KB-1F5E
06 — No-Hardcode Doctrine & Audit
2 min read Revision 1
architectureno-hardcodedieu28dieu26auditrender-shell2026-05-30
title: 06 — No-Hardcode Doctrine & Audit date: 2026-05-30
06 — No-Hardcode Doctrine & Audit
Banned patterns
- Hardcoded counts in Vue/JS/server. 2. Hardcoded species/category/tier/layer arrays in frontend. 3. Handwritten per-entity count(*) in Nuxt/API. 4. Static groups that should come from PG. 5. UNION ALL per species/category/list. 6. Route-specific business logic. 7. Frontend deciding governance/category/status. 8.
meta_catalog.record_countas truth without pivot reconciliation. 9. Fake "config" arrays that are really hardcode.
Allowed pattern
PG pivot_definitions define dimensions → PG functions/views assemble the tree → Directus/API exposes → Nuxt renders only. Adding a list = INSERT/UPDATE a data row, not code.
Audit findings
| # | Location | Finding | Banned | Severity |
|---|---|---|---|---|
| H1 | registries.vue | Phantom literal rows CAT-SPE/ORP/PHA/UNM/017 | #2,#9 | HIGH |
| H2 | /api/registry/health | gap = record−actual computed Nuxt-side | #3,#7 | HIGH |
| H3 | registries.vue | Cards read record_count as truth (DOT 307 vs 309; species 178,030 vs 42; KG 2,199 vs 2,259) | #8 | HIGH |
| H4 | pivot.vue rows 8–9 | DOT(307)+Collections(168) from meta_catalog, DOT stale | #8 | MED |
| H5 | engine | multiple active pivots over same source_object → must pick canonical total, never sum groups | (engine) | MED |
Disguised-hardcode test
Passes only if every displayed number resolves to a pivot_code and every grouped list is a PG row set, proven by: T1 grep (no count literals, no category/species/layer arrays, no phantom rows); T3 API has no aggregation SQL; T-living a list can be added via one pivot_definitions INSERT with no code deploy.
Verdict
/knowledge/registries FAILS (H1–H3). /knowledge/pivot largely passes but H4 must be fixed. Target surface designed to pass all checks by construction (doc 07/08/10).