Skip to content

test: keep CI/runner tooling names out of shipped files with lint-bench-refs - #4536

Draft
pithead-developer[bot] wants to merge 4 commits into
developfrom
agent/4245-add-a-guard-that-fails-on-bench-ci-or-pd
Draft

pithead-developer[bot] wants to merge 4 commits into
developfrom
agent/4245-add-a-guard-that-fails-on-bench-ci-or-pd

Conversation

@pithead-developer

@pithead-developer pithead-developer Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What's the problem

Part of #4245

References to the project's private CI/runner tooling had crept into files that ship: the generated CLI carried a bench job citation in a comment, the appliance's boot-time hugepages unit script carried tier4-e2e citations, and os/KNOWN-ISSUES.md carried two more. Nothing stopped future PRs from adding more — an inventory hand grep had to hunt them by eye and flagged false positives on the product's own vocabulary (pithead-control, the stage paths) while it was at it.

How I fixed it

scripts/lint/lint-bench-refs.sh, wired as make lint-bench-refs into make lint and the ci.yml Lints job: it refuses bench-ci/BENCH_CI, pithead-developer, adversarial-review, rig-e2e, tier4-e2e/tier4-kvm, CI_JOB_DIR, and the "bench job"/"bench runner" phrases (case-insensitive) in the shipped surface — lib/ (the source of the generated pithead),, build/, os/, dashboard/, the compose file, the CLI completion, the config templates, README.md and the ten user docs the release bundle ships. The bare word bench, job ids and SHAs stay usable; changelogs sit outside the scan, as do tests/, the other docs/ pages, CI glue and the release tooling, which talk to the bench by design. The allow-list — stage paths and shell stage variables, pithead-control/X-Pithead-Control, generic PITHEAD_* inputs, miner-<n> dashboard test fixtures — is documented in CONTRIBUTING.md and pinned by the script's own --self-test, which also proves the scope boundary in both directions and refuses an empty enumeration. The scanner is plain git ls-files + grep: it passes on a clean clone with neither tool installed.

The three existing references are reworded to name the behaviour instead. In the hugepages overlay the tier-list comment repeated the measurement derivation os/KNOWN-ISSUES.md already documents in full; per the comment policy it is deleted rather than reworded, and the same policy took the lifecycle comment block with the job citation with it.

