Skip to content

fix(pr-pipeline): poll the found capture run, record capture misses as blocked, cap capture retention at 30 - #13449

Merged
kyle-sexton merged 6 commits into
mainfrom
fix/12232-capture-followups
Nov 5, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
fix/12232-capture-followups

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #12232

Summary

PR 13053 put the capture workflow on main, switched off, and listed three fixes to make before merge.verify-capture.app is set. This PR makes those three fixes.

  1. Polling. find-capture.mjs re-listed the capture workflow's runs, up to 10 pages, once a minute for up to 35 minutes.
  2. Misses read as no-app. With the app set, every miss reached the verdict as no-app ("no app check ran"): a red capture run, a run that never started, a timeout, a missing artifact, an API failure.
  3. Retention. The pr-capture-* retention row records 30 days, but merge.verify-capture.retention-days accepted 1 to 90.

Fix

  • Polling. find-capture lists runs only until the capture run appears, which keeps the 2-minute "never started" check. After that it reads GET actions/runs/{id} every 3 minutes, re-runs the isCaptureRun identity checks, and confirms the id still matches. The last read lands on the 35-minute bound. A full wait now costs 13 calls instead of 36; a run that finishes at 3 minutes costs 3 instead of 5.
    • Option not taken: starting pr-verify from the capture workflow's workflow_run event, which would remove the wait. check-trusted-trigger and the verdict's run record rest on pr-verify's current trigger, the trust basis the owner's Q1 decision kept (issuecomment-6620015178). Changing that is the owner's call. Basis: judgment, on pr-verify.yml:13-15.
  • Misses. With the app set, every miss now records capture: blocked. no-app means only that the app is unset.
    • The reason is built inside find-capture from a fixed code, a run id and a run conclusion, for example "capture run N ended failure". It never comes from the artifact or from API error text.
    • The miss travels on the existing carry output, and a carried value must match an anchored pattern.
    • write-verdict passes the reason through captureEvidence, so secret screening and the length cap still apply.
    • A red run's artifact is not read.
    • prompt.md:85 already tells the judge to proceed without a blocked capture. No verdict outcome or merge gate reads the capture field: the verdict comes from the model output (write-verdict.mjs:383), and a grep of .github/scripts/pr-merge/ and babysit_verify_evidence.py finds no reader.
  • Retention. The accepted range is now 1 to 30 everywhere it is stated: the capture workflow's check, the schema maximum, pr-pipeline.yaml, the README, and the retention row's reason.
  • Boundary. The workflow diff is comments, three identical CAPTURE_BLOCKED env lines on the judge jobs' verdict steps, and the retention bound. Triggers, permissions, persist-credentials, the probe, secret placement and step order are unchanged.

