Skip to content

Add RSVP speech scoring and failure safeguards - #131

Merged
sajjad-mazaheri merged 1 commit into
mainfrom
feature/rsvp-speech-phase4
Aug 25, 2026
Merged

Add RSVP speech scoring and failure safeguards#131
sajjad-mazaheri merged 1 commit into
mainfrom
feature/rsvp-speech-phase4

Conversation

@sajjad-mazaheri

Copy link
Copy Markdown
Contributor

Summary

  • Add RSVP speech transcript scoring and target position alignment.
  • Normalize multilingual speech responses before scoring.
  • Mark technical speech failures as invalid instead of incorrect.
  • Preserve existing matrix and experimenter-scoring modes.

Testing

  • TypeScript check passed.
  • RSVP speech scoring, normalization, alignment, runtime, and validity tests passed.

Copilot AI lite review requested due to automatic review settings August 25, 2026 21:41
@sajjad-mazaheri
sajjad-mazaheri merged commit b38628b into main Aug 25, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds position-aware scoring for RSVP automatic speech responses, including multilingual transcript normalization and token-to-target alignment, and introduces safeguards so technical speech failures are treated as invalid (not incorrectly scored) while preserving existing non-speech modes.

Changes:

  • Add Unicode- and language-profile-based speech transcript normalization (English/Persian/Arabic) and deterministic token alignment.
  • Implement RSVP speech scoring with policy controls (word order, repetition, self-correction) and rich diagnostics.
  • Add runtime lifecycle safeguards (cleanup on skip/failure, provider language mapping from condition language) and trial validity gating for QUEST consumption.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
threshold.js Updates RSVP-reading block instructions and records/acts on RSVP speech preparation success.
components/trialRoutines.js Uses RSVP speech validity rules to decide QUEST validity and whether to consume target word sets.
components/rsvpReading.js Closes active RSVP speech resources when skipping due to bad tracking.
components/instructions.js Adds instruction text helpers for automatic speech RSVP reading.
components/rsvpSpeech/rsvpSpeechRuntime.ts Renames language mapping to condition language; adds close-tracking to avoid controller lifecycle races; improves cleanup on failures.
components/rsvpSpeech/rsvpSpeechValidity.ts Introduces explicit validity/consumption rules for automatic speech trials (pre/post exposure failures, missing registrations).
components/rsvpSpeech/rsvpSpeechScoring.ts Adds RSVP speech scoring pipeline (normalize → align → classify → score) with diagnostics and policy enforcement.
components/speech/textNormalization.ts Implements language profiles and Unicode-aware normalization/tokenization with join-control handling.
components/speech/tokenAlignment.ts Implements monotonic, position-aware alignment with special handling for Persian join/split patterns and diagnostics.
tests/tokenAlignment.test.ts Adds alignment behavior tests (ordering, duplicates, Persian join/split, merged tokens).
tests/textNormalization.test.ts Adds normalization/tokenization tests across English/Persian/Arabic scripts and punctuation cases.
tests/rsvpSpeechScoring.test.ts Adds scoring/policy tests and multilingual edge cases, including Persian-specific behavior.
tests/rsvpSpeechValidity.test.ts Adds validity matrix tests for runtime failure states vs QUEST consumption.
tests/rsvpSpeechRuntime.test.ts Updates runtime tests for renamed language resolver and adds lifecycle/cleanup tests.
tests/lifetime.test.ts Updates global mocks to include RSVP speech runtime state.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread threshold.js
Comment on lines +4629 to +4645
let rsvpReadingBlockInstructs =
initialInstructions +
(automaticSpeechOnly
? instructionsText.rsvpReadingAutomaticSpeechBegin(
L,
responseType.current,
totalTrials,
)
: instructionsText.initialByThresholdParameter["timing"](
L,
responseType.current,
totalTrials,
));
if (automaticSpeechModes.length > 0 && !automaticSpeechOnly) {
rsvpReadingBlockInstructs +=
instructionsText.rsvpReadingAutomaticSpeechResponse(L);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants