Repository navigation
feat(autonomy): re-promote a demoted cell once its predicate is met again - #12394
Conversation
…gain
After a demotion, a promotable cell is promoted again from run evidence,
with no person ratifying it again and no write to the binding or settings.
The publisher emits {cell, event: "re-earned", at, since} when the cell's
existing report() predicate passes over only the merges after `since`, the
latest contrary event against the cell or a prerequisite, rounded up to a
whole second as the merge gate's --window-start is. `--out` carries a
published re-earn forward and still refuses to drop a contrary event.
The checker honors a re-earn for the cell itself whose `since` is at or
after every in-epoch contrary event and whose `at` is at or after `since`.
Malformed fields count for nothing, and a prerequisite's re-earn never
revives a dependent.
Refs: #11022
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A contrary event's `at` is not always when it was found (a revert's committer date, a merge time), so one published after a re-earn can be dated at or before its `since` and still leave the re-earn honored. The re-earn now carries `covers`: the count of distinct contrary events against the cell or a prerequisite at or before `since`, keyed by cell, event and parsed instant. The checker recounts the same set and honors the re-earn only when the counts match; a missing or non-integer `covers` is malformed. Also: the bootstrap doc says the publisher's --lane-login must include the merge gate's agent identity, stale "consumed by the re-earn" and "human-ratified binding update" text is gone, and a fixture shows pass 2 still lowers C3 when C2 is demoted after its own re-earn. Refs: #11022 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…covery `covers` did not hold: a contrary event found after a re-earn, dated at or before its `since`, let the next run derive the same re-earn with a larger count, and publish() replaced the old one. Each contrary event now carries `discovered`, the publish run's time rounded up to a whole second when its key first enters the file; events already published keep theirs, and `--out` refuses to change one. The re-earn window starts at the latest `at` or `discovered` of the contrary events against the cell and its prerequisites, and the checker honors a re-earn only when its `since` is at or after both for every in-epoch contrary event. A malformed `discovered` blocks every re-earn. `covers` is removed from both sides: a late event now always lands after `since`. Refs: #11022 Co-Authored-By: Claude Opus 5.5 <[email protected]>
A run whose clock is behind could stamp a new contrary event's `discovered` at or before a published re-earn's `since`. `--out` now refuses a run whose time is before the previous sidecar's generated_at, and every new stamp falls at least a second after that publish's own whole-second stamp. A published event with no `discovered`, from a file written before the field existed, counts in the publisher's window as found at the previous generated_at, the latest it can have been first published. Refs: #11022 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. |
|
claude-security-review reviewed Security review: PR #12394, re-promote a demoted cell once its predicate is met againNo security issues found. critical-findings: 0 I read every hunk of all 25 changed files. What changed
What I checked
Notes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0d9747e88
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
claude-review reviewed Code review: re-promoting a demoted cell from a
|
|
The pr-verify verifier failed head What it wrote (38 lines)This pull request leaves the merge queue, and ci-status holds it out while it carries |
|
Hold: both open threads ask for a change to the publisher's re-earn logic (a fixed discovery baseline for contrary events that predate |
…e's generated_at A contrary event from an evidence file written before `discovered` existed never gained one: collect() copied only an existing value and publish() refused to add one. The re-earn window then fell back to the latest previous publish's generated_at on every run, so a daily publisher restarted the window each day and C2's 20 completions over 14 days could never pass. The first publish over such a file now stamps each legacy contrary event with that file's generated_at, rounded up to a second, and publish() allows exactly that one change: a prior event with no `discovered`, not a re-earn, gaining legacyDiscovered(previous generated_at). Every other added, changed or removed `discovered` is still refused. knownAt no longer takes a fallback. Tests: a daily collect/publish run over 20 C2 merges spanning 19 days from a legacy file derives the re-earn with since fixed at the legacy generated_at, and a stamped `discovered` cannot be moved or dropped by a later run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Hold released: the fix for both threads (ee07d83, merged with main as 2121968) passed an independent security review with nothing blocking (suggestions filed as #12450); both threads are resolved; the body cites the spec #12434, the #11022 decision record, architecture#17 and the owner's confirmation. Merging this turns no unattended merging off: lanes and Dependabot PRs never read promotion (babysit_merge_policy.py:6538, :6590 set promoted = True), and the remaining branch (:6597) already keeps a demoted cell unpromoted until re-ratified (:5922-5925); this adds an automatic way back. Arms when pr-verify passes this head. |
Refs: #12434
Refs: #11022
Decision record: owner decision Q-DEMOTE (a), recorded on #11022 (#11022 (comment)) and in the owner-decisions record (melodic-software/architecture#17); the owner confirmed that record in their own words ("Keep it (Recommended)") on 2026-11-02.
Summary
Owner decision Q-DEMOTE (a), recorded in #12434 (#12434): the owner answered "go w/ recommended" in the hub session on 2026-11-01 at 21:4xZ, choosing "(a) Recommended: the cell re-promotes once it meets the existing promotion rule again, counted from the demotion ... No new threshold, no settings write." After a demotion, a promotable cell now re-promotes from run evidence once it meets its existing predicate again, counted from the demotion. Before this change it stayed unpromoted until a person re-ratified the binding. No new threshold, no settings or binding write, and the lane-writable refusals are unchanged.
re-earnedevent, checker honors it).sinceis at or aftermax(at, discovered)of every contrary event in the cell's epoch, own and prerequisite.discoveredstamp existed get one fixed discovery time on upgrade (that file'sgenerated_at), so their recovery window can complete.Fix
publish-promotion-evidence.mjs, operator-side, the lane cannot write its output):discovered, the publish run's time the first time it appears in the file, kept forever. A run stamps at least one second after the priorgenerated_at, and refuses when its clock is behind the prior publish.generated_atrounded up to a second.publish()allows exactly that one change (a prior contrary event with nodiscoveredgaining that value); every other changed, added or removeddiscoveredis refused, as a dropped contrary event already is.report()predicate (work-classes.md defaults) passes over only the merges aftersince, the publisher emits{cell, event: "re-earned", at, since}, wheresinceis the latestmax(at, discovered)of every contrary event against the cell and its prerequisites, rounded up to a second.check-security-binding.mjs): a bound-promoted cell with in-epoch contrary events is effective promoted only when a re-earn names that same cell,at >= since, all fields strict ISO, andsinceis at or aftermax(at, discovered)of every in-epoch contrary event, own and prerequisite. An unparsableatordiscoveredblocks every re-earn. A prerequisite's re-earn never revives a dependent, and pass 2 still lowers a dependent whose prerequisite is not promoted.--window-start(the demotion record's creation) is unchanged. A re-earn counted from that record clears it.babysit_merge_policy.py,not-read-in-pr-merge-lane), so autonomous merges keep accruing while a cell is demoted.Verification
sinceis before a later contrary event, an event discovered aftersince, malformed fields, a prerequisite-only re-earn, and a dependent whose prerequisite is demoted again.discovered, with 20 C2 merges over 19 days: the stamp stays at that file'sgenerated_aton every run and the run after the 20th merge derives the re-earn (the code before this fix derives none);discoveredcannot be moved or dropped by a later run, and no first stamp other than the file'sgenerated_atpasses;scripts/promotion-evidence-e2e.test.mjs: 36 pass, 0 fail (the real checker through the resolver with--window-start).scripts/check-affected.sh --base origin/main: 14 passed, 1 skipped, 0 failed, after merging main.sincebut found after it (fixed by the discovery rule), and a publisher clock running behind (MEDIUM). Left for later, outside this diff: epoch assignment still usesatat the ratification boundary, the evidence file carries no freshness bound, and areverted-mergeevent keyed onatcan wedge the publisher if an earlier-dated revert of the same merge appears.Related
🤖 Generated with Claude Code