Skip to content

v1.92.74.0 pregate: clear --run-url refuses a failed or unfinished run of the lane's own workflow (GSTA-203 PR 8) - #3841

Merged
capy-ai[bot] merged 14 commits into
mainfrom
gsta203-pr8-clear-red-run
Nov 2, 2026
Merged

capy-ai[bot] merged 14 commits into
mainfrom
gsta203-pr8-clear-red-run

Conversation

@garrytan

@garrytan garrytan commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3841,
  "head": "0a976825c166ab7e626834a39df65044ff08ec8c",
  "version": "1.92.51.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 53,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "ed2f8e785db1934a1526a67635ead0f5575e2904",
  "product_patch_id": "6b8c766270352c0cacdb807119c684502bd42d6a",
  "gstack_version": "1.92.51.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 42,
    "rules": "551486253e156572",
    "base": "35817bae9ac783b8af8fd6a810c50604e7effbe5",
    "registry": "35817bae9ac783b8af8fd6a810c50604e7effbe5",
    "gate_scan": {
      "tagged": 0,
      "head": "0a976825c166ab7e626834a39df65044ff08ec8c"
    },
    "reasons": [
      "gate-class",
      "runtime=42"
    ],
    "risk": []
  },
  "pregate": "requires-remote cleared @ed2f8e785db1 (1 checks, current for 0a976825c166)",
  "requires_remote": [
    "pregate.json/remote_gate: remote-gate tree=ed2f8e785db1 tests=2108"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/pregate.md (full), docs/troubleshooting.md Pre-gate section, docs/ship-policy.md --run-url route; captain.md, README, CONTRIBUTING, ARCHITECTURE grep-checked"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 2,
    "fixed": 1,
    "scope": "frozen"
  },
  "carry": {
    "from": "d7bf9e773722e537a83347e60443971c00f89f4d",
    "reason": "stack parent gsta203-pr6-clear-workflow-check landed + base merge + test-only change + release metadata",
    "product_patch_id": "6b8c766270352c0cacdb807119c684502bd42d6a",
    "changed_paths": [
      "metadata:CHANGELOG.md",
      "metadata:VERSION",
      "metadata:agents-digest/gstack-AGENTS.md",
      "product:autoplan/DRIVER.md",
      "product:bin/gstack-autoplan",
      "product:bin/gstack-doctor-components.sh",
      "product:bin/gstack-restamp",
      "product:bin/gstack-ship-queue",
      "product:bin/gstack-ship-receipt",
      "product:captain/templates/slot-call.md",
      "product:capy/skill/gstack/SKILL.md",
      "metadata:changelog.d/gsta203-pr6-clear-workflow-check.md",
      "product:docs/TESTING_INTERNALS.md",
      "product:docs/captain.md",
      "product:docs/recommended-harness.md",
      "product:docs/review-policy.md",
      "product:docs/ship-policy.md",
      "product:docs/skills.md",
      "product:docs/troubleshooting.md",
      "product:docs/unattended.md",
      "product:lib/approval-record.ts",
      "product:lib/autoplan-ceo-only.ts",
      "product:lib/autoplan-checkpoint.ts",
      "product:lib/autoplan-export.ts",
      "product:lib/autoplan-run.ts",
      "product:lib/autoplan-scope.ts",
      "product:lib/autoplan-state.ts",
      "product:lib/factory-scorecard.ts",
      "product:lib/headless-artifacts.ts",
      "product:lib/result-codes-autoplan.ts",
      "product:lib/result-codes-release.ts",
      "product:lib/result-codes.ts",
      "product:lib/review-collect.ts",
      "product:lib/review-depth.ts",
      "product:lib/review-pass.ts",
      "product:lib/review-risk.ts",
      "product:lib/review-targeted.ts",
      "product:lib/ship-bin-common.ts",
      "product:lib/ship-queue-land-lock.ts",
      "product:lib/ship-queue-land.ts",
      "product:lib/ship-queue-train-cli.ts",
      "product:lib/ship-queue-train-gate.ts",
      "product:lib/ship-queue-train-land.ts",
      "product:lib/ship-queue-train-record.ts",
      "product:lib/ship-queue-train-verify.ts",
      "product:lib/ship-release.ts",
      "metadata:package.json",
      "product:scripts/harness-version.json",
      "product:scripts/lib/ci-history.ts",
      "product:scripts/lib/shard-jobs.ts"
    ],
    "merge_commits": 1,
    "range_diff": "1:  51efe0293 =  1:  51efe0293 test(pregate): clear --run-url accepts a run of another workflow on a lane with no profile (red, GSTA-203 PR 6)\n 2:  55be83a3c =  2:  55be83a3c fix(pregate): clear --run-url refuses a run of another workflow on a lane with no profile (GSTA-203 PR 6)\n 3:  07e9939ad =  3:  07e9939ad fix(pregate): the wrong-workflow refusal names its fix and survives a null run read (GSTA-203 PR 6)\n 4:  d8ae81bf5 =  4:  d8ae81bf5 fix: pre-landing review fixes (each refusal names its own fix)\n 5:  a330d4df0 =  5:  a330d4df0 test(pregate): a job link with ?pr= or #step clears a lane with no profile (red, GSTA-203 PR 6 fix-check)\n 6:  fc768d045 =  6:  fc768d045 fix(pregate): clear --run-url accepts job links copied with ?pr= or #step (GSTA-203 PR 6 fix-check)\n 7:  2b3a7981c =  7:  2b3a7981c test(pregate): the real workflows owe windows-smoke.yml/windows-smoke and only its run clears it; the ready conflict hint names each lane's own workflow (GSTA-203 PR 6)\n 8:  dae4edb7e =  8:  dae4edb7e test(pregate): clear --run-url accepts a failed or running run of the lane's own workflow (red, GSTA-203 PR 8)\n 9:  b9dbccf82 =  9:  b9dbccf82 fix(pregate): clear --run-url refuses a failed or unfinished run of the lane's own workflow (GSTA-203 PR 8)\n10:  7fe142672 = 10:  7fe142672 test(pregate): a --run-url clear records the run attempt it judged (GSTA-203 PR 8 review)\n11:  9ffcf9d00 = 11:  9ffcf9d00 fix(pregate): a --run-url clear records the run attempt it judged, not the link passed (GSTA-203 PR 8 review)\n12:  d7bf9e773 = 12:  d7bf9e773 docs(pregate): --run-url clears wait for a green run; troubleshooting lists the no-profile refusals (GSTA-203 PR 8 docs audit)",
    "covers": [
      "pre-landing review",
      "adversarial review",
      "gate integrity",
      "documentation audit"
    ],
    "reruns": [
      "CI at head (gstack-ship-queue ready requires it); test and helper code changed since the reviewed head runs there unreviewed"
    ],
    "ancestry": "linear",
    "trees": [
      "48f1b33b4e97fe2b5ac566cf653f97803288fbcf"
    ]
  }
}

