Normalize descriptor strings into insert-only reference tables #15
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/reference-tables"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What does this PR do?
Adopts D-0031: normalizes the low-cardinality descriptor strings repeated on the growing fact tables into four insert-only reference tables (
sources,classifiers,policies,action_providers). Fact tables (raw_observations,events,audit_records,classifications,decisions,actions) now carry int foreign keys; the domain model and ports keep speaking strings, so this is purely a persistence-layer change.Key pieces:
sources.source_typeis filled exactly once by the first typed writer; rows are never renamed or deleted, so audit history is never rewritten retroactively.SourceType: observation provenance now records the source kind (previously not captured); all three adapters set it from their existing type constants.events.source_typeanddecisions.policy_versionmove into their reference tables; both depended on the descriptor, not the row.corrected_by(user identity; future users table under admin auth),category/recommended_action/operation_id(natural follow-ons once the D-0029 config store defines those vocabularies; tracked in TODO.md).How was this tested?
dotnet build- 0 errors, 0 warningsdotnet test- 267 passed, 9 skipped (live-PostgreSQL integration tests; local WSL Docker unavailable)Checklist