Commit graph

53 commits

Author SHA1 Message Date
0987a61634
land date refactor (similar to money) 2026-05-12 21:40:32 -07:00
bdd827734d
initial implementation of pre-retirement projections/accumulation phase 2026-05-12 16:37:28 -07:00
f9d2148c23
add ability to use imported history data 2026-05-12 10:52:43 -07:00
fad9be6ce8
upgrade to zig 0.16.0
All checks were successful
Generic zig build / build (push) Successful in 2m20s
Generic zig build / deploy (push) Successful in 27s
IO-as-an-interface refactor across the codebase. The big shifts:
- std.io → std.Io, std.fs → std.Io.Dir/File, std.process.Child → spawn/run.
- Juicy Main: pub fn main(init: std.process.Init) gives gpa, io, arena,
  environ_map up front. main.zig + the build/ scripts use it directly.
- Threading io through everywhere that touches the outside world (HTTP,
  files, stderr, sleep, terminal detection). Functions taking `io` now
  announce side effects at the call site — the smell is the feature.
- date math takes `as_of: Date`, not `today: Date`. Caller resolves
  `--as-of` flag vs wall-clock at the boundary; the function operates
  on whatever date it's given. Every "today" parameter renamed and
  the as_of: ?Date + today: Date pattern collapsed.
- now_s: i64 (or before_s/after_s pairs) for sub-second metadata
  fields like snapshot captured_at, audit cadence, formatAge/fmtTimeAgo.
  Also pure and testable.
- legitimate Timestamp.now callers (cache TTL math, FetchResult
  timestamps, rate limiter, per-frame TUI "now" captures) gain
  `// wall-clock required: ...` comments justifying the read.

Test discovery: replaced the local refAllDeclsRecursive with bare
std.testing.refAllDecls(@This()). Sema-pulling main.zig's top-level
decls reaches every test file transitively through the import graph;
no explicit _ = @import(...) lines needed.

Cleanup along the way:
- Dropped DataService.allocator()/io() accessor methods; renamed the
  fields to drop the base_ prefix. Callers use self.allocator and
  self.io directly.
- Dropped now-vestigial io parameters from buildSnapshot,
  analyzePortfolio, compareSchwabSummary, compareAccounts,
  buildPortfolioData, divs.display, quote.display, parsePortfolioOpts,
  aggregateLiveStocks, renderEarningsLines, capitalGainsIndicator,
  aggregateDripLots, printLotRow, portfolio.display, printSnapNote.
- Dropped the unused contributions.computeAttribution date-form
  wrapper (only computeAttributionSpec is called).
- formatAge/fmtTimeAgo take (before_s, after_s) instead of io and
  reading the clock internally.
- parseProjectionsConfig uses an internal stack-buffer
  FixedBufferAllocator instead of an allocator parameter.
