docs(ci): stop hard-coding hook self-test deps in a comment - #14538
Conversation
The step comment claimed a fixed dependency set (jq + git only) for the whole "Claude hook guard self-tests" step, but the step discovers its matrices by glob (`find .claude/hooks -type f -name '*.selftest.sh'`), so a new matrix can legitimately need more than the two original ones did -- and one already does (guard-governed-enqueue.selftest.sh needs `node` for real, to run its two predicates). The comment never noticed; nothing catches that this prose fell out of date, since check:step-collectors cannot see this block (already admitted a few lines up). Rewrite the dependency sentence to say what is true of the STEP itself (jq + git, both already relied on bare elsewhere in this repo) plus whatever each discovered matrix declares in its own header -- because discovery is by glob, a matrix needing more must say so there, not here. Drop the stale "~2 s measured" figure along with it. No other line moves: step name, run: script, find discovery, and the rest of the "Hermetic by construction" paragraph are untouched.
…ok-selftest-deps-comment
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 33623834019 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Fixes #14141
What
.github/workflows/lint.yml'sClaude hook guard self-testsstep discovers itsmatrices by glob (
find .claude/hooks -type f -name '*.selftest.sh' | sort), butthe comment above the step hard-coded a fixed dependency claim for the whole step.
That combination is a drift channel: a new matrix can need more than the original
two did without touching this comment, and one already does
(
guard-governed-enqueue.selftest.shneedsnodefor real — see #14141 for thefull writeup).
check:step-collectorscannot see this block (the comment alreadyadmits as much a few lines up), so nothing catches the prose falling out of date.
This is option A from the triage (comment
#14141 (comment)):
rewrite the dependency sentence to describe only what the step itself needs, and
push the "what else" onto each matrix's own header — prose-for-prose, no new
machine channel. Options B/C (a preflight that parses matrix headers, deferred by
the triage) are out of scope here;
.claude/hooks/**is untouched.Before:
After:
The stale
~2 s measuredfigure is dropped along with it. No other line moves:step
name:,run:script, thefinddiscovery, and the rest of the "Hermeticby construction" paragraph (per-matrix throwaway git repos; re-run from a primary
checkout / detached HEAD / non-repo cwd) are untouched, and the
⚠️ check:step-collectors CANNOT see this blockadmission stays as-is.Selftest census (why this matters right now)
All five matrices currently discovered under
.claude/hooks/*.selftest.sh, andwhether each calls anything beyond
jq/git/bashfor real (not countingnode/pnpmstrings that appear only inside simulated Bash-command fixtures fedto the guard under test):
guard-governed-enqueue.selftest.shjq… andnode"node(both predicates run for real; one case runs a generator--checkwhen deps are installed)guard-main-checkout-bash.selftest.shguard-main-checkout.selftest.shguard-shared-stash.selftest.shguard-tree-enum.selftest.shOnly one matrix has drifted past jq+git so far, and it already documents its own
extra dependency in its own header — which is exactly the shape the rewritten
step comment now describes instead of enumerating. No second drift instance was
found, so route B (a preflight parsing matrix headers) stays deferred per the
triage.
Testing
find .claude/hooks -type f -name '*.selftest.sh' | sort— the step's owndiscovery command, run locally: discovers the same 5 files listed above.
run:block executed locally, byte-for-byte (bash + jq + git + nodeare all present on this machine): all 5 matrices
PASS, exit 0.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands .github/workflows/lint.ymlon the currenthead (commit
7987b5b2e,origin/mainmerged in twice as it advanced) — 23families, 22 RAN-PASS, 1 NOT-MEASURED (
check:type-check-debt, exit 3PREREQUISITE NOT MET— needs the full workspace dependency closure builtfirst; this is a comment-only YAML change with no bearing on type-check debt).
pnpm check:pm-dispatch-gates(1240 self-test cases) also RAN-PASS. Full listin the issue comment report.
.github/**, nopackage or user-visible behaviour changes —
skip-changesetlabel applied andconfirmed by reading the PR's labels back.
Session: https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV
Generated by Claude Code