Goal
Simplify getOnDiskSlugs() in src/lib/lint-checks.ts by removing its flat-directory fallback. Part of flat retirement (#869).
Context
The function currently has two paths: read the page-index (primary), or scan the wiki directory for .md files (fallback). The fallback is no longer needed — the silo is the sole storage layer. When there is no page-index, the function should return [].
Production code (src/lib/lint-checks.ts)
Open the function getOnDiskSlugs() (starts around line 50). It has a try/catch that reads the page-index — keep that. Everything AFTER the catch block (the "Fallback: list flat wiki directory" section through the return entries... statement) should be replaced with return [];.
Then clean up:
- The doc comment above the function mentions a "Fallback" paragraph — remove that paragraph
- The log message inside the catch mentions "falling back to listFiles" — simplify it to just say the read failed
- Remove unused imports that were only needed by the fallback:
getStorage and FileEntry from "./storage", and wikiRelPath from the "./wiki" import (keep readWikiPage, readWikiPageWithFrontmatter, listWikiPages on that line — they are used elsewhere)
Note: INFRASTRUCTURE_FILES is used in three other places in this file. Keep it.
Tests (src/lib/__tests__/lint-checks.test.ts)
In the getOnDiskSlugs describe block, two tests exercise the old fallback path (their names contain "fallback"). Since the fallback no longer exists, these tests should now expect an empty array [] instead of their current expectations. Rename them to describe the new behavior (no fallback means no results when there is no page-index, even if .md files exist on disk).
The other tests in the block already expect [] — leave them alone.
Verification
npx vitest run src/lib/__tests__/lint-checks.test.ts
pnpm build
Acceptance Criteria
Size: XS (2 files, pure deletion + test updates)
Goal
Simplify
getOnDiskSlugs()insrc/lib/lint-checks.tsby removing its flat-directory fallback. Part of flat retirement (#869).Context
The function currently has two paths: read the page-index (primary), or scan the wiki directory for
.mdfiles (fallback). The fallback is no longer needed — the silo is the sole storage layer. When there is no page-index, the function should return[].Production code (
src/lib/lint-checks.ts)Open the function
getOnDiskSlugs()(starts around line 50). It has a try/catch that reads the page-index — keep that. Everything AFTER the catch block (the "Fallback: list flat wiki directory" section through thereturn entries...statement) should be replaced withreturn [];.Then clean up:
getStorageandFileEntryfrom"./storage", andwikiRelPathfrom the"./wiki"import (keepreadWikiPage,readWikiPageWithFrontmatter,listWikiPageson that line — they are used elsewhere)Note:
INFRASTRUCTURE_FILESis used in three other places in this file. Keep it.Tests (
src/lib/__tests__/lint-checks.test.ts)In the
getOnDiskSlugsdescribe block, two tests exercise the old fallback path (their names contain "fallback"). Since the fallback no longer exists, these tests should now expect an empty array[]instead of their current expectations. Rename them to describe the new behavior (no fallback means no results when there is no page-index, even if.mdfiles exist on disk).The other tests in the block already expect
[]— leave them alone.Verification
Acceptance Criteria
getOnDiskSlugs()returns[]when page-index is absentgetStorage,FileEntry,wikiRelPathshould not appear)Size: XS (2 files, pure deletion + test updates)