Skip to content

feat(source-control): trust own-agent filings admission admits in the merge gate - #17093

Merged
kyle-sexton merged 5 commits into
mainfrom
feat/merge-gate-trusts-admitted-own-agent
Nov 18, 2026
Merged

kyle-sexton merged 5 commits into
mainfrom
feat/merge-gate-trusts-admitted-own-agent

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

No related issue: no commit on this branch names a work item; the change carries out the merge-gate consequence ADR 0111 recorded.

Summary

The merge gate read every lanes App filing as an untrusted spec, so a pull request built from an own-agent filing waited for a person even after intake admission admitted it. The gate now trusts a linked issue that meets admission's own-agent rule, so such a pull request can merge with no person.

Fix

babysit_verify_evidence.py adds an own-agent branch to the trusted-spec check. A linked issue counts only when all of these hold, each read live at judgment:

  • An identity on the own-agents list in the default branch's admission rules wrote it. github-actions[bot] never counts, even when the list names it.
  • No other account last edited its body, and it does not open with a size-split child marker.
  • It carries exactly one well-formed source: <producer> label.
  • Its Size field holds small or medium, and the newest setter of that field is a listed human or the lanes App.
  • No run's patch stopped over the scan job's size cap (scan-refused-patch) since a listed human last added agent-ready.

A filing short of any condition reads verify:untrusted-spec, so a label or Size change after a pass sends the pull request to a person. A failed read reads verify:unreadable.

The predicates are mirrored in Python because the gate runs no node. The pr-pipeline convention, ADR 0111's Consequences bullet and both changelog fragments describe the new rule.

Verification

  • Ran the gate's own Reader methods read-only against live issue perf\(harness-ops\): reduce plugins sync's remaining wall clock and digest size - part 4 of 4 #12544 with a maintainer's gh login: the admission rules, the issue query, the Size field values and field events, and the comment and event listings all returned the shapes the gate parses, and its Size read returned small. That login is not the CI token, so this proves the query shapes and not the CI token's permission.
  • No issue yet carries a source: label, so no live filing has passed the whole rule. The passing path is covered by the stubbed tests only.
  • The CI Status job's GITHUB_TOKEN has no issues scope. The REST reads of the issue's field values, comments and events each answered 200 with no authentication on this public repository. The GraphQL field-event read under that token is not proven; if it fails, the own-agent pull request reads verify:unreadable and CI Status holds it. The two pr-merge jobs that judge candidates hold issues: read.
  • verify:unreadable holds the one pull request being judged: the gate moves on to the next candidate, and a queued lanes App entry is refused by the merge queue's own CI Status read.
  • Verdicts were compared with and without the new branch while its reads failed. An issue a person filed makes none of the new reads, so its verdict does not change. An issue a bot filed that no older rule trusts reads verify:unreadable instead of verify:untrusted-spec while a new read fails, and returns to verify:untrusted-spec once the read succeeds. Both refusals hold the pull request.
  • test_babysit_own_agent_spec_trust.py is new. It covers each admission condition and runs the gate's predicates beside admit.mjs and resolve-config.mjs under node over the same inputs. It and the five changed gate test files pass locally.
  • Left out: a run of the gate under the CI token, because this pull request's own CI Status reads the verdict reader from main; the CI test lanes and both AI review lanes, because a draft skips them.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 5 commits November 18, 2026 00:45
… merge gate

The merge gate read every lanes App filing as an untrusted spec, so a pull
request built from one waited for a person even after intake admitted it.

The gate now trusts a linked issue when an identity on admission's
own-agents list wrote it, no other account edited its body, it carries
exactly one well-formed source label, and a listed human or the lanes App
sized it small or medium. The list comes from the default branch's
admission rules. The predicates are mirrored in Python, since the gate runs
no node, and a test runs them beside admit.mjs to keep the two in step.
github-actions[bot] never counts, even when the list names it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ntake

The own-agent sync test covered identities, body text and source labels but
not how the Size field's setter is chosen. It now runs resolve-config's own
event fold beside counted_size over the same event tables. The fold is lifted
from the module's source because importing the module needs ajv, which a
checkout without its npm install lacks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ch cap

Admission holds an own-agent filing for a listed human when its last run's
patch went over the scan job's size cap, but the merge gate still trusted
that filing. The gate now mirrors admit.mjs patchCapStopped: the lanes App's
scan-refused-patch stop counts until a listed human next adds agent-ready.
The parity test runs both rules over the same comments and events.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 18, 2026
@kyle-sexton

Copy link
Copy Markdown
Member Author

Held as a draft until the owner decides how the gate reads an issue's size, whether later label or size changes send the PR to a person, and how the ADR change is recorded.

@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 18, 2026
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 18, 2026 14:14
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T14:16:57.848809Z c28a863 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.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none (read lane)
Run 44322146475

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: merge gate trusts own-agent filings that intake admission admits

I read every hunk of all 11 changed files. I found nothing to block or flag.

What changed. babysit_verify_evidence.py adds an own-agent branch (_own_agent) to _trusted_spec. It sits last in the or chain, after the split-child, drift, recurring and incident rules. It is built from pure helpers that mirror admit.mjs:

  • own_agent_ids, own_agent_text, one_source_label and own_agent_filing check who wrote and edited the issue and its one source: label.
  • counted_size takes the newest setter of the Size field from the field events.
  • patch_cap_stopped checks for a scan-job patch-cap stop since a listed human last added agent-ready.

The live reads run under the Actions token and are cached once per Reader, with read times noted for run_cache. Each fails as _Unreadable.

