Repository navigation
test(scan-surfaces): content-level sweep of the test farm, and pin the ctx-shape surface to its call sites - #1838
Merged
Conversation
`test/hook-input-shape.test.ts` rules A and B walk every `.ts` under `test/` and key on one token — a hook handler being INVOKED, `handler(`. The file already guards its detector with planted probes, but nothing in it claimed the scanned tree still holds a call site for that detector to read. Measured on this branch's base 965933b: 175 real `.ts` files in the surface, of which 31 call a handler directly and 13 already reach a hook through `runHookBody(...)` instead — a form neither rule matches. The class these rules discriminate within is migrating out of the surface while the surface stays 175 real files, so a file count could not report it. That is #1755's shape one tree over: a real member that cannot carry the thing keeps the rule green. Strengthened in place, inside the existing self-test block — no new `it`, no new gate, the file stays at 16 tests (#1778's shape). The invocation pattern is single-sourced as `CALLS_HANDLER` so rule B and the surface check cannot come to discriminate different classes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DuzfS5chho38Yx1jxx9DEj
Test-only; empty frontmatter is the sanctioned "releases nothing" declaration the Changeset Check gate documents. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DuzfS5chho38Yx1jxx9DEj
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This was referenced Sep 9, 2026
os-steve
marked this pull request as ready for review
September 9, 2026 23:41
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.
Part of #1834 (epic #1579). ⛔ No closing keyword is placed on it: this PR delivers
the sweep and one repair, and deliberately leaves four measured surfaces reported
rather than repaired. #1834 stays open for the epic PM to triage those four and
decide whether the card is done. #1755, #1778, #1770, #1529, #1311, #802, #1133,
#616 and #1581 are named below for provenance only; none of them is addressed here.
What this card asked, and what the tree answered
Not #1770's question ("does the walk inspect a non-empty set?") but the stronger
one: does the assertion pin that the surface still CARRIES the class the rule
matches?
34 scan surfaces measured. 1 repaired. 1 believed blind and falsified by its own
ablation. 4 reported, not repaired. 28 already content-pinned.
The farm is in better shape than the card's worst case. The dominant reason is
structural rather than lucky: for most of these guards the class the rule matches
is any member of the surface — an absence sweep over "every
.mdxpage undercontent/docs" is judging pages, so a page count really is a content proof. The#1755 shape needs a narrower class than the surface: the barrel was one real
file that could not carry a label. So the sweep's discriminator was, per surface:
is the class a proper sub-kind of the member? — and only then, is that sub-kind
pinned?
My first pass classified surfaces by grepping their self-checks for
toBeGreaterThan/toHaveLength. That misses equality-form content pins, andit produced one wrong verdict which the ablation caught before it shipped. It is
recorded here because it is a finding about how to run this sweep, not a detour:
a guard that reads count-only at its own vacuity block can be content-pinned by a
rule three blocks away. Every verdict below was re-derived with the wider net.
The inventory
Verdicts: pinned (any-member) — the class is any member of the surface, so the
size assertion is a content proof. pinned (sub-kind) — the class is narrower
and the file carries an explicit pin for it. detector-pinned — plus positive
probes proving the matcher still reads the spellings. reported — a real gap,
below.
PACK_FILES(docs-object-term-consistency)HANS_PAGES/HANT_PAGES(same)> 50, pluscarrying(HANS_PAGES, hans) >= term.minPagesin the surviving terms are actually thereTEST_FILES(same)> 100only; theROW_LABELcontent pin beside it reads one literal pathsources(hook-input-shape)hookFiles()(hook-write-shape)> 10andcovers every update( call site— equality against the writes the runtime half exerciseshookFiles(hook-query-predicate)> 10andtoContain('_line-item-price-fill.ts')readdirSync(OBJECT_DIR)(collaboration-capabilities)PAGES+VERBATIM_PAGES(docs-drift)> 100; the six carrier pages are proved byexistsSync, not through the walkpages+CARRIERS(docs-conversion-rate-spelling)> 50; carriers read by literal path, not through the walkLEAVES/NAV(app-navigation-shape)> 20andit.each(REQUIRED_KINDS)— one exemplar of each kind must surviveFILES/DOC_PAGES(docs-zh-hant-justification)> 400/> 100andconventionBlocks >= MIN_CONVENTION_BLOCKSPAGES(docs-retired-personas)> 50, plus a 7-probe detector test, plus everyHISTORICALexemption must still name a persona in the live treeSTRINGS(persona-copy)> 5000strings off the resolved stack, plus positive probesPAGES(docs-role-hierarchy)> 50, a 15-probe detector test, plus every exemption still covers a real occurrencefiles(lead-duplicate-management)> 50and exactly 2 occurrences, in two named files, one of them a stampallSites(verify-log-decoy-pin)>=the known gate-spawning files, named — the scanner is not vacuousSCRIPTS(script-main-guard)>= 8, and each script must print somethingpredicates(view-predicate-dialect)>= authored— finds a predicate for every one authored insrc/viewsrules/ globs (labeler-config)> 0rules,> 0globs each, and every glob matches ≥1 real fileobjectSources(line-item-conventions)> 10andformulaNames > 0hookNames/flowNames(runtime-coverage)>= 20each, off the resolved stackreferences(hot-lead-threshold-parity)registered > 0andreferences > 0insrc/viewsmounters(sharing-posture-declaration)> 0, and posture must precede the mount in every memberrecordChangeFlows(actions-flows-integrity)>= 9— the filter still matchesdeal-threshold-parity)docs-dashboard-tiles)docs-metadata-counts)docs-locale-callouts)> 50pairs and> 5callouts to compareagent:values (docs-runnable-samples)> 0values found in a fence or scriptINSTRUCTIONS_DIR+ doc pages (docs-src-tree-paths)src/<dir>/at all — this guard has gone vacuous over itdocs-view-rosters)> 40resolved cells or labelsdocs-setup-navigation-names)docs-revenue-approvals-navigation)bundles > 5andbundle text > 1,000,000anchoredLinks(docs-anchor-linksviahelpers/docs-anchors)> 20anchored links, not pagesAny-member surfaces where the count is the content proof, and correctly so:
ALL_PAGES(docs-analytics-vocabulary,> 100),walk(dir)per collection(
docs-app-workflow-paths,> 0pluscontent/docsandcontent/blognamed).The 11 hardcoded literal single-path reads (
package.json,README.md,CHANGELOG.md,src/objects/_thresholds.ts,src/objects/lead.hook.ts,src/objects/account.hook.ts,src/dashboards/executive.dashboard.ts,src/data/service.seed.ts,content/docs/guides/importing-your-data.mdx) cannotgo silently vacuous the way the #1755 barrel did —
readFileSyncthrows on amissing path — and the two that could go quiet by CONTENT
(
deal-threshold-parity,hot-lead-threshold-parity) each carry an explicitanti-vacuity pin already.
The one repair —
test/hook-input-shape.test.tsRules A and B walk every
.tsundertest/and key on one token: a hook handlerbeing invoked,
handler(. The file already guards its detector withplanted probes. Nothing in it claimed the scanned tree still holds a call site for
that detector to read — and a file count could not have claimed it: 175 real files
stay 175 real files whichever way they invoke a hook.
Measured on this branch's base
965933b:test/**/*.ts)handler()runHookBody(...)— a form neither rule matchesThe class these rules discriminate within is actively migrating out of the
surface. That is the whole exposure: finish the migration and both rules report
clean over a real, non-empty tree carrying nothing they can judge.
The repair is the card's option 3 — no second mechanism to cross-reference here,
so the honest check is that the surface holds at least one instance of the class,
said plainly. It went into the existing self-test block: no new
it, no newgate, the file stays at 16 tests.
CALLS_HANDLERis single-sourced so rule Band the surface check cannot come to discriminate different classes.
The ablation — three readings, one mutation, exit codes captured before any pipe
A hand-built plain-object ctx (the #1133 defect) planted in the tree, proved on
disk before any result was read — decoy blob
a45e2d80…,test/*.test.ts165 → 166, planted defect line count 1.
Restored under a
trap … EXIT INT TERMand proved by bytes, not by an exitcode: post-restore blob
0ab6129c9285b6e4dcb8ddae0a0b253002502e80, identical toHEAD; decoy absent;git diff HEAD --name-onlyempty;git status --porcelainempty.
The verdict I got wrong, and the ablation that caught it
test/hook-write-shape.test.tslooked like the textbook case, on evidence onestep stronger than a hunch: same surface as
hook-query-predicate(
readdirSync('src/objects').filter('.ts')), self-checklength > 10, and thesibling guard on that identical surface already carries a surface pin while this
one appeared not to. The asymmetry read as the defect.
Measured, it is real: 44 files, of which 27 are
*.object.tsschemas and sharedmodules that never call the facade; all 18 write call sites are in the 17
*.hook.tsfiles;readdirSyncdoes not recurse, so relocating the hooks to asubdirectory leaves 27 real files and 0 write call sites.
The ablation refused it. With the #616 defect injected (blob
3629056b…→eaa1cc6c…, anchor count 1 → 0, bare-id line 0 → 1) and the 17 hooks relocatedwith their imports carried:
hook-write-shape.test.ts:444already holds an equality cross-referencebetween the scanned surface's call-site count and the writes its runtime half
exercises — strictly stronger than what I had written. Per the card
(⛔ do not add a check to a surface that is already content-pinned) the commit
was reverted; this branch contains no trace of it. The surface was restored by
bytes and
git statusverified clean before proceeding.Reported, not repaired — four surfaces, and what each needs
⛔ None of these is repaired here: three would need a judgement call about how far
a cross-reference should reach, and one is #1770's question rather than this
card's. Filing them rather than fixing them is the card's own instruction.
TEST_FILESindocs-object-term-consistency.test.ts— the retired-spellingsweep over the test ledgers.
> 100only. The block beside it does pincontent (
scannable('test/sharing-coverage.test.ts')must containROW_LABEL)but reaches it by literal path, not through
TEST_FILES— the samewalk-vs-literal pair test(i18n): point the #802 term guard's pack rule at the real zh-CN tree #1778 crossed for
PACK_FILES, left uncrossed here. Needs:one line asserting the walk's output contains that ledger file. Low risk, but it
is an edit to the precedent file itself and belongs in a card that owns it.
hook-query-predicate.test.ts—> 10plustoContain('_line-item-price-fill.ts').That pins a filename, not content: it proves the shared-module family is in
the surface, not that any file in it issues a query. 18 of 44 files carry a
where:key today. Needs a decision on whether a filename proxy is deemedsufficient; if not, the honest form is the same shape as row 5's equality pin.
collaboration-capabilities.test.ts— thefeeds: truesweep oversrc/objects/*.object.tsasserts nothing at all about its surface. This isVacuity sweep of the test farm — which walking assertions actually inspect a non-empty set? (epic #1579, read-only, needs no release) #1770's question (non-emptiness), not this card's, and the class here is any
.object.ts, so a plain count would be the right and sufficient answer. Leftfor whoever owns the vacuity sweep, to avoid two cards editing one line.
docs-driftanddocs-conversion-rate-spelling— both hold a carrier list(
VERBATIM_PAGES,CARRIERS) proved by literal path while the sweep runs overa walk, uncrossed. Practical exposure is low: both walks are rooted at
content/docsand the count (> 100/> 50) plusexistsSyncmeans thecarriers cannot silently fall out. Needs: a one-line
expect(PAGES).toContain(carrier)in each, or an explicit ruling that the count plus
existsSyncis the pin.Gates —
pnpm verify, exit codes captured before any pipeEvery step run in the foreground, redirected to a file,
$?read before any pipe.All eight on final HEAD
c453f11, after the changeset commit (.changeset/isinside the hygiene scan surfaces):
validate·typecheck·lint·lint:i18n-gatehygiene·hygiene:tokens·buildtest—Test Files 165 passed (165),Tests 3454 passed | 1 skipped (3455)Test count: 3455 before, 3455 after — unchanged. No new
it, no new gate, nonew file under
test/. Nothing to justify against scope rule 3, because nothingwas added.
pnpm lint --json, both on this branch's own base965933b(raw_decodefromthe first
{; pnpm appendsELIFECYCLE):Neither number moved, as the card predicted.
Scope
One file of behaviour —
test/hook-input-shape.test.ts— plus a changeset. Nosrc/**change: the repair needed none, and the two ablations'src/mutationswere restored and proved by bytes.
content/docs/releases/untouched. No governedsurface touched. No surface widened. The
--strictflip,field-no-consumers, andthe family cards are out of scope and untouched.
The changeset carries empty frontmatter — the sanctioned "this PR releases⚠️ The dispatch
nothing" declaration that
.github/workflows/changeset-check.ymldocuments in itsown comment, and the form #1778 used for the same kind of work.
asked for frontmatter that is "honest … but not empty"; for test-only work those
two halves collide, and the gate's documented semantics plus the precedent decide
it. Flagged rather than chosen silently — if the maintainer wants a named package
bump instead, it is a one-line change, but it would accrete a CHANGELOG row for
something no user can see.
维护者速读(草稿)
改了什么 —— 把
test/**里的扫描面按「内容级」重新量了一遍:不是问「走查到的集合非空吗」,而是问「断言有没有钉住这个面仍然携带规则要找的那类东西」。
34 个面,28 个本来就已经钉住内容,1 个修了,1 个我判错、被自己的消融推翻,4 个如
实上报不动手。唯一改的是
test/hook-input-shape.test.ts:它的两条规则只认handler(这一个调用形态,而仓库里已经有 13 个文件改走runHookBody(...)—— 那个形态两条规则都不认。等这轮迁移走完,两条规则会在一棵真实、非空、却什么都不含
的树上报绿。
为什么改 —— 与 #1755 同一失败方向:静默。改动只加一条断言,进的是已存
在的自检块,没有新
it、没有新门禁,测试数 3455 → 3455 一个没涨。风险与代价(含回滚) —— 风险低:只动
test/**,src/一个字节没动,不向用户发布任何东西。回滚 = revert 这两个 commit。
hook-write-shape.test.ts我一度认定是瞎的(证据是:同一个扫描面上的姊妹守卫已经加了面级钉子,它没有),代码也写
了。消融第一腿就把它否掉了:该文件
:444早就有一条等式交叉引用,比我写的更强。那个 commit 已经撤掉,分支上不留痕迹。这段写进正文,是因为它是本卡的一个真结
论:一个在自己 vacuity 块里读起来「只数数」的守卫,可能被三个块之外的规则钉住 ——
用
toBeGreaterThan扫一遍来分类,会漏掉等式形态的内容钉子。你要做的 —— 三件。① 确认上报不修的那四个面是否要各自立卡(我没动它们,理由
在正文)。② 确认 changeset 的空 frontmatter:门禁注释与 #1778 都是这个形态,但派
发词要求「非空」,我按门禁走并在此点明。③ 本 PR 停在 draft 等你复审 —— 「等总监复
审」。
🤖 Generated with Claude Code
https://claude.ai/code/session_01DuzfS5chho38Yx1jxx9DEj
Generated by Claude Code