Repository navigation
feat(observability): reason enums, label AST check, batch-stage env ratchet (lane 14 M1) - #22422
Merged
Merged
Conversation
…v ratchet (lane 14 M1) Contract (e): utils/observability/reasons.py with ReasonFamily, per-family enums, reason_label() and omi_reason_unknown_total. live_reason and recovery_disposition now derive their frozensets from the enums (behaviour-neutral; misses are also counted). Adds the shrink-only label-argument AST check and the batch-stage env-read ratchet. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…nums (lane 14) Values unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…sons.py) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ebt list for workers/consumer.py recovery_disposition.py is reverted to integration's version (freeze table); re-add the enum-derived constants after #22368 lands. REASON_UNKNOWN_TOTAL keeps the stub's name and both counters are pre-initialised per family. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Git-on-my-level
added a commit
that referenced
this pull request
Oct 19, 2026
…importers land The lane-1 stubs (#22420) are imported only by tests and by lanes' in-flight PRs. Whether they pass the backend dead-code ratchet depended on incidental docstring mentions, so a lane that rewrote reasons.py (#22422) made utils/rollout/runtime_percent.py dead and every lane push failed. Allowlist all seven stub files explicitly. Each reason carries an expiry: delete at the M3 merge. Data allowlist only; no workflow change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Git-on-my-level
added a commit
that referenced
this pull request
Oct 19, 2026
… ratchets (#22437) Lead rulings 10-19 ~07Z (lane 9 question), contracts (a)/(b) amended in the KB: - run_push maps a not-due claim_key (Outcome.DEFERRED, row already re-armed and woken by the outbox) to 200 {"status":"deferred","reason":"not_due"}; DISCARDED maps to 200 superseded. - Result.available_at is required for RETRY and for a DEFERRED returned by process(); a deferring consumer without it raises before any row write. - Outbox gains wake(row_id, wake_token), idempotent on the pair, for transactional enqueuers after commit; enqueue without tx, defer, and not-due claim_key create the wake themselves. Test selection: changed backend Python selects test_reason_label_enums.py, and batch/enrichment/ workers/outbox modules select test_batch_stage_env_ratchet.py (lane 14, #22422), so a PR adding a violation fails in its own CI. The lane-1 stub modules map to their own tests. Co-authored-by: Claude Opus 5.5 <[email protected]>
…per) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…esh ratchet baselines Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… both counters Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Git-on-my-level
added a commit
that referenced
this pull request
Oct 19, 2026
…ce on integration #22446 (main) allowed the reason-ratio alert to land before its producers, with a test that fails once a producer is declared. The lane-1 stub (#22420) already declares omi_reason_unknown_total, so after the #22388 sync every integration PR failed test_pending_backend_alert_metric_allowances_expire_when_the_producer_lands. Keep only omi_reason_total pending; lane 14 (#22422) removes it when it lands the denominator. Verified: pytest tests/unit/test_monitoring_alert_rule_contract.py, 60 passed (unit). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…allowances left) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…App-Version (lane 14) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…kReason (#21932 landed) Adds the nine reasons #21932 introduced; set unchanged (65 values). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ist_reads Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… and WorkerValidationReason (values unchanged) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ve to main; lane 14 is backend-only) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…elog fragment Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Git-on-my-level
marked this pull request as ready for review
October 19, 2026 15:20
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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…nnot break session start Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
ZhaZhaBei
pushed a commit
to ZhaZhaBei/omi
that referenced
this pull request
Oct 22, 2026
…BasedHardware#22513 x BasedHardware#22422) BasedHardware#22513 added CAP_HOLD_RESERVATIONS_RELEASED.labels(outcome=outcome) and BasedHardware#22422's contract (e) label ratchet landed after it, so test_reason_label_enums fails on the integration tip and in every lane PR. Route the value through a _bounded_outcome() helper that folds non-members of OUTCOMES to 'unknown'. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Summary
Lane 14 M1: closed reason enums with
reason_label()(unknown counted inomi_reason_unknown_total, denominatoromi_reason_total), live-STT / worker-validation / recovery-failure constants derived from the enums (label values unchanged), a shrink-only AST check that.labels(reason|outcome|provider|retry_class=)take closed vocabularies, the batch-stage env-read ratchet, andapp_buildonomi_listen_accepted_total(from X-App-Version through the existingsanitize_app_buildcap).Lane / contract
Lane 14, contracts (e) and (c) invariant 3. Sign-off for the one-line edit in
routers/listen/runtime.py: lead, after #22397 (325b7e3) merged to main.Product invariants affected
Verification
Targeted: reason-label, env-ratchet, monitoring-alert-contract, listen app_build / instrumentation / bootstrap, serving, live-health reconciliation, validation-disposition. Pre-push gate passed. Not run locally: the full suite (GitHub CI).
Rollback
Revert the PR; only counters and constants change, no label value changes.
app_buildfalls back tounknownif the header is absent or malformed.Failure-Class: none
UI-Evidence: none -- no UI source in this PR (backend counters/tests only); UI paths in the diff vs main come from merged integration/main
Line-Count-Exception: backend/routers/sync.py | 3820 -> 3857 | not touched by this PR; growth is integration-carried (gate diffs vs main)