Build Inventory MOC

Read this before you build anything. This MOC indexes every artifact in the EnrichNode codebase that a contractor might need: backend endpoints, frontend pages, query hooks, mocks. Search here first. If it’s not in the inventory, it doesn’t exist — file a stub before writing code.

The inventory deliberately stays a thin index. Long-form content stays in docs/ (the curated index, GAPS REGISTER, MOCKS REGISTER, ADRs). Each note here is a one-screen pointer: where the code lives, what state it’s in, where to learn more.

⚠️ CONFIDENTIAL. Same handling rules as the rest of the vault — see repo-root SECURITY.md. Sole IP owner: Shayer Rizvi (CEO, EnrichNode).


Schema (locked by ADR-0010 in docs/adr/)

Every inventory note has the same frontmatter contract:

---
id: <kind>.<area>.<symbol>          # stable, lowercase, dot-separated, dashes for spaces
kind: endpoint | page | component | hook | query | mock | worker | lib | service
path: <repo-relative path from DBPOC root>
symbol: <human label, e.g. "POST /api/leads" or "useCompanies">
status: shipped | stub | unused | planned | deprecated | decided-against
owner: backend | frontend | infra | compliance
gap_ref: G# | null                  # cross-link into GAPS REGISTER
mock_ref: M# | null                 # cross-link into MOCKS REGISTER
adr_refs: [number, ...]
last_scanned: YYYY-MM-DD
tags: [build-inventory, <kind>, <owner>]
---

Body is four short sections under auto-generated markers (so a future walker script can preserve them):

<!-- AUTO-GENERATED: do not edit above this line -->
 
## What it does
One sentence. No marketing copy.
 
## How to use
Minimal example — bun command, route, or hook usage. "TODO" if not yet known.
 
## Caveats / open loops
What's broken, what's stubbed, what's risky, what's not yet built.
 
## Depends on / used by
Cross-links. Optional but recommended.
 
<!-- /AUTO-GENERATED -->

Status semantics (don’t drift)

  • shipped — wired, tested, in use somewhere downstream. Safe to call.
  • stub — file exists, exports the right shape, but returns mock data or hard-codes a happy path. Wire-up not done.
  • unused — exists but nothing imports it. Deletion candidate. Either delete or document why kept.
  • planned — not built yet. The note is a placeholder so contractors know the intent and don’t rebuild.
  • deprecated — was shipped, now superseded. Path may still exist for back-compat. New code should not use it.
  • decided-against — proposed and rejected. Note explains why. Prevents re-litigation.

Inventory by kind

TABLE WITHOUT ID
  file.link AS Note,
  kind,
  status,
  path,
  gap_ref,
  mock_ref
FROM "Wiki/Build Inventory"
WHERE kind != null
SORT kind ASC, status ASC, file.name ASC

If Dataview is not installed, browse by folder:

  • Backend — 14 files in src/api/
  • Frontend Pages — 14 pages in frontend/enrichnode/src/pages/
  • Frontend Queries — 6 modules in frontend/enrichnode/src/queries/
  • Frontend Mocks — 6 notes covering frontend/enrichnode/src/mocks/handlers/ (5 domain handler files + 1 registry index)
  • Frontend Components — components added as Phase 4+ migrate them from mock-driven to query-driven (started 2026-05-04 with CompanyDrawer)

Quick filters

All stubs (P0 attention)

TABLE WITHOUT ID file.link AS Note, path, gap_ref, mock_ref
FROM "Wiki/Build Inventory"
WHERE status = "stub"
SORT file.name ASC

Items linked to a known gap

TABLE WITHOUT ID file.link AS Note, kind, gap_ref, mock_ref, status
FROM "Wiki/Build Inventory"
WHERE gap_ref != null
SORT gap_ref ASC

Items linked to a mock

TABLE WITHOUT ID file.link AS Note, kind, mock_ref, status
FROM "Wiki/Build Inventory"
WHERE mock_ref != null
SORT mock_ref ASC

Deprecated / decided-against

TABLE WITHOUT ID file.link AS Note, kind, status, path
FROM "Wiki/Build Inventory"
WHERE status = "deprecated" OR status = "decided-against"

The inventory is the index. These are the source-of-truth docs it points back to:


Maintenance

Today: hand-curated. First slice covers backend files + frontend pages + queries + MSW handlers (37 notes, 2026-05-03).

Next session: walker script scripts/inventory/scan.ts regenerates frontmatter from code on demand and preserves the body sections between the auto-generated markers.

Session after: pre-push hook runs scripts/inventory/audit.ts. Adding a new file under any indexed path without an inventory note will fail the push. Notes whose path no longer exists fail the audit until moved to _deprecated/.

If you find a code unit not in the inventory: add the note (copy any existing one as template), set status, link to gap/mock if applicable, commit. Don’t write code first and inventory later — the whole point is the inventory is searchable BEFORE anyone duplicates work.


Out of scope

  • Per-component notes for the ~120 frontend components — too many to seed by hand. Walker script (next session) will auto-generate stubs.
  • Per-route notes for backend routes — file-level granularity is the right answer for “is this built?” Per-route detail belongs in docs/API_DOCUMENTATION.md.
  • ADRs are not in the inventory — they have their own folder, their own numbering, and are immutable. Inventory notes can adr_refs: link to them.
  • Mocks register entries (M1–M22) are NOT inventory notes; they live in the MOCKS REGISTER. Inventory notes for the handler files that serve mocks ARE here.