Skip to content

feat(intake-triage): admit trusted upstream-drift issues by one shared rule - #16620

Merged
kyle-sexton merged 4 commits into
mainfrom
feat/14215-admit-drift-issues
Nov 16, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
feat/14215-admit-drift-issues

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

Closes #14215

Summary

An issue the upstream-drift workflow files now reaches the issue lane with no owner step when it is a trusted drift issue. This implements option (a) from the Decisions entry on #14215 dated 2026-11-16 19:2xZ (the answer to Q195). Under it, an issue is trusted only when:

  • github-actions[bot] (id 41898282) wrote it.
  • Nobody else last edited it.
  • Its title is exactly Upstream drift: <owner>/<repo>.
  • Its first body line is the hex-pin lead that scripts/upstream-drift-issues.sh writes.

One rule decides this at every author gate, and the spec is a fixed template built from the upstream id. Nothing in the spec is read from the body.

Fix

  • .github/scripts/intake-triage/admit.mjs is the rule's one home:
    • driftIssueId checks a GraphQL read and was extracted from pr-verify's driftSpec. driftShaped is the REST pre-filter. authorTrust combines them for a REST issue and returns listed, drift or null.
    • driftSpecText builds the template, with done-when items, the design-change stop, and close with Closes.
    • Criterion 9 accepts a trusted drift issue as author. Criterion 7 (trustedSpecTexts) reads the template in place of the body.
    • A drift issue is never split. Admission takes it at any Size, and a patch over the scan cap goes to a builder (PATCH_DRIFT).
    • specOf now reads title.
    • Every other criterion still reads the raw body and labels: charge words, Hold: lines, refuse labels and untrusted-provenance labels.
  • .github/scripts/maintenance-audit-lane-runs/triage-sweep.mjs: a drift-shaped github-actions[bot] issue becomes a candidate. One GraphQL read confirms its last editor before the sweep reads its comments or dispatches. Every other github-actions[bot] issue is still skipped.
  • .github/scripts/intake-triage/apply-verdict.mjs: the --check step and the write step both use authorTrust.
  • .github/scripts/work-resolve-issue/check-blockers.mjs: uses authorTrust and outputs split-child: true for a drift issue, so the lane runs it at split-child-size.
  • .github/scripts/work-resolve-issue/write-issue.mjs:
    • For a drift issue, issue.json's body is the template, marked source: "upstream-drift".
    • The filer's own body rewrite after admission does not stop the run. Its admission-record check compares only the title, because the run never reads the body.
    • An edit by anyone else still refuses with edited.
  • .github/scripts/pr-verify/resolve-pr.mjs: driftSpec uses the shared rule and template. The page-scope and Closes checks are unchanged.
  • .github/scripts/work-unblock/label-unblocked.mjs: staysParked uses authorTrust, so a drift issue that admission parked on a blocker is handed back once that blocker closes.
  • Known limit: a drift issue's body rows, which name paths and file names the upstream repository chooses, still reach intake's triage model. The ci-workflows reusable reads the body itself, so nothing in this repository can swap in driftSpecText there. That model has no tools and writes only allowlisted labels and fields, and the issue lane and pr-verify read only the template. The triage sweep's header says so.
  • refine.mjs is unchanged. For Size large I chose to keep a drift issue from ever needing a split rather than teach refine to split it. Basis: split children copy only text a listed human wrote (splitChildBody), so a split drift issue's children would be untrusted. Keeping it unsplit adds one condition in decide and one output in check-blockers.
  • .github/workflows/intake-triage.yml is unchanged. Its bot list already holds 41898282, which admits the sweep's GITHUB_TOKEN dispatch. The ci-workflows reusable gates a dispatch on its actor, not on the issue's author.
  • Docs:
    • docs/contracts/upstream-drift/README.md gets a new "Admission with no owner step" bullet. It also records the lane form of "One case goes to the owner": a lane run cannot file an issue, so it stops with design-change, and stop-routes sends that stop to a hold, which adds needs-human.
    • The contract's CHANGELOG moves to 6.4.0.
    • docs/conventions/pr-pipeline/README.md gains a paragraph on the shared rule.
    • A pr-pipeline changelog fragment (minor) is added.

