Skip to content

feat(ledger): add Schema V10 DDL migration for decision deepening#335

Merged
fagemx merged 1 commit intomainfrom
feat/GH-329-schema-v10
Mar 20, 2026
Merged

feat(ledger): add Schema V10 DDL migration for decision deepening#335
fagemx merged 1 commit intomainfrom
feat/GH-329-schema-v10

Conversation

@fagemx
Copy link
Owner

@fagemx fagemx commented Mar 20, 2026

Summary

  • Add 6 new columns to decisions table: status, authority, affected_paths, tags, review_after, reversibility with safe defaults
  • Backfill status from existing is_active boolean (active/superseded) to maintain COMPAT-01 invariant
  • Add indexes on status, status+domain, and affected_paths (partial) for query performance
  • Bump schema version to 10, wire migrate_v9_to_v10() into migration chain
  • Extend DecisionRow struct and all construction sites with 6 new fields

Test plan

  • test_schema_v10_fresh_db — new columns exist on fresh DB, schema_version=10
  • test_schema_v9_to_v10_migration — backfill sets status='active' for is_active=1 and status='superseded' for is_active=0, COMPAT-01 invariant verified
  • test_v10_backward_compat_is_active_queries — existing WHERE is_active = TRUE query patterns work unchanged (COMPAT-02)
  • All 134 tests pass (131 existing + 3 new)
  • cargo clippy -p edda-ledger -- -D warnings — zero warnings
  • cargo build --workspace — no cross-crate breakage

Closes #329

🤖 Generated with Claude Code

…-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>
@fagemx fagemx merged commit be71d75 into main Mar 20, 2026
1 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ledger): Schema V10 migration — decision object deepening

1 participant