Skip to content

refactor(audit): dedupe cross-link lint helper + surface seed pages#53

Merged
ethanj merged 2 commits intomainfrom
refactor/dedupe-cross-link-lint
May 2, 2026
Merged

refactor(audit): dedupe cross-link lint helper + surface seed pages#53
ethanj merged 2 commits intomainfrom
refactor/dedupe-cross-link-lint

Conversation

@ethanj
Copy link
Copy Markdown
Contributor

@ethanj ethanj commented May 2, 2026

Fourth and final pre-0.6.0 audit-fix PR. Wraps up the post-merge schema-overlap cluster cleanup.

What

Two lower-priority items from the audit:

1. Dedupe checkSchemaCrossLinks and checkPageCrossLinks

The on-disk walker (checkSchemaCrossLinks) duplicated the per-page helper's rule logic verbatim — same fields, same message, same rule name. Refactor the walker to delegate to checkPageCrossLinks so the schema-cross-link-minimum rule lives in exactly one place. Pure refactor, output unchanged.

2. Surface seed pages on CompileResult.pages

Seed pages (overview / comparison / entity) used to land on disk silently — they were absent from CompileResult.pages, so MCP / embeddings / programmatic consumers had no way to discover them without scanning wiki/. Track successful seed-page slugs on a new seedSlugs field on PageGenerationResult, and concatenate them into CompileResult.pages alongside concept-page slugs. Both the normal compile path and the no-source-changes early-return path now surface seed slugs on the result.

Test plan

  • New regression test pins that CompileResult.pages includes the seed slug after a compile that wrote one
  • npx tsc --noEmit clean
  • npm run build succeeds
  • npm test — 632 pass / 3 skipped (smoke), no regressions
  • npm run fallow:ci — 0 issues above threshold

After this lands

All four pre-0.6.0 audit items shipped. Ready to cut 0.6.0.

ethanj added 2 commits May 1, 2026 22:45
Last two items from codex's post-merge schema-overlap audit:

1. checkSchemaCrossLinks duplicated checkPageCrossLinks's rule logic
   verbatim. Refactor the on-disk walker to delegate to the per-page
   helper so the schema-cross-link-minimum rule lives in exactly one
   place. Pure refactor, output unchanged.

2. Seed pages (overview / comparison / entity) used to land on disk
   silently — they were absent from CompileResult.pages, so MCP /
   embeddings / programmatic consumers had no way to discover them
   without scanning wiki/. Track successful seed-page slugs on a new
   `seedSlugs` field on PageGenerationResult, and concatenate them
   into CompileResult.pages alongside concept-page slugs. Both the
   normal compile path and the no-source-changes early-return path
   now surface seed slugs on the result.

Tests:
  - New regression test pins that CompileResult.pages includes the
    seed slug after a compile that wrote one.
…t setup

Two findings from codex review on PR #53:

1. Seed slugs surfaced on CompileResult.pages but were never threaded
   into finalizeWiki, so resolveLinks and updateEmbeddings still
   skipped them. Newly written seed pages would land on disk without
   inbound-link resolution and stay absent from the embedding store
   until the next concept-driven compile. finalizeWiki now takes an
   optional seedSlugs argument and folds them into both the
   changed-slug set (drives embeddings refresh) and the new-slug set
   (drives inbound-link resolution that converts free-text mentions
   of seed titles into wikilinks).

2. test/seed-pages-early-return.test.ts had four near-identical
   "write schema + stub LLM + silence console + compile" blocks. CI's
   auto-changed-since fallow flagged the duplicate boilerplate.
   Hoisted into runSeedPageCompile() so each test reads as the
   assertion that distinguishes it.
@ethanj ethanj merged commit a19ab9f into main May 2, 2026
3 checks passed
@ethanj ethanj deleted the refactor/dedupe-cross-link-lint branch May 2, 2026 06:21
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