Stack: this PR was stacked on #3832, which landed as 35817ba (v1.92.62.0). It now targets main. 35817ba was merged in once under the rule 19 grant; the PR 6 hunks resolve to main's side, and git diff origin/main...HEAD is the PR 8 product diff alone. The receipt was carried from d7bf9e7 (same product patch-id).

What changed

#3832 made gstack-pregate clear --remote <workflow.yml/job> --run-url <url> check the run's workflow on a requires-remote lane with no run profile. That clear now also refuses PREGATE_RECEIPT_INVALID when the run of the lane's own workflow:

  • is still queued or running: run_in_progress. The fix line says to wait for it to finish green.
  • concluded anything but success (failure, cancelled, timed_out, …): run_not_success. The fix line says to rerun the workflow and clear with the green run.

A green run now records https://github.com/<repo>/actions/runs/<id>/attempts/<n>, the attempt it judged, instead of the link you passed. The check reuses the run already read through deps.run, which returns the newest attempt. So a /job/<id> or /attempts/<n> link is judged by the whole run. The job itself is not checked: deps.jobs returns no job id, so matching a job link would cost a new API read. docs/pregate.md says this.

docs/pregate.md now names windows-smoke.yml/windows-smoke as the free tier's Windows smoke lane, next to the narrower free-tests.yml/cso-windows-launcher and windows-setup-e2e.yml/windows-setup lanes. docs/troubleshooting.md now lists the refusals for --run-url on a lane with no profile.

