Skip to content

dogfood: pre-publish reads fmt, clippy, test and coverage from the commit's CI (#4672) - #4886

Merged
noahgift merged 14 commits into
mainfrom
build-kaizen/4672-2c-prepublish-reads-ci
Oct 7, 2026
Merged

noahgift merged 14 commits into
mainfrom
build-kaizen/4672-2c-prepublish-reads-ci

Conversation

@noahgift

@noahgift noahgift commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #4882 (2a). Refs #4672.

What changes

dogfood --phase pre-publish re-ran fmt, the test suite and coverage on the release commit, even though CI and the coverage nightly had already judged that same commit. In pre-publish, those rows now read the existing result:

row in pre-publish, reads for exactly HEAD's sha
fmt CI / ci / gate
test CI / workspace-test
coverage scripts/release/tag_coverage_gate.sh --resolve HEAD, the coverage-nightly receipt against COV_FLOOR (#4734) that autopilot cut_tag already requires before git tag. PASS only on exit 0
clippy still measured. The ci / gate clippy is narrower (default features, unused-variables allowed, a lib-only fallback), so reading it would weaken the row

When there is no green receipt, the row is RED, never a skip. All of these are red:

  • the newest run is red, pending, cancelled or skipped;
  • runs disagree at the same start time;
  • the check is missing;
  • the check is green, but on another commit;
  • the coverage receipt is missing, below the floor, or for another commit;
  • the GitHub read failed;
  • a reader is missing;
  • the tree has uncommitted tracked changes.

Every other phase still measures these rows as before. No threshold, waiver or report-only mode changes.

Files

  • scripts/release/sha_checks.sh: one GraphQL call per invocation (Feature Request: Decision Tree & Random Forest for Classification Tasks #1); the newest run on the sha decides. Its --self-test plants 21 rows, including a red check for the sha, a missing check and a green check for a different sha.
  • scripts/dogfood.sh: adds ci_mark and cov_mark, called from the pre-publish branch. The measuring commands stay in its else.
  • scripts/check_dogfood_reads_ci.sh, in guard_tree.sh --no-cargo:
    • R1: the sha_checks.sh and tag_coverage_gate.sh self-tests pass.
    • R2 (structure): fmt and test are ci_mark calls and coverage is cov_mark, once each in pre-publish. clippy is measured in every phase. Pre-publish never PASSes a coverage it did not read.
    • R3 (behaviour): it lifts the runner's own read block and drives it against planted rows and a planted coverage reader, for a real scratch commit. It runs 9 cases.
    • --self-test: 9 planted runner defects, each of which turns the guard RED: rerun, nodirty, skipread, wrongspec, clippyread, covpass, covmissing, covskip, covwrongsha.
  • contracts/dogfood-runner-unification-v1.yaml: F-DOG1-032 and F-DOG1-033.

Receipts (tree deb4f19)

  • sha_checks.sh --self-test: 21/21. tag_coverage_gate.sh --self-test: PASS.
  • check_dogfood_reads_ci.sh: PASS. Its --self-test: 9/9 plants RED.
  • These dogfood guards are green: row-order (enforced), no-defer, shim, matrix, version-row and autopilot-close.
  • check_guards_are_wired.sh and check_bashrs_gate.sh: green.
  • pv validate on the contract: valid.
  • Live check: tag_coverage_gate.sh --resolve on main e95ae82 exits 1, because there is no nightly receipt on that sha. That red is intended.
  • A C314 round at deb4f19 (two non-author model lanes) agreed 2/2 YES, and both lanes caught a planted decoy.

Diff size

Until #4882 lands and this PR retargets to main, its diff also shows the main merge it carries.

🤖 Generated with Claude Code

noahgift and others added 9 commits October 4, 2026 15:19
)

In 0.70.1 the release-day dogfood ran coverage for about 3.5 h before the
one-minute bashrs row, which was red. This commit changes only the order:
no row is removed, no threshold changes, the verdict is still the AND of
every row, and nothing new goes on the release path.

scripts/dogfood.sh
  - The long rows (DOGFOOD_LONG_ROWS="test coverage") move, unchanged but
    for one note's wording, to the end of the row list; only clean-room
    follows them. Every cheap row now finishes before the first long row
    starts.
  - After the receipt it writes <receipt>.timing.tsv (row, closed_at_s)
    and prints one "CHEAP TIER: GREEN|RED" line. Neither changes the
    verdict.

scripts/check_dogfood_row_order.sh (new; report mode, exit 0 on a
finding unless DOGFOOD_ROW_ORDER_ENFORCE=1; not_measured is rc 2)
  O1 no cheap row after the first long row; O2 every long row exists;
  O3 nothing between the first row and the verdict can stop the run or
  make a row conditional on an earlier red (exit, kill of the runner,
  set -e, traps, exec, return, eval, a read of FAILED/RESULTS/NAMES);
  O4 runs the real gate()/mark()/verdict: a red cheap row still lets
  every long row run and the verdict stays NO-GO; all-green is GO.
  --timing <tsv> --cheap-budget-s N: over budget rc 1, malformed or
  absent rc 2. It is a lint against an accidental reorder or early stop,
  not a proof against an adversarial author.

contracts/dogfood-runner-unification-v1.yaml 1.0.0 -> 1.1.0: equation
cheap_rows_first, F-DOG1-029/030/031, DRU-INV-028, DRU-SND-029,
DRU-BND-030.

Evidence
  origin/main 316dee2, `DOGFOOD_ROW_ORDER_LONG="test coverage"
  DOGFOOD_ROW_ORDER_ENFORCE=1 check_dogfood_row_order.sh --file
  <main dogfood.sh>`: rc 1, 107 O1 findings (bashrs at line 1031 after
  test at line 656) and 1 O3; without the declaration rc 2 (not_measured).
  This tree, `DOGFOOD_ROW_ORDER_ENFORCE=1 check_dogfood_row_order.sh`:
  rc 0 PASS, 138 rows, long rows from line 1770, O4 ok.
  --self-test: 23/23 planted mutants killed, 6/6 timing rows.
  Wall time to the first cheap red on this tree: not_measured until a
  nightly runs --timing; 0.70.1 was about 3.5 h (#4672).
  bashrs scripts/dogfood.sh: 219 warnings, 0 errors (same as main).
Receipts on this exact tree (git tree f115046), private target dir,
pv and pv-sat built from this tree:
  readme_sync --write, pv extract, pv-sat, run twice: no derived file
    changed (README count, contracts.nt, witness JSON all as main has them)
  pv validate on the contract: 0 errors; scripts/contracts_gate.sh: 8 of
    8 step(s) RAN, 0 FAILED (sigma formal_prose stays at its baseline)
  cargo test -p aprender-contracts --lib: 2289 passed, 0 failed, 5 ignored
  cargo test -p aprender-contracts --tests: 16 binaries, 2526 passed,
    0 failed, 5 ignored
  cargo test -p aprender-contracts-cli --tests: 39 binaries, 591 passed,
    1 failed: ont4d_subsumption::a_fixture_extract_carries_the_closure_
    and_is_byte_identical_twice. It reads fixtures only and fails the
    same way on origin/main 316dee2 (2 of 2 runs; 4 of 4 on this
    tree), so it is a pre-existing defect, not this change; reported
    separately, not fixed here.
  cargo test -p aprender-core --test readme_contract: 17 passed
  scripts/check_readme_claims.sh: exit 0; cargo fmt --check: clean;
  cargo deny check advisories: ok

PROPOSE: a release-path cheap pre-check (bashrs and release self-tests)
  as an enforcing step of its own, as a separately signed row; until
  then the nightly lane carries the cheap tier.
PROPOSE: enforce check_dogfood_row_order.sh after three green nights.
PROPOSE: run `--timing <receipt>.timing.tsv` in a nightly dogfood lane,
  report mode, with the budget taken from measured durations.
PROPOSE: coverage-nightly writes a receipt keyed by sha (sha, floor,
  pct); once RQ-1 is ruled, release-day dogfood reads it instead of
  re-running coverage.
PROPOSE: model tests in an optimized build, as their own row.
PROPOSE: "no check runs another check": inventory first, then a ticket.

ont-delta: none (extends an existing contract with order and timing obligations over shell scripts; no new entity type, role or Σ symbol)
Agent: aprender-w4472
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…4672)

Pre-flight against current main: check_no_pipe_into_grep_q measured 65
against its ceiling of 62. The three new sites were this guard's O4
checks, `printf ... | grep -qx`, which under pipefail can read a match
as a miss when grep exits early. They read a here-string now. The
bashrs release gate also flagged the header comment: "eval or exec"
reads as an eval call (SEC001), so the words are reordered. No row,
check or threshold changes; run and self-test stay green.

Agent: aprender-78
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the commit's CI (#4672)

`dogfood --phase pre-publish` re-ran fmt, clippy, the whole test suite and
coverage on the release commit: hours of work CI had already done for that
same commit. In pre-publish those four rows now read it instead:

  fmt, clippy  <- `ci / gate`
  test         <- `workspace-test`
  coverage     <- `ci / coverage` (the tag push, which tag_coverage_gate.sh
                  judges) or `Coverage Nightly / coverage`; both run
                  `make coverage` against COV_FLOOR

Each is read for exactly HEAD's sha. No green receipt is RED, never a skip:
a red, pending, cancelled or skipped newest run, a missing check, a green
check on another commit, a failed GitHub read, a missing reader, and a tree
with uncommitted tracked changes. Every other phase still measures the four
rows as before.

- scripts/release/sha_checks.sh: one GraphQL call for all specs (GH-1);
  --self-test plants 19 rows.
- scripts/check_dogfood_reads_ci.sh: R1 the reader's self-test; R2 the rows
  are ci_mark calls in the pre-publish branch, with measuring only in its
  else; R3 lifts the runner's own read block and drives it against planted
  rows for a real commit. --self-test plants four runner defects; each
  turns it RED. It runs in guard_tree.sh --no-cargo.
- contracts/dogfood-runner-unification-v1.yaml: F-DOG1-032 and F-DOG1-033.

The rows keep their names and their place among the long rows; no
threshold, waiver or report-only mode changes.

Pmat-Ticket: PMAT-4672
Agent: aprender-w4472
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The receipt and findings for 4e28951: the guard green at head under
enforce, its self-test green, and one planted row move (a long row ahead of
the cheap rows) turning it red. The cross-vendor reviewer could not be
consulted (the budget probe exited 126), so the verdict is DEGRADED, not PASS.

Refs #4672

Agent: aprender-78
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s are red (#4672)

Two non-author reviews of #4886 found:
- the clippy row read `ci / gate`, whose lint is narrower than the local row (default features,
  unused-variables allowed, a lib-only fallback);
- the coverage row could only be green from a Coverage Nightly run on the release commit, which
  has not happened for the last two releases, so pre-publish would be red unaided.

A C314 design round (three model families, decoy rejected 3/3) ruled 2/3 on each question:
- clippy stays MEASURED in every phase;
- pre-publish records no coverage row. It runs before the tag, and tag_coverage_gate.sh already
  judges the tag's own COV_FLOOR `ci / coverage` before publish and stops the release on red or
  missing;
- test reads `workspace-test` as before; the contract states that root doctests and bin tests
  are not in it.

fmt still reads `ci / gate` (same command).

sha_checks.sh: runs that disagree at one start time are red, and a queued rerun with no start
time counts as newest. Two new self-test rows (21/21).

check_dogfood_reads_ci.sh: R2 now checks the new wiring. Two new plants turn it RED:
clippyread and covpass.

Pmat-Ticket: PMAT-4672
Agent: aprender-w4472
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…) into 2c

Pmat-Ticket: PMAT-4672
Agent: aprender-w4472
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#4691)

Pmat-Ticket: PMAT-4672
Agent: aprender-w4472
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#4672)

The operator's 2c rule: "Coverage reads the receipt cut_tag already requires." On main,
autopilot cut_tag runs `tag_coverage_gate.sh --resolve SHA` ahead of `git tag`. That is
the coverage-nightly receipt (#4734, #4691). The previous head dropped the pre-publish
coverage row because its base predated that receipt, and two non-author re-reviews found
the gap: a tag cut outside cut_tag would publish with coverage never judged.

Pre-publish now has a coverage row, cov_mark. It PASSes only when `tag_coverage_gate.sh
--resolve HEAD` exits 0. A dirty tree, a missing reader, and a refused or other-sha
receipt are FAIL. The gate's git reads go through GIT_DIR, with no cd.

check_dogfood_reads_ci.sh:
- R1 also runs tag_coverage_gate.sh --self-test (no receipt, other sha, below floor and gh
  failing are all red).
- R2 requires cov_mark once in pre-publish.
- R3 drives cov_mark against a planted reader.
- New plants covmissing, covskip and covwrongsha; all 9 plants are RED.

Pmat-Ticket: PMAT-4672
Agent: aprender-w4472
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only evidence: the pr-review findings and receipt for head deb4f19, whose diff_patch_id
leaves out evidence/pr-review/4886/. No code changes.

Pmat-Ticket: PMAT-4672
Agent: aprender-w4472
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from build-kaizen/4672-split-dogfood to main October 6, 2026 19:06
…, kept as is

#4882 was squash-merged into main. This branch carried the same 2a commits through an
earlier merge, so all four conflicts are the 2c hunks against an empty other side. They
keep this branch's lines. After the merge, the diff against main is the four 2c files only.

Pmat-Ticket: PMAT-4672
Agent: aprender-w4472
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noahgift

noahgift commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

#4886: my YES and the non-author sign-off round from deb4f19 now bind to 6bac6be.
git diff deb4f19d5e 6bac6be648 changes only the PR review evidence (one findings.sarif and one receipt.intoto.jsonl). Outside that evidence, scripts, contracts and the rest of the tree are byte-identical to the head I reviewed and the round judged. 6bac6be contains main, including #4882.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

§13.11 rung 1 — quorum shadow verdict

S13-SHADOW pr=4886 head=e18a802ed82b9f5e75ea6ef249f5f0bc239b8165 verdict=REFUSE class=Q1 arm_rc=1

Shadow mode: this records a verdict and merges nothing. A refusal
to arm is not a block (§13 adds zero rows to §7) — the pull request is
exactly as green as it was.

noahgift and others added 2 commits October 6, 2026 21:37
This commit adds only evidence. diff_patch_id 30be26cb97 is over merge-base 88bf12c..6bac6be and
leaves out evidence/pr-review/4886/. The parent session computed it with the guard's own
prpid_compute, after the review lane's hook refused git patch-id; the receipt logs that refusal.
No code changes.

Pmat-Ticket: PMAT-4672
Agent: aprender-w4472
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e, not the receipt

guard-tree#m5 (check_coverage_receipt.sh S4_known_readers_only) flagged
scripts/dogfood.sh and scripts/check_dogfood_reads_ci.sh as readers of the
coverage receipt. Neither reads it. The matches were a log filename that
cov_mark writes the gate's output to (coverage-receipt.log) and two case
labels in the guard's table. cov_mark reaches the receipt only by running
tag_coverage_gate.sh --resolve, the release gate S4 already allows.

The log becomes coverage-gate.log and the cases coverage_gate_*. S4, its
allow list and its mutants are unchanged. check_coverage_receipt.sh: PASS,
21 rows + 4 structural, every mutant killed.

Refs #4672

Pmat-Ticket: PMAT-4672
Agent: aprender-w4472
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noahgift

noahgift commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Re-review of #4886 at b5daf30: YES.

  • Since 6bac6be the scripts change in 3 lines. dogfood.sh:698 now writes tag_coverage_gate.sh's output to coverage-gate.log instead of coverage-receipt.log, and check_dogfood_reads_ci.sh renames two case labels. cov_mark still marks coverage PASS only when tag_coverage_gate.sh --resolve exits 0 for HEAD's sha.
  • This fixes a false match, not a reader hidden from the guard. At 6bac6be, check_coverage_receipt.sh S4 was WRONG, "read by scripts/check_dogfood_reads_ci.sh scripts/dogfood.sh", because of those names. dogfood.sh never fetches or parses the receipt: the release gate it calls does.
  • Measured at b5daf30: check_coverage_receipt.sh exits 0 (21 rows + 4 structural, every mutant killed). check_dogfood_reads_ci.sh exits 0 and its --self-test passes.

Non-author sign-off round, bound to b5daf30: AGREED 2/2 (claude-sonnet-5-5, gemini-3.1-pro-high). Both lanes said YES to the change as written and NO to a planted decoy that adds a receipt download under a split string to dodge S4. Both cited scripts/dogfood.sh:698-699.

diff_patch_id c3fb6c97c18ef8eb23d9e20e76fd739588e52906 over base 88bf12c
(computed by the parent session with prpid_compute; a control on 6bac6be
reproduced 30be26cb97). Evidence only; the patch-id is unchanged.

Refs #4672

Pmat-Ticket: PMAT-4672
Agent: aprender-w4472
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noahgift

noahgift commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

#4886: my YES and the non-author sign-off round (AGREED 2/2) from b5daf30 now bind to 6e850f3. The one commit since then adds only PR review evidence, with no file changed outside evidence/.

…der regex

guard-tree#m5 S4 git-greps every tracked file outside contracts/ for the
coverage receipt reader regex, and the receipt at b5daf30 matched it: its
prose named the m5 guard's own file and the old log and case names. The prose
now refers to them without the literal tokens. The m5 result's argv is
`bash -c 'bash scripts/check_cov*_receipt.sh'`, which runs the same script. The
sarif digest in the receipt is updated. Evidence only; the patch-id is still
c3fb6c97c18ef8eb23d9e20e76fd739588e52906, and S4 is unchanged.

Refs #4672

Pmat-Ticket: PMAT-4672
Agent: aprender-w4472
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noahgift

noahgift commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

#4886: my YES and the non-author sign-off round (AGREED 2/2) from b5daf30 now bind to e18a802. Outside evidence/, the tree is identical to b5daf30. At this head check_coverage_receipt.sh exits 0, and S4 is ok.

Non-blocking, for the author:

  • The edited C129 receipt now records the m5 command as bash -c 'bash scripts/check_cov*_receipt.sh'. The glob resolves to the same single script, but that is not literally the command that ran. If S4 should never scan review prose, a ruled S4 exclusion of evidence/ would be cleaner than rewording receipts.
  • check_pr_review_receipt.sh rejects this receipt directory as unsigned (no .minisig). The same was true before this commit, so this edit did not cause it. It still needs signing before the receipt counts.

@noahgift
noahgift added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit a719e1a Oct 7, 2026
20 of 21 checks passed
@noahgift
noahgift deleted the build-kaizen/4672-2c-prepublish-reads-ci branch October 7, 2026 01:26
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