Repository navigation
fix(tests): Update the origin-spec registry gate for hook-event carriers - #5384
Conversation
tests/unit/sources/test_origin_specs.py has been RED on master since 2026-09-16 (#5225, the NDJSON carrier cutover). Two assertions were stale: - `hook_event_carrier` is a production artifact rule on BOTH claude-code-session and codex-session (origin_specs.py), and neither expected set listed it. That assertion is the registry's completeness gate, so a production rule it omits makes the gate red -- which is how the omission surfaced. - `artifact_suffixes_for_provider(Provider.CLAUDE_CODE)` was asserted as an ORDERED tuple. The projection dedups with `dict.fromkeys` over `artifact_rules` declaration order, and the carrier rule is declared first, so the tuple permuted to ('.ndjson', '.json', '.jsonl'). Order is not contractual: every consumer tests membership only -- `any(name.endswith(suffix) for suffix in self.suffixes)` in sources/live/watcher.py:268,271 -- so this asserts the set and records why. Neither change touches production. The registry was right; the test was describing an older one. WHY IT SURVIVED SIX DAYS, which is the more important finding: `devtools test tests/unit/sources/test_origin_specs.py` printed `ERROR: not found: ...::test_origin_specs_cover_the_public_enum_and_admission_lifecycles`, which reads as a selection mistake, not a failure. The test existed and was failing. The harness rewrites long nodeids to `<name>[param-<digest>]`, the "rerun failed tests alone" step re-selected by the ORIGINAL id, and that lookup error replaced the assertion in console output. The real failure was only in the run's pytest-report.json: {'passed': 51, 'failed': 1}. Filed as polylogue-5coki; 8,123 of 17,054 test functions (47.6%) have nodeids over 100 characters and are eligible for the same masking. Verification (exit codes read directly, not through a filter): devtools test tests/unit/sources/test_origin_specs.py -> PASSED exit=0 receipt .cache/verify/runs/20260922T030425Z-focused-test-419040-0d9c1fbd/run.json Before: FAILED exit=1, pytest-report.json {'passed': 51, 'failed': 1, 'total': 52} Schema closure: tests/ is outside the derived-schema closure; the identity does not move and this carries no landing-order constraint. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
|
Warning Review limit reachedNext included review available in 33 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
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. Comment |
Codex Review SummaryThis 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. |
Summary
tests/unit/sources/test_origin_specs.pyhas been red on master since 2026-09-16 (#5225, the NDJSON carrier cutover). Two assertions were stale. Neither change touches production — the registry was right; the test was describing an older one.Problem
hook_event_carrieris a production artifact rule on bothclaude-code-sessionandcodex-session, and neither expected set listed it. Verified against the live registry:[adopt_manifest, agent_memory_document, agent_sidecar_meta, agent_transcript, coordinator_session_stream, hook_event_carrier, prompt_history_log, session_index, todo_snapshot, tool_result_sidecar, workflow_journal, workflow_run_snapshot][agent_memory_document, hook_event_carrier, prompt_history_log, session_index]That assertion is the registry's completeness gate, so a production rule it omits makes the gate red — which is how the omission surfaced.
artifact_suffixes_for_provider(Provider.CLAUDE_CODE)was asserted as an ordered tuple. The projection dedups withdict.fromkeysoverartifact_rulesdeclaration order, and the carrier rule is declared first, so the tuple permuted to('.ndjson', '.json', '.jsonl').I checked whether order is contractual before matching the test to the code: every consumer tests membership only —
any(name.endswith(suffix) for suffix in self.suffixes)atsources/live/watcher.py:268,271. So this asserts the set, with the reason recorded inline rather than left for the next reader to re-derive.Why it survived six days — the more important finding
That reads as a selection mistake. The test existed and was failing. The harness rewrites long nodeids to
<name>[param-<digest>]; the "rerun failed tests alone" step re-selects by the original id; that lookup error then replaces the assertion in console output. The real failure was only in the run'spytest-report.json:{'passed': 51, 'failed': 1, 'total': 52}.8,123 of 17,054 test functions (47.6%) have nodeids over 100 characters, so nearly half the suite is eligible for the same masking. Filed as
polylogue-5coki.Verification
Exit codes read directly, not through a filter.
Before the fix, the same selection was
FAILED exit=1withpytest-report.jsonshowing{'passed': 51, 'failed': 1}— the red→green pair is the twoAssertionErrors quoted above, each fixed and then re-run.Schema closure:
tests/is outside the derived-schema closure; the identity does not move and this carries no landing-order constraint relative to a rebuild.Context
The 03:00 full-corpus run at
158d1363eexited 1 with 212 failing nodeids and 25/25 static gates green (storage 54, daemon 46, cli 44, sources 12, schemas/devtools 10 each, core 9, integration/property/visual 12). This PR removes one of thesourcesfailures. The ~46tests/unit/clifailures were separately proven inherited. The rest are recorded in the shared known-red baseline and not yet attributed.🤖 Generated with Claude Code
https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy