Skip to content

fix(source-control): gate and credit babysit merges by rung, not work class - #12866

Merged
kyle-sexton merged 10 commits into
mainfrom
fix/12748-rung-without-work-class
Nov 3, 2026
Merged

kyle-sexton merged 10 commits into
mainfrom
fix/12748-rung-without-work-class

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Closes #12748

Summary

Problem: the babysit loop's merge eligibility and its promotion evidence still read the work-class label, which #9668 retired as a gate. Intent: "work class gates nothing" (owner decision Q85).

Eligibility now reads only the rung and promotion state. The merge gate writes the rung it enqueued under into the merge pin, and the promotion-evidence publisher credits each merge to that rung's cells.

Fix

  • babysit_merge.py / babysit_postmerge.py: the pin's first line is <!-- babysit-merge-pin sha=<40-hex> rung=C2|C3 -->. The reader still accepts the older shape without a rung, and eligibility() no longer reads a work class. Untrusted provenance is still refused.
  • .github/scripts/pr-merge/enable-auto-merge.mjs: the pr-merge lane's pin writes the lane room's rung, and PIN_RE accepts both shapes.
  • publish-promotion-evidence.mjs:
    • An autonomous merge counts toward the cells of the rung its pin names.
    • A merge with no rung (no pin, the old pin shape, or a pin at another head) earns no credit, and its contrary events land on every cell.
    • C3-ai-review-blocking takes its positive evidence from rung-C3 merges only; a human-confirmed missed-blocking finding counts against it on rung-C3 and human merges. Positive evidence is no easier to earn than before.
    • A native pr-merge arm is credited by the lane identity's unedited pin at the merged head, under the same checks as an enqueue.
    • Linked issues and labels are no longer read. The output key unclassedAutonomous is renamed noRungAutonomous; nothing outside the script and its test reads it.
  • Docs: the loop-lane contract goes to 16.0.0 (major, because the merge-authority ladder in §1 changed). work-classes and the babysit references describe partition and credit by rung; the work-items label docs already say so on main (docs(work-items): stop saying a merge partition reads the work-class label #12823).
  • Effect: nothing becomes mergeable that was not before. C3-auto-merge still earns only from merges made at C3, so under local-babysit alone C3 promotes once a person raises the tracked rung to C3 for the pr-merge lane. C2 keeps its meaning.

Verification

  • babysit-prs Python suite: 4035 ran, OK (16 skipped). engine.test.sh: 12 checks PASS.
  • Node: publish-promotion-evidence 84/84, enable-auto-merge 208/208, other pr-merge suites 298/298, resolve-promotion-evidence 45/45, lane-snapshot 15/15. telemetry-upsert 108/108.
  • The new pin, eligibility, publisher and enable-auto-merge tests failed before the code change and pass after it. markdownlint on the changed docs: 0 issues. Changelog fragments: 6 valid.
  • Left out: a live run of the publisher against the repository's merge history, which CI's lane covers after merge.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 3 commits November 3, 2026 11:16
The babysit loop's rung partition stops reading the close-linked item's
work-class label: a PR is eligible at a rung once that rung's promotion
cells are promoted (the merge gate's RUNG_CELLS), and an item with no
class is treated like any other. The untrusted-provenance hold, the C5
fork and trust tests and the other withholdings stay.

The unattended merge pin now names the effective rung it enqueued under
(<!-- babysit-merge-pin sha=<sha> rung=C2|C3 -->); the read-back accepts
both shapes. The promotion-evidence publisher credits each autonomous
merge to the cells of that rung and reads no class label. A merge with no
rung earns no credit and its contrary events count against every cell.

Docs: cycle-shape step 3, SKILL, config-resolution, the promotion-evidence
references, the loop-lane contract (16.0.0), the repo loop profile, and the
work-items and autonomy passages that said a merge partition reads the
label.

Closes #12748

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he pr-merge rung

C3-ai-review-blocking measures the AI review, not merge authority, so its
population is every merge under rung C3 plus every human merge; autonomous
C2 and no-rung merges stay out. Its missed-blocking term now matches where
a human merge's finding is emitted.

The pr-merge lane's native-arm pin names the lane room's rung (C2 or C3) and
recognizes a pin of either shape, so its merges earn credit.

Refs #12748

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 3, 2026 16:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T16:28:57.054620Z 10aeb81 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 10aeb81f7d

ℹ️ 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".

kyle-sexton and others added 3 commits November 3, 2026 11:42
…-loop SKILL.md at 500 lines

Co-Authored-By: Claude Opus 5.5 <[email protected]>
pinned() reused the newest pin at the head whatever rung it named, so a
re-arm after the rung changed kept the old rung, and the promotion-evidence
publisher credited the merge to it. It now matches the head and the rung.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 4ca2c68cbb4ab2f1c76ef3f93f254ae80bd7e6c9: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Security review: incremental change f3888ed..4ca2c68

I found no security issues in this change. I read every hunk of all 5 files in .claude-lane/incremental-files.txt, using .claude-lane/incremental.diff. None of the 5 matches a trusted path. No CRITICAL candidate came up, so no refute pass was needed.

critical-findings: 0

What I checked

The C3-ai-review-blocking population is narrower now (publish-promotion-evidence.mjs).

  • Before: one predicate, aiReviewCounted (!r.autonomous || r.rung === "C3"), fed both the cell's positive terms (the advisory-review count and the window) and its missed-blocking term.
  • Now: two predicates.
    • aiReviewCredited (r.autonomous && r.rung === "C3") feeds the advisory-review count, the window, and the aiReviewed lookup (L786, L854-L857).
    • aiReviewMissCounted keeps the earlier, wider population, but only for the term that counts against the cell (L888).
  • Effect: a human merge can now only count against the cell, never toward promoting it. Positive credit still depends on the rung named in an unedited pin from a --lane-login identity, and no pull request or comment author can supply that pin (unchanged since the last review). This is strictly harder to earn than at f3888ed, which my previous review had called a wider population without finding a security impact. Nothing becomes promotable or mergeable that was not before, and no token, secret, trusted actor or billed resource is touched.

Tests, docs and changelog. The test changes in publish-promotion-evidence.test.mjs assert the narrower credit: a value of 1, a zero-day window, and a human-merge miss that fails the term. The two babysit-loop reference docs and the changelog fragment describe the same behaviour as the code. They delete or soften no standing instruction, so the instruction-surface lens had nothing to check.

Settled and prior items. The one settled thread (enable-auto-merge.mjs) is outside this incremental scope and stays settled. My only prior post is a summary with no line anchor, and nothing in it is repeated here.

Embedded text. The PR context and the settled-threads file contain no directives aimed at this lane.

Spend. None. The aiReviewed lookup now runs over fewer merges, so the publisher makes slightly fewer GitHub API calls.

check-changed-skills fails at 500 lines; fold one gotcha bullet to two
lines.

Refs #12748

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 4ca2c68cbb4ab2f1c76ef3f93f254ae80bd7e6c9: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Code review: #12866, incremental f3888ed2..4ca2c68c

I read every hunk of all 5 files in .claude-lane/incremental.diff. For context I also read the head version of publish-promotion-evidence.mjs (lines 84-103 and 765-891: the event comments, missed-blocking collection, windowOf, report) and the changed tests.

No findings.

What changed

C3-ai-review-blocking used to have one population: every merge under rung C3 plus every human merge. It now has two:

  • Positive evidence comes from autonomous rung-C3 merges only (aiReviewCredited). This covers the "advisory AI reviews on C3" count and the cell window (publish-promotion-evidence.mjs#L854, #L884-L889).
  • The missed-blocking term still counts misses on rung-C3 merges and human merges (aiReviewMissCounted, the same predicate as the old aiReviewCounted).

Checked and correct

  • No predicate left behind. aiReviewCounted has no remaining callers.
  • The review fetch matches the population that is credited. aiReviewed is now fetched only for credited merges (#L786), and reviewed is drawn only from c3. This also saves API calls on human merges.
  • C3-auto-merge is unchanged. c3 is the same set as before (rung === "C3" && autonomous).
  • Positive evidence is harder to earn, never easier. This matches the PR description ("Positive evidence is no easier to earn than before") and the rejected-options reasoning on feat(source-control): decide whether the babysit loop's rung partition still reads work class after Q85 #12748.
  • Emitted events are unchanged. The verification-divergence routing at #L781 still sends a human merge's miss to C3-ai-review-blocking. The header comment at L91-L95 still describes it correctly.
  • Tests:
    • The mixed-population test asserts that only the rung-C3 merge's review counts and that the window is that one merge.
    • The human-merge miss test now also asserts the term fails.
    • I did not run either; the PR's test counts are the author's claim and unverified.
  • Docs match the code. The header comment, promotion-evidence-bootstrap.md, promotion-evidence-resolution.md and the changelog fragment all state the same split.

Closing issue #12748

Nothing in this push changes the criteria outcomes the whole-PR review at f3888ed2 recorded. The publisher still picks a merge's cells from its rung, not from a work-class label.

Settled and prior

  • The settled thread on enable-auto-merge.mjs (pinned() rung refresh) is outside this push and stays settled.
  • The prior whole-PR comment had no findings, so nothing is repeated.

No spend or cost changes.

@kyle-sexton

Copy link
Copy Markdown
Member Author
# Finding (claude-review, comment 6609973860, restated on 44e3eb9) Classification Evidence
1 Native pr-merge arms never earn their rung VALID (fix now) publish-promotion-evidence.mjs rungOf returns rung: null for native before reading any pin, and autonomousOf marks most pr-merge lane merges native, so the rung pin enable-auto-merge.mjs posts is never read.

Fix in progress: a native merge reads the lanes identity's newest unedited pin at the merged head under the identity path's trust rules. No pin, or an old-shape, edited, wrong-head or foreign pin, stays no-rung. Commit follows.

kyle-sexton and others added 2 commits November 3, 2026 12:11
…ge lane posts

The publisher returned no rung for a native auto-merge before reading its
pin, but the pr-merge lane arms natively and posts a rung pin for exactly
those merges. Read the pin for them the same way as for an identity
enqueue: the lane identity's newest unedited pin at the merged head names
the rung. A native merge with no such pin stays no-rung and still owes no
pin read-back.

Refs #12748

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton

Copy link
Copy Markdown
Member Author

Fixed in f3888ed: rungOf no longer short-circuits native merges; a native pr-merge arm is credited by the lanes identity's newest unedited pin at the merged head (rung=C2|C3). New publisher test covers C2 and C3 pins crediting, and no pin, old shape, edited, wrong head and foreign author staying no-rung; it failed before the fix. Header, resolution and bootstrap docs updated.

@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 3, 2026
C3-ai-review-blocking's advisory-review count and window come from
autonomous rung-C3 merges only, so a human merge no longer makes the cell
easier to earn. Its missed-blocking term still counts confirmed misses on
rung-C3 merges and human merges, so a human merge can only count against
it. The population helper is split in two, one name per population.

Refs #12748

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 3, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 475328d Nov 3, 2026
104 of 106 checks passed
@kyle-sexton
kyle-sexton deleted the fix/12748-rung-without-work-class branch November 3, 2026 17:49
@kyle-sexton

Copy link
Copy Markdown
Member Author

Correction to the description. "Nothing becomes mergeable that was not before" holds for the promotion-evidence changes only. Eligibility no longer reads work class, so once C2-auto-merge is effective-promoted, the c2-mechanical rung admits an unlabeled or structural item, not only work-class: mechanical ones (test_each_rung_admits_a_class_less_or_structural_item_and_holds_untrusted). That is the owner decision Q85 ("work class gates nothing") that #12748 implements. Untrusted-provenance items stay ineligible at every rung, and --merge human-only on the lane launch lines still keeps every merge off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(source-control): decide whether the babysit loop's rung partition still reads work class after Q85

1 participant