Files
Imhotep/packages/imhotep-solver/src
John Dvorak 2bdda12030 fix: getTopologyValue off-by-one bug in clause-based topology evaluators
getTopologyValue used subject ID as direct array index (arr[subjectId] ?? 0),
but solver subject IDs are 1-indexed while topology arrays are 0-indexed parallel
arrays.  This produced wrong results for any subjectId != position+1.

Fixed by using world.subjects.ids.indexOf(subjectId) to map subject ID to array
position, matching the predicate evaluator's getTopologyValueBySubject pattern.

Affected callers: evaluateAttachedToScrollContainer, evaluateInStackingContext.
The predicate-based evaluators in predicates.ts were already correct.
2026-05-22 16:40:01 -07:00
..