Skip to content

feat(ledger): DecisionView projection + query_by_paths (GH-331)#336

Merged
fagemx merged 1 commit intomainfrom
feat/GH-331-decision-view
Mar 20, 2026
Merged

feat(ledger): DecisionView projection + query_by_paths (GH-331)#336
fagemx merged 1 commit intomainfrom
feat/GH-331-decision-view

Conversation

@fagemx
Copy link
Owner

@fagemx fagemx commented Mar 20, 2026

Summary

  • C1: New view.rs module with DecisionView struct and to_view() function — the read-side projection consumed by Injection (BOUNDARY-01). Parses affected_paths/tags from JSON strings to Vec<String>, renames scopepropagation, drops is_active.
  • C2: query_by_paths() on Ledger — given file paths, returns decisions whose affected_paths globs match, using globset crate. SQL pre-filters active decisions with non-empty paths for performance (PERF-01).
  • 12 new tests: JSON parsing, empty defaults, scope rename, glob matching, no-match, superseded filtering, limit enforcement, path exclusion.

Closes #331

Test plan

  • cargo test -p edda-ledger -- view (6 tests pass)
  • cargo test -p edda-ledger -- query_by_paths (5 tests pass)
  • cargo test -p edda-ledger -- query_active_with_paths (1 test passes)
  • cargo test -p edda-ledger (146 tests pass, 0 failures)
  • cargo clippy -p edda-ledger --lib -- -D warnings (zero warnings)
  • CI: cargo clippy --workspace --all-targets (pre-existing too_many_arguments in test helpers)
  • CI: cargo test --workspace (pre-existing flaky test in edda-bridge-claude)

🤖 Generated with Claude Code

Implement Track C (Decision View) from the decision-deepening plan:

C1: DecisionView + to_view()
- New `view.rs` module with `DecisionView` struct (read-side projection)
- `to_view()` converts DecisionRow -> DecisionView: parses affected_paths/tags
  from JSON strings to Vec<String>, renames scope -> propagation
- No is_active field on DecisionView (BOUNDARY-01)

C2: query_by_paths() glob-based decision lookup
- `active_decisions_with_paths()` on SqliteStore: SQL pre-filter for active
  decisions with non-empty affected_paths
- `query_active_with_paths()` on Ledger: returns Vec<DecisionView>
- `query_by_paths()` on Ledger: glob-matches file paths against decision
  affected_paths using globset crate
- Added globset dependency to edda-ledger

12 new tests covering JSON parsing, empty defaults, scope rename,
glob matching, no-match, superseded filtering, limit, and path exclusion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@fagemx fagemx force-pushed the feat/GH-331-decision-view branch from deed959 to 81c8b3d Compare March 20, 2026 00:40
@fagemx fagemx merged commit b275ba0 into main Mar 20, 2026
4 of 7 checks passed
@fagemx fagemx deleted the feat/GH-331-decision-view branch March 20, 2026 00:40
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): DecisionView + to_view() + query_by_paths

1 participant