From 401bd4a1403ebfaf6fc7a459b65df1403057d37d Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Wed, 24 Jun 2026 16:15:27 -0700 Subject: [PATCH] resolve note field item in todo --- TODO.md | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/TODO.md b/TODO.md index 2111d0a..653442b 100644 --- a/TODO.md +++ b/TODO.md @@ -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