Proof (failing first)

  • dae4edb, red test: failed, cancelled, timed-out and in-progress runs of a.yml all cleared a.yml/job (0 pass 1 fail, received cleared https://github.com/fx/fx/actions/runs/300). b9dbccf fixes it. A green run of the right workflow still clears (negative control).
  • 7fe1426, red test for the receipt: 4 tests failed without the fix, including an /attempts/1 link that has to record /attempts/2 when attempt 2 is the newest. 9ffcf9d fixes it.

Testing

  • bun run typecheck: clean. Test typecheck ratchet: 814 known diagnostics, none new.
  • Focused tests and guards at 9ffcf9d: 140 pass, 0 fail across 14 files (pregate-clear-runs, gstack-ship-queue, pregate-remote-stamp-only, pregate-from-run, pregate-invalidation, ship-queue-wave, ship-receipt-carry-pregate, run-evidence, module-size-ratchet, bun-entry-isolation, changelog-fragments, spawnsync-timeout-tripwire, git-ref-fixture-tripwire, harness-version).
  • Remote pregate (Ubicloud, owner gsta203) at tree 48f1b33b: PREGATE_REMOTE: tree=48f1b33b4e97fe2b5ac566cf653f97803288fbcf tests=10723 failed=0 spent=0.05. No VMs left afterward.
  • gstack-pregate verify: PREGATE_VERIFY: ok pregate requires-remote cleared is current for tree 48f1b33b4e97.

Review

There were two rounds, the R51 cap. In round 1 the specialist and red-team passes found nothing, and the outside voice (gpt-6.1-sol) came back clean. The native adversarial pass reported three findings:

  1. The receipt stored the raw URL, not the attempt it judged. It was marked FIXABLE, so it counted as CRITICAL, and I fixed it failing-first in 7fe1426/9ffcf9d00.
  2. A green run does not prove the lane's job ran on this tree, because the job, tree and age are not checked. This gap was there before this PR and docs/pregate.md documents it; this PR narrows it. Closing it needs a run profile for the narrow Windows lanes, or a job check that deps.jobs can't do cheaply today.
  3. The warn path for an unreadable origin and --bundle-lane still clear without a run check. Both routes predate this PR and are documented.

In round 2 (full depth on the gate class, at tree 1ffe65db) the specialist and red-team passes found nothing.

Review notes

  • Findings 2 and 3 above are notes, not fixes.
  • After round 2, the docs audit made two wording fixes in docs/pregate.md: the sentence about a lane with no profile, and the instruction to wait for a green run before clearing. Because the R51 cap was reached, gstack-review-plan returned NEXT: done, so those two lines shipped as below-floor notes with no further review round.

Documentation

Status: updated: two factual corrections bring the pregate docs in line with the stricter gstack-pregate clear --run-url (GSTA-203 PR 8).

Scope: base 2b3a798 to head 9ffcf9d on gsta203-pr8-clear-red-run (4 committed files: lib/pregate/index.ts, docs/pregate.md, changelog.d/gsta203-pr8-clear-red-run.md, test/pregate-clear-runs.test.ts; nothing staged, unstaged or untracked). Docs audited: docs/pregate.md in full, the Pre-gate section of docs/troubleshooting.md, and the --run-url route in docs/ship-policy.md. captain.md, README, CONTRIBUTING, ARCHITECTURE, AGENTS.md, CLAUDE.md, unattended.md and captain templates were grep-checked and make no --run-url claims.

Documentation health:

  • docs/pregate.md: Updated. The no-profile --run-url sentence no longer says "keeps today's recording, with one check"; the PREGATE_REMOTE_UNCLEARED route now says to wait for the job to finish green before clearing.
  • docs/troubleshooting.md: Updated. PREGATE_RECEIPT_INVALID now lists the no-profile --run-url refusals (run_ref_invalid, api_error, workflow_mismatch, run_in_progress, run_not_success); the PREGATE_REMOTE_UNCLEARED fix says to wait for a green run.
  • docs/ship-policy.md: Current.
  • README.md, CONTRIBUTING.md, ARCHITECTURE.md, docs/captain.md: Current (no --run-url claims).
  • CHANGELOG (changelog.d fragment): Current; left to the parent.
  • TODOS.md: Skipped (ship-owned mode).

Coverage:

  • clear --run-url green-run check and attempt-URL receipt: reference yes (docs/pregate.md, docs/troubleshooting.md), how-to yes (docs/ship-policy.md by-hand route), tutorial no, explanation yes (docs/pregate.md run evidence).
  • Common gap: no tutorial-style walkthrough of clearing a platform lane by hand. Low priority.

Diagram drift: none; no diagram names the changed code.

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-11-02 GSTA-203 PR 8: clear --run-url refuses a red or unfinished run (bug-fix path) “GStack Minder ordered it as a bug-fix path: failing-first test, no autoplan.” (GSTA-203 Captain thread, relaying GStack Minder's order) approved GSTA-203 PR 8 build without autoplan none

Source: gstack-approvals record for gsta203-pr8-clear-red-run (display only; not an approval citation).

garrytan and others added 12 commits November 2, 2026 02:20
… lane with no profile (red, GSTA-203 PR 6)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…lane with no profile (GSTA-203 PR 6)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… null run read (GSTA-203 PR 6)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ofile (red, GSTA-203 PR 6 fix-check)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…step (GSTA-203 PR 6 fix-check)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… and only its run clears it; the ready conflict hint names each lane's own workflow (GSTA-203 PR 6)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… lane's own workflow (red, GSTA-203 PR 8)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…he lane's own workflow (GSTA-203 PR 8)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…STA-203 PR 8 review)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…t the link passed (GSTA-203 PR 8 review)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… lists the no-profile refusals (GSTA-203 PR 8 docs audit)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot changed the base branch from gsta203-pr6-clear-workflow-check to main November 2, 2026 07:38
@trunk-io

trunk-io Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

…pr8-clear-red-run

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	docs/pregate.md
#	lib/pregate/index.ts
#	test/pregate-clear-runs.test.ts
@github-actions github-actions Bot changed the title pregate: clear --run-url refuses a failed or unfinished run of the lane's own workflow (GSTA-203 PR 8) v1.92.74.0 pregate: clear --run-url refuses a failed or unfinished run of the lane's own workflow (GSTA-203 PR 8) Nov 2, 2026
@capy-ai
capy-ai Bot merged commit f865cd9 into main Nov 2, 2026
56 checks passed
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