What
Build a CI pipeline that automatically validates documentation against the actual codebase, detecting when docs describe features that don't exist or when code changes aren't reflected in docs.
Why
The documentation currently describes phantom endpoints, tables, and contract functions that were never implemented or have since been removed:
- openapi.yaml documents
/merchants/me/anchor, /v1/escrow/claimable, /v1/escrow/claimable/:id/claim — none of these controllers exist in the backend
- architecture/backend.md references
claimable_escrows and anchors tables — not in the Drizzle schema
- contract/spec.md documents
create_claimable_escrow, claim_escrow, get_claimable_escrow — not in the Soroban contract
- architecture/frontend.md references
useDexPrices hook and lib/dex — don't exist in the frontend
This creates a bad developer experience: contributors read the docs, try to use documented features, and find they don't work.
Scope
In scope
- API route validator — parse NestJS controllers to extract route definitions (method, path, auth), diff against
openapi.yaml, flag phantom endpoints and missing docs
- Schema validator — parse
src/db/schema.ts to extract table/column names, diff against architecture/backend.md, flag phantom tables/columns
- Contract validator — parse
orbitstream_contracts/src/lib.rs for #[contractimpl] functions, diff against contract/spec.md, flag phantom/missing functions
- Link validator — parse all markdown files for internal links, verify targets exist, flag broken links
- CI integration — run all validators in GitHub Actions, warn on PRs that add code without updating docs or vice versa
- Drift report —
npm run docs:drift-report generates a markdown summary of all phantom claims
Out of scope
- Auto-fixing docs (validators only report, don't modify)
- Content quality review (only checks existence, not accuracy of descriptions)
- External link checking (only internal file references)
Acceptance criteria
Technical context
- NestJS controllers are at
OrbitStream_backend/src/*/ — route decorators are @Get(), @Post(), @Patch(), @Delete() with path strings
- Drizzle schema is at
OrbitStream_backend/src/db/schema.ts — tables defined with pgTable(), columns with type helpers
- Soroban contract is at
orbitstream_contracts/src/lib.rs — functions marked with #[contractimpl]
- OpenAPI spec is at
orbitstream_docs/api/openapi.yaml
- Architecture docs are at
orbitstream_docs/architecture/*.md
- Contract spec is at
orbitstream_docs/contract/spec.md
- Consider
ts-morph for TypeScript AST parsing, regex for Rust function extraction
- The orbitstream_docs repo has no
package.json — the validators could live in the backend repo's scripts or as standalone Node scripts in the docs repo
Severity
medium — docs drift doesn't break functionality but misleads contributors and slows development.
What
Build a CI pipeline that automatically validates documentation against the actual codebase, detecting when docs describe features that don't exist or when code changes aren't reflected in docs.
Why
The documentation currently describes phantom endpoints, tables, and contract functions that were never implemented or have since been removed:
/merchants/me/anchor,/v1/escrow/claimable,/v1/escrow/claimable/:id/claim— none of these controllers exist in the backendclaimable_escrowsandanchorstables — not in the Drizzle schemacreate_claimable_escrow,claim_escrow,get_claimable_escrow— not in the Soroban contractuseDexPriceshook andlib/dex— don't exist in the frontendThis creates a bad developer experience: contributors read the docs, try to use documented features, and find they don't work.
Scope
In scope
openapi.yaml, flag phantom endpoints and missing docssrc/db/schema.tsto extract table/column names, diff againstarchitecture/backend.md, flag phantom tables/columnsorbitstream_contracts/src/lib.rsfor#[contractimpl]functions, diff againstcontract/spec.md, flag phantom/missing functionsnpm run docs:drift-reportgenerates a markdown summary of all phantom claimsOut of scope
Acceptance criteria
npm run docs:validate:apidetects endpoints inopenapi.yamlnot backed by actual controllersnpm run docs:validate:schemadetects tables/columns in docs not inschema.tsnpm run docs:validate:contractdetects functions inspec.mdnot inlib.rsnpm run docs:validate:linksdetects broken internal markdown linksnpm run docs:drift-reportgenerates a summary reportorbitstream_docs/,OrbitStream_backend/src/, ororbitstream_contracts/src/Technical context
OrbitStream_backend/src/*/— route decorators are@Get(),@Post(),@Patch(),@Delete()with path stringsOrbitStream_backend/src/db/schema.ts— tables defined withpgTable(), columns with type helpersorbitstream_contracts/src/lib.rs— functions marked with#[contractimpl]orbitstream_docs/api/openapi.yamlorbitstream_docs/architecture/*.mdorbitstream_docs/contract/spec.mdts-morphfor TypeScript AST parsing, regex for Rust function extractionpackage.json— the validators could live in the backend repo's scripts or as standalone Node scripts in the docs repoSeverity
medium— docs drift doesn't break functionality but misleads contributors and slows development.