update todos
All checks were successful
Generic zig build / build (push) Successful in 3m10s
Generic zig build / deploy (push) Successful in 19s

This commit is contained in:
Emil Lerch 2026-05-21 12:44:14 -07:00
parent d23e2dd977
commit a06a4a8852
Signed by: lobo
GPG key ID: A7B62D657EF764F8

80
TODO.md
View file

@ -7,9 +7,6 @@ ranking; unlabeled items are "someday, if the mood strikes."
## Projections: future enhancements ## Projections: future enhancements
- **Configurable benchmark symbols — priority MEDIUM.** Currently
hardcoded SPY + AGG. Route through `projections.srf` as a
`type::config,benchmark::SYMBOL` record (or similar). Low effort.
- **Configurable return cap per position — priority MEDIUM.** - **Configurable return cap per position — priority MEDIUM.**
Default: none; cap outliers like NVDA. Should route through Default: none; cap outliers like NVDA. Should route through
`projections.srf` cleanly. `projections.srf` cleanly.
@ -592,73 +589,20 @@ commands plus interactive. The framework dispatch itself is
working correctly; these are gaps in command-level behavior or in working correctly; these are gaps in command-level behavior or in
the global `--refresh-data` flag's coverage. the global `--refresh-data` flag's coverage.
### `--refresh-data=never` doesn't actually skip network calls — priority MEDIUM ### `zfin interactive --default-keys`/`--default-theme` swallow trailing flags — priority LOW
Today `never` and `auto` behave identically: both respect cache `zfin interactive --default-keys --bogus-flag` is silently
TTLs, neither truly skips network. The help text promises "no accepted: `--default-keys` prints its output and `return`s from
provider calls (offline mode)" but that's aspirational — the `tui.run` before the rest of the args are parsed. The flag
underlying `svc.loadAllPrices` loader has no `skip_network` knob. parser itself now rejects unknown flags (`error.InvalidArgs`
See `src/commands/common.zig:280-291` for the documented + exit 1), but only when control reaches the parsing loop —
approximation. which it doesn't if `--default-keys` or `--default-theme`
short-circuits first.
Fix: add a `skip_network: bool` option to the loader's options Fix: validate the entire arg list before honoring the
struct, threaded through to `getCandles` etc. so a stale entry is print-and-exit flags, or restructure so the parser runs first
served from cache instead of triggering a refetch when the user and the print-and-exit flags fire from inside the loop after
explicitly opts in to offline mode. Then map `.never``.{ .skip_network = true }` all args have been validated.
in `loadPortfolioPrices`.
Alternative: revise the help text to drop the offline-mode claim
and document `never` as "TTL-respecting" (which is what it
actually does). Less work, less honest.
### `--refresh-data` ignored by single-symbol commands — priority MEDIUM
The 7 multi-symbol commands (portfolio, analysis, snapshot, audit,
compare, contributions, projections) honor
`ctx.globals.refresh_policy` because they go through
`cli.loadPortfolioPrices`. The 12 single-symbol commands (perf,
quote, divs, splits, options, earnings, etf, history-symbol-mode,
lookup, plus version/cache which don't fetch) bypass it — they
call `svc.getCandles` etc. directly, which has its own TTL logic
and doesn't read the global flag.
So `zfin --refresh-data=force perf AAPL` doesn't force a
re-fetch. The help text implies the flag is universal.
Fix options:
- Thread `refresh_policy` into the per-symbol freshness check
in `service.zig`. Most invasive but most correct.
- Scope the flag's docs to "portfolio commands" and rename it.
Less work, smaller blast radius.
- Add a different flag (`--symbol-refresh`?) for single-symbol
cases. Worst of both — two flags users have to remember.
### `interactive -s` without a symbol value silently launches the TUI — priority LOW
`zfin interactive -s` (no value following) doesn't error. The
flag-parsing in `src/tui.zig:2071-2079` checks `if (i + 1 < args.len)`
and silently drops `-s` if no value follows. It also doesn't
validate that the value isn't another flag — `zfin interactive -s --chart 80x24`
would treat `--chart` as the symbol.
Same issue applies to `--chart` (lines 2080-2086). Both should
error out with a clear "flag requires a value" message and exit 1.
Fix: rewrite the loop to use the framework's parseArgs convention
— error on missing values, error on flag-shaped values where a
positional value is expected. Or migrate the TUI flag parser to
the framework entirely (see "interactive command isn't framework-
registered" in main.zig's docs for the constraints).
### `zfin interactive --help` printed help; `--default-keys`/`--default-theme` skip the TUI — priority LOW
Acknowledged as fixed-with-caveat. The current implementation
intercepts `--help` at the dispatch site (main.zig). The TUI's
`--default-keys` / `--default-theme` print and `return` from
`tui.run` correctly. But: the TUI flag parser's "silently ignore
malformed flag" behavior (above) means
`zfin interactive --default-keys --bogus-flag` is accepted; the
bogus flag is silently dropped. Same fix as above.
### `etf <SYMBOL>` warns `failed to serialize ETF profile: WriteFailed` — priority LOW ### `etf <SYMBOL>` warns `failed to serialize ETF profile: WriteFailed` — priority LOW