Skip to content

test(scripts): the guard's extraction fixtures build their docs from parts - #1811

Merged
lilyshen0722 merged 1 commit into
mainfrom
kai/guard-fixture-parts
Sep 20, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
kai/guard-fixture-parts

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

What

The guard's own extraction fixtures wrote real docs/<name>.md literals into the suite, and the suite scans itself — so each fixture was a live pointer into the docs room's inventory. #1810 retargeted one of them after #1802 stranded it; otto's docs-wash (70706, relayed by connector-ops 70708) found the remaining one (the setup guide, line 98) folding into DISCORD.md on a later recut. That is the same breakage a third time, so this applies the fix to the class instead of the instance.

Both extraction fixtures now build their literal from parts, exactly like the absent-path positive control already did:

const setupGuide = ['docs', 'discord', 'DISCORD_SETUP.md'].join('/');
const designDoc = ['docs', 'discord', 'DISCORD_INTEGRATION_ARCHITECTURE.md'].join('/');

join('/') produces the identical string at runtime, so the three forms under test are unchanged (non-root-relative, root-relative, and the URL tail that must stay excluded with a real path behind it) — but there is no contiguous pointer left in this file for the scan to follow. The fixture stops depending on the docs inventory at all, which is a property its purpose never justified.

The two fixtures deliberately keep naming different docs, so a regression specific to one path form still fails only its own assertion (Vera, 70690).

Evidence

Held the tree fixed and varied only the fixture's form, deleting the setup guide to simulate the fold (git ls-files still lists it, so the guard's own file list is unchanged; fs.existsSync is what goes false):

fixture form suite fixture in the guard's missing list total missing
assembled (this PR) RED 0 2
main's written-down literal RED 1 3
assembled, doc restored GREEN 0 0

The two remaining entries are the real pointers (backend/test-discord-integration.ts, scripts/test-discord.sh) — the fold should red on those, and that is the guard doing its job. What this PR removes is the incidental dependency: this file can no longer be stranded by a doc it names only to exercise an extractor.

Mutation ledger

# mutation result
M1 assembled fixture + doc deleted fixture's own line absent from the missing list
M2 main's written-down fixture + doc deleted RED, naming this file's line
M3 root-relative handling broken (\/?docs\/ → docs\/) RED — the root-relative fixture and the positive control both fail
M4 URL-tail boundary broken (lookbehind drops / and -) RED — the tail assertions fail and docs/SKILL.md surfaces as a bogus reference
M5 assembly collapsed back to a literal + doc deleted RED, fixture back in the missing list — the assembly is what removes the dependency

State restored after each; final run green (5/5).

Scope

Test-only: one file, no version slot. Gate: wren structure + Vera stamp, then connector-ops arms. Independent of #1802 — it neither needs nor blocks it. #1809 touches the same file but only appends a test, so whichever of the two lands second needs a refresh; this one can go first.

A fixture has to be a real docs path for the extractor to see it, and this
suite scans its own text, so a written-down fixture is a live pointer into
another room's inventory. That coupling stranded this file twice - #1802's
fold and then the setup guide - both times for a reason the fixture's own
purpose could not have predicted.

Build both fixtures with join('/'), as the absent-path positive control
already did: the same string reaches the regex at runtime, while the source
holds no contiguous pointer for the scan to follow. The two fixtures keep
naming different docs, so a regression specific to one path form still
fails only its own assertion.
@lilyshen0722
lilyshen0722 force-pushed the kai/guard-fixture-parts branch from 12e67a2 to 2983b46 Compare September 20, 2026 07:36
@lilyshen0722
lilyshen0722 merged commit 97c7453 into main Sep 20, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant