Repository navigation
feat(claimant): binding-aware intervention accounting in nudges (#1656 AC4) - #12859
Merged
Merged
Conversation
…AC4) nudge-state.json now carries cumulative per-class intervention counts alongside the episodes: queue (nudges + escalations on queue-bound sessions) separate from other (unbound sessions, observed only). Only applied actuations count - a failed send and an unnoted escalation are not interventions. Queue-class interventions are capped per round at MAX_QUEUE_INTERVENTIONS_PER_ROUND (10). Planned interventions past the cap are overflow: reported in the round record and deferred, never dropped - the episode state carries untouched so the intervention re-plans next round. The cap considers queue interventions least-served first (lowest nudges_sent, then session id), so a session deferred by one burst is served before the sessions that consumed budget ahead of it. The nudge-step record gains `interventions` (this round per class + cumulative) and `overflow`, in live and shadow modes; shadow still mutates nothing. State files written before the counts existed read as zeros. Tests: TestInterventionAccounting (5 tests) in test_nudges.py - class separation + persistence, failed-send-not-counted, accumulation across rounds and episode close, burst overflow deferral with least-served-first service next round, shadow reporting without writes. Negative control: all 5 fail against origin/main's nudges.py. Full hermetic suite: 208 tests OK. Refs #1656 (AC4). AC2 (retry/failover for error-stopped queue sessions) remains open on the issue.
4 tasks
|
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 30 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. |
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.
Slice: #1656 AC4 — keeper state separates queue-session interventions
AC4: "Keeper state separates queue-session interventions from Jules/OpenChamber ones." Scope text: queue-session interventions are counted separately in the keeper state file so a burst of queue-session failures cannot silently consume the whole run's intervention budget; overflow is reported, not dropped.
In the current stack the interventions are
nudges.py's actuations over babysitter verdicts (the keeper/babysitter pair was re-scoped to this conductor-side stack on 2026-11-13).nudge-state.jsonheld only per-episode state — no aggregate counts, no budget separation.What lands
nudge-state.jsongains a top-levelcounts:queue {nudges, escalations}for interventions on queue-bound sessions,other {observed}for unbound sessions (observed only, never driven). Counts accumulate across rounds and episode churn; a pre-counts state file reads as zeros — history the file does not carry is never invented.MAX_QUEUE_INTERVENTIONS_PER_ROUND = 10per round. Planned interventions past the cap land in the round record'soverflow(withdetail: over_queue_cap) and are deferred — episode state carries untouched, so they re-plan next round. The cap considers interventions least-served first (lowestnudges_sent, then session id), so a deferred session is served before the sessions that consumed budget ahead of it: overflow defers, it never starves.interventions(this round per class + cumulative) andoverflow, in live and shadow modes alike; shadow still mutates nothing.Verification
TestInterventionAccounting(5 tests): class separation + persistence, failed-send-not-counted, accumulation across rounds and episode close, burst overflow deferral with least-served-first service next round, shadow reporting without writes.origin/main's nudges.py.run_hermetic_tests.py): 208 tests OK (includes the 43 nudges+babysitter tests).Remaining on #1656
AC1 substrate landed 2026-11-22 (#12687/#12688/#12689); AC3 superseded by Drew's 2026-11-12 ruling. AC2 (an error-stopped queue session receives the standard retry/failover treatment, logged with its binding) is the remaining slice — the issue stays open for it.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.