Skip to content

feat(validator): add the dynamic and static pairing-code suites - #165

Merged
chrisuthe merged 1 commit into
Sendspin:mainfrom
chrisuthe:chrisuthe/task/add-dynamic-and-static-pairing-code-scenarios-to
Oct 15, 2026
Merged

chrisuthe merged 1 commit into
Sendspin:mainfrom
chrisuthe:chrisuthe/task/add-dynamic-and-static-pairing-code-scenarios-to

Conversation

@chrisuthe

Copy link
Copy Markdown
Member

Phase 2b of sendspin-validate (Sendspin/backlog#84): P2 dynamic code (digits and qr_code), P3 static code, and P4 cancel and timeout, all under --suite pairing. A method the client does not advertise reports N/A. The timeout step and the 5-failure static lockout run only when the user opts in at their prompt.

No aiosendspin patch was needed. Pairing runs through the bundled SDK's public initiate_pairing / end_pairing. Changing server/hello.languages mid-session has no public API, so the spoken-language check uses a random non-English language set when the server is built (picked by the run seed, which the CLI now draws before the session) instead of repeating the step with a changed one.

Also:

  • Redacted secret fields keep their length (<redacted:N>), so the CPace field lengths are judged from frames.
  • Every entered code is registered as a secret before it is used; the self-test leak check now covers codes.
  • --auto-answer reads a secret it cannot know from stdin, which replaces --auto-answer-token.
  • A question cancelled mid-read hands its stdin read to the next question instead of eating its answer.

Tests: check unit tests over hand-built frames (pass and fail), including the pairing.md:165-169 QR vector and a guard that every vendored post-confirm failure reason maps to a verification stage. The self-test pairs the bundled client by the dynamic code (both formats, with speaker) and by the static code, in both directions, with zero FAIL or TOOL_ERROR. A client that never answers a wrong code fails. python -m unittest discover -s tests: 522 OK; vendor_aiosendspin.py --check passes.

Manual run against sendspin-cpp-cli main@7501898, both code methods, driven by a script that typed the code the CLI logs and ran pair confirm as the window gesture: 0 FAIL and 0 TOOL_ERROR, including the lockout and the real 2-minute timeout. One WARN against the CLI: it logs the dynamic code ungrouped (211030), where pairing.md:242 says it should show 211-030.

Known limits: P4 runs once, on the client's code method; declining an opt-in step is reported SKIPPED; an English-only speaking device gets a WARN on the language check.

Walk a client through each pairing-code method its client/hello offers,
in the pairing suite: P2 in the qr_code format before P1, then P2 in the
digits format or P3, then P4. A method the client does not offer reports
its checks N/A.

P2 enters the code the user reads from the app, then a wrong one, and
expects client/pair-retry or pair/abort pairing_code_mismatch before the
right code completes the pairing. P3 activates with the pairing window
closed and expects client/pair-pending. P4 cancels an attempt; its idle
timeout, and P3's five-failure lockout, run only when the user opts in at
their prompt. Machine checks cover commit_B, pairing_index, CPace field
lengths and the server's verification order; human checks cover how the
code is shown and spoken, under PAIR-DYN-*, PAIR-STATIC-* and PAIR-CTL-*.

Pairing runs through the bundled SDK's initiate_pairing and end_pairing,
so no new aiosendspin patch is needed. The server names a non-English
language in server/hello, picked by the run seed, which the CLI now draws
before the session. Redacted secret fields keep their length, so the
field lengths stay judgeable, and every entered code is registered as a
secret before it is used. --auto-answer reads a secret it cannot know from
stdin, which replaces --auto-answer-token.

The self-test pairs the bundled client by both code methods in both
directions, and shows that a client never answering a wrong code fails.
@chrisuthe
chrisuthe marked this pull request as ready for review October 15, 2026 12:33
@chrisuthe
chrisuthe merged commit fa6dc45 into Sendspin:main Oct 15, 2026
1 check passed
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.

1 participant