Skip to content

fix(pr-unblock): bind a lane fix commit to the review threads it fixes - #10740

Merged
kyle-sexton merged 3 commits into
mainfrom
feat/lane-thread-trailer
Oct 28, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
feat/lane-thread-trailer

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #9562

Summary

Problem: address-feedback's landed check credited a lane fix commit to a review thread by path, time and a cited line, so a sibling commit that fixed a different finding in the same file could be credited and the thread resolved while its own finding stood. Intent: "bind a lane fix commit to the review threads it fixes" (issue title; the owner's 2026-10-25 decision settles who writes the trailer and what an unnamed thread does).

A lane fix commit now names the threads it fixes in Lane-Thread: <thread id> trailer lines. The reply job credits a commit to a thread only when those lines name it.

Fix

  • apply-patch.mjs (under the review-threads row's new thread-trailer key) adds one Lane-Thread line after Lane-Activity for each kept thread a VALID reply in the model job's scanned replies names. It takes ids only from the select job's kept threads, in their order, so a reply naming any other thread adds nothing. Without the replies, the row commits nothing.
  • pr-run-activity-write.yml gains patch-replies-attempt and patch-replies-sha256 inputs. Before the mint, the push job downloads the scanned replies and fails red unless their SHA-256 matches the scan job's. pr-unblock.yml passes the same leg's feedback-attempt and feedback-sha256 that the reply job reads.
  • publish-feedback.mjs requires the trailer to name each VALID thread, both in the same-round path and in earlierFixOf. A VALID thread that no trailer names ends the round feedback-not-landed. The existing path and cited-line checks stay as further conditions. The trailer format sits once in thread-scope.mjs, which the write runner already copies beside apply-patch.

Verification

  • Fail before the fix: node --test publish-feedback.test.mjs printed ℹ pass 125 ℹ fail 4, failing the same-file sibling, no-thread and subject-only cases plus an earlier same-file fix whose trailer names another thread is not credited. The new apply-patch tests, run against main's apply-patch.mjs and patch-rules.json, gave ℹ pass 150 ℹ fail 5.
  • Pass after the fix: publish-feedback.test.mjs 129/0, apply-patch.test.mjs 155/0, callers.test.mjs 197/0, merge-holds.test.mjs 52/0, every other .github/scripts/pr-unblock/*.test.mjs and .github/actions/resolve-config/*.test.mjs suite 0 failures, report-escalation.test.sh exit 0. actionlint passes on both changed workflows, and check-changelog-fragments.sh --check passes.
  • Transition: lane fix commits made before this change carry no Lane-Thread lines. A retry that relies on one therefore ends feedback-not-landed, and so does a round whose push and reply jobs straddle the merge. The owner's decision accepts both.
  • Left out: no live lane run. The change is exercised on the next address-feedback round after merge.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 3 commits October 28, 2026 15:59
apply-patch writes a Lane-Thread trailer line for each kept thread a VALID
reply in the scanned replies names, under the review-threads row's new
thread-trailer key; the push job downloads those replies before the mint
and checks them against the scan job's SHA-256. publish-feedback credits a
fix commit to a thread only when its Lane-Thread lines name it, in the
same-round path and in earlierFixOf, so a same-file sibling fix is no
longer credited to another thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 28, 2026 20:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-10-28T20:10:42.495133Z b972647 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

claude-review reviewed b972647c6c085aa6b41ce45d57258d43369fe20e: 0 finding(s), 0 as inline comments.

No findings. I read the whole diff (13 files) and the PR context. I did not run any tests, because this session has no shell. Every pass/fail count in the PR body is author-claimed and unverified by me.

Closing issue #9562: acceptance criteria

  • "A lane fix commit carries one Lane-Thread: <thread id> line for each kept thread the model job's VALID replies name, written by apply-patch; a reply naming a thread outside the select job's kept threads adds no line." Met. fixedThreadsFrom intersects the select job's kept ids (keptThreadsFrom, which filters ids through THREAD_ID) with the VALID replies' thread values. Only ids that pass that filter reach commitMessage, so no reply text enters the message. Tests cover this: fixedThreadsFrom names each kept thread… (a PRRT_9 outside the kept set is dropped), the keptThreadsFrom newline-injection id case, the commit-message test, and the main end-to-end test.
  • "The landed check, in both the same-round path and earlierFixOf, credits a commit to a thread only when the commit's trailer names that thread; a VALID thread no trailer names ends the round feedback-not-landed." Met. fixesLanded requires named.has(reply.thread) for every VALID reply. earlierFixOf skips any commit whose threadsNamed set lacks the thread. Tests cover the same-file sibling, no-thread, subject-only and CRLF cases, and the retry path with a sibling trailer.
  • "A test shows that a same-file sibling fix is not credited to another thread." Present in publish-feedback.test.mjs. It covers both the same-round and the retry path.

Workflow wiring

  • The feedback-replies-<lane>-<activity>-<attempt> artifact name in the new download step matches the read runner's upload at pr-run-activity-read.yml:2712.
  • apply-feedback-patch already lists the model jobs in needs and is gated on a non-empty feedback-attempt (pr-unblock.yml:1005-1013). The new patch-replies-* inputs therefore cannot be empty when the push runs.
  • The check step runs before the mint and fails closed on a missing file, a symlink, an oversize file, or a SHA-256 mismatch. The SHA-256 must be 64 lowercase hex characters, so an empty value fails.
  • pr-unblock.yml is the only caller of the review-threads row, so no other caller is left without the new inputs.
  • checkRow restricts thread-trailer to kept-threads rows, and push throws before any API call when the row needs replies and has none.

Trusted-path scrutiny. apply-patch.mjs, publish-feedback.mjs, thread-scope.mjs and pr-unblock.yml all match trusted paths. I found nothing that widens the trust boundary. The replies are bound by SHA-256 before use, and the trailer is built only from ids that match the select job's regex and appear in its kept set. The Lane-Thread: line format is defined once in thread-scope.mjs. The reader (threadsNamed) requires each line to start with Lane-Thread: . The commit is also gated by isLaneFix, which checks the lanes App's authorship and the Lane-Activity trailer.

Accepted behaviour, not a finding. Lane fix commits made before this change carry no Lane-Thread lines. A retry that relies on one ends feedback-not-landed. The PR body and the owner's decision on the issue both accept this.

Spend. There are no billing changes. The one extra artifact download per push job draws only on Actions minutes already in use.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed b972647c6c085aa6b41ce45d57258d43369fe20e: 0 finding(s), 0 as inline comments.

No security findings. critical-findings: 0

Scope read: the whole diff (13 files), with extra scrutiny on the trusted-path files apply-patch.mjs, publish-feedback.mjs, thread-scope.mjs, pr-unblock.yml and the patch-rules JSON/schema. No manifest items were hit (no plugin.json or marketplace.json change).

  • Merge hold is tightened, not weakened. The landed check in publish-feedback.mjs now also requires a Lane-Thread trailer naming each VALID thread, in both the same-round path and earlierFixOf. The path, time and cited-line checks remain. An unnamed VALID thread ends the round feedback-not-landed. Nothing the base stopped now passes.
  • Trailer cannot be forged by a PR or comment author. It is only honored on commits that already pass isLaneFix (lanes App author, web-flow committer, valid signature, publish-feedback.mjs:298-299). threadsNamed runs after isLaneFix in earlierFixOf, so there is no undefined commit.commit access.
  • No commit-message injection. Only ids from the select job's kept threads, each matching THREAD_ID (^PRRT_[A-Za-z0-9_-]{1,100}$, apply-patch.mjs:1017), reach the message. No reply text is copied. A multi-line id is dropped (the test covers PRRT_x\nLane-Thread: PRRT_y), and a reply naming a thread outside the kept set adds nothing.
  • Replies artifact is bound before the mint. The push job downloads the same run's scan artifact and verifies its SHA-256 against the scan job's output before the lane token is requested. It rejects a symlink, a missing file, a file over 49152 bytes, and a non-64-hex digest (pr-run-activity-write.yml:665-683). fixedThreadsFrom re-checks the file is regular and within the cap. The attempt and SHA inputs come from job outputs (pr-unblock.yml:1041-1043), not PR text. The download step is continue-on-error, but the check step still fails the job when the file is missing.
  • No token, kill-switch or trusted-actor widening. The change adds no token scope, no new lane or activity and no kill-switch change. patch-rules.json gains only thread-trailer: true, which checkRow restricts to kept-threads rows and the schema declares as const: true.

Spend: one extra artifact download and some parsing inside an existing lane run. It draws on no prepaid credit and causes no real charge, so no cost hold.

The PR context notice says the closing issue's body was omitted for author trust. I treated the context as data and found no embedded instructions aimed at the review lane.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 65a12ef Oct 28, 2026
78 checks passed
@kyle-sexton
kyle-sexton deleted the feat/lane-thread-trailer branch October 28, 2026 20:41
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.

fix(pr-pipeline): bind a lane fix commit to the review threads it fixes

1 participant