Repository navigation
fix(OMN-20359): C16 probe scans until window end or terminal found - #4464
Conversation
_scan_terminal now reads until window end or this run's correlation-id terminal, instead of stopping when partitions reach start-captured end offsets. At window end: all partitions read to end => terminal absent (FAIL); otherwise unobserved error (SKIP). Missing terminal still fails. C16 record now carries healthy_correlation_id, threaded through to record_dict; replay files without the key read as empty string. RECORD_VERSION stays 1. Updated module docstring, scan loop comment, and tests (late_terminal, absent_terminal, correlation_id; early-return test rewritten). No change to grade_identity, grade_skip_never_pass, grade_typed_death.
There was a problem hiding this comment.
Hostile Reviewer — adversarial findings (OMN-17492)
Models succeeded: qwen3-review, gpt-oss-review
Models failed: none
New finding threads: 0
Deduped (already posted on this PR): 0
Below quorum (one model only, reported not threaded): 13
Nit-level findings suppressed: 0
The model is the FINDER, never the gate: merge is gated only by the
deterministic Hostile Review Thread Gate, which blocks while
hostile-reviewer threads are unresolved. Resolve each thread after
addressing (or rejecting, with a reply) its finding.
Below quorum: 13 finding(s) raised by one model only (OMN-18479)
These are reported and NOT dropped, but they get no thread and do not block: a single model's finding no other model reproduced is not evidence enough to stop a merge. Read them; act on them if they are right.
- [MAJOR]
scripts/ci/c16_receipt_identity_probe.py, _scan_terminal(qwen3-review) — caught_up check runs only after the wait loop exits, not per-iteration | The diff moves the caught_up computation out of the per-iteration loop body and into a single check after the loop. The loop's - [MAJOR]
scripts/ci/c16_receipt_identity_probe.py, _scan_terminal(qwen3-review) — caught_up is computed against stale end offsets captured before the scan began | The ends dict is captured once at the start of the scan (the high watermarks at that instant). After the loop, the code - [MAJOR]
scripts/ci/c16_receipt_identity_probe.py:685-698(gpt-oss-review) — _scan_terminal may return before the configured wait_seconds elapse | The function returns as soon as the caught_up condition is satisfied, without ensuring that the total wait_seconds timeout has bee - [MAJOR]
scripts/ci/c16_receipt_identity_probe.py:179-184, 433-440, 808-815(gpt-oss-review) — Schema change without versioning may break downstream consumers | Addinghealthy_correlation_idtoObservationsandRecordalters the public data contract. Existing consumers that deserialize th - [MAJOR]
scripts/ci/c16_receipt_identity_probe.py:748-756(gpt-oss-review) — Potential AttributeError when healthy run receipt is missing |observe_liveaccesseshealthy.correlation_idunconditionally when constructingObservations. If_observe_runreturns a `RunObserv - [MINOR]
scripts/ci/c16_receipt_identity_probe.py, module docstring(qwen3-review) — correlation_id written to record artifact; threat model justification is thin | The diff adds healthy_correlation_id to the Record dataclass and to record_dict, which serializes it into an uploaded ar - [MINOR]
tests/ci/test_c16_receipt_identity_probe_omn19181.py(qwen3-review) — No test for the case where the terminal is found on the first poll | The new test test_a_late_terminal_after_the_watermark_is_found_inside_the_window covers a terminal arriving in a later batch. There - [MINOR]
tests/ci/test_c16_receipt_identity_probe_omn19181.py, test_absent_terminal_is_established_only_after_the_window_ends(qwen3-review) — test_absent_terminal asserts elapsed >= 0.3, coupling test to wall-clock timing | The test asserts elapsed >= 0.3 where wait_seconds=0.3. This is a wall-clock assertion that will be flaky on heavily l - [MINOR]
scripts/ci/c16_receipt_identity_probe.py, observations_from_replay(qwen3-review) — observations_from_replay defaults healthy_correlation_id to empty string with no validation of consistency | In observations_from_replay, if the key is absent, healthy_correlation_id defaults to ''. T - [MINOR]
scripts/ci/c16_receipt_identity_probe.py, _scan_terminal(qwen3-review) — Full wait_seconds is now the minimum scan time in the absent case | As a consequence of moving the caught_up check outside the loop, the _scan_terminal function now always runs for the full wait_secon - [MINOR]
scripts/ci/c16_receipt_identity_probe.py:808-815(gpt-oss-review) — Healthy correlation ID is emitted in the public record | Thehealthy_correlation_idfield is added to theRecordoutput JSON. Although the comment states it is not a secret, exposing internal corr - [MINOR]
scripts/ci/c16_receipt_identity_probe.py:433-440, 808-815(gpt-oss-review) — Additional field increases serialization overhead | Includinghealthy_correlation_idin everyRecordadds extra bytes to the JSON payload and marginally increases memory usage during processing, w - [MINOR]
tests/ci/test_c16_receipt_identity_probe_omn19181.py:306-322(gpt-oss-review) — Time‑based test introduces flakiness on slow CI runners | The testtest_absent_terminal_is_established_only_after_the_window_endsasserts that the scan duration is at least the supplied `wait_second
✅ Hostile Reviewer — REVIEWEDCritical findings: 0
Semantics (OMN-17492 — the model finds, thread resolution gates)
Powered by omniintelligence.review_pairing.cli_review — multi-model adversarial review: qwen3-review (Qwen3.8-27B), gpt-oss-review (gpt-oss-120b) (OMN-8468/OMN-8524/OMN-17492) |
OMN-20359: C16 Receipt Identity Probe Terminal Scan and Correlation ID
Summary
This change modifies
scripts/ci/c16_receipt_identity_probe.pyto fix a race condition in terminal scanning and addshealthy_correlation_idto the C16 record._scan_terminalnow keeps reading until the window ends or this run's own correlation-id terminal is found. Catching up to the end offsets captured at scan start is no longer a stop condition.TerminalObservation, grades FAIL as before).grade_identity,grade_skip_never_pass, andgrade_typed_deathare untouched.healthy_correlation_id(the healthy run's correlation id; neither a secret nor a tenant value). This is threaded from_submitthroughobserve_live,Observations, andgradeintorecord_dict. Old replay files without the key read as an empty string.RECORD_VERSIONstays 1 (every sibling probe keeps 1; the field is additive).Red first
The following output was generated on the pre-fix source with the new tests.
Command:
uv run pytest tests/ci/test_c16_receipt_identity_probe_omn19181.py -q -k "late_terminal or absent_terminal or correlation_id"Output:
Lab proof
chain-canary-c16-receipt-identity.ymldispatched once against branchOMN-20359-c16-probe-raceat head8b758fefefdcd55053969120bdc8fd26a2c4a753(dev lane).37004933472success2026-10-02T12:08:54ZpassR-DELEG-11PASS,R-DELEG-12PASS,R-DELEG-26PASS1healthy_correlation_id:ba67a0b2-ddbd-40cf-ad46-307c3ab5113fVerification
uv run pytest tests/ci/test_c16_receipt_identity_probe_omn19181.py -q37 passedh202at8b758fefefdcd55053969120bdc8fd26a2c4a753, exit0.ruff checkandmypy --stricton the two changed files: clean.pre-commit run --all-files: clean (shellcheck installed onh202viauv toolto satisfy the shell-hygiene hook).Notes
2026-10-02T11:27:16Z(not re-verified here): run37000178114gradedR-DELEG-12FAIL while a completed terminal sat on the terminal topic after the probe's scan ended; rerun37000848440was green. The correlation-id match is not established by that record.tests/ci/test_c16_receipt_identity_probe_omn19181.pyincludes updates forlate_terminal,absent_terminal, andcorrelation_id(two tests). The early-return test was rewritten to the new contract (absent terminal still grades FAIL, and only after the window ends).Evidence-Ticket: OMN-20359
Evidence-Source: OCC#12328