resolve note field item in todo

This commit is contained in:
Emil Lerch 2026-06-24 16:15:27 -07:00
parent c46d39a954
commit 401bd4a140
Signed by: lobo
GPG key ID: A7B62D657EF764F8

31
TODO.md
View file

@ -129,37 +129,6 @@ have PNG export and were deferred:
exports PNG natively today; would need an external dependency
or a pixel-buffer-to-format conversion.
## Note-field handling: holistic review (priority LOW)
The lot `note::` field is nominally a human annotation, but it leaks
into behavior in at least one place: for CUSIP-like holdings with a
note, `valuation.shortLabel(note)` becomes the allocation's
`display_symbol` (`src/analytics/valuation.zig`, ~line 396), and the
classification engine then matches `metadata.srf` entries against BOTH
the allocation symbol AND `display_symbol` (`src/analytics/analysis.zig`,
~line 611). So a free-text note can silently become a
classification-matching key, which is surprising and fragile (editing
a note could change what classifies).
Surfaced while building `zfin doctor`: its metadata cross-reference
deliberately checks only `lot.priceSymbol()` (the ticker alias or raw
symbol), NOT the note-derived `display_symbol`, because coupling a
diagnostic to free-text note content felt wrong. That asymmetry is the
tell: the cross-ref and the engine now disagree on what counts as
"classified" for a note-bearing CUSIP.
Do a pass over every `note` consumer and classify each use as
display-only vs behavior-affecting; decide whether note-derived values
should ever be matching keys, document/justify any that stay, and then
reconcile `doctor`'s metadata cross-ref with whatever the engine
settles on. Starting points (grep `\.note` and `note::`):
- `valuation.shortLabel` -> `display_symbol`, used as a classification
match key in `analysis.zig` (the main offender).
- Cash / illiquid / CD row rendering (display labels; likely fine).
- `transaction_log` transfer `note` (annotation).
- audit / contributions matchers (do any key off notes?).
## Refactor: trim `src/format.zig` once Money / Date have absorbed their helpers — priority LOW
`src/format.zig` is still a ~1700-line grab-bag, but the money- and