Skip to content

resolvePlanAnswers

resolvePlanAnswers(blocks, answers): ResolvedAnswer[]

Defined in: src/plan-gate.ts:744

Resolve raw operator answers against a gate’s persisted question-form blocks. Pure, fail-closed. Questions are keyed by (blockId, questionId) — id uniqueness is only per-block — so the same questionId in two blocks never clobbers. Drops answers with no matching question. Per kind:

  • single: exactly one in-range index kept; otherwise dropped.
  • multi: in-range indices kept (deduped, order-preserving); an empty set is kept as an answered “none selected” (distinct from an absent answer).
  • freeform: trimmed non-empty text kept; blank dropped.

VisualBlock[]

RawAnswer[]

ResolvedAnswer[]