Repository navigation
id: kitty keyboard Slice D — cross-language parity oracle (#787) - #12926
Merged
Merged
Conversation
The shared kitty-disambiguate-v1 corpus (doc/kitty-disambiguate-v1-fixtures.json) now carries a `browser` field on its 24 browser-encodable cases: the browser key event for the same keystroke and the exact bytes the Slice C rich encoder must emit (its canonical form where the fixture's terminal input is an alternate form the decoder also accepts). - scripts/key-parity-generate.py generates one Roc `expect` per corpus case into a scratch copy of examples/roc-world/Key.roc — terminal bytes and browser bytes alike decode through the ACTUAL compiled `Key.parse_events`, never a re-implemented decoder. Comparison goes through a projection that zeroes the per-event `source` (the byte form that produced the event); parity is key + modifiers + kind, plus EventUnknown payloads. - scripts/key-parity-test.sh runs that generated copy under the pinned `roc test`, fails loudly when roc/python3/the corpus/Key.roc are missing, and refuses a shrunk corpus (<40 terminal or <20 browser cases) — the oracle never silently skips or weakens. Wired into scripts/roc-test.sh. - web/src/world-keyboard.parity.test.ts is the web twin: it pins richTerminalBytesForKey to the corpus bytes for every browser case and guards corpus completeness. Verification (laptop, nix develop, worktree off origin/main): - roc test on the generated copy: 123/123 (59 original Key expects + 64 generated parity expects). - Negative controls: a mutated corpus expectation fails the Roc run (2 failed); a 10-case corpus is refused by the generator (exit 1). - vitest: world-keyboard.parity 25/25 + world-keyboard 22/22; tsc --noEmit clean; biome clean; shellcheck + shfmt clean. Refs #787 — Slice D only. The issue stays open: Slices E/F remain, gated on F13.4 detection (#786).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #787 — Slice D only (cross-language parity oracle). This PR does not close #787: Slices E/F remain, gated on F13.4 detection (#786).
What
Per design
doc/2026-11-01_design_id787.md§6 row D:doc/kitty-disambiguate-v1-fixtures.json): 24 of the 40 cases gain abrowserfield — the browser key event for the same keystroke plus the exact bytes the Slice C rich encoder must emit (the encoder's canonical form where the fixture's terminal input is an alternate form, e.g. F1 tilde vs letter).pkgs/id/scripts/key-parity-generate.py+key-parity-test.sh): generates oneexpectper case into a scratch copy ofexamples/roc-world/Key.rocand runs the pinnedroc test— terminal bytes and browser bytes both decode through the actual compiledKey.parse_events, never a re-implemented decoder. Comparison zeroes the per-eventsource(which byte form produced the event); parity = key + modifiers + kind, plusEventUnknownpayloads. Missing roc/python3/corpus/Key.roc fails loudly; a shrunk corpus (<40 terminal / <20 browser cases) is refused — no silent skips, no weakened oracle. Wired intoscripts/roc-test.sh.pkgs/id/web/src/world-keyboard.parity.test.ts): pinsrichTerminalBytesForKeyto the corpus bytes for every browser case and guards corpus completeness (same pattern as the screen-parity twin).Verification (laptop,
nix develop, worktree off origin/main)scripts/roc-test.sh: RocJson 29, Screen 15, Key 59, key-parity 123, roc-cap-demo — all passed in sequence (the final pre-existing roc-import-policy cargo section was still compiling under load at merge time; this diff touches none of its inputs).tsc --noEmitclean; biome clean; shellcheck + shfmt clean.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.