feat(core+cli): advanced financial goal projections#261
Merged
Conversation
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.
Description
Builds the "advanced" layer of financial goal projections on top of the existing basic goal tracking, and exposes it through a new
ldgr goalsCLI command. All projection math lives in pureldgr-core(no I/O, no floating point) and is deterministic.What's included:
Core (
crates/ldgr-core/src/goals/tracker.rs):ScenarioRates+project_bandmodel an optimistic/expected/pessimistic annual-return range and return three projected completion dates instead of one.inflate_target,inflation_adjusted_target, andproject_with_inflationgrow the target as savings compound, so a goal preserves real purchasing power (real vs nominal target).ContributionSchedule(base monthly + step-ups + one-off lump sums) withproject_schedule.allocate_budgetdivides a single monthly budget across competing goals by priority, deadline, proportional, or equal-split strategy, reporting per-goal shortfalls.estimate_monthly_rate_from_historyderives an empirical contribution estimate from real balance history.CLI (
crates/ldgr-cli):ldgr goalscommand withlist,project <id>,plan <id>, andallocate --budgetsubcommands, each supporting--output table|json.~/.ldgr/goals.json(interim source until vault persistence lands); current amounts are pulled from a goal's linked account balance in the vault when unlocked, falling back to a configured value.Compounding uses a nominal monthly rate (annual / 12), matching the existing
loansmodule, via month-by-month simulations bounded by a 100-year horizon so unreachable goals terminate cleanly rather than looping.Related Issues
Closes #224
Type of Change
Component
crates/ldgr-core/— Core library (crypto, accounting, storage)crates/ldgr-cli/— CLI toolcrates/ldgr-server/— Sync serverbindings/swift/— UniFFI Swift bindingsapps/ios/— iOS / iPadOS / watchOS appapps/web/— Web app (Next.js + WASM)docs/— DocumentationPrivacy Checklist
Checklist
cargo test --workspace)cargo clippy --workspace -- -D warnings)cargo fmt --check)