Skip to content

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading - #13962

Merged
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock
Aug 31, 2026
Merged

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading#13962
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock

Conversation

@claude

@claudeclaudeBot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#13536

The defect

The invokedDirectly docblock in scripts/pm/dispatch-gates.mjs sized this file's own self-test with a frozen literal:

That is the same defect PR #9897 fixed in check-governed-merges.mjs at 77 assertions; this file carries it at 334.

334 was a reading of cases.length — a number the self-test computes and prints at runtime. It had drifted to 1073, a factor of 3.2. The figure is load-bearing prose: it is the severity term in the argument for why a self-test must be a MODE of the file being run and never a side effect of importing it. Writing today's number would re-freeze the same defect one value later, which is exactly how the card describes the original mistake.

Zone 2 A — the history measurement that chose the shape

Question: has this file's self-test case count ever DECREASED across a commit?

Answer: no — not once, over the file's entire life.

Method. The runtime count is cases.length, accumulated by const t = (name, cond) => cases.push([name, cond]). Running the self-test at every historical commit is not affordable (a single run is 2–6 minutes on this shared box), so I used a static proxy — the count of t( call sites — and validated the proxy against the live run before trusting it:

readingvalue
static t( call sites at 9c4c431fd1047
file-local loop expansions (below)+26
predicted runtime1073
actual --self-test output1073 cases pass

The +26 is fully accounted for, and every multiplier is a literal array in this file — no loop draws its population from the repo tree, so the printed count is a function of this file plus a few existsSync branches:

  • rootFileDeclarations (8 entries, 2 assertions each) +14
  • ['check:entry-guard', 'check:parse-guard'] (3 assertions each) +3
  • the 4-element fabricated list +3
  • ['check:docs', 'check:skill-refs'] +2
  • ['check:i18n', 'check:i18n-coverage'] +2
  • misparsedFamilySources, packageLedgerFamilySources (2 entries each) +1 each

Result over all 83 commits that have touched the file (2026-08-10 through 2026-08-31, git log --follow):

transitionscount
increases72
flat10
decreases0

The count went 14 to 1047 monotonically — it has never gone down.

Which shape that chose. The measurement clears option 2a (a bound). A lower bound stays true under a count that only ever grows, and it keeps the severity term the argument needs, which dropping the figure entirely would blunt. So: a floor, phrased as a multiple of the 77 already in the sentence — "more than ten times that many". Live ratio is 1073/77 = 13.9, so the floor carries ~39% headroom, and by the history measurement that headroom only widens.

Two smaller findings pushed the same way. The printed number is not even a pure function of this file — eight assertions sit behind if (existsSync(...)) branches, so the same commit can print different totals in different checkouts. And the count moves on 88% of commits here (72 of 82 transitions). Both make an exact figure doubly unfreezable.

Zone 2 B — occurrence count

334 appears exactly once in the file, re-derived on current origin/main (9c4c431fd) after PR #13930 landed. PM reading confirmed; the replace-one was safe.

$ grep -c '\b334\b' scripts/pm/dispatch-gates.mjs
1

After the change: 0.

Zone 2 C — the neighbouring 77 is correctly frozen (and a finding next door)

Verified, PM reading holds.77 is a historical fact anchored to PR #9897, not a live count, so it is correct to leave frozen — and the new text now says so explicitly ("which carried 77 assertions at that PR") rather than leaving it ambiguous:

assert( call sites in scripts/pm/check-governed-merges.mjsvalue
at PR #9897 (a065e46550b4)70
at that PR's parent70
at 9c4c431fd (today)223

70 static + 7 loop expansion = the 77 the prose names, so 77 was true at #9897 and is now roughly a third of the truth. Frozen-and-anchored is the right call.

⚠️Reported, not fixed (a different file — out of scope per the card):scripts/pm/check-governed-merges.mjs carries the same defect in its own docblock, and there it is not anchored:

an unguarded trigger ran THIS file's 77 assertions inside the importer's own --self-test

"THIS file's 77 assertions" is a present-tense claim about that file's current count, which is now 223+. That is the identical rot, one file over. Not touched here.

The new text

*theimporter's exit code. That is the same defect PR #9897 fixed in
*`check-governed-merges.mjs`,whichcarried77assertionsatthatPR;this*filecarriesitatmorethantentimesthatmany.ThatmultipleisaFLOOR,*anditiswrittenasoneonpurpose.Thelivefigureiswhatever*`--self-test`printsfrom`cases.length`;itmovesonmosteditstothis*file,andoverthisfile's history it has never once gone down — so a floor
*staystruewhereareadingrots.Areadingstoodherebeforeandhaddrifted*bymorethanafactorofthreebeforeanyonerepairedit,sodonot*"helpfully"refreshthisbackintoone.Aself-testisamodeofthefile*beingRUN,neverasideeffectofimportingit,andasharedmodulethat*exitsonimportisasharedmodulenobodycanshare.

Per the card's Zone 3 note, the paragraph now separates what still holds (the property: this file's self-test is enormous next to the one #9897 fixed, so an import-triggered run is far worse here) from what was measured once (77, at #9897). And it states why the figure is a floor, so the next reader who reaches for the live number is told, in place, not to.

No gate was added to pin the docblock to the live count — the card rules that out, and I agree: it would tax every edit to a constantly-edited file and re-freeze the number by another route.

What would catch a wrong edit here

Plainly: nothing would. Stating that rather than implying coverage:

  • --self-test stays green (1073 cases) — but it was green with 334 too. It asserts nothing about this prose.
  • Every gate in the derived family that reads this file masks comments before judging (check:entry-guard reports "masked prose/payloads accepted"; check-self-test-wired counts --self-test "in code (comments masked)"). By construction they cannot see this paragraph.
  • Nothing caught the original 334 rot for the whole 334 to 1073 drift. A human reading the file filed the card.

So the defence this PR ships is not mechanical: it is that the claim is now a floor instead of a reading, which stays true without maintenance, plus a sentence telling the next editor why refreshing it would be wrong. If the count ever fell below 770 the sentence would go false and nothing would flag that either — the history measurement above is the whole basis for accepting that risk.

Changeset

None. Script-only, and comment-only within that: no package publishes anything from this diff, matching the repo's precedent for script-only commits. The diff is one file under scripts/pm/, which is inside the closed list the skip-changeset label exists for. I have applied skip-changeset up front rather than waiting for Check Changeset to go red.

Gates: derived vs run

Derived with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (14 families; provenance line confirms the answer is about this repo at 9c4c431fd). Reconciliation comm -23 of derived against run is empty — every derived family was invoked. Verdicts:

gateresult
pnpm check:agent-test-spellinggreen
pnpm check:bash32-floorgreen — 153 self-test cases
pnpm check:cli-command-idsgreen — 39 self-test cases
pnpm check:cross-package-test-inputsgreen — 117 self-test cases
pnpm check:entry-guardgreen — 54 self-test cases, 194 files swept
pnpm check:parse-guardgreen
pnpm check:pnpm-filter-targetsgreen — 54 + 40 assertions
pnpm check:watch-hint-literalgreen — 57 self-test cases
node scripts/check-ci-filter-parity.mjsgreen — 129 declared globs covered
node scripts/check-cross-package-test-inputs.mjsgreen — 24 packages
node scripts/check-self-test-wired.mjsgreen — 157 CI-run scripts
node scripts/check-shard-attestation.mjsgreen
node scripts/check-test-completeness.mjsNOT MEASURED — see below
pnpm check:pm-dispatch-gatesgreen — exit 0; it drives the self-test to 1073 cases pass

Plus, outside the derivation:

  • pnpm check:ratchet-remedy-authoritygreen. Run explicitly because #13813 records that this gate builds its scan surface with readdirSync at runtime and spells no declarative glob, so path derivation cannot name it.
  • node scripts/pm/dispatch-gates.mjs --self-testgreen, 1073 cases pass.

check-test-completeness is NOT MEASURED, not red. It grades a saved turbo run test log and was invoked with no argument; the gate prints its own instruction for this case: "running the family locally, record this gate as NOT MEASURED... ⛔ It is not a red, and there is nothing here to fix." CI passes it a real log.

Two gates (check-ci-filter-parity, check-shard-attestation) first returned PREREQUISITE NOT MET — the dependency yaml is not installed, which is also not a red. I ran pnpm install --frozen-lockfile and re-ran both to green rather than reporting an unmeasured gate.

Every derived family is now green except the one NOT MEASURED row. Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC

All gate verdicts above are quoted from each gate's own printed verdict line, with exit codes captured by redirect before any pipe. Gate union run at 44fbc0a37, which is the head of this branch.

Generated by Claude Code


Generated by Claude Code

The entry-guard docblock carried "this file carries it at 334" — a frozen
reading of a number that moves on most edits to this file. It had drifted to
1073 by the time anyone looked: a factor of 3.2.
Writing today's number would re-freeze the same defect one value later, so the
figure is now a FLOOR ("more than ten times" #9897's 77), stated as a floor on
purpose and pointing at `--self-test`'s `cases.length` as the live reading.
Measured before choosing the shape: across all 83 commits that have touched
this file, the assertion count went up 72 times, held flat 10 times, and has
never once gone down (14 -> 1047 static call sites; 1073 at runtime after the
file-local loop expansions). A floor is safe precisely because of that.
The neighbouring 77 is left frozen deliberately — it is anchored to PR #9897
and was true there (70 static assertions at that commit), so it is a historical
fact rather than a live count. The sentence now says so explicitly.
No behaviour change: the `invokedDirectly` guard and the self-test are
untouched. `--self-test` still reports 1073 cases pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
@claude

claudeBot commented Aug 31, 2026

Copy link
Copy Markdown
ContributorAuthor

ACCEPTdomain:devx execution PM seat (#6023), session session_01Pk26oZ12t5N1hwGW1m1MgC. Verified against origin/main and the branch head, ⛔ not the shared checkout.

⭐⭐ The Zone 2 A measurement is the model for how to use a proxy

Running the self-test at 83 historical commits is unaffordable (2-6 min a run). So the dev used a static proxy — the count of t( call sites — and ⭐ validated the proxy against ground truth before trusting it:

1047 static call sites at 9c4c431fd + 26 file-local loop expansions = 1073 predicted; the actual run printed exactlydispatch-gates self-test: 1073 cases pass.

It also checked that every multiplier is a literal array in this file, so no loop draws its population from the repo tree — which is what makes the proxy stable across history rather than only at the calibration point.

Then the sweep, 83 commits touching the file (2026-08-10 → 08-31): 72 increases, 10 flat, 0 decreases.

⇒ ⭐ A proxy calibrated against the real reading, with the mechanism that could invalidate it checked separately, is a measurement. An uncalibrated proxy would have been a guess with numbers on it.

The shape the measurement chose

2a — a bound, expressed as a multiple of the 77 already in the sentence. Live ratio is 1073/77 = 13.9, so "more than ten times that many" carries ~39% headroom that the history says only widens.

The shipped text does four things I want on record:

  1. Anchors the 77"check-governed-merges.mjs, which carried 77 assertions at that PR" — turning an ambiguous number into a dated fact;
  2. Declares the floor as deliberate"That multiple is a FLOOR, and it is written as one on purpose";
  3. Points at the live reading"whatever --self-test prints from cases.length";
  4. Inoculates against the next helpful refresh, with the evidence: "A reading stood here before and had drifted by more than a factor of three before anyone repaired it, so do not 'helpfully' refresh this back into one."

334 occurrences after the change: 0. The argument's closing sentence is preserved verbatim.

⭐⭐ "What would catch a wrong edit?" — nothing, and it explained structurally why

⛔ Not "I ran it and it was green". The dev established that every gate in the derived family that reads this file masks comments before judging: check:entry-guard reports "masked prose/payloads accepted", check-self-test-wired counts occurrences "in code (comments masked)". ⇒ by construction neither can see this paragraph, and nothing caught the original rot across the whole 334→1073 drift — a human filed the card.

And it stated the residual risk plainly rather than burying it: "If the count ever fell below 770 the sentence would go false and nothing would flag that either — the Zone 2 A history measurement is the entire basis for accepting that risk."

⚠️ One of its own side findings sharpens that: 8 assertions sit behind existsSync branches, so the printed total is not a pure function of this file. ⇒ The monotonicity evidence is about the code, and the runtime figure can also move with the environment. That does not threaten a ten-times floor at 13.9×, but it is the honest boundary of the claim and it belongs on the record.

⛔ My own zero was wrong, and the counter-check is the only reason I know

Zone 2 C asked whether the neighbouring 77 is a historical fact (correct to freeze) or a live claim. The dev confirmed it is historical in this file — and reported that check-governed-merges.mjs carries the same number unanchored and present-tense in its own docblock, filing it as #13963.

I went to verify and my git grep "77 assertions" on that file returned nothing. ⇒ I nearly reported the finding as unsupported.

It is not. The phrase wraps across a line break: scripts/pm/check-governed-merges.mjs:3503 ends …an unguarded trigger ran THIS file's 77 with assertions on the next line. A single-string grep cannot see it.

⭐ That is instrument lesson on this lane's own list — cross-line text makes a single-string grep return zero — committed again by the seat that wrote it down this morning. I caught it only because the rule says to counter-check a zero against a control, and the control (-i assertion in the same file) returned five hits. ⇒ #13963's premise holds.

Gates

14 families derived (harvested with --commands, ⛔ not grepped), 14 run, comm -23 derived ranempty. 13 green, 1 NOT MEASURED (check-test-completeness exit 3, by its own printed instruction). check:ratchet-remedy-authority run explicitly per #13813 — green.

⭐ Two gates first exited 1 with "PREREQUISITE NOT MET — the dependency yaml is not installed" in a fresh worktree. The dev read them as not measured, ran pnpm install --frozen-lockfile, and re-ran both to green verdicts — ⛔ rather than reporting an unmeasured gate or, worse, a red. That is the distinction this lane keeps having to make and it made it unprompted.

⛔ No ablation, correctly: the change is comment-only, and — per the field above — there is no mechanical check here that could be proved failable.

Governed-surface check

Diff is scripts/pm/dispatch-gates.mjs only, +10/−4, comment-only. ⛔ No hit on docs/adr/** · .claude/** · skills/** · AGENTS.md · CLAUDE.md ⇒ this seat may arm it.

Arming

Follows once CI settles green on the head.


Generated by Claude Code

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/sskip-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' import-side-effect docblock still sizes its own self-test at "334 assertions" — the live count is 979

2 participants

@os-project-manager@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
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;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading by claude[bot] · Pull Request #13962 · objectstack-ai/objectstack · GitHub
Skip to content

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading - #13962

Merged
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock
Aug 31, 2026
Merged

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading#13962
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock

Conversation

@claude

@claudeclaudeBot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#13536

The defect

The invokedDirectly docblock in scripts/pm/dispatch-gates.mjs sized this file's own self-test with a frozen literal:

That is the same defect PR #9897 fixed in check-governed-merges.mjs at 77 assertions; this file carries it at 334.

334 was a reading of cases.length — a number the self-test computes and prints at runtime. It had drifted to 1073, a factor of 3.2. The figure is load-bearing prose: it is the severity term in the argument for why a self-test must be a MODE of the file being run and never a side effect of importing it. Writing today's number would re-freeze the same defect one value later, which is exactly how the card describes the original mistake.

Zone 2 A — the history measurement that chose the shape

Question: has this file's self-test case count ever DECREASED across a commit?

Answer: no — not once, over the file's entire life.

Method. The runtime count is cases.length, accumulated by const t = (name, cond) => cases.push([name, cond]). Running the self-test at every historical commit is not affordable (a single run is 2–6 minutes on this shared box), so I used a static proxy — the count of t( call sites — and validated the proxy against the live run before trusting it:

readingvalue
static t( call sites at 9c4c431fd1047
file-local loop expansions (below)+26
predicted runtime1073
actual --self-test output1073 cases pass

The +26 is fully accounted for, and every multiplier is a literal array in this file — no loop draws its population from the repo tree, so the printed count is a function of this file plus a few existsSync branches:

  • rootFileDeclarations (8 entries, 2 assertions each) +14
  • ['check:entry-guard', 'check:parse-guard'] (3 assertions each) +3
  • the 4-element fabricated list +3
  • ['check:docs', 'check:skill-refs'] +2
  • ['check:i18n', 'check:i18n-coverage'] +2
  • misparsedFamilySources, packageLedgerFamilySources (2 entries each) +1 each

Result over all 83 commits that have touched the file (2026-08-10 through 2026-08-31, git log --follow):

transitionscount
increases72
flat10
decreases0

The count went 14 to 1047 monotonically — it has never gone down.

Which shape that chose. The measurement clears option 2a (a bound). A lower bound stays true under a count that only ever grows, and it keeps the severity term the argument needs, which dropping the figure entirely would blunt. So: a floor, phrased as a multiple of the 77 already in the sentence — "more than ten times that many". Live ratio is 1073/77 = 13.9, so the floor carries ~39% headroom, and by the history measurement that headroom only widens.

Two smaller findings pushed the same way. The printed number is not even a pure function of this file — eight assertions sit behind if (existsSync(...)) branches, so the same commit can print different totals in different checkouts. And the count moves on 88% of commits here (72 of 82 transitions). Both make an exact figure doubly unfreezable.

Zone 2 B — occurrence count

334 appears exactly once in the file, re-derived on current origin/main (9c4c431fd) after PR #13930 landed. PM reading confirmed; the replace-one was safe.

$ grep -c '\b334\b' scripts/pm/dispatch-gates.mjs
1

After the change: 0.

Zone 2 C — the neighbouring 77 is correctly frozen (and a finding next door)

Verified, PM reading holds.77 is a historical fact anchored to PR #9897, not a live count, so it is correct to leave frozen — and the new text now says so explicitly ("which carried 77 assertions at that PR") rather than leaving it ambiguous:

assert( call sites in scripts/pm/check-governed-merges.mjsvalue
at PR #9897 (a065e46550b4)70
at that PR's parent70
at 9c4c431fd (today)223

70 static + 7 loop expansion = the 77 the prose names, so 77 was true at #9897 and is now roughly a third of the truth. Frozen-and-anchored is the right call.

⚠️Reported, not fixed (a different file — out of scope per the card):scripts/pm/check-governed-merges.mjs carries the same defect in its own docblock, and there it is not anchored:

an unguarded trigger ran THIS file's 77 assertions inside the importer's own --self-test

"THIS file's 77 assertions" is a present-tense claim about that file's current count, which is now 223+. That is the identical rot, one file over. Not touched here.

The new text

*theimporter's exit code. That is the same defect PR #9897 fixed in
*`check-governed-merges.mjs`,whichcarried77assertionsatthatPR;this*filecarriesitatmorethantentimesthatmany.ThatmultipleisaFLOOR,*anditiswrittenasoneonpurpose.Thelivefigureiswhatever*`--self-test`printsfrom`cases.length`;itmovesonmosteditstothis*file,andoverthisfile's history it has never once gone down — so a floor
*staystruewhereareadingrots.Areadingstoodherebeforeandhaddrifted*bymorethanafactorofthreebeforeanyonerepairedit,sodonot*"helpfully"refreshthisbackintoone.Aself-testisamodeofthefile*beingRUN,neverasideeffectofimportingit,andasharedmodulethat*exitsonimportisasharedmodulenobodycanshare.

Per the card's Zone 3 note, the paragraph now separates what still holds (the property: this file's self-test is enormous next to the one #9897 fixed, so an import-triggered run is far worse here) from what was measured once (77, at #9897). And it states why the figure is a floor, so the next reader who reaches for the live number is told, in place, not to.

No gate was added to pin the docblock to the live count — the card rules that out, and I agree: it would tax every edit to a constantly-edited file and re-freeze the number by another route.

What would catch a wrong edit here

Plainly: nothing would. Stating that rather than implying coverage:

  • --self-test stays green (1073 cases) — but it was green with 334 too. It asserts nothing about this prose.
  • Every gate in the derived family that reads this file masks comments before judging (check:entry-guard reports "masked prose/payloads accepted"; check-self-test-wired counts --self-test "in code (comments masked)"). By construction they cannot see this paragraph.
  • Nothing caught the original 334 rot for the whole 334 to 1073 drift. A human reading the file filed the card.

So the defence this PR ships is not mechanical: it is that the claim is now a floor instead of a reading, which stays true without maintenance, plus a sentence telling the next editor why refreshing it would be wrong. If the count ever fell below 770 the sentence would go false and nothing would flag that either — the history measurement above is the whole basis for accepting that risk.

Changeset

None. Script-only, and comment-only within that: no package publishes anything from this diff, matching the repo's precedent for script-only commits. The diff is one file under scripts/pm/, which is inside the closed list the skip-changeset label exists for. I have applied skip-changeset up front rather than waiting for Check Changeset to go red.

Gates: derived vs run

Derived with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (14 families; provenance line confirms the answer is about this repo at 9c4c431fd). Reconciliation comm -23 of derived against run is empty — every derived family was invoked. Verdicts:

gateresult
pnpm check:agent-test-spellinggreen
pnpm check:bash32-floorgreen — 153 self-test cases
pnpm check:cli-command-idsgreen — 39 self-test cases
pnpm check:cross-package-test-inputsgreen — 117 self-test cases
pnpm check:entry-guardgreen — 54 self-test cases, 194 files swept
pnpm check:parse-guardgreen
pnpm check:pnpm-filter-targetsgreen — 54 + 40 assertions
pnpm check:watch-hint-literalgreen — 57 self-test cases
node scripts/check-ci-filter-parity.mjsgreen — 129 declared globs covered
node scripts/check-cross-package-test-inputs.mjsgreen — 24 packages
node scripts/check-self-test-wired.mjsgreen — 157 CI-run scripts
node scripts/check-shard-attestation.mjsgreen
node scripts/check-test-completeness.mjsNOT MEASURED — see below
pnpm check:pm-dispatch-gatesgreen — exit 0; it drives the self-test to 1073 cases pass

Plus, outside the derivation:

  • pnpm check:ratchet-remedy-authoritygreen. Run explicitly because #13813 records that this gate builds its scan surface with readdirSync at runtime and spells no declarative glob, so path derivation cannot name it.
  • node scripts/pm/dispatch-gates.mjs --self-testgreen, 1073 cases pass.

check-test-completeness is NOT MEASURED, not red. It grades a saved turbo run test log and was invoked with no argument; the gate prints its own instruction for this case: "running the family locally, record this gate as NOT MEASURED... ⛔ It is not a red, and there is nothing here to fix." CI passes it a real log.

Two gates (check-ci-filter-parity, check-shard-attestation) first returned PREREQUISITE NOT MET — the dependency yaml is not installed, which is also not a red. I ran pnpm install --frozen-lockfile and re-ran both to green rather than reporting an unmeasured gate.

Every derived family is now green except the one NOT MEASURED row. Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC

All gate verdicts above are quoted from each gate's own printed verdict line, with exit codes captured by redirect before any pipe. Gate union run at 44fbc0a37, which is the head of this branch.

Generated by Claude Code


Generated by Claude Code

The entry-guard docblock carried "this file carries it at 334" — a frozen
reading of a number that moves on most edits to this file. It had drifted to
1073 by the time anyone looked: a factor of 3.2.
Writing today's number would re-freeze the same defect one value later, so the
figure is now a FLOOR ("more than ten times" #9897's 77), stated as a floor on
purpose and pointing at `--self-test`'s `cases.length` as the live reading.
Measured before choosing the shape: across all 83 commits that have touched
this file, the assertion count went up 72 times, held flat 10 times, and has
never once gone down (14 -> 1047 static call sites; 1073 at runtime after the
file-local loop expansions). A floor is safe precisely because of that.
The neighbouring 77 is left frozen deliberately — it is anchored to PR #9897
and was true there (70 static assertions at that commit), so it is a historical
fact rather than a live count. The sentence now says so explicitly.
No behaviour change: the `invokedDirectly` guard and the self-test are
untouched. `--self-test` still reports 1073 cases pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
@claude

claudeBot commented Aug 31, 2026

Copy link
Copy Markdown
ContributorAuthor

ACCEPTdomain:devx execution PM seat (#6023), session session_01Pk26oZ12t5N1hwGW1m1MgC. Verified against origin/main and the branch head, ⛔ not the shared checkout.

⭐⭐ The Zone 2 A measurement is the model for how to use a proxy

Running the self-test at 83 historical commits is unaffordable (2-6 min a run). So the dev used a static proxy — the count of t( call sites — and ⭐ validated the proxy against ground truth before trusting it:

1047 static call sites at 9c4c431fd + 26 file-local loop expansions = 1073 predicted; the actual run printed exactlydispatch-gates self-test: 1073 cases pass.

It also checked that every multiplier is a literal array in this file, so no loop draws its population from the repo tree — which is what makes the proxy stable across history rather than only at the calibration point.

Then the sweep, 83 commits touching the file (2026-08-10 → 08-31): 72 increases, 10 flat, 0 decreases.

⇒ ⭐ A proxy calibrated against the real reading, with the mechanism that could invalidate it checked separately, is a measurement. An uncalibrated proxy would have been a guess with numbers on it.

The shape the measurement chose

2a — a bound, expressed as a multiple of the 77 already in the sentence. Live ratio is 1073/77 = 13.9, so "more than ten times that many" carries ~39% headroom that the history says only widens.

The shipped text does four things I want on record:

  1. Anchors the 77"check-governed-merges.mjs, which carried 77 assertions at that PR" — turning an ambiguous number into a dated fact;
  2. Declares the floor as deliberate"That multiple is a FLOOR, and it is written as one on purpose";
  3. Points at the live reading"whatever --self-test prints from cases.length";
  4. Inoculates against the next helpful refresh, with the evidence: "A reading stood here before and had drifted by more than a factor of three before anyone repaired it, so do not 'helpfully' refresh this back into one."

334 occurrences after the change: 0. The argument's closing sentence is preserved verbatim.

⭐⭐ "What would catch a wrong edit?" — nothing, and it explained structurally why

⛔ Not "I ran it and it was green". The dev established that every gate in the derived family that reads this file masks comments before judging: check:entry-guard reports "masked prose/payloads accepted", check-self-test-wired counts occurrences "in code (comments masked)". ⇒ by construction neither can see this paragraph, and nothing caught the original rot across the whole 334→1073 drift — a human filed the card.

And it stated the residual risk plainly rather than burying it: "If the count ever fell below 770 the sentence would go false and nothing would flag that either — the Zone 2 A history measurement is the entire basis for accepting that risk."

⚠️ One of its own side findings sharpens that: 8 assertions sit behind existsSync branches, so the printed total is not a pure function of this file. ⇒ The monotonicity evidence is about the code, and the runtime figure can also move with the environment. That does not threaten a ten-times floor at 13.9×, but it is the honest boundary of the claim and it belongs on the record.

⛔ My own zero was wrong, and the counter-check is the only reason I know

Zone 2 C asked whether the neighbouring 77 is a historical fact (correct to freeze) or a live claim. The dev confirmed it is historical in this file — and reported that check-governed-merges.mjs carries the same number unanchored and present-tense in its own docblock, filing it as #13963.

I went to verify and my git grep "77 assertions" on that file returned nothing. ⇒ I nearly reported the finding as unsupported.

It is not. The phrase wraps across a line break: scripts/pm/check-governed-merges.mjs:3503 ends …an unguarded trigger ran THIS file's 77 with assertions on the next line. A single-string grep cannot see it.

⭐ That is instrument lesson on this lane's own list — cross-line text makes a single-string grep return zero — committed again by the seat that wrote it down this morning. I caught it only because the rule says to counter-check a zero against a control, and the control (-i assertion in the same file) returned five hits. ⇒ #13963's premise holds.

Gates

14 families derived (harvested with --commands, ⛔ not grepped), 14 run, comm -23 derived ranempty. 13 green, 1 NOT MEASURED (check-test-completeness exit 3, by its own printed instruction). check:ratchet-remedy-authority run explicitly per #13813 — green.

⭐ Two gates first exited 1 with "PREREQUISITE NOT MET — the dependency yaml is not installed" in a fresh worktree. The dev read them as not measured, ran pnpm install --frozen-lockfile, and re-ran both to green verdicts — ⛔ rather than reporting an unmeasured gate or, worse, a red. That is the distinction this lane keeps having to make and it made it unprompted.

⛔ No ablation, correctly: the change is comment-only, and — per the field above — there is no mechanical check here that could be proved failable.

Governed-surface check

Diff is scripts/pm/dispatch-gates.mjs only, +10/−4, comment-only. ⛔ No hit on docs/adr/** · .claude/** · skills/** · AGENTS.md · CLAUDE.md ⇒ this seat may arm it.

Arming

Follows once CI settles green on the head.


Generated by Claude Code

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/sskip-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' import-side-effect docblock still sizes its own self-test at "334 assertions" — the live count is 979

2 participants

@os-project-manager@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading by claude[bot] · Pull Request #13962 · objectstack-ai/objectstack · GitHub
Skip to content

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading - #13962

Merged
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock
Aug 31, 2026
Merged

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading#13962
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock

Conversation

@claude

@claudeclaudeBot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#13536

The defect

The invokedDirectly docblock in scripts/pm/dispatch-gates.mjs sized this file's own self-test with a frozen literal:

That is the same defect PR #9897 fixed in check-governed-merges.mjs at 77 assertions; this file carries it at 334.

334 was a reading of cases.length — a number the self-test computes and prints at runtime. It had drifted to 1073, a factor of 3.2. The figure is load-bearing prose: it is the severity term in the argument for why a self-test must be a MODE of the file being run and never a side effect of importing it. Writing today's number would re-freeze the same defect one value later, which is exactly how the card describes the original mistake.

Zone 2 A — the history measurement that chose the shape

Question: has this file's self-test case count ever DECREASED across a commit?

Answer: no — not once, over the file's entire life.

Method. The runtime count is cases.length, accumulated by const t = (name, cond) => cases.push([name, cond]). Running the self-test at every historical commit is not affordable (a single run is 2–6 minutes on this shared box), so I used a static proxy — the count of t( call sites — and validated the proxy against the live run before trusting it:

readingvalue
static t( call sites at 9c4c431fd1047
file-local loop expansions (below)+26
predicted runtime1073
actual --self-test output1073 cases pass

The +26 is fully accounted for, and every multiplier is a literal array in this file — no loop draws its population from the repo tree, so the printed count is a function of this file plus a few existsSync branches:

  • rootFileDeclarations (8 entries, 2 assertions each) +14
  • ['check:entry-guard', 'check:parse-guard'] (3 assertions each) +3
  • the 4-element fabricated list +3
  • ['check:docs', 'check:skill-refs'] +2
  • ['check:i18n', 'check:i18n-coverage'] +2
  • misparsedFamilySources, packageLedgerFamilySources (2 entries each) +1 each

Result over all 83 commits that have touched the file (2026-08-10 through 2026-08-31, git log --follow):

transitionscount
increases72
flat10
decreases0

The count went 14 to 1047 monotonically — it has never gone down.

Which shape that chose. The measurement clears option 2a (a bound). A lower bound stays true under a count that only ever grows, and it keeps the severity term the argument needs, which dropping the figure entirely would blunt. So: a floor, phrased as a multiple of the 77 already in the sentence — "more than ten times that many". Live ratio is 1073/77 = 13.9, so the floor carries ~39% headroom, and by the history measurement that headroom only widens.

Two smaller findings pushed the same way. The printed number is not even a pure function of this file — eight assertions sit behind if (existsSync(...)) branches, so the same commit can print different totals in different checkouts. And the count moves on 88% of commits here (72 of 82 transitions). Both make an exact figure doubly unfreezable.

Zone 2 B — occurrence count

334 appears exactly once in the file, re-derived on current origin/main (9c4c431fd) after PR #13930 landed. PM reading confirmed; the replace-one was safe.

$ grep -c '\b334\b' scripts/pm/dispatch-gates.mjs
1

After the change: 0.

Zone 2 C — the neighbouring 77 is correctly frozen (and a finding next door)

Verified, PM reading holds.77 is a historical fact anchored to PR #9897, not a live count, so it is correct to leave frozen — and the new text now says so explicitly ("which carried 77 assertions at that PR") rather than leaving it ambiguous:

assert( call sites in scripts/pm/check-governed-merges.mjsvalue
at PR #9897 (a065e46550b4)70
at that PR's parent70
at 9c4c431fd (today)223

70 static + 7 loop expansion = the 77 the prose names, so 77 was true at #9897 and is now roughly a third of the truth. Frozen-and-anchored is the right call.

⚠️Reported, not fixed (a different file — out of scope per the card):scripts/pm/check-governed-merges.mjs carries the same defect in its own docblock, and there it is not anchored:

an unguarded trigger ran THIS file's 77 assertions inside the importer's own --self-test

"THIS file's 77 assertions" is a present-tense claim about that file's current count, which is now 223+. That is the identical rot, one file over. Not touched here.

The new text

*theimporter's exit code. That is the same defect PR #9897 fixed in
*`check-governed-merges.mjs`,whichcarried77assertionsatthatPR;this*filecarriesitatmorethantentimesthatmany.ThatmultipleisaFLOOR,*anditiswrittenasoneonpurpose.Thelivefigureiswhatever*`--self-test`printsfrom`cases.length`;itmovesonmosteditstothis*file,andoverthisfile's history it has never once gone down — so a floor
*staystruewhereareadingrots.Areadingstoodherebeforeandhaddrifted*bymorethanafactorofthreebeforeanyonerepairedit,sodonot*"helpfully"refreshthisbackintoone.Aself-testisamodeofthefile*beingRUN,neverasideeffectofimportingit,andasharedmodulethat*exitsonimportisasharedmodulenobodycanshare.

Per the card's Zone 3 note, the paragraph now separates what still holds (the property: this file's self-test is enormous next to the one #9897 fixed, so an import-triggered run is far worse here) from what was measured once (77, at #9897). And it states why the figure is a floor, so the next reader who reaches for the live number is told, in place, not to.

No gate was added to pin the docblock to the live count — the card rules that out, and I agree: it would tax every edit to a constantly-edited file and re-freeze the number by another route.

What would catch a wrong edit here

Plainly: nothing would. Stating that rather than implying coverage:

  • --self-test stays green (1073 cases) — but it was green with 334 too. It asserts nothing about this prose.
  • Every gate in the derived family that reads this file masks comments before judging (check:entry-guard reports "masked prose/payloads accepted"; check-self-test-wired counts --self-test "in code (comments masked)"). By construction they cannot see this paragraph.
  • Nothing caught the original 334 rot for the whole 334 to 1073 drift. A human reading the file filed the card.

So the defence this PR ships is not mechanical: it is that the claim is now a floor instead of a reading, which stays true without maintenance, plus a sentence telling the next editor why refreshing it would be wrong. If the count ever fell below 770 the sentence would go false and nothing would flag that either — the history measurement above is the whole basis for accepting that risk.

Changeset

None. Script-only, and comment-only within that: no package publishes anything from this diff, matching the repo's precedent for script-only commits. The diff is one file under scripts/pm/, which is inside the closed list the skip-changeset label exists for. I have applied skip-changeset up front rather than waiting for Check Changeset to go red.

Gates: derived vs run

Derived with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (14 families; provenance line confirms the answer is about this repo at 9c4c431fd). Reconciliation comm -23 of derived against run is empty — every derived family was invoked. Verdicts:

gateresult
pnpm check:agent-test-spellinggreen
pnpm check:bash32-floorgreen — 153 self-test cases
pnpm check:cli-command-idsgreen — 39 self-test cases
pnpm check:cross-package-test-inputsgreen — 117 self-test cases
pnpm check:entry-guardgreen — 54 self-test cases, 194 files swept
pnpm check:parse-guardgreen
pnpm check:pnpm-filter-targetsgreen — 54 + 40 assertions
pnpm check:watch-hint-literalgreen — 57 self-test cases
node scripts/check-ci-filter-parity.mjsgreen — 129 declared globs covered
node scripts/check-cross-package-test-inputs.mjsgreen — 24 packages
node scripts/check-self-test-wired.mjsgreen — 157 CI-run scripts
node scripts/check-shard-attestation.mjsgreen
node scripts/check-test-completeness.mjsNOT MEASURED — see below
pnpm check:pm-dispatch-gatesgreen — exit 0; it drives the self-test to 1073 cases pass

Plus, outside the derivation:

  • pnpm check:ratchet-remedy-authoritygreen. Run explicitly because #13813 records that this gate builds its scan surface with readdirSync at runtime and spells no declarative glob, so path derivation cannot name it.
  • node scripts/pm/dispatch-gates.mjs --self-testgreen, 1073 cases pass.

check-test-completeness is NOT MEASURED, not red. It grades a saved turbo run test log and was invoked with no argument; the gate prints its own instruction for this case: "running the family locally, record this gate as NOT MEASURED... ⛔ It is not a red, and there is nothing here to fix." CI passes it a real log.

Two gates (check-ci-filter-parity, check-shard-attestation) first returned PREREQUISITE NOT MET — the dependency yaml is not installed, which is also not a red. I ran pnpm install --frozen-lockfile and re-ran both to green rather than reporting an unmeasured gate.

Every derived family is now green except the one NOT MEASURED row. Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC

All gate verdicts above are quoted from each gate's own printed verdict line, with exit codes captured by redirect before any pipe. Gate union run at 44fbc0a37, which is the head of this branch.

Generated by Claude Code


Generated by Claude Code

The entry-guard docblock carried "this file carries it at 334" — a frozen
reading of a number that moves on most edits to this file. It had drifted to
1073 by the time anyone looked: a factor of 3.2.
Writing today's number would re-freeze the same defect one value later, so the
figure is now a FLOOR ("more than ten times" #9897's 77), stated as a floor on
purpose and pointing at `--self-test`'s `cases.length` as the live reading.
Measured before choosing the shape: across all 83 commits that have touched
this file, the assertion count went up 72 times, held flat 10 times, and has
never once gone down (14 -> 1047 static call sites; 1073 at runtime after the
file-local loop expansions). A floor is safe precisely because of that.
The neighbouring 77 is left frozen deliberately — it is anchored to PR #9897
and was true there (70 static assertions at that commit), so it is a historical
fact rather than a live count. The sentence now says so explicitly.
No behaviour change: the `invokedDirectly` guard and the self-test are
untouched. `--self-test` still reports 1073 cases pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
@claude

claudeBot commented Aug 31, 2026

Copy link
Copy Markdown
ContributorAuthor

ACCEPTdomain:devx execution PM seat (#6023), session session_01Pk26oZ12t5N1hwGW1m1MgC. Verified against origin/main and the branch head, ⛔ not the shared checkout.

⭐⭐ The Zone 2 A measurement is the model for how to use a proxy

Running the self-test at 83 historical commits is unaffordable (2-6 min a run). So the dev used a static proxy — the count of t( call sites — and ⭐ validated the proxy against ground truth before trusting it:

1047 static call sites at 9c4c431fd + 26 file-local loop expansions = 1073 predicted; the actual run printed exactlydispatch-gates self-test: 1073 cases pass.

It also checked that every multiplier is a literal array in this file, so no loop draws its population from the repo tree — which is what makes the proxy stable across history rather than only at the calibration point.

Then the sweep, 83 commits touching the file (2026-08-10 → 08-31): 72 increases, 10 flat, 0 decreases.

⇒ ⭐ A proxy calibrated against the real reading, with the mechanism that could invalidate it checked separately, is a measurement. An uncalibrated proxy would have been a guess with numbers on it.

The shape the measurement chose

2a — a bound, expressed as a multiple of the 77 already in the sentence. Live ratio is 1073/77 = 13.9, so "more than ten times that many" carries ~39% headroom that the history says only widens.

The shipped text does four things I want on record:

  1. Anchors the 77"check-governed-merges.mjs, which carried 77 assertions at that PR" — turning an ambiguous number into a dated fact;
  2. Declares the floor as deliberate"That multiple is a FLOOR, and it is written as one on purpose";
  3. Points at the live reading"whatever --self-test prints from cases.length";
  4. Inoculates against the next helpful refresh, with the evidence: "A reading stood here before and had drifted by more than a factor of three before anyone repaired it, so do not 'helpfully' refresh this back into one."

334 occurrences after the change: 0. The argument's closing sentence is preserved verbatim.

⭐⭐ "What would catch a wrong edit?" — nothing, and it explained structurally why

⛔ Not "I ran it and it was green". The dev established that every gate in the derived family that reads this file masks comments before judging: check:entry-guard reports "masked prose/payloads accepted", check-self-test-wired counts occurrences "in code (comments masked)". ⇒ by construction neither can see this paragraph, and nothing caught the original rot across the whole 334→1073 drift — a human filed the card.

And it stated the residual risk plainly rather than burying it: "If the count ever fell below 770 the sentence would go false and nothing would flag that either — the Zone 2 A history measurement is the entire basis for accepting that risk."

⚠️ One of its own side findings sharpens that: 8 assertions sit behind existsSync branches, so the printed total is not a pure function of this file. ⇒ The monotonicity evidence is about the code, and the runtime figure can also move with the environment. That does not threaten a ten-times floor at 13.9×, but it is the honest boundary of the claim and it belongs on the record.

⛔ My own zero was wrong, and the counter-check is the only reason I know

Zone 2 C asked whether the neighbouring 77 is a historical fact (correct to freeze) or a live claim. The dev confirmed it is historical in this file — and reported that check-governed-merges.mjs carries the same number unanchored and present-tense in its own docblock, filing it as #13963.

I went to verify and my git grep "77 assertions" on that file returned nothing. ⇒ I nearly reported the finding as unsupported.

It is not. The phrase wraps across a line break: scripts/pm/check-governed-merges.mjs:3503 ends …an unguarded trigger ran THIS file's 77 with assertions on the next line. A single-string grep cannot see it.

⭐ That is instrument lesson on this lane's own list — cross-line text makes a single-string grep return zero — committed again by the seat that wrote it down this morning. I caught it only because the rule says to counter-check a zero against a control, and the control (-i assertion in the same file) returned five hits. ⇒ #13963's premise holds.

Gates

14 families derived (harvested with --commands, ⛔ not grepped), 14 run, comm -23 derived ranempty. 13 green, 1 NOT MEASURED (check-test-completeness exit 3, by its own printed instruction). check:ratchet-remedy-authority run explicitly per #13813 — green.

⭐ Two gates first exited 1 with "PREREQUISITE NOT MET — the dependency yaml is not installed" in a fresh worktree. The dev read them as not measured, ran pnpm install --frozen-lockfile, and re-ran both to green verdicts — ⛔ rather than reporting an unmeasured gate or, worse, a red. That is the distinction this lane keeps having to make and it made it unprompted.

⛔ No ablation, correctly: the change is comment-only, and — per the field above — there is no mechanical check here that could be proved failable.

Governed-surface check

Diff is scripts/pm/dispatch-gates.mjs only, +10/−4, comment-only. ⛔ No hit on docs/adr/** · .claude/** · skills/** · AGENTS.md · CLAUDE.md ⇒ this seat may arm it.

Arming

Follows once CI settles green on the head.


Generated by Claude Code

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/sskip-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' import-side-effect docblock still sizes its own self-test at "334 assertions" — the live count is 979

2 participants

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

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading - #13962

Merged
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock
Aug 31, 2026
Merged

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading#13962
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock

Conversation

@claude

@claudeclaudeBot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#13536

The defect

The invokedDirectly docblock in scripts/pm/dispatch-gates.mjs sized this file's own self-test with a frozen literal:

That is the same defect PR #9897 fixed in check-governed-merges.mjs at 77 assertions; this file carries it at 334.

334 was a reading of cases.length — a number the self-test computes and prints at runtime. It had drifted to 1073, a factor of 3.2. The figure is load-bearing prose: it is the severity term in the argument for why a self-test must be a MODE of the file being run and never a side effect of importing it. Writing today's number would re-freeze the same defect one value later, which is exactly how the card describes the original mistake.

Zone 2 A — the history measurement that chose the shape

Question: has this file's self-test case count ever DECREASED across a commit?

Answer: no — not once, over the file's entire life.

Method. The runtime count is cases.length, accumulated by const t = (name, cond) => cases.push([name, cond]). Running the self-test at every historical commit is not affordable (a single run is 2–6 minutes on this shared box), so I used a static proxy — the count of t( call sites — and validated the proxy against the live run before trusting it:

readingvalue
static t( call sites at 9c4c431fd1047
file-local loop expansions (below)+26
predicted runtime1073
actual --self-test output1073 cases pass

The +26 is fully accounted for, and every multiplier is a literal array in this file — no loop draws its population from the repo tree, so the printed count is a function of this file plus a few existsSync branches:

  • rootFileDeclarations (8 entries, 2 assertions each) +14
  • ['check:entry-guard', 'check:parse-guard'] (3 assertions each) +3
  • the 4-element fabricated list +3
  • ['check:docs', 'check:skill-refs'] +2
  • ['check:i18n', 'check:i18n-coverage'] +2
  • misparsedFamilySources, packageLedgerFamilySources (2 entries each) +1 each

Result over all 83 commits that have touched the file (2026-08-10 through 2026-08-31, git log --follow):

transitionscount
increases72
flat10
decreases0

The count went 14 to 1047 monotonically — it has never gone down.

Which shape that chose. The measurement clears option 2a (a bound). A lower bound stays true under a count that only ever grows, and it keeps the severity term the argument needs, which dropping the figure entirely would blunt. So: a floor, phrased as a multiple of the 77 already in the sentence — "more than ten times that many". Live ratio is 1073/77 = 13.9, so the floor carries ~39% headroom, and by the history measurement that headroom only widens.

Two smaller findings pushed the same way. The printed number is not even a pure function of this file — eight assertions sit behind if (existsSync(...)) branches, so the same commit can print different totals in different checkouts. And the count moves on 88% of commits here (72 of 82 transitions). Both make an exact figure doubly unfreezable.

Zone 2 B — occurrence count

334 appears exactly once in the file, re-derived on current origin/main (9c4c431fd) after PR #13930 landed. PM reading confirmed; the replace-one was safe.

$ grep -c '\b334\b' scripts/pm/dispatch-gates.mjs
1

After the change: 0.

Zone 2 C — the neighbouring 77 is correctly frozen (and a finding next door)

Verified, PM reading holds.77 is a historical fact anchored to PR #9897, not a live count, so it is correct to leave frozen — and the new text now says so explicitly ("which carried 77 assertions at that PR") rather than leaving it ambiguous:

assert( call sites in scripts/pm/check-governed-merges.mjsvalue
at PR #9897 (a065e46550b4)70
at that PR's parent70
at 9c4c431fd (today)223

70 static + 7 loop expansion = the 77 the prose names, so 77 was true at #9897 and is now roughly a third of the truth. Frozen-and-anchored is the right call.

⚠️Reported, not fixed (a different file — out of scope per the card):scripts/pm/check-governed-merges.mjs carries the same defect in its own docblock, and there it is not anchored:

an unguarded trigger ran THIS file's 77 assertions inside the importer's own --self-test

"THIS file's 77 assertions" is a present-tense claim about that file's current count, which is now 223+. That is the identical rot, one file over. Not touched here.

The new text

*theimporter's exit code. That is the same defect PR #9897 fixed in
*`check-governed-merges.mjs`,whichcarried77assertionsatthatPR;this*filecarriesitatmorethantentimesthatmany.ThatmultipleisaFLOOR,*anditiswrittenasoneonpurpose.Thelivefigureiswhatever*`--self-test`printsfrom`cases.length`;itmovesonmosteditstothis*file,andoverthisfile's history it has never once gone down — so a floor
*staystruewhereareadingrots.Areadingstoodherebeforeandhaddrifted*bymorethanafactorofthreebeforeanyonerepairedit,sodonot*"helpfully"refreshthisbackintoone.Aself-testisamodeofthefile*beingRUN,neverasideeffectofimportingit,andasharedmodulethat*exitsonimportisasharedmodulenobodycanshare.

Per the card's Zone 3 note, the paragraph now separates what still holds (the property: this file's self-test is enormous next to the one #9897 fixed, so an import-triggered run is far worse here) from what was measured once (77, at #9897). And it states why the figure is a floor, so the next reader who reaches for the live number is told, in place, not to.

No gate was added to pin the docblock to the live count — the card rules that out, and I agree: it would tax every edit to a constantly-edited file and re-freeze the number by another route.

What would catch a wrong edit here

Plainly: nothing would. Stating that rather than implying coverage:

  • --self-test stays green (1073 cases) — but it was green with 334 too. It asserts nothing about this prose.
  • Every gate in the derived family that reads this file masks comments before judging (check:entry-guard reports "masked prose/payloads accepted"; check-self-test-wired counts --self-test "in code (comments masked)"). By construction they cannot see this paragraph.
  • Nothing caught the original 334 rot for the whole 334 to 1073 drift. A human reading the file filed the card.

So the defence this PR ships is not mechanical: it is that the claim is now a floor instead of a reading, which stays true without maintenance, plus a sentence telling the next editor why refreshing it would be wrong. If the count ever fell below 770 the sentence would go false and nothing would flag that either — the history measurement above is the whole basis for accepting that risk.

Changeset

None. Script-only, and comment-only within that: no package publishes anything from this diff, matching the repo's precedent for script-only commits. The diff is one file under scripts/pm/, which is inside the closed list the skip-changeset label exists for. I have applied skip-changeset up front rather than waiting for Check Changeset to go red.

Gates: derived vs run

Derived with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (14 families; provenance line confirms the answer is about this repo at 9c4c431fd). Reconciliation comm -23 of derived against run is empty — every derived family was invoked. Verdicts:

gateresult
pnpm check:agent-test-spellinggreen
pnpm check:bash32-floorgreen — 153 self-test cases
pnpm check:cli-command-idsgreen — 39 self-test cases
pnpm check:cross-package-test-inputsgreen — 117 self-test cases
pnpm check:entry-guardgreen — 54 self-test cases, 194 files swept
pnpm check:parse-guardgreen
pnpm check:pnpm-filter-targetsgreen — 54 + 40 assertions
pnpm check:watch-hint-literalgreen — 57 self-test cases
node scripts/check-ci-filter-parity.mjsgreen — 129 declared globs covered
node scripts/check-cross-package-test-inputs.mjsgreen — 24 packages
node scripts/check-self-test-wired.mjsgreen — 157 CI-run scripts
node scripts/check-shard-attestation.mjsgreen
node scripts/check-test-completeness.mjsNOT MEASURED — see below
pnpm check:pm-dispatch-gatesgreen — exit 0; it drives the self-test to 1073 cases pass

Plus, outside the derivation:

  • pnpm check:ratchet-remedy-authoritygreen. Run explicitly because #13813 records that this gate builds its scan surface with readdirSync at runtime and spells no declarative glob, so path derivation cannot name it.
  • node scripts/pm/dispatch-gates.mjs --self-testgreen, 1073 cases pass.

check-test-completeness is NOT MEASURED, not red. It grades a saved turbo run test log and was invoked with no argument; the gate prints its own instruction for this case: "running the family locally, record this gate as NOT MEASURED... ⛔ It is not a red, and there is nothing here to fix." CI passes it a real log.

Two gates (check-ci-filter-parity, check-shard-attestation) first returned PREREQUISITE NOT MET — the dependency yaml is not installed, which is also not a red. I ran pnpm install --frozen-lockfile and re-ran both to green rather than reporting an unmeasured gate.

Every derived family is now green except the one NOT MEASURED row. Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC

All gate verdicts above are quoted from each gate's own printed verdict line, with exit codes captured by redirect before any pipe. Gate union run at 44fbc0a37, which is the head of this branch.

Generated by Claude Code


Generated by Claude Code

The entry-guard docblock carried "this file carries it at 334" — a frozen
reading of a number that moves on most edits to this file. It had drifted to
1073 by the time anyone looked: a factor of 3.2.
Writing today's number would re-freeze the same defect one value later, so the
figure is now a FLOOR ("more than ten times" #9897's 77), stated as a floor on
purpose and pointing at `--self-test`'s `cases.length` as the live reading.
Measured before choosing the shape: across all 83 commits that have touched
this file, the assertion count went up 72 times, held flat 10 times, and has
never once gone down (14 -> 1047 static call sites; 1073 at runtime after the
file-local loop expansions). A floor is safe precisely because of that.
The neighbouring 77 is left frozen deliberately — it is anchored to PR #9897
and was true there (70 static assertions at that commit), so it is a historical
fact rather than a live count. The sentence now says so explicitly.
No behaviour change: the `invokedDirectly` guard and the self-test are
untouched. `--self-test` still reports 1073 cases pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
@claude

claudeBot commented Aug 31, 2026

Copy link
Copy Markdown
ContributorAuthor

ACCEPTdomain:devx execution PM seat (#6023), session session_01Pk26oZ12t5N1hwGW1m1MgC. Verified against origin/main and the branch head, ⛔ not the shared checkout.

⭐⭐ The Zone 2 A measurement is the model for how to use a proxy

Running the self-test at 83 historical commits is unaffordable (2-6 min a run). So the dev used a static proxy — the count of t( call sites — and ⭐ validated the proxy against ground truth before trusting it:

1047 static call sites at 9c4c431fd + 26 file-local loop expansions = 1073 predicted; the actual run printed exactlydispatch-gates self-test: 1073 cases pass.

It also checked that every multiplier is a literal array in this file, so no loop draws its population from the repo tree — which is what makes the proxy stable across history rather than only at the calibration point.

Then the sweep, 83 commits touching the file (2026-08-10 → 08-31): 72 increases, 10 flat, 0 decreases.

⇒ ⭐ A proxy calibrated against the real reading, with the mechanism that could invalidate it checked separately, is a measurement. An uncalibrated proxy would have been a guess with numbers on it.

The shape the measurement chose

2a — a bound, expressed as a multiple of the 77 already in the sentence. Live ratio is 1073/77 = 13.9, so "more than ten times that many" carries ~39% headroom that the history says only widens.

The shipped text does four things I want on record:

  1. Anchors the 77"check-governed-merges.mjs, which carried 77 assertions at that PR" — turning an ambiguous number into a dated fact;
  2. Declares the floor as deliberate"That multiple is a FLOOR, and it is written as one on purpose";
  3. Points at the live reading"whatever --self-test prints from cases.length";
  4. Inoculates against the next helpful refresh, with the evidence: "A reading stood here before and had drifted by more than a factor of three before anyone repaired it, so do not 'helpfully' refresh this back into one."

334 occurrences after the change: 0. The argument's closing sentence is preserved verbatim.

⭐⭐ "What would catch a wrong edit?" — nothing, and it explained structurally why

⛔ Not "I ran it and it was green". The dev established that every gate in the derived family that reads this file masks comments before judging: check:entry-guard reports "masked prose/payloads accepted", check-self-test-wired counts occurrences "in code (comments masked)". ⇒ by construction neither can see this paragraph, and nothing caught the original rot across the whole 334→1073 drift — a human filed the card.

And it stated the residual risk plainly rather than burying it: "If the count ever fell below 770 the sentence would go false and nothing would flag that either — the Zone 2 A history measurement is the entire basis for accepting that risk."

⚠️ One of its own side findings sharpens that: 8 assertions sit behind existsSync branches, so the printed total is not a pure function of this file. ⇒ The monotonicity evidence is about the code, and the runtime figure can also move with the environment. That does not threaten a ten-times floor at 13.9×, but it is the honest boundary of the claim and it belongs on the record.

⛔ My own zero was wrong, and the counter-check is the only reason I know

Zone 2 C asked whether the neighbouring 77 is a historical fact (correct to freeze) or a live claim. The dev confirmed it is historical in this file — and reported that check-governed-merges.mjs carries the same number unanchored and present-tense in its own docblock, filing it as #13963.

I went to verify and my git grep "77 assertions" on that file returned nothing. ⇒ I nearly reported the finding as unsupported.

It is not. The phrase wraps across a line break: scripts/pm/check-governed-merges.mjs:3503 ends …an unguarded trigger ran THIS file's 77 with assertions on the next line. A single-string grep cannot see it.

⭐ That is instrument lesson on this lane's own list — cross-line text makes a single-string grep return zero — committed again by the seat that wrote it down this morning. I caught it only because the rule says to counter-check a zero against a control, and the control (-i assertion in the same file) returned five hits. ⇒ #13963's premise holds.

Gates

14 families derived (harvested with --commands, ⛔ not grepped), 14 run, comm -23 derived ranempty. 13 green, 1 NOT MEASURED (check-test-completeness exit 3, by its own printed instruction). check:ratchet-remedy-authority run explicitly per #13813 — green.

⭐ Two gates first exited 1 with "PREREQUISITE NOT MET — the dependency yaml is not installed" in a fresh worktree. The dev read them as not measured, ran pnpm install --frozen-lockfile, and re-ran both to green verdicts — ⛔ rather than reporting an unmeasured gate or, worse, a red. That is the distinction this lane keeps having to make and it made it unprompted.

⛔ No ablation, correctly: the change is comment-only, and — per the field above — there is no mechanical check here that could be proved failable.

Governed-surface check

Diff is scripts/pm/dispatch-gates.mjs only, +10/−4, comment-only. ⛔ No hit on docs/adr/** · .claude/** · skills/** · AGENTS.md · CLAUDE.md ⇒ this seat may arm it.

Arming

Follows once CI settles green on the head.


Generated by Claude Code

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/sskip-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' import-side-effect docblock still sizes its own self-test at "334 assertions" — the live count is 979

2 participants

@os-project-manager@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading by claude[bot] · Pull Request #13962 · objectstack-ai/objectstack · GitHub
Skip to content

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading - #13962

Merged
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock
Aug 31, 2026
Merged

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading#13962
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock

Conversation

@claude

@claudeclaudeBot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#13536

The defect

The invokedDirectly docblock in scripts/pm/dispatch-gates.mjs sized this file's own self-test with a frozen literal:

That is the same defect PR #9897 fixed in check-governed-merges.mjs at 77 assertions; this file carries it at 334.

334 was a reading of cases.length — a number the self-test computes and prints at runtime. It had drifted to 1073, a factor of 3.2. The figure is load-bearing prose: it is the severity term in the argument for why a self-test must be a MODE of the file being run and never a side effect of importing it. Writing today's number would re-freeze the same defect one value later, which is exactly how the card describes the original mistake.

Zone 2 A — the history measurement that chose the shape

Question: has this file's self-test case count ever DECREASED across a commit?

Answer: no — not once, over the file's entire life.

Method. The runtime count is cases.length, accumulated by const t = (name, cond) => cases.push([name, cond]). Running the self-test at every historical commit is not affordable (a single run is 2–6 minutes on this shared box), so I used a static proxy — the count of t( call sites — and validated the proxy against the live run before trusting it:

readingvalue
static t( call sites at 9c4c431fd1047
file-local loop expansions (below)+26
predicted runtime1073
actual --self-test output1073 cases pass

The +26 is fully accounted for, and every multiplier is a literal array in this file — no loop draws its population from the repo tree, so the printed count is a function of this file plus a few existsSync branches:

  • rootFileDeclarations (8 entries, 2 assertions each) +14
  • ['check:entry-guard', 'check:parse-guard'] (3 assertions each) +3
  • the 4-element fabricated list +3
  • ['check:docs', 'check:skill-refs'] +2
  • ['check:i18n', 'check:i18n-coverage'] +2
  • misparsedFamilySources, packageLedgerFamilySources (2 entries each) +1 each

Result over all 83 commits that have touched the file (2026-08-10 through 2026-08-31, git log --follow):

transitionscount
increases72
flat10
decreases0

The count went 14 to 1047 monotonically — it has never gone down.

Which shape that chose. The measurement clears option 2a (a bound). A lower bound stays true under a count that only ever grows, and it keeps the severity term the argument needs, which dropping the figure entirely would blunt. So: a floor, phrased as a multiple of the 77 already in the sentence — "more than ten times that many". Live ratio is 1073/77 = 13.9, so the floor carries ~39% headroom, and by the history measurement that headroom only widens.

Two smaller findings pushed the same way. The printed number is not even a pure function of this file — eight assertions sit behind if (existsSync(...)) branches, so the same commit can print different totals in different checkouts. And the count moves on 88% of commits here (72 of 82 transitions). Both make an exact figure doubly unfreezable.

Zone 2 B — occurrence count

334 appears exactly once in the file, re-derived on current origin/main (9c4c431fd) after PR #13930 landed. PM reading confirmed; the replace-one was safe.

$ grep -c '\b334\b' scripts/pm/dispatch-gates.mjs
1

After the change: 0.

Zone 2 C — the neighbouring 77 is correctly frozen (and a finding next door)

Verified, PM reading holds.77 is a historical fact anchored to PR #9897, not a live count, so it is correct to leave frozen — and the new text now says so explicitly ("which carried 77 assertions at that PR") rather than leaving it ambiguous:

assert( call sites in scripts/pm/check-governed-merges.mjsvalue
at PR #9897 (a065e46550b4)70
at that PR's parent70
at 9c4c431fd (today)223

70 static + 7 loop expansion = the 77 the prose names, so 77 was true at #9897 and is now roughly a third of the truth. Frozen-and-anchored is the right call.

⚠️Reported, not fixed (a different file — out of scope per the card):scripts/pm/check-governed-merges.mjs carries the same defect in its own docblock, and there it is not anchored:

an unguarded trigger ran THIS file's 77 assertions inside the importer's own --self-test

"THIS file's 77 assertions" is a present-tense claim about that file's current count, which is now 223+. That is the identical rot, one file over. Not touched here.

The new text

*theimporter's exit code. That is the same defect PR #9897 fixed in
*`check-governed-merges.mjs`,whichcarried77assertionsatthatPR;this*filecarriesitatmorethantentimesthatmany.ThatmultipleisaFLOOR,*anditiswrittenasoneonpurpose.Thelivefigureiswhatever*`--self-test`printsfrom`cases.length`;itmovesonmosteditstothis*file,andoverthisfile's history it has never once gone down — so a floor
*staystruewhereareadingrots.Areadingstoodherebeforeandhaddrifted*bymorethanafactorofthreebeforeanyonerepairedit,sodonot*"helpfully"refreshthisbackintoone.Aself-testisamodeofthefile*beingRUN,neverasideeffectofimportingit,andasharedmodulethat*exitsonimportisasharedmodulenobodycanshare.

Per the card's Zone 3 note, the paragraph now separates what still holds (the property: this file's self-test is enormous next to the one #9897 fixed, so an import-triggered run is far worse here) from what was measured once (77, at #9897). And it states why the figure is a floor, so the next reader who reaches for the live number is told, in place, not to.

No gate was added to pin the docblock to the live count — the card rules that out, and I agree: it would tax every edit to a constantly-edited file and re-freeze the number by another route.

What would catch a wrong edit here

Plainly: nothing would. Stating that rather than implying coverage:

  • --self-test stays green (1073 cases) — but it was green with 334 too. It asserts nothing about this prose.
  • Every gate in the derived family that reads this file masks comments before judging (check:entry-guard reports "masked prose/payloads accepted"; check-self-test-wired counts --self-test "in code (comments masked)"). By construction they cannot see this paragraph.
  • Nothing caught the original 334 rot for the whole 334 to 1073 drift. A human reading the file filed the card.

So the defence this PR ships is not mechanical: it is that the claim is now a floor instead of a reading, which stays true without maintenance, plus a sentence telling the next editor why refreshing it would be wrong. If the count ever fell below 770 the sentence would go false and nothing would flag that either — the history measurement above is the whole basis for accepting that risk.

Changeset

None. Script-only, and comment-only within that: no package publishes anything from this diff, matching the repo's precedent for script-only commits. The diff is one file under scripts/pm/, which is inside the closed list the skip-changeset label exists for. I have applied skip-changeset up front rather than waiting for Check Changeset to go red.

Gates: derived vs run

Derived with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (14 families; provenance line confirms the answer is about this repo at 9c4c431fd). Reconciliation comm -23 of derived against run is empty — every derived family was invoked. Verdicts:

gateresult
pnpm check:agent-test-spellinggreen
pnpm check:bash32-floorgreen — 153 self-test cases
pnpm check:cli-command-idsgreen — 39 self-test cases
pnpm check:cross-package-test-inputsgreen — 117 self-test cases
pnpm check:entry-guardgreen — 54 self-test cases, 194 files swept
pnpm check:parse-guardgreen
pnpm check:pnpm-filter-targetsgreen — 54 + 40 assertions
pnpm check:watch-hint-literalgreen — 57 self-test cases
node scripts/check-ci-filter-parity.mjsgreen — 129 declared globs covered
node scripts/check-cross-package-test-inputs.mjsgreen — 24 packages
node scripts/check-self-test-wired.mjsgreen — 157 CI-run scripts
node scripts/check-shard-attestation.mjsgreen
node scripts/check-test-completeness.mjsNOT MEASURED — see below
pnpm check:pm-dispatch-gatesgreen — exit 0; it drives the self-test to 1073 cases pass

Plus, outside the derivation:

  • pnpm check:ratchet-remedy-authoritygreen. Run explicitly because #13813 records that this gate builds its scan surface with readdirSync at runtime and spells no declarative glob, so path derivation cannot name it.
  • node scripts/pm/dispatch-gates.mjs --self-testgreen, 1073 cases pass.

check-test-completeness is NOT MEASURED, not red. It grades a saved turbo run test log and was invoked with no argument; the gate prints its own instruction for this case: "running the family locally, record this gate as NOT MEASURED... ⛔ It is not a red, and there is nothing here to fix." CI passes it a real log.

Two gates (check-ci-filter-parity, check-shard-attestation) first returned PREREQUISITE NOT MET — the dependency yaml is not installed, which is also not a red. I ran pnpm install --frozen-lockfile and re-ran both to green rather than reporting an unmeasured gate.

Every derived family is now green except the one NOT MEASURED row. Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC

All gate verdicts above are quoted from each gate's own printed verdict line, with exit codes captured by redirect before any pipe. Gate union run at 44fbc0a37, which is the head of this branch.

Generated by Claude Code


Generated by Claude Code

The entry-guard docblock carried "this file carries it at 334" — a frozen
reading of a number that moves on most edits to this file. It had drifted to
1073 by the time anyone looked: a factor of 3.2.
Writing today's number would re-freeze the same defect one value later, so the
figure is now a FLOOR ("more than ten times" #9897's 77), stated as a floor on
purpose and pointing at `--self-test`'s `cases.length` as the live reading.
Measured before choosing the shape: across all 83 commits that have touched
this file, the assertion count went up 72 times, held flat 10 times, and has
never once gone down (14 -> 1047 static call sites; 1073 at runtime after the
file-local loop expansions). A floor is safe precisely because of that.
The neighbouring 77 is left frozen deliberately — it is anchored to PR #9897
and was true there (70 static assertions at that commit), so it is a historical
fact rather than a live count. The sentence now says so explicitly.
No behaviour change: the `invokedDirectly` guard and the self-test are
untouched. `--self-test` still reports 1073 cases pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
@claude

claudeBot commented Aug 31, 2026

Copy link
Copy Markdown
ContributorAuthor

ACCEPTdomain:devx execution PM seat (#6023), session session_01Pk26oZ12t5N1hwGW1m1MgC. Verified against origin/main and the branch head, ⛔ not the shared checkout.

⭐⭐ The Zone 2 A measurement is the model for how to use a proxy

Running the self-test at 83 historical commits is unaffordable (2-6 min a run). So the dev used a static proxy — the count of t( call sites — and ⭐ validated the proxy against ground truth before trusting it:

1047 static call sites at 9c4c431fd + 26 file-local loop expansions = 1073 predicted; the actual run printed exactlydispatch-gates self-test: 1073 cases pass.

It also checked that every multiplier is a literal array in this file, so no loop draws its population from the repo tree — which is what makes the proxy stable across history rather than only at the calibration point.

Then the sweep, 83 commits touching the file (2026-08-10 → 08-31): 72 increases, 10 flat, 0 decreases.

⇒ ⭐ A proxy calibrated against the real reading, with the mechanism that could invalidate it checked separately, is a measurement. An uncalibrated proxy would have been a guess with numbers on it.

The shape the measurement chose

2a — a bound, expressed as a multiple of the 77 already in the sentence. Live ratio is 1073/77 = 13.9, so "more than ten times that many" carries ~39% headroom that the history says only widens.

The shipped text does four things I want on record:

  1. Anchors the 77"check-governed-merges.mjs, which carried 77 assertions at that PR" — turning an ambiguous number into a dated fact;
  2. Declares the floor as deliberate"That multiple is a FLOOR, and it is written as one on purpose";
  3. Points at the live reading"whatever --self-test prints from cases.length";
  4. Inoculates against the next helpful refresh, with the evidence: "A reading stood here before and had drifted by more than a factor of three before anyone repaired it, so do not 'helpfully' refresh this back into one."

334 occurrences after the change: 0. The argument's closing sentence is preserved verbatim.

⭐⭐ "What would catch a wrong edit?" — nothing, and it explained structurally why

⛔ Not "I ran it and it was green". The dev established that every gate in the derived family that reads this file masks comments before judging: check:entry-guard reports "masked prose/payloads accepted", check-self-test-wired counts occurrences "in code (comments masked)". ⇒ by construction neither can see this paragraph, and nothing caught the original rot across the whole 334→1073 drift — a human filed the card.

And it stated the residual risk plainly rather than burying it: "If the count ever fell below 770 the sentence would go false and nothing would flag that either — the Zone 2 A history measurement is the entire basis for accepting that risk."

⚠️ One of its own side findings sharpens that: 8 assertions sit behind existsSync branches, so the printed total is not a pure function of this file. ⇒ The monotonicity evidence is about the code, and the runtime figure can also move with the environment. That does not threaten a ten-times floor at 13.9×, but it is the honest boundary of the claim and it belongs on the record.

⛔ My own zero was wrong, and the counter-check is the only reason I know

Zone 2 C asked whether the neighbouring 77 is a historical fact (correct to freeze) or a live claim. The dev confirmed it is historical in this file — and reported that check-governed-merges.mjs carries the same number unanchored and present-tense in its own docblock, filing it as #13963.

I went to verify and my git grep "77 assertions" on that file returned nothing. ⇒ I nearly reported the finding as unsupported.

It is not. The phrase wraps across a line break: scripts/pm/check-governed-merges.mjs:3503 ends …an unguarded trigger ran THIS file's 77 with assertions on the next line. A single-string grep cannot see it.

⭐ That is instrument lesson on this lane's own list — cross-line text makes a single-string grep return zero — committed again by the seat that wrote it down this morning. I caught it only because the rule says to counter-check a zero against a control, and the control (-i assertion in the same file) returned five hits. ⇒ #13963's premise holds.

Gates

14 families derived (harvested with --commands, ⛔ not grepped), 14 run, comm -23 derived ranempty. 13 green, 1 NOT MEASURED (check-test-completeness exit 3, by its own printed instruction). check:ratchet-remedy-authority run explicitly per #13813 — green.

⭐ Two gates first exited 1 with "PREREQUISITE NOT MET — the dependency yaml is not installed" in a fresh worktree. The dev read them as not measured, ran pnpm install --frozen-lockfile, and re-ran both to green verdicts — ⛔ rather than reporting an unmeasured gate or, worse, a red. That is the distinction this lane keeps having to make and it made it unprompted.

⛔ No ablation, correctly: the change is comment-only, and — per the field above — there is no mechanical check here that could be proved failable.

Governed-surface check

Diff is scripts/pm/dispatch-gates.mjs only, +10/−4, comment-only. ⛔ No hit on docs/adr/** · .claude/** · skills/** · AGENTS.md · CLAUDE.md ⇒ this seat may arm it.

Arming

Follows once CI settles green on the head.


Generated by Claude Code

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/sskip-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' import-side-effect docblock still sizes its own self-test at "334 assertions" — the live count is 979

2 participants

@os-project-manager@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading by claude[bot] · Pull Request #13962 · objectstack-ai/objectstack · GitHub
Skip to content

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading - #13962

Merged
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock
Aug 31, 2026
Merged

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading#13962
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock

Conversation

@claude

@claudeclaudeBot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#13536

The defect

The invokedDirectly docblock in scripts/pm/dispatch-gates.mjs sized this file's own self-test with a frozen literal:

That is the same defect PR #9897 fixed in check-governed-merges.mjs at 77 assertions; this file carries it at 334.

334 was a reading of cases.length — a number the self-test computes and prints at runtime. It had drifted to 1073, a factor of 3.2. The figure is load-bearing prose: it is the severity term in the argument for why a self-test must be a MODE of the file being run and never a side effect of importing it. Writing today's number would re-freeze the same defect one value later, which is exactly how the card describes the original mistake.

Zone 2 A — the history measurement that chose the shape

Question: has this file's self-test case count ever DECREASED across a commit?

Answer: no — not once, over the file's entire life.

Method. The runtime count is cases.length, accumulated by const t = (name, cond) => cases.push([name, cond]). Running the self-test at every historical commit is not affordable (a single run is 2–6 minutes on this shared box), so I used a static proxy — the count of t( call sites — and validated the proxy against the live run before trusting it:

readingvalue
static t( call sites at 9c4c431fd1047
file-local loop expansions (below)+26
predicted runtime1073
actual --self-test output1073 cases pass

The +26 is fully accounted for, and every multiplier is a literal array in this file — no loop draws its population from the repo tree, so the printed count is a function of this file plus a few existsSync branches:

  • rootFileDeclarations (8 entries, 2 assertions each) +14
  • ['check:entry-guard', 'check:parse-guard'] (3 assertions each) +3
  • the 4-element fabricated list +3
  • ['check:docs', 'check:skill-refs'] +2
  • ['check:i18n', 'check:i18n-coverage'] +2
  • misparsedFamilySources, packageLedgerFamilySources (2 entries each) +1 each

Result over all 83 commits that have touched the file (2026-08-10 through 2026-08-31, git log --follow):

transitionscount
increases72
flat10
decreases0

The count went 14 to 1047 monotonically — it has never gone down.

Which shape that chose. The measurement clears option 2a (a bound). A lower bound stays true under a count that only ever grows, and it keeps the severity term the argument needs, which dropping the figure entirely would blunt. So: a floor, phrased as a multiple of the 77 already in the sentence — "more than ten times that many". Live ratio is 1073/77 = 13.9, so the floor carries ~39% headroom, and by the history measurement that headroom only widens.

Two smaller findings pushed the same way. The printed number is not even a pure function of this file — eight assertions sit behind if (existsSync(...)) branches, so the same commit can print different totals in different checkouts. And the count moves on 88% of commits here (72 of 82 transitions). Both make an exact figure doubly unfreezable.

Zone 2 B — occurrence count

334 appears exactly once in the file, re-derived on current origin/main (9c4c431fd) after PR #13930 landed. PM reading confirmed; the replace-one was safe.

$ grep -c '\b334\b' scripts/pm/dispatch-gates.mjs
1

After the change: 0.

Zone 2 C — the neighbouring 77 is correctly frozen (and a finding next door)

Verified, PM reading holds.77 is a historical fact anchored to PR #9897, not a live count, so it is correct to leave frozen — and the new text now says so explicitly ("which carried 77 assertions at that PR") rather than leaving it ambiguous:

assert( call sites in scripts/pm/check-governed-merges.mjsvalue
at PR #9897 (a065e46550b4)70
at that PR's parent70
at 9c4c431fd (today)223

70 static + 7 loop expansion = the 77 the prose names, so 77 was true at #9897 and is now roughly a third of the truth. Frozen-and-anchored is the right call.

⚠️Reported, not fixed (a different file — out of scope per the card):scripts/pm/check-governed-merges.mjs carries the same defect in its own docblock, and there it is not anchored:

an unguarded trigger ran THIS file's 77 assertions inside the importer's own --self-test

"THIS file's 77 assertions" is a present-tense claim about that file's current count, which is now 223+. That is the identical rot, one file over. Not touched here.

The new text

*theimporter's exit code. That is the same defect PR #9897 fixed in
*`check-governed-merges.mjs`,whichcarried77assertionsatthatPR;this*filecarriesitatmorethantentimesthatmany.ThatmultipleisaFLOOR,*anditiswrittenasoneonpurpose.Thelivefigureiswhatever*`--self-test`printsfrom`cases.length`;itmovesonmosteditstothis*file,andoverthisfile's history it has never once gone down — so a floor
*staystruewhereareadingrots.Areadingstoodherebeforeandhaddrifted*bymorethanafactorofthreebeforeanyonerepairedit,sodonot*"helpfully"refreshthisbackintoone.Aself-testisamodeofthefile*beingRUN,neverasideeffectofimportingit,andasharedmodulethat*exitsonimportisasharedmodulenobodycanshare.

Per the card's Zone 3 note, the paragraph now separates what still holds (the property: this file's self-test is enormous next to the one #9897 fixed, so an import-triggered run is far worse here) from what was measured once (77, at #9897). And it states why the figure is a floor, so the next reader who reaches for the live number is told, in place, not to.

No gate was added to pin the docblock to the live count — the card rules that out, and I agree: it would tax every edit to a constantly-edited file and re-freeze the number by another route.

What would catch a wrong edit here

Plainly: nothing would. Stating that rather than implying coverage:

  • --self-test stays green (1073 cases) — but it was green with 334 too. It asserts nothing about this prose.
  • Every gate in the derived family that reads this file masks comments before judging (check:entry-guard reports "masked prose/payloads accepted"; check-self-test-wired counts --self-test "in code (comments masked)"). By construction they cannot see this paragraph.
  • Nothing caught the original 334 rot for the whole 334 to 1073 drift. A human reading the file filed the card.

So the defence this PR ships is not mechanical: it is that the claim is now a floor instead of a reading, which stays true without maintenance, plus a sentence telling the next editor why refreshing it would be wrong. If the count ever fell below 770 the sentence would go false and nothing would flag that either — the history measurement above is the whole basis for accepting that risk.

Changeset

None. Script-only, and comment-only within that: no package publishes anything from this diff, matching the repo's precedent for script-only commits. The diff is one file under scripts/pm/, which is inside the closed list the skip-changeset label exists for. I have applied skip-changeset up front rather than waiting for Check Changeset to go red.

Gates: derived vs run

Derived with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (14 families; provenance line confirms the answer is about this repo at 9c4c431fd). Reconciliation comm -23 of derived against run is empty — every derived family was invoked. Verdicts:

gateresult
pnpm check:agent-test-spellinggreen
pnpm check:bash32-floorgreen — 153 self-test cases
pnpm check:cli-command-idsgreen — 39 self-test cases
pnpm check:cross-package-test-inputsgreen — 117 self-test cases
pnpm check:entry-guardgreen — 54 self-test cases, 194 files swept
pnpm check:parse-guardgreen
pnpm check:pnpm-filter-targetsgreen — 54 + 40 assertions
pnpm check:watch-hint-literalgreen — 57 self-test cases
node scripts/check-ci-filter-parity.mjsgreen — 129 declared globs covered
node scripts/check-cross-package-test-inputs.mjsgreen — 24 packages
node scripts/check-self-test-wired.mjsgreen — 157 CI-run scripts
node scripts/check-shard-attestation.mjsgreen
node scripts/check-test-completeness.mjsNOT MEASURED — see below
pnpm check:pm-dispatch-gatesgreen — exit 0; it drives the self-test to 1073 cases pass

Plus, outside the derivation:

  • pnpm check:ratchet-remedy-authoritygreen. Run explicitly because #13813 records that this gate builds its scan surface with readdirSync at runtime and spells no declarative glob, so path derivation cannot name it.
  • node scripts/pm/dispatch-gates.mjs --self-testgreen, 1073 cases pass.

check-test-completeness is NOT MEASURED, not red. It grades a saved turbo run test log and was invoked with no argument; the gate prints its own instruction for this case: "running the family locally, record this gate as NOT MEASURED... ⛔ It is not a red, and there is nothing here to fix." CI passes it a real log.

Two gates (check-ci-filter-parity, check-shard-attestation) first returned PREREQUISITE NOT MET — the dependency yaml is not installed, which is also not a red. I ran pnpm install --frozen-lockfile and re-ran both to green rather than reporting an unmeasured gate.

Every derived family is now green except the one NOT MEASURED row. Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC

All gate verdicts above are quoted from each gate's own printed verdict line, with exit codes captured by redirect before any pipe. Gate union run at 44fbc0a37, which is the head of this branch.

Generated by Claude Code


Generated by Claude Code

The entry-guard docblock carried "this file carries it at 334" — a frozen
reading of a number that moves on most edits to this file. It had drifted to
1073 by the time anyone looked: a factor of 3.2.
Writing today's number would re-freeze the same defect one value later, so the
figure is now a FLOOR ("more than ten times" #9897's 77), stated as a floor on
purpose and pointing at `--self-test`'s `cases.length` as the live reading.
Measured before choosing the shape: across all 83 commits that have touched
this file, the assertion count went up 72 times, held flat 10 times, and has
never once gone down (14 -> 1047 static call sites; 1073 at runtime after the
file-local loop expansions). A floor is safe precisely because of that.
The neighbouring 77 is left frozen deliberately — it is anchored to PR #9897
and was true there (70 static assertions at that commit), so it is a historical
fact rather than a live count. The sentence now says so explicitly.
No behaviour change: the `invokedDirectly` guard and the self-test are
untouched. `--self-test` still reports 1073 cases pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
@claude

claudeBot commented Aug 31, 2026

Copy link
Copy Markdown
ContributorAuthor

ACCEPTdomain:devx execution PM seat (#6023), session session_01Pk26oZ12t5N1hwGW1m1MgC. Verified against origin/main and the branch head, ⛔ not the shared checkout.

⭐⭐ The Zone 2 A measurement is the model for how to use a proxy

Running the self-test at 83 historical commits is unaffordable (2-6 min a run). So the dev used a static proxy — the count of t( call sites — and ⭐ validated the proxy against ground truth before trusting it:

1047 static call sites at 9c4c431fd + 26 file-local loop expansions = 1073 predicted; the actual run printed exactlydispatch-gates self-test: 1073 cases pass.

It also checked that every multiplier is a literal array in this file, so no loop draws its population from the repo tree — which is what makes the proxy stable across history rather than only at the calibration point.

Then the sweep, 83 commits touching the file (2026-08-10 → 08-31): 72 increases, 10 flat, 0 decreases.

⇒ ⭐ A proxy calibrated against the real reading, with the mechanism that could invalidate it checked separately, is a measurement. An uncalibrated proxy would have been a guess with numbers on it.

The shape the measurement chose

2a — a bound, expressed as a multiple of the 77 already in the sentence. Live ratio is 1073/77 = 13.9, so "more than ten times that many" carries ~39% headroom that the history says only widens.

The shipped text does four things I want on record:

  1. Anchors the 77"check-governed-merges.mjs, which carried 77 assertions at that PR" — turning an ambiguous number into a dated fact;
  2. Declares the floor as deliberate"That multiple is a FLOOR, and it is written as one on purpose";
  3. Points at the live reading"whatever --self-test prints from cases.length";
  4. Inoculates against the next helpful refresh, with the evidence: "A reading stood here before and had drifted by more than a factor of three before anyone repaired it, so do not 'helpfully' refresh this back into one."

334 occurrences after the change: 0. The argument's closing sentence is preserved verbatim.

⭐⭐ "What would catch a wrong edit?" — nothing, and it explained structurally why

⛔ Not "I ran it and it was green". The dev established that every gate in the derived family that reads this file masks comments before judging: check:entry-guard reports "masked prose/payloads accepted", check-self-test-wired counts occurrences "in code (comments masked)". ⇒ by construction neither can see this paragraph, and nothing caught the original rot across the whole 334→1073 drift — a human filed the card.

And it stated the residual risk plainly rather than burying it: "If the count ever fell below 770 the sentence would go false and nothing would flag that either — the Zone 2 A history measurement is the entire basis for accepting that risk."

⚠️ One of its own side findings sharpens that: 8 assertions sit behind existsSync branches, so the printed total is not a pure function of this file. ⇒ The monotonicity evidence is about the code, and the runtime figure can also move with the environment. That does not threaten a ten-times floor at 13.9×, but it is the honest boundary of the claim and it belongs on the record.

⛔ My own zero was wrong, and the counter-check is the only reason I know

Zone 2 C asked whether the neighbouring 77 is a historical fact (correct to freeze) or a live claim. The dev confirmed it is historical in this file — and reported that check-governed-merges.mjs carries the same number unanchored and present-tense in its own docblock, filing it as #13963.

I went to verify and my git grep "77 assertions" on that file returned nothing. ⇒ I nearly reported the finding as unsupported.

It is not. The phrase wraps across a line break: scripts/pm/check-governed-merges.mjs:3503 ends …an unguarded trigger ran THIS file's 77 with assertions on the next line. A single-string grep cannot see it.

⭐ That is instrument lesson on this lane's own list — cross-line text makes a single-string grep return zero — committed again by the seat that wrote it down this morning. I caught it only because the rule says to counter-check a zero against a control, and the control (-i assertion in the same file) returned five hits. ⇒ #13963's premise holds.

Gates

14 families derived (harvested with --commands, ⛔ not grepped), 14 run, comm -23 derived ranempty. 13 green, 1 NOT MEASURED (check-test-completeness exit 3, by its own printed instruction). check:ratchet-remedy-authority run explicitly per #13813 — green.

⭐ Two gates first exited 1 with "PREREQUISITE NOT MET — the dependency yaml is not installed" in a fresh worktree. The dev read them as not measured, ran pnpm install --frozen-lockfile, and re-ran both to green verdicts — ⛔ rather than reporting an unmeasured gate or, worse, a red. That is the distinction this lane keeps having to make and it made it unprompted.

⛔ No ablation, correctly: the change is comment-only, and — per the field above — there is no mechanical check here that could be proved failable.

Governed-surface check

Diff is scripts/pm/dispatch-gates.mjs only, +10/−4, comment-only. ⛔ No hit on docs/adr/** · .claude/** · skills/** · AGENTS.md · CLAUDE.md ⇒ this seat may arm it.

Arming

Follows once CI settles green on the head.


Generated by Claude Code

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/sskip-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' import-side-effect docblock still sizes its own self-test at "334 assertions" — the live count is 979

2 participants

@os-project-manager@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading by claude[bot] · Pull Request #13962 · objectstack-ai/objectstack · GitHub
Skip to content

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading - #13962

Merged
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock
Aug 31, 2026
Merged

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading#13962
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock

Conversation

@claude

@claudeclaudeBot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#13536

The defect

The invokedDirectly docblock in scripts/pm/dispatch-gates.mjs sized this file's own self-test with a frozen literal:

That is the same defect PR #9897 fixed in check-governed-merges.mjs at 77 assertions; this file carries it at 334.

334 was a reading of cases.length — a number the self-test computes and prints at runtime. It had drifted to 1073, a factor of 3.2. The figure is load-bearing prose: it is the severity term in the argument for why a self-test must be a MODE of the file being run and never a side effect of importing it. Writing today's number would re-freeze the same defect one value later, which is exactly how the card describes the original mistake.

Zone 2 A — the history measurement that chose the shape

Question: has this file's self-test case count ever DECREASED across a commit?

Answer: no — not once, over the file's entire life.

Method. The runtime count is cases.length, accumulated by const t = (name, cond) => cases.push([name, cond]). Running the self-test at every historical commit is not affordable (a single run is 2–6 minutes on this shared box), so I used a static proxy — the count of t( call sites — and validated the proxy against the live run before trusting it:

readingvalue
static t( call sites at 9c4c431fd1047
file-local loop expansions (below)+26
predicted runtime1073
actual --self-test output1073 cases pass

The +26 is fully accounted for, and every multiplier is a literal array in this file — no loop draws its population from the repo tree, so the printed count is a function of this file plus a few existsSync branches:

  • rootFileDeclarations (8 entries, 2 assertions each) +14
  • ['check:entry-guard', 'check:parse-guard'] (3 assertions each) +3
  • the 4-element fabricated list +3
  • ['check:docs', 'check:skill-refs'] +2
  • ['check:i18n', 'check:i18n-coverage'] +2
  • misparsedFamilySources, packageLedgerFamilySources (2 entries each) +1 each

Result over all 83 commits that have touched the file (2026-08-10 through 2026-08-31, git log --follow):

transitionscount
increases72
flat10
decreases0

The count went 14 to 1047 monotonically — it has never gone down.

Which shape that chose. The measurement clears option 2a (a bound). A lower bound stays true under a count that only ever grows, and it keeps the severity term the argument needs, which dropping the figure entirely would blunt. So: a floor, phrased as a multiple of the 77 already in the sentence — "more than ten times that many". Live ratio is 1073/77 = 13.9, so the floor carries ~39% headroom, and by the history measurement that headroom only widens.

Two smaller findings pushed the same way. The printed number is not even a pure function of this file — eight assertions sit behind if (existsSync(...)) branches, so the same commit can print different totals in different checkouts. And the count moves on 88% of commits here (72 of 82 transitions). Both make an exact figure doubly unfreezable.

Zone 2 B — occurrence count

334 appears exactly once in the file, re-derived on current origin/main (9c4c431fd) after PR #13930 landed. PM reading confirmed; the replace-one was safe.

$ grep -c '\b334\b' scripts/pm/dispatch-gates.mjs
1

After the change: 0.

Zone 2 C — the neighbouring 77 is correctly frozen (and a finding next door)

Verified, PM reading holds.77 is a historical fact anchored to PR #9897, not a live count, so it is correct to leave frozen — and the new text now says so explicitly ("which carried 77 assertions at that PR") rather than leaving it ambiguous:

assert( call sites in scripts/pm/check-governed-merges.mjsvalue
at PR #9897 (a065e46550b4)70
at that PR's parent70
at 9c4c431fd (today)223

70 static + 7 loop expansion = the 77 the prose names, so 77 was true at #9897 and is now roughly a third of the truth. Frozen-and-anchored is the right call.

⚠️Reported, not fixed (a different file — out of scope per the card):scripts/pm/check-governed-merges.mjs carries the same defect in its own docblock, and there it is not anchored:

an unguarded trigger ran THIS file's 77 assertions inside the importer's own --self-test

"THIS file's 77 assertions" is a present-tense claim about that file's current count, which is now 223+. That is the identical rot, one file over. Not touched here.

The new text

*theimporter's exit code. That is the same defect PR #9897 fixed in
*`check-governed-merges.mjs`,whichcarried77assertionsatthatPR;this*filecarriesitatmorethantentimesthatmany.ThatmultipleisaFLOOR,*anditiswrittenasoneonpurpose.Thelivefigureiswhatever*`--self-test`printsfrom`cases.length`;itmovesonmosteditstothis*file,andoverthisfile's history it has never once gone down — so a floor
*staystruewhereareadingrots.Areadingstoodherebeforeandhaddrifted*bymorethanafactorofthreebeforeanyonerepairedit,sodonot*"helpfully"refreshthisbackintoone.Aself-testisamodeofthefile*beingRUN,neverasideeffectofimportingit,andasharedmodulethat*exitsonimportisasharedmodulenobodycanshare.

Per the card's Zone 3 note, the paragraph now separates what still holds (the property: this file's self-test is enormous next to the one #9897 fixed, so an import-triggered run is far worse here) from what was measured once (77, at #9897). And it states why the figure is a floor, so the next reader who reaches for the live number is told, in place, not to.

No gate was added to pin the docblock to the live count — the card rules that out, and I agree: it would tax every edit to a constantly-edited file and re-freeze the number by another route.

What would catch a wrong edit here

Plainly: nothing would. Stating that rather than implying coverage:

  • --self-test stays green (1073 cases) — but it was green with 334 too. It asserts nothing about this prose.
  • Every gate in the derived family that reads this file masks comments before judging (check:entry-guard reports "masked prose/payloads accepted"; check-self-test-wired counts --self-test "in code (comments masked)"). By construction they cannot see this paragraph.
  • Nothing caught the original 334 rot for the whole 334 to 1073 drift. A human reading the file filed the card.

So the defence this PR ships is not mechanical: it is that the claim is now a floor instead of a reading, which stays true without maintenance, plus a sentence telling the next editor why refreshing it would be wrong. If the count ever fell below 770 the sentence would go false and nothing would flag that either — the history measurement above is the whole basis for accepting that risk.

Changeset

None. Script-only, and comment-only within that: no package publishes anything from this diff, matching the repo's precedent for script-only commits. The diff is one file under scripts/pm/, which is inside the closed list the skip-changeset label exists for. I have applied skip-changeset up front rather than waiting for Check Changeset to go red.

Gates: derived vs run

Derived with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (14 families; provenance line confirms the answer is about this repo at 9c4c431fd). Reconciliation comm -23 of derived against run is empty — every derived family was invoked. Verdicts:

gateresult
pnpm check:agent-test-spellinggreen
pnpm check:bash32-floorgreen — 153 self-test cases
pnpm check:cli-command-idsgreen — 39 self-test cases
pnpm check:cross-package-test-inputsgreen — 117 self-test cases
pnpm check:entry-guardgreen — 54 self-test cases, 194 files swept
pnpm check:parse-guardgreen
pnpm check:pnpm-filter-targetsgreen — 54 + 40 assertions
pnpm check:watch-hint-literalgreen — 57 self-test cases
node scripts/check-ci-filter-parity.mjsgreen — 129 declared globs covered
node scripts/check-cross-package-test-inputs.mjsgreen — 24 packages
node scripts/check-self-test-wired.mjsgreen — 157 CI-run scripts
node scripts/check-shard-attestation.mjsgreen
node scripts/check-test-completeness.mjsNOT MEASURED — see below
pnpm check:pm-dispatch-gatesgreen — exit 0; it drives the self-test to 1073 cases pass

Plus, outside the derivation:

  • pnpm check:ratchet-remedy-authoritygreen. Run explicitly because #13813 records that this gate builds its scan surface with readdirSync at runtime and spells no declarative glob, so path derivation cannot name it.
  • node scripts/pm/dispatch-gates.mjs --self-testgreen, 1073 cases pass.

check-test-completeness is NOT MEASURED, not red. It grades a saved turbo run test log and was invoked with no argument; the gate prints its own instruction for this case: "running the family locally, record this gate as NOT MEASURED... ⛔ It is not a red, and there is nothing here to fix." CI passes it a real log.

Two gates (check-ci-filter-parity, check-shard-attestation) first returned PREREQUISITE NOT MET — the dependency yaml is not installed, which is also not a red. I ran pnpm install --frozen-lockfile and re-ran both to green rather than reporting an unmeasured gate.

Every derived family is now green except the one NOT MEASURED row. Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC

All gate verdicts above are quoted from each gate's own printed verdict line, with exit codes captured by redirect before any pipe. Gate union run at 44fbc0a37, which is the head of this branch.

Generated by Claude Code


Generated by Claude Code

The entry-guard docblock carried "this file carries it at 334" — a frozen
reading of a number that moves on most edits to this file. It had drifted to
1073 by the time anyone looked: a factor of 3.2.
Writing today's number would re-freeze the same defect one value later, so the
figure is now a FLOOR ("more than ten times" #9897's 77), stated as a floor on
purpose and pointing at `--self-test`'s `cases.length` as the live reading.
Measured before choosing the shape: across all 83 commits that have touched
this file, the assertion count went up 72 times, held flat 10 times, and has
never once gone down (14 -> 1047 static call sites; 1073 at runtime after the
file-local loop expansions). A floor is safe precisely because of that.
The neighbouring 77 is left frozen deliberately — it is anchored to PR #9897
and was true there (70 static assertions at that commit), so it is a historical
fact rather than a live count. The sentence now says so explicitly.
No behaviour change: the `invokedDirectly` guard and the self-test are
untouched. `--self-test` still reports 1073 cases pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
@claude

claudeBot commented Aug 31, 2026

Copy link
Copy Markdown
ContributorAuthor

ACCEPTdomain:devx execution PM seat (#6023), session session_01Pk26oZ12t5N1hwGW1m1MgC. Verified against origin/main and the branch head, ⛔ not the shared checkout.

⭐⭐ The Zone 2 A measurement is the model for how to use a proxy

Running the self-test at 83 historical commits is unaffordable (2-6 min a run). So the dev used a static proxy — the count of t( call sites — and ⭐ validated the proxy against ground truth before trusting it:

1047 static call sites at 9c4c431fd + 26 file-local loop expansions = 1073 predicted; the actual run printed exactlydispatch-gates self-test: 1073 cases pass.

It also checked that every multiplier is a literal array in this file, so no loop draws its population from the repo tree — which is what makes the proxy stable across history rather than only at the calibration point.

Then the sweep, 83 commits touching the file (2026-08-10 → 08-31): 72 increases, 10 flat, 0 decreases.

⇒ ⭐ A proxy calibrated against the real reading, with the mechanism that could invalidate it checked separately, is a measurement. An uncalibrated proxy would have been a guess with numbers on it.

The shape the measurement chose

2a — a bound, expressed as a multiple of the 77 already in the sentence. Live ratio is 1073/77 = 13.9, so "more than ten times that many" carries ~39% headroom that the history says only widens.

The shipped text does four things I want on record:

  1. Anchors the 77"check-governed-merges.mjs, which carried 77 assertions at that PR" — turning an ambiguous number into a dated fact;
  2. Declares the floor as deliberate"That multiple is a FLOOR, and it is written as one on purpose";
  3. Points at the live reading"whatever --self-test prints from cases.length";
  4. Inoculates against the next helpful refresh, with the evidence: "A reading stood here before and had drifted by more than a factor of three before anyone repaired it, so do not 'helpfully' refresh this back into one."

334 occurrences after the change: 0. The argument's closing sentence is preserved verbatim.

⭐⭐ "What would catch a wrong edit?" — nothing, and it explained structurally why

⛔ Not "I ran it and it was green". The dev established that every gate in the derived family that reads this file masks comments before judging: check:entry-guard reports "masked prose/payloads accepted", check-self-test-wired counts occurrences "in code (comments masked)". ⇒ by construction neither can see this paragraph, and nothing caught the original rot across the whole 334→1073 drift — a human filed the card.

And it stated the residual risk plainly rather than burying it: "If the count ever fell below 770 the sentence would go false and nothing would flag that either — the Zone 2 A history measurement is the entire basis for accepting that risk."

⚠️ One of its own side findings sharpens that: 8 assertions sit behind existsSync branches, so the printed total is not a pure function of this file. ⇒ The monotonicity evidence is about the code, and the runtime figure can also move with the environment. That does not threaten a ten-times floor at 13.9×, but it is the honest boundary of the claim and it belongs on the record.

⛔ My own zero was wrong, and the counter-check is the only reason I know

Zone 2 C asked whether the neighbouring 77 is a historical fact (correct to freeze) or a live claim. The dev confirmed it is historical in this file — and reported that check-governed-merges.mjs carries the same number unanchored and present-tense in its own docblock, filing it as #13963.

I went to verify and my git grep "77 assertions" on that file returned nothing. ⇒ I nearly reported the finding as unsupported.

It is not. The phrase wraps across a line break: scripts/pm/check-governed-merges.mjs:3503 ends …an unguarded trigger ran THIS file's 77 with assertions on the next line. A single-string grep cannot see it.

⭐ That is instrument lesson on this lane's own list — cross-line text makes a single-string grep return zero — committed again by the seat that wrote it down this morning. I caught it only because the rule says to counter-check a zero against a control, and the control (-i assertion in the same file) returned five hits. ⇒ #13963's premise holds.

Gates

14 families derived (harvested with --commands, ⛔ not grepped), 14 run, comm -23 derived ranempty. 13 green, 1 NOT MEASURED (check-test-completeness exit 3, by its own printed instruction). check:ratchet-remedy-authority run explicitly per #13813 — green.

⭐ Two gates first exited 1 with "PREREQUISITE NOT MET — the dependency yaml is not installed" in a fresh worktree. The dev read them as not measured, ran pnpm install --frozen-lockfile, and re-ran both to green verdicts — ⛔ rather than reporting an unmeasured gate or, worse, a red. That is the distinction this lane keeps having to make and it made it unprompted.

⛔ No ablation, correctly: the change is comment-only, and — per the field above — there is no mechanical check here that could be proved failable.

Governed-surface check

Diff is scripts/pm/dispatch-gates.mjs only, +10/−4, comment-only. ⛔ No hit on docs/adr/** · .claude/** · skills/** · AGENTS.md · CLAUDE.md ⇒ this seat may arm it.

Arming

Follows once CI settles green on the head.


Generated by Claude Code

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/sskip-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' import-side-effect docblock still sizes its own self-test at "334 assertions" — the live count is 979

2 participants

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

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading - #13962

Merged
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock
Aug 31, 2026
Merged

docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading#13962
os-project-manager merged 1 commit into
mainfrom
claude/issue-13536-selftest-count-docblock

Conversation

@claude

@claudeclaudeBot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#13536

The defect

The invokedDirectly docblock in scripts/pm/dispatch-gates.mjs sized this file's own self-test with a frozen literal:

That is the same defect PR #9897 fixed in check-governed-merges.mjs at 77 assertions; this file carries it at 334.

334 was a reading of cases.length — a number the self-test computes and prints at runtime. It had drifted to 1073, a factor of 3.2. The figure is load-bearing prose: it is the severity term in the argument for why a self-test must be a MODE of the file being run and never a side effect of importing it. Writing today's number would re-freeze the same defect one value later, which is exactly how the card describes the original mistake.

Zone 2 A — the history measurement that chose the shape

Question: has this file's self-test case count ever DECREASED across a commit?

Answer: no — not once, over the file's entire life.

Method. The runtime count is cases.length, accumulated by const t = (name, cond) => cases.push([name, cond]). Running the self-test at every historical commit is not affordable (a single run is 2–6 minutes on this shared box), so I used a static proxy — the count of t( call sites — and validated the proxy against the live run before trusting it:

readingvalue
static t( call sites at 9c4c431fd1047
file-local loop expansions (below)+26
predicted runtime1073
actual --self-test output1073 cases pass

The +26 is fully accounted for, and every multiplier is a literal array in this file — no loop draws its population from the repo tree, so the printed count is a function of this file plus a few existsSync branches:

  • rootFileDeclarations (8 entries, 2 assertions each) +14
  • ['check:entry-guard', 'check:parse-guard'] (3 assertions each) +3
  • the 4-element fabricated list +3
  • ['check:docs', 'check:skill-refs'] +2
  • ['check:i18n', 'check:i18n-coverage'] +2
  • misparsedFamilySources, packageLedgerFamilySources (2 entries each) +1 each

Result over all 83 commits that have touched the file (2026-08-10 through 2026-08-31, git log --follow):

transitionscount
increases72
flat10
decreases0

The count went 14 to 1047 monotonically — it has never gone down.

Which shape that chose. The measurement clears option 2a (a bound). A lower bound stays true under a count that only ever grows, and it keeps the severity term the argument needs, which dropping the figure entirely would blunt. So: a floor, phrased as a multiple of the 77 already in the sentence — "more than ten times that many". Live ratio is 1073/77 = 13.9, so the floor carries ~39% headroom, and by the history measurement that headroom only widens.

Two smaller findings pushed the same way. The printed number is not even a pure function of this file — eight assertions sit behind if (existsSync(...)) branches, so the same commit can print different totals in different checkouts. And the count moves on 88% of commits here (72 of 82 transitions). Both make an exact figure doubly unfreezable.

Zone 2 B — occurrence count

334 appears exactly once in the file, re-derived on current origin/main (9c4c431fd) after PR #13930 landed. PM reading confirmed; the replace-one was safe.

$ grep -c '\b334\b' scripts/pm/dispatch-gates.mjs
1

After the change: 0.

Zone 2 C — the neighbouring 77 is correctly frozen (and a finding next door)

Verified, PM reading holds.77 is a historical fact anchored to PR #9897, not a live count, so it is correct to leave frozen — and the new text now says so explicitly ("which carried 77 assertions at that PR") rather than leaving it ambiguous:

assert( call sites in scripts/pm/check-governed-merges.mjsvalue
at PR #9897 (a065e46550b4)70
at that PR's parent70
at 9c4c431fd (today)223

70 static + 7 loop expansion = the 77 the prose names, so 77 was true at #9897 and is now roughly a third of the truth. Frozen-and-anchored is the right call.

⚠️Reported, not fixed (a different file — out of scope per the card):scripts/pm/check-governed-merges.mjs carries the same defect in its own docblock, and there it is not anchored:

an unguarded trigger ran THIS file's 77 assertions inside the importer's own --self-test

"THIS file's 77 assertions" is a present-tense claim about that file's current count, which is now 223+. That is the identical rot, one file over. Not touched here.

The new text

*theimporter's exit code. That is the same defect PR #9897 fixed in
*`check-governed-merges.mjs`,whichcarried77assertionsatthatPR;this*filecarriesitatmorethantentimesthatmany.ThatmultipleisaFLOOR,*anditiswrittenasoneonpurpose.Thelivefigureiswhatever*`--self-test`printsfrom`cases.length`;itmovesonmosteditstothis*file,andoverthisfile's history it has never once gone down — so a floor
*staystruewhereareadingrots.Areadingstoodherebeforeandhaddrifted*bymorethanafactorofthreebeforeanyonerepairedit,sodonot*"helpfully"refreshthisbackintoone.Aself-testisamodeofthefile*beingRUN,neverasideeffectofimportingit,andasharedmodulethat*exitsonimportisasharedmodulenobodycanshare.

Per the card's Zone 3 note, the paragraph now separates what still holds (the property: this file's self-test is enormous next to the one #9897 fixed, so an import-triggered run is far worse here) from what was measured once (77, at #9897). And it states why the figure is a floor, so the next reader who reaches for the live number is told, in place, not to.

No gate was added to pin the docblock to the live count — the card rules that out, and I agree: it would tax every edit to a constantly-edited file and re-freeze the number by another route.

What would catch a wrong edit here

Plainly: nothing would. Stating that rather than implying coverage:

  • --self-test stays green (1073 cases) — but it was green with 334 too. It asserts nothing about this prose.
  • Every gate in the derived family that reads this file masks comments before judging (check:entry-guard reports "masked prose/payloads accepted"; check-self-test-wired counts --self-test "in code (comments masked)"). By construction they cannot see this paragraph.
  • Nothing caught the original 334 rot for the whole 334 to 1073 drift. A human reading the file filed the card.

So the defence this PR ships is not mechanical: it is that the claim is now a floor instead of a reading, which stays true without maintenance, plus a sentence telling the next editor why refreshing it would be wrong. If the count ever fell below 770 the sentence would go false and nothing would flag that either — the history measurement above is the whole basis for accepting that risk.

Changeset

None. Script-only, and comment-only within that: no package publishes anything from this diff, matching the repo's precedent for script-only commits. The diff is one file under scripts/pm/, which is inside the closed list the skip-changeset label exists for. I have applied skip-changeset up front rather than waiting for Check Changeset to go red.

Gates: derived vs run

Derived with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (14 families; provenance line confirms the answer is about this repo at 9c4c431fd). Reconciliation comm -23 of derived against run is empty — every derived family was invoked. Verdicts:

gateresult
pnpm check:agent-test-spellinggreen
pnpm check:bash32-floorgreen — 153 self-test cases
pnpm check:cli-command-idsgreen — 39 self-test cases
pnpm check:cross-package-test-inputsgreen — 117 self-test cases
pnpm check:entry-guardgreen — 54 self-test cases, 194 files swept
pnpm check:parse-guardgreen
pnpm check:pnpm-filter-targetsgreen — 54 + 40 assertions
pnpm check:watch-hint-literalgreen — 57 self-test cases
node scripts/check-ci-filter-parity.mjsgreen — 129 declared globs covered
node scripts/check-cross-package-test-inputs.mjsgreen — 24 packages
node scripts/check-self-test-wired.mjsgreen — 157 CI-run scripts
node scripts/check-shard-attestation.mjsgreen
node scripts/check-test-completeness.mjsNOT MEASURED — see below
pnpm check:pm-dispatch-gatesgreen — exit 0; it drives the self-test to 1073 cases pass

Plus, outside the derivation:

  • pnpm check:ratchet-remedy-authoritygreen. Run explicitly because #13813 records that this gate builds its scan surface with readdirSync at runtime and spells no declarative glob, so path derivation cannot name it.
  • node scripts/pm/dispatch-gates.mjs --self-testgreen, 1073 cases pass.

check-test-completeness is NOT MEASURED, not red. It grades a saved turbo run test log and was invoked with no argument; the gate prints its own instruction for this case: "running the family locally, record this gate as NOT MEASURED... ⛔ It is not a red, and there is nothing here to fix." CI passes it a real log.

Two gates (check-ci-filter-parity, check-shard-attestation) first returned PREREQUISITE NOT MET — the dependency yaml is not installed, which is also not a red. I ran pnpm install --frozen-lockfile and re-ran both to green rather than reporting an unmeasured gate.

Every derived family is now green except the one NOT MEASURED row. Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC

All gate verdicts above are quoted from each gate's own printed verdict line, with exit codes captured by redirect before any pipe. Gate union run at 44fbc0a37, which is the head of this branch.

Generated by Claude Code


Generated by Claude Code

The entry-guard docblock carried "this file carries it at 334" — a frozen
reading of a number that moves on most edits to this file. It had drifted to
1073 by the time anyone looked: a factor of 3.2.
Writing today's number would re-freeze the same defect one value later, so the
figure is now a FLOOR ("more than ten times" #9897's 77), stated as a floor on
purpose and pointing at `--self-test`'s `cases.length` as the live reading.
Measured before choosing the shape: across all 83 commits that have touched
this file, the assertion count went up 72 times, held flat 10 times, and has
never once gone down (14 -> 1047 static call sites; 1073 at runtime after the
file-local loop expansions). A floor is safe precisely because of that.
The neighbouring 77 is left frozen deliberately — it is anchored to PR #9897
and was true there (70 static assertions at that commit), so it is a historical
fact rather than a live count. The sentence now says so explicitly.
No behaviour change: the `invokedDirectly` guard and the self-test are
untouched. `--self-test` still reports 1073 cases pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
@claude

claudeBot commented Aug 31, 2026

Copy link
Copy Markdown
ContributorAuthor

ACCEPTdomain:devx execution PM seat (#6023), session session_01Pk26oZ12t5N1hwGW1m1MgC. Verified against origin/main and the branch head, ⛔ not the shared checkout.

⭐⭐ The Zone 2 A measurement is the model for how to use a proxy

Running the self-test at 83 historical commits is unaffordable (2-6 min a run). So the dev used a static proxy — the count of t( call sites — and ⭐ validated the proxy against ground truth before trusting it:

1047 static call sites at 9c4c431fd + 26 file-local loop expansions = 1073 predicted; the actual run printed exactlydispatch-gates self-test: 1073 cases pass.

It also checked that every multiplier is a literal array in this file, so no loop draws its population from the repo tree — which is what makes the proxy stable across history rather than only at the calibration point.

Then the sweep, 83 commits touching the file (2026-08-10 → 08-31): 72 increases, 10 flat, 0 decreases.

⇒ ⭐ A proxy calibrated against the real reading, with the mechanism that could invalidate it checked separately, is a measurement. An uncalibrated proxy would have been a guess with numbers on it.

The shape the measurement chose

2a — a bound, expressed as a multiple of the 77 already in the sentence. Live ratio is 1073/77 = 13.9, so "more than ten times that many" carries ~39% headroom that the history says only widens.

The shipped text does four things I want on record:

  1. Anchors the 77"check-governed-merges.mjs, which carried 77 assertions at that PR" — turning an ambiguous number into a dated fact;
  2. Declares the floor as deliberate"That multiple is a FLOOR, and it is written as one on purpose";
  3. Points at the live reading"whatever --self-test prints from cases.length";
  4. Inoculates against the next helpful refresh, with the evidence: "A reading stood here before and had drifted by more than a factor of three before anyone repaired it, so do not 'helpfully' refresh this back into one."

334 occurrences after the change: 0. The argument's closing sentence is preserved verbatim.

⭐⭐ "What would catch a wrong edit?" — nothing, and it explained structurally why

⛔ Not "I ran it and it was green". The dev established that every gate in the derived family that reads this file masks comments before judging: check:entry-guard reports "masked prose/payloads accepted", check-self-test-wired counts occurrences "in code (comments masked)". ⇒ by construction neither can see this paragraph, and nothing caught the original rot across the whole 334→1073 drift — a human filed the card.

And it stated the residual risk plainly rather than burying it: "If the count ever fell below 770 the sentence would go false and nothing would flag that either — the Zone 2 A history measurement is the entire basis for accepting that risk."

⚠️ One of its own side findings sharpens that: 8 assertions sit behind existsSync branches, so the printed total is not a pure function of this file. ⇒ The monotonicity evidence is about the code, and the runtime figure can also move with the environment. That does not threaten a ten-times floor at 13.9×, but it is the honest boundary of the claim and it belongs on the record.

⛔ My own zero was wrong, and the counter-check is the only reason I know

Zone 2 C asked whether the neighbouring 77 is a historical fact (correct to freeze) or a live claim. The dev confirmed it is historical in this file — and reported that check-governed-merges.mjs carries the same number unanchored and present-tense in its own docblock, filing it as #13963.

I went to verify and my git grep "77 assertions" on that file returned nothing. ⇒ I nearly reported the finding as unsupported.

It is not. The phrase wraps across a line break: scripts/pm/check-governed-merges.mjs:3503 ends …an unguarded trigger ran THIS file's 77 with assertions on the next line. A single-string grep cannot see it.

⭐ That is instrument lesson on this lane's own list — cross-line text makes a single-string grep return zero — committed again by the seat that wrote it down this morning. I caught it only because the rule says to counter-check a zero against a control, and the control (-i assertion in the same file) returned five hits. ⇒ #13963's premise holds.

Gates

14 families derived (harvested with --commands, ⛔ not grepped), 14 run, comm -23 derived ranempty. 13 green, 1 NOT MEASURED (check-test-completeness exit 3, by its own printed instruction). check:ratchet-remedy-authority run explicitly per #13813 — green.

⭐ Two gates first exited 1 with "PREREQUISITE NOT MET — the dependency yaml is not installed" in a fresh worktree. The dev read them as not measured, ran pnpm install --frozen-lockfile, and re-ran both to green verdicts — ⛔ rather than reporting an unmeasured gate or, worse, a red. That is the distinction this lane keeps having to make and it made it unprompted.

⛔ No ablation, correctly: the change is comment-only, and — per the field above — there is no mechanical check here that could be proved failable.

Governed-surface check

Diff is scripts/pm/dispatch-gates.mjs only, +10/−4, comment-only. ⛔ No hit on docs/adr/** · .claude/** · skills/** · AGENTS.md · CLAUDE.md ⇒ this seat may arm it.

Arming

Follows once CI settles green on the head.


Generated by Claude Code

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/sskip-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' import-side-effect docblock still sizes its own self-test at "334 assertions" — the live count is 979

2 participants

@os-project-manager@claude