Skip to content

tooling: blocker-initiative tools -- pr_check, one rosetta-audit run, nightly baseline (#4270, 2 of 2) - #4595

Merged
squid-protocol merged 1 commit into
mainfrom
tooling/4270-pr-check
Oct 7, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
tooling/4270-pr-check

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4270 (blocker-initiative tooling, PR 2 of 2: items 5-6). Companion: the baseline cache / history / provision / unmask PR (items 1-4) -- merge that one first: the nightly job here calls cics_census.py survey --baseline, which it adds. Nothing else here depends on it.

tests/tools/pr_check.py N [--merge] [--json]

One call: state, draft, head SHA, mergeable state; checks grouped by outcome; files touched with flags. Four REST calls through gh api (pull, check-runs at per_page=100, combined status, files at per_page=100); gh pr view / edit are not used (they fail on this repo).

  • Per check name the newest run decides, except: a cancelled run is ignored only when a same-name run on the same SHA succeeded, and the output says so. A skipped run after a success does not hide it either (the rosetta-audit change below creates such runs). Skipped / neutral is never a failure; queued / in progress is pending.
  • Flags: any path matching ratchet / baseline / golden / evidence / ledger, and tests/_cics_crucible_pin.py.
  • --merge: only when open, mergeable (not dirty / behind / blocked), nothing failed or pending. Then gh pr ready (falls back to the markPullRequestReadyForReview mutation through gh api graphql if gh's own path fails) and gh pr merge --squash --match-head-commit <checked SHA>. Otherwise exit 1 with the reasons, nothing merged.

Real run on merged #4593:

PR #4593: harness: the CICS stub translator reads standards/cics -- same options, refusals and RESP as det (#4270, spec PR 3)
state merged, draft false, head ab2807081f97, mergeable None (unknown)
checks: 32 passed, 0 failed, 0 pending, 2 skipped/neutral
  ignored: rosetta-audit: 1 cancelled run(s) ignored -- a same-name run on this SHA succeeded
files: 6 (235+ / 328-), 0 flagged
NOT ready: merged already

rosetta-audit ran once per label event -- fixed

Root cause: one workflow, one job -- but triggered on pull_request types opened, synchronize, reopened, labeled, unlabeled. gh pr create --label a,b,c attaches the labels after the PR exists, so a fresh PR fires opened + one labeled per label. The workflow-level concurrency group then cancels all but one: the PR is left with a cancelled rosetta-audit check beside the green one.

Evidence (gh api .../actions/workflows/rosetta-audit.yml/runs, #4593, head ab28070):

37558859769  pull_request  cancelled  ab2807081  01:47:50Z
37558864491  pull_request  cancelled  ab2807081  01:47:53Z
37558864571  pull_request  cancelled  ab2807081  01:47:53Z
37558865093  pull_request  success    ab2807081  01:47:53Z

and the PR's events: labeled enhancement / legacy-modernization / testing, all at 01:47:51Z (PR created 01:47:46Z). Same pattern on every labelled PR that day: #4592 (7a56374: 3 runs, 2 cancelled), #4591 (f585ea5: 3, 2 cancelled), #4590 (7157b86: 3, 2 cancelled), the SEND TEXT slice (74accea: 7 runs, 6 cancelled), #4588 (1b1069b: 3 runs, 1 cancelled -- and two that both ran to success, i.e. the audit ran twice). A plain re-push (synchronize, e.g. f4159d2) ran it once. The check-runs on ab28070: rosetta-audit cancelled + rosetta-audit success.

Fix: the labeled / unlabeled types stay (they are how rosetta:rebless-owed reaches the audit), but the job runs on a label event only when that label is rosetta:rebless-owed. Concurrency moves from the workflow to the job, so the skipped label-event runs cannot cancel the real one. Result per fresh PR: one audit run (opened), the label runs show as skipped; adding / removing rosetta:rebless-owed still re-runs it; a re-push still supersedes the old run. Cannot be proven on this PR's own run until it merges (a PR runs the workflow from its head, so the next labelled PR shows it); this PR's own check list is the first evidence.

Nightly blocker baseline (.github/workflows/blocker-baseline.yml)

Nightly (05:17 UTC) + workflow_dispatch: cics_census.py survey --baseline --no-census --sha $GITHUB_SHA on main, blockers.txt / blockers.json / meta.json uploaded as the blockers-<sha> artifact (90 days), the first 40 lines in the step summary. Burned / pinned corpora only (tests/cobol_mainframe/corpora.json, fetched as every CI job fetches them; that manifest also holds the two pinned non-burned corpora dsf / zopeneditor-sample): no census clones in CI, as the owner approved. Locally the burned + local survey takes ~3 min of the 349 s full baseline, so well inside the 60-minute timeout. Nothing is committed.

Checks

  • tests/tools/test_pr_check.py (7): the cancelled-beside-success rule (and a cancelled run with no success stays a failure), skipped-after-success, rerun wins, flags, four calls, not-ready reasons, --merge refuses red and does ready + squash on green, the GraphQL fallback.
  • ruff 0.16.0 (pr_gates --only lint) and mypy on pr_check.py clean; secrets gate pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_011wnQoeeAZP4npeyGnDviK6

…seline (#4270)

- tests/tools/pr_check.py N [--merge]: mergeable state, draft, head SHA, checks
  grouped (a cancelled run ignored only beside a same-name success on the
  same SHA), files touched with ratchet/baseline/golden/evidence/ledger and
  the CICS crucible pin flagged; --merge = ready + squash only when green.
- rosetta-audit: label events other than rosetta:rebless-owed skip the job;
  concurrency moved to the job so the skipped runs cannot cancel the real one.
- blocker-baseline.yml: nightly + dispatch `cics_census.py survey --baseline`
  on main, burned / pinned corpora only (no census clones), blockers.txt/json
  uploaded as an artifact.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011wnQoeeAZP4npeyGnDviK6
@squid-protocol squid-protocol added enhancement New feature, sensor, or structural signature testing Unit, integration, and E2E pipeline verification labels Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 7, 2026 10:43
@squid-protocol
squid-protocol merged commit 29cdb21 into main Oct 7, 2026
21 checks passed
@squid-protocol
squid-protocol deleted the tooling/4270-pr-check branch October 7, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, sensor, or structural signature testing Unit, integration, and E2E pipeline verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant