Commit graph

30 commits

Author SHA1 Message Date
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
b75381a9bd
update todo.md 2026-05-08 15:02:44 -07:00
86cf60447f
nag when data is stale 2026-05-08 14:47:31 -07:00
a26470f46a
transaction documentation 2026-05-07 14:50:08 -07:00
8a09d904e2
output ratio suggestions to reconcile Schwab direct indexing accounts 2026-05-04 15:14:37 -07:00
f007a1d350
update TODOs 2026-05-02 11:33:48 -07:00
7a05d53dc9
address symptom of Torn SRF files while we track this down 2026-05-02 10:07:59 -07:00
d15939a9ad
periodic review: projections --as-of, contributions --since, comparison and tui projections date picker 2026-05-01 15:59:17 -07:00
0c08cdda6c
replace finnhub with fmp - finnhub data not correct 2026-04-30 15:22:52 -07:00
25d763e306
update todo list 2026-04-30 10:14:40 -07:00
c0b980146c
initial commit projections TUI tab 2026-04-28 10:30:13 -07:00
d6b45b0318
fixes for analysis processing 2026-04-27 16:49:27 -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
d9ce5b7082
add zig 0.16.0 to todo
All checks were successful
Generic zig build / build (push) Successful in 27s
2026-04-14 16:43:08 -07:00
ad38fe75c9
update TODO.md 2026-04-11 10:27:50 -07:00
f55af318f2
add todo 2026-04-09 17:33:55 -07:00
1cdf228fc1
update todo 2026-03-20 08:58:48 -07:00
ea7da4ad5d
add concept of "quick switch to last selected security" to todo 2026-03-19 09:41:29 -07:00
51c7dc9fdd
remove perf comparison ideal from TODO
Some checks failed
Generic zig build / build (push) Failing after 13s
2026-03-17 10:20:31 -07:00
e93d24c6d7
update todo.md 2026-03-17 10:12:54 -07:00
e5cb7d2b32
uppercase the command line symbol name 2026-03-17 10:10:29 -07:00
b248461034
update todo.md 2026-03-17 10:07:37 -07:00
36d096a938
enable ^L to repaint
All checks were successful
Generic zig build / build (push) Successful in 53s
2026-03-17 09:50:46 -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
f8a9607bc9
add Yahoo finance into the mix for candles and quotes 2026-03-11 15:31:17 -07:00
195b660f61
update todos 2026-03-11 15:06:21 -07:00
85e098ea24
add todo about the server cache 2026-03-11 13:20:13 -07:00
c50ba0124f
capture additional review in todo.txt 2026-03-10 15:57:29 -07:00
0ca05ed3b4
move isCusipLike / deal with default risk rate 2026-03-10 15:53:51 -07:00