feat(dispatch-gates): a checkable whole-tree-population channel, so a repo-wide gate is placed by declaration instead of landing near undetermined - #14774
Queued
claude[bot] wants to merge 4 commits into
Conversation
baozhoutao
marked this pull request as ready for review
September 3, 2026 01:15
baozhoutao
enabled auto-merge
September 3, 2026 01:16
baozhoutao
added this pull request to the merge queue
Sep 3, 2026
Any commits made after this event will not be merged.
Contributor
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 3, 2026
This was referenced Sep 3, 2026
baozhoutao
added this pull request to the merge queue
Sep 3, 2026
Any commits made after this event will not be merged.
This was referenced Sep 3, 2026
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14189
A checkable, in-source channel for a gate to declare "my population is the WHOLE tree; every card implicates me; do not narrow me" — the exact inverse of
dispatch-gates: no-path-population— consumed by the derivation so a declaring gate is placed by its declaration instead of landing nearundeterminedby accident, and rendered as an always-runs row rather than as leads.The marker
Same comment-form tolerance as its sibling, parsed by a sibling regex, reason REQUIRED. ⛔ Not the
ROOT_DIR_WATCH_HINTSliteral idiom, and no whole-tree literal anywhere: a**/./ bare-root declaration is the fabricated-lead movescripts/workspace-enumerator.mjsprices at +41725 (gate, file) pairs.Unlike
no-path-population, this declaration does not contradict a gate that names paths — a whole-tree gate still spells its own baseline artifacts, and those literals stay inentry.hintswhere the unreachable sweep still grades them. The declaration supersedes them for PLACEMENT only. What it does contradict isno-path-population, and that pair is refused.Which gates were declared, and why the census is five and not six
Each candidate was judged by reading its walk on this branch, never by the census that nominated it.
scripts/check-nul-bytes.mjsgit ls-filesPLUSgit ls-files --others --exclude-standardscripts/check-comment-mask-corpus.mjscollectSources(root = REPO_ROOT)— a repo-root walk over every authored JS/TS filescripts/check-refd-timer-probe.mjsreadTree(root = REPO_ROOT), the same tracked-plus-untracked sweepscripts/check-closing-keyword-parity.mjssweep(root)overgit ls-files -z, node_modules and dist asidescripts/check-watch-hint-literal.mjsaudit(walk(REPO_ROOT))— every authored JS/TS file in the treescripts/check-self-test-workflow-commands.mjswalkScripts(join(ROOT, 'scripts'))plus.github/workflows— a bounded subtreeThe last row is the reason the six nominated by #14325's census are five here. Its population is narrowable, so the ordinary subtree declaration is its remedy, not this channel — declaring it would put a row on every card for a gate that reads only
scripts/**, which is the fabricated lead this channel exists to avoid.The liveness predicate, and its limits
A declaration is checkable:
repoRootWalkSpellingreads the gate's own source with comments and--self-testbodies masked (the same normalizationpayloadEnvDependenceapplies) and looks for a published set of repo-root walk spellings:git ls-filesenumeration of the tracked corpus;wholeTreePopulationRefusalthen refuses two contradictions: a declaration with no walk behind it, and a gate carrying both markers.Stated limits, because they change how the row should be read:
unreachableLinesstates for its own listing.REPO_ROOT_WALK_SPELLINGS), printed in the refusal text, and the remedy for a new spelling is to extend it with a self-test case beside it.resolve(REPO_ROOT, maskerPath)— a path BUILD, not a walk — and would have vouched for practically any gate holding aREPO_ROOTconstant, i.e. a liveness check that cannot fail. Requiring the root to be the whole argument list restores the discrimination, and a pin holds it.Measured over the six candidates, limbs A/B/C select exactly the five declared and none of the sixth.
What the derivation does with it
placeFamilyis the ONE seam: it returnsalways-runsfor a declaring family and otherwise delegates toclassifyEntryunchanged.matched(a lead on every card is a lead on no card), neversilent(a false clearance), neverundetermined(its population is not unknown, it has been READ);Always runs (declared population)heading, identical for every card, each row carrying the gate's reason and the liveness spelling that vouches for it — and a REFUSED declaration prints as refused rather than vanishing;--commandsprints, and--ranreconciles against it, because a gate every card implicates is a gate the card owes;--jsoncarries it under its ownalwaysRunsPopulationkey, out ofmatched;--residueno longer lists a declaring gate as Silent, andresidueLinesaccounts for the fourth bucket as its own partition term — a placement wired into the derivation and not into that sum would shrink the residue silently, which is what that function's throw exists to catch.Sample, on a card that touches none of them (
packages/rest/src/server.ts):and the residue partition moves from
21 matched / 40 undetermined / 141 silentto21 matched / 40 undetermined / 136 silent / 5 always-runsover the same 202 discovered families.Byte-identity for non-declaring gates
--commandsreplayed on the merge base (7a17f3bf1) and on this branch, over four probe paths. Every diff is a pure addition of the declaring gates' commands: no line removed, none reordered, none changed.diffremovalspackages/rest/src/server.tsdocs/adr/0112-error-code-vocabulary-and-ledger.mdscripts/pm/dispatch-gates.mjspackages/spec/src/index.tsThe
scripts/pm/dispatch-gates.mjsprobe adds four, not five, and that is the channel behaving:pnpm check:watch-hint-literalwas already in that card's union by path, so it moved from the matched block to the always-runs block and the command set is unchanged for it.Tests
40 new self-test cases in
dispatch-gates.mjs— marker parsing in both comment forms, the two markers never reading as each other, each published liveness spelling against the shape it was written for, prose and self-test-body masking, the bounded-subtree negative, both refusals, placement (declared ⇒ always-runs on four unrelated probe paths, and NOT matched even for a card editing the gate's own script, where the identity key would otherwise hit), the byte-identity ofplaceFamilyagainstclassifyEntryfor non-declaring entries, the union and reconciliation terms, the rendering, and the residue partition throw. Plus a live half: the live tree carries at least one declaration, every one carries a non-empty reason, every one is backed by a root walk and contradicts no other marker, and no live declaring family lands in matched/silent/undetermined for any card.node scripts/pm/dispatch-gates.mjs --self-test→ 1283 cases pass ata7dead9d9.Discriminating mutation, on the committed tree: deleting the one declaration line from
placeFamily(mutation confirmed on disk — occurrences before=1 after=0, on-disk blobbc8c0e7bvs HEAD blob5fbb9802,git diff --stat1 deletion) turns 7 of 1283 cases red, and every one of them is a placement pin — unit, live-tree and end-to-end. Restored withgit checkout HEAD -- ABSOLUTE_PATHunder a trap; restoration proven by blob equality (5fbb9802==5fbb9802) and an emptygit diff HEAD, not by an exit code.Gate family derived in this worktree with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands(22 families, the script deriving its own change set from the merge base rather than from a hand-written path list) and every one run: all green, exceptnode scripts/check-test-completeness.mjs, which exits 3 = PREREQUISITE NOT MET (it grades a savedturbo run testlog CI tees; there is no local log) — recorded as NOT MEASURED, not as a red, per its own verdict text.origin/mainwas merged in before pushing; the union was re-derived on the merged head and is identical, and the whole union was re-run there. Every reading quoted above is from7d9b7bd54, the merged head, except the 1283-case self-test and the mutation, which were measured ata7dead9d9and re-run at7d9b7bd54.Not in this change
scripts/pm/bare-root-worklist.mjsuntouched — its--self-testis green as-is and demanded no row for the new channel.--self-testpin was added inside the five declaring gates. The pin that matters lives indispatch-gates.mjs's own live half, which grades every declarer at once against the real tree; five copies of it would be five things to remember and the sixth gate to declare would carry none.🤖 Generated with Claude Code
https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV
Generated by Claude Code