fix(pm): mark CI-measured-only gate families instead of listing them as runnable - #14280

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking
Sep 1, 2026
Merged

fix(pm): mark CI-measured-only gate families instead of listing them as runnable#14280
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking

Conversation

@baozhoutao

Copy link
Copy Markdown
Contributor

Fixes#14004

dispatch-gates advertised node scripts/pm/check-governed-queue-guard.mjs among the families under "Local gates for this card (paste into the dispatch prompt)", and emitted it from --commands, whose caption promises one runnable command per line. That gate judges the merge-queue event payload and nothing else, so outside a workflow run its only possible outcome is EXIT=1. Every dev on a .claude/agents/** diff harvested 10 commands and got 9 green and 1 structurally red on a clean tree.

The derivation now classifies such a family by SHAPE, marks it in the human rendering, flags it in --json, and omits it from --commands.

scripts/pm/check-governed-queue-guard.mjs is NOT touched. Its refusal is correct and deliberate — "could not look" must never exit 0 — and triage ruled option 2 out: 「不要改那个门禁。」 The defect was upstream of it, and that is where this lands.

Premise re-check (fresh origin/main, fa1eca3)

what the card measuredre-measured here
a diff touching .claude/agents/os-dev.md derives the queue-guard row among the local gatesstill true — 10 families, the guard among them
the guard refuses locally with EXIT=1still true, byte-for-byte the same refusal text
grep -c 'GITHUB_EVENT_PATH|ciOnly|ci-only' scripts/pm/dispatch-gates.mjs is zerostill 0 — nothing at the derivation layer marked the row

Premise valid; the card is live.

The shape criterion — measured, which is the part triage left to this lane

Triage leaned to shape detection over a hand-maintained list and explicitly left the criterion's cost to be measured here. Measured on fa1eca3, over the 200 discovered families:

limbwhat it readsfamilies selected
1 — payload dependencethe gate's own source ACCESSES process.env.GITHUB_EVENT_PATH (dotted or bracketed, through a local env alias too), with comments and self-test bodies masked1
2 — no local invocationa direct workflow run: family (never a check:* npm script) whose file no root manifest script names43
conjunction (the rule)both1scripts/pm/check-governed-queue-guard.mjs

Cost of the derivation itself: zero new I/O. discoverFamilies already reads every family file once for four other answers; the payload dependence is a fifth answer off that same read, so it cannot describe a different revision of the gate than the hints printed beside it.

Three narrowings, each with the measurement that chose it:

  1. The conjunction, not limb 1 alone. Limb 2 buys nothing today (1 either way) and is not there for today. This classification SUBTRACTS a row from --commands; a subtraction that fires wrongly is silent (a real gate quietly missing from the runnable list, every dispatch order still reading normal), while a miss is loud (the status quo). The same trade one screen up in that file — declaredInheritedPopulation — was decided the same direction by maintainer ruling on 2026-08-28. A gate with a check:* name, or one that reads the payload with a git fallback, keeps its place in the list and keeps its loud red.
  2. GITHUB_EVENT_PATH alone, not the wider GITHUB_EVENT_NAME / GITHUB_BASE_REF / GITHUB_HEAD_REF / GITHUB_REF_NAME family — those are routinely read WITH a local fallback, while the payload path is the run's input or nothing. Measured: exactly one tracked file in the repo names any of the five, so widening the set changes zero classifications. The narrowing is a statement about tomorrow's gate, not today's count.
  3. Comments and self-test bodies masked, the same normalization extractWatchHints applies. Today the masked and unmasked answers agree (one file names the variable and also accesses it), so the masking costs nothing — it is the difference between classifying a gate and classifying its docblock, in the direction where a false positive is silent.

⚠️ What the rule does NOT claim: that the gate refuses. It reads a dependence, not a control-flow proof. That is why the family stays NAMED, with its provenance and the reason printed beside it, in every rendering — an annotation a reader can check against the gate, never a family this tool quietly disappears.

Not shipped, and the measurement that decided it: annotating the row with the gate's offline --self-test entry point. The workflow does invoke node scripts/pm/check-governed-queue-guard.mjs --self-test at governed-surface-guard.yml:104, but that invocation is deliberately not a discovered family (extractCheckInvocations skips a --self-test key whose script already has a check- basename, to avoid splitting one family into two), so surfacing it would need a second scan of the workflow text rather than data already in hand. Out of proportion to the row it decorates.

Before / after, on a diff touching .claude/agents/os-dev.md

BEFORE — 10 rows in the pasted block, the last one structurally red wherever a dev runs it:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more ...
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
10 matched families — 9 pnpm, 1 direct node.
Reconciliation — 10 famil(ies): this card's WHOLE runnable answer ...

--commands emitted all ten.

AFTER — 9 runnable rows in the pasted block; the family is still named, once, under its own heading past the blank line the published harvest stops at:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more, all pnpm ...
9 matched families — 9 pnpm, 0 direct node.
⇒ Harvest with --commands ...
CI-measured only — matched by path, and NOT runnable here (1 famil(ies)):
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
↳ reads the workflow event payload (GITHUB_EVENT_PATH) and is invoked only by its workflow — outside a run there is no payload to judge, and a guard that "could not look" must never exit 0, so a local run of this can only ever exit nonzero. CI measures it on the PR; there is nothing to run here, and a red from running it anyway is not a finding.
⇒ Derived from the gate's own source, not from a list of names: a family that reads the payload and has no local invocation classifies itself.
Reconciliation — 9 famil(ies): this card's WHOLE runnable answer, and the number to assert a harvest against.
9 named by PATH (the matched block) + 0 named by change KIND (the convention block) ⇒ 9 distinct.
+ 1 famil(ies) this card's paths reach are CI-MEASURED ONLY and sit OUTSIDE this total — they read the workflow event payload, so no local run of them can produce a verdict. Named under their own heading above, carried on their row in --json, and omitted from --commands by design.

--commands now prints 9, and its stderr accounting names the omission out loud beside the two omissions that mode already declared (pending-changeset families, always-runs tail) — a quiet omission inside a fix for a quiet omission is how that defect reproduces itself one layer up.

--json keeps the family as a matched row and flags it (matched[].ciOnly.env), so a machine consumer READS the omission instead of inferring it from a missing row.

--tier is structurally unaffected: its CLI branch never enters derive, discoverFamilies, commandsFor or the reconciliation.

Self-test

pnpm check:pm-dispatch-gates (the documented entry — it spawns the tool's --self-test) at 4b6dca186:

✓ dispatch-gates self-test: 1174 cases pass.
os-verify-lock: VERDICT command-exit 0 · held the lock 687s (11m27s) · waited 1s

0 failing cases. 34 of the 1174 are new here.

New cases, in the halves the file separates:

  • Unit — limb 1 reads both access spellings; a comment-only mention, a message string, a self-test fixture and an unrelated env read are each NOT classified; the LIVE guard source still carries the dependence (a fixture-only pin would stay green if that gate were rewritten). Limb 2 refuses a family a root manifest script names, refuses a check:* family outright, and limb 1 is pinned as REQUIRED (without it limb 2 alone would subtract 43 families).
  • Live derivation — exactly one family classifies, and it is the queue guard; check:nul-bytes does not; and at least one directly-invoked gate that reads no payload does not either, so the rule discriminates rather than sweeping.
  • Renderings--commands omits the row and keeps the runnable one, and keeps it omitted when a change KIND names the same family (the other section it could arrive through); the reconciliation closes on that input and carries the omission as its own term rather than charging it to a repeat; a card whose ONLY match is CI-measured still says so at a total of zero rather than reading as "nothing matched".
  • End to end, on .claude/agents/os-dev.md — a CONTROL that the family is still derived at all (a rule that dropped it entirely would pass every case below); the real published harvest snippet, driven with real awk/sed over the real rendering, no longer yields the command; --commands agrees with that harvest exactly; the human rendering still names the family with its workflow, provenance and reason; --json flags it and excludes it from commands; the stderr accounting says so.

Gates run

Derived on the real changeset with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (no paths — the script takes the change set off the merge base itself), plus the two the dispatch named. All run at 4b6dca186, each exit code captured before any pipe:

gatereading
check:pm-dispatch-gates0 — "✓ dispatch-gates self-test: 1174 cases pass." (11m27s under the shared verify lock)
check:declared-population-live0 — "156 of 200 famil(ies) declare a path population, and every one of them reaches this tree's 7811 tracked file(s)"
check:ratchet-remedy-authority0 — "183 scripts swept; 12 mark the expanding remedy ⛔ MAINTAINER-ONLY, 6 turn it down outright, 165 hand out no ratchet-expanding remedy"
check:nul-bytes · check:agent-test-spelling · check:bash32-floor · check:cli-command-ids · check:cross-package-test-inputs · check:entry-guard · check:parse-guard · check:pnpm-filter-targets · check:watch-hint-literal0 each
check-ci-filter-parity · check-cross-package-test-inputs · check-self-test-wired · check-shard-attestation0 each
check-test-completenessNOT MEASURED, exit 3 — it grades a saved turbo run test log and the family names it with no argument; its own banner says this branch is unreachable in CI and is not a red

Also self-scanned for control bytes beyond the gate (grep -naP over the edited file, exit 1 = none).

The two yaml-importing gates first returned exit 3 PREREQUISITE NOT MET in a fresh worktree; re-run after pnpm install they are green, and that first reading is recorded as NOT MEASURED rather than as a pass.

Changeset route

skip-changeset. The diff is one file, scripts/pm/dispatch-gates.mjs — PM tooling that publishes nothing from any package, so there is no user-visible change to record. Label applied at PR-open time (never left for the Check Changeset step to redden first) and read back.


Generated by Claude Code

…as runnable
`dispatch-gates` advertised `node scripts/pm/check-governed-queue-guard.mjs`
among the families under "Local gates for this card (paste into the dispatch
prompt)" and emitted it from `--commands`, whose caption promises one runnable
command per line. That gate judges the merge-queue event payload and nothing
else, so outside a workflow run its only possible outcome is EXIT=1 — every dev
on a `.claude/agents/**` diff got 9 green and 1 structurally red on a clean
tree, and a red that always fires trains its reader to discount reds.
The classification is a SHAPE read off the gate's own source, never a list of
names: limb 1, the family accesses `process.env.GITHUB_EVENT_PATH` (comments and
self-test bodies masked); limb 2, no one can run it by name here (a direct
workflow invocation, no root manifest script). Measured over the 200 discovered
families: limb 1 alone selects 1, limb 2 alone 43, the conjunction exactly 1.
The conjunction is the safe direction — this rule SUBTRACTS from `--commands`,
and a wrong subtraction is silent while a miss is loud.
The family is marked, never dropped: it keeps its own heading with its
provenance in the human rendering, is flagged as `ciOnly` on its `--json` row,
and the reconciliation carries the omission as its own term. `--tier` is
untouched. Costs no new I/O — the payload dependence is a fifth answer off the
single source read `discoverFamilies` already makes.
⛔ `check-governed-queue-guard.mjs` is not touched: its refusal is correct.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[finding] dispatch-gates lists check-governed-queue-guard among the LOCAL gates, but it can only ever exit 1 outside a workflow run

2 participants

@baozhoutao@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

fix(pm): mark CI-measured-only gate families instead of listing them as runnable - #14280

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking
Sep 1, 2026
Merged

fix(pm): mark CI-measured-only gate families instead of listing them as runnable#14280
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking

Conversation

@baozhoutao

Copy link
Copy Markdown
Contributor

Fixes#14004

dispatch-gates advertised node scripts/pm/check-governed-queue-guard.mjs among the families under "Local gates for this card (paste into the dispatch prompt)", and emitted it from --commands, whose caption promises one runnable command per line. That gate judges the merge-queue event payload and nothing else, so outside a workflow run its only possible outcome is EXIT=1. Every dev on a .claude/agents/** diff harvested 10 commands and got 9 green and 1 structurally red on a clean tree.

The derivation now classifies such a family by SHAPE, marks it in the human rendering, flags it in --json, and omits it from --commands.

scripts/pm/check-governed-queue-guard.mjs is NOT touched. Its refusal is correct and deliberate — "could not look" must never exit 0 — and triage ruled option 2 out: 「不要改那个门禁。」 The defect was upstream of it, and that is where this lands.

Premise re-check (fresh origin/main, fa1eca3)

what the card measuredre-measured here
a diff touching .claude/agents/os-dev.md derives the queue-guard row among the local gatesstill true — 10 families, the guard among them
the guard refuses locally with EXIT=1still true, byte-for-byte the same refusal text
grep -c 'GITHUB_EVENT_PATH|ciOnly|ci-only' scripts/pm/dispatch-gates.mjs is zerostill 0 — nothing at the derivation layer marked the row

Premise valid; the card is live.

The shape criterion — measured, which is the part triage left to this lane

Triage leaned to shape detection over a hand-maintained list and explicitly left the criterion's cost to be measured here. Measured on fa1eca3, over the 200 discovered families:

limbwhat it readsfamilies selected
1 — payload dependencethe gate's own source ACCESSES process.env.GITHUB_EVENT_PATH (dotted or bracketed, through a local env alias too), with comments and self-test bodies masked1
2 — no local invocationa direct workflow run: family (never a check:* npm script) whose file no root manifest script names43
conjunction (the rule)both1scripts/pm/check-governed-queue-guard.mjs

Cost of the derivation itself: zero new I/O. discoverFamilies already reads every family file once for four other answers; the payload dependence is a fifth answer off that same read, so it cannot describe a different revision of the gate than the hints printed beside it.

Three narrowings, each with the measurement that chose it:

  1. The conjunction, not limb 1 alone. Limb 2 buys nothing today (1 either way) and is not there for today. This classification SUBTRACTS a row from --commands; a subtraction that fires wrongly is silent (a real gate quietly missing from the runnable list, every dispatch order still reading normal), while a miss is loud (the status quo). The same trade one screen up in that file — declaredInheritedPopulation — was decided the same direction by maintainer ruling on 2026-08-28. A gate with a check:* name, or one that reads the payload with a git fallback, keeps its place in the list and keeps its loud red.
  2. GITHUB_EVENT_PATH alone, not the wider GITHUB_EVENT_NAME / GITHUB_BASE_REF / GITHUB_HEAD_REF / GITHUB_REF_NAME family — those are routinely read WITH a local fallback, while the payload path is the run's input or nothing. Measured: exactly one tracked file in the repo names any of the five, so widening the set changes zero classifications. The narrowing is a statement about tomorrow's gate, not today's count.
  3. Comments and self-test bodies masked, the same normalization extractWatchHints applies. Today the masked and unmasked answers agree (one file names the variable and also accesses it), so the masking costs nothing — it is the difference between classifying a gate and classifying its docblock, in the direction where a false positive is silent.

⚠️ What the rule does NOT claim: that the gate refuses. It reads a dependence, not a control-flow proof. That is why the family stays NAMED, with its provenance and the reason printed beside it, in every rendering — an annotation a reader can check against the gate, never a family this tool quietly disappears.

Not shipped, and the measurement that decided it: annotating the row with the gate's offline --self-test entry point. The workflow does invoke node scripts/pm/check-governed-queue-guard.mjs --self-test at governed-surface-guard.yml:104, but that invocation is deliberately not a discovered family (extractCheckInvocations skips a --self-test key whose script already has a check- basename, to avoid splitting one family into two), so surfacing it would need a second scan of the workflow text rather than data already in hand. Out of proportion to the row it decorates.

Before / after, on a diff touching .claude/agents/os-dev.md

BEFORE — 10 rows in the pasted block, the last one structurally red wherever a dev runs it:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more ...
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
10 matched families — 9 pnpm, 1 direct node.
Reconciliation — 10 famil(ies): this card's WHOLE runnable answer ...

--commands emitted all ten.

AFTER — 9 runnable rows in the pasted block; the family is still named, once, under its own heading past the blank line the published harvest stops at:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more, all pnpm ...
9 matched families — 9 pnpm, 0 direct node.
⇒ Harvest with --commands ...
CI-measured only — matched by path, and NOT runnable here (1 famil(ies)):
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
↳ reads the workflow event payload (GITHUB_EVENT_PATH) and is invoked only by its workflow — outside a run there is no payload to judge, and a guard that "could not look" must never exit 0, so a local run of this can only ever exit nonzero. CI measures it on the PR; there is nothing to run here, and a red from running it anyway is not a finding.
⇒ Derived from the gate's own source, not from a list of names: a family that reads the payload and has no local invocation classifies itself.
Reconciliation — 9 famil(ies): this card's WHOLE runnable answer, and the number to assert a harvest against.
9 named by PATH (the matched block) + 0 named by change KIND (the convention block) ⇒ 9 distinct.
+ 1 famil(ies) this card's paths reach are CI-MEASURED ONLY and sit OUTSIDE this total — they read the workflow event payload, so no local run of them can produce a verdict. Named under their own heading above, carried on their row in --json, and omitted from --commands by design.

--commands now prints 9, and its stderr accounting names the omission out loud beside the two omissions that mode already declared (pending-changeset families, always-runs tail) — a quiet omission inside a fix for a quiet omission is how that defect reproduces itself one layer up.

--json keeps the family as a matched row and flags it (matched[].ciOnly.env), so a machine consumer READS the omission instead of inferring it from a missing row.

--tier is structurally unaffected: its CLI branch never enters derive, discoverFamilies, commandsFor or the reconciliation.

Self-test

pnpm check:pm-dispatch-gates (the documented entry — it spawns the tool's --self-test) at 4b6dca186:

✓ dispatch-gates self-test: 1174 cases pass.
os-verify-lock: VERDICT command-exit 0 · held the lock 687s (11m27s) · waited 1s

0 failing cases. 34 of the 1174 are new here.

New cases, in the halves the file separates:

  • Unit — limb 1 reads both access spellings; a comment-only mention, a message string, a self-test fixture and an unrelated env read are each NOT classified; the LIVE guard source still carries the dependence (a fixture-only pin would stay green if that gate were rewritten). Limb 2 refuses a family a root manifest script names, refuses a check:* family outright, and limb 1 is pinned as REQUIRED (without it limb 2 alone would subtract 43 families).
  • Live derivation — exactly one family classifies, and it is the queue guard; check:nul-bytes does not; and at least one directly-invoked gate that reads no payload does not either, so the rule discriminates rather than sweeping.
  • Renderings--commands omits the row and keeps the runnable one, and keeps it omitted when a change KIND names the same family (the other section it could arrive through); the reconciliation closes on that input and carries the omission as its own term rather than charging it to a repeat; a card whose ONLY match is CI-measured still says so at a total of zero rather than reading as "nothing matched".
  • End to end, on .claude/agents/os-dev.md — a CONTROL that the family is still derived at all (a rule that dropped it entirely would pass every case below); the real published harvest snippet, driven with real awk/sed over the real rendering, no longer yields the command; --commands agrees with that harvest exactly; the human rendering still names the family with its workflow, provenance and reason; --json flags it and excludes it from commands; the stderr accounting says so.

Gates run

Derived on the real changeset with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (no paths — the script takes the change set off the merge base itself), plus the two the dispatch named. All run at 4b6dca186, each exit code captured before any pipe:

gatereading
check:pm-dispatch-gates0 — "✓ dispatch-gates self-test: 1174 cases pass." (11m27s under the shared verify lock)
check:declared-population-live0 — "156 of 200 famil(ies) declare a path population, and every one of them reaches this tree's 7811 tracked file(s)"
check:ratchet-remedy-authority0 — "183 scripts swept; 12 mark the expanding remedy ⛔ MAINTAINER-ONLY, 6 turn it down outright, 165 hand out no ratchet-expanding remedy"
check:nul-bytes · check:agent-test-spelling · check:bash32-floor · check:cli-command-ids · check:cross-package-test-inputs · check:entry-guard · check:parse-guard · check:pnpm-filter-targets · check:watch-hint-literal0 each
check-ci-filter-parity · check-cross-package-test-inputs · check-self-test-wired · check-shard-attestation0 each
check-test-completenessNOT MEASURED, exit 3 — it grades a saved turbo run test log and the family names it with no argument; its own banner says this branch is unreachable in CI and is not a red

Also self-scanned for control bytes beyond the gate (grep -naP over the edited file, exit 1 = none).

The two yaml-importing gates first returned exit 3 PREREQUISITE NOT MET in a fresh worktree; re-run after pnpm install they are green, and that first reading is recorded as NOT MEASURED rather than as a pass.

Changeset route

skip-changeset. The diff is one file, scripts/pm/dispatch-gates.mjs — PM tooling that publishes nothing from any package, so there is no user-visible change to record. Label applied at PR-open time (never left for the Check Changeset step to redden first) and read back.


Generated by Claude Code

…as runnable
`dispatch-gates` advertised `node scripts/pm/check-governed-queue-guard.mjs`
among the families under "Local gates for this card (paste into the dispatch
prompt)" and emitted it from `--commands`, whose caption promises one runnable
command per line. That gate judges the merge-queue event payload and nothing
else, so outside a workflow run its only possible outcome is EXIT=1 — every dev
on a `.claude/agents/**` diff got 9 green and 1 structurally red on a clean
tree, and a red that always fires trains its reader to discount reds.
The classification is a SHAPE read off the gate's own source, never a list of
names: limb 1, the family accesses `process.env.GITHUB_EVENT_PATH` (comments and
self-test bodies masked); limb 2, no one can run it by name here (a direct
workflow invocation, no root manifest script). Measured over the 200 discovered
families: limb 1 alone selects 1, limb 2 alone 43, the conjunction exactly 1.
The conjunction is the safe direction — this rule SUBTRACTS from `--commands`,
and a wrong subtraction is silent while a miss is loud.
The family is marked, never dropped: it keeps its own heading with its
provenance in the human rendering, is flagged as `ciOnly` on its `--json` row,
and the reconciliation carries the omission as its own term. `--tier` is
untouched. Costs no new I/O — the payload dependence is a fifth answer off the
single source read `discoverFamilies` already makes.
⛔ `check-governed-queue-guard.mjs` is not touched: its refusal is correct.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[finding] dispatch-gates lists check-governed-queue-guard among the LOCAL gates, but it can only ever exit 1 outside a workflow run

2 participants

@baozhoutao@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(pm): mark CI-measured-only gate families instead of listing them as runnable - #14280

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking
Sep 1, 2026
Merged

fix(pm): mark CI-measured-only gate families instead of listing them as runnable#14280
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking

Conversation

@baozhoutao

Copy link
Copy Markdown
Contributor

Fixes#14004

dispatch-gates advertised node scripts/pm/check-governed-queue-guard.mjs among the families under "Local gates for this card (paste into the dispatch prompt)", and emitted it from --commands, whose caption promises one runnable command per line. That gate judges the merge-queue event payload and nothing else, so outside a workflow run its only possible outcome is EXIT=1. Every dev on a .claude/agents/** diff harvested 10 commands and got 9 green and 1 structurally red on a clean tree.

The derivation now classifies such a family by SHAPE, marks it in the human rendering, flags it in --json, and omits it from --commands.

scripts/pm/check-governed-queue-guard.mjs is NOT touched. Its refusal is correct and deliberate — "could not look" must never exit 0 — and triage ruled option 2 out: 「不要改那个门禁。」 The defect was upstream of it, and that is where this lands.

Premise re-check (fresh origin/main, fa1eca3)

what the card measuredre-measured here
a diff touching .claude/agents/os-dev.md derives the queue-guard row among the local gatesstill true — 10 families, the guard among them
the guard refuses locally with EXIT=1still true, byte-for-byte the same refusal text
grep -c 'GITHUB_EVENT_PATH|ciOnly|ci-only' scripts/pm/dispatch-gates.mjs is zerostill 0 — nothing at the derivation layer marked the row

Premise valid; the card is live.

The shape criterion — measured, which is the part triage left to this lane

Triage leaned to shape detection over a hand-maintained list and explicitly left the criterion's cost to be measured here. Measured on fa1eca3, over the 200 discovered families:

limbwhat it readsfamilies selected
1 — payload dependencethe gate's own source ACCESSES process.env.GITHUB_EVENT_PATH (dotted or bracketed, through a local env alias too), with comments and self-test bodies masked1
2 — no local invocationa direct workflow run: family (never a check:* npm script) whose file no root manifest script names43
conjunction (the rule)both1scripts/pm/check-governed-queue-guard.mjs

Cost of the derivation itself: zero new I/O. discoverFamilies already reads every family file once for four other answers; the payload dependence is a fifth answer off that same read, so it cannot describe a different revision of the gate than the hints printed beside it.

Three narrowings, each with the measurement that chose it:

  1. The conjunction, not limb 1 alone. Limb 2 buys nothing today (1 either way) and is not there for today. This classification SUBTRACTS a row from --commands; a subtraction that fires wrongly is silent (a real gate quietly missing from the runnable list, every dispatch order still reading normal), while a miss is loud (the status quo). The same trade one screen up in that file — declaredInheritedPopulation — was decided the same direction by maintainer ruling on 2026-08-28. A gate with a check:* name, or one that reads the payload with a git fallback, keeps its place in the list and keeps its loud red.
  2. GITHUB_EVENT_PATH alone, not the wider GITHUB_EVENT_NAME / GITHUB_BASE_REF / GITHUB_HEAD_REF / GITHUB_REF_NAME family — those are routinely read WITH a local fallback, while the payload path is the run's input or nothing. Measured: exactly one tracked file in the repo names any of the five, so widening the set changes zero classifications. The narrowing is a statement about tomorrow's gate, not today's count.
  3. Comments and self-test bodies masked, the same normalization extractWatchHints applies. Today the masked and unmasked answers agree (one file names the variable and also accesses it), so the masking costs nothing — it is the difference between classifying a gate and classifying its docblock, in the direction where a false positive is silent.

⚠️ What the rule does NOT claim: that the gate refuses. It reads a dependence, not a control-flow proof. That is why the family stays NAMED, with its provenance and the reason printed beside it, in every rendering — an annotation a reader can check against the gate, never a family this tool quietly disappears.

Not shipped, and the measurement that decided it: annotating the row with the gate's offline --self-test entry point. The workflow does invoke node scripts/pm/check-governed-queue-guard.mjs --self-test at governed-surface-guard.yml:104, but that invocation is deliberately not a discovered family (extractCheckInvocations skips a --self-test key whose script already has a check- basename, to avoid splitting one family into two), so surfacing it would need a second scan of the workflow text rather than data already in hand. Out of proportion to the row it decorates.

Before / after, on a diff touching .claude/agents/os-dev.md

BEFORE — 10 rows in the pasted block, the last one structurally red wherever a dev runs it:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more ...
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
10 matched families — 9 pnpm, 1 direct node.
Reconciliation — 10 famil(ies): this card's WHOLE runnable answer ...

--commands emitted all ten.

AFTER — 9 runnable rows in the pasted block; the family is still named, once, under its own heading past the blank line the published harvest stops at:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more, all pnpm ...
9 matched families — 9 pnpm, 0 direct node.
⇒ Harvest with --commands ...
CI-measured only — matched by path, and NOT runnable here (1 famil(ies)):
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
↳ reads the workflow event payload (GITHUB_EVENT_PATH) and is invoked only by its workflow — outside a run there is no payload to judge, and a guard that "could not look" must never exit 0, so a local run of this can only ever exit nonzero. CI measures it on the PR; there is nothing to run here, and a red from running it anyway is not a finding.
⇒ Derived from the gate's own source, not from a list of names: a family that reads the payload and has no local invocation classifies itself.
Reconciliation — 9 famil(ies): this card's WHOLE runnable answer, and the number to assert a harvest against.
9 named by PATH (the matched block) + 0 named by change KIND (the convention block) ⇒ 9 distinct.
+ 1 famil(ies) this card's paths reach are CI-MEASURED ONLY and sit OUTSIDE this total — they read the workflow event payload, so no local run of them can produce a verdict. Named under their own heading above, carried on their row in --json, and omitted from --commands by design.

--commands now prints 9, and its stderr accounting names the omission out loud beside the two omissions that mode already declared (pending-changeset families, always-runs tail) — a quiet omission inside a fix for a quiet omission is how that defect reproduces itself one layer up.

--json keeps the family as a matched row and flags it (matched[].ciOnly.env), so a machine consumer READS the omission instead of inferring it from a missing row.

--tier is structurally unaffected: its CLI branch never enters derive, discoverFamilies, commandsFor or the reconciliation.

Self-test

pnpm check:pm-dispatch-gates (the documented entry — it spawns the tool's --self-test) at 4b6dca186:

✓ dispatch-gates self-test: 1174 cases pass.
os-verify-lock: VERDICT command-exit 0 · held the lock 687s (11m27s) · waited 1s

0 failing cases. 34 of the 1174 are new here.

New cases, in the halves the file separates:

  • Unit — limb 1 reads both access spellings; a comment-only mention, a message string, a self-test fixture and an unrelated env read are each NOT classified; the LIVE guard source still carries the dependence (a fixture-only pin would stay green if that gate were rewritten). Limb 2 refuses a family a root manifest script names, refuses a check:* family outright, and limb 1 is pinned as REQUIRED (without it limb 2 alone would subtract 43 families).
  • Live derivation — exactly one family classifies, and it is the queue guard; check:nul-bytes does not; and at least one directly-invoked gate that reads no payload does not either, so the rule discriminates rather than sweeping.
  • Renderings--commands omits the row and keeps the runnable one, and keeps it omitted when a change KIND names the same family (the other section it could arrive through); the reconciliation closes on that input and carries the omission as its own term rather than charging it to a repeat; a card whose ONLY match is CI-measured still says so at a total of zero rather than reading as "nothing matched".
  • End to end, on .claude/agents/os-dev.md — a CONTROL that the family is still derived at all (a rule that dropped it entirely would pass every case below); the real published harvest snippet, driven with real awk/sed over the real rendering, no longer yields the command; --commands agrees with that harvest exactly; the human rendering still names the family with its workflow, provenance and reason; --json flags it and excludes it from commands; the stderr accounting says so.

Gates run

Derived on the real changeset with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (no paths — the script takes the change set off the merge base itself), plus the two the dispatch named. All run at 4b6dca186, each exit code captured before any pipe:

gatereading
check:pm-dispatch-gates0 — "✓ dispatch-gates self-test: 1174 cases pass." (11m27s under the shared verify lock)
check:declared-population-live0 — "156 of 200 famil(ies) declare a path population, and every one of them reaches this tree's 7811 tracked file(s)"
check:ratchet-remedy-authority0 — "183 scripts swept; 12 mark the expanding remedy ⛔ MAINTAINER-ONLY, 6 turn it down outright, 165 hand out no ratchet-expanding remedy"
check:nul-bytes · check:agent-test-spelling · check:bash32-floor · check:cli-command-ids · check:cross-package-test-inputs · check:entry-guard · check:parse-guard · check:pnpm-filter-targets · check:watch-hint-literal0 each
check-ci-filter-parity · check-cross-package-test-inputs · check-self-test-wired · check-shard-attestation0 each
check-test-completenessNOT MEASURED, exit 3 — it grades a saved turbo run test log and the family names it with no argument; its own banner says this branch is unreachable in CI and is not a red

Also self-scanned for control bytes beyond the gate (grep -naP over the edited file, exit 1 = none).

The two yaml-importing gates first returned exit 3 PREREQUISITE NOT MET in a fresh worktree; re-run after pnpm install they are green, and that first reading is recorded as NOT MEASURED rather than as a pass.

Changeset route

skip-changeset. The diff is one file, scripts/pm/dispatch-gates.mjs — PM tooling that publishes nothing from any package, so there is no user-visible change to record. Label applied at PR-open time (never left for the Check Changeset step to redden first) and read back.


Generated by Claude Code

…as runnable
`dispatch-gates` advertised `node scripts/pm/check-governed-queue-guard.mjs`
among the families under "Local gates for this card (paste into the dispatch
prompt)" and emitted it from `--commands`, whose caption promises one runnable
command per line. That gate judges the merge-queue event payload and nothing
else, so outside a workflow run its only possible outcome is EXIT=1 — every dev
on a `.claude/agents/**` diff got 9 green and 1 structurally red on a clean
tree, and a red that always fires trains its reader to discount reds.
The classification is a SHAPE read off the gate's own source, never a list of
names: limb 1, the family accesses `process.env.GITHUB_EVENT_PATH` (comments and
self-test bodies masked); limb 2, no one can run it by name here (a direct
workflow invocation, no root manifest script). Measured over the 200 discovered
families: limb 1 alone selects 1, limb 2 alone 43, the conjunction exactly 1.
The conjunction is the safe direction — this rule SUBTRACTS from `--commands`,
and a wrong subtraction is silent while a miss is loud.
The family is marked, never dropped: it keeps its own heading with its
provenance in the human rendering, is flagged as `ciOnly` on its `--json` row,
and the reconciliation carries the omission as its own term. `--tier` is
untouched. Costs no new I/O — the payload dependence is a fifth answer off the
single source read `discoverFamilies` already makes.
⛔ `check-governed-queue-guard.mjs` is not touched: its refusal is correct.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[finding] dispatch-gates lists check-governed-queue-guard among the LOCAL gates, but it can only ever exit 1 outside a workflow run

2 participants

@baozhoutao@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(pm): mark CI-measured-only gate families instead of listing them as runnable - #14280

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking
Sep 1, 2026
Merged

fix(pm): mark CI-measured-only gate families instead of listing them as runnable#14280
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking

Conversation

@baozhoutao

Copy link
Copy Markdown
Contributor

Fixes#14004

dispatch-gates advertised node scripts/pm/check-governed-queue-guard.mjs among the families under "Local gates for this card (paste into the dispatch prompt)", and emitted it from --commands, whose caption promises one runnable command per line. That gate judges the merge-queue event payload and nothing else, so outside a workflow run its only possible outcome is EXIT=1. Every dev on a .claude/agents/** diff harvested 10 commands and got 9 green and 1 structurally red on a clean tree.

The derivation now classifies such a family by SHAPE, marks it in the human rendering, flags it in --json, and omits it from --commands.

scripts/pm/check-governed-queue-guard.mjs is NOT touched. Its refusal is correct and deliberate — "could not look" must never exit 0 — and triage ruled option 2 out: 「不要改那个门禁。」 The defect was upstream of it, and that is where this lands.

Premise re-check (fresh origin/main, fa1eca3)

what the card measuredre-measured here
a diff touching .claude/agents/os-dev.md derives the queue-guard row among the local gatesstill true — 10 families, the guard among them
the guard refuses locally with EXIT=1still true, byte-for-byte the same refusal text
grep -c 'GITHUB_EVENT_PATH|ciOnly|ci-only' scripts/pm/dispatch-gates.mjs is zerostill 0 — nothing at the derivation layer marked the row

Premise valid; the card is live.

The shape criterion — measured, which is the part triage left to this lane

Triage leaned to shape detection over a hand-maintained list and explicitly left the criterion's cost to be measured here. Measured on fa1eca3, over the 200 discovered families:

limbwhat it readsfamilies selected
1 — payload dependencethe gate's own source ACCESSES process.env.GITHUB_EVENT_PATH (dotted or bracketed, through a local env alias too), with comments and self-test bodies masked1
2 — no local invocationa direct workflow run: family (never a check:* npm script) whose file no root manifest script names43
conjunction (the rule)both1scripts/pm/check-governed-queue-guard.mjs

Cost of the derivation itself: zero new I/O. discoverFamilies already reads every family file once for four other answers; the payload dependence is a fifth answer off that same read, so it cannot describe a different revision of the gate than the hints printed beside it.

Three narrowings, each with the measurement that chose it:

  1. The conjunction, not limb 1 alone. Limb 2 buys nothing today (1 either way) and is not there for today. This classification SUBTRACTS a row from --commands; a subtraction that fires wrongly is silent (a real gate quietly missing from the runnable list, every dispatch order still reading normal), while a miss is loud (the status quo). The same trade one screen up in that file — declaredInheritedPopulation — was decided the same direction by maintainer ruling on 2026-08-28. A gate with a check:* name, or one that reads the payload with a git fallback, keeps its place in the list and keeps its loud red.
  2. GITHUB_EVENT_PATH alone, not the wider GITHUB_EVENT_NAME / GITHUB_BASE_REF / GITHUB_HEAD_REF / GITHUB_REF_NAME family — those are routinely read WITH a local fallback, while the payload path is the run's input or nothing. Measured: exactly one tracked file in the repo names any of the five, so widening the set changes zero classifications. The narrowing is a statement about tomorrow's gate, not today's count.
  3. Comments and self-test bodies masked, the same normalization extractWatchHints applies. Today the masked and unmasked answers agree (one file names the variable and also accesses it), so the masking costs nothing — it is the difference between classifying a gate and classifying its docblock, in the direction where a false positive is silent.

⚠️ What the rule does NOT claim: that the gate refuses. It reads a dependence, not a control-flow proof. That is why the family stays NAMED, with its provenance and the reason printed beside it, in every rendering — an annotation a reader can check against the gate, never a family this tool quietly disappears.

Not shipped, and the measurement that decided it: annotating the row with the gate's offline --self-test entry point. The workflow does invoke node scripts/pm/check-governed-queue-guard.mjs --self-test at governed-surface-guard.yml:104, but that invocation is deliberately not a discovered family (extractCheckInvocations skips a --self-test key whose script already has a check- basename, to avoid splitting one family into two), so surfacing it would need a second scan of the workflow text rather than data already in hand. Out of proportion to the row it decorates.

Before / after, on a diff touching .claude/agents/os-dev.md

BEFORE — 10 rows in the pasted block, the last one structurally red wherever a dev runs it:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more ...
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
10 matched families — 9 pnpm, 1 direct node.
Reconciliation — 10 famil(ies): this card's WHOLE runnable answer ...

--commands emitted all ten.

AFTER — 9 runnable rows in the pasted block; the family is still named, once, under its own heading past the blank line the published harvest stops at:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more, all pnpm ...
9 matched families — 9 pnpm, 0 direct node.
⇒ Harvest with --commands ...
CI-measured only — matched by path, and NOT runnable here (1 famil(ies)):
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
↳ reads the workflow event payload (GITHUB_EVENT_PATH) and is invoked only by its workflow — outside a run there is no payload to judge, and a guard that "could not look" must never exit 0, so a local run of this can only ever exit nonzero. CI measures it on the PR; there is nothing to run here, and a red from running it anyway is not a finding.
⇒ Derived from the gate's own source, not from a list of names: a family that reads the payload and has no local invocation classifies itself.
Reconciliation — 9 famil(ies): this card's WHOLE runnable answer, and the number to assert a harvest against.
9 named by PATH (the matched block) + 0 named by change KIND (the convention block) ⇒ 9 distinct.
+ 1 famil(ies) this card's paths reach are CI-MEASURED ONLY and sit OUTSIDE this total — they read the workflow event payload, so no local run of them can produce a verdict. Named under their own heading above, carried on their row in --json, and omitted from --commands by design.

--commands now prints 9, and its stderr accounting names the omission out loud beside the two omissions that mode already declared (pending-changeset families, always-runs tail) — a quiet omission inside a fix for a quiet omission is how that defect reproduces itself one layer up.

--json keeps the family as a matched row and flags it (matched[].ciOnly.env), so a machine consumer READS the omission instead of inferring it from a missing row.

--tier is structurally unaffected: its CLI branch never enters derive, discoverFamilies, commandsFor or the reconciliation.

Self-test

pnpm check:pm-dispatch-gates (the documented entry — it spawns the tool's --self-test) at 4b6dca186:

✓ dispatch-gates self-test: 1174 cases pass.
os-verify-lock: VERDICT command-exit 0 · held the lock 687s (11m27s) · waited 1s

0 failing cases. 34 of the 1174 are new here.

New cases, in the halves the file separates:

  • Unit — limb 1 reads both access spellings; a comment-only mention, a message string, a self-test fixture and an unrelated env read are each NOT classified; the LIVE guard source still carries the dependence (a fixture-only pin would stay green if that gate were rewritten). Limb 2 refuses a family a root manifest script names, refuses a check:* family outright, and limb 1 is pinned as REQUIRED (without it limb 2 alone would subtract 43 families).
  • Live derivation — exactly one family classifies, and it is the queue guard; check:nul-bytes does not; and at least one directly-invoked gate that reads no payload does not either, so the rule discriminates rather than sweeping.
  • Renderings--commands omits the row and keeps the runnable one, and keeps it omitted when a change KIND names the same family (the other section it could arrive through); the reconciliation closes on that input and carries the omission as its own term rather than charging it to a repeat; a card whose ONLY match is CI-measured still says so at a total of zero rather than reading as "nothing matched".
  • End to end, on .claude/agents/os-dev.md — a CONTROL that the family is still derived at all (a rule that dropped it entirely would pass every case below); the real published harvest snippet, driven with real awk/sed over the real rendering, no longer yields the command; --commands agrees with that harvest exactly; the human rendering still names the family with its workflow, provenance and reason; --json flags it and excludes it from commands; the stderr accounting says so.

Gates run

Derived on the real changeset with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (no paths — the script takes the change set off the merge base itself), plus the two the dispatch named. All run at 4b6dca186, each exit code captured before any pipe:

gatereading
check:pm-dispatch-gates0 — "✓ dispatch-gates self-test: 1174 cases pass." (11m27s under the shared verify lock)
check:declared-population-live0 — "156 of 200 famil(ies) declare a path population, and every one of them reaches this tree's 7811 tracked file(s)"
check:ratchet-remedy-authority0 — "183 scripts swept; 12 mark the expanding remedy ⛔ MAINTAINER-ONLY, 6 turn it down outright, 165 hand out no ratchet-expanding remedy"
check:nul-bytes · check:agent-test-spelling · check:bash32-floor · check:cli-command-ids · check:cross-package-test-inputs · check:entry-guard · check:parse-guard · check:pnpm-filter-targets · check:watch-hint-literal0 each
check-ci-filter-parity · check-cross-package-test-inputs · check-self-test-wired · check-shard-attestation0 each
check-test-completenessNOT MEASURED, exit 3 — it grades a saved turbo run test log and the family names it with no argument; its own banner says this branch is unreachable in CI and is not a red

Also self-scanned for control bytes beyond the gate (grep -naP over the edited file, exit 1 = none).

The two yaml-importing gates first returned exit 3 PREREQUISITE NOT MET in a fresh worktree; re-run after pnpm install they are green, and that first reading is recorded as NOT MEASURED rather than as a pass.

Changeset route

skip-changeset. The diff is one file, scripts/pm/dispatch-gates.mjs — PM tooling that publishes nothing from any package, so there is no user-visible change to record. Label applied at PR-open time (never left for the Check Changeset step to redden first) and read back.


Generated by Claude Code

…as runnable
`dispatch-gates` advertised `node scripts/pm/check-governed-queue-guard.mjs`
among the families under "Local gates for this card (paste into the dispatch
prompt)" and emitted it from `--commands`, whose caption promises one runnable
command per line. That gate judges the merge-queue event payload and nothing
else, so outside a workflow run its only possible outcome is EXIT=1 — every dev
on a `.claude/agents/**` diff got 9 green and 1 structurally red on a clean
tree, and a red that always fires trains its reader to discount reds.
The classification is a SHAPE read off the gate's own source, never a list of
names: limb 1, the family accesses `process.env.GITHUB_EVENT_PATH` (comments and
self-test bodies masked); limb 2, no one can run it by name here (a direct
workflow invocation, no root manifest script). Measured over the 200 discovered
families: limb 1 alone selects 1, limb 2 alone 43, the conjunction exactly 1.
The conjunction is the safe direction — this rule SUBTRACTS from `--commands`,
and a wrong subtraction is silent while a miss is loud.
The family is marked, never dropped: it keeps its own heading with its
provenance in the human rendering, is flagged as `ciOnly` on its `--json` row,
and the reconciliation carries the omission as its own term. `--tier` is
untouched. Costs no new I/O — the payload dependence is a fifth answer off the
single source read `discoverFamilies` already makes.
⛔ `check-governed-queue-guard.mjs` is not touched: its refusal is correct.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[finding] dispatch-gates lists check-governed-queue-guard among the LOCAL gates, but it can only ever exit 1 outside a workflow run

2 participants

@baozhoutao@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

fix(pm): mark CI-measured-only gate families instead of listing them as runnable - #14280

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking
Sep 1, 2026
Merged

fix(pm): mark CI-measured-only gate families instead of listing them as runnable#14280
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking

Conversation

@baozhoutao

Copy link
Copy Markdown
Contributor

Fixes#14004

dispatch-gates advertised node scripts/pm/check-governed-queue-guard.mjs among the families under "Local gates for this card (paste into the dispatch prompt)", and emitted it from --commands, whose caption promises one runnable command per line. That gate judges the merge-queue event payload and nothing else, so outside a workflow run its only possible outcome is EXIT=1. Every dev on a .claude/agents/** diff harvested 10 commands and got 9 green and 1 structurally red on a clean tree.

The derivation now classifies such a family by SHAPE, marks it in the human rendering, flags it in --json, and omits it from --commands.

scripts/pm/check-governed-queue-guard.mjs is NOT touched. Its refusal is correct and deliberate — "could not look" must never exit 0 — and triage ruled option 2 out: 「不要改那个门禁。」 The defect was upstream of it, and that is where this lands.

Premise re-check (fresh origin/main, fa1eca3)

what the card measuredre-measured here
a diff touching .claude/agents/os-dev.md derives the queue-guard row among the local gatesstill true — 10 families, the guard among them
the guard refuses locally with EXIT=1still true, byte-for-byte the same refusal text
grep -c 'GITHUB_EVENT_PATH|ciOnly|ci-only' scripts/pm/dispatch-gates.mjs is zerostill 0 — nothing at the derivation layer marked the row

Premise valid; the card is live.

The shape criterion — measured, which is the part triage left to this lane

Triage leaned to shape detection over a hand-maintained list and explicitly left the criterion's cost to be measured here. Measured on fa1eca3, over the 200 discovered families:

limbwhat it readsfamilies selected
1 — payload dependencethe gate's own source ACCESSES process.env.GITHUB_EVENT_PATH (dotted or bracketed, through a local env alias too), with comments and self-test bodies masked1
2 — no local invocationa direct workflow run: family (never a check:* npm script) whose file no root manifest script names43
conjunction (the rule)both1scripts/pm/check-governed-queue-guard.mjs

Cost of the derivation itself: zero new I/O. discoverFamilies already reads every family file once for four other answers; the payload dependence is a fifth answer off that same read, so it cannot describe a different revision of the gate than the hints printed beside it.

Three narrowings, each with the measurement that chose it:

  1. The conjunction, not limb 1 alone. Limb 2 buys nothing today (1 either way) and is not there for today. This classification SUBTRACTS a row from --commands; a subtraction that fires wrongly is silent (a real gate quietly missing from the runnable list, every dispatch order still reading normal), while a miss is loud (the status quo). The same trade one screen up in that file — declaredInheritedPopulation — was decided the same direction by maintainer ruling on 2026-08-28. A gate with a check:* name, or one that reads the payload with a git fallback, keeps its place in the list and keeps its loud red.
  2. GITHUB_EVENT_PATH alone, not the wider GITHUB_EVENT_NAME / GITHUB_BASE_REF / GITHUB_HEAD_REF / GITHUB_REF_NAME family — those are routinely read WITH a local fallback, while the payload path is the run's input or nothing. Measured: exactly one tracked file in the repo names any of the five, so widening the set changes zero classifications. The narrowing is a statement about tomorrow's gate, not today's count.
  3. Comments and self-test bodies masked, the same normalization extractWatchHints applies. Today the masked and unmasked answers agree (one file names the variable and also accesses it), so the masking costs nothing — it is the difference between classifying a gate and classifying its docblock, in the direction where a false positive is silent.

⚠️ What the rule does NOT claim: that the gate refuses. It reads a dependence, not a control-flow proof. That is why the family stays NAMED, with its provenance and the reason printed beside it, in every rendering — an annotation a reader can check against the gate, never a family this tool quietly disappears.

Not shipped, and the measurement that decided it: annotating the row with the gate's offline --self-test entry point. The workflow does invoke node scripts/pm/check-governed-queue-guard.mjs --self-test at governed-surface-guard.yml:104, but that invocation is deliberately not a discovered family (extractCheckInvocations skips a --self-test key whose script already has a check- basename, to avoid splitting one family into two), so surfacing it would need a second scan of the workflow text rather than data already in hand. Out of proportion to the row it decorates.

Before / after, on a diff touching .claude/agents/os-dev.md

BEFORE — 10 rows in the pasted block, the last one structurally red wherever a dev runs it:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more ...
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
10 matched families — 9 pnpm, 1 direct node.
Reconciliation — 10 famil(ies): this card's WHOLE runnable answer ...

--commands emitted all ten.

AFTER — 9 runnable rows in the pasted block; the family is still named, once, under its own heading past the blank line the published harvest stops at:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more, all pnpm ...
9 matched families — 9 pnpm, 0 direct node.
⇒ Harvest with --commands ...
CI-measured only — matched by path, and NOT runnable here (1 famil(ies)):
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
↳ reads the workflow event payload (GITHUB_EVENT_PATH) and is invoked only by its workflow — outside a run there is no payload to judge, and a guard that "could not look" must never exit 0, so a local run of this can only ever exit nonzero. CI measures it on the PR; there is nothing to run here, and a red from running it anyway is not a finding.
⇒ Derived from the gate's own source, not from a list of names: a family that reads the payload and has no local invocation classifies itself.
Reconciliation — 9 famil(ies): this card's WHOLE runnable answer, and the number to assert a harvest against.
9 named by PATH (the matched block) + 0 named by change KIND (the convention block) ⇒ 9 distinct.
+ 1 famil(ies) this card's paths reach are CI-MEASURED ONLY and sit OUTSIDE this total — they read the workflow event payload, so no local run of them can produce a verdict. Named under their own heading above, carried on their row in --json, and omitted from --commands by design.

--commands now prints 9, and its stderr accounting names the omission out loud beside the two omissions that mode already declared (pending-changeset families, always-runs tail) — a quiet omission inside a fix for a quiet omission is how that defect reproduces itself one layer up.

--json keeps the family as a matched row and flags it (matched[].ciOnly.env), so a machine consumer READS the omission instead of inferring it from a missing row.

--tier is structurally unaffected: its CLI branch never enters derive, discoverFamilies, commandsFor or the reconciliation.

Self-test

pnpm check:pm-dispatch-gates (the documented entry — it spawns the tool's --self-test) at 4b6dca186:

✓ dispatch-gates self-test: 1174 cases pass.
os-verify-lock: VERDICT command-exit 0 · held the lock 687s (11m27s) · waited 1s

0 failing cases. 34 of the 1174 are new here.

New cases, in the halves the file separates:

  • Unit — limb 1 reads both access spellings; a comment-only mention, a message string, a self-test fixture and an unrelated env read are each NOT classified; the LIVE guard source still carries the dependence (a fixture-only pin would stay green if that gate were rewritten). Limb 2 refuses a family a root manifest script names, refuses a check:* family outright, and limb 1 is pinned as REQUIRED (without it limb 2 alone would subtract 43 families).
  • Live derivation — exactly one family classifies, and it is the queue guard; check:nul-bytes does not; and at least one directly-invoked gate that reads no payload does not either, so the rule discriminates rather than sweeping.
  • Renderings--commands omits the row and keeps the runnable one, and keeps it omitted when a change KIND names the same family (the other section it could arrive through); the reconciliation closes on that input and carries the omission as its own term rather than charging it to a repeat; a card whose ONLY match is CI-measured still says so at a total of zero rather than reading as "nothing matched".
  • End to end, on .claude/agents/os-dev.md — a CONTROL that the family is still derived at all (a rule that dropped it entirely would pass every case below); the real published harvest snippet, driven with real awk/sed over the real rendering, no longer yields the command; --commands agrees with that harvest exactly; the human rendering still names the family with its workflow, provenance and reason; --json flags it and excludes it from commands; the stderr accounting says so.

Gates run

Derived on the real changeset with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (no paths — the script takes the change set off the merge base itself), plus the two the dispatch named. All run at 4b6dca186, each exit code captured before any pipe:

gatereading
check:pm-dispatch-gates0 — "✓ dispatch-gates self-test: 1174 cases pass." (11m27s under the shared verify lock)
check:declared-population-live0 — "156 of 200 famil(ies) declare a path population, and every one of them reaches this tree's 7811 tracked file(s)"
check:ratchet-remedy-authority0 — "183 scripts swept; 12 mark the expanding remedy ⛔ MAINTAINER-ONLY, 6 turn it down outright, 165 hand out no ratchet-expanding remedy"
check:nul-bytes · check:agent-test-spelling · check:bash32-floor · check:cli-command-ids · check:cross-package-test-inputs · check:entry-guard · check:parse-guard · check:pnpm-filter-targets · check:watch-hint-literal0 each
check-ci-filter-parity · check-cross-package-test-inputs · check-self-test-wired · check-shard-attestation0 each
check-test-completenessNOT MEASURED, exit 3 — it grades a saved turbo run test log and the family names it with no argument; its own banner says this branch is unreachable in CI and is not a red

Also self-scanned for control bytes beyond the gate (grep -naP over the edited file, exit 1 = none).

The two yaml-importing gates first returned exit 3 PREREQUISITE NOT MET in a fresh worktree; re-run after pnpm install they are green, and that first reading is recorded as NOT MEASURED rather than as a pass.

Changeset route

skip-changeset. The diff is one file, scripts/pm/dispatch-gates.mjs — PM tooling that publishes nothing from any package, so there is no user-visible change to record. Label applied at PR-open time (never left for the Check Changeset step to redden first) and read back.


Generated by Claude Code

…as runnable
`dispatch-gates` advertised `node scripts/pm/check-governed-queue-guard.mjs`
among the families under "Local gates for this card (paste into the dispatch
prompt)" and emitted it from `--commands`, whose caption promises one runnable
command per line. That gate judges the merge-queue event payload and nothing
else, so outside a workflow run its only possible outcome is EXIT=1 — every dev
on a `.claude/agents/**` diff got 9 green and 1 structurally red on a clean
tree, and a red that always fires trains its reader to discount reds.
The classification is a SHAPE read off the gate's own source, never a list of
names: limb 1, the family accesses `process.env.GITHUB_EVENT_PATH` (comments and
self-test bodies masked); limb 2, no one can run it by name here (a direct
workflow invocation, no root manifest script). Measured over the 200 discovered
families: limb 1 alone selects 1, limb 2 alone 43, the conjunction exactly 1.
The conjunction is the safe direction — this rule SUBTRACTS from `--commands`,
and a wrong subtraction is silent while a miss is loud.
The family is marked, never dropped: it keeps its own heading with its
provenance in the human rendering, is flagged as `ciOnly` on its `--json` row,
and the reconciliation carries the omission as its own term. `--tier` is
untouched. Costs no new I/O — the payload dependence is a fifth answer off the
single source read `discoverFamilies` already makes.
⛔ `check-governed-queue-guard.mjs` is not touched: its refusal is correct.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[finding] dispatch-gates lists check-governed-queue-guard among the LOCAL gates, but it can only ever exit 1 outside a workflow run

2 participants

@baozhoutao@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(pm): mark CI-measured-only gate families instead of listing them as runnable - #14280

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking
Sep 1, 2026
Merged

fix(pm): mark CI-measured-only gate families instead of listing them as runnable#14280
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking

Conversation

@baozhoutao

Copy link
Copy Markdown
Contributor

Fixes#14004

dispatch-gates advertised node scripts/pm/check-governed-queue-guard.mjs among the families under "Local gates for this card (paste into the dispatch prompt)", and emitted it from --commands, whose caption promises one runnable command per line. That gate judges the merge-queue event payload and nothing else, so outside a workflow run its only possible outcome is EXIT=1. Every dev on a .claude/agents/** diff harvested 10 commands and got 9 green and 1 structurally red on a clean tree.

The derivation now classifies such a family by SHAPE, marks it in the human rendering, flags it in --json, and omits it from --commands.

scripts/pm/check-governed-queue-guard.mjs is NOT touched. Its refusal is correct and deliberate — "could not look" must never exit 0 — and triage ruled option 2 out: 「不要改那个门禁。」 The defect was upstream of it, and that is where this lands.

Premise re-check (fresh origin/main, fa1eca3)

what the card measuredre-measured here
a diff touching .claude/agents/os-dev.md derives the queue-guard row among the local gatesstill true — 10 families, the guard among them
the guard refuses locally with EXIT=1still true, byte-for-byte the same refusal text
grep -c 'GITHUB_EVENT_PATH|ciOnly|ci-only' scripts/pm/dispatch-gates.mjs is zerostill 0 — nothing at the derivation layer marked the row

Premise valid; the card is live.

The shape criterion — measured, which is the part triage left to this lane

Triage leaned to shape detection over a hand-maintained list and explicitly left the criterion's cost to be measured here. Measured on fa1eca3, over the 200 discovered families:

limbwhat it readsfamilies selected
1 — payload dependencethe gate's own source ACCESSES process.env.GITHUB_EVENT_PATH (dotted or bracketed, through a local env alias too), with comments and self-test bodies masked1
2 — no local invocationa direct workflow run: family (never a check:* npm script) whose file no root manifest script names43
conjunction (the rule)both1scripts/pm/check-governed-queue-guard.mjs

Cost of the derivation itself: zero new I/O. discoverFamilies already reads every family file once for four other answers; the payload dependence is a fifth answer off that same read, so it cannot describe a different revision of the gate than the hints printed beside it.

Three narrowings, each with the measurement that chose it:

  1. The conjunction, not limb 1 alone. Limb 2 buys nothing today (1 either way) and is not there for today. This classification SUBTRACTS a row from --commands; a subtraction that fires wrongly is silent (a real gate quietly missing from the runnable list, every dispatch order still reading normal), while a miss is loud (the status quo). The same trade one screen up in that file — declaredInheritedPopulation — was decided the same direction by maintainer ruling on 2026-08-28. A gate with a check:* name, or one that reads the payload with a git fallback, keeps its place in the list and keeps its loud red.
  2. GITHUB_EVENT_PATH alone, not the wider GITHUB_EVENT_NAME / GITHUB_BASE_REF / GITHUB_HEAD_REF / GITHUB_REF_NAME family — those are routinely read WITH a local fallback, while the payload path is the run's input or nothing. Measured: exactly one tracked file in the repo names any of the five, so widening the set changes zero classifications. The narrowing is a statement about tomorrow's gate, not today's count.
  3. Comments and self-test bodies masked, the same normalization extractWatchHints applies. Today the masked and unmasked answers agree (one file names the variable and also accesses it), so the masking costs nothing — it is the difference between classifying a gate and classifying its docblock, in the direction where a false positive is silent.

⚠️ What the rule does NOT claim: that the gate refuses. It reads a dependence, not a control-flow proof. That is why the family stays NAMED, with its provenance and the reason printed beside it, in every rendering — an annotation a reader can check against the gate, never a family this tool quietly disappears.

Not shipped, and the measurement that decided it: annotating the row with the gate's offline --self-test entry point. The workflow does invoke node scripts/pm/check-governed-queue-guard.mjs --self-test at governed-surface-guard.yml:104, but that invocation is deliberately not a discovered family (extractCheckInvocations skips a --self-test key whose script already has a check- basename, to avoid splitting one family into two), so surfacing it would need a second scan of the workflow text rather than data already in hand. Out of proportion to the row it decorates.

Before / after, on a diff touching .claude/agents/os-dev.md

BEFORE — 10 rows in the pasted block, the last one structurally red wherever a dev runs it:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more ...
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
10 matched families — 9 pnpm, 1 direct node.
Reconciliation — 10 famil(ies): this card's WHOLE runnable answer ...

--commands emitted all ten.

AFTER — 9 runnable rows in the pasted block; the family is still named, once, under its own heading past the blank line the published harvest stops at:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more, all pnpm ...
9 matched families — 9 pnpm, 0 direct node.
⇒ Harvest with --commands ...
CI-measured only — matched by path, and NOT runnable here (1 famil(ies)):
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
↳ reads the workflow event payload (GITHUB_EVENT_PATH) and is invoked only by its workflow — outside a run there is no payload to judge, and a guard that "could not look" must never exit 0, so a local run of this can only ever exit nonzero. CI measures it on the PR; there is nothing to run here, and a red from running it anyway is not a finding.
⇒ Derived from the gate's own source, not from a list of names: a family that reads the payload and has no local invocation classifies itself.
Reconciliation — 9 famil(ies): this card's WHOLE runnable answer, and the number to assert a harvest against.
9 named by PATH (the matched block) + 0 named by change KIND (the convention block) ⇒ 9 distinct.
+ 1 famil(ies) this card's paths reach are CI-MEASURED ONLY and sit OUTSIDE this total — they read the workflow event payload, so no local run of them can produce a verdict. Named under their own heading above, carried on their row in --json, and omitted from --commands by design.

--commands now prints 9, and its stderr accounting names the omission out loud beside the two omissions that mode already declared (pending-changeset families, always-runs tail) — a quiet omission inside a fix for a quiet omission is how that defect reproduces itself one layer up.

--json keeps the family as a matched row and flags it (matched[].ciOnly.env), so a machine consumer READS the omission instead of inferring it from a missing row.

--tier is structurally unaffected: its CLI branch never enters derive, discoverFamilies, commandsFor or the reconciliation.

Self-test

pnpm check:pm-dispatch-gates (the documented entry — it spawns the tool's --self-test) at 4b6dca186:

✓ dispatch-gates self-test: 1174 cases pass.
os-verify-lock: VERDICT command-exit 0 · held the lock 687s (11m27s) · waited 1s

0 failing cases. 34 of the 1174 are new here.

New cases, in the halves the file separates:

  • Unit — limb 1 reads both access spellings; a comment-only mention, a message string, a self-test fixture and an unrelated env read are each NOT classified; the LIVE guard source still carries the dependence (a fixture-only pin would stay green if that gate were rewritten). Limb 2 refuses a family a root manifest script names, refuses a check:* family outright, and limb 1 is pinned as REQUIRED (without it limb 2 alone would subtract 43 families).
  • Live derivation — exactly one family classifies, and it is the queue guard; check:nul-bytes does not; and at least one directly-invoked gate that reads no payload does not either, so the rule discriminates rather than sweeping.
  • Renderings--commands omits the row and keeps the runnable one, and keeps it omitted when a change KIND names the same family (the other section it could arrive through); the reconciliation closes on that input and carries the omission as its own term rather than charging it to a repeat; a card whose ONLY match is CI-measured still says so at a total of zero rather than reading as "nothing matched".
  • End to end, on .claude/agents/os-dev.md — a CONTROL that the family is still derived at all (a rule that dropped it entirely would pass every case below); the real published harvest snippet, driven with real awk/sed over the real rendering, no longer yields the command; --commands agrees with that harvest exactly; the human rendering still names the family with its workflow, provenance and reason; --json flags it and excludes it from commands; the stderr accounting says so.

Gates run

Derived on the real changeset with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (no paths — the script takes the change set off the merge base itself), plus the two the dispatch named. All run at 4b6dca186, each exit code captured before any pipe:

gatereading
check:pm-dispatch-gates0 — "✓ dispatch-gates self-test: 1174 cases pass." (11m27s under the shared verify lock)
check:declared-population-live0 — "156 of 200 famil(ies) declare a path population, and every one of them reaches this tree's 7811 tracked file(s)"
check:ratchet-remedy-authority0 — "183 scripts swept; 12 mark the expanding remedy ⛔ MAINTAINER-ONLY, 6 turn it down outright, 165 hand out no ratchet-expanding remedy"
check:nul-bytes · check:agent-test-spelling · check:bash32-floor · check:cli-command-ids · check:cross-package-test-inputs · check:entry-guard · check:parse-guard · check:pnpm-filter-targets · check:watch-hint-literal0 each
check-ci-filter-parity · check-cross-package-test-inputs · check-self-test-wired · check-shard-attestation0 each
check-test-completenessNOT MEASURED, exit 3 — it grades a saved turbo run test log and the family names it with no argument; its own banner says this branch is unreachable in CI and is not a red

Also self-scanned for control bytes beyond the gate (grep -naP over the edited file, exit 1 = none).

The two yaml-importing gates first returned exit 3 PREREQUISITE NOT MET in a fresh worktree; re-run after pnpm install they are green, and that first reading is recorded as NOT MEASURED rather than as a pass.

Changeset route

skip-changeset. The diff is one file, scripts/pm/dispatch-gates.mjs — PM tooling that publishes nothing from any package, so there is no user-visible change to record. Label applied at PR-open time (never left for the Check Changeset step to redden first) and read back.


Generated by Claude Code

…as runnable
`dispatch-gates` advertised `node scripts/pm/check-governed-queue-guard.mjs`
among the families under "Local gates for this card (paste into the dispatch
prompt)" and emitted it from `--commands`, whose caption promises one runnable
command per line. That gate judges the merge-queue event payload and nothing
else, so outside a workflow run its only possible outcome is EXIT=1 — every dev
on a `.claude/agents/**` diff got 9 green and 1 structurally red on a clean
tree, and a red that always fires trains its reader to discount reds.
The classification is a SHAPE read off the gate's own source, never a list of
names: limb 1, the family accesses `process.env.GITHUB_EVENT_PATH` (comments and
self-test bodies masked); limb 2, no one can run it by name here (a direct
workflow invocation, no root manifest script). Measured over the 200 discovered
families: limb 1 alone selects 1, limb 2 alone 43, the conjunction exactly 1.
The conjunction is the safe direction — this rule SUBTRACTS from `--commands`,
and a wrong subtraction is silent while a miss is loud.
The family is marked, never dropped: it keeps its own heading with its
provenance in the human rendering, is flagged as `ciOnly` on its `--json` row,
and the reconciliation carries the omission as its own term. `--tier` is
untouched. Costs no new I/O — the payload dependence is a fifth answer off the
single source read `discoverFamilies` already makes.
⛔ `check-governed-queue-guard.mjs` is not touched: its refusal is correct.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[finding] dispatch-gates lists check-governed-queue-guard among the LOCAL gates, but it can only ever exit 1 outside a workflow run

2 participants

@baozhoutao@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(pm): mark CI-measured-only gate families instead of listing them as runnable - #14280

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking
Sep 1, 2026
Merged

fix(pm): mark CI-measured-only gate families instead of listing them as runnable#14280
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking

Conversation

@baozhoutao

Copy link
Copy Markdown
Contributor

Fixes#14004

dispatch-gates advertised node scripts/pm/check-governed-queue-guard.mjs among the families under "Local gates for this card (paste into the dispatch prompt)", and emitted it from --commands, whose caption promises one runnable command per line. That gate judges the merge-queue event payload and nothing else, so outside a workflow run its only possible outcome is EXIT=1. Every dev on a .claude/agents/** diff harvested 10 commands and got 9 green and 1 structurally red on a clean tree.

The derivation now classifies such a family by SHAPE, marks it in the human rendering, flags it in --json, and omits it from --commands.

scripts/pm/check-governed-queue-guard.mjs is NOT touched. Its refusal is correct and deliberate — "could not look" must never exit 0 — and triage ruled option 2 out: 「不要改那个门禁。」 The defect was upstream of it, and that is where this lands.

Premise re-check (fresh origin/main, fa1eca3)

what the card measuredre-measured here
a diff touching .claude/agents/os-dev.md derives the queue-guard row among the local gatesstill true — 10 families, the guard among them
the guard refuses locally with EXIT=1still true, byte-for-byte the same refusal text
grep -c 'GITHUB_EVENT_PATH|ciOnly|ci-only' scripts/pm/dispatch-gates.mjs is zerostill 0 — nothing at the derivation layer marked the row

Premise valid; the card is live.

The shape criterion — measured, which is the part triage left to this lane

Triage leaned to shape detection over a hand-maintained list and explicitly left the criterion's cost to be measured here. Measured on fa1eca3, over the 200 discovered families:

limbwhat it readsfamilies selected
1 — payload dependencethe gate's own source ACCESSES process.env.GITHUB_EVENT_PATH (dotted or bracketed, through a local env alias too), with comments and self-test bodies masked1
2 — no local invocationa direct workflow run: family (never a check:* npm script) whose file no root manifest script names43
conjunction (the rule)both1scripts/pm/check-governed-queue-guard.mjs

Cost of the derivation itself: zero new I/O. discoverFamilies already reads every family file once for four other answers; the payload dependence is a fifth answer off that same read, so it cannot describe a different revision of the gate than the hints printed beside it.

Three narrowings, each with the measurement that chose it:

  1. The conjunction, not limb 1 alone. Limb 2 buys nothing today (1 either way) and is not there for today. This classification SUBTRACTS a row from --commands; a subtraction that fires wrongly is silent (a real gate quietly missing from the runnable list, every dispatch order still reading normal), while a miss is loud (the status quo). The same trade one screen up in that file — declaredInheritedPopulation — was decided the same direction by maintainer ruling on 2026-08-28. A gate with a check:* name, or one that reads the payload with a git fallback, keeps its place in the list and keeps its loud red.
  2. GITHUB_EVENT_PATH alone, not the wider GITHUB_EVENT_NAME / GITHUB_BASE_REF / GITHUB_HEAD_REF / GITHUB_REF_NAME family — those are routinely read WITH a local fallback, while the payload path is the run's input or nothing. Measured: exactly one tracked file in the repo names any of the five, so widening the set changes zero classifications. The narrowing is a statement about tomorrow's gate, not today's count.
  3. Comments and self-test bodies masked, the same normalization extractWatchHints applies. Today the masked and unmasked answers agree (one file names the variable and also accesses it), so the masking costs nothing — it is the difference between classifying a gate and classifying its docblock, in the direction where a false positive is silent.

⚠️ What the rule does NOT claim: that the gate refuses. It reads a dependence, not a control-flow proof. That is why the family stays NAMED, with its provenance and the reason printed beside it, in every rendering — an annotation a reader can check against the gate, never a family this tool quietly disappears.

Not shipped, and the measurement that decided it: annotating the row with the gate's offline --self-test entry point. The workflow does invoke node scripts/pm/check-governed-queue-guard.mjs --self-test at governed-surface-guard.yml:104, but that invocation is deliberately not a discovered family (extractCheckInvocations skips a --self-test key whose script already has a check- basename, to avoid splitting one family into two), so surfacing it would need a second scan of the workflow text rather than data already in hand. Out of proportion to the row it decorates.

Before / after, on a diff touching .claude/agents/os-dev.md

BEFORE — 10 rows in the pasted block, the last one structurally red wherever a dev runs it:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more ...
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
10 matched families — 9 pnpm, 1 direct node.
Reconciliation — 10 famil(ies): this card's WHOLE runnable answer ...

--commands emitted all ten.

AFTER — 9 runnable rows in the pasted block; the family is still named, once, under its own heading past the blank line the published harvest stops at:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more, all pnpm ...
9 matched families — 9 pnpm, 0 direct node.
⇒ Harvest with --commands ...
CI-measured only — matched by path, and NOT runnable here (1 famil(ies)):
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
↳ reads the workflow event payload (GITHUB_EVENT_PATH) and is invoked only by its workflow — outside a run there is no payload to judge, and a guard that "could not look" must never exit 0, so a local run of this can only ever exit nonzero. CI measures it on the PR; there is nothing to run here, and a red from running it anyway is not a finding.
⇒ Derived from the gate's own source, not from a list of names: a family that reads the payload and has no local invocation classifies itself.
Reconciliation — 9 famil(ies): this card's WHOLE runnable answer, and the number to assert a harvest against.
9 named by PATH (the matched block) + 0 named by change KIND (the convention block) ⇒ 9 distinct.
+ 1 famil(ies) this card's paths reach are CI-MEASURED ONLY and sit OUTSIDE this total — they read the workflow event payload, so no local run of them can produce a verdict. Named under their own heading above, carried on their row in --json, and omitted from --commands by design.

--commands now prints 9, and its stderr accounting names the omission out loud beside the two omissions that mode already declared (pending-changeset families, always-runs tail) — a quiet omission inside a fix for a quiet omission is how that defect reproduces itself one layer up.

--json keeps the family as a matched row and flags it (matched[].ciOnly.env), so a machine consumer READS the omission instead of inferring it from a missing row.

--tier is structurally unaffected: its CLI branch never enters derive, discoverFamilies, commandsFor or the reconciliation.

Self-test

pnpm check:pm-dispatch-gates (the documented entry — it spawns the tool's --self-test) at 4b6dca186:

✓ dispatch-gates self-test: 1174 cases pass.
os-verify-lock: VERDICT command-exit 0 · held the lock 687s (11m27s) · waited 1s

0 failing cases. 34 of the 1174 are new here.

New cases, in the halves the file separates:

  • Unit — limb 1 reads both access spellings; a comment-only mention, a message string, a self-test fixture and an unrelated env read are each NOT classified; the LIVE guard source still carries the dependence (a fixture-only pin would stay green if that gate were rewritten). Limb 2 refuses a family a root manifest script names, refuses a check:* family outright, and limb 1 is pinned as REQUIRED (without it limb 2 alone would subtract 43 families).
  • Live derivation — exactly one family classifies, and it is the queue guard; check:nul-bytes does not; and at least one directly-invoked gate that reads no payload does not either, so the rule discriminates rather than sweeping.
  • Renderings--commands omits the row and keeps the runnable one, and keeps it omitted when a change KIND names the same family (the other section it could arrive through); the reconciliation closes on that input and carries the omission as its own term rather than charging it to a repeat; a card whose ONLY match is CI-measured still says so at a total of zero rather than reading as "nothing matched".
  • End to end, on .claude/agents/os-dev.md — a CONTROL that the family is still derived at all (a rule that dropped it entirely would pass every case below); the real published harvest snippet, driven with real awk/sed over the real rendering, no longer yields the command; --commands agrees with that harvest exactly; the human rendering still names the family with its workflow, provenance and reason; --json flags it and excludes it from commands; the stderr accounting says so.

Gates run

Derived on the real changeset with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (no paths — the script takes the change set off the merge base itself), plus the two the dispatch named. All run at 4b6dca186, each exit code captured before any pipe:

gatereading
check:pm-dispatch-gates0 — "✓ dispatch-gates self-test: 1174 cases pass." (11m27s under the shared verify lock)
check:declared-population-live0 — "156 of 200 famil(ies) declare a path population, and every one of them reaches this tree's 7811 tracked file(s)"
check:ratchet-remedy-authority0 — "183 scripts swept; 12 mark the expanding remedy ⛔ MAINTAINER-ONLY, 6 turn it down outright, 165 hand out no ratchet-expanding remedy"
check:nul-bytes · check:agent-test-spelling · check:bash32-floor · check:cli-command-ids · check:cross-package-test-inputs · check:entry-guard · check:parse-guard · check:pnpm-filter-targets · check:watch-hint-literal0 each
check-ci-filter-parity · check-cross-package-test-inputs · check-self-test-wired · check-shard-attestation0 each
check-test-completenessNOT MEASURED, exit 3 — it grades a saved turbo run test log and the family names it with no argument; its own banner says this branch is unreachable in CI and is not a red

Also self-scanned for control bytes beyond the gate (grep -naP over the edited file, exit 1 = none).

The two yaml-importing gates first returned exit 3 PREREQUISITE NOT MET in a fresh worktree; re-run after pnpm install they are green, and that first reading is recorded as NOT MEASURED rather than as a pass.

Changeset route

skip-changeset. The diff is one file, scripts/pm/dispatch-gates.mjs — PM tooling that publishes nothing from any package, so there is no user-visible change to record. Label applied at PR-open time (never left for the Check Changeset step to redden first) and read back.


Generated by Claude Code

…as runnable
`dispatch-gates` advertised `node scripts/pm/check-governed-queue-guard.mjs`
among the families under "Local gates for this card (paste into the dispatch
prompt)" and emitted it from `--commands`, whose caption promises one runnable
command per line. That gate judges the merge-queue event payload and nothing
else, so outside a workflow run its only possible outcome is EXIT=1 — every dev
on a `.claude/agents/**` diff got 9 green and 1 structurally red on a clean
tree, and a red that always fires trains its reader to discount reds.
The classification is a SHAPE read off the gate's own source, never a list of
names: limb 1, the family accesses `process.env.GITHUB_EVENT_PATH` (comments and
self-test bodies masked); limb 2, no one can run it by name here (a direct
workflow invocation, no root manifest script). Measured over the 200 discovered
families: limb 1 alone selects 1, limb 2 alone 43, the conjunction exactly 1.
The conjunction is the safe direction — this rule SUBTRACTS from `--commands`,
and a wrong subtraction is silent while a miss is loud.
The family is marked, never dropped: it keeps its own heading with its
provenance in the human rendering, is flagged as `ciOnly` on its `--json` row,
and the reconciliation carries the omission as its own term. `--tier` is
untouched. Costs no new I/O — the payload dependence is a fifth answer off the
single source read `discoverFamilies` already makes.
⛔ `check-governed-queue-guard.mjs` is not touched: its refusal is correct.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[finding] dispatch-gates lists check-governed-queue-guard among the LOCAL gates, but it can only ever exit 1 outside a workflow run

2 participants

@baozhoutao@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

fix(pm): mark CI-measured-only gate families instead of listing them as runnable - #14280

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking
Sep 1, 2026
Merged

fix(pm): mark CI-measured-only gate families instead of listing them as runnable#14280
baozhoutao merged 1 commit into
mainfrom
claude/issue-14004-ci-only-gate-marking

Conversation

@baozhoutao

Copy link
Copy Markdown
Contributor

Fixes#14004

dispatch-gates advertised node scripts/pm/check-governed-queue-guard.mjs among the families under "Local gates for this card (paste into the dispatch prompt)", and emitted it from --commands, whose caption promises one runnable command per line. That gate judges the merge-queue event payload and nothing else, so outside a workflow run its only possible outcome is EXIT=1. Every dev on a .claude/agents/** diff harvested 10 commands and got 9 green and 1 structurally red on a clean tree.

The derivation now classifies such a family by SHAPE, marks it in the human rendering, flags it in --json, and omits it from --commands.

scripts/pm/check-governed-queue-guard.mjs is NOT touched. Its refusal is correct and deliberate — "could not look" must never exit 0 — and triage ruled option 2 out: 「不要改那个门禁。」 The defect was upstream of it, and that is where this lands.

Premise re-check (fresh origin/main, fa1eca3)

what the card measuredre-measured here
a diff touching .claude/agents/os-dev.md derives the queue-guard row among the local gatesstill true — 10 families, the guard among them
the guard refuses locally with EXIT=1still true, byte-for-byte the same refusal text
grep -c 'GITHUB_EVENT_PATH|ciOnly|ci-only' scripts/pm/dispatch-gates.mjs is zerostill 0 — nothing at the derivation layer marked the row

Premise valid; the card is live.

The shape criterion — measured, which is the part triage left to this lane

Triage leaned to shape detection over a hand-maintained list and explicitly left the criterion's cost to be measured here. Measured on fa1eca3, over the 200 discovered families:

limbwhat it readsfamilies selected
1 — payload dependencethe gate's own source ACCESSES process.env.GITHUB_EVENT_PATH (dotted or bracketed, through a local env alias too), with comments and self-test bodies masked1
2 — no local invocationa direct workflow run: family (never a check:* npm script) whose file no root manifest script names43
conjunction (the rule)both1scripts/pm/check-governed-queue-guard.mjs

Cost of the derivation itself: zero new I/O. discoverFamilies already reads every family file once for four other answers; the payload dependence is a fifth answer off that same read, so it cannot describe a different revision of the gate than the hints printed beside it.

Three narrowings, each with the measurement that chose it:

  1. The conjunction, not limb 1 alone. Limb 2 buys nothing today (1 either way) and is not there for today. This classification SUBTRACTS a row from --commands; a subtraction that fires wrongly is silent (a real gate quietly missing from the runnable list, every dispatch order still reading normal), while a miss is loud (the status quo). The same trade one screen up in that file — declaredInheritedPopulation — was decided the same direction by maintainer ruling on 2026-08-28. A gate with a check:* name, or one that reads the payload with a git fallback, keeps its place in the list and keeps its loud red.
  2. GITHUB_EVENT_PATH alone, not the wider GITHUB_EVENT_NAME / GITHUB_BASE_REF / GITHUB_HEAD_REF / GITHUB_REF_NAME family — those are routinely read WITH a local fallback, while the payload path is the run's input or nothing. Measured: exactly one tracked file in the repo names any of the five, so widening the set changes zero classifications. The narrowing is a statement about tomorrow's gate, not today's count.
  3. Comments and self-test bodies masked, the same normalization extractWatchHints applies. Today the masked and unmasked answers agree (one file names the variable and also accesses it), so the masking costs nothing — it is the difference between classifying a gate and classifying its docblock, in the direction where a false positive is silent.

⚠️ What the rule does NOT claim: that the gate refuses. It reads a dependence, not a control-flow proof. That is why the family stays NAMED, with its provenance and the reason printed beside it, in every rendering — an annotation a reader can check against the gate, never a family this tool quietly disappears.

Not shipped, and the measurement that decided it: annotating the row with the gate's offline --self-test entry point. The workflow does invoke node scripts/pm/check-governed-queue-guard.mjs --self-test at governed-surface-guard.yml:104, but that invocation is deliberately not a discovered family (extractCheckInvocations skips a --self-test key whose script already has a check- basename, to avoid splitting one family into two), so surfacing it would need a second scan of the workflow text rather than data already in hand. Out of proportion to the row it decorates.

Before / after, on a diff touching .claude/agents/os-dev.md

BEFORE — 10 rows in the pasted block, the last one structurally red wherever a dev runs it:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more ...
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
10 matched families — 9 pnpm, 1 direct node.
Reconciliation — 10 famil(ies): this card's WHOLE runnable answer ...

--commands emitted all ten.

AFTER — 9 runnable rows in the pasted block; the family is still named, once, under its own heading past the blank line the published harvest stops at:

Local gates for this card (paste into the dispatch prompt):
- pnpm check:agent-model-declared [lint.yml] matched via ...
... 8 more, all pnpm ...
9 matched families — 9 pnpm, 0 direct node.
⇒ Harvest with --commands ...
CI-measured only — matched by path, and NOT runnable here (1 famil(ies)):
- node scripts/pm/check-governed-queue-guard.mjs [governed-surface-guard.yml] matched via .claude/agents/os-dev.md ⇢ gate source '.claude/agents/os-dev.md'
↳ reads the workflow event payload (GITHUB_EVENT_PATH) and is invoked only by its workflow — outside a run there is no payload to judge, and a guard that "could not look" must never exit 0, so a local run of this can only ever exit nonzero. CI measures it on the PR; there is nothing to run here, and a red from running it anyway is not a finding.
⇒ Derived from the gate's own source, not from a list of names: a family that reads the payload and has no local invocation classifies itself.
Reconciliation — 9 famil(ies): this card's WHOLE runnable answer, and the number to assert a harvest against.
9 named by PATH (the matched block) + 0 named by change KIND (the convention block) ⇒ 9 distinct.
+ 1 famil(ies) this card's paths reach are CI-MEASURED ONLY and sit OUTSIDE this total — they read the workflow event payload, so no local run of them can produce a verdict. Named under their own heading above, carried on their row in --json, and omitted from --commands by design.

--commands now prints 9, and its stderr accounting names the omission out loud beside the two omissions that mode already declared (pending-changeset families, always-runs tail) — a quiet omission inside a fix for a quiet omission is how that defect reproduces itself one layer up.

--json keeps the family as a matched row and flags it (matched[].ciOnly.env), so a machine consumer READS the omission instead of inferring it from a missing row.

--tier is structurally unaffected: its CLI branch never enters derive, discoverFamilies, commandsFor or the reconciliation.

Self-test

pnpm check:pm-dispatch-gates (the documented entry — it spawns the tool's --self-test) at 4b6dca186:

✓ dispatch-gates self-test: 1174 cases pass.
os-verify-lock: VERDICT command-exit 0 · held the lock 687s (11m27s) · waited 1s

0 failing cases. 34 of the 1174 are new here.

New cases, in the halves the file separates:

  • Unit — limb 1 reads both access spellings; a comment-only mention, a message string, a self-test fixture and an unrelated env read are each NOT classified; the LIVE guard source still carries the dependence (a fixture-only pin would stay green if that gate were rewritten). Limb 2 refuses a family a root manifest script names, refuses a check:* family outright, and limb 1 is pinned as REQUIRED (without it limb 2 alone would subtract 43 families).
  • Live derivation — exactly one family classifies, and it is the queue guard; check:nul-bytes does not; and at least one directly-invoked gate that reads no payload does not either, so the rule discriminates rather than sweeping.
  • Renderings--commands omits the row and keeps the runnable one, and keeps it omitted when a change KIND names the same family (the other section it could arrive through); the reconciliation closes on that input and carries the omission as its own term rather than charging it to a repeat; a card whose ONLY match is CI-measured still says so at a total of zero rather than reading as "nothing matched".
  • End to end, on .claude/agents/os-dev.md — a CONTROL that the family is still derived at all (a rule that dropped it entirely would pass every case below); the real published harvest snippet, driven with real awk/sed over the real rendering, no longer yields the command; --commands agrees with that harvest exactly; the human rendering still names the family with its workflow, provenance and reason; --json flags it and excludes it from commands; the stderr accounting says so.

Gates run

Derived on the real changeset with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (no paths — the script takes the change set off the merge base itself), plus the two the dispatch named. All run at 4b6dca186, each exit code captured before any pipe:

gatereading
check:pm-dispatch-gates0 — "✓ dispatch-gates self-test: 1174 cases pass." (11m27s under the shared verify lock)
check:declared-population-live0 — "156 of 200 famil(ies) declare a path population, and every one of them reaches this tree's 7811 tracked file(s)"
check:ratchet-remedy-authority0 — "183 scripts swept; 12 mark the expanding remedy ⛔ MAINTAINER-ONLY, 6 turn it down outright, 165 hand out no ratchet-expanding remedy"
check:nul-bytes · check:agent-test-spelling · check:bash32-floor · check:cli-command-ids · check:cross-package-test-inputs · check:entry-guard · check:parse-guard · check:pnpm-filter-targets · check:watch-hint-literal0 each
check-ci-filter-parity · check-cross-package-test-inputs · check-self-test-wired · check-shard-attestation0 each
check-test-completenessNOT MEASURED, exit 3 — it grades a saved turbo run test log and the family names it with no argument; its own banner says this branch is unreachable in CI and is not a red

Also self-scanned for control bytes beyond the gate (grep -naP over the edited file, exit 1 = none).

The two yaml-importing gates first returned exit 3 PREREQUISITE NOT MET in a fresh worktree; re-run after pnpm install they are green, and that first reading is recorded as NOT MEASURED rather than as a pass.

Changeset route

skip-changeset. The diff is one file, scripts/pm/dispatch-gates.mjs — PM tooling that publishes nothing from any package, so there is no user-visible change to record. Label applied at PR-open time (never left for the Check Changeset step to redden first) and read back.


Generated by Claude Code

…as runnable
`dispatch-gates` advertised `node scripts/pm/check-governed-queue-guard.mjs`
among the families under "Local gates for this card (paste into the dispatch
prompt)" and emitted it from `--commands`, whose caption promises one runnable
command per line. That gate judges the merge-queue event payload and nothing
else, so outside a workflow run its only possible outcome is EXIT=1 — every dev
on a `.claude/agents/**` diff got 9 green and 1 structurally red on a clean
tree, and a red that always fires trains its reader to discount reds.
The classification is a SHAPE read off the gate's own source, never a list of
names: limb 1, the family accesses `process.env.GITHUB_EVENT_PATH` (comments and
self-test bodies masked); limb 2, no one can run it by name here (a direct
workflow invocation, no root manifest script). Measured over the 200 discovered
families: limb 1 alone selects 1, limb 2 alone 43, the conjunction exactly 1.
The conjunction is the safe direction — this rule SUBTRACTS from `--commands`,
and a wrong subtraction is silent while a miss is loud.
The family is marked, never dropped: it keeps its own heading with its
provenance in the human rendering, is flagged as `ciOnly` on its `--json` row,
and the reconciliation carries the omission as its own term. `--tier` is
untouched. Costs no new I/O — the payload dependence is a fifth answer off the
single source read `discoverFamilies` already makes.
⛔ `check-governed-queue-guard.mjs` is not touched: its refusal is correct.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[finding] dispatch-gates lists check-governed-queue-guard among the LOCAL gates, but it can only ever exit 1 outside a workflow run

2 participants

@baozhoutao@claude