Skip to content

test: pin declared mirror parity (#4175) - #4279

Merged
atomantic merged 6 commits into
mainfrom
claim/issue-4175
Aug 15, 2026
Merged

test: pin declared mirror parity (#4175)#4279
atomantic merged 6 commits into
mainfrom
claim/issue-4175

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

  • Add a catalog-driven parity-coverage guard for direct server/client mirrors.
  • Pin the previously unguarded season structure, shot grammar, app identity, and issue-length contracts.
  • Extend scene-prompt coverage to compare its client mirror declaration-by-declaration.

Testing

  • NODE_ENV=test npm test (server)

Closes #4175

@atomantic

Copy link
Copy Markdown
Owner Author

Review gate remains unsatisfied: three headless Antigravity attempts returned no usable code-review verdict (one unrelated flag explanation, then two empty responses). The implementation and server suite are green; leaving this PR open for a reviewer retry rather than merging without the configured review.

@atomantic
atomantic force-pushed the claim/issue-4175 branch 3 times, most recently from c993f22 to 29108dc Compare August 15, 2026 14:48
…lper

Both functions parsed README mirror-declaration table rows with identical
row-matching and mirror-description-filter logic, differing only in which
side (client vs server) was "this file" vs. "the other file it mirrors" —
exactly the duplication mirrorParity.js exists to prevent one file over.
The bare './<file>' fallback matched any test file's source containing
that literal substring, without checking WHERE the test lived. For a
direct mirror, clientFile and serverFile are the same string, so a
plain server-only unit test (e.g. bareUrl.test.js importing
'./bareUrl.js') trivially satisfied both substring checks and was
wrongly counted as a parity pin — verified by simulating removal of
bareUrl.mirror.test.js, which left missingParityPins reporting no gap.
Restrict the './<file>' form to test files that actually live under
client/src/lib, and add a bypass-probe test pinning the fix.
…tyPins

clientFile and serverName are the identical string for a direct mirror,
so the unconditional `source.includes(serverName)` check was implied by
the SAME occurrence that already proved "reads the client copy" via the
bare `'./<file>'` branch. A plain client-only unit test (e.g.
catalogTypes.test.js importing only './catalogTypes.js') was therefore
wrongly counted as a parity pin — verified in isolation. Fix strips
whichever string proved client-copy evidence before checking for
independent server-copy evidence, taking care not to strip the bare
import when it's server-side (that's the only evidence
catalogTypes.parity.test.js has for the server copy). Verified against
every declared mirror pair in the real repo and all 41
mirror/parity test files still pass; added a matching bypass-probe test.
…arityPins

Every prior check was a bare substring test, so a stray comment
mentioning a mirrored filename (or an unrelated same-prefix fixture)
could satisfy "reads the client/server copy" without any real import
existing — verified in isolation: a client-only test whose only server
reference was a trailing comment ("// keep this in sync with
server/lib/example.js") was wrongly accepted as a parity pin. Replace
every substring check with importsRef(), which requires the filename to
appear inside an actual quoted specifier. This also let the server-side
bare-import branch collapse into the same check, since a quoted
'./file.js' specifier now matches directly. Verified against every
declared pair in the real repo and all 41 mirror/parity test files
(600 tests) still pass; added a third bypass-probe test for the
comment-only case.
Backtick-fenced file paths are this codebase's dominant docstring style
for referencing a mirror's counterpart (every existing parity-test
header does this, e.g. personaTraitBlend.parity.test.js), so accepting
backtick as an import-specifier delimiter reopened the exact
prose-mention bypass the prior fix closed, just via backticks instead
of bare text — verified: a JSDoc comment merely mentioning both paths
in backticks, with no real import, was wrongly accepted. Restrict the
quote class to real string-literal delimiters ('/") only, which is
what every actual import/require/readFileSync path in this codebase
uses. Verified against all declared pairs in the real repo; added a
matching bypass-probe test.
@atomantic
atomantic merged commit a98918e into main Aug 15, 2026
7 checks passed
@atomantic
atomantic deleted the claim/issue-4175 branch August 15, 2026 15:02
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.

[repo-study-night-street] Enforce that every declared server/client mirror has a parity pin, and backfill the four that have none

1 participant