How a drift issue gets in: an issue opened with a workflow GITHUB_TOKEN starts no issues run, so the hourly triage sweep's dispatch is its only way into intake.

Verification

#14215's done-when items:

  1. An owner-approved plan. The Decisions entry dated 2026-11-16 19:2xZ records it: Q195, "go w/ recommendations", option (a).

  2. A clear drift issue is admitted with no owner step. In admit.test.mjs, "a trusted upstream-drift issue from sweep to the issue lane" walks one issue through every gate:

    • selectCandidates selects it.
    • apply-verdict's checkRun returns true.
    • admit() writes agent-ready.
    • check-blockers returns proceed: true and split-child: true.

    The same issue last edited by a person stops at every gate.

  3. A drift issue needing a decision carries needs-human and is not admitted. The template tells the run to stop with design-change. stopRoute(runCode("design-change: ...")) is hold, report-outcome's hold adds needs-human, and a needs-human drift issue reads skip in decide. That is unit-level proof; no live lane run was made.

Tests added:

  • admit.test.mjs, 13 tests:
    • Accepted: an unedited drift issue, and one only the bot edited.
    • Refused for security: a body last edited by a person, an outsider or the lanes App; five wrong titles; the vendored lead, no lead, and a lead that is not the first line; another bot or a stranger with the same text; any other github-actions[bot] issue.
    • Holds: one by needs-owner-decision and one by needs-human.
    • The design-change route.
    • Size large is admitted, and a patch over the cap goes to host-run.
    • The end-to-end chain and its person-edited counterpart.
  • triage-sweep.test.mjs, 2 tests.
  • write-issue.test.mjs, 4 tests, including the filer's rewrite after admission (runs) beside a stranger's earlier edit (refused).
  • label-unblocked.test.mjs, 1 test: a parked drift issue unparks once its blocker closes, and a person-edited one stays parked.
  • resolve-pr.test.mjs: the drift spec pin is updated.

Suite results:

  • admit, apply-verdict, refine, check-blockers, write-issue, triage-sweep, resolve-pr and label-unblocked: 1934 of 1934 pass.
  • Python twin and hold-floor sync: 157 OK.
  • scripts/check-affected.sh --base origin/main --no-fetch, after merging main: 14 passed, 5 skipped over 16 changed files.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01MWmASP1SzT1TZPQp8TTQf6

…d rule

