You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dispatch-gates: let a wide-population declaration carry exact-file hints (#17048)
check:route-envelope's real population is an AST-content filter over every
non-test .ts file under packages/ (does it write a Hono/Express JSON
response?), not a filename convention -- no glob spells it short of the
whole subtree. bare-root-worklist.mjs's own CENSUS_REFUSE_WIDE ledger had
already measured and recorded this verdict (37.4% of tracked packages/
files, REFUSE-WIDE) but the gate's own source never acted on it, so a
brand-new response-writing module matched none of its 30 declared MODULES
hints and fell into dispatch-gates' Silent bucket -- the weakest verdict,
excluded from the runnable union -- instead of the "Declared WIDE
population" bucket a reader is explicitly told not to read as clearance.
Adding the wide-population marker as-is was refused: widePopulationRefusal
treated ANY named hint as a contradiction, but all 10 gates that carry the
marker today have zero hints, so deleting check:route-envelope's 30
MODULES keys to fit was the wrong trade -- it would turn a precise MATCHED
lead on every already-known route module into an undifferentiated
wide-population one. placeFamily's own runtime placement already handles
hints coexisting with a wide-population marker correctly (matched stays
matched; everything else promotes out of Silent); only the validation-only
widePopulationRefusal was stricter than the mechanism it guards.
Refined widePopulationRefusal: an exact-file hint (matched only by
equality, per hintCovers' own plain branch) never contradicts "no glob
places this" -- it is an enumerated member, not a population claim. A hint
that reaches beyond itself (a bare directory, or a glob) is compatible
only when the marker's own reason text names it, the same "the reason is
what a reader trusts" bar wholeTreePopulationRefusal already holds a
repo-root walk to. check:route-envelope's one such hint,
DISPATCHER_DOMAIN_DIR, is a second, independently audited surface named in
the reason for exactly that reason. A glob is never exempt this way, named
or not.
No change to placeFamily's existing runtime behaviour and no change to
check:route-envelope's own audited behaviour -- same files error, same
files pass. New self-test coverage for every branch of the refined
predicate.
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
Co-authored-by: Claude <noreply@anthropic.com>
// dispatch-gates: wide-population -- discover() and discoverResponseWriters() (the two walks behind MODULES and the Hono/Express surfaces) both root at join(ROOT, 'packages') and admit every non-test .ts file there before an AST pass decides which of them write a response -- a file-KIND filter, not a filename one, so no glob spells the population short of the whole subtree. Measured fresh on this tree: 2403 of 6491 tracked packages/ files are non-test .ts source (37.0%), corroborating the independent fs-trace in scripts/pm/bare-root-worklist.mjs's CENSUS_REFUSE_WIDE ("check:route-envelope packages", 2181/5837 = 37.4% at 2aa8456cf, verdict REFUSE-WIDE) -- the same width trade that table already recorded for this gate, now acted on here (#16828). The MODULES table's own keys stay as exact-file hints below, so a card touching an ALREADY-declared module still MATCHES precisely; this marker only stops a file the walk discovers but MODULES does not yet list -- the #16730 case -- from reading as Silent. packages/runtime/src/domains (DISPATCHER_DOMAIN_DIR) is a second, separately audited surface: discoverDomains() enumerates it exhaustively against DISPATCHER_DOMAINS below, independent of the response-writer population this marker is about.
208
+
207
209
/**
208
210
* Every route module in the repo, with the envelope structure it is DECLARED to
209
211
* have. A module the scan finds that is not listed here fails — see the header.
0 commit comments