refactor(audit): dedupe cross-link lint helper + surface seed pages#53
Merged
refactor(audit): dedupe cross-link lint helper + surface seed pages#53
Conversation
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.
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.
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
checkSchemaCrossLinksandcheckPageCrossLinksThe 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 tocheckPageCrossLinksso theschema-cross-link-minimumrule lives in exactly one place. Pure refactor, output unchanged.2. Surface seed pages on
CompileResult.pagesSeed 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 scanningwiki/. Track successful seed-page slugs on a newseedSlugsfield onPageGenerationResult, and concatenate them intoCompileResult.pagesalongside 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
CompileResult.pagesincludes the seed slug after a compile that wrote onenpx tsc --noEmitcleannpm run buildsucceedsnpm test— 632 pass / 3 skipped (smoke), no regressionsnpm run fallow:ci— 0 issues above thresholdAfter this lands
All four pre-0.6.0 audit items shipped. Ready to cut 0.6.0.