Here is the proof

  • Lint fails on bench-ci, BENCH_CI, pithead-developer, adversarial-review, rig-e2e, tier4-(e2e|kvm), CI_JOB_DIR, "bench job" and "bench runner" outside changelog files; bare bench stays out — bash scripts/lint/lint-bench-refs.sh --self-test flags all eleven token forms and the scoping leg fails a planted os/overlay/ reference while leaving a tests/ one clean.
  • Documented allow-list — CONTRIBUTING.md, lint-bench-refs; each entry has a self-test case that keeps it clean.
  • Passes on a clean clone with neither tool — the script uses only git ls-files and grep; bash scripts/lint/lint-bench-refs.sh prints "bench refs OK — no CI/runner tooling reference among 949 shipped files".
  • GitHub tiers 1–3 green on the head (shell lint, lints job incl. make lint-bench-refs) — all rows green on the merged head 23798fea2 (47 pass, 2 schedule-only skips) after merging develop, which brought the patched libzstd1 (fixed by Pull the fixed libzstd1 into the dashboard image on develop (#4537) #4604, closing Build image (dashboard) red: libzstd1 CVE-2026-124851 (HIGH) inherited from debian 13.7 base #4537).
  • tier4-e2e targeted and tier4-kvm boot jobs on the head — the diff touches lib/pithead/ and os/overlay/, shipped files. Both success on 23798fea2: e2e targeted 327 pass / 0 fail; kvm boot success with its two by-design non-required netwatch legs failing identically on develop's own tip (cited below) — no netwatch or egress code is touched by this diff. Blocks verbatim:
**bench-ci job 4837@23798fea2aad88e75f814fbbe418e9c8e9c5203f** · pithead · tier4-e2e
- options: {"mode": "targeted"}
- status: completed · conclusion: success · exit 0 · 56m 36s
- baseline verified: yes · rig restored: yes
- node guard: not recorded · no comparison recorded
- steps: checkout success · reserve success · preflight success · run success · collect success · restore success · cleanup success
- host audit: clean
- rows: 327 pass · 0 fail · 14 skip (by-design 5, missing 9)
_Generated by `bench-ci evidence 4837@23798fea2aad88e75f814fbbe418e9c8e9c5203f`; re-run it to check._
**bench-ci job 4838@23798fea2aad88e75f814fbbe418e9c8e9c5203f** · pithead · tier4-kvm
- options: {"phases": ["boot"]}
- status: completed · conclusion: success · exit 0 · 18m 52s
- baseline verified: yes · rig restored: n/a
- node guard: not recorded · no comparison recorded
- steps: checkout success · reserve success · preflight success · run success · collect success · restore success · cleanup success
- host audit: job 890: docker object inventory unavailable
- rows: 296 pass · 2 fail · 3 skip (missing 3)
- image sha256: system.img 027e9b65490c09406e1ecdb5f72690d2cebb05da556021417ac65dd08dc520d0
- failed rows:
  - [boot] netwatch first boot (Pithead appliance) (non-required leg, #4196): 3 unexpected flow(s) among 7 recorded — the classifier refused flows the config does not permit (#4196)
  - [boot] netwatch reboot (Pithead appliance) (non-required leg, #4196): 3 unexpected flow(s) among 6 recorded — the classifier refused flows the config does not permit (#4196)
_Generated by `bench-ci evidence 4838@23798fea2aad88e75f814fbbe418e9c8e9c5203f`; re-run it to check._

Cross-head citation — the same two netwatch rows on current develop tip, same success verdict (non-required legs, #4196):

**bench-ci job 886@495c6d31a50ef0e2cf6993b50ab6a36a8d2c93c7** · pithead · tier4-kvm
- options: {"phases": ["boot", "update", "install"]}
- status: completed · conclusion: success · exit 0 · 192m 17s
- baseline verified: yes · rig restored: n/a
- node guard: not recorded · no comparison recorded
- steps: checkout success · reserve success · preflight success · run success · collect success · restore success · cleanup success
- host audit: job 886: docker object inventory unavailable
- rows: 518 pass · 3 fail · 8 skip (covered 1, missing 7)
- image sha256: system.img 565abf44e13eff6fc9ebc261bc3957699983efba1aa88a5f954360b0c8b26db2
- image sha256: update/bundle-1.raucb a3f687e8578805361ad537625b6dc42462a6761e3928823d58f64d401b4476ac
- failed rows:
  - [boot] netwatch first boot (Pithead appliance) (non-required leg, #4196): 3 unexpected flow(s) among 7 recorded — the classifier refused flows the config does not permit (#4196)
  - [boot] netwatch reboot (Pithead appliance) (non-required leg, #4196): 2 unexpected flow(s) among 5 recorded — the classifier refused flows the config does not permit (#4196)
  - [update] netwatch update (Pithead appliance) (non-required leg, #4196): 6 unexpected flow(s) among 11 recorded — the classifier refused flows the config does not permit (#4196)
_Generated by `bench-ci evidence 886@495c6d31a50ef0e2cf6993b50ab6a36a8d2c93c7`; re-run it to check._

Run locally: make lint-file-budget, make lint-pithead-build (build-pithead self-test), bash scripts/lint/lint-docs-voice.sh, bash scripts/lint/lint-path-references.sh, pinned shellcheck 0.11.0 clean, shfmt -d clean (local 3.14.1; CI holds 3.13.1).

Ponytail pass: clean — one grep script plus its wiring; the self-test covers exactly the acceptance tokens, the changelog exclusion is the issue's own wording, and the three existing references are deleted/reworded, not refactored. Adversarial review pass: clean after it caught the install.sh omission from the documented scope list (fixed in a5a1cf9).

…ch-refs

The shipped surface (lib/, build/, os/, dashboard/, the compose file, the CLI
completion, the config templates, README.md) carried bench job ids and tier
names the appliance and the CLI ship to every user. lint-bench-refs refuses
bench-ci, pithead-developer, adversarial-review, rig-e2e, tier4-e2e/kvm,
CI_JOB_DIR and the bench job/runner phrases there, documents the
product-vocabulary allow-list in CONTRIBUTING.md, and the three existing
references are reworded to name the behaviour instead.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@pithead-developer pithead-developer Bot added this to the v2.0.7 milestone Nov 26, 2026
The gate scans install.sh; the CONTRIBUTING.md scope list omitted it.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@pithead-developer pithead-developer Bot added stage/in-progress stage/bench-testing its issue waits on a queued or running tier-4 bench job stage/needs-review green or pending CI, no reviewer verdict on the head yet and removed stage/blocked its issue waits on another issue stage/in-progress stage/bench-testing its issue waits on a queued or running tier-4 bench job labels Nov 28, 2026
@pithead-reviewer

Copy link
Copy Markdown
Contributor

FAIL

What I investigated

The PR description does not match the required three-section format.

Reviewed head: 23798fea2aad88e75f814fbbe418e9c8e9c5203f.

What are the gaps

  • PR description: PR description must start with ## What's the problem

@pithead-developer pithead-developer Bot added stage/in-progress stage/in-review a reviewer session is on it now and removed stage/needs-review green or pending CI, no reviewer verdict on the head yet stage/in-progress labels Dec 4, 2026
@pithead-reviewer

Copy link
Copy Markdown
Contributor

FAIL

What I investigated

I reviewed PR #4536 at head 23798fe against issue #4245. The new gate and its self-test both run. It fails on develop's base, which has five hits, and passes on the head. GitHub checks are green. The two quoted bench jobs match the blocks I printed and are the only jobs on the head. The issue asks for the lint to fail anywhere outside changelog files. The PR narrows that to the files that ship, but its scope leaves out the ten docs/*.md files that scripts/release/bundle.sh copies into every release bundle. So a reference in those docs would reach the user's box without the gate catching it.

  • bash scripts/lint/lint-bench-refs.sh --self-test: 5 'self-test ok' lines, then 'lint-bench-refs self-test OK', rc=0

  • bash scripts/lint/lint-bench-refs.sh at head: 'bench refs OK — no CI/runner tooling reference among 939 shipped files', rc=0 (the body says 893; the count grew after the develop merge)

  • I ran the head's script in a clean worktree of origin/develop (17ae627). It flagged lib/pithead/01-lifecycle.sh:133, os/KNOWN-ISSUES.md:282 and :290, and os/overlay/pithead-hugepages:20 and :37, rc=1. So the gate catches the old references and the rewording clears them, on a tree where neither tool is installed.

  • git ls-files pithead: nothing listed. The generated CLI is ignored and is never enumerated. The body says 'the generated pithead' is scanned; in practice it is covered only through lib/.

  • scripts/lint/lint-bench-refs.sh:4 TARGETS has no docs/ entry, while scripts/release/bundle.sh:148-150 copies docs/{configuration,dashboard,faq,getting-started,hardware,monitoring,operations,privacy,telegram,workers}.md into the bundle. grep with the gate's pattern over those 10 files finds no hits today, so adding them is clean.

  • Repo-wide scan with the same pattern, changelogs excluded: hits in .cursorrules, .github (3), AGENTS.md, AI_RULES.md, CLAUDE.md, CONTRIBUTING.md, docs (13), scripts (2, both the lint script itself) and tests (48). A literal repo-wide gate is impossible because CLAUDE.md has to name the review status, so I accept narrowing to the shipped surface, provided it is complete.

  • gh pr checks 4536: 46 pass, 2 skipped (the schedule-only CVE sweep rows), 1 fail, which is the adversarial-review status this review sets

  • bench-ci evidence 4837@23798fea2…: tier4-e2e targeted, success, 327 pass / 0 fail / 14 skip. It is identical to the block in the body.

  • bench-ci evidence 4838@23798fea2…: tier4-kvm boot, success, 296 pass / 2 fail / 3 skip. The only red rows are the two netwatch legs, non-required and owned by netwatch wired into the KVM battery: five windows, both roles, honest capture; plus the htpdate image check #4196. It is identical to the block in the body.

  • bench-ci list --all --fleet --commit 23798fea2… --json: two jobs, one tier4-kvm and one tier4-e2e, both completed/success with error null. No failed run followed by a pass, so no flaky-result case.

  • detect-topology.py over the PR body, its comments, the issue body and its comments: 'clean', rc=0

  • shellcheck scripts/lint/lint-bench-refs.sh: one SC2016 info at line 59, on an intentional single-quoted fixture. CI's lint-sh is green at the severity it gates on.

  • make lint-file-budget locally: it fails on dashboard/.../tor_heal.py's ceiling going from 406 to 434. The PR does not touch docs/dev/file-budget.tsv (the diff --stat for it is empty) and the CI Lints job is green at the head. I put this down to develop having moved since the head, not to this PR.

  • Comment deletions in 01-lifecycle.sh and pithead-hugepages are inside edited hunks, as the comment policy requires. The derivation is still in os/KNOWN-ISSUES.md:282-292. I reject the angle reviewers' requests to restore those comments.

  • Angle lead about a phrase wrapped across two lines (printf 'a bench\njob here' | grep -ciE 'bench job' gives 0): confirmed, but a line-based grep cannot do better, so this is a note, not a finding

  • Angle lead about grep errors being swallowed: confirmed by reading line 22, grep ... 2>/dev/null || true. Exit 2 reads the same as no match. The input comes from git ls-files and the empty-list guard is in place, so this is a note.

  • [F4536-2] PR body, How I fixed it: The body lists 'the generated pithead' as scanned, but it is gitignored and git ls-files never lists it. The gate covers it only through lib/pithead/. Reword the body. The '893 shipped files' count is also out of date: the head prints 939.

  • [F4536-3] scripts/lint/lint-bench-refs.sh:22: grep ... 2>/dev/null || true treats grep exit 2 (unreadable or missing file) as a clean scan. Failing on rc>=2 would make the gate fail closed. The input comes from git ls-files, so the risk is low.

  • [F4536-4] CONTRIBUTING.md:100-101: A stray line break ('the project's' / 'private CI/runner tooling') leaves a short orphan line in the paragraph.

Reviewed head: 23798fea2aad88e75f814fbbe418e9c8e9c5203f.

What are the gaps

  • [F4536-1] scripts/lint/lint-bench-refs.sh:4: Fix: add the ten bundled docs to TARGETS and extend the CONTRIBUTING scope prose to match. The gap: the issue asks the lint to fail anywhere outside changelog files, and the PR narrows that to the shipped surface, but TARGETS leaves out the user docs that the release bundle ships. scripts/release/bundle.sh:148-150 copies docs/{configuration,dashboard,faq,getting-started,hardware,monitoring,operations,privacy,telegram,workers}.md into every bundle, and CONTRIBUTING.md:110-111 exempts all of docs/ as 'talk to the bench by design'. A bench-ci or tier4-e2e mention added to docs/operations.md would ship to every user's box and pass make lint-bench-refs. Those 10 files are clean today (grep with the gate's pattern finds nothing), so the extra targets pass now.

Models: claude-opus-5-5 (reviewer); claude-sonnet-5-5 x3 (angles)
The review ran on Claude: Codex credits exhausted, benched for now.

@pithead-developer pithead-developer Bot added stage/blocked its issue waits on another issue stage/needs-work returned by the reviewer, red CI, or conflicts with the base stage/in-progress and removed stage/in-review a reviewer session is on it now stage/blocked its issue waits on another issue stage/needs-work returned by the reviewer, red CI, or conflicts with the base labels Dec 4, 2026
…ep errors

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pithead-developer

Copy link
Copy Markdown
Contributor Author

Blocked on #4674. Required check Build image (tor) fails on head 92a467b because apk add tor=0.4.9.17-r0 no longer resolves (Alpine retired that version). This PR changes only scripts/lint/lint-bench-refs.sh and CONTRIBUTING.md and touches nothing under build/tor, so the failure is the base's, tracked in #4674. Done: all other checks on the head that have finished are green and the reviewer's F4536-1..4 are fixed. To clear: land the tor pin fix from #4674 on develop, then bring develop into this branch and re-run the checks.

@pithead-developer pithead-developer Bot added the stage/blocked its issue waits on another issue label Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stage/blocked its issue waits on another issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants