Part of #212.
Scope
Extract the embedded knowledge base from stackbilt-web/src/lib/scaffold-core.ts into packages/scaffold-core/src/knowledge/. This is pure data — no logic, no functions, no deps.
Files to create
| File |
Source |
Content |
threats.ts |
patternSpecificThreats, domainThreats |
Per-pattern threat register entries + domain threat sets (PHI, PCI, PII, telephony) |
decisions.ts |
adrContextByPattern, adrDecisionByPattern |
Per-pattern ADR context paragraphs and decision bullet lists |
index.ts |
— |
Re-exports getKnowledge(pattern) → PatternKnowledge |
Key invariant
knowledge/ has zero inbound deps within the package. It is a data layer only. Could theoretically be JSON — kept as TypeScript for type safety.
Tests
Structural completeness test: every pattern defined in classify/patterns.ts must have a corresponding entry in both threats.ts and decisions.ts.
Part of #212.
Scope
Extract the embedded knowledge base from
stackbilt-web/src/lib/scaffold-core.tsintopackages/scaffold-core/src/knowledge/. This is pure data — no logic, no functions, no deps.Files to create
threats.tspatternSpecificThreats,domainThreatsdecisions.tsadrContextByPattern,adrDecisionByPatternindex.tsgetKnowledge(pattern) → PatternKnowledgeKey invariant
knowledge/has zero inbound deps within the package. It is a data layer only. Could theoretically be JSON — kept as TypeScript for type safety.Tests
Structural completeness test: every pattern defined in
classify/patterns.tsmust have a corresponding entry in boththreats.tsanddecisions.ts.