Uh oh!
There was an error while loading. Please reload this page.
Assert the OG card URL escapes proxy.ts's matcher, instead of only reporting it - #13932
Conversation
… of only reporting it `check-docs-locale-catch-all.mjs` already computed the reading that matters -- `stats.ogUrlSkipsProxy = !compiled.runsFor(probe)` -- and only printed it in the summary line. The same file's `stats.dottedBypassesProxy` was worse than inert: it LICENSES two relaxations (`:385` skips the catch-all requirement, `:409` skips the i18n predicate) while asserting nothing itself. So widening proxy.ts's matcher until it covers dotted paths took the whole gate green over a fully broken surface: the catch-all limb relaxed, the i18n limb relaxed, and the OG limb still saw a dotted marker and stayed silent -- while every live `og:image` URL was now locale-rewritten to a path `app/og/` does not serve. Measured on the script's own fixture shape before this commit: widened matcher, `ogUrlSkipsProxy = false`, findings = 0. The relaxation is kept: it is correct on its own terms, and it is what self-test case 6 pins. What changes is that it is no longer the whole story -- the OG limb now asserts the invariant on the BUILT URL from both ends (the marker still carries a dot, AND that URL still escapes today's matcher), so it fires whichever side moves. It is wired to the URL rather than to the flag, so a widening that still excludes the `/og/` prefix relaxes the catch-all requirement and correctly stays green (new self-test case 6c). Self-test: 21 -> 28 assertions. Case 6 now pins that the relaxation holds (no catch-all finding) AND that the run is red anyway; 6b is the proxy-side ablation with the marker untouched; 6c is the green control. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
ACCEPT — ⭐ The reframing is worth more than the fixThe card was filed as "the proxy-side half is REPORTED, not asserted", and I dispatched it as an assertion that needed writing. The dev found it was already computed: ⇒ ✅ Confirmed on ⭐⭐ And it explains where #12326's false charter came from#12326's charter claimed the proxy half was "already asserted", and this seat had been treating that as an unexplained error. It is not unexplained — the file's own header said, verbatim on
⇒ The hole was documented as a design decision, and "reported in the summary line" reads as "covered" to anyone not tracing Zone 2 verdicts
⭐ Case 6c is the one that makes this a gate rather than a coincidence: a matcher that drops the dot exclusion but still excludes the The relaxation is kept, which was Zone 1 rule 2Case 6 now asserts the absence of any catch-all/i18n finding (relaxation intact) and that the run is red anyway via the OG limb. ⇒ The behaviour the pinned case protects is unchanged; what changed is that the surface can no longer break silently around it. Zone 3 — the count, handled the right wayThe card's 403 Governed-surface checkDiff is Arming
⇒ ⛔ Two probes at one instant do not establish a content cause for a failure that may be time-correlated. The reason this matters here: the un-draft landed while the ACCEPT did not, which is exactly the half-state — a PR moving toward merge with no review on record — that write-then-read-back exists to catch. It was caught because CI is settled on the head with zero failures. Arming follows. Generated by Claude Code |
Uh oh!
There was an error while loading. Please reload this page.
Fixes#13703
scripts/check-docs-locale-catch-all.mjsread "dotted paths bypassproxy.ts'smatcher" as a statistic that licenses two relaxations, and asserted it
nowhere. Widening the matcher until it covers dotted paths therefore took the
whole gate green over a fully broken surface.
Re-derived line numbers
The card's
:212/:230/:254are stale — they predate PR #13702, whichmoved the file. Against
origin/mainat4642f4c64::335stats.dottedBypassesProxy = bypassing.length > 0;:363stats.ogUrlSkipsProxy = !compiled.runsFor(probe);:364if (!stats.ogFinalSegmentDotted) {:385if (!stats.dottedBypassesProxy) continue;:409} else if (stats.dottedBypassesProxy) {:421ogUrlSkipsProxy:516/:555truefor the real matcher,falsefor a widened oneThe gate at
:363had already computed the answer and did nothing with it.The both-directions measurement
One probe, one fixture pair, run before and after the commit — identical inputs,
only the gate changed. The pair is the script's own self-test shapes: case 1's
everything (guard present, marker
image.png) with case 6's widened matcher.BEFORE (
4642f4c64)The second block is the defect in one reading: the gate knows the built OG URL
is now rewritten, and reports nothing.
AFTER (
ecb7101ac)Ablation — the new limb deleted from the committed file, mutation confirmed
on disk before the run (anchor count 1 to 0, blob
b7ca7031to3ffa8fcc),restored from
HEADafter (git diff HEADempty and blob hash back tob7ca7031):Only the two new assertions fail; case 6c (the green control) still passes, so
the red is the limb doing its job, not a fixture that reds on any edit.
What the relaxation still protects
It is kept, unchanged.
:385and:409still relax ondottedBypassesProxy, and that is still correct on its own terms: if the proxydoes rewrite dotted paths,
/ads.txtbecomes a two-segment path that matchesnothing and 404s, so the
[lang]locale guard is genuinely not load-bearingany more. Self-test case 6 still pins exactly that — it now asserts the
absence of any catch-all or i18n finding rather than a bare
findings.length === 0.What changed is that the relaxation is no longer the whole story. The same
widening 404s every
og:image, and that break is now asserted, so the run as awhole cannot go green on it.
Two limbs, one assertion — and deliberately so. They relax for different
reasons (catch-all requirement vs i18n predicate), but neither needs its own
assertion, because the new limb is not wired to the flag at all: it is wired to
the built URL, compiled against the matcher the tree carries today. That is
strictly better than mirroring the flag, and case 6c measures the difference — a
matcher that drops the dot exclusion but still excludes the
/og/prefix relaxesboth limbs correctly and still serves the cards, and stays green. A limb
keyed to
dottedBypassesProxywould cry there. It fires on the break, not onthe flag.
Impact figure
The card names 403 live
og:imageURLs. Re-derived atecb7101ac: 402tracked
.mdxpages undercontent/docs/, andapp/og/docs/[...slug]'sgenerateStaticParamsemits exactly one URL persource.getPages()entry, soit is one card per page. The card's 403 was derived on an earlier tree and the
docs page count moves daily — the durable statement is "every one of them at
once", ~402 today, not the literal 403.
Verification
Union run at
ecb7101ac, exit codes captured before any pipe.pnpm check:docs-locale-catch-all— green. Self-test 21 to 28 assertions.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commandsderived 15 families (13 path-derived + 2 convention-triggered by the gate-script edit).comm -23 derived ranis empty — all 15 ran. Pluspnpm check:ratchet-remedy-authority, run explicitly per dispatch-gates places check:ratchet-remedy-authority in "undetermined" — a scripts/** sweep that no derived family names, so a full local family run misses it #13813 since path derivation cannot name it. 16 run, 15 green.node scripts/check-test-completeness.mjs, exits 3 = NOT MEASURED by its own declaration: it grades a savedturbo run testlog, none exists locally, and its own text says this "is NOT a finding". CI passes it a log and is unaffected.--self-testis its entire suite:git grepfinds no other file naming it exceptpackage.json.eslint.config.mjswhich, per its own comment at:328and a positive-control measurement recorded there, never enables type-aware linting for any file (grepconfirms noproject:/projectService). (2) Count read from--format json: 1 file linted, 0 errors, 0 warnings, exit 0. (3) Invariance: with no type-aware linting and no rule that reads a second file, a one-file diff cannot move any untouched file's verdict — and nothing in the tree imports this script anyway.Changeset
None, deliberately, matching the repo's own precedent: of the last 13
scripts/-only commits onmain, zero carried one. This PR publishesnothing from any package, which
pr-automation.yml's Check Changeset job namesas the textbook
skip-changesetcase ("this PR edits a CI-internal script").The label is applied on this PR.
Scope
One file,
scripts/check-docs-locale-catch-all.mjs.apps/docs/lib/source.ts,apps/docs/proxy.tsand the gated half from #12326 are untouched.Generated by Claude Code
Generated by Claude Code