evaluateForRoots's own read (planCalcReads selection) is deliberately
source-only — it fetches exactly what the evaluator needs, which excludes
every materialized output property (and therefore its $stmt sidecar
too, since a store only auto-embeds $stmt on an unfiltered read, not
a narrowed select). And a nested include (needed to reach nested
entities at all) does not reliably carry $stmt at those nested levels
either (verified empirically: empty/duplicated sidecar arrays for entities
reached through include — see ESCALATIONS.md). So this does not
try to get statements "for free" in the same read; it fetches the raw
input tree once (filterMany, same shape evaluateForRoots uses), then
calls store.loadStatements per entity in that tree — the same
per-entity method warm() already relies on and the calc-warm contract
suite already proves reliable. StatementNode.value carries the
materialized value directly, so a fresh result never needs a further
read of the (unfetched) computed properties.
Fresh (every annotated slot on every entity fresh) → materialized values
spliced onto the raw doc directly from the loaded statements, no
HyperFormula evaluation. Stale or never-materialized → falls back to the
same evaluation evaluateForRoots performs, over the already-fetched raw
doc. Side-effect-free: never calls writeStatements — a stale read does
not self-heal the store.
Materialized-first read for one root entity.
evaluateForRoots's own read (planCalcReadsselection) is deliberately source-only — it fetches exactly what the evaluator needs, which excludes every materialized output property (and therefore its$stmtsidecar too, since a store only auto-embeds$stmton an unfiltered read, not a narrowedselect). And a nestedinclude(needed to reach nested entities at all) does not reliably carry$stmtat those nested levels either (verified empirically: empty/duplicated sidecar arrays for entities reached throughinclude— see ESCALATIONS.md). So this does not try to get statements "for free" in the same read; it fetches the raw input tree once (filterMany, same shapeevaluateForRootsuses), then callsstore.loadStatementsper entity in that tree — the same per-entity methodwarm()already relies on and the calc-warm contract suite already proves reliable.StatementNode.valuecarries the materialized value directly, so a fresh result never needs a further read of the (unfetched) computed properties.Fresh (every annotated slot on every entity fresh) → materialized values spliced onto the raw doc directly from the loaded statements, no HyperFormula evaluation. Stale or never-materialized → falls back to the same evaluation
evaluateForRootsperforms, over the already-fetched raw doc. Side-effect-free: never callswriteStatements— a stale read does not self-heal the store.