load_m1_window rustdoc: None is file-level, not bar-level (in-coverage-empty window returns Some(empty)) #18

Closed
opened 2026-06-04 22:05:11 +02:00 by Brummel · 0 comments
Owner

Found by the cycle-0011 fieldtest (docs/specs/fieldtest-0011-ingest.md).

aura_ingest::load_m1_window's rustdoc states "None if the symbol has no data in [from_ms, to_ms]". Empirically None is file-level: it occurs only when no data-server file overlaps the window (e.g. a far-future window) or the symbol is unknown. A narrow window inside a loaded file's coverage that happens to contain zero bars returns Some(M1Columns { ..empty vecs.. }), NOT None.

A downstream consumer matching None to mean "no bars here" is wrong for the in-coverage-empty case; it must also check cols.close.is_empty().

Fix: one rustdoc line on load_m1_window — either document precisely (None only when no overlapping file / unknown symbol; in-coverage-empty returns Some with empty columns, check .close.is_empty()), or collapse the empty case into None so Some/None cleanly means has-bars / has-none. Decide which is the intended contract and tighten rustdoc (+ ledger if the contract is load-bearing).

No functional defect in the boundary; correctness-of-docs only.

Found by the cycle-0011 fieldtest (docs/specs/fieldtest-0011-ingest.md). aura_ingest::load_m1_window's rustdoc states "None if the symbol has no data in [from_ms, to_ms]". Empirically None is **file-level**: it occurs only when no data-server file overlaps the window (e.g. a far-future window) or the symbol is unknown. A narrow window **inside** a loaded file's coverage that happens to contain zero bars returns Some(M1Columns { ..empty vecs.. }), NOT None. A downstream consumer matching None to mean "no bars here" is wrong for the in-coverage-empty case; it must also check cols.close.is_empty(). Fix: one rustdoc line on load_m1_window — either document precisely (None only when no overlapping file / unknown symbol; in-coverage-empty returns Some with empty columns, check .close.is_empty()), or collapse the empty case into None so Some/None cleanly means has-bars / has-none. Decide which is the intended contract and tighten rustdoc (+ ledger if the contract is load-bearing). No functional defect in the boundary; correctness-of-docs only.
Brummel added the bug label 2026-06-04 22:05:11 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Brummel/Aura#18