feat(ledger): DecisionView projection + query_by_paths (GH-331)#336
Merged
feat(ledger): DecisionView projection + query_by_paths (GH-331)#336
Conversation
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>
deed959 to
81c8b3d
Compare
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
view.rsmodule withDecisionViewstruct andto_view()function — the read-side projection consumed by Injection (BOUNDARY-01). Parsesaffected_paths/tagsfrom JSON strings toVec<String>, renamesscope→propagation, dropsis_active.query_by_paths()onLedger— given file paths, returns decisions whoseaffected_pathsglobs match, usingglobsetcrate. SQL pre-filters active decisions with non-empty paths for performance (PERF-01).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)cargo clippy --workspace --all-targets(pre-existingtoo_many_argumentsin test helpers)cargo test --workspace(pre-existing flaky test inedda-bridge-claude)🤖 Generated with Claude Code