Commit graph

53 commits

Author SHA1 Message Date
85c9a48969 sector/geo inference for enrich command 2026-05-30 11:21:40 -07:00
7fb674f467 enrich enrich command, remove AlphaVantage
This (huge) commit pulls out AlphaVantage in favor of utilizing
Wikidata and SEC EDGAR data sources (both free). It uses some
built-in heuristics to fill in gaps, and it is not 100% (never
will be), but should get close enough to allow hand-editing of
metadata.srf afterwords without too much labor
2026-05-30 10:40:34 -07:00
52afd75696 update srf/wire edgar and wikidata into service 2026-05-29 12:23:43 -07:00
4a5a3612e3 tweak tests 2026-05-23 11:25:39 -07:00
4bb29f1432 fix transaction log matcher reflecting real world usage 2026-05-23 11:25:12 -07:00
4b5063e974 initial wells fargo parsing implementation 2026-05-21 16:14:38 -07:00
e1b99d63b6 remove frequency and add ability to "upgrade" fields 2026-05-20 16:00:13 -07:00
6c32e94ab4 use adjClose for charting 2026-05-19 13:43:52 -07:00
80a00009d8 land date refactor (similar to money) 2026-05-12 21:40:32 -07:00
3615c4caf8 initial implementation of pre-retirement projections/accumulation phase 2026-05-12 16:37:28 -07:00
2616209614 add ability to use imported history data 2026-05-12 10:52:43 -07:00
53b807d12e upgrade to zig 0.16.0
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
57d3b03623 unnoisy the tests 2026-05-08 12:30:48 -07:00
c21ff84758 begin transfer log 2026-05-06 22:10:13 -07:00
f7c6224a1b periodic review: projections --as-of, contributions --since, comparison and tui projections date picker 2026-05-01 15:59:17 -07:00
98bee5fba6 move generation to a build step - comptime just too slow 2026-04-27 21:29:03 -07:00
94494c60ee ai: merge multiple positions with price_ratio fields 2026-04-25 11:15:41 -07:00
bc7605d0c6 filter non-stock totals by open-as-of 2026-04-23 07:24:49 -07:00
6ec6bd634b skip price_ratio on avg_cost fallback 2026-04-23 06:55:27 -07:00
fc0b2d9334 centralize calculation of effective price and market value 2026-04-23 05:45:39 -07:00
d473179815 allow determining portfolio positions for a specific date 2026-04-23 00:36:22 -07:00
ee979eb794 initial commit for new portfolio history (UI will change) 2026-04-22 12:40:54 -07:00
05d2fce9a5 move snapshot types into a new model for reuse 2026-04-22 03:54:33 -07:00
4b1989c91a clean up audit: centralize money market detection and load portfolio prices 2026-04-21 12:43:07 -07:00
323af8a351 clean up performance.zig 2026-04-21 12:34:10 -07:00
cbba12a9d6 add unit tests for account valuation 2026-04-11 10:22:03 -07:00
03fd64958b centralize portfolio value 2026-04-11 10:17:29 -07:00
a1aec7be6a add audit command (fidelity only for now) 2026-04-09 17:33:02 -07:00
5acce9d0bf refactor risk module/better sharpe ratios/adjust valuation for covered calls 2026-03-17 09:45:30 -07:00
71ec785e49 make price ratio non-null 2026-03-11 15:34:47 -07:00
b0c5dc3e21 add Yahoo finance into the mix for candles and quotes 2026-03-11 15:31:17 -07:00
31d18e28bd allow setting price ratio 2026-03-11 15:09:56 -07:00
868fcd98d3 move isCusipLike / deal with default risk rate 2026-03-10 15:53:51 -07:00
fa1fd38bc6 delete dead code 2026-03-10 15:21:24 -07:00
20c91deb3d store.zig refactored and reviewed 2026-03-09 16:58:12 -07:00
d4a5818f68 move to srf iterator/bail early when possible 2026-03-09 09:56:42 -07:00
b5af45bf5a introduce deinit on Dividend 2026-03-06 14:59:14 -08:00
46862519b6 ai: remove most manual type conversion in favor of srf 2026-03-06 10:59:33 -08:00
471c8639d8 utilize srf library from/to most concrete types 2026-03-04 17:10:01 -08:00
cf42c9942f classification.zig to use srf parser 2026-03-03 13:41:34 -08:00
ecf3d71d97 update pnl -> gain_loss 2026-03-03 13:32:56 -08:00
8f8744d781 ai: skip fetch only if price:: set but no ticker:: alias 2026-03-01 13:09:06 -08:00
54c6af8d6d ai: add tests to tui 2026-03-01 11:22:37 -08:00
333383647c ai: analysis tab, various fixes 2026-02-27 08:15:28 -08:00
a13ef81c17 add historical performance for current portfolio 2026-02-26 16:01:27 -08:00
35982375da ai: add illiquid assets 2026-02-26 15:51:55 -08:00
8682575ed9 ai: display labels from notes if provided on CUSIP securities 2026-02-26 15:32:59 -08:00
28b6f004a6 ai: portfolio sorting 2026-02-26 14:10:19 -08:00
96cf54f269 ai: show failing stocks, include on portfolio 2026-02-26 12:57:17 -08:00
9beb32a329 ai: handle drip investments 2026-02-26 10:06:27 -08:00