Implementation manifest
scripts/gen-manifest.mjs greps the source tree for ID tags and writes
src/generated/manifest.json:
{ "ids": { "FEAT-0003": { "code": ["scripts/trace-lint.mjs:1"], "tests": [] } }}Direction of truth
Section titled “Direction of truth”Code carries ID tags as ground truth; markdown gets this generated
index. File paths in frontmatter rot; comment tags travel with code
through refactors. Never hand-maintain both directions — implemented_in
never appears in frontmatter, by schema.
Code tag policy
Section titled “Code tag policy”One tag per markdown file, at the feature’s entry point (route handler, main component, module barrel):
// FEAT-0012: usage-based billing — spec: /features/billingThis is a “start here” pointer, not a coverage map. Per-function tagging dies of tedium and poisons trust in the whole graph — don’t.
States & edge cases
Section titled “States & edge cases”- The manifest is gitignored and regenerated on every build (
pnpm buildruns it first); hand edits are impossible to persist. - Files under
node_modules,dist,.astro,src/generated, and markdown content are never scanned. - An ID appearing only in a test file still fails “past
proposedneeds code” — the entry-point tag must live in non-test code.