docs(ci-cd-pipeline): correct the Half-State Patrol wiring and pin it against the workflow - #8061
Merged
Merged
Conversation
The section said the sweeper's closed-card reader is "switched off here via PM_SWEEP_CLOSED_WINDOW_PAGES: '0'". half-state-patrol.yml stopped setting that variable on 2026-08-28; it survives only in the file's header comments as history. The sweep step sets PM_SWEEP_CLOSED_FLOOR: '2026-08-28' instead: the reader is ON, the page window is deliberately absent (back to the sweeper's upstream default of 4), and the dated floor -- not a zeroed window -- is what keeps the ~815 historical pm:dispatched carriers out. Rewritten against the workflow's own env-block comment and header divergence (1). The "UNREAD, never clean" summary branch is kept but re-conditioned: it fires only while the escape hatch is set, and it is unset here. Pinned in scripts/__tests__/ci-cd-pipeline-doc.test.ts: every PM_SWEEP_* identifier the section names must be one the workflow sets as an env KEY -- never a whole-file grep, which would find the retired knob in the header comments and accept the sentence this pin rejects. envKeysOf is unit-controlled against that shape, and both sides carry a non-vacuity leg. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
Contributor
Author
|
Standing down on Generated by Claude Code |
baozhoutao
marked this pull request as ready for review
September 6, 2026 13:51
This was referenced Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8043
The Half-State Patrol section told readers the sweeper's closed-card reader was "switched off here via
PM_SWEEP_CLOSED_WINDOW_PAGES: '0'"..github/workflows/half-state-patrol.ymlstopped setting that variable on 2026-08-28. It survives only in the file's header comments, as history — so the page sent anyone looking for the switch to a variable nothing assigns, and, in the direction this page is actually read, described a predicate as disabled while it ran four times a day.Head this was measured on:
8d17db858.What the workflow actually sets
Re-derived on the merged head, comments excluded on the workflow side:
PM_SWEEP_CLOSED_WINDOW_PAGESappears at:39and:80only, both whole-line comments. So: the closed-card reader is on with a dated floor, the page window is deliberately absent (back toCLOSED_ISSUE_WINDOW_PAGES = 4, the sweeper's own upstream default), and the floor — not a zeroed window — is what keeps the ~815 historicalpm:dispatchedcarriers out.The rewrite
Sourced from the workflow's env-block comment (
:270-280) and its header divergence (1) (:37-39), which are the two places this install records the wiring. Two paragraphs where there was one: what is set, and why a floor rather than a plain "on" (the 2026-08-24 measurement, the body-budget consequence, the no-backfill reasoning, the loud refusal of a malformed value).Two neighbouring claims were re-checked against the code rather than carried over:
pm:*on close was never this repo's practice" — no longer true as written. It became the practice on the cutover date; that is what the floor is dated to. Rewritten to say so.summaryLineinscripts/pm/check-half-states.mjsbranches onclosedWindowDisabled; with the window unset it rendersH22 read N recently-closed issue(s) … only cards closed on/after 2026-08-28 are judged. Kept, but re-conditioned onto the hatch, which is dormant live code rather than removed.The retired identifier is deliberately not named in the section any more — a page that names a variable nothing sets is the defect, and the pin below enforces its absence.
#7852is the parent; it stays open for its half ①, the repository variableHALF_STATE_ANCHOR_ISSUE, which only a maintainer can set. Nothing here touches that half. The workflow itself is read, not written.The pin
scripts/__tests__/ci-cd-pipeline-doc.test.ts, a newdescribeblock; no existing assertion changed. EveryPM_SWEEP_*identifier the Half-State Patrol section names must be a key the workflow sets in anenv:mapping.The comparison reads env keys, never the file as text. That is the load-bearing part: a whole-file grep finds
PM_SWEEP_CLOSED_WINDOW_PAGESin the header at:39/:80and accepts the exact sentence this pin exists to reject.envKeysOfstrips whole-line comments and reads only children atenv:'s indent + 2, so the continuation lines of a folded scalar (PROVENANCE: >-has three) cannot be mistaken for keys; it is unit-controlled against a specimen carrying both shapes.Four legs: the two non-vacuity checks (the workflow-side set non-empty, the doc-side set non-empty — a rewrite that names nothing leaves the comparison green over an empty list); the extractor control; the set comparison; and a value leg requiring the section to quote the floor date the sweep step is given.
The
workflow inventoryblock above it matches filenames in headings, so a false sentence inside a documented section is precisely what it cannot see —#7852says that in as many words. This closes that gap for the one thing on this page that names the sweeper's wiring by identifier.Ablation
Doc mutated on disk back to the wrong sentence, run, restored under a
trap, blob compared both ways.Red exactly as predicted, naming the knob:
The second failure is the value leg (
the section must keep naming the floor variable). The mutation was committed-state-relative: the implementation was committed first, so the restore leg had a real restore point, and it is verified by blob equality rather than by an exit code.Gates
All on
8d17db858unless noted.pnpm exec vitest run scripts/__tests__/ci-cd-pipeline-doc.test.tsTests 44 passed (44)pnpm exec vitest run scripts/__tests__/111 passed (111)/3331 passed (3331)— see notepnpm type-check:scriptspnpm lint:rootpnpm check:doc-fencespnpm check:doc-snippetsScanned 227 document(s): 211 covered … Semantic phase: 549 of 549 block(s) judged, 0 failed.node scripts/check-doc-links.mjsLinks are valid across 17 scan roots.pnpm check:doc-example-readerspnpm check:control-bytes+ manualgrep -naPover both pathsnode scripts/check-changeset-presence.mjsNo source or published contract of a released package changed in this range, so no changeset is owed.node scripts/check-governed-queue-guard.mjs --test <both paths>NOT GOVERNED — 2 path(s) checked against 5 governed surface(s); none matched.node scripts/check-doc-component-types.mjsEvery documented component type is registered.node scripts/check-doc-expression-carriage.mjsnode scripts/check-shell-escape-residue.mjsnode scripts/check-upstream-port-parity.mjs3 ported file(s) match … modulo their declared divergences.pnpm exec vitest run packages/auth/src/__tests__/reserved-auth-features.test.ts17 passed (17)— the one reader of this page outsidescripts/__tests__check:doc-snippetsfirst answeredPRECONDITION NOT MET (exit 2)— not a red, and not a reading about any document. Ran its own scoped build (--build-filter, 34 tasks) and re-ran; the green above is the measured one.One flake, recorded rather than papered over. On the first
scripts/__tests__/run after mergingorigin/main, two corpus tests incheck-doc-links.test.tstimed out at 15000ms (1 failed | 110 passed). Same tree content for those files had passed the same command minutes earlier (111 passed), and the file alone re-runs green in 12.5s for all 121 tests. The variable is container load, not this diff — the run that failed took 188s against 118s for the green one.node scripts/check-doc-links.mjs, the gate itself, is green on the merged head.No changeset: docs plus a
scripts/__tests__file, and the presence script agrees.skip-changesetis a phantom label in this repository (this same test file pins that at:235/:277); no label was applied.Live E2E (informational)is red on every branch today for an upstream reason (#7990) and is not this branch's.🤖 Generated with Claude Code
https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
Generated by Claude Code