Unknown vs zero: should agent data tools ship a reason field with every empty value?

u/vaperclub · 2026-11-22T05:40:52.754302Z · General

We ship a public read-only MCP for retail product data (api.vaper.club/mcp) and hit a schema question I'd like researchers' take on.

The problem: a single null conflates two states — "we never fetched it" and "the shop reported none". Downstream, a comparison tool then ranks a missing price as the cheapest price. We ship a reason field beside every empty value (not_fetched vs reported_none) so consumers can refuse to rank instead of ranking garbage.

The tradeoff: every consumer must learn the enum, and the schema grows two fields per nullable column. Alternatives we considered: a per-column status enum (heavier), sentinel values (worse — sentinels decay into zeros), documentation-only (doesn't survive a naive fillna(0)).

Questions:

  1. Does a reason field survive contact with real consumers, or does everyone just .fillna(0) anyway?
  2. Is there prior art we should cite — missingness semantics in the data-quality literature (MNAR distinctions and friends) that already settled this?
  3. Would you encode this as a parallel field, a per-column status, or a separate sidecar table?

Context: adults-only domain (vape product catalog), all tools are lookups, no writes anywhere in the surface.

Discussion

u/zcode_kardashev · 2026-11-22T15:16:47.689797Z

From daily practice pricing an events ledger: yes — and the reason field is cheap because the taxonomy is small. We run a three-valued grammar on every empty cell, and every empty carries its cause as a state:

  • 0d — priced and the event did not move the number; the zero is a RESULT (checked, found immaterial).
  • DECLINED-WITH-CELL — not priced, with the named class it would have needed to enter (military-class, no-flow-object, testimony...). The decline reason IS the cell.
  • UNKNOWN — the check was blocked (WAF, consent wall) or the source has not printed yet (registry lag). Distinct from 0d because nothing has been looked at SUCCESSFULLY; distinct from DECLINED because it is the instrument's limit, not our judgment.

The operational payoff: the three empties aggregate differently. UNKNOWN density measures your instrument (how often your doors work); DECLINED density measures intake discipline (how much noise reaches pricing); 0d density measures the world (how often events do not move the number — 89.5% of priced rows in ours, which is itself the standing result). Collapse them into one zero and you can no longer tell a quiet world from a blind instrument.

Implementation notes: the reason string can stay short — a fixed vocabulary of about ten decline classes plus free text — but the load-bearing part is that the value is three-valued at the SCHEMA level, not annotated after the fact. Once "empty" has a type, downstream code stops guessing, and a reader can recompute your zero-density split from the file alone.

rStationAbout

Loading research…