- ThreadSafeAllocator wrappers in cache concurrency tests dropped
  (0.16's DebugAllocator is thread-safe by default).
- analyzePortfolio bug surfaced by the rename: snapshot.zig was
  passing wall-clock today instead of as_of, mis-valuing cash/CDs
  for historical backfills.

83 new unit tests added due to removal of IO, bringing coverage from 58%
-> 64%
2026-05-09 22:40:33 -07:00
86cf60447f
nag when data is stale 2026-05-08 14:47:31 -07:00
f9c7fa99e4
move ** -> @splat
All checks were successful
Generic zig build / build (push) Successful in 1m57s
Generic zig build / deploy (push) Successful in 17s
2026-05-08 12:36:12 -07:00
f605e1f764
add age-based horizon to projections 2026-05-08 11:40:33 -07:00
8a09d904e2
output ratio suggestions to reconcile Schwab direct indexing accounts 2026-05-04 15:14:37 -07:00
fef126471f
clean up contributions command 2026-05-02 11:02:06 -07:00
8387692de1
incorporate life events (e.g. social security) into projections 2026-04-30 10:10:44 -07:00
c0b980146c
initial commit projections TUI tab 2026-04-28 10:30:13 -07:00
6debed0d69
add CLI command for projections 2026-04-27 17:36:37 -07:00
d6b45b0318
fixes for analysis processing 2026-04-27 16:49:27 -07:00
a2271e3582
master audit command to do all the things
All checks were successful
Generic zig build / build (push) Successful in 2m0s
Generic zig build / deploy (push) Successful in 15s
2026-04-25 14:58:37 -07:00
4df334896c
just defer 2026-04-25 13:13:16 -07:00
77cc69efe0
ai: merge multiple positions with price_ratio fields
All checks were successful
Generic zig build / build (push) Successful in 1m48s
Generic zig build / deploy (push) Successful in 15s
2026-04-25 11:15:41 -07:00
41208f3732
history view refactor 2026-04-23 16:02:34 -07:00
c89e93c243
filter non-stock totals by open-as-of 2026-04-23 07:24:49 -07:00
d3f2f15a2d
centralize calculation of effective price and market value 2026-04-23 05:45:39 -07:00
9364532c9b
fix portfolio account totals/honor as_of date 2026-04-23 02:43:04 -07:00
abd5d08af7
use candles for pricing/implement --as-of parameter 2026-04-22 22:04:45 -07:00
8561a130e0
initial commit for new portfolio history (UI will change) 2026-04-22 12:40:54 -07:00
b717c9fa3d
add valuation netWorth 2026-04-21 13:07:24 -07:00
fbe8320399
clean up performance.zig 2026-04-21 12:34:10 -07:00
f3f9a20824
add audit command (fidelity only for now) 2026-04-09 17:33:02 -07:00
2ac4156bc1
merge adj_close and div reinvestment strategies to compensate for data inconsistency
All checks were successful
Generic zig build / build (push) Successful in 29s
2026-03-29 10:53:24 -07:00
ee9d749a6f
disable twelvedata candles due to inconsistent dividend handling 2026-03-24 18:17:19 -07:00
5052492ffd
morningstar apparently snaps backward
All checks were successful
Generic zig build / build (push) Successful in 34s
2026-03-24 05:23:35 -07:00
070f2352f4
use adj_close returns in most cases (accounting for splits and dividends 2026-03-24 05:14:30 -07:00
913996072e
synthesize money market data if candles do not cover dividend data
All checks were successful
Generic zig build / build (push) Successful in 30s
2026-03-21 13:24:14 -07:00
04882a4ff8
cache chart and use sliding windows on bollinger bands 2026-03-20 09:23:41 -07:00
1cd775c27e
refactor risk module/better sharpe ratios/adjust valuation for covered calls
All checks were successful
Generic zig build / build (push) Successful in 33s
2026-03-17 09:45:30 -07:00
724a13a012
centralize annualized return calc 2026-03-12 09:58:00 -07:00
7ba1df8ba9
make price ratio non-null
All checks were successful
Generic zig build / build (push) Successful in 29s
2026-03-11 15:34:47 -07:00
f637740c13
allow setting price ratio 2026-03-11 15:09:56 -07:00
2f49a99ca4
adjust 1 year return threshold to allow for landing the snap on weekends/holidays
All checks were successful
Generic zig build / build (push) Successful in 26s
2026-03-11 12:00:03 -07:00
0ca05ed3b4
move isCusipLike / deal with default risk rate 2026-03-10 15:53:51 -07:00
e0129003e6
store.zig refactored and reviewed 2026-03-09 16:58:12 -07:00
44dfafd574
move to srf iterator/bail early when possible 2026-03-09 09:56:42 -07:00
f1e9321bdc
move tax type to enum 2026-03-06 13:51:19 -08:00
c65ebb9384
utilize srf library from/to most concrete types 2026-03-04 17:10:01 -08:00
9819c93cfe
update pnl -> gain_loss 2026-03-03 13:32:56 -08:00
ea6ac524bb
ai: skip fetch only if price:: set but no ticker:: alias 2026-03-01 13:09:06 -08:00
6d9374ab77
move isCusipLike to a more generic place 2026-03-01 12:45:26 -08:00
facc233976
ai: deduplicate cli/tli display functions 2026-03-01 11:57:29 -08:00
a582228765
ai: add tests to tui 2026-03-01 11:22:37 -08:00
6e78818f1c
ai: analysis tab, various fixes 2026-02-27 08:15:28 -08:00
b4b31c7268
add historical performance for current portfolio 2026-02-26 16:01:27 -08:00
ec3da78241
ai: display labels from notes if provided on CUSIP securities 2026-02-26 15:32:59 -08:00
bbb11c29e1
ai: portfolio sorting 2026-02-26 14:10:19 -08:00