What I checked against the code at head:

  • Identity list. own_agent_ids matches admit.mjs ownAgentIds (admit.mjs:295-298). It is stricter in two ways: it always drops github-actions[bot], and it rejects a malformed list (non-positive ids, booleans, floats) as unreadable where JavaScript would filter it.
  • Author and editor. own_agent_text matches ownAgentText (admit.mjs:300-303).
  • Source label. Python's fullmatch over [^,]* matches JavaScript's /^source: [^\s,][^,]*$/i, including a trailing newline. ASCII-only case folding is kept so U+017F does not stand in for s.
  • Labels cut short. A label list cut off at 100 (totalCount != len(nodes)) is refused, which is the safe direction.
  • Size setter. The Size-setter read reuses merge_policy.ISSUE_STATUS_QUERY, which fetches only the newest 100 field events (timelineItems(last:100)). If a Size setter has fallen out of that window, the issue reads as unsized and is refused, so this also fails safe. The ...field fragment does supply fullDatabaseId, which counted_size compares against.
  • Exceptions. _Transient and _CutShort subclass _Unreadable, so the new _issue_listing and _size reads stay inside the existing refusal path.
  • Read order. A person's issue never reaches the new reads, because the recorded author_type != "Bot" check returns first. That matches the updated split-child test expectations (rules_calls() == author["type"] == "Bot").
  • Docs. The ADR 0111 Consequences bullet, the pr-pipeline README and both changelog fragments describe the rule the code applies.

What the tests cover (I did not run them). The new test_babysit_own_agent_spec_trust.py runs the label, author/editor, identity, patch-cap and Size-setter predicates under node next to admit.mjs and resolve-config.mjs on the same inputs. It also checks each condition one at a time and asserts a failed read on each new path is unreadable. I have no shell, so the author's claim that these pass locally is unverified. So is their claim that the reads work under the CI token; the PR body itself says that is unproven for the GraphQL field-event read.

Closing issue. The PR names none ("No related issue"), so there are no acceptance criteria to check. I found no embedded directives in the PR context.

Loosened checks. The trusted-spec branch lets more PRs merge with no person. That widens a person-approval / bot-author hold, which the criterion counts as a friction hold, so it raises no finding. The security side belongs to the separate security lane. The changed rules_calls() assertions in test_babysit_split_child_trust.py still pin exact counts for the new admission-rules read. The judge(...) and graphql_calls()==0 assertions are unchanged, so nothing there accepts more. The new stubs in the drift, incident and recurring tests are fixtures. The node-gated skipUnless sits on a new test class, not on an existing one.

Path-scoped rules. I read the rules matching the changed paths (cost-claims.md, ruff-pin.md, skill-bodies-state-current-rules.md); none is broken. The standards index under docs/standards lists no paved-path entries.

Spend. The change adds up to four GitHub API reads per bot-filed linked issue that no earlier rule trusts, under the Actions token. It starts no billed charge.

Loosened-check verdict: fail (default; the prompt gave no loosened_check_verdict: line); patterns: 0

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: no findings

I read every hunk of all 11 changed files and checked the changed gate against admission's code and the merge holds that still run after it.

The change. babysit_verify_evidence.py gives the trusted-spec check one more way to pass (_own_agent). A linked issue counts as a trusted spec when an identity on admission's own-agents list filed it, intake admission's rule would admit it, and it is sized small or medium. This weakens the verify:untrusted-spec merge hold. The owner's throughput exemption does not cover a hold on an untrusted spec, so I judged it like any other merge hold.

No untrusted actor reaches it.

  • Both the identity list and the trusted-actor list are read from the default branch's tip (_default_branch_file, _read_trusted_list), so a pull request cannot add an identity for itself.
  • Author and editor: must be a Bot whose id is on the list; github-actions[bot] (ACTIONS_BOT_ID) is removed even when the list names it.
  • Labels: the full label list is required (totalCount == len(nodes)).
  • Size: the newest setter, read from timelineItems(last:100), must be a listed human or the lanes App.
  • Patch-cap stop: the stop comment counts only when its REST user.id matches the lanes App's id from the trusted list.

It is no wider than admission. own_agent_ids, own_agent_text and one_source_label match admit.mjs (L295-L305, L1375-L1395) and are slightly narrower in places: ids of 0 or below and booleans are treated as unreadable. Python string matching uses ASCII case folding only, and a test checks the whitespace class against JavaScript's.

Untrusted text is still held elsewhere. Admission's other security refusals, the provenance: untrusted label and the security: outside-actor label, are still enforced by holds this diff does not touch:

It fails closed. A malformed list, a missing Size field config, or any failed read raises _Unreadable, which holds the pull request. An issue another rule already trusts is decided before the new reads run, so its verdict does not change.

The gate does not check admission's per-producer source cap or whether admission actually admitted the issue. The cap limits throughput, not trust, and every security condition admission applies is either mirrored here or enforced by the holds above.

The documentation changes (the ADR 0111 Consequences bullet, the pr-pipeline convention and the changelog fragments) describe the new code. They remove no instruction that a mechanism no longer enforces.

The diff touches no plugin manifest, workflow, token request, trusted-actor list, kill switch or trusted-trigger check.

critical-findings: 0

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 5a17ed3 Nov 18, 2026
145 of 147 checks passed
@kyle-sexton
kyle-sexton deleted the feat/merge-gate-trusts-admitted-own-agent branch November 18, 2026 14:34
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 18, 2026
kyle-sexton added a commit that referenced this pull request Nov 18, 2026
…ed pull requests

Record #17091, #17093 and ci-workflows#1136 as landed, state that the merge
gate now trusts admitted own-agent filings, and say that no lane produces
telemetry yet because the receiver is off by default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant