refactor(edda-ledger): wrap sqlite_store types in domain abstractions (GH-378)#385
Merged
refactor(edda-ledger): wrap sqlite_store types in domain abstractions (GH-378)#385
Conversation
Move 9 domain-shaped types (PatternType, DetectedPattern, VillageStats, etc.) from sqlite_store/types.rs to a new domain.rs module. Re-export from lib.rs and update edda-serve to use the new import paths. Phase 1 of 3: no behavioral change, only type relocation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…API (GH-378) Change 10 Ledger methods to return DecisionView instead of DecisionRow: - active_decisions, active_decisions_limited, decision_timeline, domain_timeline, find_active_decision, shared_decisions, get_decision_by_event_id, active_dependents_of, transitive_dependents_of, causal_chain Add ChainEntryView domain type for causal chain results. Update edda-ask to derive is_active from status field instead of accessing the raw is_active boolean. Update edda-serve chain endpoint similarly. Remove redundant to_view() call in edda-pack. Internal sync.rs bypasses the Ledger facade to access raw rows for source_project_id checking. Phase 2 of 3. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…-378) Move remaining public types (BundleRow, DeviceTokenRow, DecideSnapshotRow, SuggestionRow, TaskBriefRow, ImportParams) from sqlite_store/types.rs to domain.rs. Rename DepRow to DependencyEdge with backwards-compatible alias. Change sqlite_store module visibility to pub(crate) — no downstream crate can reach sqlite_store::* directly anymore. All types are re-exported from lib.rs via the domain module. Phase 3 of 3: completes the domain abstraction boundary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
Author
Code Review: PR #385 (Round 1) — LGTM 🎉All P0 and P1 issues have been resolved. SummaryThis PR cleanly wraps
Verification
Verdict: LGTM ✅No critical or high-priority issues remaining. This PR is ready for merge. Completed after 1 round(s) of automated review-fix loop |
9 tasks
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
PatternType,DetectedPattern,VillageStats, etc.) fromsqlite_store/types.rsto newdomain.rsmoduleDecisionRowtoDecisionView, addChainEntryViewdomain type, fixedda-askto deriveis_activefromstatusinstead of raw boolean, remove redundantto_view()inedda-packBundleRow,DeviceTokenRow,DecideSnapshotRow,SuggestionRow,TaskBriefRow,ImportParams) todomain.rs, renameDepRowtoDependencyEdge, sealsqlite_storemodule aspub(crate)Key Changes
sqlite_storemodule is nowpub(crate)— no downstream crate can importedda_ledger::sqlite_store::*directlylib.rsviadomain.rsDecisionRowandChainEntryremain internal toedda-ledgersync.rsbypasses the Ledger facade to access raw rows forsource_project_idcheckingverify_chainmethod annotated with#[cfg_attr(not(test), allow(dead_code))]since it's only used in testsTest plan
cargo checkpasses for all workspace cratescargo clippy -D warningspasses for all affected cratescargo fmt --checkpassescargo test— 106 tests pass across edda-ledger, edda-ask, edda-pack, edda-serve, edda-aggregate, edda-ingestionCloses #378
🤖 Generated with Claude Code