feat(ledger): add Schema V10 DDL migration for decision deepening#335
Merged
feat(ledger): add Schema V10 DDL migration for decision deepening#335
Conversation
…-329) Add 6 new columns to decisions table: status, authority, affected_paths, tags, review_after, reversibility. Backfill status from existing is_active boolean to maintain COMPAT-01 invariant. Add indexes on status, status+domain, and affected_paths for query performance. Add 3 tests: fresh V10 DB, V9->V10 migration with backfill verification, and backward compatibility for is_active queries. Refs: GH-decision-deepening Track A1 + A2 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
decisionstable:status,authority,affected_paths,tags,review_after,reversibilitywith safe defaultsstatusfrom existingis_activeboolean (active/superseded) to maintain COMPAT-01 invariantstatus,status+domain, andaffected_paths(partial) for query performancemigrate_v9_to_v10()into migration chainDecisionRowstruct and all construction sites with 6 new fieldsTest plan
test_schema_v10_fresh_db— new columns exist on fresh DB, schema_version=10test_schema_v9_to_v10_migration— backfill setsstatus='active'foris_active=1andstatus='superseded'foris_active=0, COMPAT-01 invariant verifiedtest_v10_backward_compat_is_active_queries— existingWHERE is_active = TRUEquery patterns work unchanged (COMPAT-02)cargo clippy -p edda-ledger -- -D warnings— zero warningscargo build --workspace— no cross-crate breakageCloses #329
🤖 Generated with Claude Code