# Question-first evaluation v2 The formal evaluation unit is an audited atomic question, not a checker name. ```text QuestionSpec -> Evidence DAG -> EvidencePacket -> AnswerRecord -> role-aware score ``` ## Invariants - The original question, pass/partial/fail rubric, role, and weight are frozen in `QuestionSpec`. - A free-form `decision_rule.type` is never executable by resemblance. Only a registered normalizer may emit a deterministic `PredicateSpec`. - Every tool dependency is enforced by the DAG executor. A required failed dependency blocks downstream calls. - Detector evidence is scoped by case, check, image role, and resolved ROI. - An explicit detector `no_detections` result may establish zero; a missing row may not. - A detector bbox synthesized as a mask is insufficient for formal geometry. - Deterministic answers require a successful packet, a unique numeric band, and citable call IDs. - Penalty answers retain positive rubric-satisfaction semantics. Inversion happens once in the final scorer. - The independent image validity/quality gate is applied after question scoring; a failed gate forces the final case score to zero. - VLM fallback receives the exact question/rubric, compact tool facts, input/prediction, and question-specific overlays. It does not receive reference GT. - API keys are read from an environment variable at call time and are not CLI values or audit fields. ## Current migration audit The 271-case reviewed contract set compiles to 2,198 unique question specs: - 7 deterministic questions with explicitly normalized semantics; - 2,191 `vlm_required` questions; - 1,825 distinct source rule names preserved for migration analysis; - no missing resolved case and no duplicate procedure hash. The deliberately small deterministic whitelist currently covers: - forbidden/non-exempt instance counts; - source-normalized zone clearance; - assigned vehicle slot containment with minimum area and color-evidence gating. The accessible-vehicle rule remains `vlm_required` because containment alone cannot verify the accessibility symbol. ## Entry points Compile and audit without running models: ```bash PYTHONPATH=src python scripts/run_question_eval_v2.py compile \ --contracts-dir --resolved-root --output-dir ``` Replay legacy evidence without VLM calls: ```bash PYTHONPATH=src python scripts/run_question_eval_v2.py replay \ --contracts-dir --resolved-root \ --regions-tsv --detectors-tsv --masks-tsv \ --tool-calls-tsv --output-dir ``` Add `--run-vlm --vlm-model --resume` to answer unresolved questions. Questions are batched once per case while retaining separate packets and answer records. Use `--num-shards` and `--shard-index` for parallel workers. Merge completed shards with conflict and provenance checks: ```bash python scripts/merge_question_eval_v2_shards.py \ --shard-dir --shard-dir \ --question-specs --output-dir ``` ## Golden regressions - Black spiked crystals: 0 = pass, 1–2 = partial, 3+ = fail. - Cleared stairway: 0 output vehicles = pass; presence semantics cannot be reversed. - Parking slot: containment `[0.65, 0.85)` = partial, rather than multiplying `0.85 * 0.5`. - Required DAG dependencies block downstream tools. - Bbox fallback cannot become a formal mask. - Formal answers must cite tool calls. - Runtime NumPy masks are persisted as compact summaries, not raw pixel arrays. - Multiple unresolved questions in one case use one batch VLM request.