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
{{ message }}
Repository navigation
Commit 57927af
Browse filesBrowse the repository at this point in the historyBrowse files
fix(docs-audit): measure the bridge cause split on the advisory path and render it
`bridgeCoverageFrom` derives three causes for an unreachable bridge row
(`discovery-gap` / `no-in-repo-registrar` / `undecided`), but only against a
ceiling passed as its optional third argument. Only the `--bridge-coverage` CLI
arm passed one; the PHASE 2 advisory path did not, so on that path every cause
read `unmeasured` and the three counts were `null` — and the docs-drift PR
comment, the surface a human actually reads, rendered all 177 unreachable rows
as ONE population when the census says there are three.
Both hops, because either alone is the half-wired state: a ceiling nobody
renders is cost paid for no reader, and a render branch with no ceiling prints
`unmeasured` in a nicer shape.
- the ceiling is extracted to `ceilingTailsFrom` and built in ONE place, so the
two arms that now publish these three buckets cannot compute them over two
populations;
- the advisory arm passes it;
- `docs-drift-check.yml` renders the split, with the parts READ off the same
object as the total and the breakdown withheld — as a stated verdict — on
numbers that do not partition it;
- `--self-test` pins `causes` at BOTH ends (#9433), pins the partition guard,
and pins that the renderer derives no cause count of its own.
Measured on f5a7f9c, 7 warm runs per arm: advisory run 0.652s -> 1.998s
(+1.35s), 1950 source files walked, 1106 past the `path` prefilter, 82-tail
ceiling. Same order as the ~1.4s recorded on 589758d, so the cost that could
have flipped this decision has not moved.
Part of #11867
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UjM2ia8Av1v5NqfqQEQmC6
Copy file name to clipboardExpand all lines: .github/workflows/docs-drift-check.yml
+41-1Lines changed: 41 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -259,7 +259,47 @@ jobs:
259
259
if (crossCutting.length) limits.push(`**${crossCutting.length}** cross-cutting symbol(s) contributed no route anchor: \`${crossCutting.join('`, `')}\``);
260
260
if (overbroad.length) limits.push(`**${overbroad.length}** anchor(s) matched too much of the corpus to be a work list: \`${overbroad.join('`, `')}\``);
261
261
if (weak.length) limits.push(`**${weak.length}** name(s) were too generic to anchor anything (single lowercase words)`);
262
-
if (bridge && bridge.measured && bridge.unreachable > 0) limits.push(`the SDK route bridge reached **${bridge.reachable}** of **${bridge.clientRows}** client-bound route-ledger rows — the other **${bridge.unreachable}** have no registrar \`path:\` tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run: \`node scripts/docs-audit/affected-docs.mjs --bridge-coverage\``);
262
+
// ── WHY THOSE ROWS ARE UNREACHABLE, NOT JUST HOW MANY (#11867) ────────
263
+
//
264
+
// The line above used to end at the count, and a count is one population.
265
+
// The census says there are three, and the difference is the whole reason
266
+
// the split exists: the auth ledger's `56 of 56` and the rest ledger's
267
+
// `46 of 87` print identically and are NOT the same finding — the first has
268
+
// no in-repo registration site at all, so the discovery widening the second
269
+
// one wants moves it by zero rows. That conflation already aimed one card
270
+
// (#11178) at widening a recognizer that was never the constraint, and this
271
+
// comment is the surface where a human meets the number.
272
+
//
273
+
// ⛔ SAME NAMES, ONE DERIVATION — the rule stated three lines up for the
274
+
// `anchorless` pair, and it binds here for the same reason. `bridge.causes`
275
+
// is a PARTITION of `bridge.unreachable`, computed ONCE inside
276
+
// `bridgeCoverageFrom` and published whole; the parts are READ off the same
277
+
// object as the total and never recomputed here. Re-deriving them from
278
+
// `bridge.ledgers` would be a second derivation that agrees today, drifts
279
+
// silently tomorrow, and renders a breakdown that sums to something the
280
+
// headline beside it denies.
281
+
//
282
+
// And on numbers that do NOT partition that total, the split is WITHHELD and
283
+
// the run says the census is broken, rather than printing three figures
284
+
// beside a fourth they contradict. That state cannot arise from
285
+
// `bridgeCoverageFrom` — `affected-docs.mjs --self-test` pins the partition
286
+
// — which is what makes it a verdict here and not a fallback.
287
+
//
288
+
// `measured: false` keeps its honest arm: a run that supplied no ceiling
289
+
// reports that WHY was not measured. It says so in words rather than
290
+
// rendering three nulls or, worse, three zeroes — "nobody looked" is not
291
+
// "none found", the same distinction `computedOn.dirty`'s null arm draws.
292
+
const causes = (bridge && bridge.causes) || null;
293
+
let bridgeCauses = '';
294
+
if (causes && causes.measured === true) {
295
+
const parts = causes.remediable + causes.structural + causes.undecided;
296
+
bridgeCauses = parts === bridge.unreachable
297
+
? ` Of those **${bridge.unreachable}**: **${causes.remediable}** are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); **${causes.structural}** are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; **${causes.undecided}** are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here).`
298
+
: ` ⛔ Its cause census is BROKEN — **${causes.remediable}** + **${causes.structural}** + **${causes.undecided}** is not the **${bridge.unreachable}** it claims to break down, so the split is withheld.`;
299
+
} else if (causes && causes.measured === false) {
300
+
bridgeCauses = ` WHY those rows are unreachable was NOT measured on this run — ${causes.reason} — so no cause may be read into the count above.`;
301
+
}
302
+
if (bridge && bridge.measured && bridge.unreachable > 0) limits.push(`the SDK route bridge reached **${bridge.reachable}** of **${bridge.clientRows}** client-bound route-ledger rows — the other **${bridge.unreachable}** have no registrar \`path:\` tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run.${bridgeCauses} The rows themselves: \`node scripts/docs-audit/affected-docs.mjs --bridge-coverage\``);
263
303
// ── THE RULE-CARRYING PAGE AN EMITTER DIFF CANNOT REACH (#11434) ──────
264
304
//
265
305
// Every line above is a REPORT about this run: a count this run produced, a
0 commit comments