Verification

  • node --test on each .github/scripts/pr-verify/*.test.mjs: 290 pass, 0 fail. find-capture's tests pin the call counts and cover each miss:
    • red run
    • never started
    • timeout
    • no artifact
    • API failure
    • failed download
    • carried miss
    • app unset
  • write-verdict's tests show that a pass and a fail both keep their verdict with a blocked capture.
  • scripts/check-artifact-retention.sh passes (95 upload steps, 66 families). check-changelog-fragments.sh --check-required passes.
  • actionlint on both workflows reports only the cache-mode key that main already has.
  • A fresh-context verifier checked the head against these criteria and found them met. It accepted the two additive test-file edits.
  • Not run: a live capture. The app is still unset.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 4 commits November 5, 2026 00:52
…e as blocked, cap capture retention at 30

find-capture lists the capture workflow's runs only until the capture run
shows up, then reads that run's own record (GET actions/runs/{id}) every
3 minutes, re-checking its identity, with the last read at the 35-minute
bound: a full wait costs 13 calls instead of 36.

With merge.verify-capture.app set, every miss (no run, a run that ended
other than success, a run still going at the bound, no artifact, an API
failure, a failed download) now reaches the verdict as capture: blocked
with a reason find-capture builds from a fixed code, a run id and a run
conclusion; no-app now means only that the app is unset. The miss rides
the existing carry output, so the later judge jobs record the same
reason without searching again, and the carried value is pattern-checked
like the ids. A red capture run's artifact is not read.

merge.verify-capture.retention-days now accepts 1 to 30, so the
pr-capture-* retention row's 30 days is the true upper bound.

Refs: #12232

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

chatgpt-codex-connector Bot commented Nov 5, 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-05T06:08:05.643135Z 61d2842 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

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review (incremental, 61d2842 → 3ae53d4): no security issues found

I read every hunk of all 5 files in the incremental scope. .github/workflows/pr-verify.yml is a trusted path and got extra scrutiny. I also read the unchanged parts of find-capture.mjs that the new code uses: MISS, missReason, miss, findCapture and main. This lane already reviewed an earlier head, so this review reports only blocking findings. None were found at any severity.

What changed: only four kinds of miss are now carried to the later judge jobs: malformed, no-artifact:N, mismatch:N and ended:N:<conclusion>. These are the ones that cannot change. After unreadable, not-started or running:N, the later job writes no carry and searches again. This is the fix for this lane's earlier advisory thread, which is settled and marked lines changed since resolution: no.

Checks and results

  • Carried input (FOUND_CAPTURE): still validated before use. The new PERMANENT pattern (find-capture.mjs#L43) is anchored, has no multiline flag, and accepts a subset of what MISS accepts. Every value it passes therefore still gets its reason from missReason's fixed codes. Any other carried value starts a fresh search, which is the narrower and safer behaviour (find-capture.mjs#L162).
  • Output injection into GITHUB_OUTPUT: blocked. carry= is written only when found.miss matches PERMANENT (find-capture.mjs#L190). Every miss code is built from validated run ids and from a conclusion that must match CONCLUSION, so no newline or key=value text can get in.
  • Fresh search in a later job: it runs the same identity checks as before (isCaptureRun: the capture workflow path, a workflow_run event, branch main, this repository, and a display title bound to the upstream run id and head SHA). A new search therefore cannot pick up another pull request's or another head's capture.
  • Workflow and docs: pr-verify.yml changes comments only, and the README and changelog fragment change prose only. No trigger, permissions:, token request, env wiring or step order changed.
  • Trust controls and merge holds: nothing touched or widened.
  • Instruction-surface deletions: none.
  • Plugin manifests: none changed.
  • Prior findings: the one earlier entry is this lane's clean review summary. It has no finding to repeat.
  • Embedded text: the PR description and the settled thread contain no instructions aimed at this review.

Spend: after a temporary miss, the later judge jobs now search again inside the same 35-minute bound. That uses a few more GitHub API calls and some included Actions runner time, and changes no billing.

critical-findings: 0

@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 61d28428e2df6d78de7d415faf97b998ecc11947; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: PR #13449, incremental since 61d28428 (blocking only)

No findings. This lane already reviewed an earlier head, so this review looked for blocking findings only.

Scope: I read every hunk of the 5 files in .claude-lane/incremental-files.txt:

  • the changelog fragment
  • find-capture.mjs
  • find-capture.test.mjs
  • pr-verify.yml
  • docs/conventions/pr-pipeline/README.md

I also read the whole head find-capture.mjs and checked how FOUND_CAPTURE is wired between jobs in pr-verify.yml. I ran no tests. The "290/290 pr-verify tests pass" result is the author's claim, and I have not checked it.

What I checked:

  • The earlier advisory is fixed. That was the point that a temporary miss became the outcome for every later judge job. Now only misses matching the new PERMANENT pattern are written as carry (find-capture.mjs#L43, #L190). Those misses are malformed, no-artifact:N, mismatch:N and ended:N:<conclusion>. On the read side, only those same misses are accepted from FOUND_CAPTURE (#L162). So a carried unreadable, not-started or running:N starts a fresh search.
  • Patterns. PERMANENT is anchored and is a strict subset of MISS, so miss(env.FOUND_CAPTURE) always gets a reason. ended:900:Failure and mismatch:0 are still rejected, and the tests cover both.
  • Job chain. check-intent-subscription reads needs.check-intent.outputs.capture, and the third judge job reads needs.check-intent-subscription.outputs.capture. When the second job searches again and finds the capture, it passes that result on to the third.
  • Tests.
    • A transient miss writes blocked-reason with no carry.
    • The new mismatch case, a re-read record on head_branch: feature, writes carry=mismatch:900.
    • Each carried permanent miss makes 0 calls.
    • Each carried transient code makes calls of its own.
  • Docs. The workflow comments, the README paragraph and the changelog fragment all describe the new split: a miss that cannot change is carried, and after any other miss the later jobs search again.

Prior findings and settled threads: The single earlier inline finding (find-capture.mjs line 154) was resolved with an owner reply stating the fix. The new code does what that reply describes, so nothing is re-raised.

Closing issue: The PR context names no closing issue (Refs: #12232), so there are no acceptance criteria to check.

Spend (not a finding): When the first job's miss is temporary, the later judge jobs now make their own API calls. That is at most a 2-minute listing for not-started, or a short poll once the capture run has ended. This draws on Actions minutes and API rate limit only.

No plugin manifest changed.

kyle-sexton and others added 2 commits November 5, 2026 01:11
A carried unreadable, not-started or running miss made a temporary miss
final: every later judge job recorded it blocked and never searched
again, though it starts at least one judge step later and would find the
finished capture. find-capture now carries only malformed, no-artifact,
mismatch and ended misses, and accepts only those (or the ids) as
FOUND_CAPTURE. A miss that can change still writes its blocked reason
for this job's verdict but no carry, so a later job searches again under
the same bound and records its own reason.

Refs: #12232

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 59f8e5b Nov 5, 2026
52 checks passed
@kyle-sexton
kyle-sexton deleted the fix/12232-capture-followups branch November 5, 2026 06:24
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.

1 participant