An issue the upstream-drift workflow files is trusted when
github-actions[bot] wrote it, nobody else last edited it, and its title
and first body line are the two the filer writes for a drifted hex-pin
page (owner decision on #14215, Q195 (a)). driftIssueId in admit.mjs is
that rule's one home, extracted from pr-verify's driftSpec, and
driftSpecText is the one fixed spec built from the upstream id.

- triage-sweep.mjs dispatches intake for a drift-shaped issue after a
  GraphQL read of its last editor; every other github-actions[bot]
  issue is still skipped.
- admit.mjs criterion 9 accepts a trusted drift issue as its author,
  and criterion 7 reads driftSpecText, never its body.
- write-issue.mjs writes driftSpecText as issue.json's body, with
  source upstream-drift.
- resolve-pr.mjs driftSpec uses the shared rule and template, which
  now carries done-when items and the design-change stop.

Refs: #14215

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MWmASP1SzT1TZPQp8TTQf6
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 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-16T19:43:13.756095Z 8c5a2a3 PR opened
ℹ️ 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: 8c5a2a3c15

ℹ️ 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 kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 16, 2026
@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 skipped
Commits pushed none (read lane)
Run 43941890895

Failed GitHub API calls

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

…gate

Widened scope on #14215 so a trusted upstream-drift issue reaches the
issue lane end to end with no owner step.

- admit.mjs: authorTrust answers "listed", "drift" (confirmed by one
  specOf read for a drift-shaped issue) or null. A trusted drift issue
  is never split: admission takes it at any Size, and a patch over the
  scan cap goes to a builder (PATCH_DRIFT).
- apply-verdict.mjs: the --check and the write step accept it.
- check-blockers.mjs: accepts it and outputs split-child true, so the
  lane runs it at split-child-size.
- write-issue.mjs: the filer's own body rewrite after admission does
  not stop the run, which never reads the body; the record check reads
  only the title for it. Any other editor still refuses.
- refine.mjs is unchanged: a drift issue needs no refinement or split.
- An end-to-end test walks one issue through the sweep, the verdict
  check, admission and check-blockers, and another proves the
  design-change route to a person's hold.

Refs: #14215

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MWmASP1SzT1TZPQp8TTQf6
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 16, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 1 inline finding(s) on 2f3a833bfcfd30882f40cd3a4477e53d3444852f; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread .github/scripts/intake-triage/admit.mjs Resolved
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: PR #16620, admitting trusted upstream-drift issues through one shared rule (blocking only)

This lane already reviewed an earlier head (2f3a833b), so this pass reports blocking findings only and drops advisory ones. I read every hunk of all 16 changed files in the diff. I also read the unchanged code the changed lines call:

  • write-issue.mjs: main, from the author gate through building issue.json
  • check-blockers.mjs: main, including its catch and skip paths

No blocking findings on this head.

Prior and settled points

  • staysParked advisory (earlier head). It now calls authorTrust (label-unblocked.mjs#L1040). The new test "a trusted upstream-drift issue parked on a blocker unparks once the blocker closes; a person-edited one stays" covers both cases. The thread is resolved, and its lines are unchanged since.
  • Upstream-chosen row text reaching the intake model (security lane's point). The owner settled it as VALID-defer, tracked in Keep upstream-chosen drift issue text away from the intake triage model #16635. The sweep's header comment now states the limit. Not re-raised.

What I checked

  • Shared rule. driftIssueId keeps the author, editor, lastEditedAt, title and lead checks that pr-verify's inline driftSpec used to make. driftSpec keeps its page-scope and file-scope checks unchanged.
  • Gates.
    • decide ties criterion 9 to issue.user.id === ACTIONS_BOT_ID plus driftIssueId(spec).
    • trustedSpecTexts returns driftSpecText in place of the body.
    • checkRun, run, check-blockers, write-issue and staysParked all go through authorTrust.
  • Failed GraphQL reads.
    • check-blockers: the read sits inside the existing try, so a failure skips the run and keeps agent-ready.
    • write-issue: a failed read throws.
    • apply-verdict --check: fails open on purpose, and the write step reads again.
  • write-issue edit check. bodyFree clears a body edit only when no edits are hidden and every edit since admission is github-actions[bot]'s. For a drift issue, the admission-record check compares only the title hash, and issue.json carries the template body with source: "upstream-drift".
  • Never split. A Size large drift issue is admitted. A patch over the scan cap gets PATCH_DRIFT plus host-run. check-blockers outputs split-child: true.

Closing issue #14215

  1. "The chain has run and the owner approved a plan for this route." Met: the issue's Q195 (a) Decisions entry records the owner's approval. No test applies.
  2. "A drift issue for a change needing no decision is admitted with no owner step." Met. The end-to-end test in admit.test.mjs takes one issue through selectCandidates, checkRun, admit() and check-blockers. Its person-edited counterpart stops at every gate.
  3. "A drift issue for a change needing a decision carries needs-human and is not admitted." Met at unit level only:
    • The template's design-change stop routes to hold (stopRoute).
    • A needs-human drift issue reads skip in decide.
    • The step where report-outcome's hold adds needs-human is existing behaviour that this PR does not test.
    • The author says no live lane run was made.

Other notes

  • Spend (not a hold): drift issues now draw on prepaid API or subscription usage. That covers one GraphQL read per drift candidate in the hourly sweep, intake runs and issue-lane runs.
  • Test and suite results are the author's claim. I ran nothing.
  • Embedded instructions: none found in the PR context, settled-threads or prior-findings files.

Verifier dropped 0 of 0 candidates.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-security-review: 1 inline finding(s) on 2f3a833bfcfd30882f40cd3a4477e53d3444852f; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #16620 (trusted upstream-drift issues admitted with no owner step)

Blocking only. This lane already reviewed an earlier head (2f3a833), so only CRITICAL and IMPORTANT findings are reported. I read all 16 changed files in the full diff, including the trusted paths admit.mjs and resolve-pr.mjs and the gates they feed.

What I checked on this head

  • The trust rule (driftIssueId and driftShaped in admit.mjs). An issue is trusted only when all of these hold:

    • GraphQL shows the author as the Bot with id 41898282.
    • The last editor is null or that same Bot.
    • The title fully matches ^Upstream drift: [A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$.
    • The first body line is exactly driftLead(id).
    • The REST pre-filter also requires user.id === 41898282.

    So an outsider's or another bot's issue never reaches the GraphQL read. Every author gate asks this one rule: the sweep, apply-verdict's checkRun and run, decide (criteria 7 and 9), check-blockers, write-issue, pr-verify's driftSpec, and the newly fixed staysParked in label-unblocked.mjs.

  • checkRun returns true when the read fails. This only happens for a REST issue already filed by 41898282 in drift shape. The write step reads the history again with no catch, and authorTrust throws there, so a run that cannot confirm the issue writes nothing.

  • The body never becomes spec.

    • trustedSpecTexts returns driftSpecText(id) plus comments by listed humans only.
    • write-issue.mjs writes driftSpecText as issue.json's body.
    • person_checks reads only the body's task items, and only when countedRefinement accepts the issue. That needs a body written by a listed human (admit.mjs#L1869), so a drift body's rows cannot get in that way.
    • pr-verify keeps its page-only and Closes checks.
  • Body edits after admission (readEditsSince, freeOnly, write-issue.mjs#L138). Body edits are ignored only when every one since admission is by 41898282 and no older page may be hidden. Title renames still count, and the admission record check compares the title hash. The run never reads the body, so a body rewrite by that bot changes no input to the run.

  • Other admission criteria still read the raw body and labels: charge words, Hold: lines, refuse labels and untrusted-provenance labels.

Settled point. The earlier IMPORTANT finding was that rows chosen by an upstream reach the intake triage model (triage-sweep.mjs). The owner answered it with a decision (VALID, deferred to #16635), its lines are unchanged since then, and it is not CRITICAL. It is not re-raised.

Owner friction-hold removal (not a finding, under the throughput-phase threat model): drift issues no longer need a person's approval before the issue lane. pr-verify's page-scope check and the merge gates still run after the lane.

Spend (prepaid, not a hold): drift issues now start intake and issue-lane model runs on their own, at most weekly per drifted upstream. Both draw on the prepaid API keys.

There are no plugin manifest changes, and the PR context holds no embedded instructions. The contract and doc edits match the code and remove no rule that something else does not still enforce.

I found no new CRITICAL or IMPORTANT security issues on this head.

critical-findings: 0

kyle-sexton and others added 2 commits November 16, 2026 15:16
work-unblock's staysParked judged the author with authorAdmitted, so a
trusted upstream-drift issue that admission parked on a blocker was
never handed back. It now asks the shared authorTrust, like every other
author gate.

The triage sweep's header now says plainly that a drift issue's body
rows, which name upstream-chosen paths, still reach intake's triage
model: the ci-workflows reusable reads the body itself, so no caller
change here can replace it with driftSpecText.

Refs: #14215

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MWmASP1SzT1TZPQp8TTQf6
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit 74fb327 Nov 16, 2026
109 of 112 checks passed
@kyle-sexton
kyle-sexton deleted the feat/14215-admit-drift-issues branch November 16, 2026 20:59
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 16, 2026
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.

feat(upstream-drift): admit drift issues whose change is clear without the owner

1 participant