You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
substitute_reducers_in_equation in src/simlin-engine/src/ltm_augment.rs (around line 1301) replaces a recognized reducer subexpression with its aggregate-node name to build the $⁚ltm⁚agg⁚{n} → target partial equation. If the parse of its input fails before substitution, the inline reducer survives unchanged into the agg→target partial.
This is a different hazard class from the one fixed by GH #311. GH #311 covered the case where a parse failure in the ceteris-paribus partial caused the unwrapped equation to be emitted (a PREVIOUS()-omission that silently makes the link score a constant 1). This item is the reducer-substitution-omission variant: the inline reducer is not replaced by the agg name, so the agg→target partial silently references the live reducer instead of the hoisted aggregate node.
Why it matters
Effectively unreachable in production -- the input is always a print_eqn re-print of an already-parsed AST, so the re-parse cannot realistically fail. This is a defense-in-depth candidate: it should mirror the GH #311 loud-failure treatment (convert the parse failure into a Warning naming the variable + offending equation text and skip the variable, rather than silently returning the input unchanged and producing a wrong-but-clean-compiling link score).
Make substitute_reducers_in_equation return Result<_, PartialEquationError> like the sibling partial-equation builders already do (build_partial_equation_shaped etc.), and have the db-bearing caller convert the error into a Warning via the existing emit_ltm_partial_equation_warning path.
Severity
Low (defense-in-depth; unreachable today).
Discovery context
Identified during an LTM-hardening session while reviewing the GH #311 ceteris-paribus loud-failure fix for sibling omission hazards.
Activity
engine: fail loudly on substitute_reducers parse failure
engine: decline an LTM table-argument index that reads at runtime