#!/usr/bin/env python3
"""Build a focused investigation queue for confirmed-route blockers."""
from __future__ import annotations

import argparse
import html
import json
from pathlib import Path
from typing import Any


ROOT = Path(__file__).resolve().parents[1]
OUT = ROOT / "out"
HARD_GATE_MISSING_EVIDENCE = {
    "strictSourceHotspot": "strict source coordinate",
    "tileHotspotConfirmation": "tile hotspot confirmation",
    "realSelector20Savedata": "real selector 2:0 captured savedata",
    "selectedRootExecution": "selected-root execution ref",
    "runtimeTraceOrEquivalent": "runtime trace/equivalent selected-root proof",
}
NEXT_ACTION_RELATED_FAILED_GATE_IDS = {
    1: ["selectedRootExecution", "runtimeTraceOrEquivalent"],
    2: ["selectedRootExecution"],
    3: ["strictSourceHotspot", "tileHotspotConfirmation"],
    4: ["realSelector20Savedata", "selectedRootExecution"],
    5: ["strictSourceHotspot", "tileHotspotConfirmation"],
    6: ["selectedRootExecution", "runtimeTraceOrEquivalent"],
    7: ["selectedRootExecution", "runtimeTraceOrEquivalent"],
    8: ["runtimeTraceOrEquivalent", "selectedRootExecution"],
    9: ["strictSourceHotspot", "tileHotspotConfirmation"],
}
NEXT_ACTION_INPUT_CLASSES_BY_GATE = {
    "strictSourceHotspot": "strict-source-coordinate-or-hotspot-proof",
    "tileHotspotConfirmation": "tile-hotspot-confirmation-proof",
    "realSelector20Savedata": "captured-gameplay-savedata",
    "selectedRootExecution": "selected-root-execution-proof",
    "runtimeTraceOrEquivalent": "runtime-trace-or-equivalent-proof",
}


def next_input_classes_for_gates(gate_ids: list[str]) -> list[str]:
    return unique_list([
        NEXT_ACTION_INPUT_CLASSES_BY_GATE.get(gate_id, gate_id)
        for gate_id in gate_ids or []
    ])


def next_input_summary_for_classes(input_classes: list[str]) -> str:
    if not input_classes:
        return "no additional gate input classified"
    return ", ".join(input_classes)


def load_json(path: Path, fallback: Any) -> Any:
    if not path.exists():
        return fallback
    return json.loads(path.read_text(encoding="utf-8"))


def first_match(rows: list[dict], **criteria: str) -> dict:
    for row in rows:
        if all(row.get(key) == value for key, value in criteria.items()):
            return row
    return {}


def evidence_ref(path: str, *fields: str) -> dict:
    return {
        "path": path,
        "fields": list(fields),
    }


def unique_list(values: list[Any]) -> list[Any]:
    return list(dict.fromkeys(values))


def list_text(values: list[Any] | None) -> str:
    return ",".join(str(value) for value in values or []) or "-"


def predecessor_route_attempt_brief(context: dict | None) -> str:
    if not context:
        return "-"
    public_context = context.get("publicPredecessorSelectorContext") or {}
    return (
        "predecessorRouteAttempt="
        f"{context.get('sourceFileCount')}/{context.get('totalSequenceCount')}/"
        f"{context.get('totalSampleCount')} "
        f"publicFiles={context.get('publicPredecessorObservedFileCount')} "
        f"routeCurrentHits={context.get('routeSelectorHitCount')}/"
        f"{context.get('currentRootHitCount')} "
        f"dominantDiversion={context.get('dominantDiversionSelector')} "
        f"diversionContexts={context.get('diversionSelectorContextCount')}/"
        f"{context.get('fieldMapDiversionSelectorCount')}/"
        f"{context.get('resourceOnlyDiversionSelectorCount')} "
        f"routeEvidence={context.get('diversionRoutePromotionEvidenceFound')} "
        f"publicContext={public_context.get('classification')} "
        f"status={context.get('promotionStatus')}"
    )


def next_action_related_failed_gate_ids(priority: object, failed_gate_ids: list[str]) -> list[str]:
    try:
        key = int(priority)
    except (TypeError, ValueError):
        return []
    failed = set(failed_gate_ids or [])
    return [
        gate_id
        for gate_id in NEXT_ACTION_RELATED_FAILED_GATE_IDS.get(key, [])
        if not failed or gate_id in failed
    ]


def annotate_next_actions(actions: list[dict], failed_gate_ids: list[str]) -> list[dict]:
    annotated = []
    for action in actions:
        related_gate_ids = next_action_related_failed_gate_ids(
            action.get("priority"),
            failed_gate_ids,
        )
        row = dict(action)
        row["relatedFailedGateIds"] = related_gate_ids
        row["relatedMissingEvidence"] = [
            HARD_GATE_MISSING_EVIDENCE.get(gate_id, gate_id)
            for gate_id in related_gate_ids
        ]
        row["nextInputClasses"] = next_input_classes_for_gates(related_gate_ids)
        row["nextInputSummary"] = next_input_summary_for_classes(row["nextInputClasses"])
        annotated.append(row)
    return annotated


def hard_gate_checklist(
    strict_source_hotspot_context: dict | None,
    real_savedata_evidence_gap: dict | None,
    selected_root_execution_gap: dict | None,
    runtime_trace_equivalent_rejection: dict | None,
) -> list[dict]:
    strict_source_hotspot_context = strict_source_hotspot_context or {}
    real_savedata_evidence_gap = real_savedata_evidence_gap or {}
    selected_root_execution_gap = selected_root_execution_gap or {}
    runtime_trace_equivalent_rejection = runtime_trace_equivalent_rejection or {}
    strict_source_coordinate_found = bool(
        strict_source_hotspot_context.get("strictSourceCoordinateFound")
        or strict_source_hotspot_context.get("strictSourceHotspotProofFound")
    )
    tile_hotspot_confirmed = bool(strict_source_hotspot_context.get("tileHotspotConfirmed"))
    real_selector20_save_found = bool(
        real_savedata_evidence_gap.get("routePromotionRealSaveCount")
        or real_savedata_evidence_gap.get("currentSelectorRealSaveCount")
        or real_savedata_evidence_gap.get("selectedPointerRealSaveCount")
    )
    selected_root_execution_ref_found = bool(
        selected_root_execution_gap.get("selectedRootExecutionRefFound")
    )
    runtime_trace_or_equivalent_found = bool(runtime_trace_equivalent_rejection.get("proofFound"))
    return [
        {
            "id": "strictSourceHotspot",
            "passed": strict_source_coordinate_found,
            "missingEvidence": HARD_GATE_MISSING_EVIDENCE["strictSourceHotspot"],
            "evidence": (
                "strictSourceCoordinateFound="
                f"{strict_source_hotspot_context.get('strictSourceCoordinateFound')}; "
                "strictSourceHotspotProofFound="
                f"{strict_source_hotspot_context.get('strictSourceHotspotProofFound')}; "
                f"rejection={strict_source_hotspot_context.get('strictHotspotRejectionClassification')}"
            ),
        },
        {
            "id": "tileHotspotConfirmation",
            "passed": tile_hotspot_confirmed,
            "missingEvidence": HARD_GATE_MISSING_EVIDENCE["tileHotspotConfirmation"],
            "evidence": (
                f"tileHotspotConfirmed={strict_source_hotspot_context.get('tileHotspotConfirmed')}; "
                f"candidateCount={strict_source_hotspot_context.get('candidateCount')}; "
                f"rejection={strict_source_hotspot_context.get('strictHotspotRejectionClassification')}"
            ),
        },
        {
            "id": "realSelector20Savedata",
            "passed": real_selector20_save_found,
            "missingEvidence": HARD_GATE_MISSING_EVIDENCE["realSelector20Savedata"],
            "evidence": (
                "routePromotionRealSaveCount="
                f"{real_savedata_evidence_gap.get('routePromotionRealSaveCount')}; "
                "currentSelectorRealSaveCount="
                f"{real_savedata_evidence_gap.get('currentSelectorRealSaveCount')}; "
                "selectedPointerRealSaveCount="
                f"{real_savedata_evidence_gap.get('selectedPointerRealSaveCount')}; "
                "publicSearchNoteCount="
                f"{real_savedata_evidence_gap.get('publicSearchNoteCount')}; "
                "latestPublicSearchNote="
                f"{real_savedata_evidence_gap.get('latestPublicSearchNote')}; "
                f"rejection={real_savedata_evidence_gap.get('routeEvidenceRejectionClassification')}"
            ),
        },
        {
            "id": "selectedRootExecution",
            "passed": selected_root_execution_ref_found,
            "missingEvidence": HARD_GATE_MISSING_EVIDENCE["selectedRootExecution"],
            "evidence": (
                "selectedRootExecutionRefFound="
                f"{selected_root_execution_gap.get('selectedRootExecutionRefFound')}; "
                "runtimeRouteHit="
                f"{selected_root_execution_gap.get('anyRuntimePollReachedRouteSelector')}; "
                "rejection="
                f"{selected_root_execution_gap.get('selectedRootExecutionRejectionClassification')}"
            ),
        },
        {
            "id": "runtimeTraceOrEquivalent",
            "passed": runtime_trace_or_equivalent_found,
            "missingEvidence": HARD_GATE_MISSING_EVIDENCE["runtimeTraceOrEquivalent"],
            "evidence": (
                f"proofFound={runtime_trace_equivalent_rejection.get('proofFound')}; "
                "runtimeTraceCanRunNow="
                f"{runtime_trace_equivalent_rejection.get('runtimeTraceCanRunNow')}; "
                f"classification={runtime_trace_equivalent_rejection.get('classification')}"
            ),
        },
    ]


def evidence_refs_brief(refs: list[dict]) -> str:
    parts = []
    for ref in refs:
        fields = ", ".join(ref.get("fields") or [])
        parts.append(f"{ref.get('path')}: {fields}" if fields else str(ref.get("path") or "-"))
    return "; ".join(parts) or "-"


def string_histogram_brief(rows: list[dict]) -> str:
    return ",".join(f"{row.get('value')}:{row.get('count')}" for row in rows) or "-"


def related_strict_clusters(source: str, target: str, field_map_roots: dict) -> list[dict]:
    rows = []
    for cluster in field_map_roots.get("clusters") or []:
        if cluster.get("classification") != "strict event-linked cluster":
            continue
        manifest_maps = set(cluster.get("manifestMaps") or [])
        event_sources = set(cluster.get("eventSources") or [])
        event_links = set(cluster.get("eventFieldLinks") or [])
        relevance = []
        if source in manifest_maps:
            relevance.append(f"{source} scene record")
        if source in event_sources:
            relevance.append(f"{source} strict event source")
        if target in event_links:
            relevance.append(f"{target} event field link")
        if not relevance:
            continue
        role = "source-or-target-adjacent"
        if source in event_sources and target in event_links:
            role = "direct-strict-candidate"
        elif target in event_links:
            role = "target-linked-inbound"
        elif source in event_sources:
            role = "source-event-without-target"
        elif source in manifest_maps:
            role = "source-manifest-only"
        rows.append({
            "clusterStartHex": cluster.get("clusterStartHex"),
            "clusterEndHex": cluster.get("clusterEndHex"),
            "role": role,
            "relevance": relevance,
            "manifestMaps": cluster.get("manifestMaps") or [],
            "eventSources": cluster.get("eventSources") or [],
            "eventFieldLinks": cluster.get("eventFieldLinks") or [],
            "eventRecords": cluster.get("eventRecords") or [],
            "renderMismatches": [
                {
                    "map": record.get("map"),
                    "recordVaHex": record.get("recordVaHex"),
                    "recordTilesets": (record.get("render") or {}).get("recordTilesets") or record.get("tilesets") or [],
                    "acceptedTilesets": (record.get("render") or {}).get("acceptedTilesets") or [],
                }
                for record in cluster.get("manifestRecords") or []
                if (record.get("render") or {}).get("matchesAccepted") is False
            ],
        })
    return rows


def coordinate_variant_scan_for(source: str, target: str, variant_scan: dict | None) -> dict | None:
    if not variant_scan:
        return None
    if variant_scan.get("source") != source or variant_scan.get("target") != target:
        return None
    false_positive = variant_scan.get("falsePositiveSummary") or {}
    candidates = []
    for row in variant_scan.get("candidateSummaries") or []:
        tile = row.get("tile") or {}
        candidates.append({
            "side": row.get("side"),
            "tile": {"x": tile.get("x"), "y": tile.get("y")},
            "interestingHitCount": row.get("interestingHitCount"),
            "currentRootHitCount": row.get("currentRootHitCount"),
            "characterDescriptorHitCount": row.get("characterDescriptorHitCount"),
            "spanBoundHitCount": row.get("spanBoundHitCount"),
            "spanBoundCurrentRootHitCount": row.get("spanBoundCurrentRootHitCount"),
            "spanSequenceHitCount": row.get("spanSequenceHitCount"),
            "xyRowSequenceHitCount": row.get("xyRowSequenceHitCount"),
            "yxAxisSequenceHitCount": row.get("yxAxisSequenceHitCount"),
            "yxOpcodeSequenceHitCount": row.get("yxOpcodeSequenceHitCount"),
            "strictCoordinateEvidenceFound": row.get("strictCoordinateEvidenceFound"),
        })
    return {
        "candidateCount": variant_scan.get("candidateCount"),
        "strictCoordinateEvidenceFound": variant_scan.get("strictCoordinateEvidenceFound"),
        "spanBoundScanCount": variant_scan.get("spanBoundScanCount"),
        "spanSequenceScanCount": variant_scan.get("spanSequenceScanCount"),
        "spanCurrentRootHitCount": variant_scan.get("spanCurrentRootHitCount"),
        "spanSequenceHitCount": variant_scan.get("spanSequenceHitCount"),
        "spanBoundStrictCoordinateEvidenceFound": variant_scan.get("spanBoundStrictCoordinateEvidenceFound"),
        "proofFound": variant_scan.get("proofFound"),
        "exitCoordinateVariantProofFound": variant_scan.get("exitCoordinateVariantProofFound"),
        "failedExitCoordinateVariantGateIds": variant_scan.get("failedExitCoordinateVariantGateIds") or [],
        "missingEvidence": variant_scan.get("missingEvidence") or [],
        "falsePositiveVariantScanCount": false_positive.get("variantScanCount"),
        "falsePositiveSpanBoundScanCount": false_positive.get("spanBoundScanCount"),
        "falsePositiveSpanSequenceScanCount": false_positive.get("spanSequenceScanCount"),
        "targetSpawnVariantScanCount": variant_scan.get("targetSpawnVariantScanCount"),
        "targetSpawnHitCount": variant_scan.get("targetSpawnHitCount"),
        "targetSpawnInterestingHitCount": variant_scan.get("targetSpawnInterestingHitCount"),
        "targetSpawnCurrentRootHitCount": variant_scan.get("targetSpawnCurrentRootHitCount"),
        "targetSpawnCharacterDescriptorHitCount": variant_scan.get("targetSpawnCharacterDescriptorHitCount"),
        "targetSpawnCurrentRootClassificationCounts": variant_scan.get(
            "targetSpawnCurrentRootClassificationCounts"
        ),
        "targetSpawnCharacterDescriptorClassificationCounts": variant_scan.get(
            "targetSpawnCharacterDescriptorClassificationCounts"
        ),
        "targetSpawnPromotableHitCount": variant_scan.get("targetSpawnPromotableHitCount"),
        "targetSpawnInterestingPromotableHitCount": variant_scan.get(
            "targetSpawnInterestingPromotableHitCount"
        ),
        "targetSpawnAllInterestingHitsNonPromotable": variant_scan.get(
            "targetSpawnAllInterestingHitsNonPromotable"
        ),
        "targetSpawnStrictCoordinateEvidenceFound": variant_scan.get("targetSpawnStrictCoordinateEvidenceFound"),
        "falsePositiveTargetSpawnVariantScanCount": false_positive.get("targetSpawnVariantScanCount"),
        "falsePositiveTargetSpawnHitCount": false_positive.get("targetSpawnHitCount"),
        "falsePositiveTargetSpawnInterestingHitCount": false_positive.get("targetSpawnInterestingHitCount"),
        "falsePositiveTargetSpawnCurrentRootHitCount": false_positive.get("targetSpawnCurrentRootHitCount"),
        "falsePositiveTargetSpawnCharacterDescriptorHitCount": false_positive.get(
            "targetSpawnCharacterDescriptorHitCount"
        ),
        "falsePositiveTargetSpawnCurrentRootClassificationCounts": false_positive.get(
            "targetSpawnCurrentRootClassificationCounts"
        ),
        "falsePositiveTargetSpawnCharacterDescriptorClassificationCounts": false_positive.get(
            "targetSpawnCharacterDescriptorClassificationCounts"
        ),
        "falsePositiveTargetSpawnPromotableHitCount": false_positive.get(
            "targetSpawnPromotableHitCount"
        ),
        "falsePositiveTargetSpawnAllInterestingHitsNonPromotable": false_positive.get(
            "targetSpawnAllInterestingHitsNonPromotable"
        ),
        "falsePositiveTargetSpawnStrictCoordinateEvidenceFound": false_positive.get(
            "targetSpawnStrictCoordinateEvidenceFound"
        ),
        "falsePositiveLegacyRightExactXyHitCount": false_positive.get("legacyRightExactXyHitCount"),
        "falsePositiveLegacyRightExactXyCharacterDescriptorHitCount": false_positive.get(
            "legacyRightExactXyCharacterDescriptorHitCount"
        ),
        "falsePositiveLegacyRightExactYxCurrentRootHitCount": false_positive.get(
            "legacyRightExactYxCurrentRootHitCount"
        ),
        "falsePositiveLegacyRightExactYxSelectionOpcodeHitCount": false_positive.get(
            "legacyRightExactYxSelectionOpcodeHitCount"
        ),
        "falsePositiveSpanCurrentRootSelectorScriptHitCount": false_positive.get(
            "spanCurrentRootSelectorScriptHitCount"
        ),
        "falsePositiveClassification": false_positive.get("classification"),
        "promotionStatus": variant_scan.get("promotionStatus"),
        "candidates": candidates,
        "conclusion": variant_scan.get("conclusion"),
    }


def coordinate_variant_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    candidates = ", ".join(
        f"{row.get('side')} {((row.get('tile') or {}).get('x'))},{((row.get('tile') or {}).get('y'))}"
        for row in evidence.get("candidates") or []
    )
    return (
        f"{evidence.get('candidateCount')} candidates ({candidates}); "
        f"spanSeqHits={evidence.get('spanSequenceHitCount')} "
        f"spanCurrentRoot={evidence.get('spanCurrentRootHitCount')} "
        f"falsePos={evidence.get('falsePositiveLegacyRightExactXyCharacterDescriptorHitCount')}/"
        f"{evidence.get('falsePositiveLegacyRightExactYxSelectionOpcodeHitCount')}/"
        f"{evidence.get('falsePositiveSpanCurrentRootSelectorScriptHitCount')} "
        f"targetSpawn={evidence.get('targetSpawnVariantScanCount')}/"
        f"{evidence.get('targetSpawnCurrentRootHitCount')}/"
        f"{evidence.get('targetSpawnCharacterDescriptorHitCount')}/"
        f"{json.dumps(evidence.get('targetSpawnCurrentRootClassificationCounts') or {}, sort_keys=True, separators=(',', ':'))}/"
        f"{json.dumps(evidence.get('targetSpawnCharacterDescriptorClassificationCounts') or {}, sort_keys=True, separators=(',', ':'))}/"
        f"promotable={evidence.get('targetSpawnPromotableHitCount')}/"
        f"{evidence.get('targetSpawnAllInterestingHitsNonPromotable')}/"
        f"{evidence.get('targetSpawnStrictCoordinateEvidenceFound')} "
        f"strict={evidence.get('strictCoordinateEvidenceFound')} "
        f"proof={evidence.get('proofFound')} "
        f"failed={','.join(evidence.get('failedExitCoordinateVariantGateIds') or []) or '-'} "
        f"missing={len(evidence.get('missingEvidence') or [])} "
        f"promotion={evidence.get('promotionStatus')}"
    )


def map_exit_coordinate_refs_for(source: str, target: str, coordinate_refs: dict | None) -> dict | None:
    if not coordinate_refs:
        return None
    rows = [
        row for row in coordinate_refs.get("rows") or []
        if row.get("source") == source and row.get("target") == target
    ]
    candidate_rows = [
        {
            "side": row.get("side"),
            "x": row.get("x"),
            "y": row.get("y"),
            "standable": row.get("standable"),
            "classification": row.get("classification"),
            "xyHitCount": row.get("xyHitCount"),
            "promotable": row.get("promotable"),
            "promotionStatus": row.get("promotionStatus"),
        }
        for row in rows
    ]
    return {
        "promotionPolicy": coordinate_refs.get("promotionPolicy"),
        "rowCount": len(rows),
        "classifiedRowCount": len([row for row in rows if row.get("classification")]),
        "xyHitCount": sum(row.get("xyHitCount") or 0 for row in rows),
        "promotableCount": len([row for row in rows if row.get("promotable") is True]),
        "candidateRows": candidate_rows,
    }


def map_exit_coordinate_refs_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"rows={evidence.get('rowCount')} classified={evidence.get('classifiedRowCount')} "
        f"xyHits={evidence.get('xyHitCount')} promotable={evidence.get('promotableCount')} "
        f"policy={evidence.get('promotionPolicy')}"
    )


def exit_coordinate_context_for(source: str, target: str, context: dict | None) -> dict | None:
    if not context:
        return None
    if context.get("source") != source or context.get("target") != target:
        return None
    return {
        "side": context.get("side"),
        "tile": context.get("tile") or {},
        "xyPackedHex": context.get("xyPackedHex"),
        "xyHitCount": context.get("xyHitCount"),
        "xyAlignedHitCount": context.get("xyAlignedHitCount"),
        "hitVaHex": context.get("hitVaHex"),
        "hitSection": context.get("hitSection"),
        "hitDataRefCount": context.get("hitDataRefCount"),
        "hitHasTextRefs": context.get("hitHasTextRefs"),
        "ownerSelector": context.get("ownerSelector"),
        "ownerLinkedCns": context.get("ownerLinkedCns") or [],
        "classification": context.get("classification"),
        "promotable": context.get("promotable"),
        "promotionStatus": context.get("promotionStatus"),
        "remainingProofs": context.get("remainingProofs") or [],
    }


def exit_coordinate_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    tile = evidence.get("tile") or {}
    return (
        f"{evidence.get('side')} {tile.get('x')},{tile.get('y')} "
        f"xy={evidence.get('xyPackedHex')} hits={evidence.get('xyHitCount')}/"
        f"{evidence.get('xyAlignedHitCount')} hit={evidence.get('hitVaHex')} "
        f"owner={evidence.get('ownerSelector')} cns={list_text(evidence.get('ownerLinkedCns'))} "
        f"class={evidence.get('classification')} promotable={evidence.get('promotable')} "
        f"status={evidence.get('promotionStatus')}"
    )


def original_collision_route_audit_for(source: str, target: str, audit: dict | None) -> dict | None:
    if not audit:
        return None
    route = audit.get("route") or {}
    if route.get("source") != source or route.get("target") != target:
        return None
    return {
        "collisionMode": audit.get("collisionMode"),
        "routeCandidateCount": audit.get("routeCandidateCount"),
        "sourceOriginalStandableCandidateCount": audit.get("sourceOriginalStandableCandidateCount"),
        "targetOriginalStandableSpawnCount": audit.get("targetOriginalStandableSpawnCount"),
        "allSourceCandidatesOriginalStandable": audit.get("allSourceCandidatesOriginalStandable"),
        "allTargetSpawnsOriginalStandable": audit.get("allTargetSpawnsOriginalStandable"),
        "promotionAllowed": audit.get("promotionAllowed"),
        "promotionStatus": audit.get("promotionStatus"),
        "proofFound": audit.get("proofFound"),
        "originalCollisionRouteProofFound": audit.get("originalCollisionRouteProofFound"),
        "failedOriginalCollisionRouteGateIds": audit.get("failedOriginalCollisionRouteGateIds") or [],
        "missingEvidence": audit.get("missingEvidence") or [],
        "evidenceRefCount": audit.get("evidenceRefCount"),
        "missingPromotionEvidence": audit.get("missingPromotionEvidence") or [],
        "reason": audit.get("reason"),
    }


def original_collision_route_audit_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"mode={evidence.get('collisionMode')} candidates={evidence.get('routeCandidateCount')} "
        f"standable={evidence.get('sourceOriginalStandableCandidateCount')}/"
        f"{evidence.get('targetOriginalStandableSpawnCount')} "
        f"allStandable={evidence.get('allSourceCandidatesOriginalStandable')}/"
        f"{evidence.get('allTargetSpawnsOriginalStandable')} "
        f"proofFound={evidence.get('proofFound')} "
        f"gates={list_text(evidence.get('failedOriginalCollisionRouteGateIds'))} "
        f"missing={len(evidence.get('missingEvidence') or [])} "
        f"refs={evidence.get('evidenceRefCount')} "
        f"promotionAllowed={evidence.get('promotionAllowed')} status={evidence.get('promotionStatus')}"
    )


def event_shape_scan_for(source: str, target: str, event_shape_scan: dict | None) -> dict | None:
    if not event_shape_scan:
        return None
    if event_shape_scan.get("source") != source or event_shape_scan.get("target") != target:
        return None
    broad = event_shape_scan.get("allEventShapeScan") or {}
    return {
        "sourceReferenceCount": event_shape_scan.get("sourceReferenceCount"),
        "targetReferenceCount": event_shape_scan.get("targetReferenceCount"),
        "sourceEventShapeRecordCount": event_shape_scan.get("sourceEventShapeRecordCount"),
        "targetEventShapeRecordCount": event_shape_scan.get("targetEventShapeRecordCount"),
        "directStrictEventTransitionCount": event_shape_scan.get("directStrictEventTransitionCount"),
        "currentFrontierEventShapeFound": event_shape_scan.get("currentFrontierEventShapeFound"),
        "allStrictEventShapeRecordCount": broad.get("allStrictEventShapeRecordCount"),
        "allStrictEventShapesMatchExtractedEvents": broad.get("allStrictEventShapesMatchExtractedEvents"),
        "relaxedNonStrictSmallEventRecordCount": broad.get("relaxedNonStrictSmallEventRecordCount"),
        "relaxedNonStrictMapCount": broad.get("relaxedNonStrictMapCount"),
        "relaxedRowsTouchingSourceOrTargetCount": broad.get("relaxedRowsTouchingSourceOrTargetCount"),
        "promotionStatus": event_shape_scan.get("promotionStatus"),
    }


def event_shape_scan_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"refs={evidence.get('sourceReferenceCount')}/{evidence.get('targetReferenceCount')} "
        f"strictSourceTarget={evidence.get('sourceEventShapeRecordCount')}/"
        f"{evidence.get('targetEventShapeRecordCount')} "
        f"directStrict={evidence.get('directStrictEventTransitionCount')} "
        f"frontierShape={evidence.get('currentFrontierEventShapeFound')} "
        f"allStrict={evidence.get('allStrictEventShapeRecordCount')} "
        f"relaxed={evidence.get('relaxedNonStrictSmallEventRecordCount')} "
        f"relaxedMaps={evidence.get('relaxedNonStrictMapCount')} "
        f"relaxedSourceTarget={evidence.get('relaxedRowsTouchingSourceOrTargetCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def gate_base_proof_for(source: str, target: str, gate_base_proof: dict | None) -> dict | None:
    if not gate_base_proof:
        return None
    if gate_base_proof.get("source") != source or gate_base_proof.get("target") != target:
        return None
    gate_window_rows = gate_base_proof.get("gateWindowRows") or []
    local_base_rows = gate_base_proof.get("localBaseAffectingRowsBeforeGate") or []
    remaining_proofs = gate_base_proof.get("remainingProofs") or []
    return {
        "gateWindowRowCount": len(gate_window_rows),
        "gateWindowRows": gate_window_rows,
        "proofFound": gate_base_proof.get("proofFound"),
        "gateBaseProofFound": gate_base_proof.get("gateBaseProofFound"),
        "activeOrderProofFound": gate_base_proof.get("activeOrderProofFound"),
        "gateTimeBaseProofFound": gate_base_proof.get("gateTimeBaseProofFound"),
        "predecessorPersistenceProofFound": gate_base_proof.get("predecessorPersistenceProofFound"),
        "strictHotspotProofFound": gate_base_proof.get("strictHotspotProofFound"),
        "failedGateBaseGateIds": gate_base_proof.get("failedGateBaseGateIds") or [],
        "missingEvidence": gate_base_proof.get("missingEvidence") or [],
        "localBaseAffectingRowCount": gate_base_proof.get("localBaseAffectingRowCount"),
        "localBaseAffectingRowDetailCount": len(local_base_rows),
        "localBaseAffectingRowsBeforeGate": local_base_rows,
        "gateWindowOnlyOpcode20BaseCandidate": gate_base_proof.get("gateWindowOnlyOpcode20BaseCandidate"),
        "gateWindowBaseSetterCandidateCount": gate_base_proof.get("gateWindowBaseSetterCandidateCount"),
        "descriptorScript4FieldRecordCount": gate_base_proof.get("descriptorScript4FieldRecordCount"),
        "descriptorScript4CurrentFrontierDirectRefCount": gate_base_proof.get("descriptorScript4CurrentFrontierDirectRefCount"),
        "descriptorScript4EncodedTargetClassification": gate_base_proof.get(
            "descriptorScript4EncodedTargetClassification"
        ),
        "descriptorScript4EncodedTargetRawScalarCandidateCount": gate_base_proof.get(
            "descriptorScript4EncodedTargetRawScalarCandidateCount"
        ),
        "descriptorScript4EncodedTargetRouteProofRawScalarCandidateCount": gate_base_proof.get(
            "descriptorScript4EncodedTargetRouteProofRawScalarCandidateCount"
        ),
        "descriptorScript4EncodedTargetPromotingCandidateCount": gate_base_proof.get(
            "descriptorScript4EncodedTargetPromotingCandidateCount"
        ),
        "descriptorScript4GateWriterCount": gate_base_proof.get("descriptorScript4GateWriterCount"),
        "descriptorScript4GateReaderCount": gate_base_proof.get("descriptorScript4GateReaderCount"),
        "descriptorAllScriptEncodedTargetClassification": gate_base_proof.get(
            "descriptorAllScriptEncodedTargetClassification"
        ),
        "descriptorAllScriptEncodedTargetRawScalarCandidateCount": gate_base_proof.get(
            "descriptorAllScriptEncodedTargetRawScalarCandidateCount"
        ),
        "descriptorAllScriptEncodedTargetRouteProofRawScalarCandidateCount": gate_base_proof.get(
            "descriptorAllScriptEncodedTargetRouteProofRawScalarCandidateCount"
        ),
        "descriptorAllScriptEncodedTargetPromotingCandidateCount": gate_base_proof.get(
            "descriptorAllScriptEncodedTargetPromotingCandidateCount"
        ),
        "descriptorAllScriptGateWriterCount": gate_base_proof.get("descriptorAllScriptGateWriterCount"),
        "descriptorAllScriptGateReaderCount": gate_base_proof.get("descriptorAllScriptGateReaderCount"),
        "descriptorAllScriptSelectionOpcodeCount": gate_base_proof.get("descriptorAllScriptSelectionOpcodeCount"),
        "descriptorAllScriptSpecificGateBaseProven": gate_base_proof.get("descriptorAllScriptSpecificGateBaseProven"),
        "activeOrderAloneSufficientForGateProof": gate_base_proof.get("activeOrderAloneSufficientForGateProof"),
        "activeOrderOnlyProofEliminated": gate_base_proof.get("activeOrderOnlyProofEliminated"),
        "diagnosticActiveOrderEvidence": gate_base_proof.get("diagnosticActiveOrderEvidence") or {},
        "diagnosticActiveOrderRecheckEvidence": (
            gate_base_proof.get("diagnosticActiveOrderRecheckEvidence") or {}
        ),
        "publicPredecessorActiveOrderEvidence": gate_base_proof.get("publicPredecessorActiveOrderEvidence") or {},
        "publicPredecessorLeftOverrunActiveOrderEvidence": (
            gate_base_proof.get("publicPredecessorLeftOverrunActiveOrderEvidence") or {}
        ),
        "gateOffsetSourceProofFound": gate_base_proof.get("gateOffsetSourceProofFound"),
        "gateOffsetSourceEvidenceRefCount": gate_base_proof.get("gateOffsetSourceEvidenceRefCount"),
        "gateOffsetPatternProofFound": gate_base_proof.get("gateOffsetPatternProofFound"),
        "gateOffsetPatternEvidenceRefCount": gate_base_proof.get("gateOffsetPatternEvidenceRefCount"),
        "gateBaseCandidateProofFound": gate_base_proof.get("gateBaseCandidateProofFound"),
        "gateBaseCandidateEvidenceRefCount": gate_base_proof.get("gateBaseCandidateEvidenceRefCount"),
        "gateSampleValueProofFound": gate_base_proof.get("gateSampleValueProofFound"),
        "gateSampleValueEvidenceRefCount": gate_base_proof.get("gateSampleValueEvidenceRefCount"),
        "selectionBufferBaseProofFound": gate_base_proof.get("selectionBufferBaseProofFound"),
        "selectionBufferBaseEvidenceRefCount": gate_base_proof.get("selectionBufferBaseEvidenceRefCount"),
        "opcode20ObjectBaseProofFound": gate_base_proof.get("opcode20ObjectBaseProofFound"),
        "opcode20ObjectBaseEvidenceRefCount": gate_base_proof.get("opcode20ObjectBaseEvidenceRefCount"),
        "opcode20OrderSpaceProofFound": gate_base_proof.get("opcode20OrderSpaceProofFound"),
        "opcode20OrderSpaceEvidenceRefCount": gate_base_proof.get("opcode20OrderSpaceEvidenceRefCount"),
        "opcode20SlotSourceProofFound": gate_base_proof.get("opcode20SlotSourceProofFound"),
        "opcode20SlotSourceEvidenceRefCount": gate_base_proof.get("opcode20SlotSourceEvidenceRefCount"),
        "opcode20DescriptorWriterProofFound": gate_base_proof.get("opcode20DescriptorWriterProofFound"),
        "opcode20DescriptorWriterEvidenceRefCount": gate_base_proof.get("opcode20DescriptorWriterEvidenceRefCount"),
        "opcode20RuntimeMaterializerProofFound": gate_base_proof.get("opcode20RuntimeMaterializerProofFound"),
        "opcode20RuntimeMaterializerEvidenceRefCount": gate_base_proof.get(
            "opcode20RuntimeMaterializerEvidenceRefCount"
        ),
        "opcode20RuntimeMaterializerSelfMutationPathEliminated": gate_base_proof.get(
            "opcode20RuntimeMaterializerSelfMutationPathEliminated"
        ),
        "opcode20RuntimeMaterializerCurrentFrontierActiveOrderProven": gate_base_proof.get(
            "opcode20RuntimeMaterializerCurrentFrontierActiveOrderProven"
        ),
        "sampleCurrentFrontierCovered": gate_base_proof.get("sampleCurrentFrontierCovered"),
        "promotionStatus": gate_base_proof.get("promotionStatus"),
        "remainingProofCount": len(remaining_proofs),
        "remainingProofs": remaining_proofs,
        "evidenceRefs": gate_base_proof.get("evidenceRefs") or [],
        "evidenceRefCount": gate_base_proof.get("evidenceRefCount"),
        "conclusion": gate_base_proof.get("conclusion"),
    }


def gate_base_proof_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    diagnostic = evidence.get("diagnosticActiveOrderEvidence") or {}
    diagnostic_recheck = evidence.get("diagnosticActiveOrderRecheckEvidence") or {}
    public_predecessor = evidence.get("publicPredecessorActiveOrderEvidence") or {}
    public_predecessor_left = evidence.get("publicPredecessorLeftOverrunActiveOrderEvidence") or {}
    return (
        f"gateWindowRows={evidence.get('gateWindowRowCount')} "
        f"localBaseRows={evidence.get('localBaseAffectingRowDetailCount')} "
        f"remainingProofs={evidence.get('remainingProofCount')} "
        f"proofFound={evidence.get('proofFound')} "
        f"failedGateBaseGates={','.join(evidence.get('failedGateBaseGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"windowOnlyOpcode20={evidence.get('gateWindowOnlyOpcode20BaseCandidate')} "
        f"activeOrderAlone={evidence.get('activeOrderAloneSufficientForGateProof')} "
        f"descriptorRefs={evidence.get('descriptorScript4FieldRecordCount')}/"
        f"{evidence.get('descriptorScript4CurrentFrontierDirectRefCount')} "
        f"descriptorEncoded={evidence.get('descriptorScript4EncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('descriptorScript4EncodedTargetRouteProofRawScalarCandidateCount')}/"
        f"{evidence.get('descriptorScript4EncodedTargetPromotingCandidateCount')} "
        f"descriptorEncodedClass={evidence.get('descriptorScript4EncodedTargetClassification')} "
        f"gateRows={evidence.get('descriptorScript4GateWriterCount')}/"
        f"{evidence.get('descriptorScript4GateReaderCount')} "
        f"allDescriptorEncoded={evidence.get('descriptorAllScriptEncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('descriptorAllScriptEncodedTargetRouteProofRawScalarCandidateCount')}/"
        f"{evidence.get('descriptorAllScriptEncodedTargetPromotingCandidateCount')} "
        f"allDescriptorEncodedClass={evidence.get('descriptorAllScriptEncodedTargetClassification')} "
        f"allGateRows={evidence.get('descriptorAllScriptGateWriterCount')}/"
        f"{evidence.get('descriptorAllScriptGateReaderCount')} "
        f"allSelectionRows={evidence.get('descriptorAllScriptSelectionOpcodeCount')} "
        f"allSpecificBase={evidence.get('descriptorAllScriptSpecificGateBaseProven')} "
        f"diagnosticOrder={diagnostic.get('activeOrderCountHex')}/"
        f"{','.join(diagnostic.get('activeOrderHexes') or []) or '-'} "
        f"diagnosticDescriptor={diagnostic.get('firstDescriptorHex')} "
        f"diagnosticGateBaseProven={diagnostic.get('gateBaseProven')} "
        "diagnosticRecheck="
        f"{diagnostic_recheck.get('routeSelectorHitCount')}/"
        f"{diagnostic_recheck.get('recheckRouteSelectorHitCount')}/"
        f"{diagnostic_recheck.get('activeOrderRecheckRouteSelectorHitCount')} "
        f"diagnosticRecheckCount={diagnostic_recheck.get('activeOrderRecheckActiveOrderCountValues')} "
        f"diagnosticRecheckBaseStillOpen={diagnostic_recheck.get('gateBaseStillUnproven')} "
        f"publicPredOrder={public_predecessor.get('activeOrderCountHex')}/"
        f"{','.join(public_predecessor.get('activeOrderHexes') or []) or '-'} "
        f"publicPredDescriptor={public_predecessor.get('firstDescriptorHex')} "
        f"publicPredSamples={public_predecessor.get('sampleCount')}/"
        f"{public_predecessor.get('totalSampleCount')} "
        f"publicPredRoute={not public_predecessor.get('notRouteProof') if public_predecessor.get('available') else False} "
        f"publicPredGateBaseProven={public_predecessor.get('gateBaseProven')} "
        f"publicPredLeftSamples={public_predecessor_left.get('sampleCount')}/"
        f"{public_predecessor_left.get('totalSampleCount')} "
        f"publicPredLeftRoute={not public_predecessor_left.get('notRouteProof') if public_predecessor_left.get('available') else False} "
        f"publicPredLeftGateBaseProven={public_predecessor_left.get('gateBaseProven')} "
        "supportProofs="
        f"{evidence.get('gateOffsetSourceProofFound')}/"
        f"{evidence.get('gateOffsetPatternProofFound')}/"
        f"{evidence.get('gateBaseCandidateProofFound')}/"
        f"{evidence.get('gateSampleValueProofFound')}/"
        f"{evidence.get('selectionBufferBaseProofFound')}/"
        f"{evidence.get('opcode20ObjectBaseProofFound')}/"
        f"{evidence.get('opcode20OrderSpaceProofFound')}/"
        f"{evidence.get('opcode20SlotSourceProofFound')}/"
        f"{evidence.get('opcode20DescriptorWriterProofFound')}/"
        f"{evidence.get('opcode20RuntimeMaterializerProofFound')} "
        f"materializerSelfMutationEliminated={evidence.get('opcode20RuntimeMaterializerSelfMutationPathEliminated')} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"sampleCovered={evidence.get('sampleCurrentFrontierCovered')}"
    )


def opcode20_object_base_for(source: str, target: str, object_base: dict | None) -> dict | None:
    if not object_base:
        return None
    if object_base.get("source") != source or object_base.get("target") != target:
        return None
    return {
        "candidateCount": object_base.get("candidateCount"),
        "descriptorCountWithCandidates": object_base.get("descriptorCountWithCandidates"),
        "contextF2ObjectSelectorCount": object_base.get("contextF2ObjectSelectorCount"),
        "immediateObjectIndexCandidateCount": object_base.get("immediateObjectIndexCandidateCount"),
        "gateSelectionRowsAfterCandidateCount": object_base.get("gateSelectionRowsAfterCandidateCount"),
        "fieldMapRowsAfterCandidateCount": object_base.get("fieldMapRowsAfterCandidateCount"),
        "currentFrontierRowsAfterCandidateCount": object_base.get("currentFrontierRowsAfterCandidateCount"),
        "runtimeObjectPointerProofRequired": object_base.get("runtimeObjectPointerProofRequired"),
        "promotionStatus": object_base.get("promotionStatus"),
        "conclusion": object_base.get("conclusion"),
    }


def opcode20_object_base_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"objectBaseCandidates={evidence.get('candidateCount')} "
        f"contextF2={evidence.get('contextF2ObjectSelectorCount')} "
        f"fixedStream2={evidence.get('immediateObjectIndexCandidateCount')} "
        f"gateRowsAfter={evidence.get('gateSelectionRowsAfterCandidateCount')} "
        f"fieldMapsAfter={evidence.get('fieldMapRowsAfterCandidateCount')} "
        f"frontierRefsAfter={evidence.get('currentFrontierRowsAfterCandidateCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def opcode20_order_space_for(source: str, target: str, order_space: dict | None) -> dict | None:
    if not order_space:
        return None
    if order_space.get("source") != source or order_space.get("target") != target:
        return None
    unique = order_space.get("uniqueOrderSpace") or {}
    repeat = order_space.get("repeatAllowedOrderSpace") or {}
    return {
        "descriptorRowCount": order_space.get("descriptorRowCount"),
        "slotCapacity": order_space.get("slotCapacity"),
        "uniqueOrderCount": unique.get("orderCount"),
        "repeatAllowedOrderCount": repeat.get("orderCount"),
        "uniqueDirectProofOrderCount": unique.get("directProofOrderCount"),
        "repeatAllowedDirectProofOrderCount": repeat.get("directProofOrderCount"),
        "uniqueNonPointerContextOrderCount": unique.get("nonPointerContextOrderCount"),
        "repeatAllowedNonPointerContextOrderCount": repeat.get("nonPointerContextOrderCount"),
        "currentFrontierSampleCovered": order_space.get("currentFrontierSampleCovered"),
        "activeOrderAlonePromotesRoute": order_space.get("activeOrderAlonePromotesRoute"),
        "runtimeDescriptorObjectStateRequired": order_space.get("runtimeDescriptorObjectStateRequired"),
        "promotionStatus": order_space.get("promotionStatus"),
        "conclusion": order_space.get("conclusion"),
    }


def opcode20_order_space_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"orders={evidence.get('uniqueOrderCount')}/{evidence.get('repeatAllowedOrderCount')} "
        f"directProof={evidence.get('uniqueDirectProofOrderCount')}/"
        f"{evidence.get('repeatAllowedDirectProofOrderCount')} "
        f"nonPointerContext={evidence.get('uniqueNonPointerContextOrderCount')} "
        f"sampleCovered={evidence.get('currentFrontierSampleCovered')} "
        f"activeOrderPromotes={evidence.get('activeOrderAlonePromotesRoute')}"
    )


def opcode20_context_f2_for(source: str, target: str, context_f2: dict | None) -> dict | None:
    if not context_f2:
        return None
    if context_f2.get("source") != source or context_f2.get("target") != target:
        return None
    diagnostic = context_f2.get("diagnosticRuntimeObjectTableEvidence") or {}
    return {
        "referenceCount": context_f2.get("referenceCount"),
        "readReferenceCount": context_f2.get("readReferenceCount"),
        "writeReferenceCount": context_f2.get("writeReferenceCount"),
        "runtimeObjectTableReaderCount": context_f2.get("runtimeObjectTableReaderCount"),
        "directInitializerCount": context_f2.get("directInitializerCount"),
        "copyWriterCount": context_f2.get("copyWriterCount"),
        "constantWriteCount": context_f2.get("constantWriteCount"),
        "contextF2ObjectSelectorCount": context_f2.get("contextF2ObjectSelectorCount"),
        "fixedStream2ObjectSelectorCount": context_f2.get("fixedStream2ObjectSelectorCount"),
        "currentFrontierSampleCovered": context_f2.get("currentFrontierSampleCovered"),
        "specificRuntimeObjectPointerProven": context_f2.get("specificRuntimeObjectPointerProven"),
        "runtimeObjectTableStateRequired": context_f2.get("runtimeObjectTableStateRequired"),
        "diagnosticObjectTableAvailable": diagnostic.get("available"),
        "diagnosticObjectTableRouteSampleCount": diagnostic.get("routeSampleCount"),
        "diagnosticObjectTableTotalSampleCount": diagnostic.get("totalSampleCount"),
        "diagnosticActiveOrderCountHex": diagnostic.get("activeOrderCountHex"),
        "diagnosticActiveOrderHexes": diagnostic.get("activeOrderHexes") or [],
        "diagnosticSlotBaseTableStaticHexes": diagnostic.get("runtimeSlotBaseTableStaticHexes") or [],
        "diagnosticObjectTableStaticHexes": diagnostic.get("runtimeObjectTableStaticHexes") or [],
        "diagnosticObjectTablePromotionStatus": diagnostic.get("promotionStatus"),
        "promotionStatus": context_f2.get("promotionStatus"),
        "conclusion": context_f2.get("conclusion"),
    }


def opcode20_context_f2_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    diagnostic_object_statics = "/".join(
        value for value in evidence.get("diagnosticObjectTableStaticHexes") or [] if value
    ) or "-"
    diagnostic_slot_base_statics = "/".join(
        value for value in evidence.get("diagnosticSlotBaseTableStaticHexes") or [] if value
    ) or "-"
    diagnostic_active_order = "/".join(
        value for value in evidence.get("diagnosticActiveOrderHexes") or [] if value
    ) or "-"
    return (
        f"contextF2Refs={evidence.get('referenceCount')} "
        f"rw={evidence.get('readReferenceCount')}/{evidence.get('writeReferenceCount')} "
        f"objectReaders={evidence.get('runtimeObjectTableReaderCount')} "
        f"init={evidence.get('directInitializerCount')} "
        f"copies={evidence.get('copyWriterCount')} "
        f"constWrites={evidence.get('constantWriteCount')} "
        f"selectors={evidence.get('contextF2ObjectSelectorCount')}/"
        f"{evidence.get('fixedStream2ObjectSelectorCount')} "
        f"sampleCovered={evidence.get('currentFrontierSampleCovered')} "
        f"pointerProven={evidence.get('specificRuntimeObjectPointerProven')} "
        f"diagRouteSamples={evidence.get('diagnosticObjectTableRouteSampleCount')} "
        f"diagTotalSamples={evidence.get('diagnosticObjectTableTotalSampleCount')} "
        f"diagActiveOrder={evidence.get('diagnosticActiveOrderCountHex')}/{diagnostic_active_order} "
        f"diagSlotBaseStatic={diagnostic_slot_base_statics} "
        f"diagObjectStatic={diagnostic_object_statics} "
        f"diagStatus={evidence.get('diagnosticObjectTablePromotionStatus')}"
    )


def opcode20_slot_sources_for(source: str, target: str, slot_sources: dict | None) -> dict | None:
    if not slot_sources:
        return None
    if slot_sources.get("source") != source or slot_sources.get("target") != target:
        return None
    count_source = slot_sources.get("countSaveSource") or {}
    slot_source = slot_sources.get("slotSaveSource") or {}
    return {
        "currentOpcode20VaHex": slot_sources.get("currentOpcode20VaHex"),
        "currentModeHex": slot_sources.get("currentModeHex"),
        "countRuntimeVaHex": slot_sources.get("countRuntimeVaHex"),
        "countSaveOffsetHex": count_source.get("saveOffsetHex"),
        "slotBaseHex": slot_sources.get("slotBaseHex"),
        "slotSaveOffsetHex": slot_source.get("saveOffsetHex"),
        "loadedCompleteSlotCapacity": slot_sources.get("loadedCompleteSlotCapacity"),
        "slotStrideHex": slot_sources.get("slotStrideHex"),
        "staticFirstDwordNonzeroCount": slot_sources.get("staticFirstDwordNonzeroCount"),
        "runtimeSlotCountRequired": slot_sources.get("runtimeSlotCountRequired"),
        "runtimeSlotDescriptorPointersRequired": slot_sources.get("runtimeSlotDescriptorPointersRequired"),
        "promotionStatus": slot_sources.get("promotionStatus"),
        "conclusion": slot_sources.get("conclusion"),
    }


def opcode20_slot_sources_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"op20={evidence.get('currentOpcode20VaHex')} "
        f"mode={evidence.get('currentModeHex')} "
        f"count={evidence.get('countRuntimeVaHex')}@save{evidence.get('countSaveOffsetHex')} "
        f"slots={evidence.get('slotBaseHex')}@save{evidence.get('slotSaveOffsetHex')} "
        f"capacity={evidence.get('loadedCompleteSlotCapacity')} "
        f"stride={evidence.get('slotStrideHex')} "
        f"staticNonzero={evidence.get('staticFirstDwordNonzeroCount')} "
        f"runtimeCount={evidence.get('runtimeSlotCountRequired')} "
        f"runtimePtrs={evidence.get('runtimeSlotDescriptorPointersRequired')} "
        f"status={evidence.get('promotionStatus')}"
    )


def opcode20_slot_descriptor_writers_for(source: str, target: str, writers: dict | None) -> dict | None:
    if not writers:
        return None
    if writers.get("source") != source or writers.get("target") != target:
        return None
    return {
        "slotBaseHex": writers.get("slotBaseHex"),
        "slotStrideHex": writers.get("slotStrideHex"),
        "countRuntimeVaHex": writers.get("countRuntimeVaHex"),
        "orderBytesVaHex": writers.get("orderBytesVaHex"),
        "descriptorTableVaHex": writers.get("descriptorTableVaHex"),
        "descriptorWriteCount": writers.get("descriptorWriteCount"),
        "slotFirstDwordSource": writers.get("slotFirstDwordSource"),
        "opcode20Mode0ScriptSource": writers.get("opcode20Mode0ScriptSource"),
        "runtimeActiveOrderRequired": writers.get("runtimeActiveOrderRequired"),
        "promotionStatus": writers.get("promotionStatus"),
        "conclusion": writers.get("conclusion"),
    }


def opcode20_slot_descriptor_writers_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"descriptorTable={evidence.get('descriptorTableVaHex')} "
        f"slotBase={evidence.get('slotBaseHex')} "
        f"stride={evidence.get('slotStrideHex')} "
        f"count={evidence.get('countRuntimeVaHex')} "
        f"order={evidence.get('orderBytesVaHex')} "
        f"writes={evidence.get('descriptorWriteCount')} "
        f"firstDword={evidence.get('slotFirstDwordSource')} "
        f"mode0Source={evidence.get('opcode20Mode0ScriptSource')} "
        f"runtimeOrder={evidence.get('runtimeActiveOrderRequired')} "
        f"status={evidence.get('promotionStatus')}"
    )


def opcode20_descriptor_scripts_for(source: str, target: str, scripts: dict | None) -> dict | None:
    if not scripts:
        return None
    if scripts.get("source") != source or scripts.get("target") != target:
        return None
    script_slot_aggregate_rows = scripts.get("scriptSlotAggregateRows") or []
    return {
        "descriptorRowCount": scripts.get("descriptorRowCount"),
        "scriptSlotAggregateRowCount": len(script_slot_aggregate_rows),
        "scriptSlotAggregateRows": script_slot_aggregate_rows,
        "script4FieldRecordCount": scripts.get("script4FieldRecordCount"),
        "script4CurrentFrontierDirectRefCount": scripts.get("script4CurrentFrontierDirectRefCount"),
        "script4EncodedTargetClassification": scripts.get("script4EncodedTargetClassification"),
        "script4EncodedTargetRawScalarCandidateCount": scripts.get("script4EncodedTargetRawScalarCandidateCount"),
        "script4EncodedTargetRouteProofRawScalarCandidateCount": scripts.get(
            "script4EncodedTargetRouteProofRawScalarCandidateCount"
        ),
        "script4EncodedTargetPromotingCandidateCount": scripts.get("script4EncodedTargetPromotingCandidateCount"),
        "script4GateReaderCount": scripts.get("script4GateReaderCount"),
        "script4GateWriterCount": scripts.get("script4GateWriterCount"),
        "script4SelectionOpcodeCount": scripts.get("script4SelectionOpcodeCount"),
        "script4ContextA8NonPointerOperandSourceHistogram": scripts.get(
            "script4ContextA8NonPointerOperandSourceHistogram"
        ),
        "allScriptGateReaderCount": scripts.get("allScriptGateReaderCount"),
        "allScriptGateWriterCount": scripts.get("allScriptGateWriterCount"),
        "allScriptSelectionOpcodeCount": scripts.get("allScriptSelectionOpcodeCount"),
        "allScriptEncodedTargetClassification": scripts.get("allScriptEncodedTargetClassification"),
        "allScriptEncodedTargetRawScalarCandidateCount": scripts.get("allScriptEncodedTargetRawScalarCandidateCount"),
        "allScriptEncodedTargetRouteProofRawScalarCandidateCount": scripts.get(
            "allScriptEncodedTargetRouteProofRawScalarCandidateCount"
        ),
        "allScriptEncodedTargetPromotingCandidateCount": scripts.get("allScriptEncodedTargetPromotingCandidateCount"),
        "script4SpecificGateBaseProven": scripts.get("script4SpecificGateBaseProven"),
        "allScriptsSpecificGateBaseProven": scripts.get("allScriptsSpecificGateBaseProven"),
        "runtimeActiveOrderRequired": scripts.get("runtimeActiveOrderRequired"),
        "promotionStatus": scripts.get("promotionStatus"),
        "conclusion": scripts.get("conclusion"),
    }


def opcode20_descriptor_scripts_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"descriptors={evidence.get('descriptorRowCount')} "
        f"slotRows={evidence.get('scriptSlotAggregateRowCount')} "
        f"field={evidence.get('script4FieldRecordCount')} "
        f"frontierRefs={evidence.get('script4CurrentFrontierDirectRefCount')} "
        f"encoded={evidence.get('script4EncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('script4EncodedTargetRouteProofRawScalarCandidateCount')}/"
        f"{evidence.get('script4EncodedTargetPromotingCandidateCount')} "
        f"encodedClass={evidence.get('script4EncodedTargetClassification')} "
        f"gateRw={evidence.get('script4GateReaderCount')}/{evidence.get('script4GateWriterCount')} "
        f"selectionRows={evidence.get('script4SelectionOpcodeCount')} "
        f"nonPointerSource={string_histogram_brief(evidence.get('script4ContextA8NonPointerOperandSourceHistogram') or [])} "
        f"allEncoded={evidence.get('allScriptEncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('allScriptEncodedTargetRouteProofRawScalarCandidateCount')}/"
        f"{evidence.get('allScriptEncodedTargetPromotingCandidateCount')} "
        f"allEncodedClass={evidence.get('allScriptEncodedTargetClassification')} "
        f"allGateRw={evidence.get('allScriptGateReaderCount')}/{evidence.get('allScriptGateWriterCount')} "
        f"allSelectionRows={evidence.get('allScriptSelectionOpcodeCount')} "
        f"specificBase={evidence.get('script4SpecificGateBaseProven')} "
        f"allSpecificBase={evidence.get('allScriptsSpecificGateBaseProven')} "
        f"runtimeOrder={evidence.get('runtimeActiveOrderRequired')} "
        f"status={evidence.get('promotionStatus')}"
    )


def opcode20_sample_order_for(source: str, target: str, sample_order: dict | None) -> dict | None:
    if not sample_order:
        return None
    if sample_order.get("source") != source or sample_order.get("target") != target:
        return None
    histogram = sample_order.get("sampleFinalNonPointerContextA8BaseHistogram") or []
    return {
        "sampleCount": sample_order.get("sampleCount"),
        "currentFrontierSelector": sample_order.get("currentFrontierSelector"),
        "currentFrontierSampleCovered": sample_order.get("currentFrontierSampleCovered"),
        "uniqueSampleStateCount": sample_order.get("uniqueSampleStateCount"),
        "uniqueSampleSignatures": sample_order.get("uniqueSampleSignatures") or [],
        "finalNonPointerBaseHistogram": histogram,
        "controlPathProofStatus": sample_order.get("controlPathProofStatus"),
        "promotionStatus": sample_order.get("promotionStatus"),
        "conclusion": sample_order.get("conclusion"),
    }


def opcode20_sample_order_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    signatures = ";".join(evidence.get("uniqueSampleSignatures") or [])
    non_pointer = ",".join(
        f"{row.get('value')}:{row.get('count')}"
        for row in evidence.get("finalNonPointerBaseHistogram") or []
    )
    return (
        f"samples={evidence.get('sampleCount')} "
        f"states={evidence.get('uniqueSampleStateCount')} "
        f"current={evidence.get('currentFrontierSelector')} "
        f"covered={evidence.get('currentFrontierSampleCovered')} "
        f"signatures={signatures or '-'} "
        f"nonPointerBases={non_pointer or '-'} "
        f"status={evidence.get('promotionStatus')}"
    )


def opcode20_runtime_materializers_for(source: str, target: str, materializers: dict | None) -> dict | None:
    if not materializers:
        return None
    if materializers.get("source") != source or materializers.get("target") != target:
        return None
    load = materializers.get("loadRebuildEvidence") or {}
    materializer_rows = materializers.get("materializers") or []
    current_route_same_low_byte_rows = materializers.get("currentRouteSameLowByteRows") or []
    descriptor_script_mutation_rows = materializers.get("descriptorScriptMutationRows") or []
    return {
        "currentFrontierSelector": materializers.get("currentFrontierSelector"),
        "currentFrontierActiveOrderProven": materializers.get("currentFrontierActiveOrderProven"),
        "opcode20SelfMutationPathEliminated": materializers.get("opcode20SelfMutationPathEliminated"),
        "currentRouteGeneralMutationEvidenceCount": materializers.get("currentRouteGeneralMutationEvidenceCount"),
        "currentRouteSameLowByteRowCount": materializers.get("currentRouteSameLowByteRowCount"),
        "currentRouteSameLowByteRows": current_route_same_low_byte_rows,
        "descriptorScriptMutationRowCount": materializers.get("descriptorScriptMutationRowCount"),
        "descriptorScriptMutationRows": descriptor_script_mutation_rows,
        "materializerRowCount": len(materializer_rows),
        "materializers": materializer_rows,
        "loadRebuildEvidence": load,
        "loadRebuildCallHex": load.get("rebuildCallVaHex"),
        "loadRebuildFunctionHex": load.get("rebuildFunctionVaHex"),
        "loadRebuildAfterSaveReadBlocks": load.get("rebuildAfterSaveReadBlocks"),
        "loadRebuildBeforeSelectorPointerSelection": load.get("rebuildBeforeSelectorPointerSelection"),
        "controlPathProofStatus": materializers.get("controlPathProofStatus"),
        "promotionStatus": materializers.get("promotionStatus"),
        "conclusion": materializers.get("conclusion"),
    }


def opcode20_runtime_materializers_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"current={evidence.get('currentFrontierSelector')} "
        f"activeOrderProven={evidence.get('currentFrontierActiveOrderProven')} "
        f"selfMutationEliminated={evidence.get('opcode20SelfMutationPathEliminated')} "
        f"routeMutations={evidence.get('currentRouteGeneralMutationEvidenceCount')} "
        f"sameLowByte={evidence.get('currentRouteSameLowByteRowCount')} "
        f"descriptorMutations={evidence.get('descriptorScriptMutationRowCount')} "
        f"materializers={evidence.get('materializerRowCount')} "
        f"loadRebuild={evidence.get('loadRebuildCallHex')}->{evidence.get('loadRebuildFunctionHex')} "
        f"afterReads={evidence.get('loadRebuildAfterSaveReadBlocks')} "
        f"beforeSelect={evidence.get('loadRebuildBeforeSelectorPointerSelection')} "
        f"status={evidence.get('promotionStatus')}"
    )


def opcode20_nested_base_modes_for(source: str, target: str, nested_modes: dict | None) -> dict | None:
    if not nested_modes:
        return None
    if nested_modes.get("source") != source or nested_modes.get("target") != target:
        return None
    nested_runner = nested_modes.get("nestedRunner") or {}
    current_mode = nested_modes.get("currentModeRow") or {}
    return {
        "currentWriterVaHex": nested_modes.get("currentWriterVaHex"),
        "currentOpcode20VaHex": nested_modes.get("currentOpcode20VaHex"),
        "currentOpcode20ValueHex": nested_modes.get("currentOpcode20ValueHex"),
        "currentMode": nested_modes.get("currentMode"),
        "currentModeHex": nested_modes.get("currentModeHex"),
        "currentModeIsNestedObjectPlus4": nested_modes.get("currentModeIsNestedObjectPlus4"),
        "currentModeSlotCountSourceHex": current_mode.get("slotCountSourceHex"),
        "currentModeSlotBaseExpression": current_mode.get("slotBaseExpression"),
        "currentModeNestedStreamExpression": current_mode.get("nestedStreamExpression"),
        "saveSelectorOpcode20HandlerVaHex": nested_modes.get("saveSelectorOpcode20HandlerVaHex"),
        "saveSelectorOpcode20HandlerMatchesExpected": nested_modes.get("saveSelectorOpcode20HandlerMatchesExpected"),
        "nestedRunnerVaHex": nested_runner.get("nestedRunnerVaHex"),
        "nestedDispatcherVaHex": nested_runner.get("nestedDispatcherVaHex"),
        "nestedHandlerTableVaHex": nested_runner.get("nestedHandlerTableVaHex"),
        "dispatcherUsesGeneralTable": nested_runner.get("dispatcherUsesGeneralTable"),
        "generalHandlerTableVaHex": nested_modes.get("generalHandlerTableVaHex"),
        "directContextA8SetterCount": nested_modes.get("directContextA8SetterCount"),
        "runtimePointerModeStillRequired": nested_modes.get("runtimePointerModeStillRequired"),
        "gateOffsetProofStatus": nested_modes.get("gateOffsetProofStatus"),
        "controlPathGateStatus": nested_modes.get("controlPathGateStatus"),
        "gateOffsetsHex": nested_modes.get("gateOffsetsHex") or [],
        "staticGateOffsetDirectRefCount": nested_modes.get("staticGateOffsetDirectRefCount"),
        "promotionStatus": nested_modes.get("promotionStatus"),
        "conclusion": nested_modes.get("conclusion"),
    }


def opcode20_nested_base_modes_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"op20Nested={evidence.get('currentOpcode20VaHex')} "
        f"mode={evidence.get('currentModeHex')} "
        f"nestedObjectPlus4={evidence.get('currentModeIsNestedObjectPlus4')} "
        f"handler={evidence.get('saveSelectorOpcode20HandlerVaHex')} "
        f"handlerExpected={evidence.get('saveSelectorOpcode20HandlerMatchesExpected')} "
        f"nestedRunner={evidence.get('nestedRunnerVaHex')} "
        f"generalTable={evidence.get('generalHandlerTableVaHex')} "
        f"contextA8Setters={evidence.get('directContextA8SetterCount')} "
        f"runtimePointer={evidence.get('runtimePointerModeStillRequired')} "
        f"gateOffsets={','.join(evidence.get('gateOffsetsHex') or []) or '-'} "
        f"staticGateRefs={evidence.get('staticGateOffsetDirectRefCount')} "
        f"control={evidence.get('controlPathGateStatus')} "
        f"status={evidence.get('promotionStatus')}"
    )


def branch_gate_consistency_for(source: str, target: str, consistency: dict | None) -> dict | None:
    if not consistency:
        return None
    if consistency.get("source") != source or consistency.get("target") != target:
        return None
    return {
        "nearestWriterVaHex": consistency.get("nearestWriterVaHex"),
        "frontierReaderVaHex": consistency.get("frontierReaderVaHex"),
        "sameTableAndOffset": consistency.get("sameTableAndOffset"),
        "sameTableName": consistency.get("sameTableName"),
        "sameSelectionBufferOffsetHex": consistency.get("sameSelectionBufferOffsetHex"),
        "selectionOpcodeRowsBetweenCount": consistency.get("selectionOpcodeRowsBetweenCount"),
        "postWriterSameOffsetWriteCount": consistency.get("postWriterSameOffsetWriteCount"),
        "postWriterSameOffsetReadCount": consistency.get("postWriterSameOffsetReadCount"),
        "postWriterOtherOffsetWriteCount": consistency.get("postWriterOtherOffsetWriteCount"),
        "postWriterOtherOffsetWriteOffsetsHex": consistency.get("postWriterOtherOffsetWriteOffsetsHex"),
        "validSecondaryFillBetweenCount": consistency.get("validSecondaryFillBetweenCount"),
        "invalidSecondaryFillBetweenCount": consistency.get("invalidSecondaryFillBetweenCount"),
        "invalidSecondaryFillOffsetsHex": consistency.get("invalidSecondaryFillOffsetsHex"),
        "knownOpcodeStatePreservationStatus": consistency.get("knownOpcodeStatePreservationStatus"),
        "statePreservedByKnownOpcodes": consistency.get("statePreservedByKnownOpcodes"),
        "branchStateValueStillRuntimeDependent": consistency.get("branchStateValueStillRuntimeDependent"),
        "controlPathStillUnproven": consistency.get("controlPathStillUnproven"),
        "strictHotspotStillMissing": consistency.get("strictHotspotStillMissing"),
        "promotionStatus": consistency.get("promotionStatus"),
        "conclusion": consistency.get("conclusion"),
    }


def branch_gate_consistency_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"sameOffset={evidence.get('sameTableAndOffset')} "
        f"offset={evidence.get('sameSelectionBufferOffsetHex')} "
        f"rowsBetween={evidence.get('selectionOpcodeRowsBetweenCount')} "
        f"postWrites={evidence.get('postWriterSameOffsetWriteCount')} "
        f"postReads={evidence.get('postWriterSameOffsetReadCount')} "
        f"otherWrites={evidence.get('postWriterOtherOffsetWriteCount')}@"
        f"{','.join(evidence.get('postWriterOtherOffsetWriteOffsetsHex') or []) or '-'} "
        f"validFills={evidence.get('validSecondaryFillBetweenCount')} "
        f"invalidFills={evidence.get('invalidSecondaryFillBetweenCount')} "
        f"invalidFillOffsets={','.join(evidence.get('invalidSecondaryFillOffsetsHex') or []) or '-'} "
        f"preserve={evidence.get('knownOpcodeStatePreservationStatus')} "
        f"runtimeDependent={evidence.get('branchStateValueStillRuntimeDependent')} "
        f"controlUnproven={evidence.get('controlPathStillUnproven')}"
    )


def branch_selector_equation_for(source: str, target: str, equation: dict | None) -> dict | None:
    if not equation:
        return None
    if equation.get("route") != f"{source} -> {target}":
        return None
    predecessor = equation.get("predecessorFillHypothesis") or {}
    active_flag = equation.get("activeFlagEffect") or {}
    return {
        "writerVaHex": equation.get("writerVaHex"),
        "readerVaHex": equation.get("readerVaHex"),
        "selectionOffsetHex": equation.get("selectionOffsetHex"),
        "writerTable": equation.get("writerTable"),
        "readerTable": equation.get("readerTable"),
        "equationNarrowedByPredecessorHypothesis": equation.get("equationNarrowedByPredecessorHypothesis"),
        "predecessorSelector": predecessor.get("predecessorSelector"),
        "predecessorRootHex": predecessor.get("predecessorRootHex"),
        "predecessorFillValueHex": predecessor.get("fillValueHex"),
        "predecessorAllStartsPassReader": predecessor.get("allStartsPassReader"),
        "activeFlagDefaultResolved": active_flag.get("activeFlagResolvedStaticDefault"),
        "priorSelectionBufferStillPrimaryBlocker": active_flag.get(
            "priorSelectionBufferStillPrimaryBlockerUnderPredecessorHypothesis"
        ),
        "remainingUnknowns": equation.get("remainingUnknowns") or [],
        "promotionStatus": equation.get("promotionStatus"),
        "conclusion": equation.get("conclusion"),
    }


def branch_selector_equation_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"writer={evidence.get('writerVaHex')} "
        f"reader={evidence.get('readerVaHex')} "
        f"offset={evidence.get('selectionOffsetHex')} "
        f"tables={evidence.get('writerTable')}/{evidence.get('readerTable')} "
        f"narrowed={evidence.get('equationNarrowedByPredecessorHypothesis')} "
        f"pred={evidence.get('predecessorSelector')} "
        f"fill={evidence.get('predecessorFillValueHex')} "
        f"allStartsPass={evidence.get('predecessorAllStartsPassReader')} "
        f"priorPrimary={evidence.get('priorSelectionBufferStillPrimaryBlocker')} "
        f"status={evidence.get('promotionStatus')}"
    )


def gate_offset_sources_for(source: str, target: str, offset_sources: dict | None) -> dict | None:
    if not offset_sources:
        return None
    if offset_sources.get("source") != source or offset_sources.get("target") != target:
        return None
    return {
        "selector": offset_sources.get("selector"),
        "rootHex": offset_sources.get("rootHex"),
        "gateOffsetsHex": offset_sources.get("gateOffsetsHex") or [],
        "anyScriptLocalSelectionWriter": offset_sources.get("anyScriptLocalSelectionWriter"),
        "anyGlobalScriptSelectionWriter": offset_sources.get("anyGlobalScriptSelectionWriter"),
        "controlPathGateStatus": offset_sources.get("controlPathGateStatus"),
        "controlPathProofStatus": offset_sources.get("controlPathProofStatus"),
        "promotionStatus": offset_sources.get("promotionStatus"),
        "gates": [
            {
                "selectionBufferOffsetHex": gate.get("selectionBufferOffsetHex"),
                "globalRowCount": gate.get("globalRowCount"),
                "globalReaderCount": gate.get("globalReaderCount"),
                "globalWriterCount": gate.get("globalWriterCount"),
                "currentRootRowCount": gate.get("currentRootRowCount"),
                "currentRootWriterBeforeGateCount": gate.get("currentRootWriterBeforeGateCount"),
                "sourceClassification": gate.get("sourceClassification"),
            }
            for gate in offset_sources.get("gates") or []
        ],
        "conclusion": offset_sources.get("conclusion"),
    }


def gate_offset_sources_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    gates = ", ".join(
        f"{gate.get('selectionBufferOffsetHex')} rows={gate.get('globalRowCount')} "
        f"writers={gate.get('globalWriterCount')} current={gate.get('currentRootRowCount')} "
        f"beforeW={gate.get('currentRootWriterBeforeGateCount')}"
        for gate in evidence.get("gates") or []
    )
    return (
        f"status={evidence.get('controlPathGateStatus')} "
        f"proof={evidence.get('controlPathProofStatus')} "
        f"localWriter={evidence.get('anyScriptLocalSelectionWriter')} "
        f"globalWriter={evidence.get('anyGlobalScriptSelectionWriter')} "
        f"gates=[{gates}]"
    )


def gate_offset_patterns_for(source: str, target: str, patterns: dict | None) -> dict | None:
    if not patterns:
        return None
    if patterns.get("source") != source or patterns.get("target") != target:
        return None
    return {
        "currentRootHex": patterns.get("currentRootHex"),
        "totalRowCount": patterns.get("totalRowCount"),
        "totalReaderCount": patterns.get("totalReaderCount"),
        "totalWriterCount": patterns.get("totalWriterCount"),
        "rootCount": patterns.get("rootCount"),
        "promotionStatus": patterns.get("promotionStatus"),
        "offsets": [
            {
                "offsetHex": row.get("offsetHex"),
                "rowCount": row.get("rowCount"),
                "readerCount": row.get("readerCount"),
                "writerCount": row.get("writerCount"),
                "rootCount": row.get("rootCount"),
                "routeOverlapRootCount": row.get("routeOverlapRootCount"),
                "currentRootRowCount": row.get("currentRootRowCount"),
            }
            for row in patterns.get("offsets") or []
        ],
        "conclusion": patterns.get("conclusion"),
    }


def gate_offset_patterns_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    offsets = ", ".join(
        f"{row.get('offsetHex')}={row.get('rowCount')}/{row.get('writerCount')} "
        f"roots={row.get('rootCount')} current={row.get('currentRootRowCount')}"
        for row in evidence.get("offsets") or []
    )
    return (
        f"rows={evidence.get('totalRowCount')} "
        f"readers={evidence.get('totalReaderCount')} "
        f"writers={evidence.get('totalWriterCount')} "
        f"roots={evidence.get('rootCount')} "
        f"offsets=[{offsets}]"
    )


def gate_base_candidates_for(source: str, target: str, candidates: dict | None) -> dict | None:
    if not candidates:
        return None
    if candidates.get("source") != source or candidates.get("target") != target:
        return None
    return {
        "gateOffsetsHex": candidates.get("gateOffsetsHex") or [],
        "expectedIndexRange": candidates.get("expectedIndexRange") or [],
        "candidateCount": candidates.get("candidateCount"),
        "partySlotStatByteCandidateCount": candidates.get("partySlotStatByteCandidateCount"),
        "directRefCandidateCount": candidates.get("directRefCandidateCount"),
        "runtimePointerModeStillRequired": candidates.get("runtimePointerModeStillRequired"),
        "promotionStatus": candidates.get("promotionStatus"),
        "conclusion": candidates.get("conclusion"),
    }


def gate_base_candidates_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"offsets={','.join(evidence.get('gateOffsetsHex') or [])} "
        f"range={evidence.get('expectedIndexRange')} "
        f"candidates={evidence.get('candidateCount')} "
        f"partyStatBytes={evidence.get('partySlotStatByteCandidateCount')} "
        f"directRefs={evidence.get('directRefCandidateCount')} "
        f"runtimePointer={evidence.get('runtimePointerModeStillRequired')}"
    )


def gate_sample_values_for(source: str, target: str, values: dict | None) -> dict | None:
    if not values:
        return None
    if values.get("source") != source or values.get("target") != target:
        return None
    return {
        "sampleCount": values.get("sampleCount"),
        "uniqueSelectorCount": values.get("uniqueSelectorCount"),
        "sampleSelectors": values.get("sampleSelectors") or [],
        "currentFrontierSelector": values.get("currentFrontierSelector"),
        "currentFrontierSampleCovered": values.get("currentFrontierSampleCovered"),
        "saveRuntimeGateSampleValueCount": values.get("saveRuntimeGateSampleValueCount"),
        "saveRuntimeGateInRangeSampleValueCount": values.get("saveRuntimeGateInRangeSampleValueCount"),
        "saveRuntimeGateDistinctValuesHex": values.get("saveRuntimeGateDistinctValuesHex") or [],
        "partySlotStatSampleValueCount": values.get("partySlotStatSampleValueCount"),
        "partySlotStatInRangeSampleValueCount": values.get("partySlotStatInRangeSampleValueCount"),
        "partySlotStatDistinctValuesHex": values.get("partySlotStatDistinctValuesHex") or [],
        "runtimePointerModeStillRequired": values.get("runtimePointerModeStillRequired"),
        "promotionStatus": values.get("promotionStatus"),
        "conclusion": values.get("conclusion"),
    }


def gate_sample_values_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"samples={evidence.get('sampleCount')} "
        f"selectors={','.join(evidence.get('sampleSelectors') or [])} "
        f"current={evidence.get('currentFrontierSelector')} "
        f"currentCovered={evidence.get('currentFrontierSampleCovered')} "
        f"saveRuntime={evidence.get('saveRuntimeGateInRangeSampleValueCount')}/"
        f"{evidence.get('saveRuntimeGateSampleValueCount')} "
        f"saveValues={','.join(evidence.get('saveRuntimeGateDistinctValuesHex') or [])} "
        f"partyStat={evidence.get('partySlotStatInRangeSampleValueCount')}/"
        f"{evidence.get('partySlotStatSampleValueCount')}"
    )


def opcode24_current_root_modes_for(source: str, target: str, modes: dict | None) -> dict | None:
    if not modes:
        return None
    if modes.get("source") != source or modes.get("target") != target:
        return None
    boundary = modes.get("currentBoundary") or {}
    return {
        "selector": modes.get("selector"),
        "rootRangeHex": modes.get("rootRangeHex"),
        "mode1SourceHex": modes.get("mode1SourceHex"),
        "gateBoundaryVaHex": modes.get("gateBoundaryVaHex"),
        "rowCount": modes.get("rowCount"),
        "opcodeCandidateCount": modes.get("opcodeCandidateCount"),
        "pointerCollisionCount": modes.get("pointerCollisionCount"),
        "mode1CandidateCount": modes.get("mode1CandidateCount"),
        "frontierOperandCount": modes.get("frontierOperandCount"),
        "routeCnsOperandCount": modes.get("routeCnsOperandCount"),
        "currentBoundaryFound": modes.get("currentBoundaryFound"),
        "currentBoundaryVaHex": boundary.get("vaHex"),
        "currentBoundaryValueHex": boundary.get("valueHex"),
        "currentBoundaryModeHex": boundary.get("modeHex"),
        "promotionStatus": modes.get("promotionStatus"),
        "conclusion": modes.get("conclusion"),
    }


def opcode24_current_root_modes_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"selector={evidence.get('selector')} "
        f"range={evidence.get('rootRangeHex')} "
        f"mode1Source={evidence.get('mode1SourceHex')} "
        f"gate={evidence.get('gateBoundaryVaHex')} "
        f"rows={evidence.get('rowCount')} "
        f"opcodeCandidates={evidence.get('opcodeCandidateCount')} "
        f"collisions={evidence.get('pointerCollisionCount')} "
        f"mode1={evidence.get('mode1CandidateCount')} "
        f"frontierOperands={evidence.get('frontierOperandCount')} "
        f"routeCnsOperands={evidence.get('routeCnsOperandCount')} "
        f"boundary={evidence.get('currentBoundaryVaHex')}:{evidence.get('currentBoundaryValueHex')} "
        f"status={evidence.get('promotionStatus')}"
    )


def opcode24_mode1_source_writes_for(summary: dict | None) -> dict | None:
    if not summary:
        return None
    rows = summary.get("rows") or []
    covering_writes = summary.get("coveringWrites") or []
    indexed_write_candidates = summary.get("indexedWriteCandidates") or []
    address_producer_candidates = summary.get("addressProducerCandidates") or []
    static_producer_candidates = summary.get("staticProducerCandidates") or []
    return {
        "mode1SourceHex": summary.get("mode1SourceHex"),
        "staticProducerScanRangeHex": summary.get("staticProducerScanRangeHex"),
        "rowCount": summary.get("rowCount"),
        "rows": rows,
        "exactMode1RefCount": summary.get("exactMode1RefCount"),
        "coveringWriteCount": summary.get("coveringWriteCount"),
        "coveringWrites": covering_writes,
        "indexedWriteCandidateCount": summary.get("indexedWriteCandidateCount"),
        "indexedWriteCandidates": indexed_write_candidates,
        "addressProducerCandidateCount": summary.get("addressProducerCandidateCount"),
        "addressProducerCandidates": address_producer_candidates,
        "staticProducerCandidateCount": summary.get("staticProducerCandidateCount"),
        "staticProducerCandidates": static_producer_candidates,
        "promotionStatus": summary.get("promotionStatus"),
        "conclusion": summary.get("conclusion"),
    }


def opcode24_mode1_source_writes_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"mode1={evidence.get('mode1SourceHex')} "
        f"range={evidence.get('staticProducerScanRangeHex')} "
        f"rows={evidence.get('rowCount')} "
        f"exactRefs={evidence.get('exactMode1RefCount')} "
        f"coveringWrites={evidence.get('coveringWriteCount')} "
        f"indexedWrites={evidence.get('indexedWriteCandidateCount')} "
        f"addressProducers={evidence.get('addressProducerCandidateCount')} "
        f"staticProducers={evidence.get('staticProducerCandidateCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def opcode24_mode1_runtime_context_for(summary: dict | None) -> dict | None:
    if not summary:
        return None
    storage = summary.get("storage") or {}
    direct = summary.get("directProducerSummary") or {}
    diagnostic = summary.get("diagnosticRuntimeWatch") or {}
    save_read_blocks = summary.get("saveReadBlocks") or []
    remaining_proofs = summary.get("remainingProofs") or []
    return {
        "mode1SourceHex": summary.get("mode1SourceHex"),
        "storage": storage,
        "sectionName": storage.get("sectionName"),
        "sectionRawEndVaHex": storage.get("sectionRawEndVaHex"),
        "sectionVirtualEndVaHex": storage.get("sectionVirtualEndVaHex"),
        "mode1SourceHasRawByte": storage.get("mode1SourceHasRawByte"),
        "staticInitialValueHex": storage.get("staticInitialValueHex"),
        "staticInitialValueKind": storage.get("staticInitialValueKind"),
        "saveReadBlockContainsMode1Source": summary.get("saveReadBlockContainsMode1Source"),
        "saveReadBlockCount": len(save_read_blocks),
        "saveReadBlocks": save_read_blocks,
        "directProducerSummary": direct,
        "coveringWriteCount": direct.get("coveringWriteCount"),
        "indexedWriteCandidateCount": direct.get("indexedWriteCandidateCount"),
        "staticProducerCandidateCount": direct.get("staticProducerCandidateCount"),
        "notSavedataBacked": summary.get("notSavedataBacked"),
        "noStaticProducer": summary.get("noStaticProducer"),
        "staticInitialZero": summary.get("staticInitialZero"),
        "diagnosticRouteSampleCount": diagnostic.get("routeSampleCount"),
        "diagnosticTotalSampleCount": diagnostic.get("totalSampleCount"),
        "diagnosticMode1SourceValueHex": diagnostic.get("mode1SourceValueHex"),
        "diagnosticRuntimeFlagValueHex": diagnostic.get("runtimeFlagValueHex"),
        "diagnosticCurrentObjectIndexValueHex": diagnostic.get("currentObjectIndexValueHex"),
        "diagnosticAllWatchedValuesStable": diagnostic.get("allWatchedValuesStable"),
        "diagnosticPromotionStatus": diagnostic.get("promotionStatus"),
        "diagnosticNormalRouteProof": diagnostic.get("normalRouteProof"),
        "proofFound": summary.get("proofFound"),
        "opcode24RuntimeProducerProofFound": summary.get(
            "opcode24RuntimeProducerProofFound"
        ),
        "opcode24RouteStreamSelectionProofFound": summary.get(
            "opcode24RouteStreamSelectionProofFound"
        ),
        "strictHotspotFound": summary.get("strictHotspotFound"),
        "failedOpcode24RuntimeProducerGateIds": (
            summary.get("failedOpcode24RuntimeProducerGateIds") or []
        ),
        "missingEvidence": summary.get("missingEvidence") or [],
        "evidenceRefs": summary.get("evidenceRefs") or [],
        "evidenceRefCount": summary.get("evidenceRefCount"),
        "promotionStatus": summary.get("promotionStatus"),
        "remainingProofCount": len(remaining_proofs),
        "remainingProofs": remaining_proofs,
        "conclusion": summary.get("conclusion"),
    }


def opcode24_mode1_runtime_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"mode1={evidence.get('mode1SourceHex')} "
        f"section={evidence.get('sectionName')} "
        f"rawEnd={evidence.get('sectionRawEndVaHex')} "
        f"rawByte={evidence.get('mode1SourceHasRawByte')} "
        f"initial={evidence.get('staticInitialValueHex')} "
        f"kind={evidence.get('staticInitialValueKind')} "
        f"saveBlock={evidence.get('saveReadBlockContainsMode1Source')} "
        f"saveReadBlocks={evidence.get('saveReadBlockCount')} "
        f"remainingProofs={evidence.get('remainingProofCount')} "
        f"coveringWrites={evidence.get('coveringWriteCount')} "
        f"indexedWrites={evidence.get('indexedWriteCandidateCount')} "
        f"staticProducers={evidence.get('staticProducerCandidateCount')} "
        f"saveBacked={not evidence.get('notSavedataBacked') if evidence.get('notSavedataBacked') is not None else None} "
        f"staticProducer={not evidence.get('noStaticProducer') if evidence.get('noStaticProducer') is not None else None} "
        f"diagRouteSamples={evidence.get('diagnosticRouteSampleCount')} "
        f"diagMode1={evidence.get('diagnosticMode1SourceValueHex')} "
        f"diagFlag={evidence.get('diagnosticRuntimeFlagValueHex')} "
        f"diagObject={evidence.get('diagnosticCurrentObjectIndexValueHex')} "
        f"diagStatus={evidence.get('diagnosticPromotionStatus')} "
        f"proofFound={evidence.get('proofFound')} "
        f"producerProof={evidence.get('opcode24RuntimeProducerProofFound')} "
        "failedGates="
        f"{','.join(evidence.get('failedOpcode24RuntimeProducerGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def opcode24_runtime_enabled_context_for(source: str, target: str, summary: dict | None) -> dict | None:
    if not summary:
        return None
    if summary.get("source") != source or summary.get("target") != target:
        return None
    storage = summary.get("storage") or {}
    diagnostic = summary.get("diagnosticRuntimeWatch") or {}
    refs = summary.get("refs") or []
    save_read_blocks = summary.get("saveReadBlocks") or []
    remaining_proofs = summary.get("remainingProofs") or []
    return {
        "runtimeEnabledFlagHex": summary.get("runtimeEnabledFlagHex"),
        "handlerVaHex": summary.get("handlerVaHex"),
        "flagReadInstructionVaHex": summary.get("flagReadInstructionVaHex"),
        "flagPassTargetVaHex": summary.get("flagPassTargetVaHex"),
        "flagFailAdvanceVaHex": summary.get("flagFailAdvanceVaHex"),
        "refsCount": len(refs),
        "refs": refs,
        "storage": storage,
        "sectionName": storage.get("sectionName"),
        "sectionRawEndVaHex": storage.get("sectionRawEndVaHex"),
        "runtimeEnabledFlagHasRawByte": storage.get("runtimeEnabledFlagHasRawByte"),
        "staticInitialValueHex": storage.get("staticInitialValueHex"),
        "staticInitialValueKind": storage.get("staticInitialValueKind"),
        "saveReadBlockContainsRuntimeEnabledFlag": summary.get("saveReadBlockContainsRuntimeEnabledFlag"),
        "saveReadBlockCount": len(save_read_blocks),
        "saveReadBlocks": save_read_blocks,
        "directTextRefCount": summary.get("directTextRefCount"),
        "directReadCount": summary.get("directReadCount"),
        "directWriteCount": summary.get("directWriteCount"),
        "runtimeFlagUnwrittenStaticSource": summary.get("runtimeFlagUnwrittenStaticSource"),
        "runtimeFlagNotSavedataBacked": summary.get("runtimeFlagNotSavedataBacked"),
        "runtimeFlagStaticInitialZero": summary.get("runtimeFlagStaticInitialZero"),
        "diagnosticRouteSampleCount": diagnostic.get("routeSampleCount"),
        "diagnosticTotalSampleCount": diagnostic.get("totalSampleCount"),
        "diagnosticMode1SourceValueHex": diagnostic.get("mode1SourceValueHex"),
        "diagnosticRuntimeFlagValueHex": diagnostic.get("runtimeFlagValueHex"),
        "diagnosticCurrentObjectIndexValueHex": diagnostic.get("currentObjectIndexValueHex"),
        "diagnosticAllWatchedValuesStable": diagnostic.get("allWatchedValuesStable"),
        "diagnosticRuntimeFlagDisabled": diagnostic.get("runtimeFlagStaysDisabledInDiagnostic"),
        "diagnosticPromotionStatus": diagnostic.get("promotionStatus"),
        "diagnosticNormalRouteProof": diagnostic.get("normalRouteProof"),
        "modeDispatchRequiresRuntimeFlagOne": summary.get("modeDispatchRequiresRuntimeFlagOne"),
        "staticEvidenceProvesModeDispatch": summary.get("staticEvidenceProvesModeDispatch"),
        "proofFound": summary.get("proofFound"),
        "opcode24RuntimeEnabledProofFound": summary.get(
            "opcode24RuntimeEnabledProofFound"
        ),
        "opcode24ModeDispatchProofFound": summary.get("opcode24ModeDispatchProofFound"),
        "failedOpcode24RuntimeEnabledGateIds": (
            summary.get("failedOpcode24RuntimeEnabledGateIds") or []
        ),
        "missingEvidence": summary.get("missingEvidence") or [],
        "evidenceRefs": summary.get("evidenceRefs") or [],
        "evidenceRefCount": summary.get("evidenceRefCount"),
        "promotionStatus": summary.get("promotionStatus"),
        "remainingProofCount": len(remaining_proofs),
        "remainingProofs": remaining_proofs,
        "conclusion": summary.get("conclusion"),
    }


def opcode24_runtime_enabled_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"flag={evidence.get('runtimeEnabledFlagHex')} "
        f"read={evidence.get('flagReadInstructionVaHex')} "
        f"pass={evidence.get('flagPassTargetVaHex')} "
        f"failAdvance={evidence.get('flagFailAdvanceVaHex')} "
        f"refs={evidence.get('refsCount')} "
        f"section={evidence.get('sectionName')} "
        f"rawEnd={evidence.get('sectionRawEndVaHex')} "
        f"rawByte={evidence.get('runtimeEnabledFlagHasRawByte')} "
        f"initial={evidence.get('staticInitialValueHex')} "
        f"saveBlock={evidence.get('saveReadBlockContainsRuntimeEnabledFlag')} "
        f"saveReadBlocks={evidence.get('saveReadBlockCount')} "
        f"remainingProofs={evidence.get('remainingProofCount')} "
        f"refs/read/write={evidence.get('directTextRefCount')}/"
        f"{evidence.get('directReadCount')}/{evidence.get('directWriteCount')} "
        f"requiresFlag1={evidence.get('modeDispatchRequiresRuntimeFlagOne')} "
        f"staticDispatch={evidence.get('staticEvidenceProvesModeDispatch')} "
        f"diagRouteSamples={evidence.get('diagnosticRouteSampleCount')} "
        f"diagFlag={evidence.get('diagnosticRuntimeFlagValueHex')} "
        f"diagMode1={evidence.get('diagnosticMode1SourceValueHex')} "
        f"diagObject={evidence.get('diagnosticCurrentObjectIndexValueHex')} "
        f"diagStatus={evidence.get('diagnosticPromotionStatus')} "
        f"proofFound={evidence.get('proofFound')} "
        "failedGates="
        f"{','.join(evidence.get('failedOpcode24RuntimeEnabledGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def opcode24_mode1_default_effect_for(source: str, target: str, summary: dict | None) -> dict | None:
    if not summary:
        return None
    if summary.get("source") != source or summary.get("target") != target:
        return None
    branch = summary.get("branchOperand") or {}
    object61_consumer_groups = summary.get("object61ConsumerGroups") or []
    remaining_proofs = summary.get("remainingProofs") or []
    return {
        "mode1SourceHex": summary.get("mode1SourceHex"),
        "mode1SourceStaticInitialValueHex": summary.get("mode1SourceStaticInitialValueHex"),
        "mode1SourceStaticInitialValueKind": summary.get("mode1SourceStaticInitialValueKind"),
        "defaultObject61ValueHex": summary.get("defaultObject61ValueHex"),
        "mode1SourceSaveBacked": summary.get("mode1SourceSaveBacked"),
        "mode1SourceHasStaticProducer": summary.get("mode1SourceHasStaticProducer"),
        "directFrontierOperandCount": summary.get("directFrontierOperandCount"),
        "branchFrontierOperandCount": summary.get("branchFrontierOperandCount"),
        "routeOperandRowCount": summary.get("routeOperandRowCount"),
        "object61ConsumerGroupCount": summary.get("object61ConsumerGroupCount"),
        "object61ConsumerGroups": object61_consumer_groups,
        "branchOperand": branch,
        "branchOperandNextDwordHex": branch.get("nextDwordHex"),
        "branchOperandCns": branch.get("cns"),
        "staticDefaultPromotesRoute": summary.get("staticDefaultPromotesRoute"),
        "runtimeProducerRequired": summary.get("runtimeProducerRequired"),
        "strictHotspotRequired": summary.get("strictHotspotRequired"),
        "promotionStatus": summary.get("promotionStatus"),
        "remainingProofCount": len(remaining_proofs),
        "remainingProofs": remaining_proofs,
        "conclusion": summary.get("conclusion"),
    }


def opcode24_mode1_default_effect_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"mode1={evidence.get('mode1SourceHex')} "
        f"sourceValue={evidence.get('mode1SourceStaticInitialValueHex')} "
        f"defaultObject61={evidence.get('defaultObject61ValueHex')} "
        f"saveBacked={evidence.get('mode1SourceSaveBacked')} "
        f"staticProducer={evidence.get('mode1SourceHasStaticProducer')} "
        f"directFrontier={evidence.get('directFrontierOperandCount')} "
        f"branchFrontier={evidence.get('branchFrontierOperandCount')} "
        f"routeRows={evidence.get('routeOperandRowCount')} "
        f"object61Groups={evidence.get('object61ConsumerGroupCount')} "
        f"remainingProofs={evidence.get('remainingProofCount')} "
        f"branchNext={evidence.get('branchOperandNextDwordHex')} "
        f"branchCns={evidence.get('branchOperandCns')} "
        f"promotes={evidence.get('staticDefaultPromotesRoute')} "
        f"status={evidence.get('promotionStatus')}"
    )


def gate_pass_matrix_for(source: str, target: str, matrix: dict | None) -> dict | None:
    if not matrix:
        return None
    if matrix.get("source") != source or matrix.get("target") != target:
        return None
    party_summary = matrix.get("partySlotStatSummary") or {}
    return {
        "currentFrontierSelector": matrix.get("currentFrontierSelector"),
        "currentFrontierSampleCovered": matrix.get("currentFrontierSampleCovered"),
        "saveRuntimeGateDistinctValuesHex": matrix.get("saveRuntimeGateDistinctValuesHex") or [],
        "saveRuntimePredecessorAllGatePassSampleCount": matrix.get("saveRuntimePredecessorAllGatePassSampleCount"),
        "saveRuntimePredecessorSampleCount": matrix.get("saveRuntimePredecessorSampleCount"),
        "saveRuntimeZeroTableAllGatePassSampleCount": matrix.get("saveRuntimeZeroTableAllGatePassSampleCount"),
        "saveRuntimeZeroTableSampleCount": matrix.get("saveRuntimeZeroTableSampleCount"),
        "partySlotStatSampleValueCount": party_summary.get("sampleValueCount"),
        "partySlotStatInRangeSampleValueCount": party_summary.get("inRangeSampleValueCount"),
        "runtimeBaseProofRequired": matrix.get("runtimeBaseProofRequired"),
        "predecessorPersistenceProofRequired": matrix.get("predecessorPersistenceProofRequired"),
        "strictHotspotProofRequired": matrix.get("strictHotspotProofRequired"),
        "promotionStatus": matrix.get("promotionStatus"),
        "conclusion": matrix.get("conclusion"),
    }


def gate_pass_matrix_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"currentCovered={evidence.get('currentFrontierSampleCovered')} "
        f"predPass={evidence.get('saveRuntimePredecessorAllGatePassSampleCount')}/"
        f"{evidence.get('saveRuntimePredecessorSampleCount')} "
        f"zeroPass={evidence.get('saveRuntimeZeroTableAllGatePassSampleCount')}/"
        f"{evidence.get('saveRuntimeZeroTableSampleCount')} "
        f"partyStat={evidence.get('partySlotStatInRangeSampleValueCount')}/"
        f"{evidence.get('partySlotStatSampleValueCount')} "
        f"runtimeBase={evidence.get('runtimeBaseProofRequired')} "
        f"predecessor={evidence.get('predecessorPersistenceProofRequired')} "
        f"strict={evidence.get('strictHotspotProofRequired')}"
    )


def predecessor_persistence_for(source: str, target: str, persistence_gap: dict | None) -> dict | None:
    if not persistence_gap:
        return None
    if persistence_gap.get("source") not in {None, source}:
        return None
    if persistence_gap.get("target") not in {None, target}:
        return None
    return {
        "predecessorSelector": persistence_gap.get("predecessorSelector"),
        "predecessorRootHex": persistence_gap.get("predecessorRootHex"),
        "currentSelector": persistence_gap.get("currentSelector"),
        "currentRootHex": persistence_gap.get("currentRootHex"),
        "selectorAdjacent": persistence_gap.get("selectorAdjacent"),
        "intermediateSelectorCount": persistence_gap.get("intermediateSelectorCount"),
        "predecessorFillWouldPassCurrentReader": persistence_gap.get("predecessorFillWouldPassCurrentReader"),
        "currentRootHasNoKnownBeforeFrontierOverwrite": persistence_gap.get("currentRootHasNoKnownBeforeFrontierOverwrite"),
        "directSecondaryBranchStateWriterCount": persistence_gap.get("directSecondaryBranchStateWriterCount"),
        "routeOrderProven": persistence_gap.get("routeOrderProven"),
        "sourceRoutePreviousSelector": persistence_gap.get("sourceRoutePreviousSelector"),
        "sourceRoutePreviousConfirmedOverlap": persistence_gap.get("sourceRoutePreviousConfirmedOverlap") or [],
        "predecessorIsTargetSideOnly": persistence_gap.get("predecessorIsTargetSideOnly"),
        "samePreviousContainsRoutePair": persistence_gap.get("samePreviousContainsRoutePair"),
        "selectorMergeGapOpen": persistence_gap.get("selectorMergeGapOpen"),
        "strictHotspotFound": persistence_gap.get("strictHotspotFound"),
        "persistenceProven": persistence_gap.get("persistenceProven"),
        "promotionStatus": persistence_gap.get("promotionStatus"),
        "remainingProofs": persistence_gap.get("remainingProofs") or [],
        "conclusion": persistence_gap.get("conclusion"),
    }


def predecessor_persistence_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"{evidence.get('predecessorSelector')}->{evidence.get('currentSelector')} "
        f"adjacent={evidence.get('selectorAdjacent')} "
        f"sourcePrev={evidence.get('sourceRoutePreviousSelector')} "
        f"targetSideOnly={evidence.get('predecessorIsTargetSideOnly')} "
        f"mergeGap={evidence.get('selectorMergeGapOpen')} "
        f"wouldPass={evidence.get('predecessorFillWouldPassCurrentReader')} "
        f"noLocalOverwrite={evidence.get('currentRootHasNoKnownBeforeFrontierOverwrite')} "
        f"directSecondaryWriters={evidence.get('directSecondaryBranchStateWriterCount')} "
        f"routeOrder={evidence.get('routeOrderProven')} "
        f"persistence={evidence.get('persistenceProven')}"
    )


def predecessor_branch_state_execution_for(source: str, target: str, execution_gap: dict | None) -> dict | None:
    if not execution_gap:
        return None
    if execution_gap.get("source") != source or execution_gap.get("target") != target:
        return None
    progress_poll = execution_gap.get("predecessorProgressPoll") or {}
    direction_sweep_poll = execution_gap.get("predecessorDirectionSweepPoll") or {}
    branch_state_poll = execution_gap.get("predecessorBranchStatePoll") or {}
    highfreq_branch_state_poll = execution_gap.get("predecessorHighFrequencyBranchStatePoll") or {}
    nearest_exit_branch_state_poll = execution_gap.get("predecessorNearestExitBranchStatePoll") or {}
    reciprocal_exit_branch_state_poll = execution_gap.get("predecessorReciprocalExitBranchStatePoll") or {}
    coordinate_branch_state_poll = execution_gap.get("predecessorCoordinateBranchStatePoll") or {}
    trail_start_branch_state_poll = execution_gap.get("predecessorTrailStartBranchStatePoll") or {}
    trail_left_overrun_branch_state_poll = execution_gap.get("predecessorTrailLeftOverrunBranchStatePoll") or {}
    runtime_split = execution_gap.get("runtimeBranchStateSplit") or {}
    nearest_exit_runtime_split = execution_gap.get("nearestExitRuntimeBranchStateSplit") or {}
    reciprocal_exit_runtime_split = execution_gap.get("reciprocalExitRuntimeBranchStateSplit") or {}
    coordinate_runtime_split = execution_gap.get("coordinateRuntimeBranchStateSplit") or {}
    trail_start_runtime_split = execution_gap.get("trailStartRuntimeBranchStateSplit") or {}
    trail_left_overrun_runtime_split = execution_gap.get("trailLeftOverrunRuntimeBranchStateSplit") or {}
    fill_execution_order_gap = execution_gap.get("predecessorFillExecutionOrderGap") or {}
    fill_site_execution_context = execution_gap.get("predecessorFillSiteExecutionContext") or {}
    return {
        "predecessorSelector": execution_gap.get("predecessorSelector"),
        "currentSelector": execution_gap.get("currentSelector"),
        "predecessorFillWouldPassCurrentReader": execution_gap.get("predecessorFillWouldPassCurrentReader"),
        "closedStaticResetScope": execution_gap.get("closedStaticResetScope"),
        "selectorOrderResetGapClosed": execution_gap.get("selectorOrderResetGapClosed"),
        "openRuntimeOrderOrBytecodeGap": execution_gap.get("openRuntimeOrderOrBytecodeGap"),
        "routeOrderProven": execution_gap.get("routeOrderProven"),
        "selectorMergeGapOpen": execution_gap.get("selectorMergeGapOpen"),
        "globalResetRuledOut": execution_gap.get("globalResetRuledOut"),
        "strictHotspotFound": execution_gap.get("strictHotspotFound"),
        "proofFound": execution_gap.get("proofFound"),
        "failedBranchStateExecutionGateIds": execution_gap.get(
            "failedBranchStateExecutionGateIds"
        )
        or [],
        "missingEvidence": execution_gap.get("missingEvidence") or [],
        "branchStateExecutionGatePass": execution_gap.get("branchStateExecutionGatePass") or {},
        "branchStateExecutionMissingEvidence": (
            execution_gap.get("branchStateExecutionMissingEvidence") or []
        ),
        "evidenceRefs": execution_gap.get("evidenceRefs") or [],
        "evidenceRefCount": execution_gap.get("evidenceRefCount"),
        "remainingProofs": execution_gap.get("remainingProofs") or [],
        "branchStateExecutionProofFound": execution_gap.get("branchStateExecutionProofFound"),
        "persistencePromotable": execution_gap.get("persistencePromotable"),
        "promotionStatus": execution_gap.get("promotionStatus"),
        "fillExecutionOrderProofFound": execution_gap.get("fillExecutionOrderProofFound"),
        "fillSiteExecutionContextProven": execution_gap.get("fillSiteExecutionContextProven"),
        "branchGateKnownOpcodeStatePreservationStatus": execution_gap.get(
            "branchGateKnownOpcodeStatePreservationStatus"
        ),
        "branchGateSameTableAndOffset": execution_gap.get("branchGateSameTableAndOffset"),
        "branchGateSameSelectionBufferOffsetHex": execution_gap.get(
            "branchGateSameSelectionBufferOffsetHex"
        ),
        "branchGatePostWriterSameOffsetWriteCount": execution_gap.get(
            "branchGatePostWriterSameOffsetWriteCount"
        ),
        "branchGatePostWriterSameOffsetReadCount": execution_gap.get(
            "branchGatePostWriterSameOffsetReadCount"
        ),
        "branchGatePostWriterOtherOffsetWriteCount": execution_gap.get(
            "branchGatePostWriterOtherOffsetWriteCount"
        ),
        "branchGatePostWriterOtherOffsetWriteOffsetsHex": execution_gap.get(
            "branchGatePostWriterOtherOffsetWriteOffsetsHex"
        )
        or [],
        "branchGateInvalidSecondaryFillOffsetsHex": execution_gap.get(
            "branchGateInvalidSecondaryFillOffsetsHex"
        )
        or [],
        "predecessorFillExecutionOrderGap": {
            "available": fill_execution_order_gap.get("available"),
            "fillSites": fill_execution_order_gap.get("fillSites") or [],
            "currentReaderHex": fill_execution_order_gap.get("currentReaderHex"),
            "localFillTraceStartHex": fill_execution_order_gap.get("localFillTraceStartHex"),
            "localFillTraceStopHex": fill_execution_order_gap.get("localFillTraceStopHex"),
            "localFillTraceStopReason": fill_execution_order_gap.get("localFillTraceStopReason"),
            "localFillTraceStopHandlerHex": fill_execution_order_gap.get(
                "localFillTraceStopHandlerHex"
            ),
            "localFillTraceReachesCurrentReader": fill_execution_order_gap.get(
                "localFillTraceReachesCurrentReader"
            ),
            "rootEntryFixedTraversalFillSitesReachable": fill_execution_order_gap.get(
                "rootEntryFixedTraversalFillSitesReachable"
            ),
            "encodedFillEntryClassification": fill_execution_order_gap.get(
                "encodedFillEntryClassification"
            ),
            "encodedFillEntryRawScalarCandidateCount": fill_execution_order_gap.get(
                "encodedFillEntryRawScalarCandidateCount"
            ),
            "encodedFillEntryRootTailRawScalarCandidateCount": fill_execution_order_gap.get(
                "encodedFillEntryRootTailRawScalarCandidateCount"
            ),
            "encodedFillEntryPromotingCandidateCount": fill_execution_order_gap.get(
                "encodedFillEntryPromotingCandidateCount"
            ),
            "encodedRawScalarRejectionClassification": fill_execution_order_gap.get(
                "encodedRawScalarRejectionClassification"
            ),
            "encodedRawScalarAllScalarOnly": fill_execution_order_gap.get(
                "encodedRawScalarAllScalarOnly"
            ),
            "encodedRawScalarNoFixedAdvanceCount": fill_execution_order_gap.get(
                "encodedRawScalarNoFixedAdvanceCount"
            ),
            "encodedRawScalarNoBranchJumpCount": fill_execution_order_gap.get(
                "encodedRawScalarNoBranchJumpCount"
            ),
            "encodedRawScalarBranchAttachedCount": fill_execution_order_gap.get(
                "encodedRawScalarBranchAttachedCount"
            ),
            "encodedRawScalarScalarOnlyCount": fill_execution_order_gap.get(
                "encodedRawScalarScalarOnlyCount"
            ),
            "rootTailDescriptorIsolated": fill_execution_order_gap.get("rootTailDescriptorIsolated"),
            "rootTailBranchToFillFragmentCount": fill_execution_order_gap.get(
                "rootTailBranchToFillFragmentCount"
            ),
            "rootTailFixedFallthroughToFillCount": fill_execution_order_gap.get(
                "rootTailFixedFallthroughToFillCount"
            ),
            "predecessorFillProofGateRows": fill_execution_order_gap.get(
                "predecessorFillProofGateRows"
            )
            or [],
            "predecessorFillProofGateCount": fill_execution_order_gap.get(
                "predecessorFillProofGateCount"
            ),
            "predecessorFillProofGatePassCount": fill_execution_order_gap.get(
                "predecessorFillProofGatePassCount"
            ),
            "predecessorFillProofGateBlockedCount": fill_execution_order_gap.get(
                "predecessorFillProofGateBlockedCount"
            ),
            "predecessorFillProofGateBlockedIds": fill_execution_order_gap.get(
                "predecessorFillProofGateBlockedIds"
            )
            or [],
            "predecessorFillAllProofGatesBlocked": fill_execution_order_gap.get(
                "predecessorFillAllProofGatesBlocked"
            ),
            "proofFound": fill_execution_order_gap.get("proofFound"),
            "failedPredecessorFillOrderGateIds": fill_execution_order_gap.get(
                "failedPredecessorFillOrderGateIds"
            )
            or [],
            "missingEvidence": fill_execution_order_gap.get("missingEvidence") or [],
            "promotionStatus": fill_execution_order_gap.get("promotionStatus"),
        },
        "predecessorFillSiteExecutionContext": {
            "available": fill_site_execution_context.get("available"),
            "branchStatePollCount": fill_site_execution_context.get("branchStatePollCount"),
            "branchStatePollSequenceCount": fill_site_execution_context.get(
                "branchStatePollSequenceCount"
            ),
            "branchStatePollSampleCount": fill_site_execution_context.get(
                "branchStatePollSampleCount"
            ),
            "branchStatePollPublicPredecessorHitCount": fill_site_execution_context.get(
                "branchStatePollPublicPredecessorHitCount"
            ),
            "branchStatePollCurrentRootHitCount": fill_site_execution_context.get(
                "branchStatePollCurrentRootHitCount"
            ),
            "branchStatePollRouteSelectorHitCount": fill_site_execution_context.get(
                "branchStatePollRouteSelectorHitCount"
            ),
            "branchStatePollFillMatchCount": fill_site_execution_context.get(
                "branchStatePollFillMatchCount"
            ),
            "branchStatePollAllZeroCount": fill_site_execution_context.get(
                "branchStatePollAllZeroCount"
            ),
            "branchStatePollTargetObservationStatus": fill_site_execution_context.get(
                "branchStatePollTargetObservationStatus"
            ),
            "encodedRawScalarRejectionClassification": fill_site_execution_context.get(
                "encodedRawScalarRejectionClassification"
            ),
            "encodedRawScalarAllScalarOnly": fill_site_execution_context.get(
                "encodedRawScalarAllScalarOnly"
            ),
            "encodedRawScalarNoFixedAdvanceCount": fill_site_execution_context.get(
                "encodedRawScalarNoFixedAdvanceCount"
            ),
            "encodedRawScalarNoBranchJumpCount": fill_site_execution_context.get(
                "encodedRawScalarNoBranchJumpCount"
            ),
            "encodedRawScalarBranchAttachedCount": fill_site_execution_context.get(
                "encodedRawScalarBranchAttachedCount"
            ),
            "encodedRawScalarScalarOnlyCount": fill_site_execution_context.get(
                "encodedRawScalarScalarOnlyCount"
            ),
            "fieldEntrySequenceContext": fill_site_execution_context.get(
                "fieldEntrySequenceContext"
            )
            or {},
            "descriptorBridgeProofFound": fill_site_execution_context.get(
                "descriptorBridgeProofFound"
            ),
            "descriptorEdgeRejectionClassification": fill_site_execution_context.get(
                "descriptorEdgeRejectionClassification"
            ),
            "descriptorEdgeAllTargetSectionsData": fill_site_execution_context.get(
                "descriptorEdgeAllTargetSectionsData"
            ),
            "descriptorEdgeDescriptorTargetEdgeCount": fill_site_execution_context.get(
                "descriptorEdgeDescriptorTargetEdgeCount"
            ),
            "descriptorEdgeRouteExecutionTargetEdgeCount": fill_site_execution_context.get(
                "descriptorEdgeRouteExecutionTargetEdgeCount"
            ),
            "descriptorEdgeRootRouteExecutionTargetEdgeCount": fill_site_execution_context.get(
                "descriptorEdgeRootRouteExecutionTargetEdgeCount"
            ),
            "descriptorEdgeFillRouteExecutionTargetEdgeCount": fill_site_execution_context.get(
                "descriptorEdgeFillRouteExecutionTargetEdgeCount"
            ),
            "descriptorEncodedTargetClassification": fill_site_execution_context.get(
                "descriptorEncodedTargetClassification"
            ),
            "branchGateKnownOpcodeStatePreservationStatus": fill_site_execution_context.get(
                "branchGateKnownOpcodeStatePreservationStatus"
            ),
            "branchGateSameTableAndOffset": fill_site_execution_context.get(
                "branchGateSameTableAndOffset"
            ),
            "branchGateSameSelectionBufferOffsetHex": fill_site_execution_context.get(
                "branchGateSameSelectionBufferOffsetHex"
            ),
            "branchGatePostWriterSameOffsetWriteCount": fill_site_execution_context.get(
                "branchGatePostWriterSameOffsetWriteCount"
            ),
            "branchGatePostWriterSameOffsetReadCount": fill_site_execution_context.get(
                "branchGatePostWriterSameOffsetReadCount"
            ),
            "branchGatePostWriterOtherOffsetWriteCount": fill_site_execution_context.get(
                "branchGatePostWriterOtherOffsetWriteCount"
            ),
            "branchGatePostWriterOtherOffsetWriteOffsetsHex": fill_site_execution_context.get(
                "branchGatePostWriterOtherOffsetWriteOffsetsHex"
            )
            or [],
            "branchGateInvalidSecondaryFillOffsetsHex": fill_site_execution_context.get(
                "branchGateInvalidSecondaryFillOffsetsHex"
            )
            or [],
            "descriptorEncodedTargetRawScalarCandidateCount": fill_site_execution_context.get(
                "descriptorEncodedTargetRawScalarCandidateCount"
            ),
            "descriptorEncodedTargetRootRawScalarCandidateCount": fill_site_execution_context.get(
                "descriptorEncodedTargetRootRawScalarCandidateCount"
            ),
            "descriptorEncodedTargetFillRawScalarCandidateCount": fill_site_execution_context.get(
                "descriptorEncodedTargetFillRawScalarCandidateCount"
            ),
            "descriptorEncodedTargetPromotingCandidateCount": fill_site_execution_context.get(
                "descriptorEncodedTargetPromotingCandidateCount"
            ),
            "descriptorEncodedTargetLabelCounts": fill_site_execution_context.get(
                "descriptorEncodedTargetLabelCounts"
            )
            or {},
            "descriptorEncodedTargetKindCounts": fill_site_execution_context.get(
                "descriptorEncodedTargetKindCounts"
            )
            or {},
            "runtimeFillObserved": fill_site_execution_context.get("runtimeFillObserved"),
            "requiredProofGateCount": fill_site_execution_context.get("requiredProofGateCount"),
            "requiredProofGatePassCount": fill_site_execution_context.get(
                "requiredProofGatePassCount"
            ),
            "requiredProofGateFailCount": fill_site_execution_context.get(
                "requiredProofGateFailCount"
            ),
            "requiredProofGateStatusOrder": fill_site_execution_context.get(
                "requiredProofGateStatusOrder"
            )
            or [],
            "requiredProofGateStatuses": fill_site_execution_context.get(
                "requiredProofGateStatuses"
            )
            or {},
            "requiredProofGateFailIds": fill_site_execution_context.get(
                "requiredProofGateFailIds"
            )
            or [],
            "requiredProofGateAllBlocked": fill_site_execution_context.get(
                "requiredProofGateAllBlocked"
            ),
            "fillSiteExecutionContextProven": fill_site_execution_context.get(
                "fillSiteExecutionContextProven"
            ),
            "proofFound": fill_site_execution_context.get("proofFound"),
            "failedPredecessorFillGateIds": fill_site_execution_context.get(
                "failedPredecessorFillGateIds"
            )
            or [],
            "missingEvidence": fill_site_execution_context.get("missingEvidence") or [],
            "evidenceRefs": fill_site_execution_context.get("evidenceRefs") or [],
            "evidenceRefCount": fill_site_execution_context.get("evidenceRefCount"),
            "promotionStatus": fill_site_execution_context.get("promotionStatus"),
        },
        "predecessorProgressPoll": {
            "available": progress_poll.get("available"),
            "sequenceCount": progress_poll.get("sequenceCount"),
            "sampleCount": progress_poll.get("sampleCount"),
            "prelude": progress_poll.get("prelude"),
            "caseAliasesEnabled": progress_poll.get("caseAliasesEnabled"),
            "publicSaveSelectors": progress_poll.get("publicSaveSelectors") or [],
            "observedSelectors": progress_poll.get("observedSelectors") or [],
            "observedPublicSaveSelectors": progress_poll.get("observedPublicSaveSelectors") or [],
            "anyReachedPublicSaveSelector": progress_poll.get("anyReachedPublicSaveSelector"),
            "anyReachedCurrentRoot": progress_poll.get("anyReachedCurrentRoot"),
            "anyReachedRouteSelectorContext": progress_poll.get("anyReachedRouteSelectorContext"),
            "routeSelectorHitCount": progress_poll.get("routeSelectorHitCount"),
            "currentRootHitCount": progress_poll.get("currentRootHitCount"),
            "watchValues": progress_poll.get("watchValues"),
            "inputQuality": progress_poll.get("inputQuality") or {},
        },
        "predecessorDirectionSweepPoll": {
            "available": direction_sweep_poll.get("available"),
            "sequenceCount": direction_sweep_poll.get("sequenceCount"),
            "sampleCount": direction_sweep_poll.get("sampleCount"),
            "prelude": direction_sweep_poll.get("prelude"),
            "caseAliasesEnabled": direction_sweep_poll.get("caseAliasesEnabled"),
            "stagedSaveKind": direction_sweep_poll.get("stagedSaveKind"),
            "sequenceNames": direction_sweep_poll.get("sequenceNames") or [],
            "publicSaveSelectors": direction_sweep_poll.get("publicSaveSelectors") or [],
            "observedSelectors": direction_sweep_poll.get("observedSelectors") or [],
            "observedPublicSaveSelectors": direction_sweep_poll.get("observedPublicSaveSelectors") or [],
            "anyReachedPublicSaveSelector": direction_sweep_poll.get("anyReachedPublicSaveSelector"),
            "anyReachedCurrentRoot": direction_sweep_poll.get("anyReachedCurrentRoot"),
            "anyReachedRouteSelectorContext": direction_sweep_poll.get("anyReachedRouteSelectorContext"),
            "routeSelectorHitCount": direction_sweep_poll.get("routeSelectorHitCount"),
            "currentRootHitCount": direction_sweep_poll.get("currentRootHitCount"),
            "watchValues": direction_sweep_poll.get("watchValues"),
            "inputQuality": direction_sweep_poll.get("inputQuality") or {},
        },
        "predecessorBranchStatePoll": {
            "available": branch_state_poll.get("available"),
            "sequenceCount": branch_state_poll.get("sequenceCount"),
            "sampleCount": branch_state_poll.get("sampleCount"),
            "prelude": branch_state_poll.get("prelude"),
            "caseAliasesEnabled": branch_state_poll.get("caseAliasesEnabled"),
            "stagedSaveKind": branch_state_poll.get("stagedSaveKind"),
            "sequenceNames": branch_state_poll.get("sequenceNames") or [],
            "observedSelectors": branch_state_poll.get("observedSelectors") or [],
            "observedPublicSaveSelectors": branch_state_poll.get("observedPublicSaveSelectors") or [],
            "anyReachedPublicSaveSelector": branch_state_poll.get("anyReachedPublicSaveSelector"),
            "anyReachedCurrentRoot": branch_state_poll.get("anyReachedCurrentRoot"),
            "anyReachedRouteSelectorContext": branch_state_poll.get("anyReachedRouteSelectorContext"),
            "routeSelectorHitCount": branch_state_poll.get("routeSelectorHitCount"),
            "activeSelectionFlagHex": branch_state_poll.get("activeSelectionFlagHex"),
            "secondaryBranchStateHexes": branch_state_poll.get("secondaryBranchStateHexes") or [],
            "predecessorFillHypothesisHexes": branch_state_poll.get("predecessorFillHypothesisHexes") or [],
            "matchesPredecessorFillHypothesis": branch_state_poll.get("matchesPredecessorFillHypothesis"),
            "secondaryBranchStateAllZero": branch_state_poll.get("secondaryBranchStateAllZero"),
            "watchValues": branch_state_poll.get("watchValues"),
            "inputQuality": branch_state_poll.get("inputQuality") or {},
        },
        "predecessorHighFrequencyBranchStatePoll": {
            "available": highfreq_branch_state_poll.get("available"),
            "sequenceCount": highfreq_branch_state_poll.get("sequenceCount"),
            "sampleCount": highfreq_branch_state_poll.get("sampleCount"),
            "pollIntervalSeconds": highfreq_branch_state_poll.get("pollIntervalSeconds"),
            "prelude": highfreq_branch_state_poll.get("prelude"),
            "caseAliasesEnabled": highfreq_branch_state_poll.get("caseAliasesEnabled"),
            "stagedSaveKind": highfreq_branch_state_poll.get("stagedSaveKind"),
            "observedSelectors": highfreq_branch_state_poll.get("observedSelectors") or [],
            "observedPublicSaveSelectors": highfreq_branch_state_poll.get("observedPublicSaveSelectors") or [],
            "anyReachedPublicSaveSelector": highfreq_branch_state_poll.get("anyReachedPublicSaveSelector"),
            "anyReachedCurrentRoot": highfreq_branch_state_poll.get("anyReachedCurrentRoot"),
            "anyReachedRouteSelectorContext": highfreq_branch_state_poll.get("anyReachedRouteSelectorContext"),
            "routeSelectorHitCount": highfreq_branch_state_poll.get("routeSelectorHitCount"),
            "activeSelectionFlagHex": highfreq_branch_state_poll.get("activeSelectionFlagHex"),
            "secondaryBranchStateHexes": highfreq_branch_state_poll.get("secondaryBranchStateHexes") or [],
            "predecessorFillHypothesisHexes": highfreq_branch_state_poll.get("predecessorFillHypothesisHexes") or [],
            "matchesPredecessorFillHypothesis": highfreq_branch_state_poll.get("matchesPredecessorFillHypothesis"),
            "secondaryBranchStateAllZero": highfreq_branch_state_poll.get("secondaryBranchStateAllZero"),
            "watchValues": highfreq_branch_state_poll.get("watchValues"),
            "inputQuality": highfreq_branch_state_poll.get("inputQuality") or {},
        },
        "predecessorNearestExitBranchStatePoll": {
            "available": nearest_exit_branch_state_poll.get("available"),
            "sequenceCount": nearest_exit_branch_state_poll.get("sequenceCount"),
            "sampleCount": nearest_exit_branch_state_poll.get("sampleCount"),
            "prelude": nearest_exit_branch_state_poll.get("prelude"),
            "caseAliasesEnabled": nearest_exit_branch_state_poll.get("caseAliasesEnabled"),
            "stagedSaveKind": nearest_exit_branch_state_poll.get("stagedSaveKind"),
            "sequenceNames": nearest_exit_branch_state_poll.get("sequenceNames") or [],
            "observedSelectors": nearest_exit_branch_state_poll.get("observedSelectors") or [],
            "observedPublicSaveSelectors": nearest_exit_branch_state_poll.get("observedPublicSaveSelectors") or [],
            "anyReachedPublicSaveSelector": nearest_exit_branch_state_poll.get("anyReachedPublicSaveSelector"),
            "anyReachedCurrentRoot": nearest_exit_branch_state_poll.get("anyReachedCurrentRoot"),
            "anyReachedRouteSelectorContext": nearest_exit_branch_state_poll.get("anyReachedRouteSelectorContext"),
            "routeSelectorHitCount": nearest_exit_branch_state_poll.get("routeSelectorHitCount"),
            "activeSelectionFlagHex": nearest_exit_branch_state_poll.get("activeSelectionFlagHex"),
            "secondaryBranchStateHexes": nearest_exit_branch_state_poll.get("secondaryBranchStateHexes") or [],
            "predecessorFillHypothesisHexes": nearest_exit_branch_state_poll.get("predecessorFillHypothesisHexes") or [],
            "matchesPredecessorFillHypothesis": nearest_exit_branch_state_poll.get("matchesPredecessorFillHypothesis"),
            "secondaryBranchStateAllZero": nearest_exit_branch_state_poll.get("secondaryBranchStateAllZero"),
            "targetedExitCandidates": nearest_exit_branch_state_poll.get("targetedExitCandidates") or [],
            "watchValues": nearest_exit_branch_state_poll.get("watchValues"),
            "inputQuality": nearest_exit_branch_state_poll.get("inputQuality") or {},
        },
        "predecessorReciprocalExitBranchStatePoll": {
            "available": reciprocal_exit_branch_state_poll.get("available"),
            "sequenceCount": reciprocal_exit_branch_state_poll.get("sequenceCount"),
            "sampleCount": reciprocal_exit_branch_state_poll.get("sampleCount"),
            "prelude": reciprocal_exit_branch_state_poll.get("prelude"),
            "caseAliasesEnabled": reciprocal_exit_branch_state_poll.get("caseAliasesEnabled"),
            "stagedSaveKind": reciprocal_exit_branch_state_poll.get("stagedSaveKind"),
            "sequenceNames": reciprocal_exit_branch_state_poll.get("sequenceNames") or [],
            "observedSelectors": reciprocal_exit_branch_state_poll.get("observedSelectors") or [],
            "observedPublicSaveSelectors": reciprocal_exit_branch_state_poll.get("observedPublicSaveSelectors") or [],
            "anyReachedPublicSaveSelector": reciprocal_exit_branch_state_poll.get("anyReachedPublicSaveSelector"),
            "anyReachedCurrentRoot": reciprocal_exit_branch_state_poll.get("anyReachedCurrentRoot"),
            "anyReachedRouteSelectorContext": reciprocal_exit_branch_state_poll.get("anyReachedRouteSelectorContext"),
            "routeSelectorHitCount": reciprocal_exit_branch_state_poll.get("routeSelectorHitCount"),
            "activeSelectionFlagHex": reciprocal_exit_branch_state_poll.get("activeSelectionFlagHex"),
            "secondaryBranchStateHexes": reciprocal_exit_branch_state_poll.get("secondaryBranchStateHexes") or [],
            "predecessorFillHypothesisHexes": reciprocal_exit_branch_state_poll.get("predecessorFillHypothesisHexes") or [],
            "matchesPredecessorFillHypothesis": reciprocal_exit_branch_state_poll.get("matchesPredecessorFillHypothesis"),
            "secondaryBranchStateAllZero": reciprocal_exit_branch_state_poll.get("secondaryBranchStateAllZero"),
            "targetedExitCandidates": reciprocal_exit_branch_state_poll.get("targetedExitCandidates") or [],
            "watchValues": reciprocal_exit_branch_state_poll.get("watchValues"),
            "inputQuality": reciprocal_exit_branch_state_poll.get("inputQuality") or {},
        },
        "predecessorCoordinateBranchStatePoll": {
            "available": coordinate_branch_state_poll.get("available"),
            "sequenceCount": coordinate_branch_state_poll.get("sequenceCount"),
            "sampleCount": coordinate_branch_state_poll.get("sampleCount"),
            "prelude": coordinate_branch_state_poll.get("prelude"),
            "caseAliasesEnabled": coordinate_branch_state_poll.get("caseAliasesEnabled"),
            "stagedSaveKind": coordinate_branch_state_poll.get("stagedSaveKind"),
            "sequenceNames": coordinate_branch_state_poll.get("sequenceNames") or [],
            "observedSelectors": coordinate_branch_state_poll.get("observedSelectors") or [],
            "observedPublicSaveSelectors": coordinate_branch_state_poll.get("observedPublicSaveSelectors") or [],
            "anyReachedPublicSaveSelector": coordinate_branch_state_poll.get("anyReachedPublicSaveSelector"),
            "anyReachedCurrentRoot": coordinate_branch_state_poll.get("anyReachedCurrentRoot"),
            "anyReachedRouteSelectorContext": coordinate_branch_state_poll.get("anyReachedRouteSelectorContext"),
            "routeSelectorHitCount": coordinate_branch_state_poll.get("routeSelectorHitCount"),
            "activeSelectionFlagHex": coordinate_branch_state_poll.get("activeSelectionFlagHex"),
            "secondaryBranchStateHexes": coordinate_branch_state_poll.get("secondaryBranchStateHexes") or [],
            "predecessorFillHypothesisHexes": coordinate_branch_state_poll.get("predecessorFillHypothesisHexes") or [],
            "matchesPredecessorFillHypothesis": coordinate_branch_state_poll.get("matchesPredecessorFillHypothesis"),
            "secondaryBranchStateAllZero": coordinate_branch_state_poll.get("secondaryBranchStateAllZero"),
            "targetedExitCandidates": coordinate_branch_state_poll.get("targetedExitCandidates") or [],
            "coordinateAnalysisClassification": coordinate_branch_state_poll.get("coordinateAnalysisClassification"),
            "coordinateAnyStartTileObserved": coordinate_branch_state_poll.get("coordinateAnyStartTileObserved"),
            "coordinateAnyTargetTileObserved": coordinate_branch_state_poll.get("coordinateAnyTargetTileObserved"),
            "coordinateRows": coordinate_branch_state_poll.get("coordinateRows") or [],
            "watchValues": coordinate_branch_state_poll.get("watchValues"),
            "inputQuality": coordinate_branch_state_poll.get("inputQuality") or {},
        },
        "predecessorTrailStartBranchStatePoll": {
            "available": trail_start_branch_state_poll.get("available"),
            "sequenceCount": trail_start_branch_state_poll.get("sequenceCount"),
            "sampleCount": trail_start_branch_state_poll.get("sampleCount"),
            "prelude": trail_start_branch_state_poll.get("prelude"),
            "caseAliasesEnabled": trail_start_branch_state_poll.get("caseAliasesEnabled"),
            "stagedSaveKind": trail_start_branch_state_poll.get("stagedSaveKind"),
            "sequenceNames": trail_start_branch_state_poll.get("sequenceNames") or [],
            "observedSelectors": trail_start_branch_state_poll.get("observedSelectors") or [],
            "observedPublicSaveSelectors": trail_start_branch_state_poll.get("observedPublicSaveSelectors") or [],
            "anyReachedPublicSaveSelector": trail_start_branch_state_poll.get("anyReachedPublicSaveSelector"),
            "anyReachedCurrentRoot": trail_start_branch_state_poll.get("anyReachedCurrentRoot"),
            "anyReachedRouteSelectorContext": trail_start_branch_state_poll.get("anyReachedRouteSelectorContext"),
            "routeSelectorHitCount": trail_start_branch_state_poll.get("routeSelectorHitCount"),
            "activeSelectionFlagHex": trail_start_branch_state_poll.get("activeSelectionFlagHex"),
            "secondaryBranchStateHexes": trail_start_branch_state_poll.get("secondaryBranchStateHexes") or [],
            "matchesPredecessorFillHypothesis": trail_start_branch_state_poll.get(
                "matchesPredecessorFillHypothesis"
            ),
            "secondaryBranchStateAllZero": trail_start_branch_state_poll.get("secondaryBranchStateAllZero"),
            "trailStartClassification": trail_start_branch_state_poll.get("trailStartClassification"),
            "trailAnyStartTileObserved": trail_start_branch_state_poll.get("trailAnyStartTileObserved"),
            "trailAnyTargetTileObserved": trail_start_branch_state_poll.get("trailAnyTargetTileObserved"),
            "trailAnyActorMovementObserved": trail_start_branch_state_poll.get("trailAnyActorMovementObserved"),
            "trailAnyTrailMovementObserved": trail_start_branch_state_poll.get("trailAnyTrailMovementObserved"),
            "trailRows": trail_start_branch_state_poll.get("trailRows") or [],
            "watchValues": trail_start_branch_state_poll.get("watchValues"),
            "inputQuality": trail_start_branch_state_poll.get("inputQuality") or {},
        },
        "predecessorTrailLeftOverrunBranchStatePoll": {
            "available": trail_left_overrun_branch_state_poll.get("available"),
            "sequenceCount": trail_left_overrun_branch_state_poll.get("sequenceCount"),
            "sampleCount": trail_left_overrun_branch_state_poll.get("sampleCount"),
            "prelude": trail_left_overrun_branch_state_poll.get("prelude"),
            "caseAliasesEnabled": trail_left_overrun_branch_state_poll.get("caseAliasesEnabled"),
            "stagedSaveKind": trail_left_overrun_branch_state_poll.get("stagedSaveKind"),
            "sequenceNames": trail_left_overrun_branch_state_poll.get("sequenceNames") or [],
            "observedSelectors": trail_left_overrun_branch_state_poll.get("observedSelectors") or [],
            "observedPublicSaveSelectors": trail_left_overrun_branch_state_poll.get(
                "observedPublicSaveSelectors"
            )
            or [],
            "anyReachedPublicSaveSelector": trail_left_overrun_branch_state_poll.get(
                "anyReachedPublicSaveSelector"
            ),
            "anyReachedCurrentRoot": trail_left_overrun_branch_state_poll.get("anyReachedCurrentRoot"),
            "anyReachedRouteSelectorContext": trail_left_overrun_branch_state_poll.get(
                "anyReachedRouteSelectorContext"
            ),
            "routeSelectorHitCount": trail_left_overrun_branch_state_poll.get("routeSelectorHitCount"),
            "activeSelectionFlagHex": trail_left_overrun_branch_state_poll.get("activeSelectionFlagHex"),
            "secondaryBranchStateHexes": trail_left_overrun_branch_state_poll.get(
                "secondaryBranchStateHexes"
            )
            or [],
            "matchesPredecessorFillHypothesis": trail_left_overrun_branch_state_poll.get(
                "matchesPredecessorFillHypothesis"
            ),
            "secondaryBranchStateAllZero": trail_left_overrun_branch_state_poll.get(
                "secondaryBranchStateAllZero"
            ),
            "trailLeftOverrunClassification": trail_left_overrun_branch_state_poll.get(
                "trailLeftOverrunClassification"
            ),
            "trailLeftOverrunAnyCameraTargetObserved": trail_left_overrun_branch_state_poll.get(
                "trailLeftOverrunAnyCameraTargetObserved"
            ),
            "trailLeftOverrunAnyCameraOutsideObserved": trail_left_overrun_branch_state_poll.get(
                "trailLeftOverrunAnyCameraOutsideObserved"
            ),
            "trailLeftOverrunAnyActorTargetObserved": trail_left_overrun_branch_state_poll.get(
                "trailLeftOverrunAnyActorTargetObserved"
            ),
            "trailLeftOverrunAnyTrailTargetObserved": trail_left_overrun_branch_state_poll.get(
                "trailLeftOverrunAnyTrailTargetObserved"
            ),
            "trailLeftOverrunRows": trail_left_overrun_branch_state_poll.get("trailLeftOverrunRows") or [],
            "watchValues": trail_left_overrun_branch_state_poll.get("watchValues"),
            "inputQuality": trail_left_overrun_branch_state_poll.get("inputQuality") or {},
        },
        "predecessorLeftOverrunActivationBranchStatePoll": {
            "available": (execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}).get("available"),
            "sequenceCount": (execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}).get("sequenceCount"),
            "sampleCount": (execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}).get("sampleCount"),
            "prelude": (execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}).get("prelude"),
            "caseAliasesEnabled": (
                execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}
            ).get("caseAliasesEnabled"),
            "stagedSaveKind": (
                execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}
            ).get("stagedSaveKind"),
            "observedSelectors": (
                execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}
            ).get("observedSelectors") or [],
            "observedPublicSaveSelectors": (
                execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}
            ).get("observedPublicSaveSelectors") or [],
            "anyReachedCurrentRoot": (
                execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}
            ).get("anyReachedCurrentRoot"),
            "anyReachedRouteSelectorContext": (
                execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}
            ).get("anyReachedRouteSelectorContext"),
            "activeSelectionFlagHex": (
                execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}
            ).get("activeSelectionFlagHex"),
            "secondaryBranchStateHexes": (
                execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}
            ).get("secondaryBranchStateHexes") or [],
            "matchesPredecessorFillHypothesis": (
                execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}
            ).get("matchesPredecessorFillHypothesis"),
            "secondaryBranchStateAllZero": (
                execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}
            ).get("secondaryBranchStateAllZero"),
            "watchValues": (
                execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}
            ).get("watchValues"),
            "inputQuality": (
                execution_gap.get("predecessorLeftOverrunActivationBranchStatePoll") or {}
            ).get("inputQuality") or {},
        },
        "runtimePredecessorFillObserved": execution_gap.get("runtimePredecessorFillObserved"),
        "publicPredecessorBranchStateAllZero": execution_gap.get("publicPredecessorBranchStateAllZero"),
        "runtimeBranchStateSplit": {
            "classification": runtime_split.get("classification"),
            "publicPredecessorReached": runtime_split.get("publicPredecessorReached"),
            "publicRouteReached": runtime_split.get("publicRouteReached"),
            "observedMatchesFill": runtime_split.get("observedMatchesFill"),
            "observedAllZero": runtime_split.get("observedAllZero"),
            "staticNoLocalTailReset": runtime_split.get("staticNoLocalTailReset"),
            "staticNoDirectGlobalSecondaryWriter": runtime_split.get("staticNoDirectGlobalSecondaryWriter"),
            "staticHelperOpcode10Only": runtime_split.get("staticHelperOpcode10Only"),
            "staticResetScopeClosed": runtime_split.get("staticResetScopeClosed"),
            "nextProofFocus": runtime_split.get("nextProofFocus"),
        },
        "leftOverrunActivationRuntimeBranchStateSplit": {
            "classification": (execution_gap.get("leftOverrunActivationRuntimeBranchStateSplit") or {}).get("classification"),
            "publicPredecessorReached": (
                execution_gap.get("leftOverrunActivationRuntimeBranchStateSplit") or {}
            ).get("publicPredecessorReached"),
            "publicRouteReached": (
                execution_gap.get("leftOverrunActivationRuntimeBranchStateSplit") or {}
            ).get("publicRouteReached"),
            "observedMatchesFill": (
                execution_gap.get("leftOverrunActivationRuntimeBranchStateSplit") or {}
            ).get("observedMatchesFill"),
            "observedAllZero": (
                execution_gap.get("leftOverrunActivationRuntimeBranchStateSplit") or {}
            ).get("observedAllZero"),
            "nextProofFocus": (
                execution_gap.get("leftOverrunActivationRuntimeBranchStateSplit") or {}
            ).get("nextProofFocus"),
        },
        "nearestExitRuntimeBranchStateSplit": {
            "classification": nearest_exit_runtime_split.get("classification"),
            "publicPredecessorReached": nearest_exit_runtime_split.get("publicPredecessorReached"),
            "publicRouteReached": nearest_exit_runtime_split.get("publicRouteReached"),
            "observedMatchesFill": nearest_exit_runtime_split.get("observedMatchesFill"),
            "observedAllZero": nearest_exit_runtime_split.get("observedAllZero"),
            "targetedExitCandidates": nearest_exit_runtime_split.get("targetedExitCandidates") or [],
            "nextProofFocus": nearest_exit_runtime_split.get("nextProofFocus"),
        },
        "reciprocalExitRuntimeBranchStateSplit": {
            "classification": reciprocal_exit_runtime_split.get("classification"),
            "publicPredecessorReached": reciprocal_exit_runtime_split.get("publicPredecessorReached"),
            "publicRouteReached": reciprocal_exit_runtime_split.get("publicRouteReached"),
            "observedMatchesFill": reciprocal_exit_runtime_split.get("observedMatchesFill"),
            "observedAllZero": reciprocal_exit_runtime_split.get("observedAllZero"),
            "targetedExitCandidates": reciprocal_exit_runtime_split.get("targetedExitCandidates") or [],
            "nextProofFocus": reciprocal_exit_runtime_split.get("nextProofFocus"),
        },
        "coordinateRuntimeBranchStateSplit": {
            "classification": coordinate_runtime_split.get("classification"),
            "publicPredecessorReached": coordinate_runtime_split.get("publicPredecessorReached"),
            "publicRouteReached": coordinate_runtime_split.get("publicRouteReached"),
            "observedMatchesFill": coordinate_runtime_split.get("observedMatchesFill"),
            "observedAllZero": coordinate_runtime_split.get("observedAllZero"),
            "coordinateAnyStartTileObserved": coordinate_runtime_split.get("coordinateAnyStartTileObserved"),
            "coordinateAnyTargetTileObserved": coordinate_runtime_split.get("coordinateAnyTargetTileObserved"),
            "coordinateRows": coordinate_runtime_split.get("coordinateRows") or [],
            "nextProofFocus": coordinate_runtime_split.get("nextProofFocus"),
        },
        "trailStartRuntimeBranchStateSplit": {
            "classification": trail_start_runtime_split.get("classification"),
            "publicPredecessorReached": trail_start_runtime_split.get("publicPredecessorReached"),
            "publicRouteReached": trail_start_runtime_split.get("publicRouteReached"),
            "observedMatchesFill": trail_start_runtime_split.get("observedMatchesFill"),
            "observedAllZero": trail_start_runtime_split.get("observedAllZero"),
            "trailAnyStartTileObserved": trail_start_runtime_split.get("trailAnyStartTileObserved"),
            "trailAnyTargetTileObserved": trail_start_runtime_split.get("trailAnyTargetTileObserved"),
            "trailAnyActorMovementObserved": trail_start_runtime_split.get("trailAnyActorMovementObserved"),
            "trailAnyTrailMovementObserved": trail_start_runtime_split.get("trailAnyTrailMovementObserved"),
            "trailRows": trail_start_runtime_split.get("trailRows") or [],
            "nextProofFocus": trail_start_runtime_split.get("nextProofFocus"),
        },
        "trailLeftOverrunRuntimeBranchStateSplit": {
            "classification": trail_left_overrun_runtime_split.get("classification"),
            "publicPredecessorReached": trail_left_overrun_runtime_split.get("publicPredecessorReached"),
            "publicRouteReached": trail_left_overrun_runtime_split.get("publicRouteReached"),
            "observedMatchesFill": trail_left_overrun_runtime_split.get("observedMatchesFill"),
            "observedAllZero": trail_left_overrun_runtime_split.get("observedAllZero"),
            "cameraTargetObserved": trail_left_overrun_runtime_split.get("cameraTargetObserved"),
            "cameraOutsideObserved": trail_left_overrun_runtime_split.get("cameraOutsideObserved"),
            "actorTargetObserved": trail_left_overrun_runtime_split.get("actorTargetObserved"),
            "trailTargetObserved": trail_left_overrun_runtime_split.get("trailTargetObserved"),
            "trailLeftOverrunRows": trail_left_overrun_runtime_split.get("trailLeftOverrunRows") or [],
            "nextProofFocus": trail_left_overrun_runtime_split.get("nextProofFocus"),
        },
        "conclusion": execution_gap.get("conclusion"),
    }


def compact_poll_input_brief(poll: dict) -> str:
    poll_input = poll.get("inputQuality") or {}
    poll_offsets = ",".join(str(offset) for offset in poll_input.get("observedPressedKeyOffsets") or []) or "-"
    return (
        f"{poll_input.get('sequenceWithPidCount')}/{poll_input.get('sequenceCount')}pid "
        f"{poll_input.get('sequenceWithKeyWritesCount')}/{poll_input.get('sequenceCount')}key "
        f"{poll_input.get('sequenceWithObservedKeyPressCount')}/{poll_input.get('sequenceCount')}press "
        f"events={poll_input.get('pressedEventCount')} offsets={poll_offsets}"
    )


def predecessor_branch_state_execution_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    progress_poll = evidence.get("predecessorProgressPoll") or {}
    direction_sweep_poll = evidence.get("predecessorDirectionSweepPoll") or {}
    branch_state_poll = evidence.get("predecessorBranchStatePoll") or {}
    highfreq_branch_state_poll = evidence.get("predecessorHighFrequencyBranchStatePoll") or {}
    left_overrun_activation_branch_state_poll = (
        evidence.get("predecessorLeftOverrunActivationBranchStatePoll") or {}
    )
    nearest_exit_branch_state_poll = evidence.get("predecessorNearestExitBranchStatePoll") or {}
    reciprocal_exit_branch_state_poll = evidence.get("predecessorReciprocalExitBranchStatePoll") or {}
    coordinate_branch_state_poll = evidence.get("predecessorCoordinateBranchStatePoll") or {}
    trail_start_branch_state_poll = evidence.get("predecessorTrailStartBranchStatePoll") or {}
    trail_left_overrun_branch_state_poll = evidence.get("predecessorTrailLeftOverrunBranchStatePoll") or {}
    runtime_split = evidence.get("runtimeBranchStateSplit") or {}
    left_overrun_activation_runtime_split = evidence.get("leftOverrunActivationRuntimeBranchStateSplit") or {}
    nearest_exit_runtime_split = evidence.get("nearestExitRuntimeBranchStateSplit") or {}
    reciprocal_exit_runtime_split = evidence.get("reciprocalExitRuntimeBranchStateSplit") or {}
    coordinate_runtime_split = evidence.get("coordinateRuntimeBranchStateSplit") or {}
    trail_start_runtime_split = evidence.get("trailStartRuntimeBranchStateSplit") or {}
    trail_left_overrun_runtime_split = evidence.get("trailLeftOverrunRuntimeBranchStateSplit") or {}
    fill_order = evidence.get("predecessorFillExecutionOrderGap") or {}
    fill_context = evidence.get("predecessorFillSiteExecutionContext") or {}
    fill_context_field_entry = fill_context.get("fieldEntrySequenceContext") or {}
    progress_input_brief = compact_poll_input_brief(progress_poll)
    direction_input_brief = compact_poll_input_brief(direction_sweep_poll)
    branch_input_brief = compact_poll_input_brief(branch_state_poll)
    highfreq_input_brief = compact_poll_input_brief(highfreq_branch_state_poll)
    left_overrun_activation_input_brief = compact_poll_input_brief(left_overrun_activation_branch_state_poll)
    nearest_exit_input_brief = compact_poll_input_brief(nearest_exit_branch_state_poll)
    reciprocal_exit_input_brief = compact_poll_input_brief(reciprocal_exit_branch_state_poll)
    coordinate_input_brief = compact_poll_input_brief(coordinate_branch_state_poll)
    trail_start_input_brief = compact_poll_input_brief(trail_start_branch_state_poll)
    trail_left_overrun_input_brief = compact_poll_input_brief(trail_left_overrun_branch_state_poll)
    return (
        f"{evidence.get('predecessorSelector')}->{evidence.get('currentSelector')} "
        f"fillPass={evidence.get('predecessorFillWouldPassCurrentReader')} "
        f"staticClosed={evidence.get('closedStaticResetScope')} "
        f"selectorOrderClosed={evidence.get('selectorOrderResetGapClosed')} "
        f"runtimeGap={evidence.get('openRuntimeOrderOrBytecodeGap')} "
        f"routeOrder={evidence.get('routeOrderProven')} "
        f"mergeGap={evidence.get('selectorMergeGapOpen')} "
        f"fillOrderProof={evidence.get('fillExecutionOrderProofFound')} "
        f"fillOrderTrace={fill_order.get('localFillTraceStartHex')}->{fill_order.get('localFillTraceStopHex')} "
        f"fillOrderRootEntryReach={fill_order.get('rootEntryFixedTraversalFillSitesReachable')} "
        f"fillOrderEncoded={fill_order.get('encodedFillEntryClassification')} "
        f"fillOrderRaw={fill_order.get('encodedFillEntryRawScalarCandidateCount')} "
        f"fillOrderRootTailRaw={fill_order.get('encodedFillEntryRootTailRawScalarCandidateCount')} "
        f"fillOrderPromoting={fill_order.get('encodedFillEntryPromotingCandidateCount')} "
        f"fillOrderRawScalarReject={fill_order.get('encodedRawScalarRejectionClassification')} "
        "fillOrderRawScalarNoFixed/noBranch/branchAttached/scalarOnly="
        f"{fill_order.get('encodedRawScalarNoFixedAdvanceCount')}/"
        f"{fill_order.get('encodedRawScalarNoBranchJumpCount')}/"
        f"{fill_order.get('encodedRawScalarBranchAttachedCount')}/"
        f"{fill_order.get('encodedRawScalarScalarOnlyCount')} "
        f"fillContextProof={evidence.get('fillSiteExecutionContextProven')} "
        f"fillContextPolls={fill_context.get('branchStatePollCount')}@"
        f"{fill_context.get('branchStatePollSampleCount')} "
        f"fillContextPublic={fill_context.get('branchStatePollPublicPredecessorHitCount')} "
        f"fillContextRoute2:0={fill_context.get('branchStatePollRouteSelectorHitCount')} "
        f"fillContextMatches={fill_context.get('branchStatePollFillMatchCount')} "
        f"fillContextAllZero={fill_context.get('branchStatePollAllZeroCount')} "
        f"fillContextTarget={fill_context.get('branchStatePollTargetObservationStatus')} "
        f"fillContextFieldEntries={fill_context_field_entry.get('fieldEntryCandidateCount')} "
        f"fillContextSnapshotRoutes={fill_context_field_entry.get('snapshotRouteCandidateCount')} "
        f"fillContextBranchGatePreserve={fill_context.get('branchGateKnownOpcodeStatePreservationStatus')} "
        "fillContextBranchGateSameOffset="
        f"{fill_context.get('branchGateSameTableAndOffset')}/"
        f"{fill_context.get('branchGateSameSelectionBufferOffsetHex')} "
        "fillContextBranchGateWriteRead="
        f"{fill_context.get('branchGatePostWriterSameOffsetWriteCount')}/"
        f"{fill_context.get('branchGatePostWriterSameOffsetReadCount')} "
        "fillContextBranchGateOther="
        f"{fill_context.get('branchGatePostWriterOtherOffsetWriteCount')}@"
        f"{list_text(fill_context.get('branchGatePostWriterOtherOffsetWriteOffsetsHex'))} "
        "fillContextBranchGateInvalid="
        f"{list_text(fill_context.get('branchGateInvalidSecondaryFillOffsetsHex'))} "
        f"progressPoll={progress_poll.get('sequenceCount')}@{progress_poll.get('sampleCount')} "
        f"progressObserved={','.join(progress_poll.get('observedSelectors') or []) or '-'} "
        f"progressPublic={','.join(progress_poll.get('observedPublicSaveSelectors') or []) or '-'} "
        f"progressInput={progress_input_brief} "
        f"progressRoute2:0={progress_poll.get('anyReachedRouteSelectorContext')} "
        f"progressWatch={progress_poll.get('watchValues')} "
        f"directionSweep={direction_sweep_poll.get('sequenceCount')}@{direction_sweep_poll.get('sampleCount')} "
        f"directionObserved={','.join(direction_sweep_poll.get('observedSelectors') or []) or '-'} "
        f"directionPublic={','.join(direction_sweep_poll.get('observedPublicSaveSelectors') or []) or '-'} "
        f"directionInput={direction_input_brief} "
        f"directionRoute2:0={direction_sweep_poll.get('anyReachedRouteSelectorContext')} "
        f"directionWatch={direction_sweep_poll.get('watchValues')} "
        f"branchStatePoll={branch_state_poll.get('sequenceCount')}@{branch_state_poll.get('sampleCount')} "
        f"branchStateObserved={','.join(branch_state_poll.get('observedSelectors') or []) or '-'} "
        f"branchStateInput={branch_input_brief} "
        f"branchState={','.join(branch_state_poll.get('secondaryBranchStateHexes') or []) or '-'} "
        f"branchStateMatchesFill={branch_state_poll.get('matchesPredecessorFillHypothesis')} "
        f"branchStateAllZero={branch_state_poll.get('secondaryBranchStateAllZero')} "
        f"branchStateRoute2:0={branch_state_poll.get('anyReachedRouteSelectorContext')} "
        f"highFrequencyBranchStatePoll={highfreq_branch_state_poll.get('sequenceCount')}@"
        f"{highfreq_branch_state_poll.get('sampleCount')}@"
        f"{highfreq_branch_state_poll.get('pollIntervalSeconds')} "
        f"highFrequencyBranchStateObserved={','.join(highfreq_branch_state_poll.get('observedSelectors') or []) or '-'} "
        f"highFrequencyBranchStatePublic={','.join(highfreq_branch_state_poll.get('observedPublicSaveSelectors') or []) or '-'} "
        f"highFrequencyBranchStateInput={highfreq_input_brief} "
        f"highFrequencyBranchState={','.join(highfreq_branch_state_poll.get('secondaryBranchStateHexes') or []) or '-'} "
        f"highFrequencyBranchStateMatchesFill={highfreq_branch_state_poll.get('matchesPredecessorFillHypothesis')} "
        f"highFrequencyBranchStateAllZero={highfreq_branch_state_poll.get('secondaryBranchStateAllZero')} "
        f"highFrequencyBranchStateRoute2:0={highfreq_branch_state_poll.get('anyReachedRouteSelectorContext')} "
        f"leftOverrunActivationBranchStatePoll="
        f"{left_overrun_activation_branch_state_poll.get('sequenceCount')}@"
        f"{left_overrun_activation_branch_state_poll.get('sampleCount')} "
        f"leftOverrunActivationBranchStateObserved="
        f"{','.join(left_overrun_activation_branch_state_poll.get('observedSelectors') or []) or '-'} "
        f"leftOverrunActivationBranchStateInput={left_overrun_activation_input_brief} "
        f"leftOverrunActivationBranchState="
        f"{','.join(left_overrun_activation_branch_state_poll.get('secondaryBranchStateHexes') or []) or '-'} "
        f"leftOverrunActivationBranchStateMatchesFill="
        f"{left_overrun_activation_branch_state_poll.get('matchesPredecessorFillHypothesis')} "
        f"leftOverrunActivationBranchStateAllZero="
        f"{left_overrun_activation_branch_state_poll.get('secondaryBranchStateAllZero')} "
        f"leftOverrunActivationBranchStateRoute2:0="
        f"{left_overrun_activation_branch_state_poll.get('anyReachedRouteSelectorContext')} "
        f"nearestExitPoll={nearest_exit_branch_state_poll.get('sequenceCount')}@"
        f"{nearest_exit_branch_state_poll.get('sampleCount')} "
        f"nearestExitObserved={','.join(nearest_exit_branch_state_poll.get('observedSelectors') or []) or '-'} "
        f"nearestExitInput={nearest_exit_input_brief} "
        f"nearestExitState={','.join(nearest_exit_branch_state_poll.get('secondaryBranchStateHexes') or []) or '-'} "
        f"nearestExitMatchesFill={nearest_exit_branch_state_poll.get('matchesPredecessorFillHypothesis')} "
        f"nearestExitAllZero={nearest_exit_branch_state_poll.get('secondaryBranchStateAllZero')} "
        f"nearestExitRoute2:0={nearest_exit_branch_state_poll.get('anyReachedRouteSelectorContext')} "
        f"reciprocalExitPoll={reciprocal_exit_branch_state_poll.get('sequenceCount')}@"
        f"{reciprocal_exit_branch_state_poll.get('sampleCount')} "
        f"reciprocalExitObserved={','.join(reciprocal_exit_branch_state_poll.get('observedSelectors') or []) or '-'} "
        f"reciprocalExitInput={reciprocal_exit_input_brief} "
        f"reciprocalExitState={','.join(reciprocal_exit_branch_state_poll.get('secondaryBranchStateHexes') or []) or '-'} "
        f"reciprocalExitMatchesFill={reciprocal_exit_branch_state_poll.get('matchesPredecessorFillHypothesis')} "
        f"reciprocalExitAllZero={reciprocal_exit_branch_state_poll.get('secondaryBranchStateAllZero')} "
        f"reciprocalExitRoute2:0={reciprocal_exit_branch_state_poll.get('anyReachedRouteSelectorContext')} "
        f"coordinatePoll={coordinate_branch_state_poll.get('sequenceCount')}@"
        f"{coordinate_branch_state_poll.get('sampleCount')} "
        f"coordinateObserved={','.join(coordinate_branch_state_poll.get('observedSelectors') or []) or '-'} "
        f"coordinateInput={coordinate_input_brief} "
        f"coordinateState={','.join(coordinate_branch_state_poll.get('secondaryBranchStateHexes') or []) or '-'} "
        f"coordinateMatchesFill={coordinate_branch_state_poll.get('matchesPredecessorFillHypothesis')} "
        f"coordinateAllZero={coordinate_branch_state_poll.get('secondaryBranchStateAllZero')} "
        f"coordinateRoute2:0={coordinate_branch_state_poll.get('anyReachedRouteSelectorContext')} "
        f"coordinateClass={coordinate_branch_state_poll.get('coordinateAnalysisClassification')} "
        f"coordinateStartObserved={coordinate_branch_state_poll.get('coordinateAnyStartTileObserved')} "
        f"coordinateTargetObserved={coordinate_branch_state_poll.get('coordinateAnyTargetTileObserved')} "
        f"trailStartPoll={trail_start_branch_state_poll.get('sequenceCount')}@"
        f"{trail_start_branch_state_poll.get('sampleCount')} "
        f"trailStartObserved={','.join(trail_start_branch_state_poll.get('observedSelectors') or []) or '-'} "
        f"trailStartInput={trail_start_input_brief} "
        f"trailStartState={','.join(trail_start_branch_state_poll.get('secondaryBranchStateHexes') or []) or '-'} "
        f"trailStartRoute2:0={trail_start_branch_state_poll.get('anyReachedRouteSelectorContext')} "
        f"trailStartClass={trail_start_branch_state_poll.get('trailStartClassification')} "
        f"trailStartTileObserved={trail_start_branch_state_poll.get('trailAnyStartTileObserved')} "
        f"trailStartTargetObserved={trail_start_branch_state_poll.get('trailAnyTargetTileObserved')} "
        f"trailStartMove={trail_start_branch_state_poll.get('trailAnyTrailMovementObserved')} "
        f"trailLeftOverrunPoll={trail_left_overrun_branch_state_poll.get('sequenceCount')}@"
        f"{trail_left_overrun_branch_state_poll.get('sampleCount')} "
        f"trailLeftOverrunObserved={','.join(trail_left_overrun_branch_state_poll.get('observedSelectors') or []) or '-'} "
        f"trailLeftOverrunInput={trail_left_overrun_input_brief} "
        f"trailLeftOverrunState={','.join(trail_left_overrun_branch_state_poll.get('secondaryBranchStateHexes') or []) or '-'} "
        f"trailLeftOverrunRoute2:0={trail_left_overrun_branch_state_poll.get('anyReachedRouteSelectorContext')} "
        f"trailLeftOverrunClass={trail_left_overrun_branch_state_poll.get('trailLeftOverrunClassification')} "
        f"trailLeftOverrunCameraTarget={trail_left_overrun_branch_state_poll.get('trailLeftOverrunAnyCameraTargetObserved')} "
        f"trailLeftOverrunCameraOutside={trail_left_overrun_branch_state_poll.get('trailLeftOverrunAnyCameraOutsideObserved')} "
        f"runtimeSplit={runtime_split.get('classification')} "
        f"splitPublicPred={runtime_split.get('publicPredecessorReached')} "
        f"splitObservedFill={runtime_split.get('observedMatchesFill')} "
        f"splitStaticNoReset={runtime_split.get('staticNoLocalTailReset')}/"
        f"{runtime_split.get('staticNoDirectGlobalSecondaryWriter')}/"
        f"{runtime_split.get('staticHelperOpcode10Only')} "
        f"splitNext={runtime_split.get('nextProofFocus')} "
        f"leftOverrunActivationSplit={left_overrun_activation_runtime_split.get('classification')} "
        f"nearestSplit={nearest_exit_runtime_split.get('classification')} "
        f"reciprocalSplit={reciprocal_exit_runtime_split.get('classification')} "
        f"coordinateSplit={coordinate_runtime_split.get('classification')} "
        f"trailStartSplit={trail_start_runtime_split.get('classification')} "
        f"trailLeftOverrunSplit={trail_left_overrun_runtime_split.get('classification')} "
        f"proofFound={evidence.get('proofFound')} "
        "failedBranchStateExecutionGates="
        f"{','.join(evidence.get('failedBranchStateExecutionGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"remainingProofs={len(evidence.get('remainingProofs') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"execProof={evidence.get('branchStateExecutionProofFound')}"
    )


def predecessor_fill_execution_order_gap_for(source: str, target: str, gap: dict | None) -> dict | None:
    if not gap:
        return None
    if gap.get("source") != source or gap.get("target") != target:
        return None
    return {
        "predecessorSelector": gap.get("predecessorSelector"),
        "currentSelector": gap.get("currentSelector"),
        "currentReaderHex": gap.get("currentReaderHex"),
        "fillSites": gap.get("fillSites") or [],
        "localFillTraceStartHex": gap.get("localFillTraceStartHex"),
        "localFillTraceStopHex": gap.get("localFillTraceStopHex"),
        "localFillTraceStopReason": gap.get("localFillTraceStopReason"),
        "localFillTraceStopHandlerHex": gap.get("localFillTraceStopHandlerHex"),
        "localFillTraceContainsAllFillSites": gap.get("localFillTraceContainsAllFillSites"),
        "localFillTraceReachesCurrentReader": gap.get("localFillTraceReachesCurrentReader"),
        "rootEntryFixedTraversalFillSitesReachable": gap.get("rootEntryFixedTraversalFillSitesReachable"),
        "directFillSiteRefCounts": gap.get("directFillSiteRefCounts") or {},
        "fillEntryCandidateScan": gap.get("fillEntryCandidateScan") or {},
        "encodedFillEntryCandidateScan": gap.get("encodedFillEntryCandidateScan") or {},
        "encodedFillEntryRawScalarCandidateCount": gap.get(
            "encodedFillEntryRawScalarCandidateCount"
        ),
        "encodedFillEntryRootTailRawScalarCandidateCount": gap.get(
            "encodedFillEntryRootTailRawScalarCandidateCount"
        ),
        "encodedFillEntryBranchAttachedEncodedFieldCount": gap.get(
            "encodedFillEntryBranchAttachedEncodedFieldCount"
        ),
        "encodedFillEntryModeledControlFlowCandidateCount": gap.get(
            "encodedFillEntryModeledControlFlowCandidateCount"
        ),
        "encodedFillEntryPromotingCandidateCount": gap.get(
            "encodedFillEntryPromotingCandidateCount"
        ),
        "encodedFillEntryClassification": gap.get("encodedFillEntryClassification"),
        "encodedRawScalarRejectionClassification": gap.get(
            "encodedRawScalarRejectionClassification"
        ),
        "encodedRawScalarAllScalarOnly": gap.get("encodedRawScalarAllScalarOnly"),
        "encodedRawScalarNoFixedAdvanceCount": gap.get("encodedRawScalarNoFixedAdvanceCount"),
        "encodedRawScalarNoBranchJumpCount": gap.get("encodedRawScalarNoBranchJumpCount"),
        "encodedRawScalarBranchAttachedCount": gap.get("encodedRawScalarBranchAttachedCount"),
        "encodedRawScalarScalarOnlyCount": gap.get("encodedRawScalarScalarOnlyCount"),
        "encodedRawScalarKindCounts": gap.get("encodedRawScalarKindCounts") or {},
        "encodedRawScalarHandlerSectionCounts": gap.get(
            "encodedRawScalarHandlerSectionCounts"
        ) or {},
        "rootTailIsolationScan": gap.get("rootTailIsolationScan") or {},
        "rootTailDescriptorIsolated": gap.get("rootTailDescriptorIsolated"),
        "rootTailBranchTargetClassCounts": gap.get("rootTailBranchTargetClassCounts") or {},
        "rootTailBranchTargetSectionCounts": gap.get("rootTailBranchTargetSectionCounts") or {},
        "rootTailBranchToFillFragmentCount": gap.get("rootTailBranchToFillFragmentCount"),
        "rootTailBranchToCurrentReaderCount": gap.get("rootTailBranchToCurrentReaderCount"),
        "rootTailFixedFallthroughToFillCount": gap.get("rootTailFixedFallthroughToFillCount"),
        "rootTailBranchClosureClassification": gap.get("rootTailBranchClosureClassification"),
        "rootTailBranchClosureNodeCount": gap.get("rootTailBranchClosureNodeCount"),
        "rootTailBranchClosureBranchSeedCount": gap.get("rootTailBranchClosureBranchSeedCount"),
        "rootTailBranchClosureEdgeCount": gap.get("rootTailBranchClosureEdgeCount"),
        "rootTailBranchClosureTailNodeReachFillCount": gap.get(
            "rootTailBranchClosureTailNodeReachFillCount"
        ),
        "rootTailBranchClosureTailNodeReachCurrentReaderCount": gap.get(
            "rootTailBranchClosureTailNodeReachCurrentReaderCount"
        ),
        "rootTailBranchClosureBranchSeedReachFillCount": gap.get(
            "rootTailBranchClosureBranchSeedReachFillCount"
        ),
        "rootTailBranchClosureBranchSeedReachCurrentReaderCount": gap.get(
            "rootTailBranchClosureBranchSeedReachCurrentReaderCount"
        ),
        "rootTailBranchClosureProofFound": gap.get("rootTailBranchClosureProofFound"),
        "rootTailBranchClosureOutsideSuccessorCount": gap.get(
            "rootTailBranchClosureOutsideSuccessorCount"
        ),
        "rootTailBranchClosureOutsideSuccessorClassCounts": gap.get(
            "rootTailBranchClosureOutsideSuccessorClassCounts"
        ) or {},
        "rootTailBranchClosureOutsideSuccessorSectionCounts": gap.get(
            "rootTailBranchClosureOutsideSuccessorSectionCounts"
        ) or {},
        "rootTailBranchClosureOutsideSuccessorSampleRows": gap.get(
            "rootTailBranchClosureOutsideSuccessorSampleRows"
        )
        or [],
        "publicPredecessorReached": gap.get("publicPredecessorReached"),
        "runtimeObservedFill": gap.get("runtimeObservedFill"),
        "fieldEntrySequenceCount": gap.get("fieldEntrySequenceCount"),
        "fieldEntryCandidateCount": gap.get("fieldEntryCandidateCount"),
        "fieldEntrySnapshotCount": gap.get("fieldEntrySnapshotCount"),
        "fieldEntrySnapshotRouteCandidateCount": gap.get("fieldEntrySnapshotRouteCandidateCount"),
        "fieldEntryFinalSelectorCounts": gap.get("fieldEntryFinalSelectorCounts") or {},
        "fieldEntryFinalCameraTileCounts": gap.get("fieldEntryFinalCameraTileCounts") or {},
        "fieldEntrySnapshotSelectorCounts": gap.get("fieldEntrySnapshotSelectorCounts") or {},
        "fieldEntrySnapshotCameraTileCounts": gap.get("fieldEntrySnapshotCameraTileCounts") or {},
        "fieldEntryClassificationCounts": gap.get("fieldEntryClassificationCounts") or {},
        "fieldEntryRouteCandidateFound": gap.get("fieldEntryRouteCandidateFound"),
        "fieldEntryInputStatus": gap.get("fieldEntryInputStatus"),
        "coordinateSourceClassification": gap.get("coordinateSourceClassification"),
        "coordinateSourceRejectionClassification": gap.get(
            "coordinateSourceRejectionClassification"
        ),
        "coordinateSourcePromotionStatus": gap.get("coordinateSourcePromotionStatus"),
        "coordinateSourceFinalSelector": gap.get("coordinateSourceFinalSelector"),
        "coordinateSourceFinalCameraTile": gap.get("coordinateSourceFinalCameraTile") or {},
        "coordinateSourcePublicStartPointerTableTileHitCount": gap.get(
            "coordinateSourcePublicStartPointerTableTileHitCount"
        ),
        "coordinateSourcePublicStartStaticBaseHitCount": gap.get(
            "coordinateSourcePublicStartStaticBaseHitCount"
        ),
        "coordinateSourcePublicStartTrailRingHitCount": gap.get(
            "coordinateSourcePublicStartTrailRingHitCount"
        ),
        "coordinateSourcePublicStartImageHitCount": gap.get(
            "coordinateSourcePublicStartImageHitCount"
        ),
        "coordinateSourceObservedTrailPointerTableTileHitCount": gap.get(
            "coordinateSourceObservedTrailPointerTableTileHitCount"
        ),
        "coordinateSourceObservedTrailStaticBaseHitCount": gap.get(
            "coordinateSourceObservedTrailStaticBaseHitCount"
        ),
        "coordinateSourceObservedTrailTrailRingHitCount": gap.get(
            "coordinateSourceObservedTrailTrailRingHitCount"
        ),
        "coordinateSourceObservedTrailImageHitCount": gap.get(
            "coordinateSourceObservedTrailImageHitCount"
        ),
        "coordinateSourceReciprocalPointerTableTileHitCount": gap.get(
            "coordinateSourceReciprocalPointerTableTileHitCount"
        ),
        "coordinateSourceReciprocalStaticBaseHitCount": gap.get(
            "coordinateSourceReciprocalStaticBaseHitCount"
        ),
        "coordinateSourceReciprocalTrailRingHitCount": gap.get(
            "coordinateSourceReciprocalTrailRingHitCount"
        ),
        "coordinateSourceReciprocalImageHitCount": gap.get(
            "coordinateSourceReciprocalImageHitCount"
        ),
        "runtimeBranchStateAllZero": gap.get("runtimeBranchStateAllZero"),
        "staticNoLocalTailReset": gap.get("staticNoLocalTailReset"),
        "staticResetScopeClosed": gap.get("staticResetScopeClosed"),
        "selectorOrderResetGapClosed": gap.get("selectorOrderResetGapClosed"),
        "predecessorToCurrentForwardBridgeFound": gap.get("predecessorToCurrentForwardBridgeFound"),
        "reverseReuseBeforeFillCount": gap.get("reverseReuseBeforeFillCount"),
        "reverseReuseFillSiteHitCount": gap.get("reverseReuseFillSiteHitCount"),
        "predecessorDispatchSliceRuntimeProofFound": gap.get(
            "predecessorDispatchSliceRuntimeProofFound"
        ),
        "predecessorDispatchTableProofFound": gap.get("predecessorDispatchTableProofFound"),
        "predecessorDispatchTableFailedGateIds": gap.get(
            "predecessorDispatchTableFailedGateIds"
        )
        or [],
        "predecessorDispatchTableMissingEvidence": gap.get(
            "predecessorDispatchTableMissingEvidence"
        )
        or [],
        "predecessorDispatchTableEvidenceRefCount": gap.get(
            "predecessorDispatchTableEvidenceRefCount"
        ),
        "predecessorDescriptorDependsOnSaveSelectorSliceModel": gap.get(
            "predecessorDescriptorDependsOnSaveSelectorSliceModel"
        ),
        "predecessorDispatchRawGeneralDiffersFromSliceCount": gap.get(
            "predecessorDispatchRawGeneralDiffersFromSliceCount"
        ),
        "predecessorDispatchSliceGenericByteReachableCount": gap.get(
            "predecessorDispatchSliceGenericByteReachableCount"
        ),
        "predecessorDispatchSliceRequiresTableBaseSwitchCount": gap.get(
            "predecessorDispatchSliceRequiresTableBaseSwitchCount"
        ),
        "predecessorDispatchDynamicIndexedDispatchRowCount": gap.get(
            "predecessorDispatchDynamicIndexedDispatchRowCount"
        ),
        "predecessorDispatchDynamicDwordScaledDispatchRowCount": gap.get(
            "predecessorDispatchDynamicDwordScaledDispatchRowCount"
        ),
        "predecessorDispatchDynamicScopeTableCallbackCount": gap.get(
            "predecessorDispatchDynamicScopeTableCallbackCount"
        ),
        "predecessorDispatchDynamicScopeTableCallbackSites": gap.get(
            "predecessorDispatchDynamicScopeTableCallbackSites"
        ) or [],
        "predecessorDispatchDynamicScopeTableCallbackRows": gap.get(
            "predecessorDispatchDynamicScopeTableCallbackRows"
        ) or [],
        "predecessorDispatchDynamicSaveSelectorTableImmediateNearCount": gap.get(
            "predecessorDispatchDynamicSaveSelectorTableImmediateNearCount"
        ),
        "predecessorDispatchDynamicSaveSelectorTableBaseCandidateCount": gap.get(
            "predecessorDispatchDynamicSaveSelectorTableBaseCandidateCount"
        ),
        "predecessorDispatchDynamicSaveSelectorTableBaseCandidateSites": gap.get(
            "predecessorDispatchDynamicSaveSelectorTableBaseCandidateSites"
        ) or [],
        "predecessorDispatchDynamicSaveSelectorTableBaseCandidateRows": gap.get(
            "predecessorDispatchDynamicSaveSelectorTableBaseCandidateRows"
        ) or [],
        "predecessorDispatchDynamicSaveSelectorTableBaseSwitchStaticCandidateFound": gap.get(
            "predecessorDispatchDynamicSaveSelectorTableBaseSwitchStaticCandidateFound"
        ),
        "predecessorDispatchSaveSelectorTableBaseArithmeticRowCount": gap.get(
            "predecessorDispatchSaveSelectorTableBaseArithmeticRowCount"
        ),
        "predecessorDispatchSaveSelectorTableBaseArithmeticCandidateCount": gap.get(
            "predecessorDispatchSaveSelectorTableBaseArithmeticCandidateCount"
        ),
        "predecessorDispatchSaveSelectorTableBaseArithmeticCandidateFound": gap.get(
            "predecessorDispatchSaveSelectorTableBaseArithmeticCandidateFound"
        ),
        "predecessorDispatchTableBaseRejectionClassification": gap.get(
            "predecessorDispatchTableBaseRejectionClassification"
        ),
        "predecessorDispatchTableBaseAuditRows": (
            gap.get("predecessorDispatchTableBaseAuditRows") or []
        ),
        "predecessorDispatchTableBaseAuditRowCount": len(
            gap.get("predecessorDispatchTableBaseAuditRows") or []
        ),
        "rawGenericClassification": gap.get("rawGenericClassification"),
        "rawGenericHandlerCount": gap.get("rawGenericHandlerCount"),
        "rawGenericRouteImmediateHitCount": gap.get("rawGenericRouteImmediateHitCount"),
        "rawGenericFillImmediateHitCount": gap.get("rawGenericFillImmediateHitCount"),
        "rawGenericCurrentImmediateHitCount": gap.get("rawGenericCurrentImmediateHitCount"),
        "rawGenericSelectedPointerImmediateHitCount": gap.get(
            "rawGenericSelectedPointerImmediateHitCount"
        ),
        "rawGenericBranchStateImmediateHitCount": gap.get(
            "rawGenericBranchStateImmediateHitCount"
        ),
        "rawGenericDirectCallCount": gap.get("rawGenericDirectCallCount"),
        "rawGenericMappedDirectCallCount": gap.get("rawGenericMappedDirectCallCount"),
        "rawGenericUnmappedDirectCallCount": gap.get("rawGenericUnmappedDirectCallCount"),
        "rawGenericMappedDirectCallTargets": gap.get("rawGenericMappedDirectCallTargets") or [],
        "rawGenericRouteDirectTransferHitCount": gap.get(
            "rawGenericRouteDirectTransferHitCount"
        ),
        "rawGenericFillDirectTransferHitCount": gap.get(
            "rawGenericFillDirectTransferHitCount"
        ),
        "rawGenericOneHopMappedCalleeCount": gap.get("rawGenericOneHopMappedCalleeCount"),
        "rawGenericOneHopRouteImmediateHitCount": gap.get(
            "rawGenericOneHopRouteImmediateHitCount"
        ),
        "rawGenericOneHopFillImmediateHitCount": gap.get("rawGenericOneHopFillImmediateHitCount"),
        "rawGenericOneHopCurrentImmediateHitCount": gap.get(
            "rawGenericOneHopCurrentImmediateHitCount"
        ),
        "rawGenericOneHopSelectedPointerImmediateHitCount": gap.get(
            "rawGenericOneHopSelectedPointerImmediateHitCount"
        ),
        "rawGenericOneHopBranchStateImmediateHitCount": gap.get(
            "rawGenericOneHopBranchStateImmediateHitCount"
        ),
        "rawGenericOneHopRouteDirectTransferHitCount": gap.get(
            "rawGenericOneHopRouteDirectTransferHitCount"
        ),
        "rawGenericOneHopFillDirectTransferHitCount": gap.get(
            "rawGenericOneHopFillDirectTransferHitCount"
        ),
        "rawGenericOneHopRouteProofFound": gap.get("rawGenericOneHopRouteProofFound"),
        "rawGenericCallGraphClassification": gap.get("rawGenericCallGraphClassification"),
        "rawGenericCallGraphProofFound": gap.get("rawGenericCallGraphProofFound"),
        "rawGenericCallGraphMaxDepth": gap.get("rawGenericCallGraphMaxDepth"),
        "rawGenericCallGraphReachableFunctionCount": gap.get(
            "rawGenericCallGraphReachableFunctionCount"
        ),
        "rawGenericCallGraphDirectCallEdgeCount": gap.get(
            "rawGenericCallGraphDirectCallEdgeCount"
        ),
        "rawGenericCallGraphMappedDirectCallEdgeCount": gap.get(
            "rawGenericCallGraphMappedDirectCallEdgeCount"
        ),
        "rawGenericCallGraphTextDirectCallEdgeCount": gap.get(
            "rawGenericCallGraphTextDirectCallEdgeCount"
        ),
        "rawGenericCallGraphRouteImmediateHitCount": gap.get(
            "rawGenericCallGraphRouteImmediateHitCount"
        ),
        "rawGenericCallGraphFillImmediateHitCount": gap.get(
            "rawGenericCallGraphFillImmediateHitCount"
        ),
        "rawGenericCallGraphCurrentImmediateHitCount": gap.get(
            "rawGenericCallGraphCurrentImmediateHitCount"
        ),
        "rawGenericCallGraphSelectedPointerImmediateHitCount": gap.get(
            "rawGenericCallGraphSelectedPointerImmediateHitCount"
        ),
        "rawGenericCallGraphBranchStateImmediateHitCount": gap.get(
            "rawGenericCallGraphBranchStateImmediateHitCount"
        ),
        "rawGenericCallGraphRouteDirectTransferHitCount": gap.get(
            "rawGenericCallGraphRouteDirectTransferHitCount"
        ),
        "rawGenericCallGraphFillDirectTransferHitCount": gap.get(
            "rawGenericCallGraphFillDirectTransferHitCount"
        ),
        "rawGenericCallGraphDepthSensitivityMaxDepthChecked": gap.get(
            "rawGenericCallGraphDepthSensitivityMaxDepthChecked"
        ),
        "rawGenericCallGraphDepthSensitivityProofAbsentAcrossCheckedDepths": gap.get(
            "rawGenericCallGraphDepthSensitivityProofAbsentAcrossCheckedDepths"
        ),
        "rawGenericCallGraphDepthSensitivityCountsStableAtAndBeyondDefaultDepth": gap.get(
            "rawGenericCallGraphDepthSensitivityCountsStableAtAndBeyondDefaultDepth"
        ),
        "rawGenericRouteProofFound": gap.get("rawGenericRouteProofFound"),
        "predecessorFillProofGateRows": gap.get("predecessorFillProofGateRows") or [],
        "predecessorFillProofGateCount": gap.get("predecessorFillProofGateCount"),
        "predecessorFillProofGatePassCount": gap.get("predecessorFillProofGatePassCount"),
        "predecessorFillProofGateBlockedCount": gap.get("predecessorFillProofGateBlockedCount"),
        "predecessorFillProofGateBlockedIds": gap.get("predecessorFillProofGateBlockedIds") or [],
        "predecessorFillAllProofGatesBlocked": gap.get("predecessorFillAllProofGatesBlocked"),
        "failedPredecessorFillOrderGateIds": gap.get("failedPredecessorFillOrderGateIds") or [],
        "missingEvidence": gap.get("missingEvidence") or [],
        "evidenceRefs": gap.get("evidenceRefs") or [],
        "evidenceRefCount": gap.get("evidenceRefCount"),
        "routeOrderProven": gap.get("routeOrderProven"),
        "selectorMergeGapOpen": gap.get("selectorMergeGapOpen"),
        "routeOrderAndSelectorMergeClosed": gap.get("routeOrderAndSelectorMergeClosed"),
        "selectorMergeShapeOnly": gap.get("selectorMergeShapeOnly"),
        "selectorMergeForwardBridgeAbsent": gap.get("selectorMergeForwardBridgeAbsent"),
        "selectorMergeReverseReuseBeforeFillOnly": gap.get(
            "selectorMergeReverseReuseBeforeFillOnly"
        ),
        "selectorMergeRuntimeProofFound": gap.get("selectorMergeRuntimeProofFound"),
        "selectorMergeClosureProofFound": gap.get("selectorMergeClosureProofFound"),
        "predecessorPersistenceUsableForCurrent": gap.get(
            "predecessorPersistenceUsableForCurrent"
        ),
        "proofFound": gap.get("proofFound"),
        "promotionStatus": gap.get("promotionStatus"),
        "conclusion": gap.get("conclusion"),
    }


def predecessor_fill_execution_order_gap_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    root_tail = evidence.get("rootTailIsolationScan") or {}
    root_tail_before = root_tail.get("immediatePredecessorRow") or {}
    return (
        f"{evidence.get('predecessorSelector')}->{evidence.get('currentSelector')} "
        f"fills={','.join(evidence.get('fillSites') or []) or '-'} "
        f"trace={evidence.get('localFillTraceStartHex')}->{evidence.get('localFillTraceStopHex')} "
        f"stop={evidence.get('localFillTraceStopReason')} "
        f"containsFills={evidence.get('localFillTraceContainsAllFillSites')} "
        f"reachesReader={evidence.get('localFillTraceReachesCurrentReader')} "
        f"rootEntryReachesFills={evidence.get('rootEntryFixedTraversalFillSitesReachable')} "
        f"directFillRefs={evidence.get('directFillSiteRefCounts')} "
        "fillEntryRefs="
        f"{(evidence.get('fillEntryCandidateScan') or {}).get('allDwordRefCount')} "
        "fillEntryRootBranchTargets="
        f"{(evidence.get('fillEntryCandidateScan') or {}).get('rootBranchTargetCandidateCount')} "
        f"encodedEntry={evidence.get('encodedFillEntryClassification')} "
        f"encodedRaw={evidence.get('encodedFillEntryRawScalarCandidateCount')} "
        f"encodedTailRaw={evidence.get('encodedFillEntryRootTailRawScalarCandidateCount')} "
        f"encodedPromoting={evidence.get('encodedFillEntryPromotingCandidateCount')} "
        f"rawScalarReject={evidence.get('encodedRawScalarRejectionClassification')} "
        "rawScalarNoFixed/noBranch/branchAttached/scalarOnly="
        f"{evidence.get('encodedRawScalarNoFixedAdvanceCount')}/"
        f"{evidence.get('encodedRawScalarNoBranchJumpCount')}/"
        f"{evidence.get('encodedRawScalarBranchAttachedCount')}/"
        f"{evidence.get('encodedRawScalarScalarOnlyCount')} "
        "rootTail="
        f"{root_tail.get('distanceHex')}/{root_tail.get('dwordCount')} "
        f"rootTailIsolated={evidence.get('rootTailDescriptorIsolated')} "
        f"rootTailBranchClasses={evidence.get('rootTailBranchTargetClassCounts')} "
        f"rootTailBranchSections={evidence.get('rootTailBranchTargetSectionCounts')} "
        f"rootTailBranchToFill={evidence.get('rootTailBranchToFillFragmentCount')} "
        f"rootTailBranchToReader={evidence.get('rootTailBranchToCurrentReaderCount')} "
        f"rootTailFixedToFill={evidence.get('rootTailFixedFallthroughToFillCount')} "
        "rootTailClosure="
        f"{evidence.get('rootTailBranchClosureBranchSeedCount')}/"
        f"{evidence.get('rootTailBranchClosureEdgeCount')}/"
        f"{evidence.get('rootTailBranchClosureBranchSeedReachFillCount')}/"
        f"{evidence.get('rootTailBranchClosureBranchSeedReachCurrentReaderCount')} "
        "rootTailClosureOutside="
        f"{evidence.get('rootTailBranchClosureOutsideSuccessorCount')}/"
        f"{evidence.get('rootTailBranchClosureOutsideSuccessorClassCounts')}/"
        f"{evidence.get('rootTailBranchClosureOutsideSuccessorSectionCounts')} "
        f"rootTailClosureClass={evidence.get('rootTailBranchClosureClassification')} "
        "rootTailBeforeFill="
        f"{root_tail_before.get('handlerSection')}/{root_tail_before.get('handlerVaHex')} "
        f"sliceRuntimeProof={evidence.get('predecessorDispatchSliceRuntimeProofFound')} "
        f"dispatchTableProof={evidence.get('predecessorDispatchTableProofFound')} "
        f"dispatchFailedGates={list_text(evidence.get('predecessorDispatchTableFailedGateIds'))} "
        f"dispatchMissingEvidenceCount={len(evidence.get('predecessorDispatchTableMissingEvidence') or [])} "
        f"dispatchEvidenceRefs={evidence.get('predecessorDispatchTableEvidenceRefCount')} "
        f"descriptorDependsOnSlice={evidence.get('predecessorDescriptorDependsOnSaveSelectorSliceModel')} "
        f"rawGeneralDiffers={evidence.get('predecessorDispatchRawGeneralDiffersFromSliceCount')} "
        f"sliceByteReachable={evidence.get('predecessorDispatchSliceGenericByteReachableCount')} "
        f"sliceRequiresTableBase={evidence.get('predecessorDispatchSliceRequiresTableBaseSwitchCount')} "
        "sliceDynamic="
        f"{evidence.get('predecessorDispatchDynamicIndexedDispatchRowCount')}/"
        f"{evidence.get('predecessorDispatchDynamicScopeTableCallbackCount')}/"
        f"{evidence.get('predecessorDispatchDynamicSaveSelectorTableImmediateNearCount')} "
        f"sliceDynamicScopeSites={list_text(evidence.get('predecessorDispatchDynamicScopeTableCallbackSites'))} "
        f"sliceDynamicTableBaseCandidates={evidence.get('predecessorDispatchDynamicSaveSelectorTableBaseCandidateCount')} "
        "sliceTableBaseArithmetic="
        f"{evidence.get('predecessorDispatchSaveSelectorTableBaseArithmeticRowCount')}/"
        f"{evidence.get('predecessorDispatchSaveSelectorTableBaseArithmeticCandidateCount')} "
        f"sliceDynamicTableBase={evidence.get('predecessorDispatchDynamicSaveSelectorTableBaseSwitchStaticCandidateFound')} "
        f"sliceDynamicTableBaseCandidateSites={list_text(evidence.get('predecessorDispatchDynamicSaveSelectorTableBaseCandidateSites'))} "
        f"tableBaseReject={evidence.get('predecessorDispatchTableBaseRejectionClassification')} "
        f"rawGeneric={evidence.get('rawGenericClassification')} "
        f"rawGenericHandlers={evidence.get('rawGenericHandlerCount')} "
        "rawGenericRoute/fill/currentImm="
        f"{evidence.get('rawGenericRouteImmediateHitCount')}/"
        f"{evidence.get('rawGenericFillImmediateHitCount')}/"
        f"{evidence.get('rawGenericCurrentImmediateHitCount')} "
        "rawGenericSelected/branchImm="
        f"{evidence.get('rawGenericSelectedPointerImmediateHitCount')}/"
        f"{evidence.get('rawGenericBranchStateImmediateHitCount')} "
        f"rawGenericCalls={evidence.get('rawGenericDirectCallCount')} "
        f"rawGenericMappedCalls={evidence.get('rawGenericMappedDirectCallCount')} "
        f"rawGenericMappedTargets={','.join(evidence.get('rawGenericMappedDirectCallTargets') or []) or '-'} "
        "rawGenericOneHopRoute/fill/currentImm="
        f"{evidence.get('rawGenericOneHopRouteImmediateHitCount')}/"
        f"{evidence.get('rawGenericOneHopFillImmediateHitCount')}/"
        f"{evidence.get('rawGenericOneHopCurrentImmediateHitCount')} "
        "rawGenericOneHopSelected/branchImm="
        f"{evidence.get('rawGenericOneHopSelectedPointerImmediateHitCount')}/"
        f"{evidence.get('rawGenericOneHopBranchStateImmediateHitCount')} "
        "rawGenericRoute/fillTransfers="
        f"{evidence.get('rawGenericRouteDirectTransferHitCount')}/"
        f"{evidence.get('rawGenericFillDirectTransferHitCount')} "
        "rawGenericOneHopRoute/fillTransfers="
        f"{evidence.get('rawGenericOneHopRouteDirectTransferHitCount')}/"
        f"{evidence.get('rawGenericOneHopFillDirectTransferHitCount')} "
        f"rawGenericOneHopRouteProof={evidence.get('rawGenericOneHopRouteProofFound')} "
        f"rawGenericCallGraph={evidence.get('rawGenericCallGraphClassification')} "
        f"rawGenericCallGraphDepth={evidence.get('rawGenericCallGraphMaxDepth')} "
        "rawGenericCallGraphFunctions/Edges="
        f"{evidence.get('rawGenericCallGraphReachableFunctionCount')}/"
        f"{evidence.get('rawGenericCallGraphDirectCallEdgeCount')} "
        "rawGenericCallGraphRoute/fill/currentImm="
        f"{evidence.get('rawGenericCallGraphRouteImmediateHitCount')}/"
        f"{evidence.get('rawGenericCallGraphFillImmediateHitCount')}/"
        f"{evidence.get('rawGenericCallGraphCurrentImmediateHitCount')} "
        "rawGenericCallGraphSelected/branchImm="
        f"{evidence.get('rawGenericCallGraphSelectedPointerImmediateHitCount')}/"
        f"{evidence.get('rawGenericCallGraphBranchStateImmediateHitCount')} "
        "rawGenericCallGraphRoute/fillTransfers="
        f"{evidence.get('rawGenericCallGraphRouteDirectTransferHitCount')}/"
        f"{evidence.get('rawGenericCallGraphFillDirectTransferHitCount')} "
        "rawGenericCallGraphDepthSensitivity="
        f"{evidence.get('rawGenericCallGraphDepthSensitivityMaxDepthChecked')}/"
        f"{evidence.get('rawGenericCallGraphDepthSensitivityProofAbsentAcrossCheckedDepths')}/"
        f"{evidence.get('rawGenericCallGraphDepthSensitivityCountsStableAtAndBeyondDefaultDepth')} "
        f"rawGenericCallGraphProof={evidence.get('rawGenericCallGraphProofFound')} "
        f"rawGenericRouteProof={evidence.get('rawGenericRouteProofFound')} "
        f"publicPred={evidence.get('publicPredecessorReached')} "
        f"runtimeFill={evidence.get('runtimeObservedFill')} "
        f"fieldEntrySeq={evidence.get('fieldEntrySequenceCount')} "
        f"fieldEntryCandidates={evidence.get('fieldEntryCandidateCount')} "
        f"fieldEntrySnapshots={evidence.get('fieldEntrySnapshotCount')} "
        f"fieldEntrySnapshotRouteCandidates={evidence.get('fieldEntrySnapshotRouteCandidateCount')} "
        f"fieldEntrySelectors={evidence.get('fieldEntryFinalSelectorCounts')} "
        f"fieldEntryCameras={evidence.get('fieldEntryFinalCameraTileCounts')} "
        f"fieldEntryStatus={evidence.get('fieldEntryInputStatus')} "
        f"coordinateSource={evidence.get('coordinateSourceClassification')}/"
        f"{evidence.get('coordinateSourceRejectionClassification')} "
        "coordinateStartPtrStaticTrailImage="
        f"{evidence.get('coordinateSourcePublicStartPointerTableTileHitCount')}/"
        f"{evidence.get('coordinateSourcePublicStartStaticBaseHitCount')}/"
        f"{evidence.get('coordinateSourcePublicStartTrailRingHitCount')}/"
        f"{evidence.get('coordinateSourcePublicStartImageHitCount')} "
        "coordinateTrailPtrStaticTrailImage="
        f"{evidence.get('coordinateSourceObservedTrailPointerTableTileHitCount')}/"
        f"{evidence.get('coordinateSourceObservedTrailStaticBaseHitCount')}/"
        f"{evidence.get('coordinateSourceObservedTrailTrailRingHitCount')}/"
        f"{evidence.get('coordinateSourceObservedTrailImageHitCount')} "
        "coordinateReciprocalPtrStaticTrailImage="
        f"{evidence.get('coordinateSourceReciprocalPointerTableTileHitCount')}/"
        f"{evidence.get('coordinateSourceReciprocalStaticBaseHitCount')}/"
        f"{evidence.get('coordinateSourceReciprocalTrailRingHitCount')}/"
        f"{evidence.get('coordinateSourceReciprocalImageHitCount')} "
        f"coordinateSourcePromotion={evidence.get('coordinateSourcePromotionStatus')} "
        f"allZero={evidence.get('runtimeBranchStateAllZero')} "
        f"staticClosed={evidence.get('staticResetScopeClosed')} "
        f"forwardBridge={evidence.get('predecessorToCurrentForwardBridgeFound')} "
        f"reverseBeforeFill={evidence.get('reverseReuseBeforeFillCount')} "
        f"reverseFillSite={evidence.get('reverseReuseFillSiteHitCount')} "
        f"routeOrder={evidence.get('routeOrderProven')} "
        f"mergeGap={evidence.get('selectorMergeGapOpen')} "
        f"routeMergeClosed={evidence.get('routeOrderAndSelectorMergeClosed')} "
        f"mergeRuntimeProof={evidence.get('selectorMergeRuntimeProofFound')} "
        f"mergeClosureProof={evidence.get('selectorMergeClosureProofFound')} "
        f"mergePersistenceUsable={evidence.get('predecessorPersistenceUsableForCurrent')} "
        "proofGates="
        f"{evidence.get('predecessorFillProofGateBlockedCount')}/"
        f"{evidence.get('predecessorFillProofGateCount')} "
        f"pass={evidence.get('predecessorFillProofGatePassCount')} "
        f"allBlocked={evidence.get('predecessorFillAllProofGatesBlocked')} "
        f"blockedIds={','.join(evidence.get('predecessorFillProofGateBlockedIds') or []) or '-'} "
        "failedFillOrderGates="
        f"{','.join(evidence.get('failedPredecessorFillOrderGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"proof={evidence.get('proofFound')} "
        f"status={evidence.get('promotionStatus')}"
    )


def predecessor_fill_site_execution_context_for(source: str, target: str, context: dict | None) -> dict | None:
    if not context:
        return None
    if context.get("source") != source or context.get("target") != target:
        return None
    return {
        "predecessorSelector": context.get("predecessorSelector"),
        "currentSelector": context.get("currentSelector"),
        "currentReaderHex": context.get("currentReaderHex"),
        "fillSites": context.get("fillSites") or [],
        "branchStatePollCount": context.get("branchStatePollCount"),
        "branchStatePollSequenceCount": context.get("branchStatePollSequenceCount"),
        "branchStatePollSampleCount": context.get("branchStatePollSampleCount"),
        "branchStatePollPublicPredecessorHitCount": context.get(
            "branchStatePollPublicPredecessorHitCount"
        ),
        "branchStatePollCurrentRootHitCount": context.get("branchStatePollCurrentRootHitCount"),
        "branchStatePollRouteSelectorHitCount": context.get("branchStatePollRouteSelectorHitCount"),
        "branchStatePollAllZeroCount": context.get("branchStatePollAllZeroCount"),
        "branchStatePollFillMatchCount": context.get("branchStatePollFillMatchCount"),
        "branchStatePollMovementOrTargetCount": context.get("branchStatePollMovementOrTargetCount"),
        "branchStatePollMovementOrTargetSampleCount": context.get(
            "branchStatePollMovementOrTargetSampleCount"
        ),
        "branchStatePollMovementOrTargetFillMatchCount": context.get(
            "branchStatePollMovementOrTargetFillMatchCount"
        ),
        "branchStatePollMovementOrTargetAllZeroCount": context.get(
            "branchStatePollMovementOrTargetAllZeroCount"
        ),
        "branchStatePollTargetObservationCount": context.get("branchStatePollTargetObservationCount"),
        "branchStatePollTargetObservationSampleCount": context.get(
            "branchStatePollTargetObservationSampleCount"
        ),
        "branchStatePollTargetObservationFillMatchCount": context.get(
            "branchStatePollTargetObservationFillMatchCount"
        ),
        "branchStatePollTargetObservationAllZeroCount": context.get(
            "branchStatePollTargetObservationAllZeroCount"
        ),
        "branchStatePollTargetObservationRouteSelectorHitCount": context.get(
            "branchStatePollTargetObservationRouteSelectorHitCount"
        ),
        "branchStatePollTargetObservationCurrentRootHitCount": context.get(
            "branchStatePollTargetObservationCurrentRootHitCount"
        ),
        "branchStatePollCameraOnlyTargetCount": context.get(
            "branchStatePollCameraOnlyTargetCount"
        ),
        "branchStatePollActorOrTrailTargetCount": context.get(
            "branchStatePollActorOrTrailTargetCount"
        ),
        "branchStatePollTargetObservationStatus": context.get(
            "branchStatePollTargetObservationStatus"
        ),
        "localFillTraceStartHex": context.get("localFillTraceStartHex"),
        "localFillTraceStopHex": context.get("localFillTraceStopHex"),
        "localFillTraceStopReason": context.get("localFillTraceStopReason"),
        "rootEntryFixedTraversalFillSitesReachable": context.get(
            "rootEntryFixedTraversalFillSitesReachable"
        ),
        "rootEntryFixedTraversalVisitedNodeCount": context.get(
            "rootEntryFixedTraversalVisitedNodeCount"
        ),
        "rootEntryFixedTraversalStopRows": context.get("rootEntryFixedTraversalStopRows") or [],
        "encodedFillEntryCandidateScan": context.get("encodedFillEntryCandidateScan") or {},
        "encodedFillEntryRawScalarCandidateCount": context.get(
            "encodedFillEntryRawScalarCandidateCount"
        ),
        "encodedFillEntryRootTailRawScalarCandidateCount": context.get(
            "encodedFillEntryRootTailRawScalarCandidateCount"
        ),
        "encodedFillEntryBranchAttachedEncodedFieldCount": context.get(
            "encodedFillEntryBranchAttachedEncodedFieldCount"
        ),
        "encodedFillEntryModeledControlFlowCandidateCount": context.get(
            "encodedFillEntryModeledControlFlowCandidateCount"
        ),
        "encodedFillEntryPromotingCandidateCount": context.get(
            "encodedFillEntryPromotingCandidateCount"
        ),
        "encodedFillEntryClassification": context.get("encodedFillEntryClassification"),
        "encodedRawScalarRejectionClassification": context.get(
            "encodedRawScalarRejectionClassification"
        ),
        "encodedRawScalarAllScalarOnly": context.get("encodedRawScalarAllScalarOnly"),
        "encodedRawScalarNoFixedAdvanceCount": context.get("encodedRawScalarNoFixedAdvanceCount"),
        "encodedRawScalarNoBranchJumpCount": context.get("encodedRawScalarNoBranchJumpCount"),
        "encodedRawScalarBranchAttachedCount": context.get("encodedRawScalarBranchAttachedCount"),
        "encodedRawScalarScalarOnlyCount": context.get("encodedRawScalarScalarOnlyCount"),
        "encodedRawScalarKindCounts": context.get("encodedRawScalarKindCounts") or {},
        "encodedRawScalarHandlerSectionCounts": context.get(
            "encodedRawScalarHandlerSectionCounts"
        ) or {},
        "rootTailDescriptorIsolated": context.get("rootTailDescriptorIsolated"),
        "rootTailDistanceHex": context.get("rootTailDistanceHex"),
        "rootTailDwordCount": context.get("rootTailDwordCount"),
        "rootTailBranchTargetClassCounts": context.get("rootTailBranchTargetClassCounts") or {},
        "rootTailBranchTargetSectionCounts": context.get("rootTailBranchTargetSectionCounts") or {},
        "rootTailBranchToFillFragmentCount": context.get("rootTailBranchToFillFragmentCount"),
        "rootTailBranchToCurrentReaderCount": context.get("rootTailBranchToCurrentReaderCount"),
        "rootTailFixedFallthroughToFillCount": context.get("rootTailFixedFallthroughToFillCount"),
        "rootTailBranchClosureClassification": context.get("rootTailBranchClosureClassification"),
        "rootTailBranchClosureNodeCount": context.get("rootTailBranchClosureNodeCount"),
        "rootTailBranchClosureBranchSeedCount": context.get("rootTailBranchClosureBranchSeedCount"),
        "rootTailBranchClosureEdgeCount": context.get("rootTailBranchClosureEdgeCount"),
        "rootTailBranchClosureTailNodeReachFillCount": context.get(
            "rootTailBranchClosureTailNodeReachFillCount"
        ),
        "rootTailBranchClosureTailNodeReachCurrentReaderCount": context.get(
            "rootTailBranchClosureTailNodeReachCurrentReaderCount"
        ),
        "rootTailBranchClosureBranchSeedReachFillCount": context.get(
            "rootTailBranchClosureBranchSeedReachFillCount"
        ),
        "rootTailBranchClosureBranchSeedReachCurrentReaderCount": context.get(
            "rootTailBranchClosureBranchSeedReachCurrentReaderCount"
        ),
        "rootTailBranchClosureProofFound": context.get("rootTailBranchClosureProofFound"),
        "rootTailBranchClosureOutsideSuccessorCount": context.get(
            "rootTailBranchClosureOutsideSuccessorCount"
        ),
        "rootTailBranchClosureOutsideSuccessorClassCounts": context.get(
            "rootTailBranchClosureOutsideSuccessorClassCounts"
        )
        or {},
        "rootTailBranchClosureOutsideSuccessorSectionCounts": context.get(
            "rootTailBranchClosureOutsideSuccessorSectionCounts"
        )
        or {},
        "rootTailBranchClosureOutsideSuccessorSampleRows": context.get(
            "rootTailBranchClosureOutsideSuccessorSampleRows"
        )
        or [],
        "rootTailImmediatePredecessorHandlerSection": context.get(
            "rootTailImmediatePredecessorHandlerSection"
        ),
        "rootTailImmediatePredecessorHandlerHex": context.get(
            "rootTailImmediatePredecessorHandlerHex"
        ),
        "rootStopToFillBridgeFound": context.get("rootStopToFillBridgeFound"),
        "fillStopToCurrentBridgeFound": context.get("fillStopToCurrentBridgeFound"),
        "descriptorBridgeProofFound": context.get("descriptorBridgeProofFound"),
        "descriptorBridgeFailedGateIds": context.get("descriptorBridgeFailedGateIds") or [],
        "descriptorBridgeMissingEvidence": context.get("descriptorBridgeMissingEvidence") or [],
        "descriptorBridgeEvidenceRefCount": context.get("descriptorBridgeEvidenceRefCount"),
        "descriptorEdgeRejectionClassification": context.get(
            "descriptorEdgeRejectionClassification"
        ),
        "descriptorEdgeAllTargetSectionsData": context.get("descriptorEdgeAllTargetSectionsData"),
        "descriptorEdgeDescriptorTargetEdgeCount": context.get(
            "descriptorEdgeDescriptorTargetEdgeCount"
        ),
        "descriptorEdgeRouteExecutionTargetEdgeCount": context.get(
            "descriptorEdgeRouteExecutionTargetEdgeCount"
        ),
        "descriptorEdgeRootRouteExecutionTargetEdgeCount": context.get(
            "descriptorEdgeRootRouteExecutionTargetEdgeCount"
        ),
        "descriptorEdgeFillRouteExecutionTargetEdgeCount": context.get(
            "descriptorEdgeFillRouteExecutionTargetEdgeCount"
        ),
        "descriptorEncodedTargetClassification": context.get(
            "descriptorEncodedTargetClassification"
        ),
        "descriptorEncodedTargetRawScalarCandidateCount": context.get(
            "descriptorEncodedTargetRawScalarCandidateCount"
        ),
        "descriptorEncodedTargetRootRawScalarCandidateCount": context.get(
            "descriptorEncodedTargetRootRawScalarCandidateCount"
        ),
        "descriptorEncodedTargetFillRawScalarCandidateCount": context.get(
            "descriptorEncodedTargetFillRawScalarCandidateCount"
        ),
        "descriptorEncodedTargetPromotingCandidateCount": context.get(
            "descriptorEncodedTargetPromotingCandidateCount"
        ),
        "descriptorEncodedTargetLabelCounts": context.get("descriptorEncodedTargetLabelCounts")
        or {},
        "descriptorEncodedTargetKindCounts": context.get("descriptorEncodedTargetKindCounts")
        or {},
        "predecessorDispatchTableProofFound": context.get("predecessorDispatchTableProofFound"),
        "predecessorDispatchTableFailedGateIds": context.get(
            "predecessorDispatchTableFailedGateIds"
        )
        or [],
        "predecessorDispatchTableMissingEvidence": context.get(
            "predecessorDispatchTableMissingEvidence"
        )
        or [],
        "predecessorDispatchTableEvidenceRefCount": context.get(
            "predecessorDispatchTableEvidenceRefCount"
        ),
        "predecessorDispatchSaveSelectorTableBaseArithmeticRowCount": context.get(
            "predecessorDispatchSaveSelectorTableBaseArithmeticRowCount"
        ),
        "predecessorDispatchSaveSelectorTableBaseArithmeticCandidateCount": context.get(
            "predecessorDispatchSaveSelectorTableBaseArithmeticCandidateCount"
        ),
        "predecessorDispatchSaveSelectorTableBaseArithmeticCandidateFound": context.get(
            "predecessorDispatchSaveSelectorTableBaseArithmeticCandidateFound"
        ),
        "predecessorDispatchTableBaseRejectionClassification": context.get(
            "predecessorDispatchTableBaseRejectionClassification"
        ),
        "rawGenericCallGraphClassification": context.get("rawGenericCallGraphClassification"),
        "rawGenericCallGraphProofFound": context.get("rawGenericCallGraphProofFound"),
        "rawGenericCallGraphMaxDepth": context.get("rawGenericCallGraphMaxDepth"),
        "rawGenericCallGraphReachableFunctionCount": context.get(
            "rawGenericCallGraphReachableFunctionCount"
        ),
        "rawGenericCallGraphDirectCallEdgeCount": context.get(
            "rawGenericCallGraphDirectCallEdgeCount"
        ),
        "descriptorRootClosureVisitedNodeCount": context.get(
            "descriptorRootClosureVisitedNodeCount"
        ),
        "descriptorRootClosureFillSiteEdgeHitCount": context.get(
            "descriptorRootClosureFillSiteEdgeHitCount"
        ),
        "descriptorRootClosureCurrentReaderEdgeHitCount": context.get(
            "descriptorRootClosureCurrentReaderEdgeHitCount"
        ),
        "descriptorFillClosureVisitedNodeCount": context.get(
            "descriptorFillClosureVisitedNodeCount"
        ),
        "descriptorFillClosureCurrentReaderEdgeHitCount": context.get(
            "descriptorFillClosureCurrentReaderEdgeHitCount"
        ),
        "runtimeFillObserved": context.get("runtimeFillObserved"),
        "branchGateKnownOpcodeStatePreservationStatus": context.get(
            "branchGateKnownOpcodeStatePreservationStatus"
        ),
        "branchGateSameTableAndOffset": context.get("branchGateSameTableAndOffset"),
        "branchGateSameSelectionBufferOffsetHex": context.get(
            "branchGateSameSelectionBufferOffsetHex"
        ),
        "branchGatePostWriterSameOffsetWriteCount": context.get(
            "branchGatePostWriterSameOffsetWriteCount"
        ),
        "branchGatePostWriterSameOffsetReadCount": context.get(
            "branchGatePostWriterSameOffsetReadCount"
        ),
        "branchGatePostWriterOtherOffsetWriteCount": context.get(
            "branchGatePostWriterOtherOffsetWriteCount"
        ),
        "branchGatePostWriterOtherOffsetWriteOffsetsHex": context.get(
            "branchGatePostWriterOtherOffsetWriteOffsetsHex"
        )
        or [],
        "branchGateInvalidSecondaryFillOffsetsHex": context.get(
            "branchGateInvalidSecondaryFillOffsetsHex"
        )
        or [],
        "fieldEntrySequenceContext": context.get("fieldEntrySequenceContext") or {},
        "coordinateSourceContext": context.get("coordinateSourceContext") or {},
        "routeOrderProven": context.get("routeOrderProven"),
        "selectorMergeGapOpen": context.get("selectorMergeGapOpen"),
        "requiredProofGates": context.get("requiredProofGates") or [],
        "requiredProofGateCount": context.get("requiredProofGateCount"),
        "requiredProofGatePassCount": context.get("requiredProofGatePassCount"),
        "requiredProofGateFailCount": context.get("requiredProofGateFailCount"),
        "requiredProofGateStatusOrder": context.get("requiredProofGateStatusOrder") or [],
        "requiredProofGateStatuses": context.get("requiredProofGateStatuses") or {},
        "requiredProofGateFailIds": context.get("requiredProofGateFailIds") or [],
        "requiredProofGateAllBlocked": context.get("requiredProofGateAllBlocked"),
        "proofFound": context.get("proofFound"),
        "failedPredecessorFillGateIds": context.get("failedPredecessorFillGateIds") or [],
        "missingEvidence": context.get("missingEvidence") or [],
        "evidenceRefs": context.get("evidenceRefs") or [],
        "evidenceRefCount": context.get("evidenceRefCount"),
        "fillSiteExecutionContextProven": context.get("fillSiteExecutionContextProven"),
        "promotionStatus": context.get("promotionStatus"),
        "conclusion": context.get("conclusion"),
    }


def predecessor_fill_site_execution_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    field_entry = evidence.get("fieldEntrySequenceContext") or {}
    coordinate = evidence.get("coordinateSourceContext") or {}
    return (
        f"{evidence.get('predecessorSelector')}->{evidence.get('currentSelector')} "
        f"fills={','.join(evidence.get('fillSites') or []) or '-'} "
        f"branchPolls={evidence.get('branchStatePollCount')}@"
        f"{evidence.get('branchStatePollSampleCount')} "
        f"publicHits={evidence.get('branchStatePollPublicPredecessorHitCount')} "
        f"routeHits={evidence.get('branchStatePollRouteSelectorHitCount')} "
        f"currentHits={evidence.get('branchStatePollCurrentRootHitCount')} "
        f"fillMatches={evidence.get('branchStatePollFillMatchCount')} "
        f"allZero={evidence.get('branchStatePollAllZeroCount')} "
        f"movementTarget={evidence.get('branchStatePollMovementOrTargetCount')}@"
        f"{evidence.get('branchStatePollMovementOrTargetSampleCount')} "
        f"targetObs={evidence.get('branchStatePollTargetObservationCount')}@"
        f"{evidence.get('branchStatePollTargetObservationSampleCount')} "
        f"targetFillCurrentRoute={evidence.get('branchStatePollTargetObservationFillMatchCount')}/"
        f"{evidence.get('branchStatePollTargetObservationCurrentRootHitCount')}/"
        f"{evidence.get('branchStatePollTargetObservationRouteSelectorHitCount')} "
        f"cameraOnlyTarget={evidence.get('branchStatePollCameraOnlyTargetCount')} "
        f"actorTrailTarget={evidence.get('branchStatePollActorOrTrailTargetCount')} "
        f"targetStatus={evidence.get('branchStatePollTargetObservationStatus')} "
        f"trace={evidence.get('localFillTraceStartHex')}->{evidence.get('localFillTraceStopHex')} "
        f"rootEntryReachesFills={evidence.get('rootEntryFixedTraversalFillSitesReachable')} "
        f"rootEntryVisited={evidence.get('rootEntryFixedTraversalVisitedNodeCount')} "
        f"encodedEntry={evidence.get('encodedFillEntryClassification')} "
        f"encodedRaw={evidence.get('encodedFillEntryRawScalarCandidateCount')} "
        f"encodedTailRaw={evidence.get('encodedFillEntryRootTailRawScalarCandidateCount')} "
        f"encodedPromoting={evidence.get('encodedFillEntryPromotingCandidateCount')} "
        f"rawScalarReject={evidence.get('encodedRawScalarRejectionClassification')} "
        "rawScalarNoFixed/noBranch/branchAttached/scalarOnly="
        f"{evidence.get('encodedRawScalarNoFixedAdvanceCount')}/"
        f"{evidence.get('encodedRawScalarNoBranchJumpCount')}/"
        f"{evidence.get('encodedRawScalarBranchAttachedCount')}/"
        f"{evidence.get('encodedRawScalarScalarOnlyCount')} "
        f"rootTail={evidence.get('rootTailDistanceHex')}/{evidence.get('rootTailDwordCount')} "
        f"rootTailIsolated={evidence.get('rootTailDescriptorIsolated')} "
        f"rootTailBranchClasses={evidence.get('rootTailBranchTargetClassCounts')} "
        f"rootTailBranchSections={evidence.get('rootTailBranchTargetSectionCounts')} "
        f"rootTailBranchToFill={evidence.get('rootTailBranchToFillFragmentCount')} "
        f"rootTailBranchToReader={evidence.get('rootTailBranchToCurrentReaderCount')} "
        f"rootTailFixedToFill={evidence.get('rootTailFixedFallthroughToFillCount')} "
        "rootTailClosure="
        f"{evidence.get('rootTailBranchClosureBranchSeedCount')}/"
        f"{evidence.get('rootTailBranchClosureEdgeCount')}/"
        f"{evidence.get('rootTailBranchClosureBranchSeedReachFillCount')}/"
        f"{evidence.get('rootTailBranchClosureBranchSeedReachCurrentReaderCount')} "
        "rootTailClosureOutside="
        f"{evidence.get('rootTailBranchClosureOutsideSuccessorCount')}/"
        f"{evidence.get('rootTailBranchClosureOutsideSuccessorClassCounts')}/"
        f"{evidence.get('rootTailBranchClosureOutsideSuccessorSectionCounts')} "
        f"rootTailClosureClass={evidence.get('rootTailBranchClosureClassification')} "
        "rootTailBeforeFill="
        f"{evidence.get('rootTailImmediatePredecessorHandlerSection')}/"
        f"{evidence.get('rootTailImmediatePredecessorHandlerHex')} "
        f"descriptorBridge={evidence.get('descriptorBridgeProofFound')} "
        f"descriptorBridgeFailedGates={list_text(evidence.get('descriptorBridgeFailedGateIds'))} "
        f"descriptorBridgeMissingEvidenceCount={len(evidence.get('descriptorBridgeMissingEvidence') or [])} "
        f"descriptorBridgeEvidenceRefs={evidence.get('descriptorBridgeEvidenceRefCount')} "
        f"descriptorNodes={evidence.get('descriptorRootClosureVisitedNodeCount')}/"
        f"{evidence.get('descriptorFillClosureVisitedNodeCount')} "
        f"descriptorFillEdges={evidence.get('descriptorRootClosureFillSiteEdgeHitCount')}/"
        f"{evidence.get('descriptorFillClosureCurrentReaderEdgeHitCount')} "
        f"descriptorEdgeReject={evidence.get('descriptorEdgeRejectionClassification')} "
        "descriptorRouteEdges="
        f"{evidence.get('descriptorEdgeRootRouteExecutionTargetEdgeCount')}/"
        f"{evidence.get('descriptorEdgeFillRouteExecutionTargetEdgeCount')} "
        "descriptorEncoded="
        f"{evidence.get('descriptorEncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('descriptorEncodedTargetRootRawScalarCandidateCount')}/"
        f"{evidence.get('descriptorEncodedTargetFillRawScalarCandidateCount')}/"
        f"{evidence.get('descriptorEncodedTargetPromotingCandidateCount')} "
        f"descriptorEncodedClass={evidence.get('descriptorEncodedTargetClassification')} "
        f"dispatchTableProof={evidence.get('predecessorDispatchTableProofFound')} "
        f"dispatchFailedGates={list_text(evidence.get('predecessorDispatchTableFailedGateIds'))} "
        f"dispatchMissingEvidenceCount={len(evidence.get('predecessorDispatchTableMissingEvidence') or [])} "
        f"dispatchEvidenceRefs={evidence.get('predecessorDispatchTableEvidenceRefCount')} "
        "tableBaseArithmetic="
        f"{evidence.get('predecessorDispatchSaveSelectorTableBaseArithmeticRowCount')}/"
        f"{evidence.get('predecessorDispatchSaveSelectorTableBaseArithmeticCandidateCount')} "
        f"tableBaseReject={evidence.get('predecessorDispatchTableBaseRejectionClassification')} "
        f"rawGenericCallGraph={evidence.get('rawGenericCallGraphClassification')} "
        "rawGenericCallGraphDepth/Functions/Edges="
        f"{evidence.get('rawGenericCallGraphMaxDepth')}/"
        f"{evidence.get('rawGenericCallGraphReachableFunctionCount')}/"
        f"{evidence.get('rawGenericCallGraphDirectCallEdgeCount')} "
        f"rawGenericCallGraphProof={evidence.get('rawGenericCallGraphProofFound')} "
        f"branchGatePreserve={evidence.get('branchGateKnownOpcodeStatePreservationStatus')} "
        "branchGateSameOffset="
        f"{evidence.get('branchGateSameTableAndOffset')}/"
        f"{evidence.get('branchGateSameSelectionBufferOffsetHex')} "
        "branchGateWriteRead="
        f"{evidence.get('branchGatePostWriterSameOffsetWriteCount')}/"
        f"{evidence.get('branchGatePostWriterSameOffsetReadCount')} "
        "branchGateOther="
        f"{evidence.get('branchGatePostWriterOtherOffsetWriteCount')}@"
        f"{list_text(evidence.get('branchGatePostWriterOtherOffsetWriteOffsetsHex'))} "
        "branchGateInvalid="
        f"{list_text(evidence.get('branchGateInvalidSecondaryFillOffsetsHex'))} "
        f"runtimeFill={evidence.get('runtimeFillObserved')} "
        f"fieldEntrySeq={field_entry.get('sequenceCount')} "
        f"fieldEntryCandidates={field_entry.get('fieldEntryCandidateCount')} "
        f"fieldEntrySelectors={field_entry.get('finalSelectorCounts')} "
        f"fieldEntryCameras={field_entry.get('finalCameraTileCounts')} "
        f"fieldEntrySnapshots={field_entry.get('snapshotCount')} "
        f"fieldEntrySnapshotRouteCandidates={field_entry.get('snapshotRouteCandidateCount')} "
        f"fieldEntrySnapshotSelectors={field_entry.get('snapshotSelectorCounts')} "
        f"fieldEntrySnapshotCameras={field_entry.get('snapshotCameraTileCounts')} "
        f"fieldEntryClasses={field_entry.get('classificationCounts')} "
        f"coordinateClass={coordinate.get('classification')} "
        f"coordinateReject={coordinate.get('coordinateSourceRejectionClassification')} "
        "coordinateStartPtrStaticTrailImage="
        f"{coordinate.get('publicSaveStartPointerTableTileHitCount')}/"
        f"{coordinate.get('publicSaveStartStaticBaseHitCount')}/"
        f"{coordinate.get('publicSaveStartTrailRingHitCount')}/"
        f"{coordinate.get('publicSaveStartImageHitCount')} "
        "coordinateTrailPtrStaticTrailImage="
        f"{coordinate.get('observedTrailPointerTableTileHitCount')}/"
        f"{coordinate.get('observedTrailStaticBaseHitCount')}/"
        f"{coordinate.get('observedTrailTrailRingHitCount')}/"
        f"{coordinate.get('observedTrailImageHitCount')} "
        "coordinateReciprocalPtrStaticTrailImage="
        f"{coordinate.get('reciprocalPointerTableTileHitCount')}/"
        f"{coordinate.get('reciprocalStaticBaseHitCount')}/"
        f"{coordinate.get('reciprocalTrailRingHitCount')}/"
        f"{coordinate.get('reciprocalImageHitCount')} "
        f"routeOrder={evidence.get('routeOrderProven')} "
        f"mergeGap={evidence.get('selectorMergeGapOpen')} "
        f"proofGates={evidence.get('requiredProofGatePassCount')}/"
        f"{evidence.get('requiredProofGateFailCount')} "
        f"allBlocked={evidence.get('requiredProofGateAllBlocked')} "
        f"failedIds={','.join(evidence.get('requiredProofGateFailIds') or []) or '-'} "
        f"proofFound={evidence.get('proofFound')} "
        "failedPredecessorFillGates="
        f"{','.join(evidence.get('failedPredecessorFillGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"contextProof={evidence.get('fillSiteExecutionContextProven')} "
        f"status={evidence.get('promotionStatus')}"
    )


def merge_runtime_context_for(source: str, target: str, context: dict | None) -> dict | None:
    if not context:
        return None
    if context.get("source") != source or context.get("target") != target:
        return None
    return {
        "sourceSelector": context.get("sourceSelector"),
        "predecessorSelector": context.get("predecessorSelector"),
        "currentSelector": context.get("currentSelector"),
        "currentRootHex": context.get("currentRootHex"),
        "currentEqualsPredecessorPlusSource": context.get("currentEqualsPredecessorPlusSource"),
        "sourcePredecessorUnionCoversCurrent": context.get("sourcePredecessorUnionCoversCurrent"),
        "sourcePredecessorUnionExtraMaps": context.get("sourcePredecessorUnionExtraMaps") or [],
        "routePairOnlyCurrentSelector": context.get("routePairOnlyCurrentSelector"),
        "mergeShapeOnly": context.get("mergeShapeOnly"),
        "forwardBridgeAbsent": context.get("forwardBridgeAbsent"),
        "forwardEncodedAnchorRawScalarCandidateCount": context.get(
            "forwardEncodedAnchorRawScalarCandidateCount"
        ),
        "forwardEncodedAnchorPromotingCandidateCount": context.get(
            "forwardEncodedAnchorPromotingCandidateCount"
        ),
        "encodedMergeExecutionBridgeFound": context.get("encodedMergeExecutionBridgeFound"),
        "targetAliasPublicCoveredForwardHitSelectors": context.get(
            "targetAliasPublicCoveredForwardHitSelectors"
        )
        or [],
        "targetAliasForwardHitPublicSampleCount": context.get(
            "targetAliasForwardHitPublicSampleCount"
        ),
        "targetAliasAddressAdjacentForwardHitSelectors": context.get(
            "targetAliasAddressAdjacentForwardHitSelectors"
        )
        or [],
        "targetAliasForwardHitsAddressAdjacentOnly": context.get(
            "targetAliasForwardHitsAddressAdjacentOnly"
        ),
        "targetAliasPublicForwardHitCoverageStatus": context.get(
            "targetAliasPublicForwardHitCoverageStatus"
        ),
        "targetAliasExecutionExclusionStatus": context.get("targetAliasExecutionExclusionStatus"),
        "reverseReuseBeforeFillOnly": context.get("reverseReuseBeforeFillOnly"),
        "selectedRootExecutionRefFound": context.get("selectedRootExecutionRefFound"),
        "anyRuntimePollReachedRouteSelector": context.get("anyRuntimePollReachedRouteSelector"),
        "constructedDiagnosticPollReachedRouteSelector": context.get(
            "constructedDiagnosticPollReachedRouteSelector"
        ),
        "constructedDiagnosticExcludedFromProof": context.get("constructedDiagnosticExcludedFromProof"),
        "predecessorFillSiteExecutionContextProven": context.get(
            "predecessorFillSiteExecutionContextProven"
        ),
        "predecessorBranchStatePollSampleCount": context.get("predecessorBranchStatePollSampleCount"),
        "predecessorBranchStatePollFillMatchCount": context.get(
            "predecessorBranchStatePollFillMatchCount"
        ),
        "routePairEntryExecutionProven": context.get("routePairEntryExecutionProven"),
        "routePairCorrectedTraceReachesReaderCount": context.get(
            "routePairCorrectedTraceReachesReaderCount"
        ),
        "strictSourceCoordinateFound": context.get("strictSourceCoordinateFound"),
        "tileHotspotConfirmed": context.get("tileHotspotConfirmed"),
        "selectorMergeRuntimeProofFound": context.get("selectorMergeRuntimeProofFound"),
        "proofFound": context.get("proofFound"),
        "failedSelectorMergeRuntimeGateIds": (
            context.get("failedSelectorMergeRuntimeGateIds") or []
        ),
        "missingEvidence": context.get("missingEvidence") or [],
        "evidenceRefs": context.get("evidenceRefs") or [],
        "evidenceRefCount": context.get("evidenceRefCount"),
        "selectorMergeGapOpen": context.get("selectorMergeGapOpen"),
        "promotionStatus": context.get("promotionStatus"),
        "conclusion": context.get("conclusion"),
    }


def merge_runtime_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"{evidence.get('sourceSelector')}+{evidence.get('predecessorSelector')}->"
        f"{evidence.get('currentSelector')} "
        f"shapeOnly={evidence.get('mergeShapeOnly')} "
        f"forwardBridgeAbsent={evidence.get('forwardBridgeAbsent')} "
        f"encodedRaw={evidence.get('forwardEncodedAnchorRawScalarCandidateCount')} "
        f"encodedPromoting={evidence.get('forwardEncodedAnchorPromotingCandidateCount')} "
        f"encodedMerge={evidence.get('encodedMergeExecutionBridgeFound')} "
        f"aliasPublicForward={','.join(evidence.get('targetAliasPublicCoveredForwardHitSelectors') or []) or '-'} "
        f"aliasAddressForward={','.join(evidence.get('targetAliasAddressAdjacentForwardHitSelectors') or []) or '-'} "
        f"aliasPublicSamples={evidence.get('targetAliasForwardHitPublicSampleCount')} "
        f"aliasCoverage={evidence.get('targetAliasPublicForwardHitCoverageStatus')} "
        f"aliasExclusion={evidence.get('targetAliasExecutionExclusionStatus')} "
        f"reverseBeforeFillOnly={evidence.get('reverseReuseBeforeFillOnly')} "
        f"selectedRootRef={evidence.get('selectedRootExecutionRefFound')} "
        f"anyPollRoute={evidence.get('anyRuntimePollReachedRouteSelector')} "
        f"diagRoute={evidence.get('constructedDiagnosticPollReachedRouteSelector')} "
        f"diagExcluded={evidence.get('constructedDiagnosticExcludedFromProof')} "
        f"predFillContext={evidence.get('predecessorFillSiteExecutionContextProven')} "
        f"predFillSamples={evidence.get('predecessorBranchStatePollSampleCount')} "
        f"predFillMatches={evidence.get('predecessorBranchStatePollFillMatchCount')} "
        f"routePairEntryExec={evidence.get('routePairEntryExecutionProven')} "
        f"strict={evidence.get('strictSourceCoordinateFound')}/"
        f"{evidence.get('tileHotspotConfirmed')} "
        f"runtimeProof={evidence.get('selectorMergeRuntimeProofFound')} "
        f"proofFound={evidence.get('proofFound')} "
        "failedSelectorMergeRuntimeGates="
        f"{','.join(evidence.get('failedSelectorMergeRuntimeGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"status={evidence.get('promotionStatus')}"
    )


def merge_closure_context_for(source: str, target: str, context: dict | None) -> dict | None:
    if not context:
        return None
    if context.get("source") != source or context.get("target") != target:
        return None
    return {
        "sourceSelector": context.get("sourceSelector"),
        "predecessorSelector": context.get("predecessorSelector"),
        "currentSelector": context.get("currentSelector"),
        "currentRootHex": context.get("currentRootHex"),
        "currentEqualsPredecessorPlusSource": context.get("currentEqualsPredecessorPlusSource"),
        "sourcePredecessorUnionCoversCurrent": context.get("sourcePredecessorUnionCoversCurrent"),
        "sourcePredecessorUnionExtraMaps": context.get("sourcePredecessorUnionExtraMaps") or [],
        "shapeOverIncludesExtraMaps": context.get("shapeOverIncludesExtraMaps"),
        "routePairOnlyCurrentSelector": context.get("routePairOnlyCurrentSelector"),
        "currentExactPairUnionCount": context.get("currentExactPairUnionCount"),
        "mergeShapeOnly": context.get("mergeShapeOnly"),
        "sourceToCurrentBridgeHitCount": context.get("sourceToCurrentBridgeHitCount"),
        "predecessorToCurrentHitCount": context.get("predecessorToCurrentHitCount"),
        "forwardMergeBridgeHitCount": context.get("forwardMergeBridgeHitCount"),
        "forwardEncodedAnchorRawScalarCandidateCount": context.get(
            "forwardEncodedAnchorRawScalarCandidateCount"
        ),
        "forwardEncodedAnchorPromotingCandidateCount": context.get(
            "forwardEncodedAnchorPromotingCandidateCount"
        ),
        "encodedMergeExecutionBridgeFound": context.get("encodedMergeExecutionBridgeFound"),
        "forwardBridgeAbsent": context.get("forwardBridgeAbsent"),
        "currentToPredecessorHitCount": context.get("currentToPredecessorHitCount"),
        "currentToPredecessorBeforeFillHitCount": context.get(
            "currentToPredecessorBeforeFillHitCount"
        ),
        "currentToPredecessorFillSiteHitCount": context.get("currentToPredecessorFillSiteHitCount"),
        "reverseReuseBeforeFillOnly": context.get("reverseReuseBeforeFillOnly"),
        "targetAliasPublicCoveredForwardHitSelectors": context.get(
            "targetAliasPublicCoveredForwardHitSelectors"
        )
        or [],
        "targetAliasAddressAdjacentForwardHitSelectors": context.get(
            "targetAliasAddressAdjacentForwardHitSelectors"
        )
        or [],
        "targetAliasForwardHitPublicSampleCount": context.get(
            "targetAliasForwardHitPublicSampleCount"
        ),
        "targetAliasForwardHitsAddressAdjacentOnly": context.get(
            "targetAliasForwardHitsAddressAdjacentOnly"
        ),
        "targetAliasExecutionExclusionStatus": context.get("targetAliasExecutionExclusionStatus"),
        "targetAliasToCurrentExecutionLikeBridgeFound": context.get(
            "targetAliasToCurrentExecutionLikeBridgeFound"
        ),
        "routeRootsTableOnly": context.get("routeRootsTableOnly"),
        "routeRootRefsPredecessorToCurrentRootRefFound": context.get(
            "routeRootRefsPredecessorToCurrentRootRefFound"
        ),
        "selectedRootExecutionRefFound": context.get("selectedRootExecutionRefFound"),
        "anyRuntimePollReachedRouteSelector": context.get("anyRuntimePollReachedRouteSelector"),
        "constructedDiagnosticExcludedFromProof": context.get(
            "constructedDiagnosticExcludedFromProof"
        ),
        "predecessorFillOpcode10ProofFound": context.get("predecessorFillOpcode10ProofFound"),
        "predecessorFillOpcode10RuntimeObservedAllZero": context.get(
            "predecessorFillOpcode10RuntimeObservedAllZero"
        ),
        "predecessorFillOpcode10BranchStatePollFillMatchCount": context.get(
            "predecessorFillOpcode10BranchStatePollFillMatchCount"
        ),
        "routeOrderProven": context.get("routeOrderProven"),
        "predecessorPersistenceProven": context.get("predecessorPersistenceProven"),
        "predecessorPersistenceGapSelectorMergeGapOpen": context.get(
            "predecessorPersistenceGapSelectorMergeGapOpen"
        ),
        "strictSourceCoordinateFound": context.get("strictSourceCoordinateFound"),
        "tileHotspotConfirmed": context.get("tileHotspotConfirmed"),
        "selectorMergeExecutionProofFound": context.get("selectorMergeExecutionProofFound"),
        "selectorMergeRuntimeProofFound": context.get("selectorMergeRuntimeProofFound"),
        "selectorMergeClosureProofFound": context.get("selectorMergeClosureProofFound"),
        "proofFound": context.get("proofFound"),
        "failedSelectorMergeGateIds": context.get("failedSelectorMergeGateIds") or [],
        "missingEvidence": context.get("missingEvidence") or [],
        "evidenceRefs": context.get("evidenceRefs") or [],
        "evidenceRefCount": context.get("evidenceRefCount"),
        "predecessorPersistenceUsableForCurrent": context.get(
            "predecessorPersistenceUsableForCurrent"
        ),
        "promotionStatus": context.get("promotionStatus"),
        "conclusion": context.get("conclusion"),
    }


def merge_closure_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"{evidence.get('sourceSelector')}+{evidence.get('predecessorSelector')}->"
        f"{evidence.get('currentSelector')} "
        f"shapeOnly={evidence.get('mergeShapeOnly')} "
        f"extra={','.join(evidence.get('sourcePredecessorUnionExtraMaps') or []) or '-'} "
        f"overinclude={evidence.get('shapeOverIncludesExtraMaps')} "
        f"forwardAbsent={evidence.get('forwardBridgeAbsent')} "
        f"bridges={evidence.get('sourceToCurrentBridgeHitCount')}/"
        f"{evidence.get('predecessorToCurrentHitCount')}/"
        f"{evidence.get('forwardMergeBridgeHitCount')} "
        f"encoded={evidence.get('forwardEncodedAnchorRawScalarCandidateCount')}/"
        f"{evidence.get('forwardEncodedAnchorPromotingCandidateCount')}/"
        f"{evidence.get('encodedMergeExecutionBridgeFound')} "
        f"reverse={evidence.get('currentToPredecessorHitCount')}/"
        f"{evidence.get('currentToPredecessorBeforeFillHitCount')}/"
        f"{evidence.get('currentToPredecessorFillSiteHitCount')} "
        f"aliasPublicForward={','.join(evidence.get('targetAliasPublicCoveredForwardHitSelectors') or []) or '-'} "
        f"aliasAddressForward={','.join(evidence.get('targetAliasAddressAdjacentForwardHitSelectors') or []) or '-'} "
        f"aliasSamples={evidence.get('targetAliasForwardHitPublicSampleCount')} "
        f"aliasExec={evidence.get('targetAliasToCurrentExecutionLikeBridgeFound')} "
        f"aliasExclusion={evidence.get('targetAliasExecutionExclusionStatus')} "
        f"routeRootsTable={evidence.get('routeRootsTableOnly')} "
        f"predCurrentRootRef={evidence.get('routeRootRefsPredecessorToCurrentRootRefFound')} "
        f"selectedRoot={evidence.get('selectedRootExecutionRefFound')} "
        f"anyPollRoute={evidence.get('anyRuntimePollReachedRouteSelector')} "
        f"diagExcluded={evidence.get('constructedDiagnosticExcludedFromProof')} "
        f"opcode10Proof={evidence.get('predecessorFillOpcode10ProofFound')} "
        f"opcode10AllZero={evidence.get('predecessorFillOpcode10RuntimeObservedAllZero')} "
        f"opcode10FillMatches={evidence.get('predecessorFillOpcode10BranchStatePollFillMatchCount')} "
        f"routeOrder={evidence.get('routeOrderProven')} "
        f"strict={evidence.get('strictSourceCoordinateFound')}/"
        f"{evidence.get('tileHotspotConfirmed')} "
        f"proofs={evidence.get('selectorMergeExecutionProofFound')}/"
        f"{evidence.get('selectorMergeRuntimeProofFound')}/"
        f"{evidence.get('selectorMergeClosureProofFound')} "
        f"proofFound={evidence.get('proofFound')} "
        f"failedSelectorMergeGates={','.join(evidence.get('failedSelectorMergeGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"predUsable={evidence.get('predecessorPersistenceUsableForCurrent')} "
        f"status={evidence.get('promotionStatus')}"
    )


def merge_execution_gap_for(source: str, target: str, gap: dict | None) -> dict | None:
    if not gap:
        return None
    if gap.get("source") != source or gap.get("target") != target:
        return None
    return {
        "sourceSelector": gap.get("sourceSelector"),
        "predecessorSelector": gap.get("predecessorSelector"),
        "currentSelector": gap.get("currentSelector"),
        "currentRootHex": gap.get("currentRootHex"),
        "currentEqualsPredecessorPlusSource": gap.get("currentEqualsPredecessorPlusSource"),
        "sourcePredecessorUnionExtraMaps": gap.get("sourcePredecessorUnionExtraMaps") or [],
        "routePairOnlyCurrentSelector": gap.get("routePairOnlyCurrentSelector"),
        "currentExactPairUnionCount": gap.get("currentExactPairUnionCount"),
        "sourceToCurrentBridgeHitCount": gap.get("sourceToCurrentBridgeHitCount"),
        "currentToSourceBridgeHitCount": gap.get("currentToSourceBridgeHitCount"),
        "predecessorToCurrentHitCount": gap.get("predecessorToCurrentHitCount"),
        "currentToPredecessorHitCount": gap.get("currentToPredecessorHitCount"),
        "currentToPredecessorBeforeFillHitCount": gap.get("currentToPredecessorBeforeFillHitCount"),
        "currentToPredecessorFillSiteHitCount": gap.get("currentToPredecessorFillSiteHitCount"),
        "forwardEncodedAnchorRawScalarCandidateCount": gap.get(
            "forwardEncodedAnchorRawScalarCandidateCount"
        ),
        "forwardEncodedAnchorPromotingCandidateCount": gap.get(
            "forwardEncodedAnchorPromotingCandidateCount"
        ),
        "encodedMergeExecutionBridgeFound": gap.get("encodedMergeExecutionBridgeFound"),
        "targetAliasForwardHitSelectors": gap.get("targetAliasForwardHitSelectors") or [],
        "targetAliasForwardDataSelectors": gap.get("targetAliasForwardDataSelectors") or [],
        "targetAliasAfterLastFillDataSelectors": gap.get("targetAliasAfterLastFillDataSelectors") or [],
        "targetAliasDominantDataSelectors": gap.get("targetAliasDominantDataSelectors") or [],
        "targetAliasPublicCoveredForwardHitSelectors": gap.get(
            "targetAliasPublicCoveredForwardHitSelectors"
        )
        or [],
        "targetAliasForwardHitPublicSampleCount": gap.get("targetAliasForwardHitPublicSampleCount"),
        "targetAliasAddressAdjacentForwardHitSelectors": gap.get(
            "targetAliasAddressAdjacentForwardHitSelectors"
        )
        or [],
        "targetAliasForwardHitsAddressAdjacentOnly": gap.get(
            "targetAliasForwardHitsAddressAdjacentOnly"
        ),
        "targetAliasPublicForwardHitCoverageStatus": gap.get(
            "targetAliasPublicForwardHitCoverageStatus"
        ),
        "targetAliasExecutionExclusionStatus": gap.get("targetAliasExecutionExclusionStatus"),
        "targetAliasToCurrentPromotingMetadataHitCount": gap.get(
            "targetAliasToCurrentPromotingMetadataHitCount"
        ),
        "targetAliasToCurrentPromotingDataHitCount": gap.get(
            "targetAliasToCurrentPromotingDataHitCount"
        ),
        "targetAliasToCurrentPromotingExactMetadataOnly": gap.get(
            "targetAliasToCurrentPromotingExactMetadataOnly"
        ),
        "targetAliasToCurrentExecutionLikeBridgeFound": gap.get(
            "targetAliasToCurrentExecutionLikeBridgeFound"
        ),
        "routeRootExecutionRefFound": gap.get("routeRootExecutionRefFound"),
        "branchStateExecutionProofFound": gap.get("branchStateExecutionProofFound"),
        "selectorMergeExecutionProofFound": gap.get("selectorMergeExecutionProofFound"),
        "runtimeOrControlFlowProofFound": gap.get("runtimeOrControlFlowProofFound"),
        "proofFound": gap.get("proofFound"),
        "strictHotspotFound": gap.get("strictHotspotFound"),
        "failedSelectorMergeExecutionGateIds": (
            gap.get("failedSelectorMergeExecutionGateIds") or []
        ),
        "missingEvidence": gap.get("missingEvidence") or [],
        "evidenceRefs": gap.get("evidenceRefs") or [],
        "evidenceRefCount": gap.get("evidenceRefCount"),
        "selectorMergeGapOpen": gap.get("selectorMergeGapOpen"),
        "promotionStatus": gap.get("promotionStatus"),
        "conclusion": gap.get("conclusion"),
    }


def merge_execution_gap_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"{evidence.get('sourceSelector')}+{evidence.get('predecessorSelector')}->"
        f"{evidence.get('currentSelector')} "
        f"shape={evidence.get('currentEqualsPredecessorPlusSource')} "
        f"extra={','.join(evidence.get('sourcePredecessorUnionExtraMaps') or []) or '-'} "
        f"exactPairs={evidence.get('currentExactPairUnionCount')} "
        f"sourceCurrent={evidence.get('sourceToCurrentBridgeHitCount')}/"
        f"{evidence.get('currentToSourceBridgeHitCount')} "
        f"predCurrent={evidence.get('predecessorToCurrentHitCount')}/"
        f"{evidence.get('currentToPredecessorHitCount')} "
        f"reverseBeforeFill={evidence.get('currentToPredecessorBeforeFillHitCount')} "
        f"reverseFillSite={evidence.get('currentToPredecessorFillSiteHitCount')} "
        f"encoded={evidence.get('forwardEncodedAnchorRawScalarCandidateCount')}/"
        f"{evidence.get('forwardEncodedAnchorPromotingCandidateCount')}/"
        f"{evidence.get('encodedMergeExecutionBridgeFound')} "
        f"aliasData={','.join(evidence.get('targetAliasForwardDataSelectors') or []) or '-'} "
        f"aliasTailData={','.join(evidence.get('targetAliasAfterLastFillDataSelectors') or []) or '-'} "
        f"aliasPublicForward={','.join(evidence.get('targetAliasPublicCoveredForwardHitSelectors') or []) or '-'} "
        f"aliasAddressForward={','.join(evidence.get('targetAliasAddressAdjacentForwardHitSelectors') or []) or '-'} "
        f"aliasPublicSamples={evidence.get('targetAliasForwardHitPublicSampleCount')} "
        f"aliasCoverage={evidence.get('targetAliasPublicForwardHitCoverageStatus')} "
        f"aliasExclusion={evidence.get('targetAliasExecutionExclusionStatus')} "
        f"aliasPromotingMetaData={evidence.get('targetAliasToCurrentPromotingMetadataHitCount')}/"
        f"{evidence.get('targetAliasToCurrentPromotingDataHitCount')} "
        f"aliasExactMetadataOnly={evidence.get('targetAliasToCurrentPromotingExactMetadataOnly')} "
        f"aliasExec={evidence.get('targetAliasToCurrentExecutionLikeBridgeFound')} "
        f"routeRoot={evidence.get('routeRootExecutionRefFound')} "
        f"branchState={evidence.get('branchStateExecutionProofFound')} "
        f"proof={evidence.get('selectorMergeExecutionProofFound')} "
        f"runtimeOrControlFlowProof={evidence.get('runtimeOrControlFlowProofFound')} "
        f"proofFound={evidence.get('proofFound')} "
        f"strictHotspot={evidence.get('strictHotspotFound')} "
        "failedSelectorMergeExecutionGates="
        f"{','.join(evidence.get('failedSelectorMergeExecutionGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"gap={evidence.get('selectorMergeGapOpen')} "
        f"status={evidence.get('promotionStatus')}"
    )


def predecessor_fill_opcode10_context_for(source: str, target: str, context: dict | None) -> dict | None:
    if not context:
        return None
    if context.get("source") != source or context.get("target") != target:
        return None
    return {
        "opcodeHandlerHex": context.get("opcodeHandlerHex"),
        "opcodeHandlerStreamEffectText": context.get("opcodeHandlerStreamEffectText"),
        "helperVaHex": context.get("helperVaHex"),
        "helperDirectCallCount": context.get("helperDirectCallCount"),
        "helperOnlyDirectCallInsideOpcode10Handler": context.get(
            "helperOnlyDirectCallInsideOpcode10Handler"
        ),
        "fillFragmentRangeHex": context.get("fillFragmentRangeHex"),
        "fillFragmentOpcodes": context.get("fillFragmentOpcodes") or [],
        "decodedOpcode10FillTargetTables": context.get("decodedOpcode10FillTargetTables") or [],
        "decodedOpcode10HelperFillCounts": context.get("decodedOpcode10HelperFillCounts") or [],
        "decodedOpcode10ExpectedFillHexes": context.get("decodedOpcode10ExpectedFillHexes") or [],
        "decodedOpcode10AllSecondaryBranchState": context.get(
            "decodedOpcode10AllSecondaryBranchState"
        ),
        "fillOpcode10RowCount": context.get("fillOpcode10RowCount"),
        "fillDefaultAdvanceRowCount": context.get("fillDefaultAdvanceRowCount"),
        "fillDescriptorStopRowCount": context.get("fillDescriptorStopRowCount"),
        "directFillSiteTextRefCount": context.get("directFillSiteTextRefCount"),
        "directCurrentReaderTextRefCount": context.get("directCurrentReaderTextRefCount"),
        "opcode10HandlerRouteImmediateCount": context.get("opcode10HandlerRouteImmediateCount"),
        "rootTailDescriptorIsolated": context.get("rootTailDescriptorIsolated"),
        "rootTailBranchToFillFragmentCount": context.get("rootTailBranchToFillFragmentCount"),
        "rootTailBranchToCurrentReaderCount": context.get("rootTailBranchToCurrentReaderCount"),
        "rootTailFixedFallthroughToFillCount": context.get("rootTailFixedFallthroughToFillCount"),
        "publicPredecessorReached": context.get("publicPredecessorReached"),
        "runtimeObservedAllZero": context.get("runtimeObservedAllZero"),
        "runtimeMatchesExpectedFill": context.get("runtimeMatchesExpectedFill"),
        "branchStatePollSampleCount": context.get("branchStatePollSampleCount"),
        "branchStatePollFillMatchCount": context.get("branchStatePollFillMatchCount"),
        "requiredProofGateCount": context.get("requiredProofGateCount"),
        "requiredProofGatePassCount": context.get("requiredProofGatePassCount"),
        "requiredProofGateFailCount": context.get("requiredProofGateFailCount"),
        "requiredProofGateFailIds": context.get("requiredProofGateFailIds") or [],
        "requiredProofGateAllBlocked": context.get("requiredProofGateAllBlocked"),
        "proofFound": context.get("proofFound"),
        "failedPredecessorFillOpcode10GateIds": context.get(
            "failedPredecessorFillOpcode10GateIds"
        )
        or [],
        "missingEvidence": context.get("missingEvidence") or [],
        "evidenceRefCount": context.get("evidenceRefCount"),
        "promotionStatus": context.get("promotionStatus"),
        "conclusion": context.get("conclusion"),
    }


def predecessor_fill_opcode10_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"handler={evidence.get('opcodeHandlerHex')} "
        f"effect={evidence.get('opcodeHandlerStreamEffectText')} "
        f"helperCalls={evidence.get('helperDirectCallCount')} "
        f"helperOpcode10Only={evidence.get('helperOnlyDirectCallInsideOpcode10Handler')} "
        f"fragment={evidence.get('fillFragmentRangeHex')} "
        f"opcodes={','.join(evidence.get('fillFragmentOpcodes') or []) or '-'} "
        f"decoded={','.join(evidence.get('decodedOpcode10FillTargetTables') or []) or '-'}/"
        f"{','.join(str(value) for value in evidence.get('decodedOpcode10HelperFillCounts') or []) or '-'}/"
        f"{','.join(evidence.get('decodedOpcode10ExpectedFillHexes') or []) or '-'} "
        f"rows={evidence.get('fillOpcode10RowCount')}/"
        f"{evidence.get('fillDefaultAdvanceRowCount')}/"
        f"{evidence.get('fillDescriptorStopRowCount')} "
        f"textRefs={evidence.get('directFillSiteTextRefCount')}/"
        f"{evidence.get('directCurrentReaderTextRefCount')} "
        f"handlerRouteImmediate={evidence.get('opcode10HandlerRouteImmediateCount')} "
        f"rootTail={evidence.get('rootTailDescriptorIsolated')}/"
        f"{evidence.get('rootTailBranchToFillFragmentCount')}/"
        f"{evidence.get('rootTailBranchToCurrentReaderCount')}/"
        f"{evidence.get('rootTailFixedFallthroughToFillCount')} "
        f"runtime={evidence.get('publicPredecessorReached')}/"
        f"{evidence.get('runtimeObservedAllZero')}/"
        f"{evidence.get('runtimeMatchesExpectedFill')} "
        f"polls={evidence.get('branchStatePollSampleCount')} "
        f"fillMatches={evidence.get('branchStatePollFillMatchCount')} "
        f"proofGates={evidence.get('requiredProofGatePassCount')}/"
        f"{evidence.get('requiredProofGateFailCount')} "
        f"allBlocked={evidence.get('requiredProofGateAllBlocked')} "
        f"failedIds={','.join(evidence.get('requiredProofGateFailIds') or []) or '-'} "
        f"failedOpcode10Gates={','.join(evidence.get('failedPredecessorFillOpcode10GateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"proof={evidence.get('proofFound')} "
        f"status={evidence.get('promotionStatus')}"
    )


def predecessor_descriptor_bridge_gap_for(source: str, target: str, gap: dict | None) -> dict | None:
    if not gap:
        return None
    if gap.get("source") != source or gap.get("target") != target:
        return None
    root_closure = gap.get("rootStopDescriptorClosure") or {}
    fill_closure = gap.get("fillStopDescriptorClosure") or {}
    edge_summary = gap.get("descriptorTargetEdgeSummary") or {}
    return {
        "predecessorSelector": gap.get("predecessorSelector"),
        "currentSelector": gap.get("currentSelector"),
        "predecessorRootStopSiteHex": gap.get("predecessorRootStopSiteHex"),
        "predecessorRootStopDescriptorHex": gap.get("predecessorRootStopDescriptorHex"),
        "predecessorFillStopSiteHex": gap.get("predecessorFillStopSiteHex"),
        "predecessorFillStopDescriptorHex": gap.get("predecessorFillStopDescriptorHex"),
        "fillSites": gap.get("fillSites") or [],
        "currentRootHex": gap.get("currentRootHex"),
        "currentReaderHex": gap.get("currentReaderHex"),
        "targetRefCounts": gap.get("targetRefCounts") or {},
        "rootClosureVisitedNodeCount": root_closure.get("visitedNodeCount"),
        "rootClosureEdgeCount": root_closure.get("edgeCount"),
        "rootClosureTargetEdgeHits": root_closure.get("targetEdgeHits") or {},
        "fillClosureVisitedNodeCount": fill_closure.get("visitedNodeCount"),
        "fillClosureEdgeCount": fill_closure.get("edgeCount"),
        "fillClosureTargetEdgeHits": fill_closure.get("targetEdgeHits") or {},
        "descriptorTargetEdgeSummary": edge_summary,
        "descriptorSharedOnly": edge_summary.get("sharedDescriptorOnly"),
        "descriptorRootTargetEdgeCount": edge_summary.get("rootDescriptorTargetEdgeCount"),
        "descriptorFillTargetEdgeCount": edge_summary.get("fillDescriptorTargetEdgeCount"),
        "descriptorRootRouteExecutionEdgeCount": edge_summary.get("rootRouteExecutionTargetEdgeCount"),
        "descriptorFillRouteExecutionEdgeCount": edge_summary.get("fillRouteExecutionTargetEdgeCount"),
        "descriptorEdgeRejectionClassification": gap.get("descriptorEdgeRejectionClassification"),
        "descriptorEdgeAllTargetSectionsData": gap.get("descriptorEdgeAllTargetSectionsData"),
        "descriptorEdgeTargetEdgeCount": gap.get("descriptorEdgeDescriptorTargetEdgeCount"),
        "descriptorEdgeRouteExecutionTargetEdgeCount": gap.get(
            "descriptorEdgeRouteExecutionTargetEdgeCount"
        ),
        "descriptorEncodedTargetClassification": gap.get("descriptorEncodedTargetClassification"),
        "descriptorEncodedTargetRawScalarCandidateCount": gap.get(
            "descriptorEncodedTargetRawScalarCandidateCount"
        ),
        "descriptorEncodedTargetRootRawScalarCandidateCount": gap.get(
            "descriptorEncodedTargetRootRawScalarCandidateCount"
        ),
        "descriptorEncodedTargetFillRawScalarCandidateCount": gap.get(
            "descriptorEncodedTargetFillRawScalarCandidateCount"
        ),
        "descriptorEncodedTargetPromotingCandidateCount": gap.get(
            "descriptorEncodedTargetPromotingCandidateCount"
        ),
        "descriptorEncodedTargetLabelCounts": gap.get("descriptorEncodedTargetLabelCounts") or {},
        "descriptorEncodedTargetKindCounts": gap.get("descriptorEncodedTargetKindCounts") or {},
        "rootStopClosureReachesFillStopDescriptor": gap.get("rootStopClosureReachesFillStopDescriptor"),
        "rootStopToFillBridgeFound": gap.get("rootStopToFillBridgeFound"),
        "fillStopClosureSelfLoopFound": gap.get("fillStopClosureSelfLoopFound"),
        "fillStopToCurrentBridgeFound": gap.get("fillStopToCurrentBridgeFound"),
        "descriptorBridgeProofFound": gap.get("descriptorBridgeProofFound"),
        "proofFound": gap.get("proofFound"),
        "failedDescriptorBridgeGateIds": gap.get("failedDescriptorBridgeGateIds") or [],
        "missingEvidence": gap.get("missingEvidence") or [],
        "evidenceRefCount": gap.get("evidenceRefCount"),
        "promotionStatus": gap.get("promotionStatus"),
        "conclusion": gap.get("conclusion"),
    }


def predecessor_descriptor_bridge_gap_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"{evidence.get('predecessorSelector')}->{evidence.get('currentSelector')} "
        f"rootStop={evidence.get('predecessorRootStopSiteHex')}->{evidence.get('predecessorRootStopDescriptorHex')} "
        f"fillStop={evidence.get('predecessorFillStopSiteHex')}->{evidence.get('predecessorFillStopDescriptorHex')} "
        f"rootClosure={evidence.get('rootClosureVisitedNodeCount')}/{evidence.get('rootClosureEdgeCount')} "
        f"fillClosure={evidence.get('fillClosureVisitedNodeCount')}/{evidence.get('fillClosureEdgeCount')} "
        f"rootReachesC0={evidence.get('rootStopClosureReachesFillStopDescriptor')} "
        f"rootToFill={evidence.get('rootStopToFillBridgeFound')} "
        f"fillSelfLoop={evidence.get('fillStopClosureSelfLoopFound')} "
        f"fillToCurrent={evidence.get('fillStopToCurrentBridgeFound')} "
        f"sharedDescriptorOnly={evidence.get('descriptorSharedOnly')} "
        f"descriptorEdges={evidence.get('descriptorRootTargetEdgeCount')}/"
        f"{evidence.get('descriptorFillTargetEdgeCount')} "
        f"routeEdges={evidence.get('descriptorRootRouteExecutionEdgeCount')}/"
        f"{evidence.get('descriptorFillRouteExecutionEdgeCount')} "
        f"edgeReject={evidence.get('descriptorEdgeRejectionClassification')} "
        f"edgeCounts={evidence.get('descriptorEdgeTargetEdgeCount')}/"
        f"{evidence.get('descriptorEdgeRouteExecutionTargetEdgeCount')} "
        "encodedTargets="
        f"{evidence.get('descriptorEncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('descriptorEncodedTargetRootRawScalarCandidateCount')}/"
        f"{evidence.get('descriptorEncodedTargetFillRawScalarCandidateCount')}/"
        f"{evidence.get('descriptorEncodedTargetPromotingCandidateCount')} "
        f"encodedClass={evidence.get('descriptorEncodedTargetClassification')} "
        f"targetRefs={evidence.get('targetRefCounts')} "
        f"proof={evidence.get('descriptorBridgeProofFound')} "
        f"topProof={evidence.get('proofFound')} "
        f"failedDescriptorBridgeGates={','.join(evidence.get('failedDescriptorBridgeGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def active_flag_effect_for(source: str, target: str, effect: dict | None) -> dict | None:
    if not effect:
        return None
    if effect.get("source") != source or effect.get("target") != target:
        return None
    return {
        "activeFlagVaHex": effect.get("activeFlagVaHex"),
        "activeFlagStaticInitialByteHex": effect.get("activeFlagStaticInitialByteHex"),
        "activeFlagSaveOffsetHex": effect.get("activeFlagSaveOffsetHex"),
        "activeFlagResolvedStaticDefault": effect.get("activeFlagResolvedStaticDefault"),
        "predecessorSelector": effect.get("predecessorSelector"),
        "predecessorRootHex": effect.get("predecessorRootHex"),
        "predecessorFillValueHex": effect.get("predecessorFillValueHex"),
        "allPredecessorStartsPass": effect.get("allPredecessorStartsPass"),
        "priorSelectionBufferStillPrimaryBlockerUnderPredecessorHypothesis": effect.get(
            "priorSelectionBufferStillPrimaryBlockerUnderPredecessorHypothesis"
        ),
        "arbitraryStateCounterexampleCount": len(effect.get("arbitraryStateCounterexamples") or []),
        "promotionStatus": effect.get("promotionStatus"),
        "conclusion": effect.get("conclusion"),
    }


def active_flag_effect_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"active={evidence.get('activeFlagVaHex')} "
        f"static={evidence.get('activeFlagStaticInitialByteHex')} "
        f"save={evidence.get('activeFlagSaveOffsetHex')} "
        f"allPredStartsPass={evidence.get('allPredecessorStartsPass')} "
        f"priorPrimary={evidence.get('priorSelectionBufferStillPrimaryBlockerUnderPredecessorHypothesis')} "
        f"counterexamples={evidence.get('arbitraryStateCounterexampleCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def predecessor_route_order_for(source: str, target: str, route_order: dict | None) -> dict | None:
    if not route_order:
        return None
    if route_order.get("source") != source or route_order.get("target") != target:
        return None
    return {
        "predecessorSelector": route_order.get("predecessorSelector"),
        "currentSelector": route_order.get("currentSelector"),
        "sourceRoutePreviousSelector": route_order.get("sourceRoutePreviousSelector"),
        "predecessorConfirmedOverlapCount": len(route_order.get("predecessorConfirmedOverlap") or []),
        "sourceRoutePreviousConfirmedOverlap": route_order.get("sourceRoutePreviousConfirmedOverlap") or [],
        "routePairPreviousSelectorCount": len(route_order.get("routePairPreviousSelectors") or []),
        "predecessorIsTargetSideOnly": route_order.get("predecessorIsTargetSideOnly"),
        "samePreviousContainsRoutePair": route_order.get("samePreviousContainsRoutePair"),
        "selectorMergeGapOpen": route_order.get("selectorMergeGapOpen"),
        "selectorIndexOrderSupportsPredecessor": route_order.get("selectorIndexOrderSupportsPredecessor"),
        "selectorProgressSupportsPredecessor": route_order.get("selectorProgressSupportsPredecessor"),
        "routeOrderProven": route_order.get("routeOrderProven"),
        "proofFound": route_order.get("proofFound"),
        "predecessorRouteOrderProofFound": route_order.get("predecessorRouteOrderProofFound"),
        "failedPredecessorRouteOrderGateIds": route_order.get(
            "failedPredecessorRouteOrderGateIds"
        )
        or [],
        "missingEvidence": route_order.get("missingEvidence") or [],
        "evidenceRefs": route_order.get("evidenceRefs") or [],
        "evidenceRefCount": route_order.get("evidenceRefCount"),
        "promotionStatus": route_order.get("promotionStatus"),
        "conclusion": route_order.get("conclusion"),
    }


def predecessor_route_order_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"{evidence.get('predecessorSelector')}->{evidence.get('currentSelector')} "
        f"sourcePrev={evidence.get('sourceRoutePreviousSelector')} "
        f"predConfirmed={evidence.get('predecessorConfirmedOverlapCount')} "
        f"routePairPrev={evidence.get('routePairPreviousSelectorCount')} "
        f"targetOnly={evidence.get('predecessorIsTargetSideOnly')} "
        f"mergeGap={evidence.get('selectorMergeGapOpen')} "
        f"indexOrder={evidence.get('selectorIndexOrderSupportsPredecessor')} "
        f"progress={evidence.get('selectorProgressSupportsPredecessor')} "
        f"routeOrder={evidence.get('routeOrderProven')} "
        f"proofFound={evidence.get('proofFound')} "
        f"failedRouteOrderGates={','.join(evidence.get('failedPredecessorRouteOrderGateIds') or []) or '-'} "
        f"evidenceRefs={evidence.get('evidenceRefCount')}"
    )


def selector_set_decomposition_for(source: str, target: str, decomposition: dict | None) -> dict | None:
    if not decomposition:
        return None
    if decomposition.get("source") != source or decomposition.get("target") != target:
        return None
    return {
        "sourceSelector": decomposition.get("sourceSelector"),
        "predecessorSelector": decomposition.get("predecessorSelector"),
        "currentSelector": decomposition.get("currentSelector"),
        "currentEqualsPredecessorPlusSource": decomposition.get("currentEqualsPredecessorPlusSource"),
        "sourcePredecessorUnionCoversCurrent": decomposition.get("sourcePredecessorUnionCoversCurrent"),
        "sourcePredecessorUnionExtraMaps": decomposition.get("sourcePredecessorUnionExtraMaps") or [],
        "sourcePredecessorUnionMissingMaps": decomposition.get("sourcePredecessorUnionMissingMaps") or [],
        "exactPreviousSelectorUnionCount": decomposition.get("exactPreviousSelectorUnionCount"),
        "sourceSelectorExtraMapsOmittedByCurrent": decomposition.get("sourceSelectorExtraMapsOmittedByCurrent") or [],
        "currentOmitsSourceSelectorExtraMaps": decomposition.get("currentOmitsSourceSelectorExtraMaps"),
        "listRecompositionPatternFound": decomposition.get("listRecompositionPatternFound"),
        "executionOrderProven": decomposition.get("executionOrderProven"),
        "strictHotspotFound": decomposition.get("strictHotspotFound"),
        "proofFound": decomposition.get("proofFound"),
        "selectorSetDecompositionProofFound": decomposition.get("selectorSetDecompositionProofFound"),
        "failedSelectorSetDecompositionGateIds": decomposition.get(
            "failedSelectorSetDecompositionGateIds"
        )
        or [],
        "missingEvidence": decomposition.get("missingEvidence") or [],
        "evidenceRefs": decomposition.get("evidenceRefs") or [],
        "evidenceRefCount": decomposition.get("evidenceRefCount"),
        "promotionStatus": decomposition.get("promotionStatus"),
        "conclusion": decomposition.get("conclusion"),
    }


def selector_set_decomposition_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"{evidence.get('currentSelector')}=pred+source "
        f"{evidence.get('currentEqualsPredecessorPlusSource')} "
        f"{evidence.get('sourceSelector')}+{evidence.get('predecessorSelector')} "
        f"covers={evidence.get('sourcePredecessorUnionCoversCurrent')} "
        f"extra={','.join(evidence.get('sourcePredecessorUnionExtraMaps') or []) or '-'} "
        f"exactPairs={evidence.get('exactPreviousSelectorUnionCount')} "
        f"recomposition={evidence.get('listRecompositionPatternFound')} "
        f"execution={evidence.get('executionOrderProven')} "
        f"proofFound={evidence.get('proofFound')} "
        "failedGates="
        f"{','.join(evidence.get('failedSelectorSetDecompositionGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"status={evidence.get('promotionStatus')}"
    )


def selector_recomposition_lattice_for(source: str, target: str, lattice: dict | None) -> dict | None:
    if not lattice:
        return None
    if lattice.get("source") != source or lattice.get("target") != target:
        return None
    current = lattice.get("current") or {}
    return {
        "selectorWithFieldMapCount": lattice.get("selectorWithFieldMapCount"),
        "oneMapAugmentationCount": lattice.get("oneMapAugmentationCount"),
        "exactPairUnionCount": lattice.get("exactPairUnionCount"),
        "exactPairUnionSelectorCount": lattice.get("exactPairUnionSelectorCount"),
        "routePairSelectorCount": lattice.get("routePairSelectorCount"),
        "routePairOnlyCurrentSelector": lattice.get("routePairOnlyCurrentSelector"),
        "sourceSelector": (current.get("sourceSelector") or {}).get("selector"),
        "predecessorSelector": (current.get("predecessorSelector") or {}).get("selector"),
        "currentSelector": (current.get("currentSelector") or {}).get("selector"),
        "currentEqualsPredecessorPlusSource": current.get("currentEqualsPredecessorPlusSource"),
        "currentEqualsSourcePredecessorUnion": current.get("currentEqualsSourcePredecessorUnion"),
        "sourcePredecessorUnionCoversCurrent": current.get("sourcePredecessorUnionCoversCurrent"),
        "sourcePredecessorUnionExtraMaps": current.get("sourcePredecessorUnionExtraMaps") or [],
        "sourcePredecessorUnionMissingMaps": current.get("sourcePredecessorUnionMissingMaps") or [],
        "executionOrderProven": lattice.get("executionOrderProven"),
        "strictHotspotFound": lattice.get("strictHotspotFound"),
        "promotionStatus": lattice.get("promotionStatus"),
        "conclusion": lattice.get("conclusion"),
    }


def selector_recomposition_lattice_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"selectors={evidence.get('selectorWithFieldMapCount')} "
        f"routePairSelectors={evidence.get('routePairSelectorCount')} "
        f"onlyCurrent={evidence.get('routePairOnlyCurrentSelector')} "
        f"oneMapAug={evidence.get('oneMapAugmentationCount')} "
        f"exactPairUnions={evidence.get('exactPairUnionCount')}/"
        f"{evidence.get('exactPairUnionSelectorCount')} "
        f"{evidence.get('currentSelector')}=pred+source "
        f"{evidence.get('currentEqualsPredecessorPlusSource')} "
        f"unionCovers={evidence.get('sourcePredecessorUnionCoversCurrent')} "
        f"extra={','.join(evidence.get('sourcePredecessorUnionExtraMaps') or []) or '-'} "
        f"execution={evidence.get('executionOrderProven')} "
        f"hotspot={evidence.get('strictHotspotFound')} "
        f"status={evidence.get('promotionStatus')}"
    )


def address_predecessor_context_for(source: str, target: str, context: dict | None) -> dict | None:
    if not context:
        return None
    if context.get("source") != source or context.get("target") != target:
        return None
    return {
        "logicalPredecessorSelector": context.get("logicalPredecessorSelector"),
        "addressPredecessorSelector": context.get("addressPredecessorSelector"),
        "addressPredecessorRootHex": context.get("addressPredecessorRootHex"),
        "addressPredecessorEqualsLogicalPredecessorMapSet": context.get("addressPredecessorEqualsLogicalPredecessorMapSet"),
        "currentEqualsAddressPredecessorPlusSource": context.get("currentEqualsAddressPredecessorPlusSource"),
        "addressPredecessorToCurrentRootRefCount": context.get("addressPredecessorToCurrentRootRefCount"),
        "addressPredecessorToCurrentRootRefIsCurrentSelectorRowEntry": context.get("addressPredecessorToCurrentRootRefIsCurrentSelectorRowEntry"),
        "currentToAddressPredecessorRootRefCount": context.get("currentToAddressPredecessorRootRefCount"),
        "addressPredecessorCurrentRootRefClassification": context.get("addressPredecessorCurrentRootRefClassification"),
        "addressPredecessorCurrentRootRefFollowingStrings": context.get("addressPredecessorCurrentRootRefFollowingStrings") or [],
        "addressPredecessorLastFillAllStartsPassCurrentReader": context.get(
            "addressPredecessorLastFillAllStartsPassCurrentReader"
        ),
        "addressPredecessorTailHasKnownSecondaryFillAfterLastFill": context.get(
            "addressPredecessorTailHasKnownSecondaryFillAfterLastFill"
        ),
        "addressPredecessorPassingFillStillNotExecutionProof": context.get(
            "addressPredecessorPassingFillStillNotExecutionProof"
        ),
        "addressPredecessorTailCurrentRootRangePointerCount": context.get(
            "addressPredecessorTailCurrentRootRangePointerCount"
        ),
        "addressPredecessorTailCurrentRootExactRefCount": context.get(
            "addressPredecessorTailCurrentRootExactRefCount"
        ),
        "addressPredecessorTailFrontierReaderRefCount": context.get(
            "addressPredecessorTailFrontierReaderRefCount"
        ),
        "addressPredecessorTailSourceRecordRefCount": context.get(
            "addressPredecessorTailSourceRecordRefCount"
        ),
        "addressPredecessorTailTargetRecordRefCount": context.get(
            "addressPredecessorTailTargetRecordRefCount"
        ),
        "addressPredecessorTailLeafTableWindowPointerCount": context.get(
            "addressPredecessorTailLeafTableWindowPointerCount"
        ),
        "addressPredecessorTailDataHandlerLowByteCount": context.get(
            "addressPredecessorTailDataHandlerLowByteCount"
        ),
        "addressPredecessorTailLooksLikeDescriptorData": context.get(
            "addressPredecessorTailLooksLikeDescriptorData"
        ),
        "addressContiguityProvesExecution": context.get("addressContiguityProvesExecution"),
        "executionOrderProven": context.get("executionOrderProven"),
        "promotionStatus": context.get("promotionStatus"),
        "conclusion": context.get("conclusion"),
    }


def address_predecessor_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"addrPrev={evidence.get('addressPredecessorSelector')} "
        f"root={evidence.get('addressPredecessorRootHex')} "
        f"sameMapsAsLogical={evidence.get('addressPredecessorEqualsLogicalPredecessorMapSet')} "
        f"current=addrPrev+source {evidence.get('currentEqualsAddressPredecessorPlusSource')} "
        f"addrPrev->current={evidence.get('addressPredecessorToCurrentRootRefCount')} "
        f"rowEntry={evidence.get('addressPredecessorToCurrentRootRefIsCurrentSelectorRowEntry')} "
        f"class={evidence.get('addressPredecessorCurrentRootRefClassification')} "
        f"addrFillPass={evidence.get('addressPredecessorLastFillAllStartsPassCurrentReader')} "
        f"tailFillAfterLast={evidence.get('addressPredecessorTailHasKnownSecondaryFillAfterLastFill')} "
        f"passNotProof={evidence.get('addressPredecessorPassingFillStillNotExecutionProof')} "
        f"tailCurrentPtrs={evidence.get('addressPredecessorTailCurrentRootRangePointerCount')} "
        f"tailExactRoot={evidence.get('addressPredecessorTailCurrentRootExactRefCount')} "
        f"tailReader={evidence.get('addressPredecessorTailFrontierReaderRefCount')} "
        f"tailRecords={evidence.get('addressPredecessorTailSourceRecordRefCount')}/"
        f"{evidence.get('addressPredecessorTailTargetRecordRefCount')} "
        f"tailDataLike={evidence.get('addressPredecessorTailLooksLikeDescriptorData')} "
        f"contiguity={evidence.get('addressContiguityProvesExecution')} "
        f"execution={evidence.get('executionOrderProven')} "
        f"status={evidence.get('promotionStatus')}"
    )


def mapset_aliases_for(source: str, target: str, aliases: dict | None) -> dict | None:
    if not aliases:
        return None
    if aliases.get("source") != source or aliases.get("target") != target:
        return None
    return {
        "sourceSelector": aliases.get("sourceSelector"),
        "logicalPredecessorSelector": aliases.get("logicalPredecessorSelector"),
        "addressPredecessorSelector": aliases.get("addressPredecessorSelector"),
        "currentSelector": aliases.get("currentSelector"),
        "duplicateMapSetGroupCount": aliases.get("duplicateMapSetGroupCount"),
        "duplicateMapSetSelectorCount": aliases.get("duplicateMapSetSelectorCount"),
        "targetAliasSelectors": aliases.get("targetAliasSelectors") or [],
        "targetAliasPublicSampleIds": aliases.get("targetAliasPublicSampleIds") or [],
        "targetAliasPublicSampleCount": aliases.get("targetAliasPublicSampleCount"),
        "currentEqualsTargetAliasPlusSource": aliases.get("currentEqualsTargetAliasPlusSource"),
        "sourceTargetUnionOvercoversCurrent": aliases.get("sourceTargetUnionOvercoversCurrent"),
        "sourceTargetUnionExtraMaps": aliases.get("sourceTargetUnionExtraMaps") or [],
        "sourceTargetUnionMissingMaps": aliases.get("sourceTargetUnionMissingMaps") or [],
        "addressPredecessorEqualsLogicalPredecessorMapSet": aliases.get(
            "addressPredecessorEqualsLogicalPredecessorMapSet"
        ),
        "addressPredecessorToCurrentRootRefCount": aliases.get("addressPredecessorToCurrentRootRefCount"),
        "addressPredecessorCurrentRootRefClassification": aliases.get(
            "addressPredecessorCurrentRootRefClassification"
        ),
        "addressContiguityProvesExecution": aliases.get("addressContiguityProvesExecution"),
        "setDecompositionExecutionOrderProven": aliases.get("setDecompositionExecutionOrderProven"),
        "promotionStatus": aliases.get("promotionStatus"),
        "conclusion": aliases.get("conclusion"),
    }


def mapset_aliases_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"aliases={','.join(evidence.get('targetAliasSelectors') or []) or '-'} "
        f"public={','.join(evidence.get('targetAliasPublicSampleIds') or []) or '-'} "
        f"duplicates={evidence.get('duplicateMapSetGroupCount')}/"
        f"{evidence.get('duplicateMapSetSelectorCount')} "
        f"current=targetAlias+source {evidence.get('currentEqualsTargetAliasPlusSource')} "
        f"sourceTargetOvercovers={evidence.get('sourceTargetUnionOvercoversCurrent')} "
        f"extra={','.join(evidence.get('sourceTargetUnionExtraMaps') or []) or '-'} "
        f"addrPrevSameMaps={evidence.get('addressPredecessorEqualsLogicalPredecessorMapSet')} "
        f"addrPrev->current={evidence.get('addressPredecessorToCurrentRootRefCount')} "
        f"class={evidence.get('addressPredecessorCurrentRootRefClassification')} "
        f"contiguity={evidence.get('addressContiguityProvesExecution')} "
        f"execution={evidence.get('setDecompositionExecutionOrderProven')} "
        f"status={evidence.get('promotionStatus')}"
    )


def target_alias_state_effects_for(source: str, target: str, effects: dict | None) -> dict | None:
    if not effects:
        return None
    if effects.get("source") != source or effects.get("target") != target:
        return None
    alias_rows = []
    for row in effects.get("aliasRows") or []:
        alias_rows.append({
            "selector": row.get("selector"),
            "role": row.get("role"),
            "rootHex": row.get("rootHex"),
            "publicSampleIds": row.get("publicSampleIds") or [],
            "fillCount": row.get("fillCount"),
            "uniqueFillValuesHex": row.get("uniqueFillValuesHex") or [],
            "passingStartSlotCount": row.get("passingStartSlotCount"),
            "allStartSlotsPassCurrentReader": row.get("allStartSlotsPassCurrentReader"),
            "stateEffectStatus": row.get("stateEffectStatus"),
        })
    return {
        "currentSelector": effects.get("currentSelector"),
        "currentWriterVaHex": effects.get("currentWriterVaHex"),
        "currentReaderVaHex": effects.get("currentReaderVaHex"),
        "targetAliasSelectors": effects.get("targetAliasSelectors") or [],
        "targetAliasCount": effects.get("targetAliasCount"),
        "modeledPassFillValueHex": effects.get("modeledPassFillValueHex"),
        "modeledPassTable": effects.get("modeledPassTable") or [],
        "aliasesThatWouldPassIfExecutedAndPersisted": effects.get("aliasesThatWouldPassIfExecutedAndPersisted") or [],
        "aliasPassCount": effects.get("aliasPassCount"),
        "aliasesWithoutFillProof": effects.get("aliasesWithoutFillProof") or [],
        "aliasNoFillProofCount": effects.get("aliasNoFillProofCount"),
        "allTargetAliasesHaveFillProof": effects.get("allTargetAliasesHaveFillProof"),
        "aliasRows": alias_rows,
        "promotionStatus": effects.get("promotionStatus"),
        "conclusion": effects.get("conclusion"),
    }


def target_alias_state_effects_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    table = evidence.get("modeledPassTable") or []
    table_prefix = ",".join(str(value) for value in table[:4])
    if len(table) > 4:
        table_prefix += ",..."
    return (
        f"aliases={','.join(evidence.get('targetAliasSelectors') or []) or '-'} "
        f"pass={','.join(evidence.get('aliasesThatWouldPassIfExecutedAndPersisted') or []) or '-'} "
        f"noFill={','.join(evidence.get('aliasesWithoutFillProof') or []) or '-'} "
        f"passCount={evidence.get('aliasPassCount')} "
        f"noFillCount={evidence.get('aliasNoFillProofCount')} "
        f"fill={evidence.get('modeledPassFillValueHex')} "
        f"table=[{table_prefix}] "
        f"allFillProof={evidence.get('allTargetAliasesHaveFillProof')} "
        f"writer={evidence.get('currentWriterVaHex')} "
        f"reader={evidence.get('currentReaderVaHex')} "
        f"status={evidence.get('promotionStatus')}"
    )


def target_alias_bridge_for(source: str, target: str, bridges: dict | None) -> dict | None:
    if not bridges:
        return None
    if bridges.get("source") != source or bridges.get("target") != target:
        return None
    return {
        "targetAliasSelectors": bridges.get("targetAliasSelectors") or [],
        "currentRootRangeHex": bridges.get("currentRootRangeHex"),
        "publicSampleIds": bridges.get("publicSampleIds") or [],
        "publicCoveredAliasSelectors": bridges.get("publicCoveredAliasSelectors") or [],
        "publicCoveredForwardHitSelectors": bridges.get("publicCoveredForwardHitSelectors") or [],
        "publicCoveredForwardHitAliasCount": bridges.get("publicCoveredForwardHitAliasCount"),
        "publicCoveredForwardDataSelectors": bridges.get("publicCoveredForwardDataSelectors") or [],
        "publicCoveredAfterLastFillDataSelectors": bridges.get(
            "publicCoveredAfterLastFillDataSelectors"
        )
        or [],
        "forwardHitPublicSampleCount": bridges.get("forwardHitPublicSampleCount"),
        "addressAdjacentForwardHitSelectors": bridges.get("addressAdjacentForwardHitSelectors") or [],
        "addressAdjacentForwardDataSelectors": bridges.get("addressAdjacentForwardDataSelectors") or [],
        "nonPublicForwardHitSelectors": bridges.get("nonPublicForwardHitSelectors") or [],
        "forwardHitsAddressAdjacentOnly": bridges.get("forwardHitsAddressAdjacentOnly"),
        "publicForwardHitCoverageStatus": bridges.get("publicForwardHitCoverageStatus"),
        "targetAliasExecutionExclusionStatus": bridges.get(
            "targetAliasExecutionExclusionStatus"
        ),
        "targetAliasExecutionExclusionDetail": bridges.get(
            "targetAliasExecutionExclusionDetail"
        ),
        "aliasesWithForwardHits": bridges.get("aliasesWithForwardHits") or [],
        "aliasesWithForwardDataHits": bridges.get("aliasesWithForwardDataHits") or [],
        "aliasesWithAfterLastFillDataHits": bridges.get("aliasesWithAfterLastFillDataHits") or [],
        "dominantForwardDataAliases": bridges.get("dominantForwardDataAliases") or [],
        "dominantAfterLastFillDataAliases": bridges.get("dominantAfterLastFillDataAliases") or [],
        "aliasBridgeSummaryRows": bridges.get("aliasBridgeSummaryRows") or [],
        "aliasToCurrentHitCount": bridges.get("aliasToCurrentHitCount"),
        "aliasToCurrentMetadataHitCount": bridges.get("aliasToCurrentMetadataHitCount"),
        "aliasToCurrentDataHitCount": bridges.get("aliasToCurrentDataHitCount"),
        "aliasToCurrentPromotingExactHitCount": bridges.get("aliasToCurrentPromotingExactHitCount"),
        "aliasToCurrentPromotingMetadataHitCount": bridges.get("aliasToCurrentPromotingMetadataHitCount"),
        "aliasToCurrentPromotingDataHitCount": bridges.get("aliasToCurrentPromotingDataHitCount"),
        "aliasToCurrentPromotingExactMetadataOnly": bridges.get(
            "aliasToCurrentPromotingExactMetadataOnly"
        ),
        "aliasToCurrentPromotingMetadataHits": bridges.get("aliasToCurrentPromotingMetadataHits") or [],
        "aliasToCurrentPromotingMetadataHitSelectors": bridges.get(
            "aliasToCurrentPromotingMetadataHitSelectors"
        ) or [],
        "aliasToCurrentPromotingMetadataSourceRoles": bridges.get(
            "aliasToCurrentPromotingMetadataSourceRoles"
        ) or [],
        "aliasToCurrentReaderOrSceneRecordHitCount": bridges.get("aliasToCurrentReaderOrSceneRecordHitCount"),
        "aliasToCurrentLeafTableHitCount": bridges.get("aliasToCurrentLeafTableHitCount"),
        "aliasToCurrentLeafTableRoutePairHitCount": bridges.get("aliasToCurrentLeafTableRoutePairHitCount"),
        "aliasToCurrentLeafTableReaderHitCount": bridges.get("aliasToCurrentLeafTableReaderHitCount"),
        "aliasToCurrentLeafTableCorrectedReaderHitCount": bridges.get(
            "aliasToCurrentLeafTableCorrectedReaderHitCount"
        ),
        "aliasToCurrentLeafTableEffectiveReaderHitCount": bridges.get(
            "aliasToCurrentLeafTableEffectiveReaderHitCount"
        ),
        "aliasToCurrentLeafTableFrontierLeafHitCount": bridges.get("aliasToCurrentLeafTableFrontierLeafHitCount"),
        "aliasToCurrentPreWriterUniqueTargetCount": bridges.get("aliasToCurrentPreWriterUniqueTargetCount"),
        "aliasToCurrentPreWriterTraceCurrentWriterHitCount": bridges.get(
            "aliasToCurrentPreWriterTraceCurrentWriterHitCount"
        ),
        "aliasToCurrentPreWriterTraceCurrentReaderHitCount": bridges.get(
            "aliasToCurrentPreWriterTraceCurrentReaderHitCount"
        ),
        "aliasToCurrentPreWriterTraceRouteSceneRecordHitCount": bridges.get(
            "aliasToCurrentPreWriterTraceRouteSceneRecordHitCount"
        ),
        "aliasToCurrentAfterLastFillHitCount": bridges.get("aliasToCurrentAfterLastFillHitCount"),
        "aliasToCurrentAfterLastFillMetadataHitCount": bridges.get(
            "aliasToCurrentAfterLastFillMetadataHitCount"
        ),
        "aliasToCurrentAfterLastFillDataHitCount": bridges.get("aliasToCurrentAfterLastFillDataHitCount"),
        "aliasToCurrentAfterLastFillPreWriterHitCount": bridges.get(
            "aliasToCurrentAfterLastFillPreWriterHitCount"
        ),
        "aliasToCurrentAfterLastFillLeafTableHitCount": bridges.get(
            "aliasToCurrentAfterLastFillLeafTableHitCount"
        ),
        "aliasToCurrentAfterLastFillLeafTableCorrectedReaderHitCount": bridges.get(
            "aliasToCurrentAfterLastFillLeafTableCorrectedReaderHitCount"
        ),
        "aliasToCurrentAfterLastFillLeafTableEffectiveReaderHitCount": bridges.get(
            "aliasToCurrentAfterLastFillLeafTableEffectiveReaderHitCount"
        ),
        "aliasToCurrentAfterLastFillReaderOrSceneRecordHitCount": bridges.get(
            "aliasToCurrentAfterLastFillReaderOrSceneRecordHitCount"
        ),
        "aliasToCurrentAfterLastFillPreWriterUniqueTargetCount": bridges.get(
            "aliasToCurrentAfterLastFillPreWriterUniqueTargetCount"
        ),
        "aliasToCurrentAfterLastFillTraceCurrentWriterHitCount": bridges.get(
            "aliasToCurrentAfterLastFillTraceCurrentWriterHitCount"
        ),
        "aliasToCurrentAfterLastFillTraceCurrentReaderHitCount": bridges.get(
            "aliasToCurrentAfterLastFillTraceCurrentReaderHitCount"
        ),
        "aliasToCurrentAfterLastFillTraceRouteSceneRecordHitCount": bridges.get(
            "aliasToCurrentAfterLastFillTraceRouteSceneRecordHitCount"
        ),
        "aliasToCurrentAfterLastFillExecutionLikeBridgeFound": bridges.get(
            "aliasToCurrentAfterLastFillExecutionLikeBridgeFound"
        ),
        "aliasToCurrentExecutionLikeBridgeFound": bridges.get("aliasToCurrentExecutionLikeBridgeFound"),
        "aliasesWithoutForwardHits": bridges.get("aliasesWithoutForwardHits") or [],
        "proofFound": bridges.get("proofFound"),
        "targetAliasBridgeProofFound": bridges.get("targetAliasBridgeProofFound"),
        "failedTargetAliasBridgeGateIds": bridges.get("failedTargetAliasBridgeGateIds") or [],
        "missingEvidence": bridges.get("missingEvidence") or [],
        "evidenceRefs": bridges.get("evidenceRefs") or [],
        "evidenceRefCount": bridges.get("evidenceRefCount"),
        "promotionStatus": bridges.get("promotionStatus"),
        "conclusion": bridges.get("conclusion"),
    }


def target_alias_bridge_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"aliases={','.join(evidence.get('targetAliasSelectors') or []) or '-'} "
        f"range={evidence.get('currentRootRangeHex')} "
        f"public={','.join(evidence.get('publicSampleIds') or []) or '-'} "
        f"publicAliases={','.join(evidence.get('publicCoveredAliasSelectors') or []) or '-'} "
        f"publicForward={','.join(evidence.get('publicCoveredForwardHitSelectors') or []) or '-'} "
        f"publicData={','.join(evidence.get('publicCoveredForwardDataSelectors') or []) or '-'} "
        f"publicSamplesOnForward={evidence.get('forwardHitPublicSampleCount')} "
        f"addressForward={','.join(evidence.get('addressAdjacentForwardHitSelectors') or []) or '-'} "
        f"nonPublicForward={','.join(evidence.get('nonPublicForwardHitSelectors') or []) or '-'} "
        f"addressOnly={evidence.get('forwardHitsAddressAdjacentOnly')} "
        f"coverage={evidence.get('publicForwardHitCoverageStatus')} "
        f"exclusion={evidence.get('targetAliasExecutionExclusionStatus')} "
        f"hits={evidence.get('aliasToCurrentHitCount')} "
        f"meta/data={evidence.get('aliasToCurrentMetadataHitCount')}/"
        f"{evidence.get('aliasToCurrentDataHitCount')} "
        f"promotingExact={evidence.get('aliasToCurrentPromotingExactHitCount')} "
        f"promotingMetaData={evidence.get('aliasToCurrentPromotingMetadataHitCount')}/"
        f"{evidence.get('aliasToCurrentPromotingDataHitCount')} "
        f"promotingMetadataOnly={evidence.get('aliasToCurrentPromotingExactMetadataOnly')} "
        f"promotingRoles={','.join(evidence.get('aliasToCurrentPromotingMetadataSourceRoles') or []) or '-'} "
        f"forwardHitAliases={','.join(evidence.get('aliasesWithForwardHits') or []) or '-'} "
        f"forwardDataAliases={','.join(evidence.get('aliasesWithForwardDataHits') or []) or '-'} "
        f"tailDataAliases={','.join(evidence.get('aliasesWithAfterLastFillDataHits') or []) or '-'} "
        f"dominantDataAliases={','.join(evidence.get('dominantForwardDataAliases') or []) or '-'} "
        f"tailHits={evidence.get('aliasToCurrentAfterLastFillHitCount')} "
        f"tailMeta={evidence.get('aliasToCurrentAfterLastFillMetadataHitCount')} "
        f"tailData={evidence.get('aliasToCurrentAfterLastFillDataHitCount')} "
        f"tailPreWriter={evidence.get('aliasToCurrentAfterLastFillPreWriterHitCount')} "
        f"tailLeaf={evidence.get('aliasToCurrentAfterLastFillLeafTableHitCount')} "
        f"leafRoutePair={evidence.get('aliasToCurrentLeafTableRoutePairHitCount')} "
        f"leafRawReader={evidence.get('aliasToCurrentLeafTableReaderHitCount')} "
        f"leafCorrectedReader={evidence.get('aliasToCurrentLeafTableCorrectedReaderHitCount')} "
        f"tailLeafCorrectedReader={evidence.get('aliasToCurrentAfterLastFillLeafTableCorrectedReaderHitCount')} "
        f"tailTraceW/R/S={evidence.get('aliasToCurrentAfterLastFillTraceCurrentWriterHitCount')}/"
        f"{evidence.get('aliasToCurrentAfterLastFillTraceCurrentReaderHitCount')}/"
        f"{evidence.get('aliasToCurrentAfterLastFillTraceRouteSceneRecordHitCount')} "
        f"execLike={evidence.get('aliasToCurrentExecutionLikeBridgeFound')} "
        f"tailExecLike={evidence.get('aliasToCurrentAfterLastFillExecutionLikeBridgeFound')} "
        f"withoutForward={','.join(evidence.get('aliasesWithoutForwardHits') or []) or '-'} "
        f"proofFound={evidence.get('proofFound')} "
        "failedGates="
        f"{','.join(evidence.get('failedTargetAliasBridgeGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"status={evidence.get('promotionStatus')}"
    )


def route_root_ref_context_for(source: str, target: str, context: dict | None) -> dict | None:
    if not context:
        return None
    if context.get("source") != source or context.get("target") != target:
        return None
    return {
        "allRouteSelectorRootsTableOnly": context.get("allRouteSelectorRootsTableOnly"),
        "anyRouteSelectorRootTextRefs": context.get("anyRouteSelectorRootTextRefs"),
        "sourceTargetSplitAcrossPreviousSelectors": context.get("sourceTargetSplitAcrossPreviousSelectors"),
        "currentSelectorContainsRoutePair": context.get("currentSelectorContainsRoutePair"),
        "predecessorToCurrentRootRefFound": context.get("predecessorToCurrentRootRefFound"),
        "routeOrderProven": context.get("routeOrderProven"),
        "proofFound": context.get("proofFound"),
        "routeRootRefProofFound": context.get("routeRootRefProofFound"),
        "failedRouteRootRefGateIds": context.get("failedRouteRootRefGateIds") or [],
        "missingEvidence": context.get("missingEvidence") or [],
        "evidenceRefs": context.get("evidenceRefs") or [],
        "evidenceRefCount": context.get("evidenceRefCount"),
        "promotionStatus": context.get("promotionStatus"),
        "remainingProofs": context.get("remainingProofs") or [],
        "conclusion": context.get("conclusion"),
    }


def route_root_ref_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"tableOnly={evidence.get('allRouteSelectorRootsTableOnly')} "
        f"textRefs={evidence.get('anyRouteSelectorRootTextRefs')} "
        f"split={evidence.get('sourceTargetSplitAcrossPreviousSelectors')} "
        f"currentPair={evidence.get('currentSelectorContainsRoutePair')} "
        f"predToCurrentRootRef={evidence.get('predecessorToCurrentRootRefFound')} "
        f"routeOrder={evidence.get('routeOrderProven')} "
        f"proofFound={evidence.get('proofFound')} "
        "failedGates="
        f"{','.join(evidence.get('failedRouteRootRefGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])}"
    )


def predecessor_bridge_refs_for(bridge_refs: dict | None) -> dict | None:
    if not bridge_refs:
        return None
    predecessor_to_current = bridge_refs.get("predecessorToCurrent") or {}
    current_to_predecessor = bridge_refs.get("currentToPredecessor") or {}
    return {
        "predecessorSelector": bridge_refs.get("predecessorSelector"),
        "predecessorRootHex": bridge_refs.get("predecessorRootHex"),
        "currentSelector": bridge_refs.get("currentSelector"),
        "currentRootHex": bridge_refs.get("currentRootHex"),
        "predecessorToCurrentHitCount": predecessor_to_current.get("hitCount"),
        "currentToPredecessorHitCount": current_to_predecessor.get("hitCount"),
        "bridgeFound": bridge_refs.get("bridgeFound"),
        "forwardExecutionBridgeFound": bridge_refs.get("forwardExecutionBridgeFound"),
        "reverseReuseHitCount": bridge_refs.get("reverseReuseHitCount"),
        "reverseHitsToFillSiteCount": bridge_refs.get("reverseHitsToFillSiteCount"),
        "reverseHitsBeforeFillCount": bridge_refs.get("reverseHitsBeforeFillCount"),
        "reverseHitsOnlyBeforeFill": bridge_refs.get("reverseHitsOnlyBeforeFill"),
        "routeOrderProven": bridge_refs.get("routeOrderProven"),
        "promotionStatus": bridge_refs.get("promotionStatus"),
        "conclusion": bridge_refs.get("conclusion"),
    }


def predecessor_bridge_refs_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"{evidence.get('predecessorSelector')}->{evidence.get('currentSelector')} "
        f"forward={evidence.get('predecessorToCurrentHitCount')} "
        f"reverse={evidence.get('currentToPredecessorHitCount')} "
        f"forwardExec={evidence.get('forwardExecutionBridgeFound')} "
        f"reverseBeforeFill={evidence.get('reverseHitsBeforeFillCount')} "
        f"reverseToFill={evidence.get('reverseHitsToFillSiteCount')} "
        f"onlyBeforeFill={evidence.get('reverseHitsOnlyBeforeFill')} "
        f"routeOrder={evidence.get('routeOrderProven')}"
    )


def reverse_reuse_context_for(source: str, target: str, context: dict | None) -> dict | None:
    if not context:
        return None
    if context.get("source") != source or context.get("target") != target:
        return None
    return {
        "sourceSelector": context.get("sourceSelector"),
        "predecessorSelector": context.get("predecessorSelector"),
        "currentSelector": context.get("currentSelector"),
        "reverseHitCount": context.get("reverseHitCount"),
        "forwardMergeBridgeHitCount": context.get("forwardMergeBridgeHitCount"),
        "directMergeExecutionBridgeFound": context.get("directMergeExecutionBridgeFound"),
        "beforePredecessorFillHitCount": context.get("beforePredecessorFillHitCount"),
        "fillSiteHitCount": context.get("fillSiteHitCount"),
        "alignedTargetCount": context.get("alignedTargetCount"),
        "unalignedTargetCount": context.get("unalignedTargetCount"),
        "classificationCounts": context.get("classificationCounts") or {},
        "proofFound": context.get("proofFound"),
        "reverseReuseProofFound": context.get("reverseReuseProofFound"),
        "failedReverseReuseGateIds": context.get("failedReverseReuseGateIds") or [],
        "missingEvidence": context.get("missingEvidence") or [],
        "evidenceRefs": context.get("evidenceRefs") or [],
        "evidenceRefCount": context.get("evidenceRefCount"),
        "promotionStatus": context.get("promotionStatus"),
        "conclusion": context.get("conclusion"),
    }


def reverse_reuse_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"{evidence.get('currentSelector')}->{evidence.get('predecessorSelector')} "
        f"reverse={evidence.get('reverseHitCount')} "
        f"beforeFill={evidence.get('beforePredecessorFillHitCount')} "
        f"fillSites={evidence.get('fillSiteHitCount')} "
        f"aligned/unaligned={evidence.get('alignedTargetCount')}/"
        f"{evidence.get('unalignedTargetCount')} "
        f"forward={evidence.get('forwardMergeBridgeHitCount')} "
        f"directMerge={evidence.get('directMergeExecutionBridgeFound')} "
        f"proof={evidence.get('proofFound')} "
        f"status={evidence.get('promotionStatus')}"
    )


def merge_bridge_matrix_for(source: str, target: str, matrix: dict | None) -> dict | None:
    if not matrix:
        return None
    if matrix.get("source") != source or matrix.get("target") != target:
        return None
    return {
        "sourceSelector": matrix.get("sourceSelector"),
        "predecessorSelector": matrix.get("predecessorSelector"),
        "currentSelector": matrix.get("currentSelector"),
        "sourceToPredecessorHitCount": matrix.get("sourceToPredecessorHitCount"),
        "sourceToCurrentHitCount": matrix.get("sourceToCurrentHitCount"),
        "predecessorToCurrentHitCount": matrix.get("predecessorToCurrentHitCount"),
        "currentToPredecessorHitCount": matrix.get("currentToPredecessorHitCount"),
        "currentToPredecessorBeforeFillHitCount": matrix.get("currentToPredecessorBeforeFillHitCount"),
        "currentToPredecessorFillSiteHitCount": matrix.get("currentToPredecessorFillSiteHitCount"),
        "currentPredecessorHitsBeforeFillOnly": matrix.get("currentPredecessorHitsBeforeFillOnly"),
        "forwardMergeBridgeHitCount": matrix.get("forwardMergeBridgeHitCount"),
        "directMergeExecutionBridgeFound": matrix.get("directMergeExecutionBridgeFound"),
        "forwardEncodedAnchorRawScalarCandidateCount": matrix.get(
            "forwardEncodedAnchorRawScalarCandidateCount"
        ),
        "forwardEncodedAnchorPromotingCandidateCount": matrix.get(
            "forwardEncodedAnchorPromotingCandidateCount"
        ),
        "encodedAnchorPromotingCandidateCount": matrix.get("encodedAnchorPromotingCandidateCount"),
        "encodedMergeExecutionBridgeFound": matrix.get("encodedMergeExecutionBridgeFound"),
        "selectorMergeProofStatus": matrix.get("selectorMergeProofStatus"),
        "proofFound": matrix.get("proofFound"),
        "mergeBridgeMatrixProofFound": matrix.get("mergeBridgeMatrixProofFound"),
        "failedMergeBridgeGateIds": matrix.get("failedMergeBridgeGateIds") or [],
        "missingEvidence": matrix.get("missingEvidence") or [],
        "evidenceRefs": matrix.get("evidenceRefs") or [],
        "evidenceRefCount": matrix.get("evidenceRefCount"),
        "promotionStatus": matrix.get("promotionStatus"),
        "conclusion": matrix.get("conclusion"),
    }


def merge_bridge_matrix_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"{evidence.get('sourceSelector')}->{evidence.get('predecessorSelector')}="
        f"{evidence.get('sourceToPredecessorHitCount')} "
        f"{evidence.get('sourceSelector')}->{evidence.get('currentSelector')}="
        f"{evidence.get('sourceToCurrentHitCount')} "
        f"{evidence.get('predecessorSelector')}->{evidence.get('currentSelector')}="
        f"{evidence.get('predecessorToCurrentHitCount')} "
        f"{evidence.get('currentSelector')}->{evidence.get('predecessorSelector')}="
        f"{evidence.get('currentToPredecessorHitCount')} "
        f"beforeFill={evidence.get('currentToPredecessorBeforeFillHitCount')} "
        f"fillSites={evidence.get('currentToPredecessorFillSiteHitCount')} "
        f"forward={evidence.get('forwardMergeBridgeHitCount')} "
        f"directMerge={evidence.get('directMergeExecutionBridgeFound')} "
        f"encodedRaw={evidence.get('forwardEncodedAnchorRawScalarCandidateCount')} "
        f"encodedPromoting={evidence.get('forwardEncodedAnchorPromotingCandidateCount')} "
        f"encodedMerge={evidence.get('encodedMergeExecutionBridgeFound')} "
        f"proofFound={evidence.get('proofFound')} "
        "failedGates="
        f"{','.join(evidence.get('failedMergeBridgeGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])}"
    )


def selected_pointer_opcode_paths_for(source: str, target: str, opcode_paths: dict | None) -> dict | None:
    if not opcode_paths:
        return None
    if opcode_paths.get("source") != source or opcode_paths.get("target") != target:
        return None
    return {
        "sourceSelector": opcode_paths.get("sourceSelector"),
        "predecessorSelector": opcode_paths.get("predecessorSelector"),
        "currentSelector": opcode_paths.get("currentSelector"),
        "sourceOrPredecessorOpcode08ActivatorCount": opcode_paths.get("sourceOrPredecessorOpcode08ActivatorCount"),
        "sourceOrPredecessorCurrentRootWriterCount": opcode_paths.get("sourceOrPredecessorCurrentRootWriterCount"),
        "sourceOrPredecessorCurrentRangeWriterCount": opcode_paths.get("sourceOrPredecessorCurrentRangeWriterCount"),
        "currentInternalOpcode09StoreCount": opcode_paths.get("currentInternalOpcode09StoreCount"),
        "selectedPointerOpcodePathPromotesRoute": opcode_paths.get("selectedPointerOpcodePathPromotesRoute"),
        "promotionStatus": opcode_paths.get("promotionStatus"),
        "conclusion": opcode_paths.get("conclusion"),
    }


def selected_pointer_opcode_paths_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"op8Activators={evidence.get('sourceOrPredecessorOpcode08ActivatorCount')} "
        f"sourcePredCurrentRootWriters={evidence.get('sourceOrPredecessorCurrentRootWriterCount')} "
        f"sourcePredCurrentRangeWriters={evidence.get('sourceOrPredecessorCurrentRangeWriterCount')} "
        f"currentInternalOp9={evidence.get('currentInternalOpcode09StoreCount')} "
        f"promotes={evidence.get('selectedPointerOpcodePathPromotesRoute')}"
    )


def global_selected_pointer_paths_for(source: str, target: str, global_paths: dict | None) -> dict | None:
    if not global_paths:
        return None
    if global_paths.get("source") != source or global_paths.get("target") != target:
        return None
    return {
        "currentSelector": global_paths.get("currentSelector"),
        "currentRootHex": global_paths.get("currentRootHex"),
        "currentRangeHex": global_paths.get("currentRangeHex"),
        "selectorRowCount": global_paths.get("selectorRowCount"),
        "selectorRootCount": global_paths.get("selectorRootCount"),
        "scannedRootCount": global_paths.get("scannedRootCount"),
        "opcode07RowCount": global_paths.get("opcode07RowCount"),
        "opcode08RowCount": global_paths.get("opcode08RowCount"),
        "opcode09RowCount": global_paths.get("opcode09RowCount"),
        "nonCurrentOpcode07CurrentRootSelectCount": global_paths.get("nonCurrentOpcode07CurrentRootSelectCount"),
        "nonCurrentOpcode07CurrentRangeSelectCount": global_paths.get("nonCurrentOpcode07CurrentRangeSelectCount"),
        "nonCurrentOpcode09CurrentRootStoreCount": global_paths.get("nonCurrentOpcode09CurrentRootStoreCount"),
        "nonCurrentOpcode09CurrentRangeStoreCount": global_paths.get("nonCurrentOpcode09CurrentRangeStoreCount"),
        "nonCurrentOpcode08ActivatorCount": global_paths.get("nonCurrentOpcode08ActivatorCount"),
        "nonCurrentOpcode08NearestCurrentRootProducerCount": global_paths.get("nonCurrentOpcode08NearestCurrentRootProducerCount"),
        "nonCurrentOpcode08NearestCurrentRangeProducerCount": global_paths.get("nonCurrentOpcode08NearestCurrentRangeProducerCount"),
        "currentInternalOpcode09CurrentRangeStoreCount": global_paths.get("currentInternalOpcode09CurrentRangeStoreCount"),
        "currentInternalOpcode08NearestCurrentRangeProducerCount": global_paths.get("currentInternalOpcode08NearestCurrentRangeProducerCount"),
        "promotingSelectedPointerPathCount": global_paths.get("promotingSelectedPointerPathCount"),
        "selectedRootExecutionRefFound": global_paths.get("selectedRootExecutionRefFound"),
        "promotionStatus": global_paths.get("promotionStatus"),
        "conclusion": global_paths.get("conclusion"),
    }


def global_selected_pointer_paths_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"roots={evidence.get('scannedRootCount')}/{evidence.get('selectorRootCount')} "
        f"op7/op8/op9={evidence.get('opcode07RowCount')}/"
        f"{evidence.get('opcode08RowCount')}/{evidence.get('opcode09RowCount')} "
        f"nonCurrentRoot={evidence.get('nonCurrentOpcode07CurrentRootSelectCount')}/"
        f"{evidence.get('nonCurrentOpcode09CurrentRootStoreCount')}/"
        f"{evidence.get('nonCurrentOpcode08NearestCurrentRootProducerCount')} "
        f"nonCurrentRange={evidence.get('nonCurrentOpcode07CurrentRangeSelectCount')}/"
        f"{evidence.get('nonCurrentOpcode09CurrentRangeStoreCount')}/"
        f"{evidence.get('nonCurrentOpcode08NearestCurrentRangeProducerCount')} "
        f"currentInternal={evidence.get('currentInternalOpcode09CurrentRangeStoreCount')}/"
        f"{evidence.get('currentInternalOpcode08NearestCurrentRangeProducerCount')} "
        f"selectedRootExec={evidence.get('selectedRootExecutionRefFound')} "
        f"promoteCandidates={evidence.get('promotingSelectedPointerPathCount')}"
    )


def selected_root_execution_gap_for(source: str, target: str, execution_gap: dict | None) -> dict | None:
    if not execution_gap:
        return None
    if execution_gap.get("source") != source or execution_gap.get("target") != target:
        return None
    gate_rows = execution_gap.get("gateRows") or []
    save_gate = execution_gap.get("saveLoaderGate") or {}
    static_gate = execution_gap.get("staticReferenceGate") or {}
    hook_gate = execution_gap.get("hookPrerequisiteGate") or {}
    dispatch_gate = execution_gap.get("dispatchTableGate") or {}
    opcode_gate = execution_gap.get("opcodeSelectedPointerGate") or {}
    writer_gate = execution_gap.get("currentWriterPathGate") or {}
    runtime_gate = execution_gap.get("runtimeProbeGate") or {}
    diagnostic_gate = execution_gap.get("diagnosticExclusionGate") or {}
    remaining_proofs = execution_gap.get("remainingProofs") or execution_gap.get("nextRequiredEvidence") or []
    evidence_refs = execution_gap.get("evidenceRefs") or []
    return {
        "currentSelector": execution_gap.get("currentSelector"),
        "currentRootHex": execution_gap.get("currentRootHex"),
        "selectedPointerGlobalHex": execution_gap.get("selectedPointerGlobalHex"),
        "proofFound": execution_gap.get("proofFound"),
        "selectedRootExecutionRefFound": execution_gap.get("selectedRootExecutionRefFound"),
        "failedSelectedRootGateIds": execution_gap.get("failedSelectedRootGateIds") or [],
        "missingEvidence": execution_gap.get("missingEvidence") or [],
        "selectedRootExecutionRejectionClassification": execution_gap.get(
            "selectedRootExecutionRejectionClassification"
        ),
        "selectedRootExecutionRejection": execution_gap.get("selectedRootExecutionRejection") or {},
        "saveLoaderGateStatus": execution_gap.get("saveLoaderGateStatus"),
        "dispatchTableGateStatus": execution_gap.get("dispatchTableGateStatus"),
        "staticReferenceGateStatus": execution_gap.get("staticReferenceGateStatus"),
        "hookPrerequisiteGateStatus": execution_gap.get("hookPrerequisiteGateStatus"),
        "opcodeSelectedPointerGateStatus": execution_gap.get("opcodeSelectedPointerGateStatus"),
        "currentWriterPathGateStatus": execution_gap.get("currentWriterPathGateStatus"),
        "runtimeProbeGateStatus": execution_gap.get("runtimeProbeGateStatus"),
        "diagnosticExclusionGateStatus": execution_gap.get("diagnosticExclusionGateStatus"),
        "selectedRootSubgateStatusOrder": execution_gap.get("selectedRootSubgateStatusOrder") or [],
        "selectedRootSubgateStatuses": execution_gap.get("selectedRootSubgateStatuses") or {},
        "selectedRootSubgateCount": execution_gap.get("selectedRootSubgateCount"),
        "selectedRootNonPromotingSubgateCount": execution_gap.get("selectedRootNonPromotingSubgateCount"),
        "selectedRootAllSubgatesNonPromoting": execution_gap.get("selectedRootAllSubgatesNonPromoting"),
        "selectedRootGateRowCount": len(gate_rows),
        "selectedRootGateRows": gate_rows,
        "remainingProofs": remaining_proofs,
        "remainingProofCount": len(remaining_proofs),
        "evidenceRefs": evidence_refs,
        "evidenceRefCount": len(evidence_refs),
        "saveCurrentSelectorRealSaveCount": save_gate.get("currentSelectorRealSaveCount"),
        "saveSelectedPointerRealSaveCount": save_gate.get("selectedPointerRealSaveCount"),
        "saveRoutePairRealSaveCount": save_gate.get("routePairRealSaveCount"),
        "staticCurrentCodeRefCount": static_gate.get("currentCodeRefCount"),
        "staticRootTextRefCount": static_gate.get("currentSelectorRootTextRefCount"),
        "hookTraceHookPointCount": hook_gate.get("traceHookPointCount"),
        "hookPrerequisiteUnprovenCount": hook_gate.get("routePrerequisiteUnprovenCount"),
        "hookSelfProvingCount": hook_gate.get("hookSelfProvingCount"),
        "hookPromotingCount": hook_gate.get("hookPromotingCount"),
        "hookWindowScannedRefCount": hook_gate.get("hookWindowScannedRefCount"),
        "hookWindowRouteSpecificHitCount": hook_gate.get("hookWindowRouteSpecificHitCount"),
        "hookPrerequisitesAllUnproven": hook_gate.get("hookPrerequisitesAllUnproven"),
        "hookHandlerCallGraphClassification": hook_gate.get("hookHandlerCallGraphClassification"),
        "hookHandlerCallGraphProofFound": hook_gate.get("hookHandlerCallGraphProofFound"),
        "hookHandlerCallGraphRouteContextFound": hook_gate.get("hookHandlerCallGraphRouteContextFound"),
        "hookHandlerCallGraphRootCount": hook_gate.get("hookHandlerCallGraphRootCount"),
        "hookHandlerCallGraphReachableFunctionCount": hook_gate.get(
            "hookHandlerCallGraphReachableFunctionCount"
        ),
        "hookHandlerCallGraphDirectCallEdgeCount": hook_gate.get(
            "hookHandlerCallGraphDirectCallEdgeCount"
        ),
        "hookHandlerCallGraphRouteImmediateHitCount": hook_gate.get(
            "hookHandlerCallGraphRouteImmediateHitCount"
        ),
        "hookHandlerCallGraphCurrentImmediateHitCount": hook_gate.get(
            "hookHandlerCallGraphCurrentImmediateHitCount"
        ),
        "hookHandlerCallGraphRouteRecordImmediateHitCount": hook_gate.get(
            "hookHandlerCallGraphRouteRecordImmediateHitCount"
        ),
        "hookHandlerCallGraphRouteSelectorImmediateHitCount": hook_gate.get(
            "hookHandlerCallGraphRouteSelectorImmediateHitCount"
        ),
        "hookHandlerCallGraphSelectedPointerImmediateHitCount": hook_gate.get(
            "hookHandlerCallGraphSelectedPointerImmediateHitCount"
        ),
        "hookHandlerCallGraphSelectorTableImmediateHitCount": hook_gate.get(
            "hookHandlerCallGraphSelectorTableImmediateHitCount"
        ),
        "hookHandlerCallGraphBranchStateImmediateHitCount": hook_gate.get(
            "hookHandlerCallGraphBranchStateImmediateHitCount"
        ),
        "hookHandlerCallGraphDepthSensitivityMaxDepthChecked": hook_gate.get(
            "hookHandlerCallGraphDepthSensitivityMaxDepthChecked"
        ),
        "hookHandlerCallGraphDepthSensitivityProofAbsentAcrossCheckedDepths": hook_gate.get(
            "hookHandlerCallGraphDepthSensitivityProofAbsentAcrossCheckedDepths"
        ),
        "hookHandlerCallGraphDepthSensitivityCountsStableAtAndBeyondDefaultDepth": hook_gate.get(
            "hookHandlerCallGraphDepthSensitivityCountsStableAtAndBeyondDefaultDepth"
        ),
        "hookHandlerEncodedTargetClassification": hook_gate.get(
            "hookHandlerEncodedTargetClassification"
        ),
        "hookHandlerEncodedTargetRawScalarCandidateCount": hook_gate.get(
            "hookHandlerEncodedTargetRawScalarCandidateCount"
        ),
        "hookHandlerEncodedTargetRouteProofRawScalarCandidateCount": hook_gate.get(
            "hookHandlerEncodedTargetRouteProofRawScalarCandidateCount"
        ),
        "hookHandlerEncodedTargetRouteContextRawScalarCandidateCount": hook_gate.get(
            "hookHandlerEncodedTargetRouteContextRawScalarCandidateCount"
        ),
        "hookHandlerEncodedTargetPromotingCandidateCount": hook_gate.get(
            "hookHandlerEncodedTargetPromotingCandidateCount"
        ),
        "hookRequirementKinds": hook_gate.get("routeRequirementKinds") or [],
        "hookPromotionStatus": hook_gate.get("promotionStatus"),
        "dispatchGeneralHandlerTableHex": dispatch_gate.get("generalHandlerTableHex"),
        "dispatchSaveSelectorHandlerTableHex": dispatch_gate.get("saveSelectorHandlerTableHex"),
        "dispatchSaveSelectorSliceOffsetHex": dispatch_gate.get("saveSelectorSliceOffsetHex"),
        "dispatchGenericIndexedDispatchCount": dispatch_gate.get("generalIndexedDispatchCount"),
        "dispatchSaveSelectorDirectDwordRefCount": dispatch_gate.get("saveSelectorDirectDwordRefCount"),
        "dispatchSaveSelectorIndexedDispatchCount": dispatch_gate.get("saveSelectorIndexedDispatchCount"),
        "dispatchSelectedPointerRelativeHandlersVerified": dispatch_gate.get(
            "selectedPointerRelativeHandlersVerified"
        ),
        "dispatchRefFound": dispatch_gate.get("selectedRootExecutionDispatchRefFound"),
        "globalNonCurrentRootProducerCounts": [
            opcode_gate.get("nonCurrentOpcode07CurrentRootSelectCount"),
            opcode_gate.get("nonCurrentOpcode09CurrentRootStoreCount"),
            opcode_gate.get("nonCurrentOpcode08NearestCurrentRootProducerCount"),
        ],
        "globalNonCurrentRangeProducerCounts": [
            opcode_gate.get("nonCurrentOpcode07CurrentRangeSelectCount"),
            opcode_gate.get("nonCurrentOpcode09CurrentRangeStoreCount"),
            opcode_gate.get("nonCurrentOpcode08NearestCurrentRangeProducerCount"),
        ],
        "globalCurrentInternalProducerCounts": [
            opcode_gate.get("currentInternalOpcode09CurrentRangeStoreCount"),
            opcode_gate.get("currentInternalOpcode08NearestCurrentRangeProducerCount"),
        ],
        "currentWriterCount": writer_gate.get("writerCount"),
        "currentWriterPathPromotionStatus": writer_gate.get("promotionStatus"),
        "runtimePollSampleCount": runtime_gate.get("pollSampleCount"),
        "runtimePollObservedSelectors": runtime_gate.get("pollObservedSelectors") or [],
        "runtimePreludePollSampleCount": runtime_gate.get("preludePollSampleCount"),
        "runtimePreludePollObservedSelectors": runtime_gate.get("preludePollObservedSelectors") or [],
        "runtimeLongPollSampleCount": runtime_gate.get("longPollSampleCount"),
        "runtimeLongPollObservedSelectors": runtime_gate.get("longPollObservedSelectors") or [],
        "runtimeLatePollSampleCount": runtime_gate.get("latePollSampleCount"),
        "runtimeLatePollStartupWaitSeconds": runtime_gate.get("latePollStartupWaitSeconds"),
        "runtimeLatePollObservedSelectors": runtime_gate.get("latePollObservedSelectors") or [],
        "runtimeRouteWatchPollSampleCount": runtime_gate.get("routeWatchPollSampleCount"),
        "runtimeRouteWatchPollStartupWaitSeconds": runtime_gate.get("routeWatchPollStartupWaitSeconds"),
        "runtimeRouteWatchPollObservedSelectors": runtime_gate.get("routeWatchPollObservedSelectors") or [],
        "runtimeRouteWatchPollValues": runtime_gate.get("routeWatchPollValues"),
        "runtimeRouteWatchPollReachedRouteSelector": runtime_gate.get("routeWatchPollReachedRouteSelector"),
        "runtimeSaveLoadPollSampleCount": runtime_gate.get("savedataLoadPollSampleCount"),
        "runtimeSaveLoadPollStartupWaitSeconds": runtime_gate.get("savedataLoadPollStartupWaitSeconds"),
        "runtimeSaveLoadPollObservedSelectors": runtime_gate.get("savedataLoadPollObservedSelectors") or [],
        "runtimeSaveLoadPollReachedRouteSelector": runtime_gate.get("savedataLoadPollReachedRouteSelector"),
        "runtimeSaveLoadPollValues": runtime_gate.get("savedataLoadPollValues"),
        "runtimeMultislotSaveLoadPollSampleCount": runtime_gate.get("multislotSavedataLoadPollSampleCount"),
        "runtimeMultislotSaveLoadPollStartupWaitSeconds": runtime_gate.get(
            "multislotSavedataLoadPollStartupWaitSeconds"
        ),
        "runtimeMultislotSaveLoadPollPublicSaveSelectors": (
            runtime_gate.get("multislotSavedataLoadPollPublicSaveSelectors") or []
        ),
        "runtimeMultislotSaveLoadPollObservedSelectors": (
            runtime_gate.get("multislotSavedataLoadPollObservedSelectors") or []
        ),
        "runtimeMultislotSaveLoadPollObservedPublicSaveSelectors": (
            runtime_gate.get("multislotSavedataLoadPollObservedPublicSaveSelectors") or []
        ),
        "runtimeMultislotSaveLoadPollReachedPublicSaveSelector": runtime_gate.get(
            "multislotSavedataLoadPollReachedPublicSaveSelector"
        ),
        "runtimeMultislotSaveLoadPollReachedRouteSelector": runtime_gate.get(
            "multislotSavedataLoadPollReachedRouteSelector"
        ),
        "runtimeMultislotSaveLoadPollValues": runtime_gate.get("multislotSavedataLoadPollValues"),
        "runtimeCaseAliasMultislotSaveLoadPollSampleCount": runtime_gate.get(
            "caseAliasMultislotSavedataLoadPollSampleCount"
        ),
        "runtimeCaseAliasMultislotSaveLoadPollStartupWaitSeconds": runtime_gate.get(
            "caseAliasMultislotSavedataLoadPollStartupWaitSeconds"
        ),
        "runtimeCaseAliasMultislotSaveLoadPollCaseAliasesEnabled": runtime_gate.get(
            "caseAliasMultislotSavedataLoadPollCaseAliasesEnabled"
        ),
        "runtimeCaseAliasMultislotSaveLoadPollPublicSaveSelectors": (
            runtime_gate.get("caseAliasMultislotSavedataLoadPollPublicSaveSelectors") or []
        ),
        "runtimeCaseAliasMultislotSaveLoadPollObservedSelectors": (
            runtime_gate.get("caseAliasMultislotSavedataLoadPollObservedSelectors") or []
        ),
        "runtimeCaseAliasMultislotSaveLoadPollObservedPublicSaveSelectors": (
            runtime_gate.get("caseAliasMultislotSavedataLoadPollObservedPublicSaveSelectors") or []
        ),
        "runtimeCaseAliasMultislotSaveLoadPollReachedPublicSaveSelector": runtime_gate.get(
            "caseAliasMultislotSavedataLoadPollReachedPublicSaveSelector"
        ),
        "runtimeCaseAliasMultislotSaveLoadPollReachedRouteSelector": runtime_gate.get(
            "caseAliasMultislotSavedataLoadPollReachedRouteSelector"
        ),
        "runtimeCaseAliasMultislotSaveLoadPollValues": runtime_gate.get(
            "caseAliasMultislotSavedataLoadPollValues"
        ),
        "runtimeInputPathCaseAliasMultislotSaveLoadPollSampleCount": runtime_gate.get(
            "inputPathCaseAliasMultislotSavedataLoadPollSampleCount"
        ),
        "runtimeInputPathCaseAliasMultislotSaveLoadPollStartupWaitSeconds": runtime_gate.get(
            "inputPathCaseAliasMultislotSavedataLoadPollStartupWaitSeconds"
        ),
        "runtimeInputPathCaseAliasMultislotSaveLoadPollCaseAliasesEnabled": runtime_gate.get(
            "inputPathCaseAliasMultislotSavedataLoadPollCaseAliasesEnabled"
        ),
        "runtimeInputPathCaseAliasMultislotSaveLoadPollPublicSaveSelectors": (
            runtime_gate.get("inputPathCaseAliasMultislotSavedataLoadPollPublicSaveSelectors") or []
        ),
        "runtimeInputPathCaseAliasMultislotSaveLoadPollObservedSelectors": (
            runtime_gate.get("inputPathCaseAliasMultislotSavedataLoadPollObservedSelectors") or []
        ),
        "runtimeInputPathCaseAliasMultislotSaveLoadPollObservedPublicSaveSelectors": (
            runtime_gate.get("inputPathCaseAliasMultislotSavedataLoadPollObservedPublicSaveSelectors") or []
        ),
        "runtimeInputPathCaseAliasMultislotSaveLoadPollReachedPublicSaveSelector": runtime_gate.get(
            "inputPathCaseAliasMultislotSavedataLoadPollReachedPublicSaveSelector"
        ),
        "runtimeInputPathCaseAliasMultislotSaveLoadPollReachedRouteSelector": runtime_gate.get(
            "inputPathCaseAliasMultislotSavedataLoadPollReachedRouteSelector"
        ),
        "runtimeInputPathCaseAliasMultislotSaveLoadPollValues": runtime_gate.get(
            "inputPathCaseAliasMultislotSavedataLoadPollValues"
        ),
        "runtimePredecessorDirectionSweepPollSequenceCount": runtime_gate.get(
            "predecessorDirectionSweepPollSequenceCount"
        ),
        "runtimePredecessorDirectionSweepPollSampleCount": runtime_gate.get(
            "predecessorDirectionSweepPollSampleCount"
        ),
        "runtimePredecessorDirectionSweepPollStartupWaitSeconds": runtime_gate.get(
            "predecessorDirectionSweepPollStartupWaitSeconds"
        ),
        "runtimePredecessorDirectionSweepPollCaseAliasesEnabled": runtime_gate.get(
            "predecessorDirectionSweepPollCaseAliasesEnabled"
        ),
        "runtimePredecessorDirectionSweepPollStagedSaveKind": runtime_gate.get(
            "predecessorDirectionSweepPollStagedSaveKind"
        ),
        "runtimePredecessorDirectionSweepPollPublicSaveSelectors": (
            runtime_gate.get("predecessorDirectionSweepPollPublicSaveSelectors") or []
        ),
        "runtimePredecessorDirectionSweepPollObservedSelectors": (
            runtime_gate.get("predecessorDirectionSweepPollObservedSelectors") or []
        ),
        "runtimePredecessorDirectionSweepPollObservedPublicSaveSelectors": (
            runtime_gate.get("predecessorDirectionSweepPollObservedPublicSaveSelectors") or []
        ),
        "runtimePredecessorDirectionSweepPollReachedPublicSaveSelector": runtime_gate.get(
            "predecessorDirectionSweepPollReachedPublicSaveSelector"
        ),
        "runtimePredecessorDirectionSweepPollReachedRouteSelector": runtime_gate.get(
            "predecessorDirectionSweepPollReachedRouteSelector"
        ),
        "runtimePredecessorDirectionSweepPollValues": runtime_gate.get(
            "predecessorDirectionSweepPollValues"
        ),
        "runtimePredecessorLeftOverrunActivationSweepPollSequenceCount": runtime_gate.get(
            "predecessorLeftOverrunActivationSweepPollSequenceCount"
        ),
        "runtimePredecessorLeftOverrunActivationSweepPollSampleCount": runtime_gate.get(
            "predecessorLeftOverrunActivationSweepPollSampleCount"
        ),
        "runtimePredecessorLeftOverrunActivationSweepPollStartupWaitSeconds": runtime_gate.get(
            "predecessorLeftOverrunActivationSweepPollStartupWaitSeconds"
        ),
        "runtimePredecessorLeftOverrunActivationSweepPollCaseAliasesEnabled": runtime_gate.get(
            "predecessorLeftOverrunActivationSweepPollCaseAliasesEnabled"
        ),
        "runtimePredecessorLeftOverrunActivationSweepPollStagedSaveKind": runtime_gate.get(
            "predecessorLeftOverrunActivationSweepPollStagedSaveKind"
        ),
        "runtimePredecessorLeftOverrunActivationSweepPollPublicSaveSelectors": (
            runtime_gate.get("predecessorLeftOverrunActivationSweepPollPublicSaveSelectors") or []
        ),
        "runtimePredecessorLeftOverrunActivationSweepPollObservedSelectors": (
            runtime_gate.get("predecessorLeftOverrunActivationSweepPollObservedSelectors") or []
        ),
        "runtimePredecessorLeftOverrunActivationSweepPollObservedPublicSaveSelectors": (
            runtime_gate.get("predecessorLeftOverrunActivationSweepPollObservedPublicSaveSelectors") or []
        ),
        "runtimePredecessorLeftOverrunActivationSweepPollReachedPublicSaveSelector": runtime_gate.get(
            "predecessorLeftOverrunActivationSweepPollReachedPublicSaveSelector"
        ),
        "runtimePredecessorLeftOverrunActivationSweepPollReachedRouteSelector": runtime_gate.get(
            "predecessorLeftOverrunActivationSweepPollReachedRouteSelector"
        ),
        "runtimePredecessorLeftOverrunActivationSweepPollValues": runtime_gate.get(
            "predecessorLeftOverrunActivationSweepPollValues"
        ),
        "runtimePredecessorRouteAttemptSummary": runtime_gate.get(
            "predecessorRouteAttemptSummary"
        ),
        "runtimePredecessorRouteAttemptPromotionStatus": runtime_gate.get(
            "predecessorRouteAttemptPromotionStatus"
        ),
        "runtimePredecessorRouteAttemptProofFound": runtime_gate.get(
            "predecessorRouteAttemptProofFound"
        ),
        "runtimePredecessorRouteAttemptRuntimeProofFound": runtime_gate.get(
            "predecessorRouteAttemptRuntimeProofFound"
        ),
        "runtimePredecessorRouteAttemptSourceFileCount": runtime_gate.get(
            "predecessorRouteAttemptSourceFileCount"
        ),
        "runtimePredecessorRouteAttemptTotalSequenceCount": runtime_gate.get(
            "predecessorRouteAttemptTotalSequenceCount"
        ),
        "runtimePredecessorRouteAttemptTotalSampleCount": runtime_gate.get(
            "predecessorRouteAttemptTotalSampleCount"
        ),
        "runtimePredecessorRouteAttemptPublicObservedFileCount": runtime_gate.get(
            "predecessorRouteAttemptPublicObservedFileCount"
        ),
        "runtimePredecessorRouteAttemptReachedRouteSelector": runtime_gate.get(
            "predecessorRouteAttemptReachedRouteSelector"
        ),
        "runtimePredecessorRouteAttemptReachedCurrentRoot": runtime_gate.get(
            "predecessorRouteAttemptReachedCurrentRoot"
        ),
        "runtimePredecessorRouteAttemptRouteSelectorHitCount": runtime_gate.get(
            "predecessorRouteAttemptRouteSelectorHitCount"
        ),
        "runtimePredecessorRouteAttemptCurrentRootHitCount": runtime_gate.get(
            "predecessorRouteAttemptCurrentRootHitCount"
        ),
        "runtimePredecessorRouteAttemptObservedSelectorCounts": (
            runtime_gate.get("predecessorRouteAttemptObservedSelectorCounts") or {}
        ),
        "runtimePredecessorRouteAttemptDominantDiversionSelector": runtime_gate.get(
            "predecessorRouteAttemptDominantDiversionSelector"
        ),
        "runtimePredecessorRouteAttemptDiversionSelectorContextCount": runtime_gate.get(
            "predecessorRouteAttemptDiversionSelectorContextCount"
        ),
        "runtimePredecessorRouteAttemptFieldMapDiversionSelectorCount": runtime_gate.get(
            "predecessorRouteAttemptFieldMapDiversionSelectorCount"
        ),
        "runtimePredecessorRouteAttemptResourceOnlyDiversionSelectorCount": runtime_gate.get(
            "predecessorRouteAttemptResourceOnlyDiversionSelectorCount"
        ),
        "runtimePredecessorRouteAttemptDiversionRoutePromotionEvidenceFound": runtime_gate.get(
            "predecessorRouteAttemptDiversionRoutePromotionEvidenceFound"
        ),
        "runtimePredecessorRouteAttemptPublicSelectorContextClassification": runtime_gate.get(
            "predecessorRouteAttemptPublicSelectorContextClassification"
        ),
        "runtimePredecessorRouteAttemptPublicSelectorCurrentProofCount": runtime_gate.get(
            "predecessorRouteAttemptPublicSelectorCurrentProofCount"
        ),
        "runtimeSyntheticSelector20PollSampleCount": runtime_gate.get(
            "syntheticSelector20InputPathCaseAliasPollSampleCount"
        ),
        "runtimeSyntheticSelector20PollStartupWaitSeconds": runtime_gate.get(
            "syntheticSelector20InputPathCaseAliasPollStartupWaitSeconds"
        ),
        "runtimeSyntheticSelector20PollStagedSelectors": (
            runtime_gate.get("syntheticSelector20InputPathCaseAliasPollStagedSelectors") or []
        ),
        "runtimeSyntheticSelector20PollObservedSelectors": (
            runtime_gate.get("syntheticSelector20InputPathCaseAliasPollObservedSelectors") or []
        ),
        "runtimeSyntheticSelector20PollObservedStagedSelectors": (
            runtime_gate.get("syntheticSelector20InputPathCaseAliasPollObservedStagedSelectors") or []
        ),
        "runtimeSyntheticSelector20PollReachedStagedSelector": runtime_gate.get(
            "syntheticSelector20InputPathCaseAliasPollReachedStagedSelector"
        ),
        "runtimeSyntheticSelector20PollReachedRouteSelector": runtime_gate.get(
            "syntheticSelector20InputPathCaseAliasPollReachedRouteSelector"
        ),
        "runtimeSyntheticSelector20PollValues": runtime_gate.get(
            "syntheticSelector20InputPathCaseAliasPollValues"
        ),
        "runtimePatchedPublicSelector20PollSampleCount": runtime_gate.get(
            "patchedPublicSelector20InputPathCaseAliasPollSampleCount"
        ),
        "runtimePatchedPublicSelector20PollStartupWaitSeconds": runtime_gate.get(
            "patchedPublicSelector20InputPathCaseAliasPollStartupWaitSeconds"
        ),
        "runtimePatchedPublicSelector20PollStagedSaveKind": runtime_gate.get(
            "patchedPublicSelector20InputPathCaseAliasPollStagedSaveKind"
        ),
        "runtimePatchedPublicSelector20PollStagedSelectors": (
            runtime_gate.get("patchedPublicSelector20InputPathCaseAliasPollStagedSelectors") or []
        ),
        "runtimePatchedPublicSelector20PollObservedSelectors": (
            runtime_gate.get("patchedPublicSelector20InputPathCaseAliasPollObservedSelectors") or []
        ),
        "runtimePatchedPublicSelector20PollReachedRouteSelector": runtime_gate.get(
            "patchedPublicSelector20InputPathCaseAliasPollReachedRouteSelector"
        ),
        "runtimePatchedPublicSelector20PollConstructedDiagnosticRoute": runtime_gate.get(
            "constructedDiagnosticPollReachedRouteSelector"
        ),
        "diagnosticNotRouteProof": diagnostic_gate.get("notRoutePromotionProof"),
        "diagnosticActiveOrderSampleCount": diagnostic_gate.get("activeOrderSampleCount"),
        "diagnosticActiveOrderCountHex": diagnostic_gate.get("activeOrderCountHex"),
        "diagnosticActiveOrderHexes": diagnostic_gate.get("activeOrderHexes") or [],
        "diagnosticActiveDescriptorStaticHex": (
            diagnostic_gate.get("activeSlotFirstDwordsStaticHex") or [None]
        )[0],
        "diagnosticBranchStateTotalSampleCount": diagnostic_gate.get("branchStateTotalSampleCount"),
        "diagnosticBranchStateRouteSampleCount": diagnostic_gate.get("branchStateRouteSampleCount"),
        "diagnosticBranchStateObservedSelectors": diagnostic_gate.get("branchStateObservedSelectors") or [],
        "diagnosticBranchStateActiveSelectionFlagHex": diagnostic_gate.get(
            "branchStateActiveSelectionFlagHex"
        ),
        "diagnosticBranchStateSecondaryAllZero": diagnostic_gate.get("branchStateSecondaryAllZero"),
        "diagnosticBranchStateMatchesPredecessorFill": diagnostic_gate.get(
            "branchStateMatchesPredecessorFillHypothesis"
        ),
        "diagnosticBranchStatePromotionStatus": diagnostic_gate.get("branchStatePromotionStatus"),
        "diagnosticExitCandidateCount": diagnostic_gate.get("exitCandidateCount"),
        "diagnosticExitCandidateRouteSelectorSides": (
            diagnostic_gate.get("exitCandidateRouteSelectorSides") or []
        ),
        "diagnosticExitCandidateBranchStateNonzeroSides": (
            diagnostic_gate.get("exitCandidateBranchStateNonzeroSides") or []
        ),
        "diagnosticExitCandidatePromotionStatus": diagnostic_gate.get("exitCandidatePromotionStatus"),
        "diagnosticLeftStabilitySampleCount": diagnostic_gate.get("leftStabilitySampleCount"),
        "diagnosticLeftStabilityRouteSequenceNames": (
            diagnostic_gate.get("leftStabilityRouteSequenceNames") or []
        ),
        "diagnosticLeftStabilityNonRouteSequenceNames": (
            diagnostic_gate.get("leftStabilityNonRouteSequenceNames") or []
        ),
        "diagnosticLeftStabilityObservedSelectors": (
            diagnostic_gate.get("leftStabilityObservedSelectors") or []
        ),
        "diagnosticLeftStabilityRouteSelectorHitCount": diagnostic_gate.get(
            "leftStabilityRouteSelectorHitCount"
        ),
        "diagnosticLeftStabilityOpcode24AllZero": diagnostic_gate.get("leftStabilityOpcode24AllZero"),
        "diagnosticLeftStabilityRouteHitReproducibility": diagnostic_gate.get(
            "leftStabilityRouteHitReproducibility"
        ),
        "diagnosticLeftStabilityRecheckSampleCount": diagnostic_gate.get("leftStabilityRecheckSampleCount"),
        "diagnosticLeftStabilityRecheckObservedSelectors": (
            diagnostic_gate.get("leftStabilityRecheckObservedSelectors") or []
        ),
        "diagnosticLeftStabilityRecheckRouteSelectorHitCount": diagnostic_gate.get(
            "leftStabilityRecheckRouteSelectorHitCount"
        ),
        "diagnosticLeftActiveOrderRecheckSampleCount": diagnostic_gate.get(
            "leftActiveOrderRecheckSampleCount"
        ),
        "diagnosticLeftActiveOrderRecheckObservedSelectors": (
            diagnostic_gate.get("leftActiveOrderRecheckObservedSelectors") or []
        ),
        "diagnosticLeftActiveOrderRecheckRouteSelectorHitCount": diagnostic_gate.get(
            "leftActiveOrderRecheckRouteSelectorHitCount"
        ),
        "diagnosticLeftActiveOrderRecheckActiveOrderCountValues": diagnostic_gate.get(
            "leftActiveOrderRecheckActiveOrderCountValues"
        ),
        "diagnosticLeftStabilityPromotionStatus": diagnostic_gate.get("leftStabilityPromotionStatus"),
        "diagnosticFollowupSelector": diagnostic_gate.get("followupSelector"),
        "diagnosticFollowupRootHex": diagnostic_gate.get("followupRootHex"),
        "diagnosticFollowupContainsSource": diagnostic_gate.get("followupAliasContainsSource"),
        "diagnosticFollowupContainsTarget": diagnostic_gate.get("followupAliasContainsTarget"),
        "diagnosticFollowupHasPublicSample": diagnostic_gate.get("followupAliasHasPublicSample"),
        "diagnosticBridgeExecutionLike": diagnostic_gate.get("aliasToCurrentExecutionLikeBridgeFound"),
        "diagnosticExactFollowupPointerHexes": diagnostic_gate.get("exactFollowupPointerHexes") or [],
        "diagnosticExactTraceStopReasons": diagnostic_gate.get("exactTraceStopReasons") or [],
        "diagnosticExcludedFromSelectedRootExecutionProof": diagnostic_gate.get(
            "excludedFromSelectedRootExecutionProof"
        ),
        "runtimeFileIoAttachLoadBackend": runtime_gate.get("fileIoAttachLoadBackend"),
        "runtimeFileIoAttachLoadSequenceCount": runtime_gate.get("fileIoAttachLoadSequenceCount"),
        "runtimeFileIoAttachLoadSequenceWithPidCount": runtime_gate.get("fileIoAttachLoadSequenceWithPidCount"),
        "runtimeFileIoAttachLoadSequenceWithKeyWritesCount": runtime_gate.get(
            "fileIoAttachLoadSequenceWithKeyWritesCount"
        ),
        "runtimeFileIoAttachLoadInputTraceUsable": runtime_gate.get("fileIoAttachLoadInputTraceUsable"),
        "runtimeFileIoAttachLoadMatchedLineCount": runtime_gate.get("fileIoAttachLoadMatchedLineCount"),
        "runtimeFileIoAttachLoadAnySavedat1Access": runtime_gate.get("fileIoAttachLoadAnySavedat1Access"),
        "runtimeFileIoAttachCaseAliasLoadBackend": runtime_gate.get("fileIoAttachCaseAliasLoadBackend"),
        "runtimeFileIoAttachCaseAliasLoadSequenceCount": runtime_gate.get(
            "fileIoAttachCaseAliasLoadSequenceCount"
        ),
        "runtimeFileIoAttachCaseAliasLoadSequenceWithPidCount": runtime_gate.get(
            "fileIoAttachCaseAliasLoadSequenceWithPidCount"
        ),
        "runtimeFileIoAttachCaseAliasLoadSequenceWithKeyWritesCount": runtime_gate.get(
            "fileIoAttachCaseAliasLoadSequenceWithKeyWritesCount"
        ),
        "runtimeFileIoAttachCaseAliasLoadInputTraceUsable": runtime_gate.get(
            "fileIoAttachCaseAliasLoadInputTraceUsable"
        ),
        "runtimeFileIoAttachCaseAliasLoadMatchedLineCount": runtime_gate.get(
            "fileIoAttachCaseAliasLoadMatchedLineCount"
        ),
        "runtimeFileIoAttachCaseAliasLoadAnySavedat1Access": runtime_gate.get(
            "fileIoAttachCaseAliasLoadAnySavedat1Access"
        ),
        "anyRuntimePollReachedRouteSelector": runtime_gate.get("anyRuntimePollReachedRouteSelector"),
        "promotionStatus": execution_gap.get("promotionStatus"),
        "conclusion": execution_gap.get("conclusion"),
    }


def selected_root_execution_gap_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    root_counts = "/".join(str(value) for value in evidence.get("globalNonCurrentRootProducerCounts") or [])
    range_counts = "/".join(str(value) for value in evidence.get("globalNonCurrentRangeProducerCounts") or [])
    current_counts = "/".join(str(value) for value in evidence.get("globalCurrentInternalProducerCounts") or [])
    poll_observed = ",".join(evidence.get("runtimePollObservedSelectors") or []) or "-"
    prelude_observed = ",".join(evidence.get("runtimePreludePollObservedSelectors") or []) or "-"
    long_observed = ",".join(evidence.get("runtimeLongPollObservedSelectors") or []) or "-"
    late_observed = ",".join(evidence.get("runtimeLatePollObservedSelectors") or []) or "-"
    route_watch_observed = ",".join(evidence.get("runtimeRouteWatchPollObservedSelectors") or []) or "-"
    save_load_observed = ",".join(evidence.get("runtimeSaveLoadPollObservedSelectors") or []) or "-"
    multislot_save_load_observed = ",".join(
        evidence.get("runtimeMultislotSaveLoadPollObservedSelectors") or []
    ) or "-"
    multislot_public_selectors = ",".join(
        evidence.get("runtimeMultislotSaveLoadPollPublicSaveSelectors") or []
    ) or "-"
    case_alias_multislot_save_load_observed = ",".join(
        evidence.get("runtimeCaseAliasMultislotSaveLoadPollObservedSelectors") or []
    ) or "-"
    input_path_case_alias_multislot_save_load_observed = ",".join(
        evidence.get("runtimeInputPathCaseAliasMultislotSaveLoadPollObservedSelectors") or []
    ) or "-"
    input_path_case_alias_multislot_public_selectors = ",".join(
        evidence.get("runtimeInputPathCaseAliasMultislotSaveLoadPollPublicSaveSelectors") or []
    ) or "-"
    input_path_case_alias_multislot_observed_public_selectors = ",".join(
        evidence.get("runtimeInputPathCaseAliasMultislotSaveLoadPollObservedPublicSaveSelectors") or []
    ) or "-"
    predecessor_direction_sweep_observed = ",".join(
        evidence.get("runtimePredecessorDirectionSweepPollObservedSelectors") or []
    ) or "-"
    predecessor_direction_sweep_public_selectors = ",".join(
        evidence.get("runtimePredecessorDirectionSweepPollPublicSaveSelectors") or []
    ) or "-"
    predecessor_direction_sweep_observed_public_selectors = ",".join(
        evidence.get("runtimePredecessorDirectionSweepPollObservedPublicSaveSelectors") or []
    ) or "-"
    predecessor_left_overrun_activation_sweep_observed = ",".join(
        evidence.get("runtimePredecessorLeftOverrunActivationSweepPollObservedSelectors") or []
    ) or "-"
    predecessor_left_overrun_activation_sweep_public_selectors = ",".join(
        evidence.get("runtimePredecessorLeftOverrunActivationSweepPollPublicSaveSelectors") or []
    ) or "-"
    predecessor_left_overrun_activation_sweep_observed_public_selectors = ",".join(
        evidence.get("runtimePredecessorLeftOverrunActivationSweepPollObservedPublicSaveSelectors") or []
    ) or "-"
    patched_public_selector_20_observed = ",".join(
        evidence.get("runtimePatchedPublicSelector20PollObservedSelectors") or []
    ) or "-"
    synthetic_selector_20_observed = ",".join(
        evidence.get("runtimeSyntheticSelector20PollObservedSelectors") or []
    ) or "-"
    synthetic_selector_20_observed_staged = ",".join(
        evidence.get("runtimeSyntheticSelector20PollObservedStagedSelectors") or []
    ) or "-"
    diagnostic_order = (
        f"{evidence.get('diagnosticActiveOrderCountHex')}/"
        f"{','.join(evidence.get('diagnosticActiveOrderHexes') or []) or '-'}"
    )
    diagnostic_branch_state_observed = ",".join(
        evidence.get("diagnosticBranchStateObservedSelectors") or []
    ) or "-"
    diagnostic_exit_route_sides = ",".join(
        evidence.get("diagnosticExitCandidateRouteSelectorSides") or []
    ) or "-"
    diagnostic_exit_branch_nonzero = ",".join(
        evidence.get("diagnosticExitCandidateBranchStateNonzeroSides") or []
    ) or "-"
    diagnostic_left_route_sequences = ",".join(
        evidence.get("diagnosticLeftStabilityRouteSequenceNames") or []
    ) or "-"
    diagnostic_left_non_route_sequences = ",".join(
        evidence.get("diagnosticLeftStabilityNonRouteSequenceNames") or []
    ) or "-"
    diagnostic_left_observed = ",".join(
        evidence.get("diagnosticLeftStabilityObservedSelectors") or []
    ) or "-"
    diagnostic_left_recheck_observed = ",".join(
        evidence.get("diagnosticLeftStabilityRecheckObservedSelectors") or []
    ) or "-"
    diagnostic_left_active_order_recheck_observed = ",".join(
        evidence.get("diagnosticLeftActiveOrderRecheckObservedSelectors") or []
    ) or "-"
    return (
        f"selectedRootRef={evidence.get('selectedRootExecutionRefFound')} "
        f"proofFound={evidence.get('proofFound')} "
        f"failedSelectedRootGates={','.join(evidence.get('failedSelectedRootGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"reject={evidence.get('selectedRootExecutionRejectionClassification')} "
        "subgates="
        f"{evidence.get('selectedRootNonPromotingSubgateCount')}/"
        f"{evidence.get('selectedRootSubgateCount')} "
        f"remainingProofs={evidence.get('remainingProofCount')} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        "subgateStatus="
        f"{evidence.get('saveLoaderGateStatus')}/"
        f"{evidence.get('staticReferenceGateStatus')}/"
        f"{evidence.get('hookPrerequisiteGateStatus')}/"
        f"{evidence.get('dispatchTableGateStatus')}/"
        f"{evidence.get('opcodeSelectedPointerGateStatus')}/"
        f"{evidence.get('currentWriterPathGateStatus')}/"
        f"{evidence.get('runtimeProbeGateStatus')}/"
        f"{evidence.get('diagnosticExclusionGateStatus')} "
        f"saveSelector2:0={evidence.get('saveCurrentSelectorRealSaveCount')} "
        f"selectedPointerSave={evidence.get('saveSelectedPointerRealSaveCount')} "
        f"routePairSave={evidence.get('saveRoutePairRealSaveCount')} "
        f"staticCodeRefs={evidence.get('staticCurrentCodeRefCount')} "
        f"rootTextRefs={evidence.get('staticRootTextRefCount')} "
        f"hookPrereq={evidence.get('hookTraceHookPointCount')}/"
        f"{evidence.get('hookPrerequisiteUnprovenCount')}/"
        f"{evidence.get('hookSelfProvingCount')}/"
        f"{evidence.get('hookPromotingCount')} "
        f"hookWindow={evidence.get('hookWindowScannedRefCount')}/"
        f"{evidence.get('hookWindowRouteSpecificHitCount')} "
        f"hookAllUnproven={evidence.get('hookPrerequisitesAllUnproven')} "
        f"hookGraph={evidence.get('hookHandlerCallGraphClassification')} "
        "hookGraphRoots/Fns/Calls="
        f"{evidence.get('hookHandlerCallGraphRootCount')}/"
        f"{evidence.get('hookHandlerCallGraphReachableFunctionCount')}/"
        f"{evidence.get('hookHandlerCallGraphDirectCallEdgeCount')} "
        "hookGraphRoute/current/record/selector/branch="
        f"{evidence.get('hookHandlerCallGraphRouteImmediateHitCount')}/"
        f"{evidence.get('hookHandlerCallGraphCurrentImmediateHitCount')}/"
        f"{evidence.get('hookHandlerCallGraphRouteRecordImmediateHitCount')}/"
        f"{evidence.get('hookHandlerCallGraphRouteSelectorImmediateHitCount')}/"
        f"{evidence.get('hookHandlerCallGraphBranchStateImmediateHitCount')} "
        "hookGraphGeneric="
        f"{evidence.get('hookHandlerCallGraphSelectedPointerImmediateHitCount')}/"
        f"{evidence.get('hookHandlerCallGraphSelectorTableImmediateHitCount')} "
        "hookGraphDepth="
        f"{evidence.get('hookHandlerCallGraphDepthSensitivityMaxDepthChecked')}/"
        f"{evidence.get('hookHandlerCallGraphDepthSensitivityProofAbsentAcrossCheckedDepths')}/"
        f"{evidence.get('hookHandlerCallGraphDepthSensitivityCountsStableAtAndBeyondDefaultDepth')} "
        "hookEncoded="
        f"{evidence.get('hookHandlerEncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('hookHandlerEncodedTargetRouteProofRawScalarCandidateCount')}/"
        f"{evidence.get('hookHandlerEncodedTargetRouteContextRawScalarCandidateCount')}/"
        f"{evidence.get('hookHandlerEncodedTargetPromotingCandidateCount')} "
        f"hookEncodedClass={evidence.get('hookHandlerEncodedTargetClassification')} "
        f"dispatchTable={evidence.get('dispatchSaveSelectorHandlerTableHex')} "
        f"dispatchSlice={evidence.get('dispatchSaveSelectorSliceOffsetHex')} "
        f"dispatchRefs={evidence.get('dispatchSaveSelectorDirectDwordRefCount')}/"
        f"{evidence.get('dispatchSaveSelectorIndexedDispatchCount')} "
        f"dispatchHandlers={evidence.get('dispatchSelectedPointerRelativeHandlersVerified')} "
        f"dispatchExecRef={evidence.get('dispatchRefFound')} "
        f"nonCurrentRoot={root_counts or '-'} "
        f"nonCurrentRange={range_counts or '-'} "
        f"currentInternal={current_counts or '-'} "
        f"writerCount={evidence.get('currentWriterCount')} "
        f"poll={evidence.get('runtimePollSampleCount')}:{poll_observed} "
        f"preludePoll={evidence.get('runtimePreludePollSampleCount')}:{prelude_observed} "
        f"longPoll={evidence.get('runtimeLongPollSampleCount')}:{long_observed} "
        f"latePoll={evidence.get('runtimeLatePollSampleCount')}@"
        f"{evidence.get('runtimeLatePollStartupWaitSeconds')}:{late_observed} "
        f"routeWatch={evidence.get('runtimeRouteWatchPollSampleCount')}@"
        f"{evidence.get('runtimeRouteWatchPollStartupWaitSeconds')}:{route_watch_observed} "
        f"routeWatchValues={evidence.get('runtimeRouteWatchPollValues')} "
        f"routeWatchRoute={evidence.get('runtimeRouteWatchPollReachedRouteSelector')} "
        f"saveLoadPoll={evidence.get('runtimeSaveLoadPollSampleCount')}@"
        f"{evidence.get('runtimeSaveLoadPollStartupWaitSeconds')}:{save_load_observed} "
        f"saveLoadRoute={evidence.get('runtimeSaveLoadPollReachedRouteSelector')} "
        f"multiSaveLoad={evidence.get('runtimeMultislotSaveLoadPollSampleCount')}@"
        f"{evidence.get('runtimeMultislotSaveLoadPollStartupWaitSeconds')}:{multislot_save_load_observed} "
        f"multiSavePublic={multislot_public_selectors} "
        f"multiSavePublicHit={evidence.get('runtimeMultislotSaveLoadPollReachedPublicSaveSelector')} "
        f"multiSaveRoute={evidence.get('runtimeMultislotSaveLoadPollReachedRouteSelector')} "
        f"caseAliasMultiSaveLoad={evidence.get('runtimeCaseAliasMultislotSaveLoadPollSampleCount')}@"
        f"{evidence.get('runtimeCaseAliasMultislotSaveLoadPollStartupWaitSeconds')}:"
        f"{case_alias_multislot_save_load_observed} "
        f"caseAliasMultiSavePublicHit={evidence.get('runtimeCaseAliasMultislotSaveLoadPollReachedPublicSaveSelector')} "
        f"caseAliasMultiSaveRoute={evidence.get('runtimeCaseAliasMultislotSaveLoadPollReachedRouteSelector')} "
        f"inputPathCaseAliasMultiSaveLoad={evidence.get('runtimeInputPathCaseAliasMultislotSaveLoadPollSampleCount')}@"
        f"{evidence.get('runtimeInputPathCaseAliasMultislotSaveLoadPollStartupWaitSeconds')}:"
        f"{input_path_case_alias_multislot_save_load_observed} "
        f"inputPathCaseAliasMultiSavePublic={input_path_case_alias_multislot_public_selectors} "
        f"inputPathCaseAliasMultiSaveObservedPublic={input_path_case_alias_multislot_observed_public_selectors} "
        "inputPathCaseAliasMultiSavePublicHit="
        f"{evidence.get('runtimeInputPathCaseAliasMultislotSaveLoadPollReachedPublicSaveSelector')} "
        f"inputPathCaseAliasMultiSaveRoute={evidence.get('runtimeInputPathCaseAliasMultislotSaveLoadPollReachedRouteSelector')} "
        f"predecessorDirectionSweep={evidence.get('runtimePredecessorDirectionSweepPollSampleCount')}@"
        f"{evidence.get('runtimePredecessorDirectionSweepPollStartupWaitSeconds')}:"
        f"{predecessor_direction_sweep_observed} "
        f"predecessorDirectionSweepKind={evidence.get('runtimePredecessorDirectionSweepPollStagedSaveKind')} "
        f"predecessorDirectionSweepPublic={predecessor_direction_sweep_public_selectors} "
        f"predecessorDirectionSweepObservedPublic={predecessor_direction_sweep_observed_public_selectors} "
        "predecessorDirectionSweepPublicHit="
        f"{evidence.get('runtimePredecessorDirectionSweepPollReachedPublicSaveSelector')} "
        f"predecessorDirectionSweepRoute={evidence.get('runtimePredecessorDirectionSweepPollReachedRouteSelector')} "
        f"predecessorDirectionSweepValues={evidence.get('runtimePredecessorDirectionSweepPollValues')} "
        f"predecessorLeftOverrunActivationSweep={evidence.get('runtimePredecessorLeftOverrunActivationSweepPollSampleCount')}@"
        f"{evidence.get('runtimePredecessorLeftOverrunActivationSweepPollStartupWaitSeconds')}:"
        f"{predecessor_left_overrun_activation_sweep_observed} "
        f"predecessorLeftOverrunActivationSweepKind={evidence.get('runtimePredecessorLeftOverrunActivationSweepPollStagedSaveKind')} "
        f"predecessorLeftOverrunActivationSweepPublic={predecessor_left_overrun_activation_sweep_public_selectors} "
        f"predecessorLeftOverrunActivationSweepObservedPublic={predecessor_left_overrun_activation_sweep_observed_public_selectors} "
        "predecessorLeftOverrunActivationSweepPublicHit="
        f"{evidence.get('runtimePredecessorLeftOverrunActivationSweepPollReachedPublicSaveSelector')} "
        "predecessorLeftOverrunActivationSweepRoute="
        f"{evidence.get('runtimePredecessorLeftOverrunActivationSweepPollReachedRouteSelector')} "
        "predecessorLeftOverrunActivationSweepValues="
        f"{evidence.get('runtimePredecessorLeftOverrunActivationSweepPollValues')} "
        f"predecessorRouteAttempt={evidence.get('runtimePredecessorRouteAttemptSourceFileCount')}/"
        f"{evidence.get('runtimePredecessorRouteAttemptTotalSequenceCount')}/"
        f"{evidence.get('runtimePredecessorRouteAttemptTotalSampleCount')} "
        f"predecessorRouteAttemptPublicFiles={evidence.get('runtimePredecessorRouteAttemptPublicObservedFileCount')} "
        "predecessorRouteAttemptRouteCurrentHits="
        f"{evidence.get('runtimePredecessorRouteAttemptRouteSelectorHitCount')}/"
        f"{evidence.get('runtimePredecessorRouteAttemptCurrentRootHitCount')} "
        f"predecessorRouteAttemptDominantDiversion={evidence.get('runtimePredecessorRouteAttemptDominantDiversionSelector')} "
        "predecessorRouteAttemptDiversionContexts="
        f"{evidence.get('runtimePredecessorRouteAttemptDiversionSelectorContextCount')}/"
        f"{evidence.get('runtimePredecessorRouteAttemptFieldMapDiversionSelectorCount')}/"
        f"{evidence.get('runtimePredecessorRouteAttemptResourceOnlyDiversionSelectorCount')} "
        f"predecessorRouteAttemptRouteEvidence={evidence.get('runtimePredecessorRouteAttemptDiversionRoutePromotionEvidenceFound')} "
        f"predecessorRouteAttemptPublicContext={evidence.get('runtimePredecessorRouteAttemptPublicSelectorContextClassification')} "
        f"predecessorRouteAttemptStatus={evidence.get('runtimePredecessorRouteAttemptPromotionStatus')} "
        f"syntheticSelector20={evidence.get('runtimeSyntheticSelector20PollSampleCount')}@"
        f"{evidence.get('runtimeSyntheticSelector20PollStartupWaitSeconds')}:"
        f"{synthetic_selector_20_observed} "
        f"syntheticSelector20ObservedStaged={synthetic_selector_20_observed_staged} "
        f"syntheticSelector20Route={evidence.get('runtimeSyntheticSelector20PollReachedRouteSelector')} "
        f"patchedPublicSelector20={evidence.get('runtimePatchedPublicSelector20PollSampleCount')}@"
        f"{evidence.get('runtimePatchedPublicSelector20PollStartupWaitSeconds')}:"
        f"{patched_public_selector_20_observed} "
        f"patchedPublicSelector20Route={evidence.get('runtimePatchedPublicSelector20PollReachedRouteSelector')} "
        "patchedPublicSelector20Diagnostic="
        f"{evidence.get('runtimePatchedPublicSelector20PollConstructedDiagnosticRoute')} "
        f"diagnosticExcluded={evidence.get('diagnosticExcludedFromSelectedRootExecutionProof')} "
        f"diagnosticActiveOrder={diagnostic_order} "
        f"diagnosticDescriptor={evidence.get('diagnosticActiveDescriptorStaticHex')} "
        f"diagnosticBranchState={evidence.get('diagnosticBranchStateTotalSampleCount')}/"
        f"{evidence.get('diagnosticBranchStateRouteSampleCount')}:{diagnostic_branch_state_observed} "
        f"diagnosticBranchActive={evidence.get('diagnosticBranchStateActiveSelectionFlagHex')} "
        f"diagnosticBranchAllZero={evidence.get('diagnosticBranchStateSecondaryAllZero')} "
        f"diagnosticBranchMatchesFill={evidence.get('diagnosticBranchStateMatchesPredecessorFill')} "
        f"diagnosticExitCandidates={evidence.get('diagnosticExitCandidateCount')} "
        f"diagnosticExitRouteSides={diagnostic_exit_route_sides} "
        f"diagnosticExitBranchNonzero={diagnostic_exit_branch_nonzero} "
        f"diagnosticExitStatus={evidence.get('diagnosticExitCandidatePromotionStatus')} "
        f"diagnosticLeftStability={evidence.get('diagnosticLeftStabilitySampleCount')} "
        f"diagnosticLeftRouteSeq={diagnostic_left_route_sequences} "
        f"diagnosticLeftNonRouteSeq={diagnostic_left_non_route_sequences} "
        f"diagnosticLeftObserved={diagnostic_left_observed} "
        f"diagnosticLeftRouteHits={evidence.get('diagnosticLeftStabilityRouteSelectorHitCount')} "
        f"diagnosticLeftOpcode24AllZero={evidence.get('diagnosticLeftStabilityOpcode24AllZero')} "
        f"diagnosticLeftRepro={evidence.get('diagnosticLeftStabilityRouteHitReproducibility')} "
        f"diagnosticLeftRecheck={evidence.get('diagnosticLeftStabilityRecheckSampleCount')}:"
        f"{diagnostic_left_recheck_observed} "
        f"diagnosticLeftRecheckRouteHits={evidence.get('diagnosticLeftStabilityRecheckRouteSelectorHitCount')} "
        f"diagnosticLeftActiveOrderRecheck={evidence.get('diagnosticLeftActiveOrderRecheckSampleCount')}:"
        f"{diagnostic_left_active_order_recheck_observed} "
        "diagnosticLeftActiveOrderRecheckRouteHits="
        f"{evidence.get('diagnosticLeftActiveOrderRecheckRouteSelectorHitCount')} "
        "diagnosticLeftActiveOrderCount="
        f"{evidence.get('diagnosticLeftActiveOrderRecheckActiveOrderCountValues')} "
        f"diagnosticLeftStatus={evidence.get('diagnosticLeftStabilityPromotionStatus')} "
        f"diagnosticFollowup={evidence.get('diagnosticFollowupSelector')}@"
        f"{evidence.get('diagnosticFollowupRootHex')} "
        f"diagnosticFollowupSource={evidence.get('diagnosticFollowupContainsSource')} "
        f"diagnosticFollowupTarget={evidence.get('diagnosticFollowupContainsTarget')} "
        f"diagnosticBridgeExec={evidence.get('diagnosticBridgeExecutionLike')} "
        f"diagnosticTraceStops={','.join(evidence.get('diagnosticExactTraceStopReasons') or []) or '-'} "
        f"fileIoAttachLoad={evidence.get('runtimeFileIoAttachLoadSequenceWithPidCount')}/"
        f"{evidence.get('runtimeFileIoAttachLoadSequenceCount')} "
        f"fileIoAttachLoadKeyWrites={evidence.get('runtimeFileIoAttachLoadSequenceWithKeyWritesCount')}/"
        f"{evidence.get('runtimeFileIoAttachLoadSequenceCount')} "
        f"fileIoAttachLoadUsable={evidence.get('runtimeFileIoAttachLoadInputTraceUsable')} "
        f"fileIoAttachLoadSavedat1={evidence.get('runtimeFileIoAttachLoadAnySavedat1Access')} "
        f"fileIoAttachCaseAliasLoad={evidence.get('runtimeFileIoAttachCaseAliasLoadSequenceWithPidCount')}/"
        f"{evidence.get('runtimeFileIoAttachCaseAliasLoadSequenceCount')} "
        "fileIoAttachCaseAliasLoadKeyWrites="
        f"{evidence.get('runtimeFileIoAttachCaseAliasLoadSequenceWithKeyWritesCount')}/"
        f"{evidence.get('runtimeFileIoAttachCaseAliasLoadSequenceCount')} "
        f"fileIoAttachCaseAliasLoadUsable={evidence.get('runtimeFileIoAttachCaseAliasLoadInputTraceUsable')} "
        f"fileIoAttachCaseAliasLoadSavedat1={evidence.get('runtimeFileIoAttachCaseAliasLoadAnySavedat1Access')} "
        f"anyPollRoute={evidence.get('anyRuntimePollReachedRouteSelector')} "
        f"status={evidence.get('promotionStatus')}"
    )


def runtime_trace_equivalent_rejection_for(
    selected_root_execution_gap: dict | None,
    runtime_trace_feasibility: dict | None,
) -> dict:
    selected_root_execution_gap = selected_root_execution_gap or {}
    runtime_trace_feasibility = runtime_trace_feasibility or {}
    runtime_probe = runtime_trace_feasibility.get("executionProbe") or {}
    runtime_poll_reached_route = bool(
        selected_root_execution_gap.get("anyRuntimePollReachedRouteSelector")
        or selected_root_execution_gap.get("runtimeRouteWatchPollReachedRouteSelector")
        or selected_root_execution_gap.get("runtimePredecessorDirectionSweepPollReachedRouteSelector")
        or selected_root_execution_gap.get(
            "runtimePredecessorLeftOverrunActivationSweepPollReachedRouteSelector"
        )
    )
    rejection = {
        "classification": None,
        "proofFound": runtime_poll_reached_route,
        "runtimeTraceCanRunNow": runtime_trace_feasibility.get("canRunRuntimeTraceNow"),
        "failedRuntimeTraceGateIds": runtime_trace_feasibility.get(
            "failedRuntimeTraceGateIds"
        ) or [],
        "missingEvidence": runtime_trace_feasibility.get("missingEvidence") or [],
        "evidenceRefs": runtime_trace_feasibility.get("evidenceRefs") or [],
        "evidenceRefCount": runtime_trace_feasibility.get("evidenceRefCount"),
        "runtimeTraceBlockerCount": len(runtime_trace_feasibility.get("blockers") or []),
        "runtimeTraceExecutionCanCaptureNow": runtime_probe.get("canCaptureTraceNow"),
        "runtimeTraceExecutionBlockerCount": len(runtime_probe.get("blockers") or []),
        "runtimeTraceSummaryBinfmtRegistered": (
            runtime_trace_feasibility.get("qemuI386Binfmt") or {}
        ).get("registered"),
        "runtimeTraceSummaryBinfmtEnabled": (
            runtime_trace_feasibility.get("qemuI386Binfmt") or {}
        ).get("enabled"),
        "runtimeTraceExecutionBinfmtRegistered": (
            runtime_probe.get("qemuI386Binfmt") or {}
        ).get("registered"),
        "selectedRootExecutionRefFound": selected_root_execution_gap.get(
            "selectedRootExecutionRefFound"
        ),
        "selectedRootRuntimeAnyPollRoute": selected_root_execution_gap.get(
            "anyRuntimePollReachedRouteSelector"
        ),
        "selectedRootConstructedDiagnosticRoute": selected_root_execution_gap.get(
            "runtimePatchedPublicSelector20PollConstructedDiagnosticRoute"
        ),
        "selectedRootDiagnosticExcludedFromProof": selected_root_execution_gap.get(
            "diagnosticExcludedFromSelectedRootExecutionProof"
        ),
        "routeWatchReachedRoute": selected_root_execution_gap.get(
            "runtimeRouteWatchPollReachedRouteSelector"
        ),
        "predecessorDirectionSweepReachedRoute": selected_root_execution_gap.get(
            "runtimePredecessorDirectionSweepPollReachedRouteSelector"
        ),
        "predecessorLeftOverrunActivationSweepReachedRoute": selected_root_execution_gap.get(
            "runtimePredecessorLeftOverrunActivationSweepPollReachedRouteSelector"
        ),
    }
    if (
        runtime_trace_feasibility.get("canRunRuntimeTraceNow") is False
        and runtime_probe.get("canCaptureTraceNow") is False
        and runtime_poll_reached_route is False
        and selected_root_execution_gap.get("selectedRootExecutionRefFound") is False
        and selected_root_execution_gap.get("anyRuntimePollReachedRouteSelector") is False
        and selected_root_execution_gap.get("runtimePatchedPublicSelector20PollConstructedDiagnosticRoute")
        is True
        and selected_root_execution_gap.get("diagnosticExcludedFromSelectedRootExecutionProof") is True
    ):
        rejection[
            "classification"
        ] = "trace-unavailable-no-equivalent-selected-root-proof-diagnostic-excluded"
    return rejection


def runtime_trace_equivalent_rejection_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"reject={evidence.get('classification')} "
        f"proof={evidence.get('proofFound')} "
        f"failedRuntimeTraceGates={','.join(evidence.get('failedRuntimeTraceGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"canRun={evidence.get('runtimeTraceCanRunNow')} "
        f"execCapture={evidence.get('runtimeTraceExecutionCanCaptureNow')} "
        f"selectedRootRef={evidence.get('selectedRootExecutionRefFound')} "
        f"anyPollRoute={evidence.get('selectedRootRuntimeAnyPollRoute')} "
        f"diagnosticRoute={evidence.get('selectedRootConstructedDiagnosticRoute')} "
        f"diagnosticExcluded={evidence.get('selectedRootDiagnosticExcludedFromProof')}"
    )


def route_pair_entry_execution_gap_for(source: str, target: str, entry_gap: dict | None) -> dict | None:
    if not entry_gap:
        return None
    if entry_gap.get("source") != source or entry_gap.get("target") != target:
        return None
    evidence_rows = entry_gap.get("evidenceRows") or []
    route_pair_entry_rows = entry_gap.get("routePairEntryRows") or []
    negative_reader_rows = entry_gap.get("negativeReaderRows") or []
    remaining_proofs = entry_gap.get("remainingProofs") or []
    return {
        "selector": entry_gap.get("selector"),
        "rootHex": entry_gap.get("rootHex"),
        "rootTablePointerHex": entry_gap.get("rootTablePointerHex"),
        "frontierReaderHex": entry_gap.get("frontierReaderHex"),
        "evidenceRowCount": len(evidence_rows),
        "evidenceRows": evidence_rows,
        "routePairEntryRowCount": len(route_pair_entry_rows),
        "routePairEntryRows": route_pair_entry_rows,
        "negativeReaderRowCount": len(negative_reader_rows),
        "negativeReaderRows": negative_reader_rows,
        "remainingProofs": remaining_proofs,
        "evidenceRefs": entry_gap.get("evidenceRefs") or [],
        "evidenceRefCount": entry_gap.get("evidenceRefCount"),
        "routePairEntryIndices": entry_gap.get("routePairEntryIndices") or [],
        "routePairCorrectedTraceEntryIndices": entry_gap.get("routePairCorrectedTraceEntryIndices") or [],
        "negativeReaderEntryIndices": entry_gap.get("negativeReaderEntryIndices") or [],
        "routePairCurrentEntryCount": entry_gap.get("routePairCurrentEntryCount"),
        "routePairCorrectedTraceReachesReaderCount": entry_gap.get(
            "routePairCorrectedTraceReachesReaderCount"
        ),
        "routePairCorrectedReaderGrounded": entry_gap.get("routePairCorrectedReaderGrounded"),
        "globalCurrentSelectorRoutePairIndices": entry_gap.get(
            "globalCurrentSelectorRoutePairIndices"
        )
        or [],
        "globalCurrentSelectorNegativeRoutePairRowCount": entry_gap.get(
            "globalCurrentSelectorNegativeRoutePairRowCount"
        ),
        "globalCurrentSelectorNonNegativeRoutePairRowCount": entry_gap.get(
            "globalCurrentSelectorNonNegativeRoutePairRowCount"
        ),
        "globalCurrentFrontierLeafOnlyNegative": entry_gap.get(
            "globalCurrentFrontierLeafOnlyNegative"
        ),
        "frontierReaderSelectableByNonNegativeIndex": entry_gap.get(
            "frontierReaderSelectableByNonNegativeIndex"
        ),
        "frontierReaderReachableByCorrectedNonNegativeIndex": entry_gap.get(
            "frontierReaderReachableByCorrectedNonNegativeIndex"
        ),
        "correctedTraceNormalSelectionGapFound": entry_gap.get(
            "correctedTraceNormalSelectionGapFound"
        ),
        "correctedTraceNormalSelectionGapStatus": entry_gap.get(
            "correctedTraceNormalSelectionGapStatus"
        ),
        "opcode07DirectEntrySelectionAbsent": entry_gap.get("opcode07DirectEntrySelectionAbsent"),
        "opcode08SourceOrPredecessorCurrentRootProducerCount": entry_gap.get(
            "opcode08SourceOrPredecessorCurrentRootProducerCount"
        ),
        "opcode08SourceOrPredecessorCurrentRangeProducerCount": entry_gap.get(
            "opcode08SourceOrPredecessorCurrentRangeProducerCount"
        ),
        "opcode08CurrentInternalCurrentRangeProducerCount": entry_gap.get(
            "opcode08CurrentInternalCurrentRangeProducerCount"
        ),
        "opcode08SelectorBucketRows": entry_gap.get("opcode08SelectorBucketRows") or [],
        "opcode08SourcePredecessorBucketSummary": entry_gap.get(
            "opcode08SourcePredecessorBucketSummary"
        ),
        "opcode08CurrentSelectorContrastSummary": entry_gap.get(
            "opcode08CurrentSelectorContrastSummary"
        ),
        "opcode09SourceOrPredecessorCurrentRangeStoreCount": entry_gap.get(
            "opcode09SourceOrPredecessorCurrentRangeStoreCount"
        ),
        "opcode09SourceOrPredecessorUnsupportedModeOpcode09RowCount": entry_gap.get(
            "opcode09SourceOrPredecessorUnsupportedModeOpcode09RowCount"
        ),
        "opcode09SourceOrPredecessorUnsupportedModesHex": entry_gap.get(
            "opcode09SourceOrPredecessorUnsupportedModesHex"
        )
        or [],
        "opcode09SourcePredecessorPointerCollisionRows": entry_gap.get(
            "opcode09SourcePredecessorPointerCollisionRows"
        )
        or [],
        "opcode09SourcePredecessorPointerCollisionSummary": entry_gap.get(
            "opcode09SourcePredecessorPointerCollisionSummary"
        ),
        "sourceOrPredecessorCurrentProducerCount": entry_gap.get("sourceOrPredecessorCurrentProducerCount"),
        "routePairIndexSourceRouteEntryIndices": entry_gap.get("routePairIndexSourceRouteEntryIndices")
        or [],
        "routePairIndexSourceEntryPointerRefCount": entry_gap.get(
            "routePairIndexSourceEntryPointerRefCount"
        ),
        "routePairIndexSourceEntryPointerTextRefCount": entry_gap.get(
            "routePairIndexSourceEntryPointerTextRefCount"
        ),
        "routePairIndexSourceEntryPointerPromotingRefCount": entry_gap.get(
            "routePairIndexSourceEntryPointerPromotingRefCount"
        ),
        "routePairIndexSourceEncodedEntryAnchorRawScalarCandidateCount": entry_gap.get(
            "routePairIndexSourceEncodedEntryAnchorRawScalarCandidateCount"
        ),
        "routePairIndexSourceEncodedEntryAnchorBranchAttachedEncodedFieldCount": entry_gap.get(
            "routePairIndexSourceEncodedEntryAnchorBranchAttachedEncodedFieldCount"
        ),
        "routePairIndexSourceEncodedEntryAnchorModeledControlFlowCandidateCount": entry_gap.get(
            "routePairIndexSourceEncodedEntryAnchorModeledControlFlowCandidateCount"
        ),
        "routePairIndexSourceEncodedEntryAnchorPromotingCandidateCount": entry_gap.get(
            "routePairIndexSourceEncodedEntryAnchorPromotingCandidateCount"
        ),
        "routePairIndexSourceEncodedEntryAnchorClassification": entry_gap.get(
            "routePairIndexSourceEncodedEntryAnchorClassification"
        ),
        "routePairIndexSourceEntryPointerOpcode5aFallthroughRefCount": entry_gap.get(
            "routePairIndexSourceEntryPointerOpcode5aFallthroughRefCount"
        ),
        "routePairIndexSourceEntryPointerFallthroughNonCodeRefCount": entry_gap.get(
            "routePairIndexSourceEntryPointerFallthroughNonCodeRefCount"
        ),
        "routePairIndexSourceNonNegativeEntryPointerPromotingRefCount": entry_gap.get(
            "routePairIndexSourceNonNegativeEntryPointerPromotingRefCount"
        ),
        "routePairIndexSourceNegativeReaderEntryPointerPromotingRefCount": entry_gap.get(
            "routePairIndexSourceNegativeReaderEntryPointerPromotingRefCount"
        ),
        "routePairIndexSourceEntryPointerFallthroughHandlerSummaries": entry_gap.get(
            "routePairIndexSourceEntryPointerFallthroughHandlerSummaries"
        )
        or [],
        "routePairIndexSourceDescriptorRefsOnlyTableCells": entry_gap.get(
            "routePairIndexSourceDescriptorRefsOnlyTableCells"
        ),
        "routePairIndexSourceChildRefsOnlyDescriptorChildWords": entry_gap.get(
            "routePairIndexSourceChildRefsOnlyDescriptorChildWords"
        ),
        "routePairIndexSourceHigherLevelIndexSourceProven": entry_gap.get(
            "routePairIndexSourceHigherLevelIndexSourceProven"
        ),
        "routePairIndexSourceProofFound": entry_gap.get("routePairIndexSourceProofFound"),
        "routePairIndexSourceFailedGateIds": (
            entry_gap.get("routePairIndexSourceFailedGateIds") or []
        ),
        "routePairIndexSourceMissingEvidence": (
            entry_gap.get("routePairIndexSourceMissingEvidence") or []
        ),
        "rootTableWindowDirectRefCount": entry_gap.get("rootTableWindowDirectRefCount"),
        "rootTableWindowDirectTextRefCount": entry_gap.get("rootTableWindowDirectTextRefCount"),
        "rootTableWindowDirectRefSectionCounts": entry_gap.get(
            "rootTableWindowDirectRefSectionCounts"
        )
        or {},
        "rootTableRouteEntryAddressTextRefCount": entry_gap.get(
            "rootTableRouteEntryAddressTextRefCount"
        ),
        "rootTableRouteLeafValueTextRefCount": entry_gap.get(
            "rootTableRouteLeafValueTextRefCount"
        ),
        "rootTableFrontierLeafValueTextRefCount": entry_gap.get(
            "rootTableFrontierLeafValueTextRefCount"
        ),
        "rootTableFrontierReaderValueTextRefCount": entry_gap.get(
            "rootTableFrontierReaderValueTextRefCount"
        ),
        "rootTableFrontierReaderValueRefCount": entry_gap.get(
            "rootTableFrontierReaderValueRefCount"
        ),
        "wrapperRefBeforeCurrentRoot": entry_gap.get("wrapperRefBeforeCurrentRoot"),
        "currentRootReferencesWrapper": entry_gap.get("currentRootReferencesWrapper"),
        "wrapperEntryCurrentRootEntryRunRefCount": entry_gap.get(
            "wrapperEntryCurrentRootEntryRunRefCount"
        ),
        "wrapperEntryOpcode5aFallthroughRefCount": entry_gap.get(
            "wrapperEntryOpcode5aFallthroughRefCount"
        ),
        "wrapperEntryFallthroughNonCodeRefCount": entry_gap.get(
            "wrapperEntryFallthroughNonCodeRefCount"
        ),
        "wrapperEntryFallthroughHandlerSummaries": entry_gap.get(
            "wrapperEntryFallthroughHandlerSummaries"
        )
        or [],
        "wrapperEntryOnlyRefIsOpcode5aFallthrough": entry_gap.get(
            "wrapperEntryOnlyRefIsOpcode5aFallthrough"
        ),
        "wrapperEntryPromotingRefCount": entry_gap.get("wrapperEntryPromotingRefCount"),
        "wrapperExecutionProofFound": entry_gap.get("wrapperExecutionProofFound"),
        "selectedRootExecutionRefFound": entry_gap.get("selectedRootExecutionRefFound"),
        "routePairEntryExecutionProven": entry_gap.get("routePairEntryExecutionProven"),
        "proofFound": entry_gap.get("proofFound"),
        "failedRoutePairEntryGateIds": entry_gap.get("failedRoutePairEntryGateIds") or [],
        "missingEvidence": entry_gap.get("missingEvidence") or [],
        "entrySelectionGapOpen": entry_gap.get("entrySelectionGapOpen"),
        "strictHotspotFound": entry_gap.get("strictHotspotFound"),
        "promotionStatus": entry_gap.get("promotionStatus"),
        "conclusion": entry_gap.get("conclusion"),
    }


def route_pair_entry_execution_gap_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"entryIdx={','.join(str(value) for value in evidence.get('routePairEntryIndices') or []) or '-'} "
        f"correctedIdx={','.join(str(value) for value in evidence.get('routePairCorrectedTraceEntryIndices') or []) or '-'} "
        f"negativeReaderIdx={','.join(str(value) for value in evidence.get('negativeReaderEntryIndices') or []) or '-'} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"globalRoutePairIdx={','.join(str(value) for value in evidence.get('globalCurrentSelectorRoutePairIndices') or []) or '-'} "
        f"globalNegNonNeg={evidence.get('globalCurrentSelectorNegativeRoutePairRowCount')}/"
        f"{evidence.get('globalCurrentSelectorNonNegativeRoutePairRowCount')} "
        f"frontierLeafNegativeOnly={evidence.get('globalCurrentFrontierLeafOnlyNegative')} "
        f"correctedReader={evidence.get('routePairCorrectedTraceReachesReaderCount')}/"
        f"{evidence.get('routePairCurrentEntryCount')} "
        f"nonNegSelectable={evidence.get('frontierReaderSelectableByNonNegativeIndex')} "
        f"nonNegCorrectedReachable={evidence.get('frontierReaderReachableByCorrectedNonNegativeIndex')} "
        f"normalSelectionGap={evidence.get('correctedTraceNormalSelectionGapStatus')} "
        f"normalSelectionGapFound={evidence.get('correctedTraceNormalSelectionGapFound')} "
        f"op7DirectAbsent={evidence.get('opcode07DirectEntrySelectionAbsent')} "
        f"op8CurrentRootRange={evidence.get('opcode08SourceOrPredecessorCurrentRootProducerCount')}/"
        f"{evidence.get('opcode08SourceOrPredecessorCurrentRangeProducerCount')} "
        f"op8CurrentInternal={evidence.get('opcode08CurrentInternalCurrentRangeProducerCount')} "
        f"op8Buckets={evidence.get('opcode08SourcePredecessorBucketSummary') or '-'} "
        f"op8CurrentContrast={evidence.get('opcode08CurrentSelectorContrastSummary') or '-'} "
        f"op9CurrentRangeStores={evidence.get('opcode09SourceOrPredecessorCurrentRangeStoreCount')} "
        f"op9Unsupported={evidence.get('opcode09SourceOrPredecessorUnsupportedModeOpcode09RowCount')} "
        f"op9UnsupportedModes={','.join(evidence.get('opcode09SourceOrPredecessorUnsupportedModesHex') or []) or '-'} "
        f"op9CollisionRows={evidence.get('opcode09SourcePredecessorPointerCollisionSummary') or '-'} "
        f"sourcePredCurrentProducers={evidence.get('sourceOrPredecessorCurrentProducerCount')} "
        f"indexSourceEntryRefs={evidence.get('routePairIndexSourceEntryPointerRefCount')}/"
        f"{evidence.get('routePairIndexSourceEntryPointerTextRefCount')}/"
        f"{evidence.get('routePairIndexSourceEntryPointerPromotingRefCount')} "
        f"indexSourceEncoded={evidence.get('routePairIndexSourceEncodedEntryAnchorRawScalarCandidateCount')}/"
        f"{evidence.get('routePairIndexSourceEncodedEntryAnchorBranchAttachedEncodedFieldCount')}/"
        f"{evidence.get('routePairIndexSourceEncodedEntryAnchorModeledControlFlowCandidateCount')}/"
        f"{evidence.get('routePairIndexSourceEncodedEntryAnchorPromotingCandidateCount')} "
        f"indexSourceEncodedClass={evidence.get('routePairIndexSourceEncodedEntryAnchorClassification')} "
        f"indexSourceFallthrough={evidence.get('routePairIndexSourceEntryPointerOpcode5aFallthroughRefCount')}/"
        f"{evidence.get('routePairIndexSourceEntryPointerFallthroughNonCodeRefCount')} "
        f"indexSourceNonNegPromoting={evidence.get('routePairIndexSourceNonNegativeEntryPointerPromotingRefCount')} "
        f"indexSourceNegativeReaderPromoting={evidence.get('routePairIndexSourceNegativeReaderEntryPointerPromotingRefCount')} "
        f"indexSourceHandlers={','.join(evidence.get('routePairIndexSourceEntryPointerFallthroughHandlerSummaries') or []) or '-'} "
        f"indexSourceProven={evidence.get('routePairIndexSourceHigherLevelIndexSourceProven')} "
        f"indexSourceProof={evidence.get('routePairIndexSourceProofFound')} "
        "indexSourceFailedGates="
        f"{','.join(evidence.get('routePairIndexSourceFailedGateIds') or []) or '-'} "
        f"indexSourceMissingEvidenceCount={len(evidence.get('routePairIndexSourceMissingEvidence') or [])} "
        f"rootTableRefs={evidence.get('rootTableWindowDirectRefCount')}/"
        f"{evidence.get('rootTableWindowDirectTextRefCount')} "
        f"rootTableSections={evidence.get('rootTableWindowDirectRefSectionCounts')} "
        f"rootTableEntryLeafFrontierReaderText="
        f"{evidence.get('rootTableRouteEntryAddressTextRefCount')}/"
        f"{evidence.get('rootTableRouteLeafValueTextRefCount')}/"
        f"{evidence.get('rootTableFrontierLeafValueTextRefCount')}/"
        f"{evidence.get('rootTableFrontierReaderValueTextRefCount')} "
        f"rootTableFrontierReaderRefs={evidence.get('rootTableFrontierReaderValueRefCount')} "
        f"wrapperEntryRunRefs={evidence.get('wrapperEntryCurrentRootEntryRunRefCount')} "
        f"wrapperFallthroughRefs={evidence.get('wrapperEntryOpcode5aFallthroughRefCount')} "
        f"wrapperFallthroughNonCodeRefs={evidence.get('wrapperEntryFallthroughNonCodeRefCount')} "
        f"wrapperFallthroughHandlers={','.join(evidence.get('wrapperEntryFallthroughHandlerSummaries') or []) or '-'} "
        f"wrapperExec={evidence.get('wrapperExecutionProofFound')} "
        f"selectedRootRef={evidence.get('selectedRootExecutionRefFound')} "
        f"entryExec={evidence.get('routePairEntryExecutionProven')} "
        f"proofFound={evidence.get('proofFound')} "
        f"failedRoutePairEntryGates={','.join(evidence.get('failedRoutePairEntryGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"strictHotspot={evidence.get('strictHotspotFound')} "
        f"status={evidence.get('promotionStatus')}"
    )


def opcode08_activation_windows_for(source: str, target: str, activation_windows: dict | None) -> dict | None:
    if not activation_windows:
        return None
    if activation_windows.get("source") != source or activation_windows.get("target") != target:
        return None
    return {
        "sourceSelector": activation_windows.get("sourceSelector"),
        "predecessorSelector": activation_windows.get("predecessorSelector"),
        "currentSelector": activation_windows.get("currentSelector"),
        "sourceOrPredecessorOpcode08ActivatorCount": activation_windows.get("sourceOrPredecessorOpcode08ActivatorCount"),
        "sourceOrPredecessorCurrentRootProducerCount": activation_windows.get("sourceOrPredecessorCurrentRootProducerCount"),
        "sourceOrPredecessorCurrentRangeProducerCount": activation_windows.get("sourceOrPredecessorCurrentRangeProducerCount"),
        "sourceOrPredecessorOwnRangeProducerCount": activation_windows.get("sourceOrPredecessorOwnRangeProducerCount"),
        "sourceOrPredecessorScriptScalarProducerCount": activation_windows.get("sourceOrPredecessorScriptScalarProducerCount"),
        "sourceOrPredecessorUnreadableProducerCount": activation_windows.get("sourceOrPredecessorUnreadableProducerCount"),
        "currentInternalCurrentRangeProducerCount": activation_windows.get("currentInternalCurrentRangeProducerCount"),
        "opcode08ActivationPromotesRoute": activation_windows.get("opcode08ActivationPromotesRoute"),
        "promotionStatus": activation_windows.get("promotionStatus"),
        "conclusion": activation_windows.get("conclusion"),
    }


def opcode08_activation_windows_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"op8Activators={evidence.get('sourceOrPredecessorOpcode08ActivatorCount')} "
        f"currentRangeProducers={evidence.get('sourceOrPredecessorCurrentRangeProducerCount')} "
        f"ownRange={evidence.get('sourceOrPredecessorOwnRangeProducerCount')} "
        f"scriptScalar={evidence.get('sourceOrPredecessorScriptScalarProducerCount')} "
        f"unreadable={evidence.get('sourceOrPredecessorUnreadableProducerCount')} "
        f"currentInternal={evidence.get('currentInternalCurrentRangeProducerCount')} "
        f"promotes={evidence.get('opcode08ActivationPromotesRoute')}"
    )


def opcode08_unreadable_producers_for(source: str, target: str, unreadable_producers: dict | None) -> dict | None:
    if not unreadable_producers:
        return None
    if unreadable_producers.get("source") != source or unreadable_producers.get("target") != target:
        return None
    return {
        "sourceSelector": unreadable_producers.get("sourceSelector"),
        "predecessorSelector": unreadable_producers.get("predecessorSelector"),
        "currentSelector": unreadable_producers.get("currentSelector"),
        "sourceOrPredecessorUnreadableActivationCount": unreadable_producers.get("sourceOrPredecessorUnreadableActivationCount"),
        "uniqueUnreadableProducerCount": unreadable_producers.get("uniqueUnreadableProducerCount"),
        "opcode07UnreadableActivationCount": unreadable_producers.get("opcode07UnreadableActivationCount"),
        "opcode07UnmappedSelectedSlotActivationCount": unreadable_producers.get("opcode07UnmappedSelectedSlotActivationCount"),
        "opcode09UnreadableActivationCount": unreadable_producers.get("opcode09UnreadableActivationCount"),
        "opcode09UnsupportedModeActivationCount": unreadable_producers.get("opcode09UnsupportedModeActivationCount"),
        "staticCurrentPointerEvidenceCount": unreadable_producers.get("staticCurrentPointerEvidenceCount"),
        "opcode08UnreadableProducerPromotesRoute": unreadable_producers.get("opcode08UnreadableProducerPromotesRoute"),
        "promotionStatus": unreadable_producers.get("promotionStatus"),
        "conclusion": unreadable_producers.get("conclusion"),
    }


def opcode08_unreadable_producers_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"unreadableActivations={evidence.get('sourceOrPredecessorUnreadableActivationCount')} "
        f"uniqueProducers={evidence.get('uniqueUnreadableProducerCount')} "
        f"op7={evidence.get('opcode07UnreadableActivationCount')} "
        f"unmappedSlots={evidence.get('opcode07UnmappedSelectedSlotActivationCount')} "
        f"op9={evidence.get('opcode09UnreadableActivationCount')} "
        f"unsupportedModes={evidence.get('opcode09UnsupportedModeActivationCount')} "
        f"staticCurrent={evidence.get('staticCurrentPointerEvidenceCount')} "
        f"promotes={evidence.get('opcode08UnreadableProducerPromotesRoute')}"
    )


def opcode09_pointer_collisions_for(source: str, target: str, pointer_collisions: dict | None) -> dict | None:
    if not pointer_collisions:
        return None
    if pointer_collisions.get("source") != source or pointer_collisions.get("target") != target:
        return None
    return {
        "sourceSelector": pointer_collisions.get("sourceSelector"),
        "predecessorSelector": pointer_collisions.get("predecessorSelector"),
        "currentSelector": pointer_collisions.get("currentSelector"),
        "opcode09HandlerHex": pointer_collisions.get("opcode09HandlerHex"),
        "opcode09ModeSource": pointer_collisions.get("opcode09ModeSource"),
        "opcode09SupportedModesHex": pointer_collisions.get("opcode09SupportedModesHex") or [],
        "unsupportedModeReturnsWithoutStore": pointer_collisions.get("unsupportedModeReturnsWithoutStore"),
        "opcode09RowCount": pointer_collisions.get("opcode09RowCount"),
        "sourceOrPredecessorOpcode09RowCount": pointer_collisions.get("sourceOrPredecessorOpcode09RowCount"),
        "sourceOrPredecessorSupportedOpcode09RowCount": pointer_collisions.get("sourceOrPredecessorSupportedOpcode09RowCount"),
        "sourceOrPredecessorUnsupportedModeOpcode09RowCount": pointer_collisions.get("sourceOrPredecessorUnsupportedModeOpcode09RowCount"),
        "sourceOrPredecessorPointerCollisionRowCount": pointer_collisions.get("sourceOrPredecessorPointerCollisionRowCount"),
        "sourceOrPredecessorUnsupportedModePointerCollisionCount": pointer_collisions.get("sourceOrPredecessorUnsupportedModePointerCollisionCount"),
        "sourceOrPredecessorUnsupportedModesHex": pointer_collisions.get("sourceOrPredecessorUnsupportedModesHex") or [],
        "sourceOrPredecessorUnsupportedModesAllPointerCollisions": pointer_collisions.get("sourceOrPredecessorUnsupportedModesAllPointerCollisions"),
        "sourceOrPredecessorCurrentRangeStoreCount": pointer_collisions.get("sourceOrPredecessorCurrentRangeStoreCount"),
        "currentOpcode09RowCount": pointer_collisions.get("currentOpcode09RowCount"),
        "currentUnsupportedModeOpcode09RowCount": pointer_collisions.get("currentUnsupportedModeOpcode09RowCount"),
        "activationLinkedPointerCollisionCount": pointer_collisions.get("activationLinkedPointerCollisionCount"),
        "opcode09PointerCollisionPromotesRoute": pointer_collisions.get("opcode09PointerCollisionPromotesRoute"),
        "promotionStatus": pointer_collisions.get("promotionStatus"),
        "conclusion": pointer_collisions.get("conclusion"),
    }


def opcode09_pointer_collisions_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"op9Rows={evidence.get('sourceOrPredecessorOpcode09RowCount')} "
        f"handler={evidence.get('opcode09HandlerHex')} "
        f"modeSource={evidence.get('opcode09ModeSource')} "
        f"modes={evidence.get('opcode09SupportedModesHex')} "
        f"supported={evidence.get('sourceOrPredecessorSupportedOpcode09RowCount')} "
        f"unsupported={evidence.get('sourceOrPredecessorUnsupportedModeOpcode09RowCount')} "
        f"collisions={evidence.get('sourceOrPredecessorPointerCollisionRowCount')} "
        f"unsupportedCollision={evidence.get('sourceOrPredecessorUnsupportedModePointerCollisionCount')} "
        f"unsupportedModes={evidence.get('sourceOrPredecessorUnsupportedModesHex')} "
        f"allUnsupportedCollisions={evidence.get('sourceOrPredecessorUnsupportedModesAllPointerCollisions')} "
        f"currentStores={evidence.get('sourceOrPredecessorCurrentRangeStoreCount')} "
        f"currentUnsupported={evidence.get('currentUnsupportedModeOpcode09RowCount')} "
        f"activationLinked={evidence.get('activationLinkedPointerCollisionCount')} "
        f"promotes={evidence.get('opcode09PointerCollisionPromotesRoute')}"
    )


def secondary_reset_scope_for(source: str, target: str, reset_scope: dict | None) -> dict | None:
    if not reset_scope:
        return None
    route = reset_scope.get("routeScope") or {}
    return {
        "secondaryRangeHex": (reset_scope.get("secondaryBranchState") or {}).get("rangeHex"),
        "directIndexedWriterCount": (reset_scope.get("secondaryBranchState") or {}).get("directIndexedWriterCount"),
        "unresolvedRefCount": (reset_scope.get("secondaryBranchState") or {}).get("unresolvedRefCount"),
        "helperDirectCallCount": (reset_scope.get("helper") or {}).get("directCallCount"),
        "helperOnlyCalledInsideOpcode10Handler": (reset_scope.get("helper") or {}).get("onlyDirectCallInsideOpcode10Handler"),
        "currentRootValidBeforeFrontierFillCount": route.get("currentRootValidBeforeFrontierFillCount"),
        "currentRootValidAfterFrontierFillCount": route.get("currentRootValidAfterFrontierFillCount"),
        "predecessorTailValidSecondaryFillCount": route.get("predecessorTailValidSecondaryFillCount"),
        "noDirectGlobalSecondaryWriter": reset_scope.get("noDirectGlobalSecondaryWriter"),
        "noKnownPreFrontierResetInScopedEvidence": reset_scope.get("noKnownPreFrontierResetInScopedEvidence"),
        "globalResetRuledOut": reset_scope.get("globalResetRuledOut"),
        "promotionStatus": reset_scope.get("promotionStatus"),
        "conclusion": reset_scope.get("conclusion"),
    }


def secondary_reset_scope_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"secondary={evidence.get('secondaryRangeHex')} "
        f"directWriters={evidence.get('directIndexedWriterCount')} "
        f"helperOpcode10Only={evidence.get('helperOnlyCalledInsideOpcode10Handler')} "
        f"currentBefore={evidence.get('currentRootValidBeforeFrontierFillCount')} "
        f"predecessorTail={evidence.get('predecessorTailValidSecondaryFillCount')} "
        f"scopedNoReset={evidence.get('noKnownPreFrontierResetInScopedEvidence')} "
        f"globalResetRuledOut={evidence.get('globalResetRuledOut')}"
    )


def secondary_global_reset_gap_for(source: str, target: str, gap: dict | None) -> dict | None:
    if not gap:
        return None
    if gap.get("source") != source or gap.get("target") != target:
        return None
    return {
        "globalResetCandidateClass": gap.get("globalResetCandidateClass"),
        "directGlobalSecondaryWriterCount": gap.get("directGlobalSecondaryWriterCount"),
        "unresolvedGlobalSecondaryRefCount": gap.get("unresolvedGlobalSecondaryRefCount"),
        "helperOnlyCalledInsideOpcode10Handler": gap.get("helperOnlyCalledInsideOpcode10Handler"),
        "secondaryBlockWriteScanRangeHex": gap.get("secondaryBlockWriteScanRangeHex"),
        "secondaryBlockAddressLikeTouchingBaseCount": gap.get("secondaryBlockAddressLikeTouchingBaseCount"),
        "secondaryBlockDirectOverlapWriteCount": gap.get("secondaryBlockDirectOverlapWriteCount"),
        "secondaryTouchBlockWriteCandidateCount": gap.get("secondaryTouchBlockWriteCandidateCount"),
        "secondaryFullCoverBlockWriteCandidateCount": gap.get("secondaryFullCoverBlockWriteCandidateCount"),
        "secondaryBlockWriteShapeClosed": gap.get("secondaryBlockWriteShapeClosed"),
        "currentRootValidBeforeFrontierFillCount": gap.get("currentRootValidBeforeFrontierFillCount"),
        "currentRootValidAfterFrontierFillCount": gap.get("currentRootValidAfterFrontierFillCount"),
        "currentRootAfterFrontierFillVas": gap.get("currentRootAfterFrontierFillVas") or [],
        "predecessorSelector": gap.get("predecessorSelector"),
        "predecessorRootHex": gap.get("predecessorRootHex"),
        "predecessorFillCount": gap.get("predecessorFillCount"),
        "predecessorFillVas": gap.get("predecessorFillVas") or [],
        "predecessorTailValidSecondaryFillCount": gap.get("predecessorTailValidSecondaryFillCount"),
        "predecessorLocalTailResetFound": gap.get("predecessorLocalTailResetFound"),
        "predecessorFillWouldPassCurrentReader": gap.get("predecessorFillWouldPassCurrentReader"),
        "currentRootHasNoKnownBeforeFrontierOverwrite": gap.get("currentRootHasNoKnownBeforeFrontierOverwrite"),
        "routeOrderProven": gap.get("routeOrderProven"),
        "persistenceProven": gap.get("persistenceProven"),
        "strictHotspotFound": gap.get("strictHotspotFound"),
        "selectorMergeGapOpen": gap.get("selectorMergeGapOpen"),
        "closedStaticResetScope": gap.get("closedStaticResetScope"),
        "staticResetShapeRuledOut": gap.get("staticResetShapeRuledOut"),
        "selectorOrderResetGapClosed": gap.get("selectorOrderResetGapClosed"),
        "openRuntimeOrderOrBytecodeGap": gap.get("openRuntimeOrderOrBytecodeGap"),
        "runtimeResetRiskClass": gap.get("runtimeResetRiskClass"),
        "globalResetRuledOut": gap.get("globalResetRuledOut"),
        "promotionStatus": gap.get("promotionStatus"),
        "conclusion": gap.get("conclusion"),
    }


def secondary_global_reset_gap_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    after = ",".join(evidence.get("currentRootAfterFrontierFillVas") or [])
    pred = ",".join(evidence.get("predecessorFillVas") or [])
    return (
        f"class={evidence.get('globalResetCandidateClass')} "
        f"direct={evidence.get('directGlobalSecondaryWriterCount')} "
        f"unresolved={evidence.get('unresolvedGlobalSecondaryRefCount')} "
        f"helperOpcode10Only={evidence.get('helperOnlyCalledInsideOpcode10Handler')} "
        f"blockScan={evidence.get('secondaryBlockWriteScanRangeHex')} "
        f"blockAddr={evidence.get('secondaryBlockAddressLikeTouchingBaseCount')} "
        f"blockTouch={evidence.get('secondaryTouchBlockWriteCandidateCount')} "
        f"blockFull={evidence.get('secondaryFullCoverBlockWriteCandidateCount')} "
        f"blockClosed={evidence.get('secondaryBlockWriteShapeClosed')} "
        f"currentBefore={evidence.get('currentRootValidBeforeFrontierFillCount')} "
        f"currentAfter={evidence.get('currentRootValidAfterFrontierFillCount')}[{after or '-'}] "
        f"predecessor={evidence.get('predecessorSelector')}@{evidence.get('predecessorRootHex')} "
        f"fills={evidence.get('predecessorFillCount')}[{pred or '-'}] "
        f"tailValid={evidence.get('predecessorTailValidSecondaryFillCount')} "
        f"staticClosed={evidence.get('closedStaticResetScope')} "
        f"staticShapeRuledOut={evidence.get('staticResetShapeRuledOut')} "
        f"selectorOrderClosed={evidence.get('selectorOrderResetGapClosed')} "
        f"runtimeGap={evidence.get('openRuntimeOrderOrBytecodeGap')} "
        f"runtimeRisk={evidence.get('runtimeResetRiskClass')} "
        f"globalResetRuledOut={evidence.get('globalResetRuledOut')}"
    )


def secondary_block_writes_for(evidence: dict | None) -> dict | None:
    if not evidence:
        return None
    return {
        "secondaryRangeHex": evidence.get("secondaryRangeHex"),
        "scanRangeHex": evidence.get("scanRangeHex"),
        "addressLikeTouchingBaseCount": evidence.get("addressLikeTouchingBaseCount"),
        "directOverlapWriteCount": evidence.get("directOverlapWriteCount"),
        "touchBlockWriteCandidateCount": evidence.get("touchBlockWriteCandidateCount"),
        "fullCoverBlockWriteCandidateCount": evidence.get("fullCoverBlockWriteCandidateCount"),
        "promotionStatus": evidence.get("promotionStatus"),
        "conclusion": evidence.get("conclusion"),
    }


def secondary_block_writes_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"secondaryBlock={evidence.get('secondaryRangeHex')} "
        f"scan={evidence.get('scanRangeHex')} "
        f"addr={evidence.get('addressLikeTouchingBaseCount')} "
        f"directOverlap={evidence.get('directOverlapWriteCount')} "
        f"touch={evidence.get('touchBlockWriteCandidateCount')} "
        f"full={evidence.get('fullCoverBlockWriteCandidateCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def runtime_selector_byte_writes_for(source: str, target: str, evidence: dict | None) -> dict | None:
    if not evidence:
        return None
    if evidence.get("source") != source or evidence.get("target") != target:
        return None
    scan = evidence.get("opcode4fDataScan") or {}
    root_pattern = scan.get("rootSelfWritePattern") or {}
    return {
        "handlerVaHex": (evidence.get("runtimeSelectorHandler") or {}).get("handlerVaHex"),
        "handlerOpcodeHex": (evidence.get("runtimeSelectorHandler") or {}).get("opcodeHex"),
        "selectorByteWriteMechanismIdentified": evidence.get("selectorByteWriteMechanismIdentified"),
        "currentSelectorByteWriterFound": evidence.get("currentSelectorByteWriterFound"),
        "currentSelectorWriterIsCurrentRootSelfWrite": evidence.get("currentSelectorWriterIsCurrentRootSelfWrite"),
        "sourceOrPredecessorCurrentSelectorWriterCount": evidence.get("sourceOrPredecessorCurrentSelectorWriterCount"),
        "leafStreamOpcode4fHitCount": evidence.get("leafStreamOpcode4fHitCount"),
        "mode1CurrentSelectorWriterCount": scan.get("mode1CurrentSelectorWriterCount"),
        "mode1CurrentSelectorWriterOutsideCurrentRootCount": scan.get(
            "mode1CurrentSelectorWriterOutsideCurrentRootCount"
        ),
        "mode1SelfWriteCount": root_pattern.get("mode1SelfWriteCount"),
        "mode1CrossWriteCount": root_pattern.get("mode1CrossWriteCount"),
        "routeContextCommonSignatureCount": root_pattern.get("routeContextCommonSignatureCount"),
        "crossWriteToCurrentSelectorCount": root_pattern.get("crossWriteToCurrentSelectorCount"),
        "rootSelfWritePatternPromotesRoute": evidence.get("rootSelfWritePatternPromotesRoute"),
        "routeContextMode1RowCount": scan.get("routeContextMode1RowCount"),
        "selectorByteWritePromotesRoute": evidence.get("selectorByteWritePromotesRoute"),
        "promotionStatus": evidence.get("promotionStatus"),
    }


def runtime_selector_byte_writes_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"handler={evidence.get('handlerVaHex')} opcode={evidence.get('handlerOpcodeHex')} "
        f"mechanism={evidence.get('selectorByteWriteMechanismIdentified')} "
        f"currentWriter={evidence.get('mode1CurrentSelectorWriterCount')} "
        f"outsideCurrent={evidence.get('mode1CurrentSelectorWriterOutsideCurrentRootCount')} "
        f"selfRows={evidence.get('mode1SelfWriteCount')} "
        f"crossRows={evidence.get('mode1CrossWriteCount')} "
        f"routeCommon={evidence.get('routeContextCommonSignatureCount')} "
        f"crossToCurrent={evidence.get('crossWriteToCurrentSelectorCount')} "
        f"sourcePredCurrent={evidence.get('sourceOrPredecessorCurrentSelectorWriterCount')} "
        f"leafHits={evidence.get('leafStreamOpcode4fHitCount')} "
        f"selfWrite={evidence.get('currentSelectorWriterIsCurrentRootSelfWrite')} "
        f"rootPatternPromotes={evidence.get('rootSelfWritePatternPromotesRoute')} "
        f"promotes={evidence.get('selectorByteWritePromotesRoute')}"
    )


def secondary_route_overlap_for(source: str, target: str, candidates: dict | None) -> dict | None:
    if not candidates:
        return None
    if candidates.get("source") != source or candidates.get("target") != target:
        return None
    return {
        "routeOverlapRootCount": candidates.get("routeOverlapRootCount"),
        "preCurrentRouteOverlapFillRootCount": candidates.get("preCurrentRouteOverlapFillRootCount"),
        "candidatePredecessorRootCount": candidates.get("candidatePredecessorRootCount"),
        "sourceSidePreviousSecondaryFillCount": candidates.get("sourceSidePreviousSecondaryFillCount"),
        "currentRootBeforeFrontierFillCount": candidates.get("currentRootBeforeFrontierFillCount"),
        "currentRootAfterFrontierFillCount": candidates.get("currentRootAfterFrontierFillCount"),
        "postCurrentRouteOverlapRootCount": candidates.get("postCurrentRouteOverlapRootCount"),
        "secondaryRouteOverlapPromotesRoute": candidates.get("secondaryRouteOverlapPromotesRoute"),
        "promotionStatus": candidates.get("promotionStatus"),
        "conclusion": candidates.get("conclusion"),
    }


def secondary_route_overlap_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"routeOverlap={evidence.get('routeOverlapRootCount')} "
        f"preCurrent={evidence.get('preCurrentRouteOverlapFillRootCount')} "
        f"sourceSide={evidence.get('sourceSidePreviousSecondaryFillCount')} "
        f"currentAfter={evidence.get('currentRootAfterFrontierFillCount')} "
        f"postCurrent={evidence.get('postCurrentRouteOverlapRootCount')} "
        f"promotes={evidence.get('secondaryRouteOverlapPromotesRoute')}"
    )


def secondary_fill_roots_for(summary: dict | None) -> dict | None:
    if not summary:
        return None
    current_root = summary.get("currentRoot") or {}
    route_roots = summary.get("routeOverlapRoots") or []
    predecessor_root = next((row for row in route_roots if row.get("rootHex") == "0x00478364"), {})
    current_fills = current_root.get("fills") or []
    return {
        "currentRootHex": summary.get("currentRootHex"),
        "frontierReaderHex": summary.get("frontierReaderHex"),
        "rootCount": summary.get("rootCount"),
        "routeOverlapRootCount": summary.get("routeOverlapRootCount"),
        "fillEntryReferenceRootCount": summary.get("fillEntryReferenceRootCount"),
        "routeOverlapFillEntryReferenceRootCount": summary.get("routeOverlapFillEntryReferenceRootCount"),
        "fillEntryReferenceSelectors": summary.get("fillEntryReferenceSelectors") or [],
        "fillEntryReferenceNonRouteOnly": summary.get("fillEntryReferenceNonRouteOnly"),
        "fillEntryReferenceExclusionStatus": summary.get("fillEntryReferenceExclusionStatus"),
        "fillEntryReferenceExclusionDetail": summary.get("fillEntryReferenceExclusionDetail"),
        "predecessorFillEntryCandidateFound": summary.get("predecessorFillEntryCandidateFound"),
        "predecessorFillEntryDwordRefCount": summary.get("predecessorFillEntryDwordRefCount"),
        "predecessorFillEntryRootRangeDwordRefCount": summary.get("predecessorFillEntryRootRangeDwordRefCount"),
        "predecessorFillEntryRootBranchTargetCount": summary.get("predecessorFillEntryRootBranchTargetCount"),
        "currentRootFillCount": current_root.get("fillCount"),
        "currentRootAfterFrontierFillCount": sum(1 for row in current_fills if row.get("afterCurrentFrontierReader")),
        "predecessorRootHex": predecessor_root.get("rootHex"),
        "predecessorFillCount": predecessor_root.get("fillCount"),
        "fillEntryReferenceRoots": [
            {
                "selector": row.get("selector"),
                "rootHex": row.get("rootHex"),
                "rootRangeHex": row.get("rootRangeHex"),
                "fieldMaps": row.get("fieldMaps") or [],
                "routeMapOverlap": row.get("routeMapOverlap") or [],
                "fillEntryDwordRefCount": row.get("fillEntryDwordRefCount"),
                "fillEntryRootRangeDwordRefCount": row.get("fillEntryRootRangeDwordRefCount"),
                "fillEntryRootBranchTargetCount": row.get("fillEntryRootBranchTargetCount"),
                "fillEntryCandidateFound": row.get("fillEntryCandidateFound"),
                "firstFillEntryDwordRef": row.get("firstFillEntryDwordRef"),
            }
            for row in summary.get("fillEntryReferenceRoots") or []
        ],
        "routeOverlapRoots": [
            {
                "rootHex": row.get("rootHex"),
                "fillCount": row.get("fillCount"),
                "fillEntryDwordRefCount": row.get("fillEntryDwordRefCount"),
                "fillEntryRootRangeDwordRefCount": row.get("fillEntryRootRangeDwordRefCount"),
                "fillEntryRootBranchTargetCount": row.get("fillEntryRootBranchTargetCount"),
                "fillEntryCandidateFound": row.get("fillEntryCandidateFound"),
                "routeRelevance": row.get("routeRelevance") or [],
            }
            for row in route_roots
        ],
        "conclusion": summary.get("conclusion"),
    }


def secondary_fill_roots_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"roots={evidence.get('rootCount')} "
        f"routeOverlap={evidence.get('routeOverlapRootCount')} "
        f"entryRefs={evidence.get('fillEntryReferenceRootCount')} "
        f"routeEntryRefs={evidence.get('routeOverlapFillEntryReferenceRootCount')} "
        f"entrySelectors={','.join(evidence.get('fillEntryReferenceSelectors') or []) or '-'} "
        f"entryNonRouteOnly={evidence.get('fillEntryReferenceNonRouteOnly')} "
        f"entryExclusion={evidence.get('fillEntryReferenceExclusionStatus')} "
        f"predRoot={evidence.get('predecessorRootHex')} "
        f"predFills={evidence.get('predecessorFillCount')} "
        f"predEntry={evidence.get('predecessorFillEntryCandidateFound')} "
        f"predEntryRefs={evidence.get('predecessorFillEntryDwordRefCount')} "
        f"predRootRefs={evidence.get('predecessorFillEntryRootRangeDwordRefCount')} "
        f"predBranchTargets={evidence.get('predecessorFillEntryRootBranchTargetCount')} "
        f"currentAfter={evidence.get('currentRootAfterFrontierFillCount')} "
        f"frontier={evidence.get('frontierReaderHex')}"
    )


def inherited_state_candidates_for(summary: dict | None) -> dict | None:
    if not summary:
        return None
    best = summary.get("bestPrevious") or {}
    return {
        "currentSelector": summary.get("currentSelector"),
        "currentRootHex": summary.get("currentRootHex"),
        "candidateCount": len(summary.get("candidates") or []),
        "bestPreviousSelector": best.get("selector"),
        "bestPreviousRootHex": best.get("rootHex"),
        "bestPreviousScore": best.get("score"),
        "bestPreviousSecondaryFillCount": best.get("secondaryFillCount"),
        "bestPreviousFirstFillVas": [row.get("vaHex") for row in best.get("firstFills") or []],
        "bestPreviousIntroducedMaps": best.get("introducedMaps") or [],
        "bestPreviousSharedMapCount": len(best.get("sharedMaps") or []),
        "conclusion": summary.get("conclusion"),
    }


def inherited_state_candidates_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    fills = ",".join(evidence.get("bestPreviousFirstFillVas") or []) or "-"
    return (
        f"current={evidence.get('currentSelector')} "
        f"best={evidence.get('bestPreviousSelector')} "
        f"root={evidence.get('bestPreviousRootHex')} "
        f"score={evidence.get('bestPreviousScore')} "
        f"fills={evidence.get('bestPreviousSecondaryFillCount')} "
        f"sites={fills} "
        f"introduced={','.join(evidence.get('bestPreviousIntroducedMaps') or []) or '-'}"
    )


def current_state_sources_for(summary: dict | None) -> dict | None:
    if not summary:
        return None
    helper = summary.get("helper") or {}
    branch_operand = next(
        (
            row for row in summary.get("validBeforeFirstFrontierReader") or []
            if (row.get("operandRole") or {}).get("kind") == "branchTargetOperand"
        ),
        {},
    )
    branch_operand_context = (summary.get("branchOperandContexts") or [{}])[0]
    return {
        "rootHex": summary.get("rootHex"),
        "rootRangeHex": summary.get("rootRangeHex"),
        "firstFrontierReaderHex": summary.get("firstFrontierReaderHex"),
        "candidateCount": summary.get("candidateCount"),
        "validBeforeFirstFrontierReaderCount": summary.get("validBeforeFirstFrontierReaderCount"),
        "validBeforeFirstFrontierReaderWithExecutionEvidenceCount": summary.get(
            "validBeforeFirstFrontierReaderWithExecutionEvidenceCount"
        ),
        "validBeforeFirstFrontierReaderNonOperandCount": summary.get("validBeforeFirstFrontierReaderNonOperandCount"),
        "validBeforeFirstFrontierReaderPromotingFillCount": summary.get(
            "validBeforeFirstFrontierReaderPromotingFillCount"
        ),
        "branchOperandCandidateCount": summary.get("branchOperandCandidateCount"),
        "branchOperandSmallScalarCount": summary.get("branchOperandSmallScalarCount"),
        "activationCandidateCount": summary.get("activationCandidateCount"),
        "validActivationCandidateCount": summary.get("validActivationCandidateCount"),
        "outOfRangeActivationCandidateCount": summary.get("outOfRangeActivationCandidateCount"),
        "helperValidCaseRangeHex": helper.get("validCaseRangeHex"),
        "branchOperandVaHex": branch_operand.get("vaHex"),
        "branchOperandOwnerVaHex": (branch_operand.get("operandRole") or {}).get("ownerVaHex"),
        "branchOperandOwnerCondition": branch_operand_context.get("ownerCondition"),
        "branchOperandValueKind": branch_operand_context.get("operandValueKind"),
        "branchOperandPromotesPrimaryFill": branch_operand_context.get("promotesPrimaryFill"),
        "conclusion": summary.get("conclusion"),
    }


def current_state_sources_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"candidates={evidence.get('candidateCount')} "
        f"validBefore={evidence.get('validBeforeFirstFrontierReaderCount')} "
        f"execValid={evidence.get('validBeforeFirstFrontierReaderWithExecutionEvidenceCount')} "
        f"nonOperand={evidence.get('validBeforeFirstFrontierReaderNonOperandCount')} "
        f"promoting={evidence.get('validBeforeFirstFrontierReaderPromotingFillCount')} "
        f"activationValid={evidence.get('validActivationCandidateCount')}/"
        f"{evidence.get('activationCandidateCount')} "
        f"outOfRange={evidence.get('outOfRangeActivationCandidateCount')} "
        f"branchOperand={evidence.get('branchOperandVaHex')} "
        f"owner={evidence.get('branchOperandOwnerVaHex')} "
        f"kind={evidence.get('branchOperandValueKind')}"
    )


def predecessor_tail_reset_for(summary: dict | None) -> dict | None:
    if not summary:
        return None
    if summary.get("predecessorSelector") != "1:0":
        return None
    return {
        "predecessorSelector": summary.get("predecessorSelector"),
        "predecessorRootHex": summary.get("predecessorRootHex"),
        "predecessorRootRangeHex": summary.get("predecessorRootRangeHex"),
        "nextRootSelector": summary.get("nextRootSelector"),
        "nextRootHex": summary.get("nextRootHex"),
        "tailRangeHex": summary.get("tailRangeHex"),
        "predecessorFillVas": summary.get("predecessorFillVas") or [],
        "lastFillVaHex": summary.get("lastFillVaHex"),
        "lastFillValueHex": summary.get("lastFillValueHex"),
        "tailOpcode10RowCount": summary.get("tailOpcode10RowCount"),
        "tailValidSecondaryFillCount": summary.get("tailValidSecondaryFillCount"),
        "localTailResetFound": summary.get("localTailResetFound"),
        "tailCurrentRootRangePointerCount": summary.get("tailCurrentRootRangePointerCount"),
        "tailCurrentRootExactRefCount": summary.get("tailCurrentRootExactRefCount"),
        "tailFrontierLeafRefCount": summary.get("tailFrontierLeafRefCount"),
        "tailCurrentReaderRefCount": summary.get("tailCurrentReaderRefCount"),
        "tailSourceRecordRefCount": summary.get("tailSourceRecordRefCount"),
        "tailTargetRecordRefCount": summary.get("tailTargetRecordRefCount"),
        "tailBranchToCurrentRouteCount": summary.get("tailBranchToCurrentRouteCount"),
        "tailDirectCurrentRouteBridgeFound": summary.get("tailDirectCurrentRouteBridgeFound"),
        "promotionStatus": summary.get("promotionStatus"),
        "remainingProofs": summary.get("remainingProofs") or [],
        "conclusion": summary.get("conclusion"),
    }


def predecessor_tail_reset_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"{evidence.get('predecessorSelector')} tail={evidence.get('tailRangeHex')} "
        f"lastFill={evidence.get('lastFillVaHex')} "
        f"tailOp10={evidence.get('tailOpcode10RowCount')} "
        f"tailValid={evidence.get('tailValidSecondaryFillCount')} "
        f"localReset={evidence.get('localTailResetFound')} "
        f"currentRangePtrs={evidence.get('tailCurrentRootRangePointerCount')} "
        f"routeRefs={evidence.get('tailCurrentRootExactRefCount')}/"
        f"{evidence.get('tailFrontierLeafRefCount')}/"
        f"{evidence.get('tailCurrentReaderRefCount')}/"
        f"{evidence.get('tailSourceRecordRefCount')}/"
        f"{evidence.get('tailTargetRecordRefCount')} "
        f"branchRoute={evidence.get('tailBranchToCurrentRouteCount')} "
        f"tailBridge={evidence.get('tailDirectCurrentRouteBridgeFound')} "
        f"next={evidence.get('nextRootSelector')}"
    )


def branch_state_writers_for(summary: dict | None) -> dict | None:
    if not summary:
        return None
    primary = summary.get("primaryBranchState") or {}
    clusters = summary.get("clusters") or []
    return {
        "baseVaHex": primary.get("baseVaHex"),
        "slots": primary.get("slots"),
        "directWriterCount": primary.get("directWriterCount"),
        "clusterCount": primary.get("clusterCount"),
        "clusterLabels": [row.get("label") for row in clusters],
        "sourceGlobalCount": sum(len(row.get("sourceGlobals") or []) for row in clusters),
        "conclusion": summary.get("conclusion"),
    }


def branch_state_writers_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"primary={evidence.get('baseVaHex')} "
        f"slots={evidence.get('slots')} "
        f"directWriters={evidence.get('directWriterCount')} "
        f"clusters={evidence.get('clusterCount')} "
        f"sourceGlobals={evidence.get('sourceGlobalCount')}"
    )


def branch_state_dispatch_for(summary: dict | None) -> dict | None:
    if not summary:
        return None
    table = summary.get("eventHandlerTable") or {}
    clusters = summary.get("clusters") or []
    return {
        "tableVaHex": table.get("tableVaHex"),
        "entryCount": table.get("entryCount"),
        "dispatcherVaHex": table.get("dispatcherVaHex"),
        "dispatchCallVaHex": table.get("dispatchCallVaHex"),
        "clusterCount": len(clusters),
        "dispatchOpcodes": [
            (row.get("eventHandlerTable") or {}).get("opcodeHex")
            for row in clusters
        ],
        "directRelativeCallRefCount": sum(row.get("directRelativeCallRefCount", 0) for row in clusters),
        "pointerRefCount": sum(row.get("pointerRefCount", 0) for row in clusters),
        "functionStarts": [row.get("functionStartHex") for row in clusters],
        "conclusion": summary.get("conclusion"),
    }


def branch_state_dispatch_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"table={evidence.get('tableVaHex')} "
        f"dispatcher={evidence.get('dispatcherVaHex')} "
        f"opcodes={','.join(evidence.get('dispatchOpcodes') or [])} "
        f"directCalls={evidence.get('directRelativeCallRefCount')} "
        f"ptrRefs={evidence.get('pointerRefCount')}"
    )


def secondary_state_sources_for(summary: dict | None) -> dict | None:
    if not summary:
        return None
    direct = summary.get("secondaryDirectWrites") or {}
    return {
        "rootRangeHex": summary.get("rootRangeHex"),
        "frontierReaderHex": summary.get("frontierReaderHex"),
        "secondaryBranchStateHex": summary.get("secondaryBranchStateHex"),
        "candidateCount": summary.get("candidateCount"),
        "beforeFrontierCount": summary.get("beforeFrontierCount"),
        "validBeforeFrontierCount": summary.get("validBeforeFrontierCount"),
        "validBeforeFrontierNonOperandCount": summary.get("validBeforeFrontierNonOperandCount"),
        "validAfterFrontierCount": summary.get("validAfterFrontierCount"),
        "directWriterCount": direct.get("directWriterCount"),
        "directWriteValueCounts": direct.get("directWriteValueCounts") or {},
        "refKindCounts": direct.get("refKindCounts") or {},
        "conclusion": summary.get("conclusion"),
    }


def secondary_state_sources_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"secondary={evidence.get('secondaryBranchStateHex')} "
        f"candidates={evidence.get('candidateCount')} "
        f"before={evidence.get('beforeFrontierCount')} "
        f"validBefore={evidence.get('validBeforeFrontierCount')} "
        f"validAfter={evidence.get('validAfterFrontierCount')} "
        f"directWriters={evidence.get('directWriterCount')}"
    )


def branch_state_opcode_overlap_for(summary: dict | None) -> dict | None:
    if not summary:
        return None
    return {
        "currentFrontierReaderHex": summary.get("currentFrontierReaderHex"),
        "overlapCount": summary.get("overlapCount"),
        "overlapBeforeCurrentFrontierReaderCount": summary.get("overlapBeforeCurrentFrontierReaderCount"),
        "overlaps": [
            {
                "wordVaHex": row.get("wordVaHex"),
                "opcodeHex": row.get("opcodeHex"),
                "saveSelectorHandlerHex": (row.get("saveSelectorDispatch") or {}).get("handlerVaHex"),
                "eventObjectFunctionHex": row.get("eventObjectFunctionHex"),
                "beforeCurrentFrontierReader": row.get("beforeCurrentFrontierReader"),
            }
            for row in summary.get("rows") or []
        ],
        "conclusion": summary.get("conclusion"),
    }


def branch_state_opcode_overlap_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"reader={evidence.get('currentFrontierReaderHex')} "
        f"overlap={evidence.get('overlapCount')} "
        f"beforeReader={evidence.get('overlapBeforeCurrentFrontierReaderCount')} "
        "saveDispatch=0x00440720 eventDispatch=0x0047f1d8"
    )


def event_object_branch_state_for(
    stream_candidates: dict | None,
    candidate_links: dict | None,
    block_context: dict | None,
) -> dict | None:
    if not (stream_candidates or candidate_links or block_context):
        return None
    return {
        "candidateCount": (stream_candidates or {}).get("candidateCount"),
        "candidateCountsByIndex": (stream_candidates or {}).get("candidateCountsByIndex") or {},
        "candidateCountsByConfidence": (stream_candidates or {}).get("candidateCountsByConfidence") or {},
        "mediumCandidateCount": (candidate_links or {}).get("mediumCandidateCount"),
        "currentRouteLinkedCount": (candidate_links or {}).get("currentRouteLinkedCount"),
        "currentRouteRangeHitCount": (candidate_links or {}).get("currentRouteRangeHitCount"),
        "currentSelectorRootRangeCandidateCount": (candidate_links or {}).get("currentSelectorRootRangeCandidateCount"),
        "currentRouteLeafRangeCandidateCount": (candidate_links or {}).get("currentRouteLeafRangeCandidateCount"),
        "currentRouteSceneRecordRangeCandidateCount": (candidate_links or {}).get("currentRouteSceneRecordRangeCandidateCount"),
        "routeMapContainerCandidateCount": (candidate_links or {}).get("routeMapContainerCandidateCount"),
        "emptySelectorContainerCandidateCount": (candidate_links or {}).get("emptySelectorContainerCandidateCount"),
        "currentSelectorRootRangeHex": (candidate_links or {}).get("currentSelectorRootRangeHex"),
        "currentRouteLeafStreamRangeHex": (candidate_links or {}).get("currentRouteLeafStreamRangeHex"),
        "currentRouteSceneRecordRangeHex": (candidate_links or {}).get("currentRouteSceneRecordRangeHex"),
        "nearbyCnsCandidateCount": (block_context or {}).get("nearbyCnsCandidateCount"),
        "menuLikeCandidateCount": (block_context or {}).get("menuLikeCandidateCount"),
        "contextCandidateCount": (block_context or {}).get("candidateCount"),
        "conclusion": (block_context or candidate_links or stream_candidates).get("conclusion"),
    }


def event_object_branch_state_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"raw={evidence.get('candidateCount')} "
        f"medium={evidence.get('mediumCandidateCount')} "
        f"linked={evidence.get('currentRouteLinkedCount')} "
        f"rangeHits={evidence.get('currentRouteRangeHitCount')} "
        f"routeContainers={evidence.get('routeMapContainerCandidateCount')} "
        f"emptyContainers={evidence.get('emptySelectorContainerCandidateCount')} "
        f"nearbyCns={evidence.get('nearbyCnsCandidateCount')} "
        f"menuLike={evidence.get('menuLikeCandidateCount')}"
    )


def selection_buffer_bases_for(summary: dict | None) -> dict | None:
    if not summary:
        return None
    static_e8_ea = [
        row for row in summary.get("gateAddressRows") or []
        if row.get("offsetHex") in {"0xe8", "0xea"}
        and row.get("staticAddress")
        and row.get("directDwordRefCount", 0) > 0
    ]
    return {
        "contextFieldHex": summary.get("contextFieldHex"),
        "immediateAssignmentCount": summary.get("immediateAssignmentCount"),
        "registerAssignmentCount": summary.get("registerAssignmentCount"),
        "knownStaticGateOffsetDirectRefCount": summary.get("knownStaticGateOffsetDirectRefCount"),
        "runtimePointerModeStillRequired": summary.get("runtimePointerModeStillRequired"),
        "promotionStatus": summary.get("promotionStatus"),
        "immediateBases": sorted({row.get("baseHex") for row in summary.get("immediateAssignments") or []}),
        "registerBaseExpressions": [
            row.get("baseExpression")
            for row in summary.get("registerAssignments") or []
        ],
        "staticGateOffsetDirectRefCount": len(static_e8_ea),
        "conclusion": summary.get("conclusion"),
    }


def selection_buffer_bases_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"context={evidence.get('contextFieldHex')} "
        f"imm={evidence.get('immediateAssignmentCount')} "
        f"reg={evidence.get('registerAssignmentCount')} "
        f"staticGateRefs={evidence.get('knownStaticGateOffsetDirectRefCount')} "
        f"runtimePointer={evidence.get('runtimePointerModeStillRequired')}"
    )


def post_gate_reset_for(source: str, target: str, post_gate_reset: dict | None) -> dict | None:
    if not post_gate_reset:
        return None
    if post_gate_reset.get("source") != source or post_gate_reset.get("target") != target:
        return None
    return {
        "postGateTraceStartHex": post_gate_reset.get("postGateTraceStartHex"),
        "opcode24BoundaryVaHex": post_gate_reset.get("opcode24BoundaryVaHex"),
        "dispatchStopVaHex": post_gate_reset.get("dispatchStopVaHex"),
        "postGateOpcode10RowCount": post_gate_reset.get("postGateOpcode10RowCount"),
        "validPostGateSecondaryResetCount": post_gate_reset.get("validPostGateSecondaryResetCount"),
        "invalidPostGateOpcode10RowCount": post_gate_reset.get("invalidPostGateOpcode10RowCount"),
        "postGateHelperArgs": [
            row.get("helperArgumentHex")
            for row in post_gate_reset.get("postGateOpcode10Rows") or []
        ],
        "postGateRowsPromoteRoute": post_gate_reset.get("postGateRowsPromoteRoute"),
        "promotionStatus": post_gate_reset.get("promotionStatus"),
        "conclusion": post_gate_reset.get("conclusion"),
    }


def post_gate_reset_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"postGateOp10={evidence.get('postGateOpcode10RowCount')} "
        f"validReset={evidence.get('validPostGateSecondaryResetCount')} "
        f"helperArgs={','.join(evidence.get('postGateHelperArgs') or []) or '-'} "
        f"opcode24={evidence.get('opcode24BoundaryVaHex')} "
        f"promotes={evidence.get('postGateRowsPromoteRoute')}"
    )


def predecessor_state_effect_for(source: str, target: str, effect: dict | None) -> dict | None:
    if not effect:
        return None
    if effect.get("predecessorSelector") != "1:0" or effect.get("currentSelector") != "2:0":
        return None
    return {
        "predecessorSelector": effect.get("predecessorSelector"),
        "predecessorRootHex": effect.get("predecessorRootHex"),
        "predecessorFillVas": effect.get("predecessorFillVas") or [],
        "fillValueHex": effect.get("fillValueHex"),
        "fillMeaning": effect.get("fillMeaning"),
        "currentSelector": effect.get("currentSelector"),
        "currentWriterVaHex": effect.get("currentWriterVaHex"),
        "currentReaderVaHex": effect.get("currentReaderVaHex"),
        "secondaryBranchStateAfterFill": effect.get("secondaryBranchStateAfterFill") or [],
        "allStartsPassReader": effect.get("allStartsPassReader"),
        "promotionStatus": effect.get("promotionStatus"),
        "remainingBlockers": effect.get("remainingBlockers") or [],
        "conclusion": effect.get("conclusion"),
    }


def predecessor_state_effect_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    table = evidence.get("secondaryBranchStateAfterFill") or []
    table_brief = ",".join(str(value) for value in table[:4])
    if len(table) > 4:
        table_brief += ",..."
    fills = ",".join(evidence.get("predecessorFillVas") or []) or "-"
    return (
        f"{evidence.get('predecessorSelector')} fill={evidence.get('fillValueHex')} "
        f"sites={fills} table=[{table_brief}] "
        f"reader={evidence.get('currentReaderVaHex')} "
        f"allStartsPass={evidence.get('allStartsPassReader')} "
        f"status={evidence.get('promotionStatus')}"
    )


def synthetic_savedata_probe_for(source: str, target: str, probe: dict | None) -> dict | None:
    if not probe:
        return None
    if probe.get("source") != source or probe.get("target") != target:
        return None
    return {
        "kind": probe.get("kind"),
        "fileName": probe.get("fileName"),
        "selector": probe.get("selector"),
        "selectedPointerHex": probe.get("selectedPointerHex"),
        "rowPointerHex": probe.get("rowPointerHex"),
        "tile": probe.get("tile") or {},
        "containsRoutePair": probe.get("containsRoutePair"),
        "notCapturedSave": probe.get("notCapturedSave"),
        "notRuntimeTrace": probe.get("notRuntimeTrace"),
        "notRoutePromotionProof": probe.get("notRoutePromotionProof"),
        "routePromotionStatus": probe.get("routePromotionStatus"),
        "promotionStatus": probe.get("promotionStatus"),
        "proofFound": probe.get("proofFound"),
        "syntheticSavedataProbeProofFound": probe.get("syntheticSavedataProbeProofFound"),
        "failedSyntheticSavedataGateIds": probe.get("failedSyntheticSavedataGateIds") or [],
        "missingEvidence": probe.get("missingEvidence") or [],
        "evidenceRefs": probe.get("evidenceRefs") or [],
        "evidenceRefCount": probe.get("evidenceRefCount"),
        "browserUrl": probe.get("browserUrl"),
        "conclusion": probe.get("conclusion"),
    }


def synthetic_savedata_probe_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    tile = evidence.get("tile") or {}
    return (
        f"{evidence.get('selector')} selected={evidence.get('selectedPointerHex')} "
        f"tile={tile.get('x')},{tile.get('y')} "
        f"routePair={evidence.get('containsRoutePair')} "
        f"notProof={evidence.get('notRoutePromotionProof')} "
        f"proofFound={evidence.get('proofFound')} "
        f"probeProof={evidence.get('syntheticSavedataProbeProofFound')} "
        f"failedGates={','.join(evidence.get('failedSyntheticSavedataGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus') or evidence.get('routePromotionStatus')}"
    )


def real_savedata_evidence_gap_for(source: str, target: str, gap: dict | None) -> dict | None:
    if not gap:
        return None
    if gap.get("source") != source or gap.get("target") != target:
        return None
    public_notes = gap.get("publicSearchNotes") or []
    return {
        "realCandidateCount": gap.get("realCandidateCount"),
        "validRealCandidateCount": gap.get("validRealCandidateCount"),
        "validRealUniqueSha256Count": gap.get("validRealUniqueSha256Count"),
        "validRealDuplicateGroupCount": gap.get("validRealDuplicateGroupCount"),
        "validRealCandidateRows": gap.get("validRealCandidateRows") or [],
        "validRealCandidateBlockReasonCounts": gap.get("validRealCandidateBlockReasonCounts") or {},
        "validRealCandidatesAllBlocked": gap.get("validRealCandidatesAllBlocked"),
        "currentSelectorRealSaveCount": gap.get("currentSelectorRealSaveCount"),
        "selectedPointerRealSaveCount": gap.get("selectedPointerRealSaveCount"),
        "routePairRealSaveCount": gap.get("routePairRealSaveCount"),
        "routePromotionRealSaveCount": gap.get("routePromotionRealSaveCount"),
        "proofFound": gap.get("proofFound"),
        "routeEvidenceProofFound": gap.get("routeEvidenceProofFound"),
        "routeEvidenceRejectionClassification": gap.get("routeEvidenceRejectionClassification"),
        "realSavedataRouteEvidenceRejection": gap.get("realSavedataRouteEvidenceRejection") or {},
        "realSelector20SaveFound": gap.get("realSelector20SaveFound"),
        "realSelector20CapturedCurrentSelectorSaveCount": gap.get(
            "realSelector20CapturedCurrentSelectorSaveCount"
        ),
        "realSelector20CapturedSourceOnlySaveCount": gap.get("realSelector20CapturedSourceOnlySaveCount"),
        "realSelector20CapturedTargetOnlySaveCount": gap.get("realSelector20CapturedTargetOnlySaveCount"),
        "realSelector20CapturedRoutePairSaveCount": gap.get("realSelector20CapturedRoutePairSaveCount"),
        "workspaceDatFileCount": gap.get("workspaceDatFileCount"),
        "workspaceExpectedSizeDatFileCount": gap.get("workspaceExpectedSizeDatFileCount"),
        "workspaceZipDatMemberCount": gap.get("workspaceZipDatMemberCount"),
        "workspaceHiddenExpectedSizeDatFileCount": gap.get("workspaceHiddenExpectedSizeDatFileCount"),
        "promotionGateChecklist": gap.get("promotionGateChecklist") or [],
        "failedSavedataGateIds": gap.get("failedSavedataGateIds") or [],
        "missingEvidence": gap.get("missingEvidence") or [],
        "realSelectorDistribution": gap.get("realSelectorDistribution") or [],
        "capturedRoutePairGap": gap.get("capturedRoutePairGap") or {},
        "requiredByteCoverage": gap.get("requiredByteCoverage") or {},
        "requiredSelectorBytePairRealSaveCount": (
            gap.get("requiredSelectorBytePairRealSaveCount")
            if gap.get("requiredSelectorBytePairRealSaveCount") is not None
            else (gap.get("requiredByteCoverage") or {}).get("requiredSelectorBytePairRealSaveCount")
        ),
        "requiredCaptureChecklist": gap.get("requiredCaptureChecklist") or {},
        "browserScanPatterns": gap.get("browserScanPatterns") or [],
        "webScanUrl": gap.get("webScanUrl"),
        "terminalScanCommand": gap.get("terminalScanCommand"),
        "syntheticDiagnosticExcluded": gap.get("syntheticDiagnosticExcluded"),
        "publicCurrentFrontierCovered": gap.get("publicCurrentFrontierCovered"),
        "publicRoutePairCovered": gap.get("publicRoutePairCovered"),
        "publicSearchNoteCount": len(public_notes),
        "latestPublicSearchNote": public_notes[-1] if public_notes else None,
        "evidenceRefs": gap.get("evidenceRefs") or [],
        "evidenceRefCount": gap.get("evidenceRefCount"),
        "promotionStatus": gap.get("promotionStatus"),
        "conclusion": gap.get("conclusion"),
    }


def real_savedata_evidence_gap_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"real={evidence.get('realCandidateCount')} "
        f"valid={evidence.get('validRealCandidateCount')} "
        f"uniqueSha256={evidence.get('validRealUniqueSha256Count')} "
        f"validRowsBlocked={evidence.get('validRealCandidatesAllBlocked')} "
        f"realCandidateBlocks={evidence.get('validRealCandidateBlockReasonCounts')} "
        f"current={evidence.get('currentSelectorRealSaveCount')} "
        f"selectedPointer={evidence.get('selectedPointerRealSaveCount')} "
        f"routePair={evidence.get('routePairRealSaveCount')} "
        f"routeProof={evidence.get('routePromotionRealSaveCount')} "
        f"proofFound={evidence.get('proofFound')} "
        f"routeEvidenceProof={evidence.get('routeEvidenceProofFound')} "
        f"realSelector20Save={evidence.get('realSelector20SaveFound')} "
        f"reject={evidence.get('routeEvidenceRejectionClassification')} "
        f"capturedSplit="
        f"{(evidence.get('capturedRoutePairGap') or {}).get('sourceOnlyCount')}/"
        f"{(evidence.get('capturedRoutePairGap') or {}).get('targetOnlyCount')}/"
        f"{(evidence.get('capturedRoutePairGap') or {}).get('routePairCount')} "
        f"requiredBytePair={evidence.get('requiredSelectorBytePairRealSaveCount')} "
        f"workspace={evidence.get('workspaceDatFileCount')}/"
        f"{evidence.get('workspaceExpectedSizeDatFileCount')} "
        f"zipMembers={evidence.get('workspaceZipDatMemberCount')} "
        f"hidden={evidence.get('workspaceHiddenExpectedSizeDatFileCount')} "
        f"syntheticExcluded={evidence.get('syntheticDiagnosticExcluded')} "
        f"failedSavedataGates={','.join(evidence.get('failedSavedataGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"publicCurrent={evidence.get('publicCurrentFrontierCovered')} "
        f"publicSearchNoteCount={evidence.get('publicSearchNoteCount')} "
        f"latestPublicSearchNote={evidence.get('latestPublicSearchNote')} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def runtime_source_save_load_variant_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    load = evidence.get("loadVariant") or {}
    coordinate = evidence.get("coordinateLoad") or {}
    exit_path = evidence.get("exitPath") or {}
    adaptive = evidence.get("adaptiveExit") or {}
    adaptive_trail = evidence.get("adaptiveTrailStart") or {}
    ready_paths = evidence.get("readyPathSummary") or {}
    diversion = evidence.get("diversionSelectorContext") or {}
    return (
        f"class={evidence.get('classification')} "
        f"proofFound={evidence.get('proofFound')} "
        f"sourceSaveLoadProof={evidence.get('runtimeSourceSaveLoadVariantProofFound')} "
        f"failedGates={','.join(evidence.get('failedRuntimeSourceSaveLoadVariantGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"loadSource={load.get('sourceSaveObserved')} "
        f"coordSourceStart={coordinate.get('sourceSaveObserved')}/"
        f"{coordinate.get('sourceStartTileObserved')} "
        f"exitSource={exit_path.get('sourceSaveObserved')} "
        f"exitSelectors={','.join(exit_path.get('observedSelectors') or []) or '-'} "
        f"exitPublic={','.join(exit_path.get('observedPublicSaveSelectors') or []) or '-'} "
        f"exitRouteCurrent={exit_path.get('anyReachedRouteSelectorContext')}/"
        f"{exit_path.get('anyReachedCurrentRoot')} "
        f"adaptiveReady={adaptive.get('sourceReadyCount')} "
        f"adaptiveTrailReady={adaptive_trail.get('sourceReadyCount')} "
        f"readyDivert={ready_paths.get('diversionClassification')} "
        f"readyPaths={ready_paths.get('readyPathCount')}/"
        f"{ready_paths.get('routeOrCurrentReadyPathCount')}/"
        f"{ready_paths.get('candidateOrOutsideReadyPathCount')} "
        f"firstNonSource={ready_paths.get('dominantNonRouteSelector')} "
        f"diversionContext={diversion.get('classification')} "
        f"diversionSelector={diversion.get('selector')} "
        f"diversionMaps={','.join(diversion.get('fieldMaps') or []) or '-'} "
        f"diversionAdjacency={diversion.get('sceneAdjacencyRowCount')}/"
        f"{diversion.get('sceneAdjacencySelectorOnlyPairCount')}/"
        f"{diversion.get('sceneAdjacencyStrictEventBackedCount')}/"
        f"{diversion.get('sceneAdjacencyConfirmedReviewBackedCount')} "
        f"diversionCurrentProof={diversion.get('selectedPointerPathSelectsOrStoresCurrentCount')} "
        f"strictProof={evidence.get('strictSourceHotspotProofFound')} "
        f"selectedRootProof={evidence.get('selectedRootExecutionProofFound')} "
        f"status={evidence.get('promotionStatus')}"
    )


def selection_buffer20_provenance_for(source: str, target: str, provenance: dict | None) -> dict | None:
    if not provenance:
        return None
    if provenance.get("source") != source or provenance.get("target") != target:
        return None
    brief = provenance.get("brief") or {}
    current = provenance.get("currentRoot") or {}
    source_side = provenance.get("sourceSideRoot") or {}
    predecessor = provenance.get("predecessorRoot") or {}
    nearest = (provenance.get("currentLocalWriters") or {}).get("nearestCurrentWriter") or {}
    reader = provenance.get("frontierReader") or {}
    return {
        "writerCountFor0x20": provenance.get("writerCountFor0x20"),
        "readerCountFor0x20": provenance.get("readerCountFor0x20"),
        "writerRootCount": provenance.get("writerRootCount"),
        "readerRootCount": provenance.get("readerRootCount"),
        "currentSelector": brief.get("currentSelector") or ",".join(current.get("labels") or []),
        "currentRootHex": current.get("rootHex"),
        "currentWriterCount": current.get("writerCount"),
        "currentReaderCount": current.get("readerCount"),
        "currentContainsRoutePair": current.get("containsRoutePair"),
        "sourceSideSelector": brief.get("sourceSideSelector") or ",".join(source_side.get("labels") or []),
        "sourceSideRootHex": source_side.get("rootHex"),
        "sourceSideWriterCount": source_side.get("writerCount"),
        "sourceSideReaderCount": source_side.get("readerCount"),
        "predecessorSelector": brief.get("predecessorSelector") or ",".join(predecessor.get("labels") or []),
        "predecessorRootHex": predecessor.get("rootHex"),
        "predecessorWriterCount": predecessor.get("writerCount"),
        "predecessorReaderCount": predecessor.get("readerCount"),
        "nearestCurrentWriter": nearest.get("writerVaHex"),
        "frontierReader": reader.get("readerVaHex"),
        "promotionStatus": provenance.get("promotionStatus"),
        "conclusion": provenance.get("conclusion"),
    }


def selection_buffer20_provenance_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"current={evidence.get('currentSelector')} {evidence.get('currentRootHex')} "
        f"writers={evidence.get('currentWriterCount')} readers={evidence.get('currentReaderCount')} "
        f"roots={evidence.get('writerRootCount')}/{evidence.get('readerRootCount')} "
        f"nearest={evidence.get('nearestCurrentWriter')} "
        f"frontier={evidence.get('frontierReader')} "
        f"sourceRoot={evidence.get('sourceSideSelector')} "
        f"predecessor={evidence.get('predecessorSelector')} "
        f"status={evidence.get('promotionStatus')}"
    )


def selected_pointer_usage_for(usage: dict | None) -> dict | None:
    if not usage:
        return None
    if usage.get("currentSelector") != "2:0" or usage.get("currentSelectorRootHex") != "0x00540714":
        return None
    values = {
        row.get("name"): row
        for row in usage.get("watchValues") or []
    }
    hooks = usage.get("runtimeTraceHookPoints") or []
    return {
        "selectedPointerGlobalHex": usage.get("selectedPointerGlobalHex"),
        "selectorGroupTableHex": usage.get("selectorGroupTableHex"),
        "currentSelector": usage.get("currentSelector"),
        "currentSelectorRootHex": usage.get("currentSelectorRootHex"),
        "currentCodeRefCount": usage.get("currentCodeRefCount"),
        "noStaticDirectCurrentSelectorCodeRef": usage.get("noStaticDirectCurrentSelectorCodeRef"),
        "selectedPointerGlobalTextRefCount": usage.get("selectedPointerGlobalTextRefCount"),
        "currentSelectorRootTextRefCount": (values.get("current-selector-root-2:0") or {}).get("textRefCount"),
        "currentSecondLevelTableHex": (values.get("current-second-level-table-2:0") or {}).get("valueHex"),
        "currentSecondLevelTableTextRefCount": (values.get("current-second-level-table-2:0") or {}).get("textRefCount"),
        "currentFrontierReaderRefCount": (values.get("current-frontier-reader-2:0") or {}).get("refCount"),
        "currentSourceRecordRefCount": (values.get("current-source-record-map1_01a") or {}).get("refCount"),
        "currentTargetRecordRefCount": (values.get("current-target-record-map2_02d") or {}).get("refCount"),
        "runtimeTraceHookPointCount": len(hooks),
        "runtimeTraceHookPointVas": [row.get("vaHex") for row in hooks if row.get("vaHex")],
        "selectedPointerWriterHookCount": usage.get("selectedPointerWriterHookCount"),
        "selectedPointerReaderHookCount": usage.get("selectedPointerReaderHookCount"),
        "selectedPointerWriteMechanisms": usage.get("selectedPointerWriteMechanisms") or [],
        "selectedPointerReadMechanisms": usage.get("selectedPointerReadMechanisms") or [],
        "opcode8SelectedPointerReadHex": next(
            (
                row.get("vaHex")
                for row in hooks
                if row.get("access") == "read" and "opcode 8 reads selected-pointer" in (row.get("meaning") or "")
            ),
            None,
        ),
        "routePromotionStatus": usage.get("routePromotionStatus"),
        "promotionStatus": usage.get("promotionStatus"),
        "proofFound": usage.get("proofFound"),
        "selectedPointerUsageProofFound": usage.get("selectedPointerUsageProofFound"),
        "failedSelectedPointerUsageGateIds": usage.get("failedSelectedPointerUsageGateIds") or [],
        "missingEvidence": usage.get("missingEvidence") or [],
        "evidenceRefs": usage.get("evidenceRefs") or [],
        "evidenceRefCount": usage.get("evidenceRefCount"),
        "nextEvidenceNeeded": usage.get("nextEvidenceNeeded") or [],
        "conclusion": usage.get("conclusion"),
    }


def selected_pointer_usage_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    hooks = ",".join(evidence.get("runtimeTraceHookPointVas") or [])
    return (
        f"global={evidence.get('selectedPointerGlobalHex')} "
        f"groupTable={evidence.get('selectorGroupTableHex')} "
        f"current={evidence.get('currentSelector')} "
        f"root={evidence.get('currentSelectorRootHex')} "
        f"globalTextRefs={evidence.get('selectedPointerGlobalTextRefCount')} "
        f"currentCodeRefs={evidence.get('currentCodeRefCount')} "
        f"rootTextRefs={evidence.get('currentSelectorRootTextRefCount')} "
        f"level2={evidence.get('currentSecondLevelTableHex')} "
        f"level2TextRefs={evidence.get('currentSecondLevelTableTextRefCount')} "
        f"readerRefs={evidence.get('currentFrontierReaderRefCount')} "
        f"sourceRefs={evidence.get('currentSourceRecordRefCount')} "
        f"targetRefs={evidence.get('currentTargetRecordRefCount')} "
        f"hooks={evidence.get('runtimeTraceHookPointCount')}[{hooks}] "
        f"writerHooks={evidence.get('selectedPointerWriterHookCount')} "
        f"readerHooks={evidence.get('selectedPointerReaderHookCount')} "
        f"opcode8Read={evidence.get('opcode8SelectedPointerReadHex')} "
        f"proofFound={evidence.get('proofFound')} "
        f"usageProof={evidence.get('selectedPointerUsageProofFound')} "
        f"failedGates={','.join(evidence.get('failedSelectedPointerUsageGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus') or evidence.get('routePromotionStatus')}"
    )


def data_descriptor_opcode_map_for(source: str, target: str, descriptor_map: dict | None) -> dict | None:
    if not descriptor_map:
        return None
    if descriptor_map.get("source") != source or descriptor_map.get("target") != target:
        return None
    return {
        "routeAndWrapperShareE8Descriptor": descriptor_map.get("routeAndWrapperShareE8Descriptor"),
        "directLeafUsesDistinctDescriptor": descriptor_map.get("directLeafUsesDistinctDescriptor"),
        "predecessorRootStopIsDataDescriptor": descriptor_map.get("predecessorRootStopIsDataDescriptor"),
        "predecessorFillStopIsDataDescriptor": descriptor_map.get("predecessorFillStopIsDataDescriptor"),
        "d0DescriptorSharedHandlerOpcodes": descriptor_map.get("d0DescriptorSharedHandlerOpcodes") or [],
        "d0DescriptorTableAlignedRefIndexes": descriptor_map.get("d0DescriptorTableAlignedRefIndexes") or [],
        "d0DescriptorPointerRefSections": descriptor_map.get("d0DescriptorPointerRefSections") or [],
        "c0DescriptorSharedHandlerOpcodes": descriptor_map.get("c0DescriptorSharedHandlerOpcodes") or [],
        "c0DescriptorTableAlignedRefIndexes": descriptor_map.get("c0DescriptorTableAlignedRefIndexes") or [],
        "c0DescriptorPointerRefSections": descriptor_map.get("c0DescriptorPointerRefSections") or [],
        "e8DescriptorSharedHandlerOpcodes": descriptor_map.get("e8DescriptorSharedHandlerOpcodes") or [],
        "e8DescriptorTableAlignedRefIndexes": descriptor_map.get("e8DescriptorTableAlignedRefIndexes") or [],
        "e8DescriptorPointerRefSections": descriptor_map.get("e8DescriptorPointerRefSections") or [],
        "payloadDirectlyTargetsLeafTable": descriptor_map.get("payloadDirectlyTargetsLeafTable"),
        "payloadGraphComponentCount": descriptor_map.get("payloadGraphComponentCount"),
        "payloadGraphAllEdgesLocal": descriptor_map.get("payloadGraphAllEdgesLocal"),
        "payloadGraphReachesFrontierTarget": descriptor_map.get("payloadGraphReachesFrontierTarget"),
        "promotionStatus": descriptor_map.get("promotionStatus"),
        "conclusion": descriptor_map.get("conclusion"),
    }


def data_descriptor_opcode_map_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"e8Shared={evidence.get('routeAndWrapperShareE8Descriptor')} "
        f"opcodes={','.join(evidence.get('e8DescriptorSharedHandlerOpcodes') or []) or '-'} "
        f"aligned={','.join(evidence.get('e8DescriptorTableAlignedRefIndexes') or []) or '-'} "
        f"refs={','.join(evidence.get('e8DescriptorPointerRefSections') or []) or '-'} "
        f"directLeafDistinct={evidence.get('directLeafUsesDistinctDescriptor')} "
        f"predRootDescriptor={evidence.get('predecessorRootStopIsDataDescriptor')} "
        f"d0Ops={','.join(evidence.get('d0DescriptorSharedHandlerOpcodes') or []) or '-'} "
        f"d0Refs={','.join(evidence.get('d0DescriptorPointerRefSections') or []) or '-'} "
        f"predFillDescriptor={evidence.get('predecessorFillStopIsDataDescriptor')} "
        f"c0Ops={','.join(evidence.get('c0DescriptorSharedHandlerOpcodes') or []) or '-'} "
        f"c0Refs={','.join(evidence.get('c0DescriptorPointerRefSections') or []) or '-'} "
        f"payloadTargetsLeaf={evidence.get('payloadDirectlyTargetsLeafTable')} "
        f"payloadGraph={evidence.get('payloadGraphComponentCount')} "
        f"payloadLocal={evidence.get('payloadGraphAllEdgesLocal')} "
        f"payloadGraphFrontier={evidence.get('payloadGraphReachesFrontierTarget')} "
        f"status={evidence.get('promotionStatus')}"
    )


def opcode24_payload_table_for(source: str, target: str, payload_table: dict | None) -> dict | None:
    if not payload_table:
        return None
    if payload_table.get("source") != source or payload_table.get("target") != target:
        return None
    return {
        "opcode24VaHex": payload_table.get("opcode24VaHex"),
        "dispatchStopVaHex": payload_table.get("dispatchStopVaHex"),
        "payloadWindowHex": payload_table.get("payloadWindowHex"),
        "leafTableWindowStartHex": payload_table.get("leafTableWindowStartHex"),
        "rootTablePointerHex": payload_table.get("rootTablePointerHex"),
        "wrapperLeafHex": payload_table.get("wrapperLeafHex"),
        "frontierLeafHex": payload_table.get("frontierLeafHex"),
        "frontierReaderHex": payload_table.get("frontierReaderHex"),
        "payloadPointerCount": payload_table.get("payloadPointerCount"),
        "leafTablePointerCount": payload_table.get("leafTablePointerCount"),
        "payloadGraphEdgeCount": payload_table.get("payloadGraphEdgeCount"),
        "payloadGraphComponentCount": payload_table.get("payloadGraphComponentCount"),
        "payloadGraphExternalEdgeCount": payload_table.get("payloadGraphExternalEdgeCount"),
        "payloadGraphAllEdgesLocal": payload_table.get("payloadGraphAllEdgesLocal"),
        "payloadGraphReachesFrontierTarget": payload_table.get("payloadGraphReachesFrontierTarget"),
        "closureReachesFrontierTarget": payload_table.get("closureReachesFrontierTarget"),
        "payloadDirectlyTargetsLeafTable": payload_table.get("payloadDirectlyTargetsLeafTable"),
        "promotionStatus": payload_table.get("promotionStatus"),
        "conclusion": payload_table.get("conclusion"),
    }


def opcode24_payload_table_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"op24={evidence.get('opcode24VaHex')} "
        f"stop={evidence.get('dispatchStopVaHex')} "
        f"window={evidence.get('payloadWindowHex')} "
        f"leafStart={evidence.get('leafTableWindowStartHex')} "
        f"root={evidence.get('rootTablePointerHex')} "
        f"wrapper={evidence.get('wrapperLeafHex')} "
        f"frontier={evidence.get('frontierLeafHex')} "
        f"reader={evidence.get('frontierReaderHex')} "
        f"ptrs={evidence.get('payloadPointerCount')} "
        f"leafPtrs={evidence.get('leafTablePointerCount')} "
        f"graph={evidence.get('payloadGraphEdgeCount')}/{evidence.get('payloadGraphComponentCount')} "
        f"external={evidence.get('payloadGraphExternalEdgeCount')} "
        f"local={evidence.get('payloadGraphAllEdgesLocal')} "
        f"reachesFrontier={evidence.get('payloadGraphReachesFrontierTarget')} "
        f"closureFrontier={evidence.get('closureReachesFrontierTarget')} "
        f"directLeafTable={evidence.get('payloadDirectlyTargetsLeafTable')} "
        f"status={evidence.get('promotionStatus')}"
    )


def wrapper_descriptor_context_for(source: str, target: str, wrapper: dict | None) -> dict | None:
    if not wrapper:
        return None
    if wrapper.get("source") != source or wrapper.get("target") != target:
        return None
    return {
        "rootTablePointerHex": wrapper.get("rootTablePointerHex"),
        "currentRootEntryRunHex": wrapper.get("currentRootEntryRunHex"),
        "wrapperDescriptorHex": wrapper.get("wrapperDescriptorHex"),
        "wrapperEntryHex": wrapper.get("wrapperEntryHex"),
        "wrapperChildPointerHex": wrapper.get("wrapperChildPointerHex"),
        "frontierLeafHex": wrapper.get("frontierLeafHex"),
        "currentRootDescriptorCount": wrapper.get("currentRootDescriptorCount"),
        "wrapperEntryRefCount": wrapper.get("wrapperEntryRefCount"),
        "wrapperEntryCurrentRootRangeRefCount": wrapper.get("wrapperEntryCurrentRootRangeRefCount"),
        "wrapperEntryPromotingRefCount": wrapper.get("wrapperEntryPromotingRefCount"),
        "wrapperRefBeforeCurrentRoot": wrapper.get("wrapperRefBeforeCurrentRoot"),
        "currentRootReferencesWrapper": wrapper.get("currentRootReferencesWrapper"),
        "frontierLeafDirectCurrentRootRef": wrapper.get("frontierLeafDirectCurrentRootRef"),
        "wrapperChildIsFrontierLeaf": wrapper.get("wrapperChildIsFrontierLeaf"),
        "promotionStatus": wrapper.get("promotionStatus"),
        "conclusion": wrapper.get("conclusion"),
    }


def wrapper_descriptor_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"rootRun={evidence.get('currentRootEntryRunHex')} "
        f"entry={evidence.get('wrapperEntryHex')} "
        f"wrapper={evidence.get('wrapperDescriptorHex')} "
        f"child={evidence.get('wrapperChildPointerHex')} "
        f"entryRefs={evidence.get('wrapperEntryRefCount')} "
        f"entryRootRefs={evidence.get('wrapperEntryCurrentRootRangeRefCount')} "
        f"entryPromotes={evidence.get('wrapperEntryPromotingRefCount')} "
        f"beforeRoot={evidence.get('wrapperRefBeforeCurrentRoot')} "
        f"rootRefsWrapper={evidence.get('currentRootReferencesWrapper')} "
        f"frontierDirect={evidence.get('frontierLeafDirectCurrentRootRef')} "
        f"descriptors={evidence.get('currentRootDescriptorCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def opcode24_globals_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    mode2_context = evidence.get("mode2WriterContext") or {}
    impact = mode2_context.get("promotionImpact") or "mode2-adjacent-only"
    return (
        f"range={evidence.get('neighborhoodRangeHex')} "
        f"mode1 reads/writes={evidence.get('mode1NeighborhoodDirectReadCount')}/"
        f"{evidence.get('mode1NeighborhoodDirectWriteCount')} "
        f"mode2 writes={evidence.get('mode2DirectWriteCount')} "
        f"mode1Hole={evidence.get('mode1DirectWriteHoleBetweenNeighborWrites')} "
        f"nearestWrites={evidence.get('mode1NearestLowerDirectWriteHex')}/"
        f"{evidence.get('mode1NearestHigherDirectWriteHex')} "
        f"mode2CopiesObjectIndex={mode2_context.get('copiesCurrentRuntimeObjectIndex')} "
        f"status=mode1-unwritten; {impact}"
    )


def resource_ref_scan_for(source: str, target: str, resource_scan: dict | None) -> dict | None:
    if not resource_scan:
        return None
    if resource_scan.get("source") != source or resource_scan.get("target") != target:
        return None
    current = resource_scan.get("currentFrontierReference") or {}
    return {
        "resourceReferenceCount": resource_scan.get("resourceReferenceCount"),
        "sourceReferenceCount": resource_scan.get("sourceReferenceCount"),
        "targetReferenceCount": resource_scan.get("targetReferenceCount"),
        "pointCandidateCount": resource_scan.get("pointCandidateCount"),
        "pointCandidateClassCounts": resource_scan.get("pointCandidateClassCounts"),
        "routeExitPointCandidateCount": resource_scan.get("routeExitPointCandidateCount"),
        "strictSourceTargetCandidateCount": resource_scan.get("strictSourceTargetCandidateCount"),
        "currentFrontierReferenceFound": resource_scan.get("currentFrontierReferenceFound"),
        "currentFrontierReferenceHex": current.get("refVaHex"),
        "currentFrontierNearbyMaps": current.get("nearbyMapResources") or [],
        "currentFrontierPointCandidateClassCounts": resource_scan.get(
            "currentFrontierPointCandidateClassCounts"
        ),
        "currentFrontierRouteExitPointHitCount": resource_scan.get(
            "currentFrontierRouteExitPointHitCount"
        ),
        "promotionStatus": resource_scan.get("promotionStatus"),
        "conclusion": resource_scan.get("conclusion"),
    }


def resource_ref_scan_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"refs={evidence.get('resourceReferenceCount')} "
        f"source/target={evidence.get('sourceReferenceCount')}/{evidence.get('targetReferenceCount')} "
        f"pointCandidates={evidence.get('pointCandidateCount')} "
        f"routeExitHits={evidence.get('routeExitPointCandidateCount')} "
        f"strict={evidence.get('strictSourceTargetCandidateCount')} "
        f"frontierClasses={evidence.get('currentFrontierPointCandidateClassCounts')} "
        f"frontierRouteHits={evidence.get('currentFrontierRouteExitPointHitCount')} "
        f"frontierRef={evidence.get('currentFrontierReferenceHex')} "
        f"status={evidence.get('promotionStatus')}"
    )


def hotspot_gap_for(source: str, target: str, hotspot_gap: dict | None) -> dict | None:
    if not hotspot_gap:
        return None
    if hotspot_gap.get("map") != source or hotspot_gap.get("target") != target:
        return None
    resource_scan = hotspot_gap.get("resourceRefScan") or {}
    target_context = hotspot_gap.get("targetContext") or {}
    current = target_context.get("currentFrontierContext") or {}
    cluster_start = current.get("clusterStartHex")
    cluster_end = current.get("clusterEndHex")
    return {
        "strictHotspotFound": hotspot_gap.get("strictHotspotFound"),
        "eventTransitionCount": hotspot_gap.get("eventTransitionCount"),
        "coordinateCandidateCount": hotspot_gap.get("coordinateCandidateCount"),
        "extractionGapCount": hotspot_gap.get("extractionGapCount"),
        "manifestPointPromotableSourceCount": hotspot_gap.get("manifestPointPromotableSourceCount"),
        "manifestPointIncomingCount": hotspot_gap.get("manifestPointIncomingCount"),
        "resourceReferenceCount": resource_scan.get("resourceReferenceCount"),
        "resourcePointCandidateCount": resource_scan.get("pointCandidateCount"),
        "resourceRouteExitPointCandidateCount": resource_scan.get("routeExitPointCandidateCount"),
        "resourceStrictSourceTargetCandidateCount": resource_scan.get("strictSourceTargetCandidateCount"),
        "currentFrontierReferenceFound": resource_scan.get("currentFrontierReferenceFound"),
        "currentFrontierReferenceHex": resource_scan.get("currentFrontierReferenceHex"),
        "targetContextCount": target_context.get("contextCount"),
        "targetStrictEventContextCount": target_context.get("strictEventContextCount"),
        "targetSelectorOnlyContextCount": target_context.get("selectorOnlyContextCount"),
        "currentFrontierClusterRangeHex": (
            f"{cluster_start}..{cluster_end}" if cluster_start and cluster_end else None
        ),
        "currentFrontierClassification": current.get("classification"),
        "currentFrontierManifestMapCount": current.get("manifestMapCount"),
        "currentFrontierHasPair": current.get("hasCurrentFrontierPair"),
        "saveSelectorFrontierTargets": hotspot_gap.get("saveSelectorFrontierTargets") or [],
        "promotionStatus": hotspot_gap.get("promotionStatus"),
        "conclusion": hotspot_gap.get("conclusion"),
    }


def hotspot_gap_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"strictHotspot={evidence.get('strictHotspotFound')} "
        f"events={evidence.get('eventTransitionCount')} "
        f"coords={evidence.get('coordinateCandidateCount')} "
        f"extractionGaps={evidence.get('extractionGapCount')} "
        f"manifestIncoming={evidence.get('manifestPointIncomingCount')} "
        f"promotable={evidence.get('manifestPointPromotableSourceCount')} "
        f"resourceRefs={evidence.get('resourceReferenceCount')} "
        f"resourcePoints={evidence.get('resourcePointCandidateCount')} "
        f"routeExitPoints={evidence.get('resourceRouteExitPointCandidateCount')} "
        f"resourceStrict={evidence.get('resourceStrictSourceTargetCandidateCount')} "
        f"targetContexts={evidence.get('targetContextCount')} "
        f"strictTargetContexts={evidence.get('targetStrictEventContextCount')} "
        f"selectorOnlyContexts={evidence.get('targetSelectorOnlyContextCount')} "
        f"frontier={evidence.get('currentFrontierClusterRangeHex')} "
        f"class={evidence.get('currentFrontierClassification')} "
        f"pair={evidence.get('currentFrontierHasPair')} "
        f"status={evidence.get('promotionStatus')}"
    )


def scene_payload_context_for(source: str, target: str, scene_payload: dict | None) -> dict | None:
    if not scene_payload:
        return None
    if scene_payload.get("source") != source or scene_payload.get("target") != target:
        return None
    payloads = scene_payload.get("payloads") or []
    in_bounds = 0
    raw_points = 0
    text_refs = 0
    promotion_payloads = 0
    for payload in payloads:
        point_scan = payload.get("pointScan") or {}
        in_bounds += point_scan.get("inBoundsPointCount", 0)
        raw_points += point_scan.get("rawPointCount", 0)
        text_refs += payload.get("rangeTextRefCount", 0)
        if payload.get("promotionEvidence"):
            promotion_payloads += 1
    return {
        "sourceRecordVaHex": scene_payload.get("sourceRecordVaHex"),
        "targetRecordVaHex": scene_payload.get("targetRecordVaHex"),
        "payloadCount": len(payloads),
        "rawPointCount": raw_points,
        "inBoundsPointCount": in_bounds,
        "rangeTextRefCount": text_refs,
        "promotionPayloadCount": promotion_payloads,
        "strictHotspotFound": scene_payload.get("strictHotspotFound"),
        "promotionStatus": scene_payload.get("promotionStatus"),
        "conclusion": scene_payload.get("conclusion"),
    }


def scene_payload_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"sourceRecord={evidence.get('sourceRecordVaHex')} "
        f"targetRecord={evidence.get('targetRecordVaHex')} "
        f"payloads={evidence.get('payloadCount')} "
        f"inBounds={evidence.get('inBoundsPointCount')} "
        f"textRefs={evidence.get('rangeTextRefCount')} "
        f"promotions={evidence.get('promotionPayloadCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def scene_list_context_for(source: str, target: str, scene_list: dict | None) -> dict | None:
    if not scene_list:
        return None
    current = scene_list.get("currentFrontier") or {}
    if current.get("source") != source or current.get("target") != target:
        for row in scene_list.get("rows") or []:
            if row.get("source") == source and row.get("target") == target:
                current = row
                break
        else:
            return None
    branch = (current.get("branchSteps") or [{}])[0]
    source_record = branch.get("nearestSourceRecordAfterBranch") or {}
    target_record = branch.get("nearestTargetRecordAfterBranch") or {}
    return {
        "selectorOnlySceneList": current.get("selectorOnlySceneList"),
        "branchStreamVaHex": branch.get("streamVaHex"),
        "branchTargetKind": branch.get("branchTargetKind"),
        "branchTargetIsResource": branch.get("branchTargetIsResource"),
        "fallthroughLooksExecutable": branch.get("fallthroughLooksExecutable"),
        "classification": branch.get("classification"),
        "nearestSourceRecordHex": source_record.get("recordVaHex"),
        "nearestTargetRecordHex": target_record.get("recordVaHex"),
        "sourceRecordCount": len(current.get("sourceRecords") or []),
        "targetRecordCount": len(current.get("targetRecords") or []),
        "proofFound": current.get("proofFound", scene_list.get("proofFound")),
        "sceneListResourceGateProofFound": current.get(
            "sceneListResourceGateProofFound",
            scene_list.get("sceneListResourceGateProofFound"),
        ),
        "strictTransitionProofFound": current.get(
            "strictTransitionProofFound",
            scene_list.get("strictTransitionProofFound"),
        ),
        "failedSceneListGateIds": (
            current.get("failedSceneListGateIds")
            or scene_list.get("failedSceneListGateIds")
            or []
        ),
        "missingEvidence": current.get("missingEvidence") or scene_list.get("missingEvidence") or [],
        "remainingProofs": current.get("remainingProofs") or scene_list.get("remainingProofs") or [],
        "evidenceRefs": current.get("evidenceRefs") or scene_list.get("evidenceRefs") or [],
        "evidenceRefCount": current.get("evidenceRefCount") or scene_list.get("evidenceRefCount"),
        "promotionStatus": current.get("promotionStatus") or scene_list.get("promotionStatus"),
        "conclusion": current.get("conclusion") or scene_list.get("conclusion"),
    }


def scene_list_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"branch={evidence.get('branchStreamVaHex')} "
        f"target={evidence.get('branchTargetKind')} "
        f"resource={evidence.get('branchTargetIsResource')} "
        f"class={evidence.get('classification')} "
        f"sourceRecord={evidence.get('nearestSourceRecordHex')} "
        f"targetRecord={evidence.get('nearestTargetRecordHex')} "
        f"proofFound={evidence.get('proofFound')} "
        "failedGates="
        f"{','.join(evidence.get('failedSceneListGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def value_kind_label(kind: dict | None) -> str:
    kind = kind or {}
    return kind.get("cns") or kind.get("targetVaHex") or kind.get("kind") or "-"


def frontier_reader_branch_context_for(source: str, target: str, context: dict | None) -> dict | None:
    if not context:
        return None
    if context.get("source") != source or context.get("target") != target:
        return None
    pass_outcome = context.get("passOutcome") or {}
    fail_outcome = context.get("failOutcome") or {}
    return {
        "readerVaHex": context.get("readerVaHex"),
        "readerValueHex": context.get("readerValueHex"),
        "readerHandlerVaHex": context.get("readerHandlerVaHex"),
        "condition": context.get("condition"),
        "selectionBufferOffsetHex": context.get("selectionBufferOffsetHex"),
        "stateTable": context.get("stateTable"),
        "routePairCorrectedTraceReachesReaderCount": context.get("routePairCorrectedTraceReachesReaderCount"),
        "routePairDescriptorCount": context.get("routePairDescriptorCount"),
        "predecessorHypothesisSelector": context.get("predecessorHypothesisSelector"),
        "predecessorHypothesisFillHex": context.get("predecessorHypothesisFillHex"),
        "predecessorAllStartsPassReader": context.get("predecessorAllStartsPassReader"),
        "priorSelectionBufferStillPrimaryBlocker": context.get("priorSelectionBufferStillPrimaryBlocker"),
        "predecessorHypothesisOutcome": context.get("predecessorHypothesisOutcome"),
        "passOutcomeNextStreamVaHex": pass_outcome.get("nextStreamVaHex"),
        "passOutcomeValueHex": pass_outcome.get("valueHex"),
        "passOutcomeKind": value_kind_label(pass_outcome.get("valueKind")),
        "passOutcomeLooksExecutable": pass_outcome.get("looksExecutable"),
        "passOutcomePayloadClassification": pass_outcome.get("payloadClassification"),
        "passOutcomePayloadPromotionEvidence": pass_outcome.get("payloadPromotionEvidence"),
        "passOutcomePayloadInBoundsPointCount": pass_outcome.get("payloadInBoundsPointCount"),
        "passOutcomePayloadRangeTextRefCount": pass_outcome.get("payloadRangeTextRefCount"),
        "failOutcomeTargetVaHex": fail_outcome.get("targetVaHex"),
        "failOutcomeKind": value_kind_label(fail_outcome.get("valueKind")),
        "failOutcomeTargetIsResource": fail_outcome.get("targetIsResource"),
        "failOutcomeTargetIsFieldMap": fail_outcome.get("targetIsFieldMap"),
        "siblingGateCountBeforeSourceRecord": context.get("siblingGateCountBeforeSourceRecord"),
        "siblingResourceGateCount": context.get("siblingResourceGateCount"),
        "siblingFieldMapTargetCount": context.get("siblingFieldMapTargetCount"),
        "siblingExecutableFallthroughCount": context.get("siblingExecutableFallthroughCount"),
        "classification": context.get("classification"),
        "proofFound": context.get("proofFound"),
        "frontierReaderRuntimeProofFound": context.get("frontierReaderRuntimeProofFound"),
        "frontierReaderStrictHotspotProofFound": context.get("frontierReaderStrictHotspotProofFound"),
        "failedFrontierReaderGateIds": context.get("failedFrontierReaderGateIds") or [],
        "missingEvidence": context.get("missingEvidence") or [],
        "evidenceRefs": context.get("evidenceRefs") or [],
        "evidenceRefCount": context.get("evidenceRefCount"),
        "strictHotspotFound": context.get("strictHotspotFound"),
        "runtimeSelectionProven": context.get("runtimeSelectionProven"),
        "promotionStatus": context.get("promotionStatus"),
        "remainingProofs": context.get("remainingProofs") or [],
        "conclusion": context.get("conclusion"),
    }


def frontier_reader_branch_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"reader={evidence.get('readerVaHex')} "
        f"condition={evidence.get('condition')} "
        f"traces={evidence.get('routePairCorrectedTraceReachesReaderCount')}/"
        f"{evidence.get('routePairDescriptorCount')} "
        f"pred={evidence.get('predecessorHypothesisSelector')} "
        f"fill={evidence.get('predecessorHypothesisFillHex')} "
        f"allPass={evidence.get('predecessorAllStartsPassReader')} "
        f"outcome={evidence.get('predecessorHypothesisOutcome')} "
        f"pass={evidence.get('passOutcomeNextStreamVaHex')}->{evidence.get('passOutcomeValueHex')} "
        f"class={evidence.get('passOutcomePayloadClassification')} "
        f"passPromotes={evidence.get('passOutcomePayloadPromotionEvidence')} "
        f"inBounds={evidence.get('passOutcomePayloadInBoundsPointCount')} "
        f"fail={evidence.get('failOutcomeTargetVaHex')} "
        f"failKind={evidence.get('failOutcomeKind')} "
        f"failFieldMap={evidence.get('failOutcomeTargetIsFieldMap')} "
        f"siblings={evidence.get('siblingGateCountBeforeSourceRecord')} "
        f"resourceSiblings={evidence.get('siblingResourceGateCount')} "
        f"fieldMapSiblings={evidence.get('siblingFieldMapTargetCount')} "
        f"runtime={evidence.get('runtimeSelectionProven')} "
        f"strict={evidence.get('strictHotspotFound')} "
        f"proofFound={evidence.get('proofFound')} "
        "failedGates="
        f"{','.join(evidence.get('failedFrontierReaderGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def frontier_payload_shape_for(source: str, target: str, payload_shape: dict | None) -> dict | None:
    if not payload_shape:
        return None
    if payload_shape.get("source") != source or payload_shape.get("target") != target:
        return None
    rows = []
    for row in payload_shape.get("rows") or []:
        payload = row.get("payload") or {}
        point_scan = payload.get("pointScan") or {}
        first_rects = payload.get("firstRects") or []
        rows.append({
            "branchVaHex": row.get("branchVaHex"),
            "selectionBufferOffsetHex": row.get("selectionBufferOffsetHex"),
            "resourceCns": row.get("resourceCns"),
            "resourceKind": row.get("resourceKind"),
            "resourceWidth": row.get("resourceWidth"),
            "resourceHeight": row.get("resourceHeight"),
            "payloadVaHex": row.get("payloadVaHex"),
            "classification": row.get("classification"),
            "promotionEvidence": row.get("promotionEvidence"),
            "rectSampleCount": payload.get("rectSampleCount"),
            "contiguousValidImageRectCount": payload.get("contiguousValidImageRectCount"),
            "allContiguousRectsMultipleOf16": payload.get("allContiguousRectsMultipleOf16"),
            "rawPointCount": point_scan.get("rawPointCount"),
            "inBoundsPointCount": point_scan.get("inBoundsPointCount"),
            "rangeTextRefCount": payload.get("rangeTextRefCount"),
            "firstRect": first_rects[0] if first_rects else None,
        })
    return {
        "readerVaHex": payload_shape.get("readerVaHex"),
        "readerPassPayloadVaHex": payload_shape.get("readerPassPayloadVaHex"),
        "gateCount": payload_shape.get("gateCount"),
        "resourceImageGateCount": payload_shape.get("resourceImageGateCount"),
        "rectLikePayloadGateCount": payload_shape.get("rectLikePayloadGateCount"),
        "allPayloadsFitPairedImages": payload_shape.get("allPayloadsFitPairedImages"),
        "sourceInBoundsPointCount": payload_shape.get("sourceInBoundsPointCount"),
        "payloadTextRefCount": payload_shape.get("payloadTextRefCount"),
        "proofFound": payload_shape.get("proofFound"),
        "frontierPayloadHotspotProofFound": payload_shape.get("frontierPayloadHotspotProofFound"),
        "failedFrontierPayloadGateIds": payload_shape.get("failedFrontierPayloadGateIds") or [],
        "missingEvidence": payload_shape.get("missingEvidence") or [],
        "remainingProofs": payload_shape.get("remainingProofs") or [],
        "evidenceRefs": payload_shape.get("evidenceRefs") or [],
        "evidenceRefCount": payload_shape.get("evidenceRefCount"),
        "strictHotspotFound": payload_shape.get("strictHotspotFound"),
        "promotionStatus": payload_shape.get("promotionStatus"),
        "rows": rows,
        "conclusion": payload_shape.get("conclusion"),
    }


def frontier_payload_shape_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    row_bits = []
    for row in evidence.get("rows") or []:
        resource = row.get("resourceCns") or "-"
        payload = row.get("payloadVaHex") or "-"
        rects = row.get("contiguousValidImageRectCount")
        points = row.get("inBoundsPointCount")
        row_bits.append(f"{resource}:{payload}:{rects}rects/{points}points")
    return (
        f"reader={evidence.get('readerVaHex')} "
        f"passPayload={evidence.get('readerPassPayloadVaHex')} "
        f"rectLike={evidence.get('rectLikePayloadGateCount')}/{evidence.get('gateCount')} "
        f"imageGates={evidence.get('resourceImageGateCount')} "
        f"allFitImages={evidence.get('allPayloadsFitPairedImages')} "
        f"inBounds={evidence.get('sourceInBoundsPointCount')} "
        f"textRefs={evidence.get('payloadTextRefCount')} "
        f"rows={';'.join(row_bits) or '-'} "
        f"strict={evidence.get('strictHotspotFound')} "
        f"proofFound={evidence.get('proofFound')} "
        "failedGates="
        f"{','.join(evidence.get('failedFrontierPayloadGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def scene_adjacency_index_for(source: str, target: str, adjacency: dict | None) -> dict | None:
    if not adjacency:
        return None
    current = adjacency.get("currentPair") or {}
    if current.get("source") != source or current.get("target") != target:
        return None
    return {
        "selectorLeafCount": adjacency.get("selectorLeafCount"),
        "fieldMapReferenceCount": adjacency.get("fieldMapReferenceCount"),
        "adjacentOccurrenceCount": adjacency.get("adjacentOccurrenceCount"),
        "uniqueDirectedAdjacentPairCount": adjacency.get("uniqueDirectedAdjacentPairCount"),
        "strictEventEdgeCount": adjacency.get("strictEventEdgeCount"),
        "confirmedReviewEdgeCount": adjacency.get("confirmedReviewEdgeCount"),
        "adjacentPairsWithStrictEventCount": adjacency.get("adjacentPairsWithStrictEventCount"),
        "adjacentPairsWithConfirmedReviewCount": adjacency.get("adjacentPairsWithConfirmedReviewCount"),
        "adjacentPairsWithoutStrictOrConfirmedCount": adjacency.get("adjacentPairsWithoutStrictOrConfirmedCount"),
        "currentPairOccurrenceCount": adjacency.get("currentPairOccurrenceCount"),
        "currentPairStrictEventBacked": adjacency.get("currentPairStrictEventBacked"),
        "currentPairConfirmedReviewBacked": adjacency.get("currentPairConfirmedReviewBacked"),
        "currentPairSelectorAdjacencyOnly": adjacency.get("currentPairSelectorAdjacencyOnly"),
        "currentPairSelectors": current.get("selectors") or [],
        "currentPairLeafPointers": current.get("leafPointers") or [],
        "currentPairSourceRecords": current.get("sourceRecords") or [],
        "currentPairTargetRecords": current.get("targetRecords") or [],
        "proofFound": adjacency.get("proofFound"),
        "sceneAdjacencyStrictProofFound": adjacency.get("sceneAdjacencyStrictProofFound"),
        "failedSceneAdjacencyGateIds": adjacency.get("failedSceneAdjacencyGateIds") or [],
        "missingEvidence": adjacency.get("missingEvidence") or [],
        "remainingProofs": adjacency.get("remainingProofs") or [],
        "evidenceRefs": adjacency.get("evidenceRefs") or [],
        "evidenceRefCount": adjacency.get("evidenceRefCount"),
        "promotionStatus": adjacency.get("promotionStatus"),
        "conclusion": adjacency.get("conclusion"),
    }


def scene_adjacency_index_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"leaves={evidence.get('selectorLeafCount')} "
        f"refs={evidence.get('fieldMapReferenceCount')} "
        f"adjOcc={evidence.get('adjacentOccurrenceCount')} "
        f"uniquePairs={evidence.get('uniqueDirectedAdjacentPairCount')} "
        f"strictOverlap={evidence.get('adjacentPairsWithStrictEventCount')} "
        f"confirmedOverlap={evidence.get('adjacentPairsWithConfirmedReviewCount')} "
        f"selectorOnly={evidence.get('adjacentPairsWithoutStrictOrConfirmedCount')} "
        f"currentOcc={evidence.get('currentPairOccurrenceCount')} "
        f"currentStrict={evidence.get('currentPairStrictEventBacked')} "
        f"currentConfirmed={evidence.get('currentPairConfirmedReviewBacked')} "
        f"currentSelectorOnly={evidence.get('currentPairSelectorAdjacencyOnly')} "
        f"proofFound={evidence.get('proofFound')} "
        "failedGates="
        f"{','.join(evidence.get('failedSceneAdjacencyGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')}"
    )


def exit_target_ranking_for(source: str, target: str, ranking: dict | None) -> dict | None:
    if not ranking:
        return None
    if ranking.get("source") != source or ranking.get("blockedTarget") != target:
        return None
    exits = ranking.get("exits") or []
    blocked_target_candidates = ranking.get("blockedTargetCandidates") or []
    selector_outgoing_candidates = ranking.get("selectorOutgoingCandidates") or []
    selector_target_candidates = ranking.get("selectorTargetCandidates") or []
    confirmed_incoming_reviews = ranking.get("confirmedIncomingReviews") or []
    remaining_proofs = ranking.get("remainingProofs") or []
    return {
        "proofFound": ranking.get("proofFound"),
        "exitTargetRankingProofFound": ranking.get("exitTargetRankingProofFound"),
        "failedExitTargetRankingGateIds": ranking.get("failedExitTargetRankingGateIds") or [],
        "missingEvidence": ranking.get("missingEvidence") or [],
        "evidenceRefs": ranking.get("evidenceRefs") or [],
        "evidenceRefCount": ranking.get("evidenceRefCount"),
        "exitCount": ranking.get("exitCount"),
        "exits": exits,
        "blockedTargetExitCount": ranking.get("blockedTargetExitCount"),
        "blockedTargetCandidates": blocked_target_candidates,
        "autoBlockedTargetExitCount": ranking.get("autoBlockedTargetExitCount"),
        "blockedTargetReturnOverlapExitCount": ranking.get("blockedTargetReturnOverlapExitCount"),
        "blockedTargetReciprocalExitCount": ranking.get("blockedTargetReciprocalExitCount"),
        "blockedTargetCoordinateLikeHitCount": ranking.get("blockedTargetCoordinateLikeHitCount"),
        "coordinatePromotableCount": ranking.get("coordinatePromotableCount"),
        "selectorOutgoingCandidateCount": ranking.get("selectorOutgoingCandidateCount"),
        "selectorOutgoingCandidates": selector_outgoing_candidates,
        "selectorTargetCandidates": selector_target_candidates,
        "selectorOutgoingTargets": ranking.get("selectorOutgoingTargets") or [],
        "selectorOutgoingStrictBackedCount": ranking.get("selectorOutgoingStrictBackedCount"),
        "selectorOutgoingConfirmedBackedCount": ranking.get("selectorOutgoingConfirmedBackedCount"),
        "selectorOutgoingOnlyCount": ranking.get("selectorOutgoingOnlyCount"),
        "blockedTargetSelectorOccurrenceCount": ranking.get("blockedTargetSelectorOccurrenceCount"),
        "returnTargetSelectorOccurrenceCount": ranking.get("returnTargetSelectorOccurrenceCount"),
        "confirmedIncomingCount": ranking.get("confirmedIncomingCount"),
        "confirmedIncomingReviews": confirmed_incoming_reviews,
        "remainingProofCount": len(remaining_proofs),
        "remainingProofs": remaining_proofs,
        "promotionStatus": ranking.get("promotionStatus"),
        "conclusion": ranking.get("conclusion"),
    }


def exit_target_ranking_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"rows={len(evidence.get('exits') or [])}/"
        f"{len(evidence.get('blockedTargetCandidates') or [])}/"
        f"{len(evidence.get('selectorOutgoingCandidates') or [])}/"
        f"{len(evidence.get('confirmedIncomingReviews') or [])}/"
        f"{evidence.get('remainingProofCount')} "
        f"exits={evidence.get('exitCount')} "
        f"blockedExits={evidence.get('blockedTargetExitCount')} "
        f"autoBlocked={evidence.get('autoBlockedTargetExitCount')} "
        f"returnOverlap={evidence.get('blockedTargetReturnOverlapExitCount')} "
        f"reciprocal={evidence.get('blockedTargetReciprocalExitCount')} "
        f"coordLike={evidence.get('blockedTargetCoordinateLikeHitCount')} "
        f"coordPromotable={evidence.get('coordinatePromotableCount')} "
        f"outgoing={evidence.get('selectorOutgoingCandidateCount')} "
        f"targets={','.join(evidence.get('selectorOutgoingTargets') or []) or '-'} "
        f"strictBacked={evidence.get('selectorOutgoingStrictBackedCount')} "
        f"confirmedBacked={evidence.get('selectorOutgoingConfirmedBackedCount')} "
        f"selectorOnly={evidence.get('selectorOutgoingOnlyCount')} "
        f"blockedOcc={evidence.get('blockedTargetSelectorOccurrenceCount')} "
        f"returnOcc={evidence.get('returnTargetSelectorOccurrenceCount')} "
        f"incomingConfirmed={evidence.get('confirmedIncomingCount')} "
        f"proofFound={evidence.get('proofFound')} "
        "failedGates="
        f"{','.join(evidence.get('failedExitTargetRankingGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def leaf_table_context_for(leaf_table: dict | None) -> dict | None:
    if not leaf_table:
        return None
    return {
        "selector": leaf_table.get("selector"),
        "rootHex": leaf_table.get("rootHex"),
        "rootTablePointerHex": leaf_table.get("rootTablePointerHex"),
        "tableWindowHex": leaf_table.get("tableWindowHex"),
        "wrapperLeafHex": leaf_table.get("wrapperLeafHex"),
        "frontierLeafHex": leaf_table.get("frontierLeafHex"),
        "frontierReaderHex": leaf_table.get("frontierReaderHex"),
        "leafRefCount": leaf_table.get("leafRefCount"),
        "frontierLeafRefVaHex": leaf_table.get("frontierLeafRefVaHex"),
        "frontierLeafRefIsDirectRootTableEntry": leaf_table.get("frontierLeafRefIsDirectRootTableEntry"),
        "selectorPathCount": leaf_table.get("selectorPathCount"),
        "runtimeSelectionProven": leaf_table.get("runtimeSelectionProven"),
        "proofFound": leaf_table.get("proofFound"),
        "failedLeafTableGateIds": leaf_table.get("failedLeafTableGateIds") or [],
        "missingEvidence": leaf_table.get("missingEvidence") or [],
        "strictHotspotFound": leaf_table.get("strictHotspotFound"),
        "promotionStatus": leaf_table.get("promotionStatus"),
        "conclusion": leaf_table.get("conclusion"),
    }


def leaf_table_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"table={evidence.get('tableWindowHex')} "
        f"leafRefs={evidence.get('leafRefCount')} "
        f"wrapper={evidence.get('wrapperLeafHex')} "
        f"frontier={evidence.get('frontierLeafHex')} "
        f"directEntry={evidence.get('frontierLeafRefIsDirectRootTableEntry')} "
        f"runtimeSelection={evidence.get('runtimeSelectionProven')} "
        f"proofFound={evidence.get('proofFound')} "
        f"failedLeafTableGates={','.join(evidence.get('failedLeafTableGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"strict={evidence.get('strictHotspotFound')} "
        f"status={evidence.get('promotionStatus')}"
    )


def leaf_index_space_for(source: str, target: str, leaf_index: dict | None) -> dict | None:
    if not leaf_index:
        return None
    if leaf_index.get("source") != source or leaf_index.get("target") != target:
        return None
    return {
        "selector": leaf_index.get("selector"),
        "rootHex": leaf_index.get("rootHex"),
        "rootTablePointerHex": leaf_index.get("rootTablePointerHex"),
        "tableWindowHex": leaf_index.get("tableWindowHex"),
        "frontierLeafHex": leaf_index.get("frontierLeafHex"),
        "frontierReaderHex": leaf_index.get("frontierReaderHex"),
        "entryCount": leaf_index.get("entryCount"),
        "negativeIndexCount": leaf_index.get("negativeIndexCount"),
        "currentRootEntryCount": leaf_index.get("currentRootEntryCount"),
        "routePairDescriptorCurrentEntryCount": leaf_index.get("routePairDescriptorCurrentEntryCount"),
        "readerBearingCurrentEntryCount": leaf_index.get("readerBearingCurrentEntryCount"),
        "readerBearingNegativeEntryCount": leaf_index.get("readerBearingNegativeEntryCount"),
        "frontierLeafChildEntryIndices": leaf_index.get("frontierLeafChildEntryIndices") or [],
        "frontierLeafChildOnlyNegativeIndex": leaf_index.get("frontierLeafChildOnlyNegativeIndex"),
        "frontierReaderSelectableByNonNegativeIndex": leaf_index.get("frontierReaderSelectableByNonNegativeIndex"),
        "frontierReaderReachableByCorrectedNonNegativeIndex": leaf_index.get(
            "frontierReaderReachableByCorrectedNonNegativeIndex"
        ),
        "routePairCurrentDescriptorIndices": leaf_index.get("routePairCurrentDescriptorIndices") or [],
        "readerBearingNegativeIndices": leaf_index.get("readerBearingNegativeIndices") or [],
        "runtimeSelectionProven": leaf_index.get("runtimeSelectionProven"),
        "proofFound": leaf_index.get("proofFound"),
        "failedLeafIndexGateIds": leaf_index.get("failedLeafIndexGateIds") or [],
        "missingEvidence": leaf_index.get("missingEvidence") or [],
        "strictHotspotFound": leaf_index.get("strictHotspotFound"),
        "promotionStatus": leaf_index.get("promotionStatus"),
        "evidenceRefs": leaf_index.get("evidenceRefs") or [],
        "evidenceRefCount": leaf_index.get("evidenceRefCount"),
        "remainingProofs": leaf_index.get("remainingProofs") or [],
        "conclusion": leaf_index.get("conclusion"),
    }


def leaf_index_space_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"tablePtr={evidence.get('rootTablePointerHex')} "
        f"entries={evidence.get('entryCount')} "
        f"negative={evidence.get('negativeIndexCount')} "
        f"current={evidence.get('currentRootEntryCount')} "
        f"routePairCurrent={evidence.get('routePairDescriptorCurrentEntryCount')} "
        f"readerCurrent={evidence.get('readerBearingCurrentEntryCount')} "
        f"readerNegative={evidence.get('readerBearingNegativeEntryCount')} "
        f"frontierChildIdx={evidence.get('frontierLeafChildEntryIndices')} "
        f"readerNegativeIdx={evidence.get('readerBearingNegativeIndices')} "
        f"routePairIdx={evidence.get('routePairCurrentDescriptorIndices')} "
        f"nonNegativeSelectable={evidence.get('frontierReaderSelectableByNonNegativeIndex')} "
        f"correctedReachable={evidence.get('frontierReaderReachableByCorrectedNonNegativeIndex')} "
        f"runtimeSelection={evidence.get('runtimeSelectionProven')} "
        f"proofFound={evidence.get('proofFound')} "
        f"failedLeafIndexGates={','.join(evidence.get('failedLeafIndexGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def route_pair_descriptor_context_for(source: str, target: str, context: dict | None) -> dict | None:
    if not context:
        return None
    if context.get("source") != source or context.get("target") != target:
        return None
    return {
        "selector": context.get("selector"),
        "rootHex": context.get("rootHex"),
        "rootTablePointerHex": context.get("rootTablePointerHex"),
        "frontierReaderHex": context.get("frontierReaderHex"),
        "currentRoutePairDescriptorCount": context.get("currentRoutePairDescriptorCount"),
        "currentRoutePairDescriptorIndices": context.get("currentRoutePairDescriptorIndices") or [],
        "currentRoutePairDescriptorHexes": context.get("currentRoutePairDescriptorHexes") or [],
        "currentRoutePairNestedFieldMaps": context.get("currentRoutePairNestedFieldMaps") or [],
        "currentRoutePairSceneAdjacentCount": context.get("currentRoutePairSceneAdjacentCount"),
        "currentRoutePairTraceReachesReaderCount": context.get("currentRoutePairTraceReachesReaderCount"),
        "currentRoutePairGeometryExitHitCount": context.get("currentRoutePairGeometryExitHitCount"),
        "readerBearingCurrentEntryCount": context.get("readerBearingCurrentEntryCount"),
        "readerBearingNegativeEntryCount": context.get("readerBearingNegativeEntryCount"),
        "readerBearingNegativeIndices": context.get("readerBearingNegativeIndices") or [],
        "frontierReaderSelectableByNonNegativeIndex": context.get("frontierReaderSelectableByNonNegativeIndex"),
        "runtimeSelectionProven": context.get("runtimeSelectionProven"),
        "strictHotspotFound": context.get("strictHotspotFound"),
        "proofFound": context.get("proofFound"),
        "routePairDescriptorProofFound": context.get("routePairDescriptorProofFound"),
        "failedRoutePairDescriptorGateIds": context.get("failedRoutePairDescriptorGateIds") or [],
        "missingEvidence": context.get("missingEvidence") or [],
        "evidenceRefs": context.get("evidenceRefs") or [],
        "evidenceRefCount": context.get("evidenceRefCount"),
        "promotionStatus": context.get("promotionStatus"),
        "remainingProofs": context.get("remainingProofs") or [],
        "conclusion": context.get("conclusion"),
    }


def route_pair_descriptor_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"currentRoutePair={evidence.get('currentRoutePairDescriptorCount')} "
        f"indices={evidence.get('currentRoutePairDescriptorIndices')} "
        f"sceneAdjacent={evidence.get('currentRoutePairSceneAdjacentCount')} "
        f"readerHits={evidence.get('currentRoutePairTraceReachesReaderCount')} "
        f"geoHits={evidence.get('currentRoutePairGeometryExitHitCount')} "
        f"readerCurrent={evidence.get('readerBearingCurrentEntryCount')} "
        f"readerNegative={evidence.get('readerBearingNegativeEntryCount')} "
        f"readerNegativeIdx={evidence.get('readerBearingNegativeIndices')} "
        f"nonNegativeSelectable={evidence.get('frontierReaderSelectableByNonNegativeIndex')} "
        f"proofFound={evidence.get('proofFound')} "
        f"failedGates={','.join(evidence.get('failedRoutePairDescriptorGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def opcode07_indexed_pointers_for(source: str, target: str, opcode07: dict | None) -> dict | None:
    if not opcode07:
        return None
    if opcode07.get("source") != source or opcode07.get("target") != target:
        return None
    return {
        "rowCount": opcode07.get("rowCount"),
        "validTableRowCount": opcode07.get("validTableRowCount"),
        "opcode07IndexMode": opcode07.get("opcode07IndexMode"),
        "selectedLeafTableWindowSlotCount": opcode07.get("selectedLeafTableWindowSlotCount"),
        "selectedNegativeRootEntrySlotCount": opcode07.get("selectedNegativeRootEntrySlotCount"),
        "selectedCurrentRootEntrySlotCount": opcode07.get("selectedCurrentRootEntrySlotCount"),
        "selectedWrapperEntrySlotCount": opcode07.get("selectedWrapperEntrySlotCount"),
        "directFrontierTargetCount": opcode07.get("directFrontierTargetCount"),
        "leafTableWindowStartHex": opcode07.get("leafTableWindowStartHex"),
        "leafTableWindowHex": opcode07.get("leafTableWindowHex"),
        "rootTablePointerHex": opcode07.get("rootTablePointerHex"),
        "wrapperEntryHex": opcode07.get("wrapperEntryHex"),
        "wrapperLeafHex": opcode07.get("wrapperLeafHex"),
        "frontierLeafHex": opcode07.get("frontierLeafHex"),
        "frontierReaderHex": opcode07.get("frontierReaderHex"),
        "promotionStatus": opcode07.get("promotionStatus"),
        "conclusion": opcode07.get("conclusion"),
    }


def opcode07_indexed_pointers_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"rows={evidence.get('rowCount')} "
        f"valid={evidence.get('validTableRowCount')} "
        f"indexMode={evidence.get('opcode07IndexMode')} "
        f"leafSlots={evidence.get('selectedLeafTableWindowSlotCount')} "
        f"negativeSlots={evidence.get('selectedNegativeRootEntrySlotCount')} "
        f"wrapperEntrySlots={evidence.get('selectedWrapperEntrySlotCount')} "
        f"directFrontier={evidence.get('directFrontierTargetCount')} "
        f"table={evidence.get('leafTableWindowStartHex')} "
        f"entry={evidence.get('wrapperEntryHex')} "
        f"wrapper={evidence.get('wrapperLeafHex')} "
        f"frontier={evidence.get('frontierLeafHex')} "
        f"status={evidence.get('promotionStatus')}"
    )


def object61_stream_operands_for(source: str, target: str, operands: dict | None) -> dict | None:
    if not operands:
        return None
    if operands.get("source") != source or operands.get("target") != target:
        return None
    branch_rows = operands.get("branchCapableRows") or []
    first_branch = branch_rows[0] if branch_rows else {}
    return {
        "objectHandlerOpcodeCount": operands.get("objectHandlerOpcodeCount"),
        "routeOperandRowCount": operands.get("routeOperandRowCount"),
        "branchCapableRowCount": operands.get("branchCapableRowCount"),
        "directFrontierOperandCount": operands.get("directFrontierOperandCount"),
        "branchFrontierOperandCount": operands.get("branchFrontierOperandCount"),
        "branchOperandVaHex": first_branch.get("wordVaHex"),
        "branchOperandValueMeaning": first_branch.get("valueMeaning"),
        "branchOperandNextDwordHex": first_branch.get("nextDwordHex"),
        "promotionStatus": operands.get("promotionStatus"),
        "conclusion": operands.get("conclusion"),
    }


def object61_stream_operands_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"handlers={evidence.get('objectHandlerOpcodeCount')} "
        f"rows={evidence.get('routeOperandRowCount')} "
        f"branchRows={evidence.get('branchCapableRowCount')} "
        f"directFrontier={evidence.get('directFrontierOperandCount')} "
        f"branchFrontier={evidence.get('branchFrontierOperandCount')} "
        f"branch={evidence.get('branchOperandVaHex')} "
        f"next={evidence.get('branchOperandNextDwordHex')} "
        f"meaning={evidence.get('branchOperandValueMeaning')} "
        f"status={evidence.get('promotionStatus')}"
    )


def context58_consumers_for(source: str, target: str, consumers: dict | None) -> dict | None:
    if not consumers:
        return None
    if consumers.get("source") != source or consumers.get("target") != target:
        return None
    return {
        "context58RefCount": consumers.get("context58RefCount"),
        "context58ReadCount": consumers.get("context58ReadCount"),
        "context58WriteCount": consumers.get("context58WriteCount"),
        "currentOpcode24ModeHex": consumers.get("currentOpcode24ModeHex"),
        "currentOpcode24ModeTouchesContext58": consumers.get("currentOpcode24ModeTouchesContext58"),
        "opcode24Mode0Context58RefCount": consumers.get("opcode24Mode0Context58RefCount"),
        "opcode20Context58HandlerCount": consumers.get("opcode20Context58HandlerCount"),
        "context58PromotionStatus": consumers.get("context58PromotionStatus"),
        "promotionStatus": consumers.get("promotionStatus"),
        "conclusion": consumers.get("conclusion"),
    }


def context58_consumers_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"context58Refs={evidence.get('context58RefCount')} "
        f"rw={evidence.get('context58ReadCount')}/{evidence.get('context58WriteCount')} "
        f"currentMode={evidence.get('currentOpcode24ModeHex')} "
        f"currentTouches={evidence.get('currentOpcode24ModeTouchesContext58')} "
        f"mode0Refs={evidence.get('opcode24Mode0Context58RefCount')} "
        f"op20Handlers={evidence.get('opcode20Context58HandlerCount')} "
        f"status={evidence.get('context58PromotionStatus')}"
    )


def current_root_frontier_paths_for(source: str, target: str, paths: dict | None) -> dict | None:
    if not paths:
        return None
    if paths.get("source") != source or paths.get("target") != target:
        return None
    leaf_rows = paths.get("leafRows") or []
    reader_leaf_count = sum(1 for row in leaf_rows if row.get("traceContainsFrontierReader"))
    return {
        "selector": paths.get("selector"),
        "rootHex": paths.get("rootHex"),
        "leafCount": paths.get("leafCount"),
        "readerLeafCount": reader_leaf_count,
        "strictHotspotFound": paths.get("strictHotspotFound"),
        "frontierClusterRangeHex": paths.get("frontierClusterRangeHex"),
        "frontierClusterClass": paths.get("frontierClusterClass"),
        "frontierClusterEventCount": paths.get("frontierClusterEventCount"),
        "frontierClusterSelectorRefCount": paths.get("frontierClusterSelectorRefCount"),
        "proofFound": paths.get("proofFound"),
        "currentRootFrontierProofFound": paths.get("currentRootFrontierProofFound"),
        "failedCurrentRootFrontierGateIds": paths.get("failedCurrentRootFrontierGateIds") or [],
        "missingEvidence": paths.get("missingEvidence") or [],
        "remainingProofs": paths.get("remainingProofs") or [],
        "evidenceRefs": paths.get("evidenceRefs") or [],
        "evidenceRefCount": paths.get("evidenceRefCount"),
        "promotionStatus": paths.get("promotionStatus"),
        "conclusion": paths.get("conclusion"),
    }


def current_root_frontier_paths_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"leafs={evidence.get('leafCount')} "
        f"readerLeafs={evidence.get('readerLeafCount')} "
        f"cluster={evidence.get('frontierClusterRangeHex')} "
        f"class={evidence.get('frontierClusterClass')} "
        f"events={evidence.get('frontierClusterEventCount')} "
        f"selectorRefs={evidence.get('frontierClusterSelectorRefCount')} "
        f"strict={evidence.get('strictHotspotFound')} "
        f"proofFound={evidence.get('proofFound')} "
        f"failedGates={','.join(evidence.get('failedCurrentRootFrontierGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def current_writer_paths_for(source: str, target: str, rows: list[dict] | None) -> dict | None:
    if not rows:
        return None
    route_rows = [
        row for row in rows
        if source in (row.get("rootFieldMaps") or []) and target in (row.get("rootFieldMaps") or [])
    ]
    if not route_rows:
        return None
    evidence_refs = route_rows[0].get("evidenceRefs") or []
    selected_store_vas = []
    activation_store_vas = []
    for row in route_rows:
        for step in row.get("trace") or []:
            if step.get("opcodeHex") == "0x09" and "0x0059de30" in (step.get("meaning") or ""):
                va = step.get("vaHex")
                if va and va not in selected_store_vas:
                    selected_store_vas.append(va)
        for item in (row.get("activationContext") or {}).get("activators") or []:
            if item.get("kind") == "opcode09Mode0NextStream":
                va = item.get("vaHex")
                if va and va not in activation_store_vas:
                    activation_store_vas.append(va)
    return {
        "writerCount": len(route_rows),
        "writerVaHexes": [row.get("writerVaHex") for row in route_rows if row.get("writerVaHex")],
        "streamStartHexes": sorted({row.get("streamStartHex") for row in route_rows if row.get("streamStartHex")}),
        "rootHexes": sorted({row.get("rootHex") for row in route_rows if row.get("rootHex")}),
        "rootLabels": sorted({label for row in route_rows for label in row.get("rootLabels") or []}),
        "selectedPointerStoreVaHexes": selected_store_vas,
        "activationStoreVaHexes": activation_store_vas,
        "evidenceRefs": evidence_refs,
        "evidenceRefCount": len(evidence_refs),
        "proofFound": route_rows[0].get("proofFound"),
        "currentWriterPathProofFound": route_rows[0].get("currentWriterPathProofFound"),
        "failedCurrentWriterPathGateIds": route_rows[0].get("failedCurrentWriterPathGateIds") or [],
        "missingEvidence": route_rows[0].get("missingEvidence") or [],
        "remainingProofs": route_rows[0].get("remainingProofs") or [],
        "outOfRangeHelperMentioned": any(
            "out-of-range values" in (row.get("opcode10HelperRule") or "")
            or any(
                "out-of-range argument 0x20" in (context.get("meaning") or "")
                for context in (row.get("activationContext") or {}).get("contextRows") or []
            )
            for row in route_rows
        ),
        "currentInternalOnly": True,
        "promotionStatus": "blocked-current-internal-only",
    }


def current_writer_paths_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"writers={evidence.get('writerCount')} "
        f"roots={','.join(evidence.get('rootHexes') or []) or '-'} "
        f"labels={','.join(evidence.get('rootLabels') or []) or '-'} "
        f"starts={','.join(evidence.get('streamStartHexes') or []) or '-'} "
        f"selectedStores={','.join(evidence.get('selectedPointerStoreVaHexes') or []) or '-'} "
        f"activators={','.join(evidence.get('activationStoreVaHexes') or []) or '-'} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"outOfRangeHelper={evidence.get('outOfRangeHelperMentioned')} "
        f"currentInternalOnly={evidence.get('currentInternalOnly')} "
        f"proofFound={evidence.get('proofFound')} "
        f"failedGates={','.join(evidence.get('failedCurrentWriterPathGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"status={evidence.get('promotionStatus')}"
    )


def record_pattern_contrast_for(source: str, target: str, contrast: dict | None) -> dict | None:
    if not contrast:
        return None
    if contrast.get("source") != source or contrast.get("target") != target:
        return None
    confirmed = contrast.get("confirmedPattern") or {}
    frontier = contrast.get("frontierPattern") or {}
    return {
        "confirmedReferenceRoute": contrast.get("confirmedReferenceRoute"),
        "confirmedClusterRangeHex": confirmed.get("clusterRangeHex"),
        "confirmedEventRecordHex": confirmed.get("eventRecordHex"),
        "confirmedEventPointCount": confirmed.get("eventPointCount"),
        "confirmedTransitionReviewConfirmed": confirmed.get("transitionReviewConfirmed"),
        "frontierClusterRangeHex": frontier.get("clusterRangeHex"),
        "frontierEventRecordCount": frontier.get("eventRecordCount"),
        "frontierSaveSelectorRefCount": frontier.get("saveSelectorRefCount"),
        "frontierRouteExitPointCandidateCount": frontier.get("routeExitPointCandidateCount"),
        "frontierGeometryExitWordHitCount": frontier.get("geometryExitWordHitCount"),
        "frontierBranchTargetKind": frontier.get("branchTargetKind"),
        "frontierBranchClassification": frontier.get("branchClassification"),
        "confirmedLikePatternFound": contrast.get("confirmedLikePatternFound"),
        "frontierHasStrictEventRecord": contrast.get("frontierHasStrictEventRecord"),
        "frontierHasStrictSourceHotspot": contrast.get("frontierHasStrictSourceHotspot"),
        "frontierHasOnlySelectorSceneList": contrast.get("frontierHasOnlySelectorSceneList"),
        "promotionStatus": contrast.get("promotionStatus"),
        "conclusion": contrast.get("conclusion"),
    }


def record_pattern_contrast_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"confirmed={evidence.get('confirmedReferenceRoute')} "
        f"cluster={evidence.get('confirmedClusterRangeHex')} "
        f"event={evidence.get('confirmedEventRecordHex')} "
        f"points={evidence.get('confirmedEventPointCount')} "
        f"reviews={evidence.get('confirmedTransitionReviewConfirmed')}; "
        f"frontier={evidence.get('frontierClusterRangeHex')} "
        f"events={evidence.get('frontierEventRecordCount')} "
        f"selectorRefs={evidence.get('frontierSaveSelectorRefCount')} "
        f"routeExit={evidence.get('frontierRouteExitPointCandidateCount')} "
        f"geometry={evidence.get('frontierGeometryExitWordHitCount')} "
        f"branch={evidence.get('frontierBranchTargetKind')} "
        f"confirmedLike={evidence.get('confirmedLikePatternFound')} "
        f"status={evidence.get('promotionStatus')}"
    )


def strict_target_link_gap_for(source: str, target: str, gap: dict | None) -> dict | None:
    if not gap:
        return None
    if gap.get("source") != source or gap.get("target") != target:
        return None
    current = gap.get("currentFrontierCluster") or {}
    source_clusters = gap.get("sourceStrictClusters") or []
    target_strict_clusters = gap.get("targetStrictClusters") or []
    target_clusters = gap.get("targetSelectorOnlyClusters") or []
    direct_transitions = gap.get("directStrictEventTransitions") or []
    return {
        "directStrictEventTransitionCount": gap.get("directStrictEventTransitionCount"),
        "directStrictEventTransitions": direct_transitions,
        "sourceStrictClusterCount": gap.get("sourceStrictClusterCount"),
        "sourceStrictClusterRows": source_clusters,
        "sourceIncomingOnlyStrictClusterCount": gap.get("sourceIncomingOnlyStrictClusterCount"),
        "sourceOutgoingStrictClusterCount": gap.get("sourceOutgoingStrictClusterCount"),
        "sourceStrictClusterRanges": [row.get("clusterRangeHex") for row in source_clusters],
        "targetStrictClusterCount": gap.get("targetStrictClusterCount"),
        "targetStrictClusterRows": target_strict_clusters,
        "targetSelectorOnlyClusterCount": gap.get("targetSelectorOnlyClusterCount"),
        "targetSelectorOnlyClusterRows": target_clusters,
        "targetSelectorOnlyClusterRanges": [row.get("clusterRangeHex") for row in target_clusters],
        "targetSelectorOnlySourceOverlapCount": gap.get("targetSelectorOnlySourceOverlapCount"),
        "targetSelectorOnlySourceTargetRoutePairClusterCount": gap.get(
            "targetSelectorOnlySourceTargetRoutePairClusterCount"
        ),
        "targetSelectorOnlyCurrentFrontierClusterCount": gap.get(
            "targetSelectorOnlyCurrentFrontierClusterCount"
        ),
        "currentFrontierManifestMapCount": gap.get("currentFrontierManifestMapCount"),
        "currentFrontierRoutePairCount": gap.get("currentFrontierRoutePairCount"),
        "currentFrontierSourceOutgoingRoutePairCount": gap.get(
            "currentFrontierSourceOutgoingRoutePairCount"
        ),
        "currentFrontierTargetIncomingRoutePairCount": gap.get(
            "currentFrontierTargetIncomingRoutePairCount"
        ),
        "currentFrontierSourceTargetRoutePairCount": gap.get(
            "currentFrontierSourceTargetRoutePairCount"
        ),
        "currentFrontierCluster": current,
        "currentFrontierClusterRangeHex": current.get("clusterRangeHex"),
        "currentFrontierClusterIsSelectorOnly": gap.get("currentFrontierClusterIsSelectorOnly"),
        "strictTargetLinkFound": gap.get("strictTargetLinkFound"),
        "proofFound": gap.get("proofFound"),
        "strictTargetLinkProofFound": gap.get("strictTargetLinkProofFound"),
        "failedStrictTargetLinkGateIds": gap.get("failedStrictTargetLinkGateIds") or [],
        "missingEvidence": gap.get("missingEvidence") or [],
        "remainingProofs": gap.get("remainingProofs") or [],
        "evidenceRefs": gap.get("evidenceRefs") or [],
        "evidenceRefCount": gap.get("evidenceRefCount"),
        "promotionStatus": gap.get("promotionStatus"),
        "conclusion": gap.get("conclusion"),
    }


def strict_target_link_gap_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    source_ranges = ",".join(evidence.get("sourceStrictClusterRanges") or [])
    target_ranges = ",".join(evidence.get("targetSelectorOnlyClusterRanges") or [])
    return (
        f"rows={len(evidence.get('directStrictEventTransitions') or [])}/"
        f"{len(evidence.get('sourceStrictClusterRows') or [])}/"
        f"{len(evidence.get('targetStrictClusterRows') or [])}/"
        f"{len(evidence.get('targetSelectorOnlyClusterRows') or [])} "
        f"directStrict={evidence.get('directStrictEventTransitionCount')} "
        f"sourceStrict={evidence.get('sourceStrictClusterCount')} "
        f"incomingOnly={evidence.get('sourceIncomingOnlyStrictClusterCount')} "
        f"outgoing={evidence.get('sourceOutgoingStrictClusterCount')} "
        f"sourceClusters={source_ranges or '-'} "
        f"targetStrict={evidence.get('targetStrictClusterCount')} "
        f"targetSelectorOnly={evidence.get('targetSelectorOnlyClusterCount')} "
        f"targetSelectorSourceOverlap={evidence.get('targetSelectorOnlySourceOverlapCount')} "
        "targetSelectorSourceTargetPairs="
        f"{evidence.get('targetSelectorOnlySourceTargetRoutePairClusterCount')} "
        f"targetClusters={target_ranges or '-'} "
        "frontierBreadth="
        f"{evidence.get('currentFrontierManifestMapCount')}/"
        f"{evidence.get('currentFrontierRoutePairCount')}/"
        f"{evidence.get('currentFrontierSourceOutgoingRoutePairCount')}/"
        f"{evidence.get('currentFrontierTargetIncomingRoutePairCount')} "
        f"frontierSourceTargetPairs={evidence.get('currentFrontierSourceTargetRoutePairCount')} "
        f"frontier={evidence.get('currentFrontierClusterRangeHex')} "
        f"selectorOnly={evidence.get('currentFrontierClusterIsSelectorOnly')} "
        f"strictLink={evidence.get('strictTargetLinkFound')} "
        f"proofFound={evidence.get('proofFound')} "
        "failedGates="
        f"{','.join(evidence.get('failedStrictTargetLinkGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def entry_context_for(source: str, target: str, entry_context: dict | None) -> dict | None:
    if not entry_context:
        return None
    if entry_context.get("map") != source or entry_context.get("frontierTarget") != target:
        return None
    return {
        "confirmedPrevious": entry_context.get("confirmedPrevious"),
        "confirmedEntryRecordHex": entry_context.get("confirmedEntryRecordHex"),
        "confirmedEntryClusterHex": entry_context.get("confirmedEntryClusterHex"),
        "frontierRecordHex": entry_context.get("frontierRecordHex"),
        "frontierClusterHex": entry_context.get("frontierClusterHex"),
        "frontierProvenFromConfirmedEntry": entry_context.get("frontierProvenFromConfirmedEntry"),
        "promotionStatus": entry_context.get("promotionStatus"),
        "conclusion": entry_context.get("conclusion"),
    }


def entry_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"confirmedPrev={evidence.get('confirmedPrevious')} "
        f"entry={evidence.get('confirmedEntryRecordHex')} "
        f"entryCluster={evidence.get('confirmedEntryClusterHex')} "
        f"frontier={evidence.get('frontierRecordHex')} "
        f"frontierCluster={evidence.get('frontierClusterHex')} "
        f"entryProvesFrontier={evidence.get('frontierProvenFromConfirmedEntry')} "
        f"status={evidence.get('promotionStatus')}"
    )


def selector_bridge_for(source: str, target: str, selector_bridge: dict | None) -> dict | None:
    if not selector_bridge:
        return None
    if selector_bridge.get("map") != source or selector_bridge.get("frontierTarget") != target:
        return None
    confirmed = selector_bridge.get("confirmedContext") or {}
    frontier = selector_bridge.get("frontierContext") or {}
    confirmed_to_frontier = selector_bridge.get("confirmedToFrontier") or {}
    frontier_to_confirmed = selector_bridge.get("frontierToConfirmed") or {}
    return {
        "confirmedSelector": confirmed.get("selector"),
        "confirmedRootHex": confirmed.get("rootVaHex"),
        "frontierSelector": frontier.get("selector"),
        "frontierRootHex": frontier.get("rootVaHex"),
        "confirmedToFrontierHitCount": confirmed_to_frontier.get("dwordHitCount"),
        "frontierToConfirmedHitCount": frontier_to_confirmed.get("dwordHitCount"),
        "bridgeFound": selector_bridge.get("bridgeFound"),
        "promotionStatus": selector_bridge.get("promotionStatus"),
        "conclusion": selector_bridge.get("conclusion"),
    }


def selector_bridge_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"{evidence.get('confirmedSelector')}:{evidence.get('confirmedRootHex')}->"
        f"{evidence.get('frontierSelector')}:{evidence.get('frontierRootHex')} "
        f"forward={evidence.get('confirmedToFrontierHitCount')} "
        f"reverse={evidence.get('frontierToConfirmedHitCount')} "
        f"bridge={evidence.get('bridgeFound')} "
        f"status={evidence.get('promotionStatus')}"
    )


def manifest_point_scan_for(source: str, target: str, manifest_point_scan: dict | None) -> dict | None:
    if not manifest_point_scan:
        return None
    if manifest_point_scan.get("map") != source or manifest_point_scan.get("frontierTarget") != target:
        return None
    records = manifest_point_scan.get("records") or []
    point_like_count = sum(record.get("pointLikePointerCount", 0) for record in records)
    promotable_count = sum(record.get("promotableSourcePointCount", 0) for record in records)
    incoming_table = None
    for record in records:
        for pointer in record.get("pointLikePointers") or []:
            owner = pointer.get("ownerEvent") or {}
            if owner.get("kind") == "strict-event-record":
                incoming_table = {
                    "fieldVaHex": pointer.get("fieldVaHex"),
                    "payloadVaHex": pointer.get("payloadVaHex"),
                    "ownerMap": owner.get("map"),
                    "ownerRecordHex": owner.get("recordVaHex"),
                    "ownerTargets": owner.get("targets") or [],
                    "rawPointCount": pointer.get("rawPointCount"),
                }
                break
        if incoming_table:
            break
    return {
        "recordCount": len(records),
        "pointLikePointerCount": point_like_count,
        "incomingPointTableCount": manifest_point_scan.get("incomingPointTableCount"),
        "promotableSourcePointCount": promotable_count,
        "strictSourceHotspotFound": manifest_point_scan.get("strictSourceHotspotFound"),
        "incomingPointTable": incoming_table,
        "promotionStatus": manifest_point_scan.get("promotionStatus"),
        "conclusion": manifest_point_scan.get("conclusion"),
    }


def manifest_point_scan_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    incoming = evidence.get("incomingPointTable") or {}
    return (
        f"records={evidence.get('recordCount')} "
        f"pointLike={evidence.get('pointLikePointerCount')} "
        f"incoming={evidence.get('incomingPointTableCount')} "
        f"promotable={evidence.get('promotableSourcePointCount')} "
        f"strict={evidence.get('strictSourceHotspotFound')} "
        f"incomingTable={incoming.get('fieldVaHex') or '-'}->{incoming.get('payloadVaHex') or '-'} "
        f"owner={incoming.get('ownerMap') or '-'}@{incoming.get('ownerRecordHex') or '-'} "
        f"status={evidence.get('promotionStatus')}"
    )


def root_point_scan_for(source: str, target: str, root_point_scan: dict | None) -> dict | None:
    if not root_point_scan:
        return None
    if root_point_scan.get("source") != source or root_point_scan.get("target") != target:
        return None
    top = (root_point_scan.get("candidates") or [{}])[0] or {}
    first_values = top.get("firstValues") or []
    return {
        "selector": root_point_scan.get("selector"),
        "rootHex": root_point_scan.get("rootVaHex"),
        "rootRangeHex": root_point_scan.get("rootRangeHex"),
        "pointerLikeCount": root_point_scan.get("pointerLikeCount"),
        "reportedCandidateCount": root_point_scan.get("reportedCandidateCount"),
        "frontierClusterCandidateCount": root_point_scan.get("frontierClusterCandidateCount"),
        "exactExitCandidateCount": root_point_scan.get("exactExitCandidateCount"),
        "scriptLikeCandidateCount": root_point_scan.get("scriptLikeCandidateCount"),
        "strictSourceHotspotFound": root_point_scan.get("strictSourceHotspotFound"),
        "topCandidateFieldHex": top.get("fieldVaHex"),
        "topCandidatePayloadHex": top.get("payloadVaHex"),
        "topCandidateClassification": top.get("classification"),
        "topCandidateFirstValueHex": first_values[0] if first_values else None,
        "promotionStatus": root_point_scan.get("promotionStatus"),
        "conclusion": root_point_scan.get("conclusion"),
    }


def root_point_scan_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"selector={evidence.get('selector')} "
        f"root={evidence.get('rootHex')} "
        f"range={evidence.get('rootRangeHex')} "
        f"pointLike={evidence.get('pointerLikeCount')} "
        f"reported={evidence.get('reportedCandidateCount')} "
        f"frontierClusterCandidates={evidence.get('frontierClusterCandidateCount')} "
        f"exactExit={evidence.get('exactExitCandidateCount')} "
        f"scriptLike={evidence.get('scriptLikeCandidateCount')} "
        f"top={evidence.get('topCandidateFieldHex')}->{evidence.get('topCandidatePayloadHex')} "
        f"first={evidence.get('topCandidateFirstValueHex')} "
        f"class={evidence.get('topCandidateClassification')} "
        f"strict={evidence.get('strictSourceHotspotFound')} "
        f"status={evidence.get('promotionStatus')}"
    )


def edge_trigger_gap_for(source: str, target: str, edge_trigger_gap: dict | None) -> dict | None:
    if not edge_trigger_gap:
        return None
    if edge_trigger_gap.get("source") != source or edge_trigger_gap.get("target") != target:
        return None
    helper = edge_trigger_gap.get("collisionHelperEvidence") or {}
    controller = edge_trigger_gap.get("actorControllerEvidence") or {}
    latch = edge_trigger_gap.get("directionLatchReferenceEvidence") or {}
    global_refs = (edge_trigger_gap.get("globalTransitionReferenceEvidence") or {}).get(
        "directReferences"
    ) or {}
    actor_controller_caller_windows = edge_trigger_gap.get("actorControllerCallerWindowEvidence") or {}
    collision_helper_caller_windows = edge_trigger_gap.get("collisionHelperCallerWindowEvidence") or {}
    script_runner_context = edge_trigger_gap.get("scriptRunnerCallContextEvidence") or {}
    selected_pointer_context = edge_trigger_gap.get("selectedPointerImmediateContextEvidence") or {}
    direct_call_graph = edge_trigger_gap.get("directCallGraphEvidence") or {}
    call_graph_sensitivity = edge_trigger_gap.get("directCallGraphDepthSensitivity") or {}
    edge_handler_encoded = edge_trigger_gap.get("edgeHandlerEncodedTargetScan") or {}
    edge_local_window_encoded = edge_trigger_gap.get("edgeLocalWindowEncodedTargetScan") or {}
    edge_call_graph_encoded = edge_trigger_gap.get("edgeCallGraphEncodedTargetScan") or {}
    edge_global_contrast_encoded = (
        edge_trigger_gap.get("edgeGlobalContrastWindowEncodedTargetScan") or {}
    )
    candidate_rows = edge_trigger_gap.get("candidateRows") or []
    missing_promotion_evidence = edge_trigger_gap.get("missingPromotionEvidence") or []
    missing_evidence = edge_trigger_gap.get("missingEvidence") or missing_promotion_evidence
    return {
        "promotionStatus": edge_trigger_gap.get("promotionStatus"),
        "promotionAllowed": edge_trigger_gap.get("promotionAllowed"),
        "proofFound": edge_trigger_gap.get("proofFound"),
        "edgeTriggerProofFound": edge_trigger_gap.get("edgeTriggerProofFound"),
        "failedEdgeTriggerGateIds": edge_trigger_gap.get("failedEdgeTriggerGateIds") or [],
        "missingEvidence": missing_evidence,
        "routeCandidateCount": edge_trigger_gap.get("routeCandidateCount"),
        "candidateRowCount": len(candidate_rows),
        "candidateRows": candidate_rows,
        "missingPromotionEvidence": missing_promotion_evidence,
        "sourceBoundaryCandidateCount": edge_trigger_gap.get("sourceBoundaryCandidateCount"),
        "autoBoundaryCandidateCount": edge_trigger_gap.get("autoBoundaryCandidateCount"),
        "allBoundarySnippetsMatchExpected": helper.get("allBoundarySnippetsMatchExpected"),
        "allBoundaryCasesFallThroughToActorOverlapLoop": helper.get("allBoundaryCasesFallThroughToActorOverlapLoop"),
        "collisionHelperCallCount": controller.get("collisionHelperCallCount"),
        "directionLatchDirectRefCount": latch.get("directRefCount"),
        "directionLatchOtherTextRefCount": latch.get("otherTextRefCount"),
        "directionLatchTransitionLikeWindowRelHitCount": latch.get("transitionLikeWindowRelHitCount"),
        "directionLatchRouteImmediateWindowHitCount": latch.get("routeImmediateWindowHitCount"),
        "transitionLikeDirectRelHitCountInHelperOrController": edge_trigger_gap.get(
            "transitionLikeDirectRelHitCountInHelperOrController"
        ),
        "directRouteImmediateCountInHelperOrController": edge_trigger_gap.get(
            "directRouteImmediateCountInHelperOrController"
        ),
        "globalMapLoaderDirectRelHitCount": global_refs.get("mapLoaderDirectRelHitCount"),
        "globalScriptRunnerDirectRelHitCount": global_refs.get("scriptRunnerDirectRelHitCount"),
        "globalSelectorTableDirectRelHitCount": global_refs.get("selectorTableDirectRelHitCount"),
        "globalSelectedPointerImmediateCount": global_refs.get("selectedPointerGlobalImmediateCount"),
        "globalCurrentRootImmediateCount": global_refs.get("currentSelectorRootImmediateCount"),
        "globalSourceMapStringImmediateCount": global_refs.get("sourceMapStringImmediateCount"),
        "globalTargetMapStringImmediateCount": global_refs.get("targetMapStringImmediateCount"),
        "scriptRunnerCallerCount": script_runner_context.get("callerCount"),
        "scriptRunnerRouteWindowImmediateHitCount": script_runner_context.get(
            "routeImmediateWindowHitCount"
        ),
        "scriptRunnerMapLoaderWindowRelHitCount": script_runner_context.get(
            "mapLoaderWindowRelHitCount"
        ),
        "scriptRunnerSelectorTableWindowRelHitCount": script_runner_context.get(
            "selectorTableWindowRelHitCount"
        ),
        "scriptRunnerActorControllerRangeCallerCount": script_runner_context.get(
            "actorControllerRangeCallerCount"
        ),
        "scriptRunnerCollisionHelperRangeCallerCount": script_runner_context.get(
            "collisionHelperRangeCallerCount"
        ),
        "selectedPointerImmediateRefCount": selected_pointer_context.get("immediateRefCount"),
        "selectedPointerRouteSpecificWindowHitCount": selected_pointer_context.get(
            "routeSpecificWindowHitCount"
        ),
        "selectedPointerCurrentRootWindowImmediateHitCount": selected_pointer_context.get(
            "currentSelectorRootImmediateWindowHitCount"
        ),
        "selectedPointerSourceStringWindowImmediateHitCount": selected_pointer_context.get(
            "sourceMapStringImmediateWindowHitCount"
        ),
        "selectedPointerTargetStringWindowImmediateHitCount": selected_pointer_context.get(
            "targetMapStringImmediateWindowHitCount"
        ),
        "selectedPointerMapLoaderWindowRelHitCount": selected_pointer_context.get(
            "mapLoaderWindowRelHitCount"
        ),
        "selectedPointerScriptRunnerWindowRelHitCount": selected_pointer_context.get(
            "scriptRunnerWindowRelHitCount"
        ),
        "selectedPointerSelectorTableWindowRelHitCount": selected_pointer_context.get(
            "selectorTableWindowRelHitCount"
        ),
        "edgeHandlerEncodedTargetClassification": edge_handler_encoded.get("classification"),
        "edgeHandlerEncodedTargetRawScalarCandidateCount": edge_handler_encoded.get(
            "rawScalarCandidateCount"
        ),
        "edgeHandlerEncodedTargetTransitionRawScalarCandidateCount": edge_handler_encoded.get(
            "transitionRawScalarCandidateCount"
        ),
        "edgeHandlerEncodedTargetRouteProofRawScalarCandidateCount": edge_handler_encoded.get(
            "routeProofRawScalarCandidateCount"
        ),
        "edgeHandlerEncodedTargetSelectedPointerRawScalarCandidateCount": edge_handler_encoded.get(
            "selectedPointerRawScalarCandidateCount"
        ),
        "edgeHandlerEncodedTargetPromotingCandidateCount": edge_handler_encoded.get(
            "promotingCandidateCount"
        ),
        "edgeLocalWindowEncodedTargetClassification": edge_local_window_encoded.get(
            "classification"
        ),
        "edgeLocalWindowEncodedTargetRawScalarCandidateCount": edge_local_window_encoded.get(
            "rawScalarCandidateCount"
        ),
        "edgeLocalWindowEncodedTargetTransitionRawScalarCandidateCount": edge_local_window_encoded.get(
            "transitionRawScalarCandidateCount"
        ),
        "edgeLocalWindowEncodedTargetRouteProofRawScalarCandidateCount": edge_local_window_encoded.get(
            "routeProofRawScalarCandidateCount"
        ),
        "edgeLocalWindowEncodedTargetSelectedPointerRawScalarCandidateCount": edge_local_window_encoded.get(
            "selectedPointerRawScalarCandidateCount"
        ),
        "edgeLocalWindowEncodedTargetPromotingCandidateCount": edge_local_window_encoded.get(
            "promotingCandidateCount"
        ),
        "edgeCallGraphEncodedTargetClassification": edge_call_graph_encoded.get(
            "classification"
        ),
        "edgeCallGraphEncodedTargetRawScalarCandidateCount": edge_call_graph_encoded.get(
            "rawScalarCandidateCount"
        ),
        "edgeCallGraphEncodedTargetTransitionRawScalarCandidateCount": edge_call_graph_encoded.get(
            "transitionRawScalarCandidateCount"
        ),
        "edgeCallGraphEncodedTargetRouteProofRawScalarCandidateCount": edge_call_graph_encoded.get(
            "routeProofRawScalarCandidateCount"
        ),
        "edgeCallGraphEncodedTargetSelectedPointerRawScalarCandidateCount": edge_call_graph_encoded.get(
            "selectedPointerRawScalarCandidateCount"
        ),
        "edgeCallGraphEncodedTargetPromotingCandidateCount": edge_call_graph_encoded.get(
            "promotingCandidateCount"
        ),
        "edgeGlobalContrastEncodedTargetClassification": edge_global_contrast_encoded.get(
            "classification"
        ),
        "edgeGlobalContrastEncodedTargetRawScalarCandidateCount": edge_global_contrast_encoded.get(
            "rawScalarCandidateCount"
        ),
        "edgeGlobalContrastEncodedTargetTransitionRawScalarCandidateCount": edge_global_contrast_encoded.get(
            "transitionRawScalarCandidateCount"
        ),
        "edgeGlobalContrastEncodedTargetRouteProofRawScalarCandidateCount": edge_global_contrast_encoded.get(
            "routeProofRawScalarCandidateCount"
        ),
        "edgeGlobalContrastEncodedTargetSelectedPointerRawScalarCandidateCount": edge_global_contrast_encoded.get(
            "selectedPointerRawScalarCandidateCount"
        ),
        "edgeGlobalContrastEncodedTargetPromotingCandidateCount": edge_global_contrast_encoded.get(
            "promotingCandidateCount"
        ),
        "actorControllerCallerCount": actor_controller_caller_windows.get("callerCount"),
        "actorControllerCallerRouteWindowRelHitCount": actor_controller_caller_windows.get(
            "transitionLikeWindowRelHitCount"
        ),
        "actorControllerCallerRouteWindowImmediateHitCount": actor_controller_caller_windows.get(
            "routeImmediateWindowHitCount"
        ),
        "collisionHelperCallerCount": collision_helper_caller_windows.get("callerCount"),
        "collisionHelperCallerRouteWindowRelHitCount": collision_helper_caller_windows.get(
            "transitionLikeWindowRelHitCount"
        ),
        "collisionHelperCallerRouteWindowImmediateHitCount": collision_helper_caller_windows.get(
            "routeImmediateWindowHitCount"
        ),
        "directCallGraphRejectionClassification": direct_call_graph.get("classification"),
        "directCallGraphEvidence": direct_call_graph,
        "directCallGraphProofFound": direct_call_graph.get("proofFound"),
        "directCallGraphReachableFunctionCount": direct_call_graph.get("reachableFunctionCount"),
        "directCallGraphDirectCallEdgeCount": direct_call_graph.get("directCallEdgeCount"),
        "directCallGraphTransitionTargetReachableCount": direct_call_graph.get(
            "transitionTargetReachableCount"
        ),
        "directCallGraphTransitionTargetHitCount": direct_call_graph.get("transitionTargetHitCount"),
        "directCallGraphRouteImmediateHitCount": direct_call_graph.get("routeImmediateHitCount"),
        "directCallGraphIndirectCallLikeByteCount": direct_call_graph.get(
            "indirectCallLikeByteCount"
        ),
        "directCallGraphIndirectRejectionClassification": direct_call_graph.get(
            "indirectCallGraphRejectionClassification"
        ),
        "directCallGraphIndirectProofFound": direct_call_graph.get(
            "indirectCallGraphProofFound"
        ),
        "directCallGraphIndirectIndexedJumpTableCandidateCount": direct_call_graph.get(
            "indirectCallGraphIndexedJumpTableCandidateCount"
        ),
        "directCallGraphIndirectIndexedJumpTableEntryCount": direct_call_graph.get(
            "indirectCallGraphIndexedJumpTableEntryCount"
        ),
        "directCallGraphIndirectIndexedJumpTableTargetCount": direct_call_graph.get(
            "indirectCallGraphIndexedJumpTableTargetCount"
        ),
        "directCallGraphIndirectIndexedJumpTableUniqueTargetCount": direct_call_graph.get(
            "indirectCallGraphIndexedJumpTableUniqueTargetCount"
        ),
        "directCallGraphIndirectIndexedJumpTableAllTargetsLocalToEdgeHandlers": direct_call_graph.get(
            "indirectCallGraphIndexedJumpTableAllTargetsLocalToEdgeHandlers"
        ),
        "directCallGraphIndirectIndexedJumpTableOutsideEdgeHandlerTargetCount": direct_call_graph.get(
            "indirectCallGraphIndexedJumpTableOutsideEdgeHandlerTargetCount"
        ),
        "directCallGraphIndirectTransitionTargetHitCount": direct_call_graph.get(
            "indirectCallGraphTransitionTargetHitCount"
        ),
        "directCallGraphIndirectRouteImmediateHitCount": direct_call_graph.get(
            "indirectCallGraphRouteImmediateHitCount"
        ),
        "directCallGraphDepthSensitivityMaxDepthChecked": call_graph_sensitivity.get(
            "maxDepthChecked"
        ),
        "directCallGraphDepthSensitivityProofAbsentAcrossCheckedDepths": (
            call_graph_sensitivity.get("proofAbsentAcrossCheckedDepths")
        ),
        "directCallGraphDepthSensitivityCountsStableAtAndBeyondDefaultDepth": (
            call_graph_sensitivity.get("countsStableAtAndBeyondDefaultDepth")
        ),
        "conclusion": edge_trigger_gap.get("conclusion"),
    }


def edge_trigger_gap_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"candidateRows={evidence.get('candidateRowCount')} "
        f"proof={evidence.get('proofFound')} "
        f"failed={','.join(evidence.get('failedEdgeTriggerGateIds') or []) or '-'} "
        f"missing={len(evidence.get('missingEvidence') or [])} "
        f"edgeTriggerBoundary={evidence.get('sourceBoundaryCandidateCount')}/"
        f"{evidence.get('routeCandidateCount')} "
        f"autoBoundary={evidence.get('autoBoundaryCandidateCount')} "
        f"snippets={evidence.get('allBoundarySnippetsMatchExpected')} "
        f"fallToOverlap={evidence.get('allBoundaryCasesFallThroughToActorOverlapLoop')} "
        f"helperCalls={evidence.get('collisionHelperCallCount')} "
        f"transitionRelHits={evidence.get('transitionLikeDirectRelHitCountInHelperOrController')} "
        f"routeImmediateHits={evidence.get('directRouteImmediateCountInHelperOrController')} "
        "globalRelHits="
        f"{evidence.get('globalMapLoaderDirectRelHitCount')}/"
        f"{evidence.get('globalScriptRunnerDirectRelHitCount')}/"
        f"{evidence.get('globalSelectorTableDirectRelHitCount')} "
        "globalRouteImms="
        f"{evidence.get('globalSelectedPointerImmediateCount')}/"
        f"{evidence.get('globalCurrentRootImmediateCount')}/"
        f"{evidence.get('globalSourceMapStringImmediateCount')}/"
        f"{evidence.get('globalTargetMapStringImmediateCount')} "
        "scriptRunnerWindows="
        f"{evidence.get('scriptRunnerCallerCount')}/"
        f"{evidence.get('scriptRunnerRouteWindowImmediateHitCount')}/"
        f"{evidence.get('scriptRunnerMapLoaderWindowRelHitCount')}/"
        f"{evidence.get('scriptRunnerSelectorTableWindowRelHitCount')} "
        "selectedPointerWindows="
        f"{evidence.get('selectedPointerImmediateRefCount')}/"
        f"{evidence.get('selectedPointerRouteSpecificWindowHitCount')} "
        "edgeEncoded="
        f"{evidence.get('edgeHandlerEncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('edgeHandlerEncodedTargetTransitionRawScalarCandidateCount')}/"
        f"{evidence.get('edgeHandlerEncodedTargetRouteProofRawScalarCandidateCount')}/"
        f"{evidence.get('edgeHandlerEncodedTargetSelectedPointerRawScalarCandidateCount')}/"
        f"{evidence.get('edgeHandlerEncodedTargetPromotingCandidateCount')};"
        f"{evidence.get('edgeLocalWindowEncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('edgeLocalWindowEncodedTargetTransitionRawScalarCandidateCount')}/"
        f"{evidence.get('edgeLocalWindowEncodedTargetRouteProofRawScalarCandidateCount')}/"
        f"{evidence.get('edgeLocalWindowEncodedTargetSelectedPointerRawScalarCandidateCount')}/"
        f"{evidence.get('edgeLocalWindowEncodedTargetPromotingCandidateCount')};"
        f"{evidence.get('edgeCallGraphEncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('edgeCallGraphEncodedTargetTransitionRawScalarCandidateCount')}/"
        f"{evidence.get('edgeCallGraphEncodedTargetRouteProofRawScalarCandidateCount')}/"
        f"{evidence.get('edgeCallGraphEncodedTargetSelectedPointerRawScalarCandidateCount')}/"
        f"{evidence.get('edgeCallGraphEncodedTargetPromotingCandidateCount')};"
        f"{evidence.get('edgeGlobalContrastEncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('edgeGlobalContrastEncodedTargetTransitionRawScalarCandidateCount')}/"
        f"{evidence.get('edgeGlobalContrastEncodedTargetRouteProofRawScalarCandidateCount')}/"
        f"{evidence.get('edgeGlobalContrastEncodedTargetSelectedPointerRawScalarCandidateCount')}/"
        f"{evidence.get('edgeGlobalContrastEncodedTargetPromotingCandidateCount')} "
        "edgeEncodedClass="
        f"{evidence.get('edgeHandlerEncodedTargetClassification')}/"
        f"{evidence.get('edgeLocalWindowEncodedTargetClassification')}/"
        f"{evidence.get('edgeCallGraphEncodedTargetClassification')}/"
        f"{evidence.get('edgeGlobalContrastEncodedTargetClassification')} "
        f"latchRefs={evidence.get('directionLatchDirectRefCount')} "
        f"latchOtherText={evidence.get('directionLatchOtherTextRefCount')} "
        f"latchWindowHits={evidence.get('directionLatchTransitionLikeWindowRelHitCount')}/"
        f"{evidence.get('directionLatchRouteImmediateWindowHitCount')} "
        "callerWindows="
        f"{evidence.get('actorControllerCallerCount')}/"
        f"{evidence.get('actorControllerCallerRouteWindowRelHitCount')}/"
        f"{evidence.get('actorControllerCallerRouteWindowImmediateHitCount')};"
        f"{evidence.get('collisionHelperCallerCount')}/"
        f"{evidence.get('collisionHelperCallerRouteWindowRelHitCount')}/"
        f"{evidence.get('collisionHelperCallerRouteWindowImmediateHitCount')} "
        "callGraph="
        f"{evidence.get('directCallGraphRejectionClassification')}/"
        f"{evidence.get('directCallGraphReachableFunctionCount')}/"
        f"{evidence.get('directCallGraphDirectCallEdgeCount')}/"
        f"{evidence.get('directCallGraphTransitionTargetReachableCount')}/"
        f"{evidence.get('directCallGraphTransitionTargetHitCount')}/"
        f"{evidence.get('directCallGraphRouteImmediateHitCount')}/"
        f"{evidence.get('directCallGraphIndirectCallLikeByteCount')} "
        "callGraphSensitivity="
        f"{evidence.get('directCallGraphDepthSensitivityMaxDepthChecked')}/"
        f"{evidence.get('directCallGraphDepthSensitivityProofAbsentAcrossCheckedDepths')}/"
        f"{evidence.get('directCallGraphDepthSensitivityCountsStableAtAndBeyondDefaultDepth')} "
        "indirectGraph="
        f"{evidence.get('directCallGraphIndirectRejectionClassification')}/"
        f"{evidence.get('directCallGraphIndirectIndexedJumpTableCandidateCount')}/"
        f"{evidence.get('directCallGraphIndirectIndexedJumpTableEntryCount')}/"
        f"{evidence.get('directCallGraphIndirectIndexedJumpTableTargetCount')}/"
        f"{evidence.get('directCallGraphIndirectIndexedJumpTableUniqueTargetCount')}/"
        f"{evidence.get('directCallGraphIndirectIndexedJumpTableOutsideEdgeHandlerTargetCount')}/"
        f"{evidence.get('directCallGraphIndirectTransitionTargetHitCount')}/"
        f"{evidence.get('directCallGraphIndirectRouteImmediateHitCount')} "
        f"indirectLocal={evidence.get('directCallGraphIndirectIndexedJumpTableAllTargetsLocalToEdgeHandlers')} "
        f"status={evidence.get('promotionStatus')}"
    )


def tile_hotspot_pattern_for(source: str, target: str, tile_hotspot_pattern: dict | None) -> dict | None:
    if not tile_hotspot_pattern:
        return None
    if tile_hotspot_pattern.get("source") != source or tile_hotspot_pattern.get("target") != target:
        return None
    return {
        "promotionStatus": tile_hotspot_pattern.get("promotionStatus"),
        "proofFound": tile_hotspot_pattern.get("proofFound"),
        "tileHotspotPatternProofFound": tile_hotspot_pattern.get("tileHotspotPatternProofFound"),
        "failedTileHotspotPatternGateIds": tile_hotspot_pattern.get("failedTileHotspotPatternGateIds") or [],
        "missingEvidence": tile_hotspot_pattern.get("missingEvidence") or [],
        "evidenceRefs": tile_hotspot_pattern.get("evidenceRefs") or [],
        "evidenceRefCount": tile_hotspot_pattern.get("evidenceRefCount"),
        "tileHotspotConfirmed": tile_hotspot_pattern.get("tileHotspotConfirmed"),
        "strictSourceCoordinateFound": tile_hotspot_pattern.get("strictSourceCoordinateFound"),
        "confirmedReviewCount": tile_hotspot_pattern.get("confirmedReviewCount"),
        "confirmedRejectedCount": tile_hotspot_pattern.get("confirmedRejectedCount"),
        "confirmedEventRecordHex": tile_hotspot_pattern.get("confirmedEventRecordHex"),
        "currentCandidateCount": tile_hotspot_pattern.get("currentCandidateCount"),
        "currentStrictEventPointCount": tile_hotspot_pattern.get("currentStrictEventPointCount"),
        "currentStrictTransitionReviewCount": tile_hotspot_pattern.get("currentStrictTransitionReviewCount"),
        "currentOriginalStandableCandidateCount": tile_hotspot_pattern.get("currentOriginalStandableCandidateCount"),
        "currentTargetSpawnOriginalStandableCount": tile_hotspot_pattern.get("currentTargetSpawnOriginalStandableCount"),
        "currentCandidatesMatchingConfirmedLowNibbleCount": tile_hotspot_pattern.get(
            "currentCandidatesMatchingConfirmedLowNibbleCount"
        ),
        "currentCandidatesMatchingConfirmedCenterPairCount": tile_hotspot_pattern.get(
            "currentCandidatesMatchingConfirmedCenterPairCount"
        ),
        "currentCandidatesMatchingConfirmedLow3x3Count": tile_hotspot_pattern.get(
            "currentCandidatesMatchingConfirmedLow3x3Count"
        ),
        "currentCandidatesMatchingConfirmedPair3x3Count": tile_hotspot_pattern.get(
            "currentCandidatesMatchingConfirmedPair3x3Count"
        ),
        "conclusion": tile_hotspot_pattern.get("conclusion"),
    }


def tile_hotspot_pattern_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"tileHotspot={evidence.get('tileHotspotConfirmed')} "
        f"strictCoord={evidence.get('strictSourceCoordinateFound')} "
        f"confirmedReviews={evidence.get('confirmedReviewCount')}/"
        f"{evidence.get('confirmedRejectedCount')} "
        f"confirmedRecord={evidence.get('confirmedEventRecordHex')} "
        f"currentCandidates={evidence.get('currentCandidateCount')} "
        f"currentStandable={evidence.get('currentOriginalStandableCandidateCount')}/"
        f"{evidence.get('currentCandidateCount')} "
        f"targetSpawns={evidence.get('currentTargetSpawnOriginalStandableCount')}/"
        f"{evidence.get('currentCandidateCount')} "
        f"lowNibbleMatch={evidence.get('currentCandidatesMatchingConfirmedLowNibbleCount')}/"
        f"{evidence.get('currentCandidateCount')} "
        f"centerPairMatch={evidence.get('currentCandidatesMatchingConfirmedCenterPairCount')}/"
        f"{evidence.get('currentCandidateCount')} "
        f"low3x3Match={evidence.get('currentCandidatesMatchingConfirmedLow3x3Count')}/"
        f"{evidence.get('currentCandidateCount')} "
        f"pair3x3Match={evidence.get('currentCandidatesMatchingConfirmedPair3x3Count')}/"
        f"{evidence.get('currentCandidateCount')} "
        f"currentReviews={evidence.get('currentStrictTransitionReviewCount')} "
        f"currentEventPoints={evidence.get('currentStrictEventPointCount')} "
        f"proofFound={evidence.get('proofFound')} "
        "failedGates="
        f"{','.join(evidence.get('failedTileHotspotPatternGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"status={evidence.get('promotionStatus')}"
    )


def strict_event_tile_signature_for(source: str, target: str, signature_scan: dict | None) -> dict | None:
    if not signature_scan:
        return None
    if signature_scan.get("source") != source or signature_scan.get("target") != target:
        return None
    return {
        "promotionStatus": signature_scan.get("promotionStatus"),
        "proofFound": signature_scan.get("proofFound"),
        "strictEventTileSignatureProofFound": signature_scan.get("strictEventTileSignatureProofFound"),
        "failedStrictEventTileSignatureGateIds": (
            signature_scan.get("failedStrictEventTileSignatureGateIds") or []
        ),
        "missingEvidence": signature_scan.get("missingEvidence") or [],
        "tileHotspotConfirmed": signature_scan.get("tileHotspotConfirmed"),
        "strictSourceCoordinateFound": signature_scan.get("strictSourceCoordinateFound"),
        "tileSignaturePromotes": signature_scan.get("tileSignaturePromotes"),
        "strictEventRecordCount": signature_scan.get("strictEventRecordCount"),
        "strictEventPointCount": signature_scan.get("strictEventPointCount"),
        "reviewedStrictEventPointCount": signature_scan.get("reviewedStrictEventPointCount"),
        "confirmedStrictEventPointCount": signature_scan.get("confirmedStrictEventPointCount"),
        "rejectedStrictEventPointCount": signature_scan.get("rejectedStrictEventPointCount"),
        "targetLinkedStrictEventRecordCount": signature_scan.get("targetLinkedStrictEventRecordCount"),
        "directSourceTargetStrictEventRecordCount": signature_scan.get("directSourceTargetStrictEventRecordCount"),
        "candidateCount": signature_scan.get("candidateCount"),
        "candidatesWithCenterPairMatchCount": signature_scan.get("candidatesWithCenterPairMatchCount"),
        "centerPairMatchCount": signature_scan.get("centerPairMatchCount"),
        "centerPairSameSourceMatchCount": signature_scan.get("centerPairSameSourceMatchCount"),
        "centerPairTargetLinkedMatchCount": signature_scan.get("centerPairTargetLinkedMatchCount"),
        "centerPairConfirmedReviewMatchCount": signature_scan.get("centerPairConfirmedReviewMatchCount"),
        "centerPairRejectedReviewMatchCount": signature_scan.get("centerPairRejectedReviewMatchCount"),
        "allCenterPairMatchesRejectedReview": signature_scan.get("allCenterPairMatchesRejectedReview"),
        "centerPairOwnerPairs": signature_scan.get("centerPairOwnerPairs"),
        "candidatesWithLow3x3MatchCount": signature_scan.get("candidatesWithLow3x3MatchCount"),
        "candidatesWithPair3x3MatchCount": signature_scan.get("candidatesWithPair3x3MatchCount"),
        "targetSpawnTargetMapStrictEventPointCount": signature_scan.get(
            "targetSpawnTargetMapStrictEventPointCount",
            signature_scan.get("targetSpawnStrictEventPointCount"),
        ),
        "candidatesWithTargetSpawnCenterPairMatchCount": signature_scan.get(
            "candidatesWithTargetSpawnCenterPairMatchCount"
        ),
        "candidatesWithTargetSpawnLow3x3MatchCount": signature_scan.get(
            "candidatesWithTargetSpawnLow3x3MatchCount"
        ),
        "candidatesWithTargetSpawnPair3x3MatchCount": signature_scan.get(
            "candidatesWithTargetSpawnPair3x3MatchCount"
        ),
        "targetSpawnCenterPairStrictEventMatchCount": signature_scan.get(
            "targetSpawnCenterPairStrictEventMatchCount"
        ),
        "targetSpawnLow3x3StrictEventMatchCount": signature_scan.get(
            "targetSpawnLow3x3StrictEventMatchCount"
        ),
        "targetSpawnPair3x3StrictEventMatchCount": signature_scan.get(
            "targetSpawnPair3x3StrictEventMatchCount"
        ),
        "targetSpawnCenterPairTargetMapMatchCount": signature_scan.get(
            "targetSpawnCenterPairTargetMapMatchCount"
        ),
        "targetSpawnLow3x3TargetMapMatchCount": signature_scan.get(
            "targetSpawnLow3x3TargetMapMatchCount"
        ),
        "targetSpawnPair3x3TargetMapMatchCount": signature_scan.get(
            "targetSpawnPair3x3TargetMapMatchCount"
        ),
        "targetSpawnLow3x3TargetLinkedMatchCount": signature_scan.get(
            "targetSpawnLow3x3TargetLinkedMatchCount"
        ),
        "targetSpawnLow3x3ConfirmedReviewMatchCount": signature_scan.get(
            "targetSpawnLow3x3ConfirmedReviewMatchCount"
        ),
        "targetSpawnLow3x3RejectedReviewMatchCount": signature_scan.get(
            "targetSpawnLow3x3RejectedReviewMatchCount"
        ),
        "targetSpawnLow3x3OwnerPairs": signature_scan.get("targetSpawnLow3x3OwnerPairs"),
        "targetSpawnLow3x3GenericOnly": signature_scan.get("targetSpawnLow3x3GenericOnly"),
        "allTargetSpawnCenterPairMatchesZero": signature_scan.get(
            "allTargetSpawnCenterPairMatchesZero"
        ),
        "allTargetSpawnPair3x3MatchesZero": signature_scan.get(
            "allTargetSpawnPair3x3MatchesZero"
        ),
        "allTargetSpawnTargetMapStrictEventsZero": signature_scan.get(
            "allTargetSpawnTargetMapStrictEventsZero"
        ),
        "allDirectSourceTargetStrictEventMatchesZero": signature_scan.get(
            "allDirectSourceTargetStrictEventMatchesZero"
        ),
        "allTargetLinkedStrictEventMatchesZero": signature_scan.get("allTargetLinkedStrictEventMatchesZero"),
        "allConfirmedReviewPair3x3MatchesZero": signature_scan.get("allConfirmedReviewPair3x3MatchesZero"),
        "candidateRows": [
            {
                "side": row.get("side"),
                "tile": {"x": row.get("x"), "y": row.get("y")},
                "centerPairKey": (row.get("signature") or {}).get("centerPairKey"),
                "edgeRole": (row.get("signature") or {}).get("edgeRole"),
                "centerPairStrictEventMatchCount": row.get("centerPairStrictEventMatchCount"),
                "centerPairSameSourceMatchCount": row.get("centerPairSameSourceMatchCount"),
                "centerPairTargetLinkedMatchCount": row.get("centerPairTargetLinkedMatchCount"),
                "centerPairConfirmedReviewMatchCount": row.get("centerPairConfirmedReviewMatchCount"),
                "centerPairRejectedReviewMatchCount": row.get("centerPairRejectedReviewMatchCount"),
                "centerPairAllMatchesRejectedReview": row.get("centerPairAllMatchesRejectedReview"),
                "centerPairOwnerPairs": row.get("centerPairOwnerPairs"),
                "low3x3StrictEventMatchCount": row.get("low3x3StrictEventMatchCount"),
                "pair3x3StrictEventMatchCount": row.get("pair3x3StrictEventMatchCount"),
                "targetSpawnCenterPairStrictEventMatchCount": row.get(
                    "targetSpawnCenterPairStrictEventMatchCount"
                ),
                "targetSpawnLow3x3StrictEventMatchCount": row.get(
                    "targetSpawnLow3x3StrictEventMatchCount"
                ),
                "targetSpawnPair3x3StrictEventMatchCount": row.get(
                    "targetSpawnPair3x3StrictEventMatchCount"
                ),
                "targetSpawnCenterPairTargetMapMatchCount": row.get(
                    "targetSpawnCenterPairTargetMapMatchCount"
                ),
                "targetSpawnLow3x3TargetMapMatchCount": row.get(
                    "targetSpawnLow3x3TargetMapMatchCount"
                ),
                "targetSpawnPair3x3TargetMapMatchCount": row.get(
                    "targetSpawnPair3x3TargetMapMatchCount"
                ),
                "targetSpawnLow3x3TargetLinkedMatchCount": row.get(
                    "targetSpawnLow3x3TargetLinkedMatchCount"
                ),
                "targetSpawnLow3x3OwnerPairs": row.get("targetSpawnLow3x3OwnerPairs"),
                "targetSpawnLow3x3GenericOnly": row.get("targetSpawnLow3x3GenericOnly"),
                "targetLinkedStrictEventMatchCount": row.get("targetLinkedStrictEventMatchCount"),
                "directSourceTargetStrictEventMatchCount": row.get("directSourceTargetStrictEventMatchCount"),
                "confirmedReviewPair3x3MatchCount": row.get("confirmedReviewPair3x3MatchCount"),
                "promotionStatus": row.get("promotionStatus"),
            }
            for row in signature_scan.get("candidateRows") or []
        ],
        "conclusion": signature_scan.get("conclusion"),
    }


def owner_pair_summary(pairs: list[dict] | None) -> str:
    parts = []
    for row in pairs or []:
        owner = row.get("owner")
        count = row.get("count")
        if owner is not None and count is not None:
            parts.append(f"{owner}:{count}")
    return ",".join(parts) or "-"


def strict_event_tile_signature_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"strictEvents={evidence.get('strictEventRecordCount')}/"
        f"{evidence.get('strictEventPointCount')} "
        f"proof={evidence.get('proofFound')} "
        f"failed={','.join(evidence.get('failedStrictEventTileSignatureGateIds') or []) or '-'} "
        f"missing={len(evidence.get('missingEvidence') or [])} "
        f"reviewed={evidence.get('reviewedStrictEventPointCount')} "
        f"confirmed={evidence.get('confirmedStrictEventPointCount')} "
        f"targetLinked={evidence.get('targetLinkedStrictEventRecordCount')} "
        f"directSourceTarget={evidence.get('directSourceTargetStrictEventRecordCount')} "
        f"matches=center:{evidence.get('candidatesWithCenterPairMatchCount')}/"
        f"{evidence.get('candidateCount')},low3x3:{evidence.get('candidatesWithLow3x3MatchCount')}/"
        f"{evidence.get('candidateCount')},pair3x3:{evidence.get('candidatesWithPair3x3MatchCount')}/"
        f"{evidence.get('candidateCount')} "
        f"centerPairs={evidence.get('centerPairMatchCount')} "
        f"centerOwners={owner_pair_summary(evidence.get('centerPairOwnerPairs'))} "
        "centerSame/target/confirmed/rejected="
        f"{evidence.get('centerPairSameSourceMatchCount')}/"
        f"{evidence.get('centerPairTargetLinkedMatchCount')}/"
        f"{evidence.get('centerPairConfirmedReviewMatchCount')}/"
        f"{evidence.get('centerPairRejectedReviewMatchCount')} "
        f"allCenterRejected={evidence.get('allCenterPairMatchesRejectedReview')} "
        "targetSpawnSig="
        f"points:{evidence.get('targetSpawnTargetMapStrictEventPointCount')},"
        f"candidates:{evidence.get('candidatesWithTargetSpawnCenterPairMatchCount')}/"
        f"{evidence.get('candidatesWithTargetSpawnLow3x3MatchCount')}/"
        f"{evidence.get('candidatesWithTargetSpawnPair3x3MatchCount')},"
        f"matches:{evidence.get('targetSpawnCenterPairStrictEventMatchCount')}/"
        f"{evidence.get('targetSpawnLow3x3StrictEventMatchCount')}/"
        f"{evidence.get('targetSpawnPair3x3StrictEventMatchCount')},"
        f"targetMap:{evidence.get('targetSpawnCenterPairTargetMapMatchCount')}/"
        f"{evidence.get('targetSpawnLow3x3TargetMapMatchCount')}/"
        f"{evidence.get('targetSpawnPair3x3TargetMapMatchCount')},"
        f"low3x3Owners:{owner_pair_summary(evidence.get('targetSpawnLow3x3OwnerPairs'))},"
        "low3x3Target/confirmed/rejected="
        f"{evidence.get('targetSpawnLow3x3TargetLinkedMatchCount')}/"
        f"{evidence.get('targetSpawnLow3x3ConfirmedReviewMatchCount')}/"
        f"{evidence.get('targetSpawnLow3x3RejectedReviewMatchCount')},"
        f"low3x3GenericOnly:{evidence.get('targetSpawnLow3x3GenericOnly')},"
        f"zero:{evidence.get('allTargetSpawnCenterPairMatchesZero')}/"
        f"{evidence.get('allTargetSpawnPair3x3MatchesZero')}/"
        f"{evidence.get('allTargetSpawnTargetMapStrictEventsZero')} "
        f"allTargetZero={evidence.get('allTargetLinkedStrictEventMatchesZero')} "
        f"allDirectZero={evidence.get('allDirectSourceTargetStrictEventMatchesZero')} "
        f"confirmedPair3x3Zero={evidence.get('allConfirmedReviewPair3x3MatchesZero')} "
        f"tilePromotes={evidence.get('tileSignaturePromotes')} "
        f"status={evidence.get('promotionStatus')}"
    )


def strict_hotspot_review_matrix_for(source: str, target: str, review_matrix: dict | None) -> dict | None:
    if not review_matrix:
        return None
    if review_matrix.get("source") != source or review_matrix.get("target") != target:
        return None
    gate = review_matrix.get("candidateGateSummary") or {}
    candidate_rows = review_matrix.get("candidateRows") or []
    remaining_proofs = review_matrix.get("remainingProofs") or []
    return {
        "promotionStatus": review_matrix.get("promotionStatus"),
        "proofFound": review_matrix.get("proofFound"),
        "strictHotspotReviewProofFound": review_matrix.get("strictHotspotReviewProofFound"),
        "failedStrictHotspotReviewGateIds": review_matrix.get("failedStrictHotspotReviewGateIds") or [],
        "missingEvidence": review_matrix.get("missingEvidence") or [],
        "strictSourceCoordinateFound": review_matrix.get("strictSourceCoordinateFound"),
        "tileHotspotConfirmed": review_matrix.get("tileHotspotConfirmed"),
        "eventTransitionCount": review_matrix.get("eventTransitionCount"),
        "transitionReviewRowCount": review_matrix.get("transitionReviewRowCount"),
        "sourceReviewRowCount": review_matrix.get("sourceReviewRowCount"),
        "confirmedIncomingEventRecordCount": review_matrix.get("confirmedIncomingEventRecordCount"),
        "confirmedIncomingReviewCount": review_matrix.get("confirmedIncomingReviewCount"),
        "incomingReviewCount": review_matrix.get("incomingReviewCount"),
        "incomingReviewStateCounts": review_matrix.get("incomingReviewStateCounts") or {},
        "confirmedIncomingRecordHexes": review_matrix.get("confirmedIncomingRecordHexes") or [],
        "candidateCount": review_matrix.get("candidateCount"),
        "allCandidatesHaveNoRouteReviewRows": gate.get("allCandidatesHaveNoRouteReviewRows"),
        "allCandidatesHaveNoStrictEventRows": gate.get("allCandidatesHaveNoStrictEventRows"),
        "allCoordinateRefsNonPromotable": gate.get("allCoordinateRefsNonPromotable"),
        "allVariantScansNonPromotable": gate.get("allVariantScansNonPromotable"),
        "lowNibbleMatchCount": gate.get("lowNibbleMatchCount"),
        "tileSignatureOnly": gate.get("tileSignatureOnly"),
        "candidateRowCount": len(candidate_rows),
        "candidateRows": [
            {
                "side": row.get("side"),
                "tile": row.get("tile") or {},
                "coordRefStatus": (row.get("coordinateRef") or {}).get("status"),
                "xyHitCount": (row.get("coordinateRef") or {}).get("xyHitCount"),
                "yxHitCount": (row.get("coordinateRef") or {}).get("yxHitCount"),
                "variantCurrentRootHitCount": (row.get("variantScan") or {}).get("currentRootHitCount"),
                "variantStrictCoordinateEvidenceFound": (row.get("variantScan") or {}).get(
                    "strictCoordinateEvidenceFound"
                ),
                "lowNibbleMatch": (row.get("tileEvidence") or {}).get("matchesConfirmedLowNibble"),
                "promotionStatus": row.get("promotionStatus"),
            }
            for row in candidate_rows
        ],
        "remainingProofCount": len(remaining_proofs),
        "remainingProofs": remaining_proofs,
        "conclusion": review_matrix.get("conclusion"),
    }


def strict_hotspot_review_matrix_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    states = evidence.get("incomingReviewStateCounts") or {}
    state_text = ",".join(f"{key}:{value}" for key, value in states.items()) or "-"
    return (
        f"candidateRows={evidence.get('candidateRowCount')} "
        f"proof={evidence.get('proofFound')} "
        f"failed={','.join(evidence.get('failedStrictHotspotReviewGateIds') or []) or '-'} "
        f"missing={len(evidence.get('missingEvidence') or [])} "
        f"remainingProofs={evidence.get('remainingProofCount')} "
        f"candidates={evidence.get('candidateCount')} "
        f"routeReviews={evidence.get('transitionReviewRowCount')} "
        f"routeEvents={evidence.get('eventTransitionCount')} "
        f"sourceReviews={evidence.get('sourceReviewRowCount')} "
        f"incomingReviews={evidence.get('confirmedIncomingReviewCount')}/"
        f"{evidence.get('incomingReviewCount')} "
        f"incomingStates={state_text} "
        f"records={','.join(evidence.get('confirmedIncomingRecordHexes') or []) or '-'} "
        f"allNoReviews={evidence.get('allCandidatesHaveNoRouteReviewRows')} "
        f"allNoEvents={evidence.get('allCandidatesHaveNoStrictEventRows')} "
        f"coordRefsBlocked={evidence.get('allCoordinateRefsNonPromotable')} "
        f"variantsBlocked={evidence.get('allVariantScansNonPromotable')} "
        f"lowNibbleOnly={evidence.get('lowNibbleMatchCount')}/{evidence.get('candidateCount')} "
        f"tileSignatureOnly={evidence.get('tileSignatureOnly')} "
        f"status={evidence.get('promotionStatus')}"
    )


def strict_source_hotspot_context_for(source: str, target: str, context: dict | None) -> dict | None:
    if not context:
        return None
    if context.get("source") != source or context.get("target") != target:
        return None
    candidate_summaries = context.get("candidateSummaries") or []
    evidence_rows = context.get("evidence") or []
    remaining_proofs = context.get("remainingProofs") or []
    return {
        "candidateCount": context.get("candidateCount"),
        "candidateSummaryCount": len(candidate_summaries),
        "candidateSummaries": candidate_summaries,
        "evidenceRowCount": len(evidence_rows),
        "evidence": evidence_rows,
        "evidenceRefs": context.get("evidenceRefs") or [],
        "evidenceRefCount": context.get("evidenceRefCount"),
        "remainingProofCount": len(remaining_proofs),
        "remainingProofs": remaining_proofs,
        "candidateBlockReasonCounts": context.get("candidateBlockReasonCounts") or {},
        "candidateAllBlocked": context.get("candidateAllBlocked"),
        "transitionReviewRowCount": context.get("transitionReviewRowCount"),
        "eventTransitionCount": context.get("eventTransitionCount"),
        "strictSourceCoordinateFound": context.get("strictSourceCoordinateFound"),
        "tileHotspotConfirmed": context.get("tileHotspotConfirmed"),
        "allCoordinateRefsNonPromotable": context.get("allCoordinateRefsNonPromotable"),
        "allVariantScansNonPromotable": context.get("allVariantScansNonPromotable"),
        "targetSpawnCoordinateScanCount": context.get("targetSpawnCoordinateScanCount"),
        "targetSpawnCoordinateCurrentRootHitCount": context.get(
            "targetSpawnCoordinateCurrentRootHitCount"
        ),
        "targetSpawnCoordinateCharacterDescriptorHitCount": context.get(
            "targetSpawnCoordinateCharacterDescriptorHitCount"
        ),
        "targetSpawnCoordinateCurrentRootClassificationCounts": context.get(
            "targetSpawnCoordinateCurrentRootClassificationCounts"
        ),
        "targetSpawnCoordinateCharacterDescriptorClassificationCounts": context.get(
            "targetSpawnCoordinateCharacterDescriptorClassificationCounts"
        ),
        "targetSpawnCoordinatePromotableHitCount": context.get(
            "targetSpawnCoordinatePromotableHitCount"
        ),
        "targetSpawnCoordinateAllInterestingHitsNonPromotable": context.get(
            "targetSpawnCoordinateAllInterestingHitsNonPromotable"
        ),
        "targetSpawnStrictCoordinateEvidenceFound": context.get(
            "targetSpawnStrictCoordinateEvidenceFound"
        ),
        "byteCoordinateScanCount": context.get("byteCoordinateScanCount"),
        "byteCoordinateSequenceScanCount": context.get("byteCoordinateSequenceScanCount"),
        "byteCoordinateHitCount": context.get("byteCoordinateHitCount"),
        "byteCoordinateSequenceHitCount": context.get("byteCoordinateSequenceHitCount"),
        "byteCoordinateStrictSourceTargetHitCount": context.get(
            "byteCoordinateStrictSourceTargetHitCount"
        ),
        "byteCoordinateStrictEventOtherHitCount": context.get(
            "byteCoordinateStrictEventOtherHitCount"
        ),
        "byteCoordinateCurrentSelectorRootHitCount": context.get(
            "byteCoordinateCurrentSelectorRootHitCount"
        ),
        "byteCoordinateTextCodeHitCount": context.get("byteCoordinateTextCodeHitCount"),
        "strictByteCoordinateEvidenceFound": context.get("strictByteCoordinateEvidenceFound"),
        "targetSpawnByteCoordinateScanCount": context.get("targetSpawnByteCoordinateScanCount"),
        "targetSpawnByteCoordinateHitCount": context.get("targetSpawnByteCoordinateHitCount"),
        "targetSpawnByteCoordinateStrictSourceTargetHitCount": context.get(
            "targetSpawnByteCoordinateStrictSourceTargetHitCount"
        ),
        "targetSpawnByteCoordinateStrictEventOtherHitCount": context.get(
            "targetSpawnByteCoordinateStrictEventOtherHitCount"
        ),
        "targetSpawnByteCoordinateCurrentSelectorRootHitCount": context.get(
            "targetSpawnByteCoordinateCurrentSelectorRootHitCount"
        ),
        "targetSpawnByteCoordinateTextCodeHitCount": context.get(
            "targetSpawnByteCoordinateTextCodeHitCount"
        ),
        "targetSpawnStrictByteCoordinateEvidenceFound": context.get(
            "targetSpawnStrictByteCoordinateEvidenceFound"
        ),
        "byteCoordinatePromotionStatus": context.get("byteCoordinatePromotionStatus"),
        "cnsPayloadSourceWidth": context.get("cnsPayloadSourceWidth"),
        "cnsPayloadSourceHeight": context.get("cnsPayloadSourceHeight"),
        "cnsPayloadDecodedSize": context.get("cnsPayloadDecodedSize"),
        "cnsPayloadBytePairScanCount": context.get("cnsPayloadBytePairScanCount"),
        "cnsPayloadWordPairScanCount": context.get("cnsPayloadWordPairScanCount"),
        "cnsPayloadPackedU32ScanCount": context.get("cnsPayloadPackedU32ScanCount"),
        "cnsPayloadSequenceScanCount": context.get("cnsPayloadSequenceScanCount"),
        "cnsPayloadBytePairHitCount": context.get("cnsPayloadBytePairHitCount"),
        "cnsPayloadWordPairHitCount": context.get("cnsPayloadWordPairHitCount"),
        "cnsPayloadPackedU32HitCount": context.get("cnsPayloadPackedU32HitCount"),
        "cnsPayloadSequenceHitCount": context.get("cnsPayloadSequenceHitCount"),
        "cnsPayloadHeaderHitCount": context.get("cnsPayloadHeaderHitCount"),
        "cnsPayloadLayerHitCount": context.get("cnsPayloadLayerHitCount"),
        "cnsPayloadOutsideStructuredHitCount": context.get(
            "cnsPayloadOutsideStructuredHitCount"
        ),
        "strictCnsCoordinateEvidenceFound": context.get("strictCnsCoordinateEvidenceFound"),
        "cnsPayloadPromotionStatus": context.get("cnsPayloadPromotionStatus"),
        "centerPairStrictEventMatchCount": context.get("centerPairStrictEventMatchCount"),
        "centerPairSameSourceMatchCount": context.get("centerPairSameSourceMatchCount"),
        "centerPairTargetLinkedMatchCount": context.get("centerPairTargetLinkedMatchCount"),
        "centerPairConfirmedReviewMatchCount": context.get("centerPairConfirmedReviewMatchCount"),
        "centerPairRejectedReviewMatchCount": context.get("centerPairRejectedReviewMatchCount"),
        "allCenterPairMatchesRejectedReview": context.get("allCenterPairMatchesRejectedReview"),
        "centerPairOwnerPairs": context.get("centerPairOwnerPairs"),
        "centerPairOwnerText": context.get("centerPairOwnerText"),
        "low3x3StrictEventMatchCount": context.get("low3x3StrictEventMatchCount"),
        "pair3x3StrictEventMatchCount": context.get("pair3x3StrictEventMatchCount"),
        "targetSpawnTargetMapStrictEventPointCount": context.get(
            "targetSpawnTargetMapStrictEventPointCount"
        ),
        "targetSpawnCenterPairStrictEventMatchCount": context.get(
            "targetSpawnCenterPairStrictEventMatchCount"
        ),
        "targetSpawnLow3x3StrictEventMatchCount": context.get(
            "targetSpawnLow3x3StrictEventMatchCount"
        ),
        "targetSpawnPair3x3StrictEventMatchCount": context.get(
            "targetSpawnPair3x3StrictEventMatchCount"
        ),
        "targetSpawnCenterPairTargetMapMatchCount": context.get(
            "targetSpawnCenterPairTargetMapMatchCount"
        ),
        "targetSpawnLow3x3TargetMapMatchCount": context.get(
            "targetSpawnLow3x3TargetMapMatchCount"
        ),
        "targetSpawnLow3x3TargetLinkedMatchCount": context.get(
            "targetSpawnLow3x3TargetLinkedMatchCount"
        ),
        "targetSpawnLow3x3ConfirmedReviewMatchCount": context.get(
            "targetSpawnLow3x3ConfirmedReviewMatchCount"
        ),
        "targetSpawnLow3x3RejectedReviewMatchCount": context.get(
            "targetSpawnLow3x3RejectedReviewMatchCount"
        ),
        "targetSpawnLow3x3OwnerPairs": context.get("targetSpawnLow3x3OwnerPairs"),
        "targetSpawnLow3x3GenericOnly": context.get("targetSpawnLow3x3GenericOnly"),
        "targetSpawnPair3x3TargetMapMatchCount": context.get(
            "targetSpawnPair3x3TargetMapMatchCount"
        ),
        "allTargetSpawnCenterPairMatchesZero": context.get("allTargetSpawnCenterPairMatchesZero"),
        "allTargetSpawnPair3x3MatchesZero": context.get("allTargetSpawnPair3x3MatchesZero"),
        "allTargetSpawnTargetMapStrictEventsZero": context.get(
            "allTargetSpawnTargetMapStrictEventsZero"
        ),
        "targetLinkedStrictEventMatchCount": context.get("targetLinkedStrictEventMatchCount"),
        "directSourceTargetStrictEventMatchCount": context.get("directSourceTargetStrictEventMatchCount"),
        "resourcePointCandidateCount": context.get("resourcePointCandidateCount"),
        "resourcePointCandidateClassCounts": context.get("resourcePointCandidateClassCounts"),
        "routeExitPointCandidateCount": context.get("routeExitPointCandidateCount"),
        "strictSourceTargetCandidateCount": context.get("strictSourceTargetCandidateCount"),
        "currentFrontierPointCandidateClassCounts": context.get(
            "currentFrontierPointCandidateClassCounts"
        ),
        "currentFrontierRouteExitPointHitCount": context.get("currentFrontierRouteExitPointHitCount"),
        "currentFrontierNonRouteSingletonPointCandidateCount": context.get(
            "currentFrontierNonRouteSingletonPointCandidateCount"
        ),
        "readerBranchClassification": context.get("readerBranchClassification"),
        "payloadSourceInBoundsPointCount": context.get("payloadSourceInBoundsPointCount"),
        "currentPairSelectorAdjacencyOnly": context.get("currentPairSelectorAdjacencyOnly"),
        "targetSelectorOnlySourceOverlapCount": context.get("targetSelectorOnlySourceOverlapCount"),
        "targetSelectorOnlySourceTargetRoutePairClusterCount": context.get(
            "targetSelectorOnlySourceTargetRoutePairClusterCount"
        ),
        "currentFrontierManifestMapCount": context.get("currentFrontierManifestMapCount"),
        "currentFrontierRoutePairCount": context.get("currentFrontierRoutePairCount"),
        "currentFrontierSourceOutgoingRoutePairCount": context.get(
            "currentFrontierSourceOutgoingRoutePairCount"
        ),
        "currentFrontierTargetIncomingRoutePairCount": context.get(
            "currentFrontierTargetIncomingRoutePairCount"
        ),
        "currentFrontierSourceTargetRoutePairCount": context.get(
            "currentFrontierSourceTargetRoutePairCount"
        ),
        "edgeTriggerPromotionAllowed": context.get("edgeTriggerPromotionAllowed"),
        "edgeTriggerPromotionStatus": context.get("edgeTriggerPromotionStatus"),
        "edgeTriggerSourceBoundaryCandidateCount": context.get(
            "edgeTriggerSourceBoundaryCandidateCount"
        ),
        "edgeTriggerAutoBoundaryCandidateCount": context.get(
            "edgeTriggerAutoBoundaryCandidateCount"
        ),
        "edgeTriggerRouteCandidateCount": context.get("edgeTriggerRouteCandidateCount"),
        "edgeTriggerTransitionLikeDirectRelHitCount": context.get(
            "edgeTriggerTransitionLikeDirectRelHitCount"
        ),
        "edgeTriggerRouteImmediateHitCount": context.get("edgeTriggerRouteImmediateHitCount"),
        "edgeTriggerDirectionLatchTextRefCount": context.get(
            "edgeTriggerDirectionLatchTextRefCount"
        ),
        "edgeTriggerDirectionLatchRouteWindowRelHitCount": context.get(
            "edgeTriggerDirectionLatchRouteWindowRelHitCount"
        ),
        "edgeTriggerDirectionLatchRouteWindowImmediateHitCount": context.get(
            "edgeTriggerDirectionLatchRouteWindowImmediateHitCount"
        ),
        "edgeTriggerGlobalMapLoaderRelHitCount": context.get(
            "edgeTriggerGlobalMapLoaderRelHitCount"
        ),
        "edgeTriggerGlobalScriptRunnerRelHitCount": context.get(
            "edgeTriggerGlobalScriptRunnerRelHitCount"
        ),
        "edgeTriggerGlobalSelectorTableRelHitCount": context.get(
            "edgeTriggerGlobalSelectorTableRelHitCount"
        ),
        "edgeTriggerScriptRunnerCallerCount": context.get(
            "edgeTriggerScriptRunnerCallerCount"
        ),
        "edgeTriggerScriptRunnerRouteWindowImmediateHitCount": context.get(
            "edgeTriggerScriptRunnerRouteWindowImmediateHitCount"
        ),
        "edgeTriggerScriptRunnerMapLoaderWindowRelHitCount": context.get(
            "edgeTriggerScriptRunnerMapLoaderWindowRelHitCount"
        ),
        "edgeTriggerScriptRunnerSelectorTableWindowRelHitCount": context.get(
            "edgeTriggerScriptRunnerSelectorTableWindowRelHitCount"
        ),
        "edgeTriggerScriptRunnerActorControllerRangeCallerCount": context.get(
            "edgeTriggerScriptRunnerActorControllerRangeCallerCount"
        ),
        "edgeTriggerScriptRunnerCollisionHelperRangeCallerCount": context.get(
            "edgeTriggerScriptRunnerCollisionHelperRangeCallerCount"
        ),
        "edgeTriggerSelectedPointerImmediateRefCount": context.get(
            "edgeTriggerSelectedPointerImmediateRefCount"
        ),
        "edgeTriggerSelectedPointerRouteSpecificWindowHitCount": context.get(
            "edgeTriggerSelectedPointerRouteSpecificWindowHitCount"
        ),
        "edgeTriggerSelectedPointerCurrentRootWindowImmediateHitCount": context.get(
            "edgeTriggerSelectedPointerCurrentRootWindowImmediateHitCount"
        ),
        "edgeTriggerSelectedPointerSourceStringWindowImmediateHitCount": context.get(
            "edgeTriggerSelectedPointerSourceStringWindowImmediateHitCount"
        ),
        "edgeTriggerSelectedPointerTargetStringWindowImmediateHitCount": context.get(
            "edgeTriggerSelectedPointerTargetStringWindowImmediateHitCount"
        ),
        "edgeTriggerSelectedPointerMapLoaderWindowRelHitCount": context.get(
            "edgeTriggerSelectedPointerMapLoaderWindowRelHitCount"
        ),
        "edgeTriggerSelectedPointerScriptRunnerWindowRelHitCount": context.get(
            "edgeTriggerSelectedPointerScriptRunnerWindowRelHitCount"
        ),
        "edgeTriggerSelectedPointerSelectorTableWindowRelHitCount": context.get(
            "edgeTriggerSelectedPointerSelectorTableWindowRelHitCount"
        ),
        "edgeTriggerHandlerEncodedTargetClassification": context.get(
            "edgeTriggerHandlerEncodedTargetClassification"
        ),
        "edgeTriggerHandlerEncodedTargetRawScalarCandidateCount": context.get(
            "edgeTriggerHandlerEncodedTargetRawScalarCandidateCount"
        ),
        "edgeTriggerHandlerEncodedTargetTransitionRawScalarCandidateCount": context.get(
            "edgeTriggerHandlerEncodedTargetTransitionRawScalarCandidateCount"
        ),
        "edgeTriggerHandlerEncodedTargetRouteProofRawScalarCandidateCount": context.get(
            "edgeTriggerHandlerEncodedTargetRouteProofRawScalarCandidateCount"
        ),
        "edgeTriggerHandlerEncodedTargetSelectedPointerRawScalarCandidateCount": context.get(
            "edgeTriggerHandlerEncodedTargetSelectedPointerRawScalarCandidateCount"
        ),
        "edgeTriggerHandlerEncodedTargetPromotingCandidateCount": context.get(
            "edgeTriggerHandlerEncodedTargetPromotingCandidateCount"
        ),
        "edgeTriggerLocalWindowEncodedTargetClassification": context.get(
            "edgeTriggerLocalWindowEncodedTargetClassification"
        ),
        "edgeTriggerLocalWindowEncodedTargetRawScalarCandidateCount": context.get(
            "edgeTriggerLocalWindowEncodedTargetRawScalarCandidateCount"
        ),
        "edgeTriggerLocalWindowEncodedTargetTransitionRawScalarCandidateCount": context.get(
            "edgeTriggerLocalWindowEncodedTargetTransitionRawScalarCandidateCount"
        ),
        "edgeTriggerLocalWindowEncodedTargetRouteProofRawScalarCandidateCount": context.get(
            "edgeTriggerLocalWindowEncodedTargetRouteProofRawScalarCandidateCount"
        ),
        "edgeTriggerLocalWindowEncodedTargetSelectedPointerRawScalarCandidateCount": context.get(
            "edgeTriggerLocalWindowEncodedTargetSelectedPointerRawScalarCandidateCount"
        ),
        "edgeTriggerLocalWindowEncodedTargetPromotingCandidateCount": context.get(
            "edgeTriggerLocalWindowEncodedTargetPromotingCandidateCount"
        ),
        "edgeTriggerCallGraphEncodedTargetClassification": context.get(
            "edgeTriggerCallGraphEncodedTargetClassification"
        ),
        "edgeTriggerCallGraphEncodedTargetRawScalarCandidateCount": context.get(
            "edgeTriggerCallGraphEncodedTargetRawScalarCandidateCount"
        ),
        "edgeTriggerCallGraphEncodedTargetTransitionRawScalarCandidateCount": context.get(
            "edgeTriggerCallGraphEncodedTargetTransitionRawScalarCandidateCount"
        ),
        "edgeTriggerCallGraphEncodedTargetRouteProofRawScalarCandidateCount": context.get(
            "edgeTriggerCallGraphEncodedTargetRouteProofRawScalarCandidateCount"
        ),
        "edgeTriggerCallGraphEncodedTargetSelectedPointerRawScalarCandidateCount": context.get(
            "edgeTriggerCallGraphEncodedTargetSelectedPointerRawScalarCandidateCount"
        ),
        "edgeTriggerCallGraphEncodedTargetPromotingCandidateCount": context.get(
            "edgeTriggerCallGraphEncodedTargetPromotingCandidateCount"
        ),
        "edgeTriggerGlobalContrastEncodedTargetClassification": context.get(
            "edgeTriggerGlobalContrastEncodedTargetClassification"
        ),
        "edgeTriggerGlobalContrastEncodedTargetRawScalarCandidateCount": context.get(
            "edgeTriggerGlobalContrastEncodedTargetRawScalarCandidateCount"
        ),
        "edgeTriggerGlobalContrastEncodedTargetTransitionRawScalarCandidateCount": context.get(
            "edgeTriggerGlobalContrastEncodedTargetTransitionRawScalarCandidateCount"
        ),
        "edgeTriggerGlobalContrastEncodedTargetRouteProofRawScalarCandidateCount": context.get(
            "edgeTriggerGlobalContrastEncodedTargetRouteProofRawScalarCandidateCount"
        ),
        "edgeTriggerGlobalContrastEncodedTargetSelectedPointerRawScalarCandidateCount": context.get(
            "edgeTriggerGlobalContrastEncodedTargetSelectedPointerRawScalarCandidateCount"
        ),
        "edgeTriggerGlobalContrastEncodedTargetPromotingCandidateCount": context.get(
            "edgeTriggerGlobalContrastEncodedTargetPromotingCandidateCount"
        ),
        "edgeTriggerActorControllerCallerCount": context.get(
            "edgeTriggerActorControllerCallerCount"
        ),
        "edgeTriggerActorControllerCallerRouteWindowRelHitCount": context.get(
            "edgeTriggerActorControllerCallerRouteWindowRelHitCount"
        ),
        "edgeTriggerActorControllerCallerRouteWindowImmediateHitCount": context.get(
            "edgeTriggerActorControllerCallerRouteWindowImmediateHitCount"
        ),
        "edgeTriggerCollisionHelperCallerCount": context.get(
            "edgeTriggerCollisionHelperCallerCount"
        ),
        "edgeTriggerCollisionHelperCallerRouteWindowRelHitCount": context.get(
            "edgeTriggerCollisionHelperCallerRouteWindowRelHitCount"
        ),
        "edgeTriggerCollisionHelperCallerRouteWindowImmediateHitCount": context.get(
            "edgeTriggerCollisionHelperCallerRouteWindowImmediateHitCount"
        ),
        "edgeTriggerDirectCallGraphRejectionClassification": context.get(
            "edgeTriggerDirectCallGraphRejectionClassification"
        ),
        "edgeTriggerDirectCallGraphProofFound": context.get(
            "edgeTriggerDirectCallGraphProofFound"
        ),
        "edgeTriggerDirectCallGraphReachableFunctionCount": context.get(
            "edgeTriggerDirectCallGraphReachableFunctionCount"
        ),
        "edgeTriggerDirectCallGraphDirectCallEdgeCount": context.get(
            "edgeTriggerDirectCallGraphDirectCallEdgeCount"
        ),
        "edgeTriggerDirectCallGraphTransitionTargetReachableCount": context.get(
            "edgeTriggerDirectCallGraphTransitionTargetReachableCount"
        ),
        "edgeTriggerDirectCallGraphTransitionTargetHitCount": context.get(
            "edgeTriggerDirectCallGraphTransitionTargetHitCount"
        ),
        "edgeTriggerDirectCallGraphRouteImmediateHitCount": context.get(
            "edgeTriggerDirectCallGraphRouteImmediateHitCount"
        ),
        "edgeTriggerDirectCallGraphIndirectCallLikeByteCount": context.get(
            "edgeTriggerDirectCallGraphIndirectCallLikeByteCount"
        ),
        "edgeTriggerDirectCallGraphIndirectRejectionClassification": context.get(
            "edgeTriggerDirectCallGraphIndirectRejectionClassification"
        ),
        "edgeTriggerDirectCallGraphIndirectProofFound": context.get(
            "edgeTriggerDirectCallGraphIndirectProofFound"
        ),
        "edgeTriggerDirectCallGraphIndirectIndexedJumpTableCandidateCount": context.get(
            "edgeTriggerDirectCallGraphIndirectIndexedJumpTableCandidateCount"
        ),
        "edgeTriggerDirectCallGraphIndirectIndexedJumpTableEntryCount": context.get(
            "edgeTriggerDirectCallGraphIndirectIndexedJumpTableEntryCount"
        ),
        "edgeTriggerDirectCallGraphIndirectIndexedJumpTableTargetCount": context.get(
            "edgeTriggerDirectCallGraphIndirectIndexedJumpTableTargetCount"
        ),
        "edgeTriggerDirectCallGraphIndirectIndexedJumpTableUniqueTargetCount": context.get(
            "edgeTriggerDirectCallGraphIndirectIndexedJumpTableUniqueTargetCount"
        ),
        "edgeTriggerDirectCallGraphIndirectIndexedJumpTableAllTargetsLocalToEdgeHandlers": context.get(
            "edgeTriggerDirectCallGraphIndirectIndexedJumpTableAllTargetsLocalToEdgeHandlers"
        ),
        "edgeTriggerDirectCallGraphIndirectIndexedJumpTableOutsideEdgeHandlerTargetCount": context.get(
            "edgeTriggerDirectCallGraphIndirectIndexedJumpTableOutsideEdgeHandlerTargetCount"
        ),
        "edgeTriggerDirectCallGraphIndirectTransitionTargetHitCount": context.get(
            "edgeTriggerDirectCallGraphIndirectTransitionTargetHitCount"
        ),
        "edgeTriggerDirectCallGraphIndirectRouteImmediateHitCount": context.get(
            "edgeTriggerDirectCallGraphIndirectRouteImmediateHitCount"
        ),
        "edgeTriggerDirectCallGraphDepthSensitivityMaxDepthChecked": context.get(
            "edgeTriggerDirectCallGraphDepthSensitivityMaxDepthChecked"
        ),
        "edgeTriggerDirectCallGraphDepthSensitivityProofAbsentAcrossCheckedDepths": context.get(
            "edgeTriggerDirectCallGraphDepthSensitivityProofAbsentAcrossCheckedDepths"
        ),
        "edgeTriggerDirectCallGraphDepthSensitivityCountsStableAtAndBeyondDefaultDepth": context.get(
            "edgeTriggerDirectCallGraphDepthSensitivityCountsStableAtAndBeyondDefaultDepth"
        ),
        "edgeTriggerGenericBoundaryTransitionProven": context.get(
            "edgeTriggerGenericBoundaryTransitionProven"
        ),
        "strictTargetLinkFound": context.get("strictTargetLinkFound"),
        "frontierHasOnlySelectorSceneList": context.get("frontierHasOnlySelectorSceneList"),
        "confirmedLikePatternFound": context.get("confirmedLikePatternFound"),
        "proofFound": context.get("proofFound"),
        "strictSourceHotspotProofFound": context.get("strictSourceHotspotProofFound"),
        "failedStrictHotspotGateIds": context.get("failedStrictHotspotGateIds") or [],
        "missingEvidence": context.get("missingEvidence") or [],
        "strictHotspotRejectionClassification": context.get("strictHotspotRejectionClassification"),
        "strictHotspotRejection": context.get("strictHotspotRejection") or {},
        "promotionStatus": context.get("promotionStatus"),
    }


def strict_source_hotspot_context_brief(evidence: dict | None) -> str:
    if not evidence:
        return "-"
    return (
        f"candidateRows={evidence.get('candidateSummaryCount')} "
        f"evidenceRows={evidence.get('evidenceRowCount')} "
        f"evidenceRefs={evidence.get('evidenceRefCount')} "
        f"remainingProofs={evidence.get('remainingProofCount')} "
        f"candidates={evidence.get('candidateCount')} "
        f"candidateAllBlocked={evidence.get('candidateAllBlocked')} "
        "candidateBlocks="
        f"{json.dumps(evidence.get('candidateBlockReasonCounts') or {}, sort_keys=True, separators=(',', ':'))} "
        f"reviews/events={evidence.get('transitionReviewRowCount')}/"
        f"{evidence.get('eventTransitionCount')} "
        f"strict={evidence.get('strictSourceCoordinateFound')}/"
        f"{evidence.get('tileHotspotConfirmed')} "
        f"proofFound={evidence.get('proofFound')} "
        f"coordBlocked={evidence.get('allCoordinateRefsNonPromotable')} "
        f"variantBlocked={evidence.get('allVariantScansNonPromotable')} "
        "targetSpawnCoord="
        f"{evidence.get('targetSpawnCoordinateScanCount')}/"
        f"{evidence.get('targetSpawnCoordinateCurrentRootHitCount')}/"
        f"{evidence.get('targetSpawnCoordinateCharacterDescriptorHitCount')}/"
        f"{evidence.get('targetSpawnCoordinatePromotableHitCount')}/"
        f"{evidence.get('targetSpawnCoordinateAllInterestingHitsNonPromotable')} "
        "targetSpawnClasses="
        f"{json.dumps(evidence.get('targetSpawnCoordinateCurrentRootClassificationCounts') or {}, sort_keys=True, separators=(',', ':'))}/"
        f"{json.dumps(evidence.get('targetSpawnCoordinateCharacterDescriptorClassificationCounts') or {}, sort_keys=True, separators=(',', ':'))} "
        "byteCoord="
        f"{evidence.get('byteCoordinateScanCount')}/"
        f"{evidence.get('byteCoordinateSequenceHitCount')}/"
        f"{evidence.get('byteCoordinateStrictSourceTargetHitCount')}/"
        f"{evidence.get('byteCoordinateCurrentSelectorRootHitCount')}/"
        f"{evidence.get('strictByteCoordinateEvidenceFound')} "
        "targetByteCoord="
        f"{evidence.get('targetSpawnByteCoordinateScanCount')}/"
        f"{evidence.get('targetSpawnByteCoordinateStrictSourceTargetHitCount')}/"
        f"{evidence.get('targetSpawnByteCoordinateCurrentSelectorRootHitCount')}/"
        f"{evidence.get('targetSpawnStrictByteCoordinateEvidenceFound')} "
        "cnsPayload="
        f"{evidence.get('cnsPayloadBytePairScanCount')}/"
        f"{evidence.get('cnsPayloadSequenceHitCount')}/"
        f"{evidence.get('cnsPayloadHeaderHitCount')},"
        f"{evidence.get('cnsPayloadLayerHitCount')},"
        f"{evidence.get('cnsPayloadOutsideStructuredHitCount')}/"
        f"{evidence.get('strictCnsCoordinateEvidenceFound')} "
        f"tileMatches=center:{evidence.get('centerPairStrictEventMatchCount')},"
        f"low3x3:{evidence.get('low3x3StrictEventMatchCount')},"
        f"pair:{evidence.get('pair3x3StrictEventMatchCount')} "
        "targetSpawnSig="
        f"points:{evidence.get('targetSpawnTargetMapStrictEventPointCount')},"
        f"matches:{evidence.get('targetSpawnCenterPairStrictEventMatchCount')}/"
        f"{evidence.get('targetSpawnLow3x3StrictEventMatchCount')}/"
        f"{evidence.get('targetSpawnPair3x3StrictEventMatchCount')},"
        f"targetMap:{evidence.get('targetSpawnCenterPairTargetMapMatchCount')}/"
        f"{evidence.get('targetSpawnLow3x3TargetMapMatchCount')}/"
        f"{evidence.get('targetSpawnPair3x3TargetMapMatchCount')},"
        f"low3x3Owners:{owner_pair_summary(evidence.get('targetSpawnLow3x3OwnerPairs'))},"
        "low3x3Target/confirmed/rejected:"
        f"{evidence.get('targetSpawnLow3x3TargetLinkedMatchCount')}/"
        f"{evidence.get('targetSpawnLow3x3ConfirmedReviewMatchCount')}/"
        f"{evidence.get('targetSpawnLow3x3RejectedReviewMatchCount')},"
        f"low3x3GenericOnly:{evidence.get('targetSpawnLow3x3GenericOnly')},"
        f"zero:{evidence.get('allTargetSpawnCenterPairMatchesZero')}/"
        f"{evidence.get('allTargetSpawnPair3x3MatchesZero')}/"
        f"{evidence.get('allTargetSpawnTargetMapStrictEventsZero')} "
        f"centerOwners={evidence.get('centerPairOwnerText') or owner_pair_summary(evidence.get('centerPairOwnerPairs'))} "
        "centerSame/target/confirmed/rejected="
        f"{evidence.get('centerPairSameSourceMatchCount')}/"
        f"{evidence.get('centerPairTargetLinkedMatchCount')}/"
        f"{evidence.get('centerPairConfirmedReviewMatchCount')}/"
        f"{evidence.get('centerPairRejectedReviewMatchCount')} "
        f"allCenterRejected={evidence.get('allCenterPairMatchesRejectedReview')} "
        f"targetLinked={evidence.get('targetLinkedStrictEventMatchCount')} "
        f"direct={evidence.get('directSourceTargetStrictEventMatchCount')} "
        f"points={evidence.get('resourcePointCandidateCount')}/"
        f"{evidence.get('routeExitPointCandidateCount')} "
        f"frontierPointClasses={evidence.get('currentFrontierPointCandidateClassCounts')} "
        f"frontierRouteHits={evidence.get('currentFrontierRouteExitPointHitCount')} "
        f"branch={evidence.get('readerBranchClassification')} "
        "selectorOverlap="
        f"{evidence.get('targetSelectorOnlySourceOverlapCount')}/"
        f"{evidence.get('targetSelectorOnlySourceTargetRoutePairClusterCount')} "
        "frontierBreadth="
        f"{evidence.get('currentFrontierManifestMapCount')}/"
        f"{evidence.get('currentFrontierRoutePairCount')}/"
        f"{evidence.get('currentFrontierSourceOutgoingRoutePairCount')}/"
        f"{evidence.get('currentFrontierTargetIncomingRoutePairCount')} "
        "edgeTrigger="
        f"{evidence.get('edgeTriggerSourceBoundaryCandidateCount')}/"
        f"{evidence.get('edgeTriggerAutoBoundaryCandidateCount')}/"
        f"{evidence.get('edgeTriggerTransitionLikeDirectRelHitCount')}/"
        f"{evidence.get('edgeTriggerRouteImmediateHitCount')} "
        "edgeLatchWindow="
        f"{evidence.get('edgeTriggerDirectionLatchTextRefCount')}/"
        f"{evidence.get('edgeTriggerDirectionLatchRouteWindowRelHitCount')}/"
        f"{evidence.get('edgeTriggerDirectionLatchRouteWindowImmediateHitCount')} "
        "edgeGlobal="
        f"{evidence.get('edgeTriggerGlobalMapLoaderRelHitCount')}/"
        f"{evidence.get('edgeTriggerGlobalScriptRunnerRelHitCount')}/"
        f"{evidence.get('edgeTriggerGlobalSelectorTableRelHitCount')} "
        "edgeScriptRunnerWindows="
        f"{evidence.get('edgeTriggerScriptRunnerCallerCount')}/"
        f"{evidence.get('edgeTriggerScriptRunnerRouteWindowImmediateHitCount')}/"
        f"{evidence.get('edgeTriggerScriptRunnerMapLoaderWindowRelHitCount')}/"
        f"{evidence.get('edgeTriggerScriptRunnerSelectorTableWindowRelHitCount')} "
        "edgeSelectedPointerWindows="
        f"{evidence.get('edgeTriggerSelectedPointerImmediateRefCount')}/"
        f"{evidence.get('edgeTriggerSelectedPointerRouteSpecificWindowHitCount')} "
        "edgeEncoded="
        f"{evidence.get('edgeTriggerHandlerEncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerHandlerEncodedTargetTransitionRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerHandlerEncodedTargetRouteProofRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerHandlerEncodedTargetSelectedPointerRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerHandlerEncodedTargetPromotingCandidateCount')};"
        f"{evidence.get('edgeTriggerLocalWindowEncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerLocalWindowEncodedTargetTransitionRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerLocalWindowEncodedTargetRouteProofRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerLocalWindowEncodedTargetSelectedPointerRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerLocalWindowEncodedTargetPromotingCandidateCount')};"
        f"{evidence.get('edgeTriggerCallGraphEncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerCallGraphEncodedTargetTransitionRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerCallGraphEncodedTargetRouteProofRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerCallGraphEncodedTargetSelectedPointerRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerCallGraphEncodedTargetPromotingCandidateCount')};"
        f"{evidence.get('edgeTriggerGlobalContrastEncodedTargetRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerGlobalContrastEncodedTargetTransitionRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerGlobalContrastEncodedTargetRouteProofRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerGlobalContrastEncodedTargetSelectedPointerRawScalarCandidateCount')}/"
        f"{evidence.get('edgeTriggerGlobalContrastEncodedTargetPromotingCandidateCount')} "
        "edgeEncodedClass="
        f"{evidence.get('edgeTriggerHandlerEncodedTargetClassification')}/"
        f"{evidence.get('edgeTriggerLocalWindowEncodedTargetClassification')}/"
        f"{evidence.get('edgeTriggerCallGraphEncodedTargetClassification')}/"
        f"{evidence.get('edgeTriggerGlobalContrastEncodedTargetClassification')} "
        "edgeCallerWindows="
        f"{evidence.get('edgeTriggerActorControllerCallerCount')}/"
        f"{evidence.get('edgeTriggerActorControllerCallerRouteWindowRelHitCount')}/"
        f"{evidence.get('edgeTriggerActorControllerCallerRouteWindowImmediateHitCount')};"
        f"{evidence.get('edgeTriggerCollisionHelperCallerCount')}/"
        f"{evidence.get('edgeTriggerCollisionHelperCallerRouteWindowRelHitCount')}/"
        f"{evidence.get('edgeTriggerCollisionHelperCallerRouteWindowImmediateHitCount')} "
        "edgeCallGraph="
        f"{evidence.get('edgeTriggerDirectCallGraphRejectionClassification')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphReachableFunctionCount')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphDirectCallEdgeCount')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphTransitionTargetReachableCount')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphTransitionTargetHitCount')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphRouteImmediateHitCount')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphIndirectCallLikeByteCount')} "
        "edgeCallGraphSensitivity="
        f"{evidence.get('edgeTriggerDirectCallGraphDepthSensitivityMaxDepthChecked')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphDepthSensitivityProofAbsentAcrossCheckedDepths')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphDepthSensitivityCountsStableAtAndBeyondDefaultDepth')} "
        "edgeIndirectGraph="
        f"{evidence.get('edgeTriggerDirectCallGraphIndirectRejectionClassification')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphIndirectIndexedJumpTableCandidateCount')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphIndirectIndexedJumpTableEntryCount')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphIndirectIndexedJumpTableTargetCount')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphIndirectIndexedJumpTableUniqueTargetCount')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphIndirectIndexedJumpTableOutsideEdgeHandlerTargetCount')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphIndirectTransitionTargetHitCount')}/"
        f"{evidence.get('edgeTriggerDirectCallGraphIndirectRouteImmediateHitCount')} "
        f"edgeIndirectLocal={evidence.get('edgeTriggerDirectCallGraphIndirectIndexedJumpTableAllTargetsLocalToEdgeHandlers')} "
        f"edgeStatus={evidence.get('edgeTriggerPromotionStatus')} "
        f"selectorOnly={evidence.get('currentPairSelectorAdjacencyOnly')} "
        f"proof={evidence.get('strictSourceHotspotProofFound')} "
        f"failedStrictHotspotGates={','.join(evidence.get('failedStrictHotspotGateIds') or []) or '-'} "
        f"missingEvidenceCount={len(evidence.get('missingEvidence') or [])} "
        f"reject={evidence.get('strictHotspotRejectionClassification')} "
        f"status={evidence.get('promotionStatus')}"
    )


def classify_next_actions(
    blocker: dict,
    frontier: dict,
    branch: dict,
    selection_flow: dict,
    strict_clusters: list[dict],
    coordinate_variant_scan: dict | None = None,
    map_exit_coordinate_refs: dict | None = None,
    exit_coordinate_context: dict | None = None,
    original_collision_route_audit: dict | None = None,
    event_shape_scan: dict | None = None,
    gate_base_proof: dict | None = None,
    branch_gate_consistency: dict | None = None,
    branch_selector_equation: dict | None = None,
    gate_offset_sources: dict | None = None,
    gate_offset_patterns: dict | None = None,
    gate_base_candidates: dict | None = None,
    gate_sample_values: dict | None = None,
    gate_pass_matrix: dict | None = None,
    predecessor_state_effect: dict | None = None,
    predecessor_persistence: dict | None = None,
    predecessor_branch_execution: dict | None = None,
    active_flag_effect: dict | None = None,
    secondary_fill_roots: dict | None = None,
    inherited_state_candidates: dict | None = None,
    current_state_sources: dict | None = None,
    predecessor_tail_reset: dict | None = None,
    branch_state_writers: dict | None = None,
    branch_state_dispatch: dict | None = None,
    secondary_state_sources: dict | None = None,
    branch_state_opcode_overlap: dict | None = None,
    event_object_branch_state: dict | None = None,
    predecessor_route_order: dict | None = None,
    selector_set_decomposition: dict | None = None,
    selector_recomposition_lattice: dict | None = None,
    mapset_aliases: dict | None = None,
    target_alias_state_effects: dict | None = None,
    address_predecessor_context: dict | None = None,
    target_alias_bridge: dict | None = None,
    route_root_ref_context: dict | None = None,
    predecessor_bridge_refs: dict | None = None,
    reverse_reuse_context: dict | None = None,
    merge_bridge_matrix: dict | None = None,
    selected_pointer_opcode_paths: dict | None = None,
    global_selected_pointer_paths: dict | None = None,
    selected_pointer_usage: dict | None = None,
    selected_root_execution_gap: dict | None = None,
    route_pair_entry_execution_gap: dict | None = None,
    opcode08_activation_windows: dict | None = None,
    opcode08_unreadable_producers: dict | None = None,
    opcode09_pointer_collisions: dict | None = None,
    synthetic_savedata_probe: dict | None = None,
    real_savedata_evidence_gap: dict | None = None,
    selection_buffer20_provenance: dict | None = None,
    secondary_reset_scope: dict | None = None,
    secondary_global_reset_gap: dict | None = None,
    secondary_block_writes: dict | None = None,
    runtime_selector_byte_writes: dict | None = None,
    post_gate_reset_candidates: dict | None = None,
    secondary_route_overlap_candidates: dict | None = None,
    opcode24_mode1_indirect_context: dict | None = None,
    opcode24_mode1_file_read_context: dict | None = None,
    opcode24_mode1_block_writes: dict | None = None,
    opcode24_runtime_enabled_block_writes: dict | None = None,
    opcode24_mode1_source_writes: dict | None = None,
    opcode24_mode1_runtime_context: dict | None = None,
    opcode24_runtime_enabled_context: dict | None = None,
    opcode24_mode1_default_effect: dict | None = None,
    opcode24_globals: dict | None = None,
    opcode24_payload_table: dict | None = None,
    resource_ref_scan: dict | None = None,
    opcode20_object_base_candidates: dict | None = None,
    opcode20_order_space: dict | None = None,
    opcode20_context_f2_sources: dict | None = None,
    opcode20_slot_sources: dict | None = None,
    opcode20_descriptor_scripts: dict | None = None,
    opcode20_sample_order: dict | None = None,
    opcode20_runtime_materializers: dict | None = None,
    opcode20_nested_base_modes: dict | None = None,
    wrapper_descriptor_context: dict | None = None,
    scene_payload_context: dict | None = None,
    scene_list_context: dict | None = None,
    frontier_reader_branch_context: dict | None = None,
    frontier_payload_shape: dict | None = None,
    scene_adjacency_index: dict | None = None,
    leaf_table_context: dict | None = None,
    leaf_index_space: dict | None = None,
    route_pair_descriptor_context: dict | None = None,
    opcode07_indexed_pointers: dict | None = None,
    object61_stream_operands: dict | None = None,
    context58_consumers: dict | None = None,
    current_root_frontier_paths: dict | None = None,
    selection_buffer_bases: dict | None = None,
    record_pattern_contrast: dict | None = None,
    strict_target_link_gap: dict | None = None,
    hotspot_gap: dict | None = None,
    entry_context: dict | None = None,
    selector_bridge: dict | None = None,
    manifest_point_scan: dict | None = None,
    root_point_scan: dict | None = None,
    opcode20_slot_descriptor_writers: dict | None = None,
    opcode24_current_root_modes: dict | None = None,
    current_writer_paths: dict | None = None,
    edge_trigger_gap: dict | None = None,
    strict_event_tile_signature: dict | None = None,
    strict_source_hotspot_context: dict | None = None,
    runtime_source_save_load_variant_context: dict | None = None,
    runtime_predecessor_route_attempt_context: dict | None = None,
    exit_target_ranking: dict | None = None,
    predecessor_fill_order_gap: dict | None = None,
    predecessor_fill_opcode10_context: dict | None = None,
    predecessor_descriptor_bridge_gap: dict | None = None,
    predecessor_fill_site_execution_context: dict | None = None,
    merge_runtime_context: dict | None = None,
    merge_closure_context: dict | None = None,
    runtime_opcode24_flag_context: dict | None = None,
) -> list[dict]:
    actions = []
    if selection_flow and not selection_flow.get("hasLocalWriterForBranchOffset"):
        predecessor_all_starts_pass = (predecessor_state_effect or {}).get("allStartsPassReader") is True
        runtime_split = (predecessor_branch_execution or {}).get("runtimeBranchStateSplit") or {}
        predecessor_fill_not_observed = (
            runtime_split.get("classification") == "public-predecessor-reached-fill-not-observed"
        )
        actions.append({
            "priority": 1,
            "status": "open",
            "task": (
                "Prove predecessor fill-site execution/order before the current reader."
                if predecessor_fill_not_observed
                else "Prove predecessor branch-state execution and persistence."
                if predecessor_all_starts_pass
                else "Trace the inherited branch selector value."
            ),
            "why": (
                (
                    "The public predecessor runtime path reaches selector 1:0 but leaves secondaryBranchState "
                    "all zero; local/static reset evidence is closed, so the next proof is whether the 1:0 "
                    "fill sites execute before the 0x00542b0c reader."
                )
                if predecessor_fill_not_observed
                else (
                    "The strongest predecessor-fill hypothesis makes every start slot pass the frontier reader, "
                    "but predecessor execution order and state persistence are still unproven."
                )
                if predecessor_all_starts_pass
                else (
                    f"The frontier branch reads selectionBuffer[{selection_flow.get('branchSelectionBufferOffsetHex')}], "
                    "but the local stream does not write that offset before the branch."
                )
            ),
            "evidence": (
                (
                    (
                        "The current frontier still inherits selectionBuffer[0x20]; public predecessor polling "
                        "reached 1:0 but did not observe the expected fill, so proof now depends on fill-site "
                        "execution/order before the current reader"
                    )
                    if predecessor_fill_not_observed
                    else (
                        "The current frontier still inherits selectionBuffer[0x20], but the predecessor-fill "
                        "hypothesis narrows the value side; proof now depends on 1:0 execution order and state persistence"
                    )
                )
                if predecessor_all_starts_pass
                else selection_flow.get("conclusion", "")
            )
            + f"; {predecessor_state_effect_brief(predecessor_state_effect)}; "
            + branch_selector_equation_brief(branch_selector_equation)
            + "; "
            + active_flag_effect_brief(active_flag_effect)
            + f"; {predecessor_route_order_brief(predecessor_route_order)}"
            + f"; predecessor branch-state execution: {predecessor_branch_state_execution_brief(predecessor_branch_execution)}"
            + f"; predecessor fill execution/order: {predecessor_fill_execution_order_gap_brief(predecessor_fill_order_gap)}"
            + f"; predecessor fill opcode10 context: {predecessor_fill_opcode10_context_brief(predecessor_fill_opcode10_context)}"
            + f"; predecessor descriptor bridge: {predecessor_descriptor_bridge_gap_brief(predecessor_descriptor_bridge_gap)}"
            + f"; predecessor fill-site execution context: {predecessor_fill_site_execution_context_brief(predecessor_fill_site_execution_context)}"
            + f"; runtime predecessor route attempt: {predecessor_route_attempt_brief(runtime_predecessor_route_attempt_context)}"
            + f"; selector recomposition lattice: {selector_recomposition_lattice_brief(selector_recomposition_lattice)}"
            + f"; mapset aliases: {mapset_aliases_brief(mapset_aliases)}"
            + f"; target alias state effects: {target_alias_state_effects_brief(target_alias_state_effects)}"
            + f"; {route_root_ref_context_brief(route_root_ref_context)}"
            + f"; {address_predecessor_context_brief(address_predecessor_context)}"
            + f"; {target_alias_bridge_brief(target_alias_bridge)}"
            + f"; {predecessor_bridge_refs_brief(predecessor_bridge_refs)}; "
            + f"reverse reuse context: {reverse_reuse_context_brief(reverse_reuse_context)}; "
            + selection_buffer20_provenance_brief(selection_buffer20_provenance)
            + f"; {secondary_reset_scope_brief(secondary_reset_scope)}; "
            + f"{secondary_global_reset_gap_brief(secondary_global_reset_gap)}; "
            + f"{secondary_block_writes_brief(secondary_block_writes)}; "
            + f"{runtime_selector_byte_writes_brief(runtime_selector_byte_writes)}; "
            + f"{secondary_route_overlap_brief(secondary_route_overlap_candidates)}; "
            + f"{secondary_fill_roots_brief(secondary_fill_roots)}; "
            + f"{inherited_state_candidates_brief(inherited_state_candidates)}; "
            + f"{current_state_sources_brief(current_state_sources)}; "
            + f"{predecessor_tail_reset_brief(predecessor_tail_reset)}; "
            + f"{branch_state_writers_brief(branch_state_writers)}; "
            + f"{branch_state_dispatch_brief(branch_state_dispatch)}; "
            + f"{secondary_state_sources_brief(secondary_state_sources)}; "
            + f"{branch_state_opcode_overlap_brief(branch_state_opcode_overlap)}; "
            + f"{event_object_branch_state_brief(event_object_branch_state)}; "
            + f"{global_selected_pointer_paths_brief(global_selected_pointer_paths)}; "
            + f"{selected_root_execution_gap_brief(selected_root_execution_gap)}; "
            + f"{opcode24_payload_table_brief(opcode24_payload_table)}; "
            + post_gate_reset_brief(post_gate_reset_candidates),
            "evidenceRefs": [
                evidence_ref(
                    "out/save_selector_predecessor_branch_state_execution_gap.json",
                    "proofFound",
                    "failedBranchStateExecutionGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "runtimeBranchStateSplit",
                    "fillExecutionOrderProofFound",
                    "fillSiteExecutionContextProven",
                ),
                evidence_ref(
                    "out/save_selector_predecessor_fill_execution_order_gap.json",
                    "localFillTraceReachesCurrentReader",
                    "rootEntryFixedTraversalFillSitesReachable",
                    "predecessorDescriptorDependsOnSaveSelectorSliceModel",
                    "rawGenericClassification",
                    "rawGenericCallGraphClassification",
                    "rawGenericCallGraphProofFound",
                    "rawGenericCallGraphDepthSensitivity",
                    "rawGenericRouteProofFound",
                    "predecessorDispatchTableBaseAuditRows",
                    "predecessorFillProofGateRows",
                    "predecessorFillProofGateCount",
                    "predecessorFillProofGatePassCount",
                    "predecessorFillProofGateBlockedIds",
                    "predecessorFillProofGateBlockedCount",
                    "predecessorFillAllProofGatesBlocked",
                    "failedPredecessorFillOrderGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "proofFound",
                ),
                evidence_ref(
                    "out/save_selector_predecessor_fill_opcode10_context.json",
                    "helperOnlyDirectCallInsideOpcode10Handler",
                    "directFillSiteTextRefCount",
                    "runtimeObservedAllZero",
                    "branchStatePollSampleCount",
                    "branchStatePollFillMatchCount",
                    "requiredProofGateCount",
                    "requiredProofGatePassCount",
                    "requiredProofGateFailCount",
                    "requiredProofGateFailIds",
                    "requiredProofGateAllBlocked",
                    "failedPredecessorFillOpcode10GateIds",
                    "missingEvidence",
                    "evidenceRefCount",
                    "proofFound",
                ),
                evidence_ref(
                    "out/save_selector_predecessor_fill_site_execution_context.json",
                    "branchStatePollSampleCount",
                    "branchStatePollFillMatchCount",
                    "descriptorEdgeRejectionClassification",
                    "requiredProofGates",
                    "requiredProofGateCount",
                    "requiredProofGatePassCount",
                    "requiredProofGateFailCount",
                    "requiredProofGateFailIds",
                    "requiredProofGateAllBlocked",
                    "fillSiteExecutionContextProven",
                    "proofFound",
                    "failedPredecessorFillGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_predecessor_descriptor_bridge_gap.json",
                    "proofFound",
                    "failedDescriptorBridgeGateIds",
                    "missingEvidence",
                    "evidenceRefCount",
                    "descriptorEdgeRejectionClassification",
                    "rootStopToFillBridgeFound",
                    "fillStopToCurrentBridgeFound",
                    "descriptorBridgeProofFound",
                ),
                evidence_ref(
                    "out/save_selector_merge_runtime_context.json",
                    "forwardBridgeAbsent",
                    "reverseReuseBeforeFillOnly",
                    "selectorMergeRuntimeProofFound",
                    "proofFound",
                    "failedSelectorMergeRuntimeGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                ),
                evidence_ref(
                    "out/save_selector_selected_root_execution_gap.json",
                    "proofFound",
                    "failedSelectedRootGateIds",
                    "missingEvidence",
                    "selectedRootExecutionRefFound",
                    "selectedRootExecutionRejectionClassification",
                    "saveLoaderGate",
                    "runtimeProbeGate",
                    "remainingProofs",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/runtime_predecessor_coordinate_source_scan.json",
                    "classification",
                    "promotionStatus",
                    "proofFound",
                    "predecessorCoordinateSourceProofFound",
                    "failedPredecessorCoordinateSourceGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "sourceSave",
                    "scanTargets",
                    "pointerTables",
                    "staticBasePairHits",
                    "trailRingPairHits",
                    "pairHitSummaryRows",
                    "coordinateSourceRejectionClassification",
                    "publicSaveStartPointerTableTileHitCount",
                    "publicSaveStartStaticBaseHitCount",
                    "publicSaveStartTrailRingHitCount",
                    "publicSaveStartImageHitCount",
                    "reciprocalPointerTableTileHitCount",
                    "reciprocalStaticBaseHitCount",
                    "reciprocalTrailRingHitCount",
                    "reciprocalImageHitCount",
                    "remainingProofs",
                    "imagePairHits",
                ),
                evidence_ref(
                    "out/runtime_predecessor_route_attempt_context.json",
                    "proofFound",
                    "predecessorRouteAttemptProofFound",
                    "routeSelectorHitCount",
                    "currentRootHitCount",
                    "observedSelectorCounts",
                    "dominantDiversionSelector",
                    "diversionSelectorContextCount",
                    "diversionRoutePromotionEvidenceFound",
                    "publicPredecessorSelectorContext",
                    "failedPredecessorRouteAttemptGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
            ],
        })
    if predecessor_persistence and predecessor_persistence.get("persistenceProven") is False:
        actions.append({
            "priority": 2,
            "status": "open",
            "task": "Resolve selector merge before using predecessor 1:0 persistence.",
            "why": (
                "The confirmed source-side route overlaps selector 0:0, while predecessor 1:0 is target-side only. "
                "The current 2:0 row looks like a merge of those selector lists, not a proven execution sequence."
            ),
            "evidence": (
                predecessor_persistence_brief(predecessor_persistence)
                + f"; merge runtime context: {merge_runtime_context_brief(merge_runtime_context)}"
                + f"; merge closure context: {merge_closure_context_brief(merge_closure_context)}"
                + f"; {predecessor_route_order_brief(predecessor_route_order)}"
                + f"; {selector_set_decomposition_brief(selector_set_decomposition)}"
                + f"; selector recomposition lattice: {selector_recomposition_lattice_brief(selector_recomposition_lattice)}"
                + f"; mapset aliases: {mapset_aliases_brief(mapset_aliases)}"
                + f"; target alias state effects: {target_alias_state_effects_brief(target_alias_state_effects)}"
                + f"; {address_predecessor_context_brief(address_predecessor_context)}"
                + f"; {target_alias_bridge_brief(target_alias_bridge)}"
                + f"; {route_root_ref_context_brief(route_root_ref_context)}"
                + f"; {predecessor_bridge_refs_brief(predecessor_bridge_refs)}"
                + f"; reverse reuse context: {reverse_reuse_context_brief(reverse_reuse_context)}"
                + f"; {merge_bridge_matrix_brief(merge_bridge_matrix)}"
                + f"; {selected_pointer_opcode_paths_brief(selected_pointer_opcode_paths)}"
                + f"; {global_selected_pointer_paths_brief(global_selected_pointer_paths)}"
                + f"; {selected_pointer_usage_brief(selected_pointer_usage)}"
                + f"; {selected_root_execution_gap_brief(selected_root_execution_gap)}"
                + f"; route-pair entry execution gap: {route_pair_entry_execution_gap_brief(route_pair_entry_execution_gap)}"
                + f"; {runtime_selector_byte_writes_brief(runtime_selector_byte_writes)}"
                + f"; {opcode08_activation_windows_brief(opcode08_activation_windows)}"
                + f"; {opcode08_unreadable_producers_brief(opcode08_unreadable_producers)}"
                + f"; {opcode09_pointer_collisions_brief(opcode09_pointer_collisions)}"
                + f"; {wrapper_descriptor_context_brief(wrapper_descriptor_context)}"
                + f"; {opcode24_payload_table_brief(opcode24_payload_table)}"
                + f"; {leaf_table_context_brief(leaf_table_context)}"
                + f"; {leaf_index_space_brief(leaf_index_space)}"
                + f"; {route_pair_descriptor_context_brief(route_pair_descriptor_context)}"
                + f"; {opcode07_indexed_pointers_brief(opcode07_indexed_pointers)}"
                + f"; {object61_stream_operands_brief(object61_stream_operands)}"
                + f"; {current_root_frontier_paths_brief(current_root_frontier_paths)}"
                + f"; {secondary_route_overlap_brief(secondary_route_overlap_candidates)}"
            ),
            "evidenceRefs": [
                evidence_ref(
                    "out/save_selector_predecessor_persistence_gap.json",
                    "proofFound",
                    "predecessorPersistenceProofFound",
                    "failedPredecessorPersistenceGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "persistenceProven",
                    "selectorMergeGapOpen",
                    "routeOrderProven",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_predecessor_route_order.json",
                    "proofFound",
                    "predecessorRouteOrderProofFound",
                    "failedPredecessorRouteOrderGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "routeOrderProven",
                    "selectorMergeGapOpen",
                    "sourceRoutePreviousSelector",
                    "predecessorIsTargetSideOnly",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_merge_runtime_context.json",
                    "mergeShapeOnly",
                    "forwardBridgeAbsent",
                    "selectorMergeRuntimeProofFound",
                    "proofFound",
                    "failedSelectorMergeRuntimeGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                ),
                evidence_ref(
                    "out/save_selector_merge_closure_context.json",
                    "selectorMergeClosureProofFound",
                    "proofFound",
                    "failedSelectorMergeGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "predecessorPersistenceUsableForCurrent",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_merge_execution_gap.json",
                    "sourceToCurrentBridgeHitCount",
                    "currentToPredecessorBeforeFillHitCount",
                    "selectorMergeExecutionProofFound",
                    "proofFound",
                    "failedSelectorMergeExecutionGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                ),
                evidence_ref(
                    "out/save_selector_set_decomposition.json",
                    "currentEqualsPredecessorPlusSource",
                    "sourcePredecessorUnionCoversCurrent",
                    "executionOrderProven",
                    "proofFound",
                    "failedSelectorSetDecompositionGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                ),
                evidence_ref(
                    "out/save_selector_target_alias_bridges.json",
                    "forwardHitsAddressAdjacentOnly",
                    "targetAliasExecutionExclusionStatus",
                    "aliasToCurrentExecutionLikeBridgeFound",
                    "proofFound",
                    "failedTargetAliasBridgeGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                ),
                evidence_ref(
                    "out/save_selector_route_root_ref_context.json",
                    "allRouteSelectorRootsTableOnly",
                    "predecessorToCurrentRootRefFound",
                    "routeOrderProven",
                    "proofFound",
                    "failedRouteRootRefGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                ),
                evidence_ref(
                    "out/save_selector_reverse_reuse_context.json",
                    "reverseHitCount",
                    "beforePredecessorFillHitCount",
                    "fillSiteHitCount",
                    "alignedTargetCount",
                    "unalignedTargetCount",
                    "classificationCounts",
                    "forwardMergeBridgeHitCount",
                    "directMergeExecutionBridgeFound",
                    "proofFound",
                    "reverseReuseProofFound",
                    "failedReverseReuseGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_merge_bridge_matrix.json",
                    "sourceToCurrentHitCount",
                    "predecessorToCurrentHitCount",
                    "currentToPredecessorHitCount",
                    "currentToPredecessorBeforeFillHitCount",
                    "currentToPredecessorFillSiteHitCount",
                    "forwardMergeBridgeHitCount",
                    "forwardEncodedAnchorRawScalarCandidateCount",
                    "forwardEncodedAnchorPromotingCandidateCount",
                    "directMergeExecutionBridgeFound",
                    "encodedMergeExecutionBridgeFound",
                    "currentPredecessorHitsBeforeFillOnly",
                    "selectorMergeProofStatus",
                    "proofFound",
                    "failedMergeBridgeGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_route_pair_entry_execution_gap.json",
                    "proofFound",
                    "failedRoutePairEntryGateIds",
                    "missingEvidence",
                    "routePairEntryExecutionProven",
                    "correctedTraceNormalSelectionGapFound",
                    "selectedRootExecutionRefFound",
                    "wrapperExecutionProofFound",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
            ],
        })
    if synthetic_savedata_probe and synthetic_savedata_probe.get("notRoutePromotionProof") is True:
        actions.append({
            "priority": 4,
            "status": "open",
            "task": "Replace the synthetic selector 2:0 savedat vector with real captured evidence.",
            "why": (
                "The constructed savedat proves table resolution to selector 2:0, but it is not a captured gameplay "
                "save and does not prove runtime execution order or a strict map1_01a trigger."
            ),
            "evidence": (
                f"{synthetic_savedata_probe_brief(synthetic_savedata_probe)}; "
                f"{real_savedata_evidence_gap_brief(real_savedata_evidence_gap)}; "
                f"{selected_pointer_usage_brief(selected_pointer_usage)}"
            ),
            "evidenceRefs": [
                evidence_ref(
                    "out/synthetic_savedata_selector_probe.json",
                    "selector",
                    "selectedPointerHex",
                    "notRoutePromotionProof",
                    "promotionStatus",
                    "proofFound",
                    "syntheticSavedataProbeProofFound",
                    "failedSyntheticSavedataGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                ),
                evidence_ref(
                    "out/save_selector_real_savedata_evidence_gap.json",
                    "realCandidateCount",
                    "validRealCandidateCount",
                    "validRealUniqueSha256Count",
                    "validRealDuplicateGroupCount",
                    "validRealCandidateRows",
                    "validRealCandidateBlockReasonCounts",
                    "validRealCandidatesAllBlocked",
                    "requiredByteCoverage",
                    "proofFound",
                    "routeEvidenceProofFound",
                    "failedSavedataGateIds",
                    "missingEvidence",
                    "routeEvidenceRejectionClassification",
                    "currentSelectorRealSaveCount",
                    "selectedPointerRealSaveCount",
                    "routePairRealSaveCount",
                    "routePromotionRealSaveCount",
                    "syntheticDiagnosticExcluded",
                    "publicSearchNotes",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/savedata_slot_scan.json",
                    "status",
                    "promotionStatus",
                    "proofFound",
                    "savedataSlotScanProofFound",
                    "failedSavedataSlotScanGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "foundCount",
                    "validCount",
                    "currentSelectorCandidateCount",
                    "realRouteEvidenceCandidateCount",
                    "syntheticDiagnosticCount",
                    "archiveFoundCount",
                    "archiveValidCount",
                ),
                evidence_ref(
                    "out/save_selector_selected_pointer_usage.json",
                    "selectedPointerGlobalHex",
                    "currentSelectorRootHex",
                    "currentCodeRefCount",
                    "noStaticDirectCurrentSelectorCodeRef",
                    "routePromotionStatus",
                    "promotionStatus",
                    "proofFound",
                    "selectedPointerUsageProofFound",
                    "failedSelectedPointerUsageGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                ),
            ],
        })
    resource_gates = [
        step for step in branch.get("branchSteps") or []
        if str(step.get("branchTargetKind") or "").startswith("cns:")
        and not str(step.get("branchTargetKind") or "").startswith("cns:map")
    ]
    if resource_gates:
        first_gate = resource_gates[0]
        actions.append({
            "priority": 3,
            "status": "blocked",
            "task": "Treat the save-selector branch as a resource/scene-list gate, not a map transition.",
            "why": (
                "The branch target is a character/object CNS resource, while the target map appears later as "
                "another scene record in the selector list."
            ),
            "evidence": (
                f"{first_gate.get('streamVaHex')} target={first_gate.get('branchTargetKind')} "
                f"fallthrough={first_gate.get('fallthroughVaHex')}"
                f"; {scene_list_context_brief(scene_list_context)}; "
                f"{frontier_reader_branch_context_brief(frontier_reader_branch_context)}; "
                f"{frontier_payload_shape_brief(frontier_payload_shape)}; "
                f"{scene_adjacency_index_brief(scene_adjacency_index)}"
            ),
            "evidenceRefs": [
                evidence_ref(
                    "out/save_selector_scene_list_context.json",
                    "currentFrontier",
                    "rowCount",
                    "proofFound",
                    "failedSceneListGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_frontier_reader_branch_context.json",
                    "classification",
                    "passOutcome",
                    "failOutcome",
                    "proofFound",
                    "failedFrontierReaderGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "runtimeSelectionProven",
                    "strictHotspotFound",
                ),
                evidence_ref(
                    "out/save_selector_frontier_payload_shape.json",
                    "allPayloadsFitPairedImages",
                    "sourceInBoundsPointCount",
                    "payloadTextRefCount",
                    "proofFound",
                    "failedFrontierPayloadGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_scene_adjacency_index.json",
                    "adjacentPairsWithoutStrictOrConfirmedCount",
                    "currentPairSelectorAdjacencyOnly",
                    "currentPairStrictEventBacked",
                    "proofFound",
                    "failedSceneAdjacencyGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                ),
            ],
        })
    if not frontier.get("directEventTransition"):
        coordinate_evidence = coordinate_variant_brief(coordinate_variant_scan)
        actions.append({
            "priority": 5,
            "status": "open",
            "task": "Find a strict source coordinate or hotspot before promotion.",
            "why": "The frontier currently comes from save-selector scene links, not from event transition coordinates.",
            "evidence": (
                f"sourceEventCount={frontier.get('sourceEventCount')} "
                f"targetEventCount={frontier.get('targetEventCount')}; "
                f"coordinate variant scan: {coordinate_evidence}; "
                f"coordinate refs: {map_exit_coordinate_refs_brief(map_exit_coordinate_refs)}; "
                f"coordinate context: {exit_coordinate_context_brief(exit_coordinate_context)}; "
                f"original collision audit: {original_collision_route_audit_brief(original_collision_route_audit)}; "
                f"hotspot gap: {hotspot_gap_brief(hotspot_gap)}; "
                f"resource ref scan: {resource_ref_scan_brief(resource_ref_scan)}; "
                f"scene payload context: {scene_payload_context_brief(scene_payload_context)}; "
                f"frontier reader branch context: {frontier_reader_branch_context_brief(frontier_reader_branch_context)}; "
                f"frontier payload shape: {frontier_payload_shape_brief(frontier_payload_shape)}; "
                f"record pattern contrast: {record_pattern_contrast_brief(record_pattern_contrast)}; "
                f"strict target link gap: {strict_target_link_gap_brief(strict_target_link_gap)}; "
                f"scene adjacency index: {scene_adjacency_index_brief(scene_adjacency_index)}; "
                f"entry context: {entry_context_brief(entry_context)}; "
                f"selector bridge: {selector_bridge_brief(selector_bridge)}; "
                f"manifest point scan: {manifest_point_scan_brief(manifest_point_scan)}; "
                f"root point scan: {root_point_scan_brief(root_point_scan)}; "
                f"edge trigger gap: {edge_trigger_gap_brief(edge_trigger_gap)}; "
                f"strict event tile signature: {strict_event_tile_signature_brief(strict_event_tile_signature)}; "
                f"strict source hotspot context: {strict_source_hotspot_context_brief(strict_source_hotspot_context)}; "
                "runtime source-save load variant context: "
                f"{runtime_source_save_load_variant_context_brief(runtime_source_save_load_variant_context)}; "
                f"exit target ranking: {exit_target_ranking_brief(exit_target_ranking)}"
            ),
            "evidenceRefs": [
                evidence_ref(
                    "out/map1_01a_strict_source_hotspot_context.json",
                    "candidateSummaries",
                    "evidence",
                    "remainingProofs",
                    "candidateCount",
                    "strictHotspotRejectionClassification",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "strictSourceCoordinateFound",
                    "tileHotspotConfirmed",
                    "proofFound",
                    "failedStrictHotspotGateIds",
                    "missingEvidence",
                    "targetSpawnCoordinateCurrentRootClassificationCounts",
                    "targetSpawnCoordinateCharacterDescriptorClassificationCounts",
                    "targetSpawnCoordinatePromotableHitCount",
                    "strictSourceHotspotProofFound",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/map1_01a_strict_hotspot_review_matrix.json",
                    "candidateRows",
                    "remainingProofs",
                    "transitionReviewRowCount",
                    "eventTransitionCount",
                    "candidateGateSummary",
                    "proofFound",
                    "strictHotspotReviewProofFound",
                    "failedStrictHotspotReviewGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/map1_01a_exit_coordinate_variant_scan.json",
                    "spanSequenceHitCount",
                    "spanCurrentRootHitCount",
                    "targetSpawnCurrentRootClassificationCounts",
                    "targetSpawnCharacterDescriptorClassificationCounts",
                    "targetSpawnPromotableHitCount",
                    "strictCoordinateEvidenceFound",
                    "proofFound",
                    "exitCoordinateVariantProofFound",
                    "failedExitCoordinateVariantGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/map_exit_coordinate_refs.json",
                    "promotionPolicy",
                    "promotionStatus",
                    "proofFound",
                    "mapExitCoordinateRefProofFound",
                    "failedMapExitCoordinateRefGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "rows",
                ),
                evidence_ref(
                    "out/map1_01a_exit_coordinate_context.json",
                    "xyPackedHex",
                    "xyHitCount",
                    "hitVaHex",
                    "ownerSelector",
                    "ownerLinkedCns",
                    "classification",
                    "proofFound",
                    "exitCoordinateContextProofFound",
                    "failedExitCoordinateContextGateIds",
                    "missingEvidence",
                    "evidenceRefCount",
                    "promotable",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/map1_01a_exit_byte_coordinate_scan.json",
                    "bytePairScanCount",
                    "targetSpawnBytePairScanCount",
                    "sequenceHitCount",
                    "strictSourceTargetByteHitCount",
                    "targetSpawnStrictSourceTargetByteHitCount",
                    "strictByteCoordinateEvidenceFound",
                    "targetSpawnStrictByteCoordinateEvidenceFound",
                    "proofFound",
                    "exitByteCoordinateProofFound",
                    "failedExitByteCoordinateGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/map1_01a_exit_cns_payload_scan.json",
                    "bytePairScanCount",
                    "wordPairScanCount",
                    "outsideStructuredHitCount",
                    "strictCnsCoordinateEvidenceFound",
                    "proofFound",
                    "exitCnsPayloadCoordinateProofFound",
                    "failedExitCnsPayloadGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/original_collision_route_audit.json",
                    "collisionMode",
                    "routeCandidateCount",
                    "sourceOriginalStandableCandidateCount",
                    "targetOriginalStandableSpawnCount",
                    "promotionAllowed",
                    "promotionStatus",
                    "proofFound",
                    "originalCollisionRouteProofFound",
                    "failedOriginalCollisionRouteGateIds",
                    "missingEvidence",
                    "evidenceRefCount",
                ),
                evidence_ref(
                    "out/map1_01a_tile_hotspot_pattern_contrast.json",
                    "currentCandidatesMatchingConfirmedLowNibbleCount",
                    "currentCandidatesMatchingConfirmedCenterPairCount",
                    "currentCandidatesMatchingConfirmedLow3x3Count",
                    "currentCandidatesMatchingConfirmedPair3x3Count",
                    "currentStrictTransitionReviewCount",
                    "tileHotspotConfirmed",
                    "proofFound",
                    "tileHotspotPatternProofFound",
                    "failedTileHotspotPatternGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/map1_01a_strict_event_tile_signature_scan.json",
                    "strictEventRecordCount",
                    "strictEventPointCount",
                    "targetLinkedStrictEventRecordCount",
                    "directSourceTargetStrictEventRecordCount",
                    "candidateCount",
                    "centerPairMatchCount",
                    "allCenterPairMatchesRejectedReview",
                    "targetSpawnTargetMapStrictEventPointCount",
                    "tileHotspotConfirmed",
                    "tileSignaturePromotes",
                    "promotionStatus",
                    "proofFound",
                    "strictEventTileSignatureProofFound",
                    "failedStrictEventTileSignatureGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                ),
                evidence_ref(
                    "out/map1_01a_edge_trigger_gap.json",
                    "candidateRows",
                    "directCallGraphEvidence",
                    "missingPromotionEvidence",
                    "sourceBoundaryCandidateCount",
                    "transitionLikeDirectRelHitCountInHelperOrController",
                    "directRouteImmediateCountInHelperOrController",
                    "promotionStatus",
                    "proofFound",
                    "edgeTriggerProofFound",
                    "failedEdgeTriggerGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                ),
                evidence_ref(
                    "out/runtime_source_save_load_variant_context.json",
                    "classification",
                    "proofFound",
                    "runtimeSourceSaveLoadVariantProofFound",
                    "failedRuntimeSourceSaveLoadVariantGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "exitPath",
                    "readyPathSummary",
                    "strictSourceHotspotProofFound",
                    "selectedRootExecutionProofFound",
                    "routePromotionEvidenceFound",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/map1_01a_exit_target_ranking.json",
                    "exits",
                    "blockedTargetCandidates",
                    "selectorOutgoingCandidates",
                    "confirmedIncomingReviews",
                    "remainingProofs",
                    "exitCount",
                    "blockedTargetExitCount",
                    "selectorOutgoingOnlyCount",
                    "proofFound",
                    "exitTargetRankingProofFound",
                    "failedExitTargetRankingGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
            ],
        })
    if gate_base_proof and gate_base_proof.get("activeOrderOnlyProofEliminated") is True:
        actions.append({
            "priority": 6,
            "status": "open",
            "task": "Prove current selector leaf selection and wrapper execution.",
            "why": (
                "The current 2:0 root contains route-adjacent leaves, but the traced reader leaf is indirect and "
                "the direct opcode 0x07/object+0x61 paths do not select the frontier."
            ),
            "evidence": (
                f"{current_root_frontier_paths_brief(current_root_frontier_paths)}; "
                f"{leaf_table_context_brief(leaf_table_context)}; "
                f"{leaf_index_space_brief(leaf_index_space)}; "
                f"{route_pair_descriptor_context_brief(route_pair_descriptor_context)}; "
                f"{target_alias_bridge_brief(target_alias_bridge)}; "
                f"{opcode24_payload_table_brief(opcode24_payload_table)}; "
                f"{selected_pointer_usage_brief(selected_pointer_usage)}; "
                f"{global_selected_pointer_paths_brief(global_selected_pointer_paths)}; "
                f"route-pair entry execution gap: {route_pair_entry_execution_gap_brief(route_pair_entry_execution_gap)}; "
                f"{opcode07_indexed_pointers_brief(opcode07_indexed_pointers)}; "
                f"{object61_stream_operands_brief(object61_stream_operands)}; "
                f"{context58_consumers_brief(context58_consumers)}; "
                f"{current_writer_paths_brief(current_writer_paths)}"
            ),
            "evidenceRefs": [
                evidence_ref(
                    "out/save_selector_selected_root_execution_gap.json",
                    "proofFound",
                    "failedSelectedRootGateIds",
                    "missingEvidence",
                    "selectedRootExecutionRefFound",
                    "selectedRootExecutionRejectionClassification",
                    "selectedRootExecutionRejection",
                    "selectedRootSubgateStatusOrder",
                    "selectedRootSubgateStatuses",
                    "selectedRootNonPromotingSubgateCount",
                    "gateRows",
                    "remainingProofs",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "staticReferenceGate",
                    "runtimeProbeGate",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_wrapper_execution_gap.json",
                    "proofFound",
                    "failedWrapperGateIds",
                    "missingEvidence",
                    "wrapperExecutionProofFound",
                    "currentSelectorLeafExecutionProofFound",
                    "correctedTraceNormalSelectionGapFound",
                    "readerBearingNegativeOnly",
                    "evidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "remainingProofs",
                ),
                evidence_ref(
                    "out/save_selector_route_pair_entry_execution_gap.json",
                    "routePairEntryExecutionProven",
                    "proofFound",
                    "failedRoutePairEntryGateIds",
                    "missingEvidence",
                    "correctedTraceNormalSelectionGapFound",
                    "globalCurrentFrontierLeafOnlyNegative",
                    "opcode07DirectEntrySelectionAbsent",
                    "evidenceRows",
                    "routePairEntryRows",
                    "negativeReaderRows",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "remainingProofs",
                ),
                evidence_ref(
                    "out/save_selector_route_pair_index_source_gap.json",
                    "routeEntryIndices",
                    "routePairEntryIndices",
                    "negativeReaderEntryIndices",
                    "entryPointerRefCount",
                    "entryPointerTextRefCount",
                    "entryPointerPromotingRefCount",
                    "encodedEntryAnchorRawScalarCandidateCount",
                    "encodedEntryAnchorBranchAttachedEncodedFieldCount",
                    "encodedEntryAnchorModeledControlFlowCandidateCount",
                    "encodedEntryAnchorPromotingCandidateCount",
                    "encodedEntryAnchorClassification",
                    "entryPointerOpcode5aFallthroughRefCount",
                    "entryPointerFallthroughNonCodeRefCount",
                    "nonNegativeEntryPointerPromotingRefCount",
                    "negativeReaderEntryPointerPromotingRefCount",
                    "higherLevelIndexSourceProven",
                    "proofFound",
                    "failedRoutePairIndexSourceGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_leaf_table_context.json",
                    "runtimeSelectionProven",
                    "proofFound",
                    "failedLeafTableGateIds",
                    "missingEvidence",
                    "frontierLeafRefIsDirectRootTableEntry",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_leaf_index_space.json",
                    "entryCount",
                    "negativeIndexCount",
                    "routePairDescriptorCurrentEntryCount",
                    "readerBearingCurrentEntryCount",
                    "readerBearingNegativeEntryCount",
                    "frontierReaderSelectableByNonNegativeIndex",
                    "frontierReaderReachableByCorrectedNonNegativeIndex",
                    "proofFound",
                    "failedLeafIndexGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_leaf_table_global_context.json",
                    "selectorTableCount",
                    "fieldEntryRowCount",
                    "negativeFieldEntryRowCount",
                    "nonNegativeFieldEntryRowCount",
                    "currentSelectorRoutePairIndices",
                    "currentSelectorNegativeRoutePairRowCount",
                    "currentSelectorNonNegativeRoutePairRowCount",
                    "currentFrontierLeafOnlyNegative",
                    "runtimeSelectionProven",
                    "proofFound",
                    "leafTableGlobalProofFound",
                    "failedLeafTableGlobalGateIds",
                    "missingEvidence",
                    "remainingProofs",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_route_pair_descriptor_context.json",
                    "currentRoutePairDescriptorCount",
                    "currentRoutePairDescriptorIndices",
                    "currentRoutePairCorrectedTraceReachesReaderCount",
                    "currentRoutePairCorrectedTraceAllDescriptorsReachReader",
                    "currentRoutePairGeometryExitHitCount",
                    "readerBearingNegativeEntryCount",
                    "readerBearingNegativeIndices",
                    "frontierReaderSelectableByNonNegativeIndex",
                    "frontierReaderReachableByCorrectedNonNegativeIndex",
                    "runtimeSelectionProven",
                    "proofFound",
                    "routePairDescriptorProofFound",
                    "failedRoutePairDescriptorGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode2c_route_pair_context.json",
                    "routePairDescriptorCount",
                    "oldNoFixedAdvanceStopCount",
                    "correctedTraceReachesReaderCount",
                    "correctedTraceAllRoutePairDescriptorsReachReader",
                    "runtimeSelectionProven",
                    "proofFound",
                    "opcode2cRoutePairProofFound",
                    "failedOpcode2cRoutePairGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_current_writer_paths.json",
                    "classification",
                    "rootHex",
                    "writerVaHex",
                    "writerValueHex",
                    "proofFound",
                    "currentWriterPathProofFound",
                    "failedCurrentWriterPathGateIds",
                    "missingEvidence",
                    "remainingProofs",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
            ],
        })
    if gate_base_proof and gate_base_proof.get("activeOrderOnlyProofEliminated") is True:
        actions.append({
            "priority": 7,
            "status": "open",
            "task": "Prove the opcode 0x20 gate-time base path, not just active order.",
            "why": (
                "The local gate window has only opcode 0x20 as a base candidate, and descriptor+0/+4/+8 scanning "
                "does not directly reference field maps, the current frontier, or the 0xe8/0xea gate offsets."
            ),
            "evidence": (
                f"{gate_base_proof_brief(gate_base_proof)}; "
                f"{branch_gate_consistency_brief(branch_gate_consistency)}; "
                f"{gate_offset_sources_brief(gate_offset_sources)}; "
                f"{gate_offset_patterns_brief(gate_offset_patterns)}; "
                f"{gate_base_candidates_brief(gate_base_candidates)}; "
                f"{gate_sample_values_brief(gate_sample_values)}; "
                f"{gate_pass_matrix_brief(gate_pass_matrix)}; "
                f"{selection_buffer_bases_brief(selection_buffer_bases)}; "
                f"{opcode20_object_base_brief(opcode20_object_base_candidates)}; "
                f"{opcode20_order_space_brief(opcode20_order_space)}; "
                f"{opcode20_context_f2_brief(opcode20_context_f2_sources)}; "
                f"{opcode20_slot_sources_brief(opcode20_slot_sources)}; "
                f"{opcode20_slot_descriptor_writers_brief(opcode20_slot_descriptor_writers)}; "
                f"{opcode20_descriptor_scripts_brief(opcode20_descriptor_scripts)}; "
                f"{opcode20_sample_order_brief(opcode20_sample_order)}; "
                f"{opcode20_runtime_materializers_brief(opcode20_runtime_materializers)}; "
                f"{opcode20_nested_base_modes_brief(opcode20_nested_base_modes)}"
            ),
            "evidenceRefs": [
                evidence_ref(
                    "out/save_selector_gate_base_proof_gap.json",
                    "proofFound",
                    "gateBaseProofFound",
                    "activeOrderProofFound",
                    "gateTimeBaseProofFound",
                    "failedGateBaseGateIds",
                    "missingEvidence",
                    "gateWindowRows",
                    "localBaseAffectingRowsBeforeGate",
                    "activeOrderOnlyProofEliminated",
                    "descriptorAllScriptSpecificGateBaseProven",
                    "promotionStatus",
                    "remainingProofs",
                    "evidenceRefs",
                    "evidenceRefCount",
                ),
                evidence_ref(
                    "out/save_selector_gate_offset_sources.json",
                    "gateOffsetsHex",
                    "gates",
                    "anyScriptLocalSelectionWriter",
                    "anyGlobalScriptSelectionWriter",
                    "controlPathGateStatus",
                    "controlPathProofStatus",
                    "proofFound",
                    "gateOffsetSourceProofFound",
                    "failedGateOffsetSourceGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_gate_offset_patterns.json",
                    "offsets",
                    "totalReaderCount",
                    "totalWriterCount",
                    "proofFound",
                    "gateOffsetPatternProofFound",
                    "failedGateOffsetPatternGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_gate_base_candidates.json",
                    "baseCandidates",
                    "candidateCount",
                    "directRefCandidateCount",
                    "partySlotStatByteCandidateCount",
                    "runtimePointerModeStillRequired",
                    "proofFound",
                    "gateBaseCandidateProofFound",
                    "failedGateBaseCandidateGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_gate_sample_values.json",
                    "sampleCount",
                    "uniqueSelectorCount",
                    "currentFrontierSampleCovered",
                    "saveRuntimeGateSampleRows",
                    "partySlotStatSampleRows",
                    "runtimePointerModeStillRequired",
                    "proofFound",
                    "gateSampleValueProofFound",
                    "failedGateSampleValueGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_gate_pass_matrix.json",
                    "gateRows",
                    "saveRuntimePassMatrix",
                    "saveRuntimePredecessorAllGatePassSampleCount",
                    "saveRuntimeZeroTableAllGatePassSampleCount",
                    "runtimeBaseProofRequired",
                    "predecessorPersistenceProofRequired",
                    "strictHotspotProofRequired",
                    "proofFound",
                    "gatePassMatrixProofFound",
                    "failedGatePassMatrixGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_selection_buffer_bases.json",
                    "immediateAssignments",
                    "registerAssignments",
                    "knownStaticGateOffsetDirectRefCount",
                    "runtimePointerModeStillRequired",
                    "proofFound",
                    "selectionBufferBaseProofFound",
                    "failedSelectionBufferBaseGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode20_object_base_candidates.json",
                    "candidates",
                    "candidateCount",
                    "contextF2ObjectSelectorCount",
                    "fieldMapRowsAfterCandidateCount",
                    "currentFrontierRowsAfterCandidateCount",
                    "gateSelectionRowsAfterCandidateCount",
                    "runtimeObjectPointerProofRequired",
                    "proofFound",
                    "opcode20ObjectBaseProofFound",
                    "failedOpcode20ObjectBaseGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode20_order_space.json",
                    "uniqueOrderSpace",
                    "repeatAllowedOrderSpace",
                    "descriptorRowCount",
                    "currentFrontierSampleCovered",
                    "activeOrderAlonePromotesRoute",
                    "runtimeDescriptorObjectStateRequired",
                    "proofFound",
                    "opcode20OrderSpaceProofFound",
                    "failedOpcode20OrderSpaceGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode20_nested_base_modes.json",
                    "currentModeIsNestedObjectPlus4",
                    "directContextA8SetterCount",
                    "proofFound",
                    "opcode20NestedBaseProofFound",
                    "failedOpcode20NestedBaseGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode20_context_f2_sources.json",
                    "referenceCount",
                    "readReferenceCount",
                    "writeReferenceCount",
                    "runtimeObjectTableReaderCount",
                    "directInitializerCount",
                    "copyWriterCount",
                    "constantWriteCount",
                    "objectBaseCandidateCount",
                    "contextF2ObjectSelectorCount",
                    "fixedStream2ObjectSelectorCount",
                    "currentFrontierSampleCovered",
                    "activeOrderAlonePromotesRoute",
                    "diagnosticRuntimeObjectTableEvidence",
                    "fixedContextF2ValueProvenForCurrentFrontier",
                    "specificRuntimeObjectPointerProven",
                    "runtimeObjectTableStateRequired",
                    "proofFound",
                    "opcode20ContextF2ProofFound",
                    "failedOpcode20ContextF2GateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode20_slot_sources.json",
                    "runtimeSlotCountRequired",
                    "runtimeSlotDescriptorPointersRequired",
                    "controlPathProofStatus",
                    "proofFound",
                    "opcode20SlotSourceProofFound",
                    "failedOpcode20SlotSourceGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode20_descriptor_scripts.json",
                    "scriptSlotAggregateRows",
                    "script4SpecificGateBaseProven",
                    "allScriptsSpecificGateBaseProven",
                    "runtimeActiveOrderRequired",
                    "controlPathProofStatus",
                    "proofFound",
                    "opcode20DescriptorScriptProofFound",
                    "failedOpcode20DescriptorScriptGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode20_slot_descriptor_writers.json",
                    "descriptorRows",
                    "routines",
                    "descriptorWriteCount",
                    "opcode20Mode0ScriptSource",
                    "runtimeActiveOrderRequired",
                    "proofFound",
                    "opcode20DescriptorWriterProofFound",
                    "failedOpcode20DescriptorWriterGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode20_sample_order_effects.json",
                    "sampleRows",
                    "sampleCount",
                    "uniqueSampleStateCount",
                    "currentFrontierSampleCovered",
                    "allSamplesHaveKnownDescriptorIndices",
                    "controlPathProofStatus",
                    "proofFound",
                    "opcode20SampleOrderProofFound",
                    "failedOpcode20SampleOrderGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode20_runtime_materializers.json",
                    "materializers",
                    "loadRebuildEvidence",
                    "currentRouteSameLowByteRows",
                    "descriptorScriptMutationRows",
                    "currentFrontierActiveOrderProven",
                    "opcode20SelfMutationPathEliminated",
                    "controlPathProofStatus",
                    "proofFound",
                    "opcode20RuntimeMaterializerProofFound",
                    "failedOpcode20RuntimeMaterializerGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
            ],
        })
    if (opcode24_mode1_indirect_context or {}).get("noStaticBaseIndirectCandidate") is True:
        file_read_count = (opcode24_mode1_file_read_context or {}).get("mode1FileReadCandidateCount")
        block_count = (opcode24_mode1_block_writes or {}).get("blockWriteCandidateCount")
        runtime_flag_block_count = (opcode24_runtime_enabled_block_writes or {}).get("blockWriteCandidateCount")
        actions.append({
            "priority": 8,
            "status": "open",
            "task": "Capture a runtime producer trace for opcode 0x24 mode1 source.",
            "why": (
                "Static scans now rule out direct writes, savedata backing, and the known "
                "0x0059e310+0x38 base-immediate path for 0x0059e348"
                + (", ReadFile destinations" if file_read_count == 0 else "")
                + (", and broad block-write candidates." if block_count == 0 else ".")
                + (
                    " The runtime enabled flag 0x0059e34d also has no broad block-write candidate."
                    if runtime_flag_block_count == 0
                    else ""
                )
            ),
            "evidence": (
                f"mode1={opcode24_mode1_indirect_context.get('mode1SourceHex')} "
                f"globalBase={opcode24_mode1_indirect_context.get('globalBufferBaseHex')} "
                f"base+mode1 candidates={opcode24_mode1_indirect_context.get('basePlusMode1OffsetCandidateCount')} "
                f"short-window writes={opcode24_mode1_indirect_context.get('baseWindowMode1WriteCandidateCount')} "
                f"nearby-base writes={opcode24_mode1_indirect_context.get('nearbyBaseWindowMode1WriteCandidateCount')} "
                f"file-read candidates={file_read_count if file_read_count is not None else '-'}; "
                f"block writes={block_count if block_count is not None else '-'}; "
                f"runtimeFlagBlockWrites={runtime_flag_block_count if runtime_flag_block_count is not None else '-'}; "
                f"{opcode24_mode1_source_writes_brief(opcode24_mode1_source_writes)}; "
                f"{opcode24_mode1_runtime_context_brief(opcode24_mode1_runtime_context)}; "
                f"{opcode24_runtime_enabled_context_brief(opcode24_runtime_enabled_context)}; "
                f"{opcode24_mode1_default_effect_brief(opcode24_mode1_default_effect)}; "
                f"{opcode24_globals_brief(opcode24_globals)}; "
                f"{opcode24_current_root_modes_brief(opcode24_current_root_modes)}; "
                "runtimeOpcode24FlagContext="
                f"{(runtime_opcode24_flag_context or {}).get('classification')}/"
                f"polls={(runtime_opcode24_flag_context or {}).get('pollCount')}/"
                f"realRoute={(runtime_opcode24_flag_context or {}).get('realRouteHitObserved')}/"
                f"constructedRoute={(runtime_opcode24_flag_context or {}).get('constructedRouteHitObserved')}/"
                f"runtimeFlagNonzero={(runtime_opcode24_flag_context or {}).get('runtimeFlagNonzeroObserved')}/"
                f"flag1={(runtime_opcode24_flag_context or {}).get('runtimeFlagOneCount')}/"
                f"mode1Nonzero={(runtime_opcode24_flag_context or {}).get('mode1SourceNonzeroObserved')}/"
                f"currentObjectNonzero={(runtime_opcode24_flag_context or {}).get('currentObjectIndexNonzeroObserved')}/"
                f"routeEvidence={(runtime_opcode24_flag_context or {}).get('routePromotionEvidenceFound')}/"
                f"sourceExitSamples="
                f"{next((poll.get('sampleCount') for poll in (runtime_opcode24_flag_context or {}).get('polls') or [] if poll.get('key') == 'sourceExitLoadConfirmed'), '-')}/"
                f"sourceSave={(runtime_opcode24_flag_context or {}).get('sourceSaveLoadClassification')}/"
                f"{(runtime_opcode24_flag_context or {}).get('sourceSaveLoadPromotionStatus')}/"
                f"{(runtime_opcode24_flag_context or {}).get('sourceSaveLoadReadyPathDiversionClassification')}/"
                f"{(runtime_opcode24_flag_context or {}).get('sourceSaveLoadReadyPathCount')}/"
                f"{(runtime_opcode24_flag_context or {}).get('sourceSaveLoadReadyPathRouteOrCurrentCount')}/"
                f"{(runtime_opcode24_flag_context or {}).get('sourceSaveLoadReadyPathCandidateOrOutsideCount')}/"
                f"{(runtime_opcode24_flag_context or {}).get('sourceSaveLoadDiversionSelector')}/"
                f"{','.join((runtime_opcode24_flag_context or {}).get('sourceSaveLoadDiversionFieldMaps') or []) or '-'}/"
                f"{(runtime_opcode24_flag_context or {}).get('sourceSaveLoadDiversionSelectedPointerCurrentProofCount')}/"
                f"{(runtime_opcode24_flag_context or {}).get('sourceSaveLoadDiversionRoutePromotionEvidenceFound')}/"
                f"{(runtime_opcode24_flag_context or {}).get('sourceSaveLoadRoutePromotionEvidenceFound')}/"
                f"proofFound={(runtime_opcode24_flag_context or {}).get('proofFound')}/"
                f"failedGates={','.join((runtime_opcode24_flag_context or {}).get('failedRuntimeOpcode24FlagGateIds') or [])}/"
                f"missingEvidenceCount={len((runtime_opcode24_flag_context or {}).get('missingEvidence') or [])}/"
                f"evidenceRefs={(runtime_opcode24_flag_context or {}).get('evidenceRefCount')}"
            ),
            "evidenceRefs": [
                evidence_ref(
                    "out/save_selector_opcode24_mode1_indirect_context.json",
                    "mode1DirectRefs",
                    "globalBaseDirectRefs",
                    "basePlusOffsetRows",
                    "basePlusMode1OffsetCandidates",
                    "baseWindowMode1WriteCandidates",
                    "nearbyBaseWindowMode1WriteCandidates",
                    "noStaticBaseIndirectCandidate",
                    "basePlusMode1OffsetCandidateCount",
                    "baseWindowMode1WriteCandidateCount",
                    "proofFound",
                    "opcode24Mode1IndirectProofFound",
                    "failedOpcode24Mode1IndirectGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode24_mode1_source_writes.json",
                    "rows",
                    "coveringWrites",
                    "indexedWriteCandidates",
                    "addressProducerCandidates",
                    "staticProducerCandidates",
                    "coveringWriteCount",
                    "indexedWriteCandidateCount",
                    "staticProducerCandidateCount",
                    "proofFound",
                    "opcode24Mode1SourceWriteProofFound",
                    "failedOpcode24Mode1SourceWriteGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode24_mode1_file_read_context.json",
                    "globalDestinationReadFileRows",
                    "mode1FileReadCandidates",
                    "readFileCallCount",
                    "globalDestinationReadFileCount",
                    "mode1FileReadCandidateCount",
                    "proofFound",
                    "opcode24Mode1FileReadProofFound",
                    "failedOpcode24Mode1FileReadGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode24_mode1_block_writes.json",
                    "rows",
                    "addressLikeCoveringBases",
                    "directCoveringWrites",
                    "blockWriteCandidates",
                    "blockWriteCandidateCount",
                    "proofFound",
                    "opcode24Mode1BlockWriteProofFound",
                    "failedOpcode24Mode1BlockWriteGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode24_mode1_runtime_context.json",
                    "storage",
                    "saveReadBlocks",
                    "remainingProofs",
                    "saveReadBlockContainsMode1Source",
                    "directProducerSummary",
                    "proofFound",
                    "failedOpcode24RuntimeProducerGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode24_runtime_enabled_context.json",
                    "refs",
                    "storage",
                    "saveReadBlocks",
                    "remainingProofs",
                    "modeDispatchRequiresRuntimeFlagOne",
                    "proofFound",
                    "failedOpcode24RuntimeEnabledGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "directWriteCount",
                    "staticEvidenceProvesModeDispatch",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode24_runtime_enabled_block_writes.json",
                    "rows",
                    "addressLikeCoveringBases",
                    "directCoveringWrites",
                    "blockWriteCandidates",
                    "blockWriteCandidateCount",
                    "proofFound",
                    "opcode24RuntimeEnabledBlockWriteProofFound",
                    "failedOpcode24RuntimeEnabledBlockWriteGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/save_selector_opcode24_mode1_default_effect.json",
                    "object61ConsumerGroups",
                    "branchOperand",
                    "remainingProofs",
                    "routeOperandRowCount",
                    "staticDefaultPromotesRoute",
                    "directFrontierOperandCount",
                    "branchFrontierOperandCount",
                    "proofFound",
                    "opcode24Mode1DefaultEffectProofFound",
                    "failedOpcode24Mode1DefaultEffectGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/runtime_trace_feasibility.json",
                    "canRunRuntimeTraceNow",
                    "blockers",
                    "tracePoints",
                    "proofFound",
                    "failedRuntimeTraceGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/runtime_trace_execution_probe.json",
                    "canCaptureTraceNow",
                    "blockers",
                    "probes",
                    "qemuI386Binfmt",
                    "relocationContext",
                    "winePrefix",
                    "gdbMultiarchPath",
                    "proofFound",
                    "runtimeTraceExecutionProofFound",
                    "failedRuntimeTraceExecutionGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
                evidence_ref(
                    "out/runtime_opcode24_flag_context.json",
                    "classification",
                    "promotionStatus",
                    "proofFound",
                    "runtimeOpcode24FlagProofFound",
                    "failedRuntimeOpcode24FlagGateIds",
                    "missingEvidence",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "pollCount",
                    "realRouteHitObserved",
                    "constructedRouteHitObserved",
                    "runtimeFlagOneCount",
                    "mode1SourceNonzeroObserved",
                    "runtimeFlagNonzeroObserved",
                    "currentObjectIndexNonzeroObserved",
                    "selectedRootExecutionProofFound",
                    "routePromotionEvidenceFound",
                    "sourceSaveLoadClassification",
                    "sourceSaveLoadPromotionStatus",
                    "sourceSaveLoadReadyPathDiversionClassification",
                    "sourceSaveLoadReadyPathCount",
                    "sourceSaveLoadReadyPathRouteOrCurrentCount",
                    "sourceSaveLoadReadyPathCandidateOrOutsideCount",
                    "sourceSaveLoadDiversionSelector",
                    "sourceSaveLoadDiversionFieldMaps",
                    "sourceSaveLoadDiversionSelectedPointerCurrentProofCount",
                    "sourceSaveLoadDiversionRoutePromotionEvidenceFound",
                    "sourceSaveLoadRoutePromotionEvidenceFound",
                ),
            ],
        })
    if branch and branch.get("sourceTilesetMatch") is False:
        actions.append({
            "priority": 10,
            "status": "open",
            "task": "Resolve the source scene/render mismatch.",
            "why": (
                "The selector source scene record uses tilesets that do not match the accepted render for "
                f"{blocker.get('source')}."
            ),
            "evidence": (
                f"record={','.join(branch.get('sourceRecordTilesets') or [])}; "
                f"accepted={','.join((branch.get('sourceAcceptedRender') or {}).get('tilesets') or [])}"
            ),
            "evidenceRefs": [
                evidence_ref(
                    "out/save_selector_frontier_branches.json",
                    "sourceRecordTilesets",
                    "sourceAcceptedRender",
                    "sourceTilesetMatch",
                ),
                evidence_ref(
                    "out/map_render_reviews.json",
                    "accepted",
                    "tilesets",
                    "state",
                ),
            ],
        })
    if strict_clusters:
        direct = [
            cluster for cluster in strict_clusters
            if cluster.get("role") == "direct-strict-candidate"
        ]
        best = direct[0] if direct else strict_clusters[0]
        actions.append({
            "priority": 9,
            "status": "candidate" if direct else "blocked",
            "task": (
                "Use direct strict-event clusters as the safer coordinate search root."
                if direct
                else "Do not promote from adjacent strict clusters without a target link."
            ),
            "why": (
                "A strict event cluster already connects this source to this target."
                if direct
                else "The related strict cluster is adjacent to the route but does not prove this source->target transition."
            ),
            "evidence": (
                f"{best.get('clusterStartHex')}..{best.get('clusterEndHex')} "
                f"role={best.get('role')} "
                f"events={', '.join(record.get('recordVaHex', '') for record in best.get('eventRecords') or [])}; "
                f"eventSources={','.join(best.get('eventSources') or []) or '-'}; "
                f"eventLinks={','.join(best.get('eventFieldLinks') or []) or '-'}"
            ),
            "evidenceRefs": [
                    evidence_ref(
                        "out/field_map_record_roots.json",
                        "clusters",
                        "strictEventLinkedClusterCount",
                        "selectorOnlyClusterCount",
                        "proofFound",
                        "fieldMapRecordRootsProofFound",
                        "failedFieldMapRecordRootGateIds",
                        "missingEvidence",
                        "evidenceRefs",
                        "evidenceRefCount",
                        "promotionStatus",
                    ),
                evidence_ref(
                    "out/map1_01a_strict_target_link_gap.json",
                    "directStrictEventTransitions",
                    "sourceStrictClusters",
                    "targetStrictClusters",
                    "targetSelectorOnlyClusters",
                    "currentFrontierCluster",
                    "directStrictEventTransitionCount",
                    "targetSelectorOnlyClusterCount",
                    "strictTargetLinkFound",
                    "proofFound",
                    "strictTargetLinkProofFound",
                    "failedStrictTargetLinkGateIds",
                    "missingEvidence",
                    "remainingProofs",
                    "evidenceRefs",
                    "evidenceRefCount",
                    "promotionStatus",
                ),
            ],
        })
    return sorted(actions, key=lambda row: row["priority"])


def build_rows(
    blockers: list[dict],
    frontier_rows: list[dict],
    branch_rows: list[dict],
    selection_flow_rows: list[dict],
    leaf_streams: list[dict],
    field_map_roots: dict,
    writer_chain_rows: list[dict] | None = None,
    gate_path_rows: list[dict] | None = None,
    opcode24_mode1_indirect_context: dict | None = None,
    opcode24_mode1_file_read_context: dict | None = None,
    opcode24_mode1_block_writes: dict | None = None,
    opcode24_runtime_enabled_block_writes: dict | None = None,
    opcode24_mode1_source_writes_summary: dict | None = None,
    opcode24_mode1_runtime_context_summary: dict | None = None,
    opcode24_runtime_enabled_context_summary: dict | None = None,
    opcode24_mode1_default_effect_summary: dict | None = None,
    exit_coordinate_variant_scan: dict | None = None,
    map_exit_coordinate_refs_summary: dict | None = None,
    exit_coordinate_context_summary: dict | None = None,
    original_collision_route_audit_summary: dict | None = None,
    gate_base_proof_gap: dict | None = None,
    branch_gate_consistency_summary: dict | None = None,
    branch_selector_equation_summary: dict | None = None,
    gate_offset_sources_summary: dict | None = None,
    gate_offset_patterns_summary: dict | None = None,
    gate_base_candidates_summary: dict | None = None,
    gate_sample_values_summary: dict | None = None,
    gate_pass_matrix_summary: dict | None = None,
    predecessor_state_effect: dict | None = None,
    predecessor_persistence_gap: dict | None = None,
    predecessor_branch_state_execution_gap_summary: dict | None = None,
    active_flag_effect: dict | None = None,
    secondary_fill_roots_summary: dict | None = None,
    inherited_state_candidates_summary: dict | None = None,
    current_state_sources_summary: dict | None = None,
    predecessor_tail_reset_summary: dict | None = None,
    branch_state_writers_summary: dict | None = None,
    branch_state_dispatch_summary: dict | None = None,
    secondary_state_sources_summary: dict | None = None,
    branch_state_opcode_overlap_summary: dict | None = None,
    event_object_branch_state_stream_candidates_summary: dict | None = None,
    event_object_branch_state_candidate_links_summary: dict | None = None,
    event_object_branch_state_block_context_summary: dict | None = None,
    predecessor_route_order: dict | None = None,
    selector_set_decomposition_summary: dict | None = None,
    selector_recomposition_lattice_summary: dict | None = None,
    mapset_aliases_summary: dict | None = None,
    target_alias_state_effects_summary: dict | None = None,
    address_predecessor_context_summary: dict | None = None,
    target_alias_bridges_summary: dict | None = None,
    route_root_ref_context_summary: dict | None = None,
    predecessor_bridge_refs: dict | None = None,
    reverse_reuse_context_summary: dict | None = None,
    merge_bridge_matrix_summary: dict | None = None,
    selected_pointer_opcode_paths_summary: dict | None = None,
    global_selected_pointer_paths_summary: dict | None = None,
    selected_pointer_usage_summary: dict | None = None,
    selected_root_execution_gap_summary: dict | None = None,
    route_pair_entry_execution_gap_summary: dict | None = None,
    opcode08_activation_windows_summary: dict | None = None,
    opcode08_unreadable_producers_summary: dict | None = None,
    opcode09_pointer_collisions_summary: dict | None = None,
    synthetic_savedata_selector_probe: dict | None = None,
    selection_buffer20_provenance: dict | None = None,
    data_descriptor_opcode_map: dict | None = None,
    opcode24_payload_table_summary: dict | None = None,
    real_savedata_evidence_gap: dict | None = None,
    opcode24_globals: dict | None = None,
    map1_resource_ref_scan: dict | None = None,
    opcode20_object_base_candidates: dict | None = None,
    opcode20_order_space_summary: dict | None = None,
    opcode20_context_f2_sources_summary: dict | None = None,
    opcode20_slot_sources_summary: dict | None = None,
    opcode20_descriptor_scripts_summary: dict | None = None,
    opcode20_sample_order_summary: dict | None = None,
    opcode20_runtime_materializers_summary: dict | None = None,
    opcode20_nested_base_modes_summary: dict | None = None,
    secondary_reset_scope: dict | None = None,
    secondary_global_reset_gap: dict | None = None,
    secondary_block_writes: dict | None = None,
    runtime_selector_byte_writes_summary: dict | None = None,
    post_gate_reset_candidates: dict | None = None,
    secondary_route_overlap_candidates: dict | None = None,
    wrapper_descriptor_context: dict | None = None,
    scene_payload_context: dict | None = None,
    scene_list_context: dict | None = None,
    scene_adjacency_index_summary: dict | None = None,
    leaf_table_context: dict | None = None,
    leaf_index_space_summary: dict | None = None,
    route_pair_descriptor_context: dict | None = None,
    opcode07_indexed_pointers: dict | None = None,
    object61_stream_operands: dict | None = None,
    context58_consumers_summary: dict | None = None,
    current_root_frontier_paths: dict | None = None,
    selection_buffer_bases_summary: dict | None = None,
    record_pattern_contrast_summary: dict | None = None,
    strict_target_link_gap_summary: dict | None = None,
    entry_context_summary: dict | None = None,
    selector_bridge_summary: dict | None = None,
    manifest_point_scan_summary: dict | None = None,
    root_point_scan_summary: dict | None = None,
    opcode20_slot_descriptor_writers_summary: dict | None = None,
    opcode24_current_root_modes_summary: dict | None = None,
    event_shape_scan_summary: dict | None = None,
    current_writer_paths_summary: list[dict] | None = None,
    edge_trigger_gap_summary: dict | None = None,
    hotspot_gap_summary: dict | None = None,
    tile_hotspot_pattern_summary: dict | None = None,
    strict_event_tile_signature_summary: dict | None = None,
    strict_hotspot_review_matrix_summary: dict | None = None,
    strict_source_hotspot_context_summary: dict | None = None,
    runtime_source_save_load_variant_context_summary: dict | None = None,
    runtime_predecessor_route_attempt_context_summary: dict | None = None,
    frontier_reader_branch_context_summary: dict | None = None,
    frontier_payload_shape_summary: dict | None = None,
    predecessor_fill_execution_order_gap_summary: dict | None = None,
    predecessor_fill_opcode10_context_summary: dict | None = None,
    predecessor_descriptor_bridge_gap_summary: dict | None = None,
    predecessor_fill_site_execution_context_summary: dict | None = None,
    merge_execution_gap_summary: dict | None = None,
    merge_runtime_context_summary: dict | None = None,
    merge_closure_context_summary: dict | None = None,
    exit_target_ranking_summary: dict | None = None,
    runtime_trace_feasibility_summary: dict | None = None,
    runtime_opcode24_flag_context_summary: dict | None = None,
) -> list[dict]:
    rows = []
    writer_chain_rows = writer_chain_rows or []
    gate_path_rows = gate_path_rows or []
    for blocker in blockers:
        source = blocker.get("source")
        target = blocker.get("target")
        if not source or not target:
            continue
        frontier = first_match(frontier_rows, source=source, target=target)
        branch = first_match(branch_rows, source=source, target=target)
        selection_flow = first_match(selection_flow_rows, source=source, target=target)
        leaves = [
            row for row in leaf_streams
            if row.get("source") == source and row.get("target") == target
        ]
        writer_chain = first_match(writer_chain_rows, source=source, target=target)
        gate_path = first_match(gate_path_rows, source=source, target=target)
        strict_clusters = related_strict_clusters(source, target, field_map_roots)
        coordinate_scan = coordinate_variant_scan_for(source, target, exit_coordinate_variant_scan)
        coordinate_refs = map_exit_coordinate_refs_for(source, target, map_exit_coordinate_refs_summary)
        exit_coordinate_context = exit_coordinate_context_for(source, target, exit_coordinate_context_summary)
        original_collision_audit = original_collision_route_audit_for(
            source,
            target,
            original_collision_route_audit_summary,
        )
        event_shape_scan = event_shape_scan_for(source, target, event_shape_scan_summary)
        gate_base_proof = gate_base_proof_for(source, target, gate_base_proof_gap)
        branch_gate_consistency = branch_gate_consistency_for(source, target, branch_gate_consistency_summary)
        branch_selector_equation = branch_selector_equation_for(source, target, branch_selector_equation_summary)
        gate_offset_sources = gate_offset_sources_for(source, target, gate_offset_sources_summary)
        gate_offset_patterns = gate_offset_patterns_for(source, target, gate_offset_patterns_summary)
        gate_base_candidates = gate_base_candidates_for(source, target, gate_base_candidates_summary)
        gate_sample_values = gate_sample_values_for(source, target, gate_sample_values_summary)
        gate_pass_matrix = gate_pass_matrix_for(source, target, gate_pass_matrix_summary)
        opcode20_object_base = opcode20_object_base_for(source, target, opcode20_object_base_candidates)
        opcode20_order_space = opcode20_order_space_for(source, target, opcode20_order_space_summary)
        opcode20_context_f2 = opcode20_context_f2_for(source, target, opcode20_context_f2_sources_summary)
        opcode20_slot_sources = opcode20_slot_sources_for(source, target, opcode20_slot_sources_summary)
        opcode20_slot_descriptor_writers = opcode20_slot_descriptor_writers_for(
            source,
            target,
            opcode20_slot_descriptor_writers_summary,
        )
        opcode20_descriptor_scripts = opcode20_descriptor_scripts_for(source, target, opcode20_descriptor_scripts_summary)
        opcode20_sample_order = opcode20_sample_order_for(source, target, opcode20_sample_order_summary)
        opcode20_runtime_materializers = opcode20_runtime_materializers_for(
            source,
            target,
            opcode20_runtime_materializers_summary,
        )
        opcode20_nested_base = opcode20_nested_base_modes_for(source, target, opcode20_nested_base_modes_summary)
        predecessor_effect = predecessor_state_effect_for(source, target, predecessor_state_effect)
        predecessor_persistence = predecessor_persistence_for(source, target, predecessor_persistence_gap)
        predecessor_branch_execution = predecessor_branch_state_execution_for(
            source,
            target,
            predecessor_branch_state_execution_gap_summary,
        )
        predecessor_fill_order_gap = predecessor_fill_execution_order_gap_for(
            source,
            target,
            predecessor_fill_execution_order_gap_summary,
        )
        predecessor_fill_opcode10_context = predecessor_fill_opcode10_context_for(
            source,
            target,
            predecessor_fill_opcode10_context_summary,
        )
        predecessor_descriptor_bridge_gap = predecessor_descriptor_bridge_gap_for(
            source,
            target,
            predecessor_descriptor_bridge_gap_summary,
        )
        predecessor_fill_site_execution_context = predecessor_fill_site_execution_context_for(
            source,
            target,
            predecessor_fill_site_execution_context_summary,
        )
        merge_execution_gap = merge_execution_gap_for(source, target, merge_execution_gap_summary)
        merge_runtime_context = merge_runtime_context_for(source, target, merge_runtime_context_summary)
        merge_closure_context = merge_closure_context_for(source, target, merge_closure_context_summary)
        active_flag = active_flag_effect_for(source, target, active_flag_effect)
        secondary_fill_roots = secondary_fill_roots_for(secondary_fill_roots_summary)
        inherited_state_candidates = inherited_state_candidates_for(inherited_state_candidates_summary)
        current_state_sources = current_state_sources_for(current_state_sources_summary)
        predecessor_tail_reset = predecessor_tail_reset_for(predecessor_tail_reset_summary)
        branch_state_writers = branch_state_writers_for(branch_state_writers_summary)
        branch_state_dispatch = branch_state_dispatch_for(branch_state_dispatch_summary)
        secondary_state_sources = secondary_state_sources_for(secondary_state_sources_summary)
        branch_state_opcode_overlap = branch_state_opcode_overlap_for(branch_state_opcode_overlap_summary)
        event_object_branch_state = event_object_branch_state_for(
            event_object_branch_state_stream_candidates_summary,
            event_object_branch_state_candidate_links_summary,
            event_object_branch_state_block_context_summary,
        )
        route_order = predecessor_route_order_for(source, target, predecessor_route_order)
        selector_decomposition = selector_set_decomposition_for(source, target, selector_set_decomposition_summary)
        selector_recomposition = selector_recomposition_lattice_for(
            source,
            target,
            selector_recomposition_lattice_summary,
        )
        mapset_aliases = mapset_aliases_for(source, target, mapset_aliases_summary)
        target_alias_state = target_alias_state_effects_for(source, target, target_alias_state_effects_summary)
        address_predecessor = address_predecessor_context_for(source, target, address_predecessor_context_summary)
        target_alias_bridge = target_alias_bridge_for(source, target, target_alias_bridges_summary)
        route_root_refs = route_root_ref_context_for(source, target, route_root_ref_context_summary)
        bridge_refs = predecessor_bridge_refs_for(predecessor_bridge_refs)
        reverse_reuse = reverse_reuse_context_for(source, target, reverse_reuse_context_summary)
        merge_bridge_matrix = merge_bridge_matrix_for(source, target, merge_bridge_matrix_summary)
        selected_pointer_opcode_paths = selected_pointer_opcode_paths_for(source, target, selected_pointer_opcode_paths_summary)
        global_selected_pointer_paths = global_selected_pointer_paths_for(source, target, global_selected_pointer_paths_summary)
        selected_pointer_usage = selected_pointer_usage_for(selected_pointer_usage_summary)
        selected_root_execution_gap = selected_root_execution_gap_for(source, target, selected_root_execution_gap_summary)
        runtime_trace_equivalent_rejection = runtime_trace_equivalent_rejection_for(
            selected_root_execution_gap,
            runtime_trace_feasibility_summary,
        )
        route_pair_entry_execution_gap = route_pair_entry_execution_gap_for(
            source,
            target,
            route_pair_entry_execution_gap_summary,
        )
        opcode08_activation_windows = opcode08_activation_windows_for(source, target, opcode08_activation_windows_summary)
        opcode08_unreadable_producers = opcode08_unreadable_producers_for(source, target, opcode08_unreadable_producers_summary)
        opcode09_pointer_collisions = opcode09_pointer_collisions_for(source, target, opcode09_pointer_collisions_summary)
        secondary_reset = secondary_reset_scope_for(source, target, secondary_reset_scope)
        secondary_global_reset = secondary_global_reset_gap_for(source, target, secondary_global_reset_gap)
        secondary_block_write = secondary_block_writes_for(secondary_block_writes)
        runtime_selector_byte_writes = runtime_selector_byte_writes_for(source, target, runtime_selector_byte_writes_summary)
        post_gate_reset = post_gate_reset_for(source, target, post_gate_reset_candidates)
        secondary_route_overlap = secondary_route_overlap_for(source, target, secondary_route_overlap_candidates)
        synthetic_probe = synthetic_savedata_probe_for(source, target, synthetic_savedata_selector_probe)
        real_gap = real_savedata_evidence_gap_for(source, target, real_savedata_evidence_gap)
        buffer20_provenance = selection_buffer20_provenance_for(source, target, selection_buffer20_provenance)
        descriptor_map = data_descriptor_opcode_map_for(source, target, data_descriptor_opcode_map)
        opcode24_payload_table = opcode24_payload_table_for(source, target, opcode24_payload_table_summary)
        opcode24_current_root_modes = opcode24_current_root_modes_for(
            source,
            target,
            opcode24_current_root_modes_summary,
        )
        wrapper_descriptor = wrapper_descriptor_context_for(source, target, wrapper_descriptor_context)
        resource_scan = resource_ref_scan_for(source, target, map1_resource_ref_scan)
        scene_payload = scene_payload_context_for(source, target, scene_payload_context)
        scene_list = scene_list_context_for(source, target, scene_list_context)
        frontier_reader_branch = frontier_reader_branch_context_for(
            source,
            target,
            frontier_reader_branch_context_summary,
        )
        frontier_payload_shape = frontier_payload_shape_for(source, target, frontier_payload_shape_summary)
        scene_adjacency = scene_adjacency_index_for(source, target, scene_adjacency_index_summary)
        exit_target_ranking = exit_target_ranking_for(source, target, exit_target_ranking_summary)
        leaf_table = leaf_table_context_for(leaf_table_context)
        leaf_index = leaf_index_space_for(source, target, leaf_index_space_summary)
        route_pair_descriptor = route_pair_descriptor_context_for(source, target, route_pair_descriptor_context)
        opcode07_indexed = opcode07_indexed_pointers_for(source, target, opcode07_indexed_pointers)
        object61_operands = object61_stream_operands_for(source, target, object61_stream_operands)
        context58_consumers = context58_consumers_for(source, target, context58_consumers_summary)
        current_root_paths = current_root_frontier_paths_for(source, target, current_root_frontier_paths)
        current_writer_paths = current_writer_paths_for(source, target, current_writer_paths_summary)
        selection_buffer_bases = selection_buffer_bases_for(selection_buffer_bases_summary)
        record_pattern = record_pattern_contrast_for(source, target, record_pattern_contrast_summary)
        strict_target_gap = strict_target_link_gap_for(source, target, strict_target_link_gap_summary)
        hotspot_gap = hotspot_gap_for(source, target, hotspot_gap_summary)
        entry_context = entry_context_for(source, target, entry_context_summary)
        selector_bridge = selector_bridge_for(source, target, selector_bridge_summary)
        manifest_point_scan = manifest_point_scan_for(source, target, manifest_point_scan_summary)
        root_point_scan = root_point_scan_for(source, target, root_point_scan_summary)
        edge_trigger_gap = edge_trigger_gap_for(source, target, edge_trigger_gap_summary)
        tile_hotspot_pattern = tile_hotspot_pattern_for(source, target, tile_hotspot_pattern_summary)
        strict_event_tile_signature = strict_event_tile_signature_for(
            source,
            target,
            strict_event_tile_signature_summary,
        )
        strict_hotspot_review_matrix = strict_hotspot_review_matrix_for(
            source,
            target,
            strict_hotspot_review_matrix_summary,
        )
        strict_source_hotspot_context = strict_source_hotspot_context_for(
            source,
            target,
            strict_source_hotspot_context_summary,
        )
        runtime_source_save_load_variant_context = (
            runtime_source_save_load_variant_context_summary
            if (
                (runtime_source_save_load_variant_context_summary or {}).get("sourceMap") == source
                and (runtime_source_save_load_variant_context_summary or {}).get("targetMap") == target
            )
            else {}
        )
        runtime_predecessor_route_attempt_context = (
            runtime_predecessor_route_attempt_context_summary or {}
        )
        opcode24_source_writes = opcode24_mode1_source_writes_for(opcode24_mode1_source_writes_summary)
        opcode24_runtime_context = opcode24_mode1_runtime_context_for(opcode24_mode1_runtime_context_summary)
        opcode24_runtime_enabled_context = opcode24_runtime_enabled_context_for(
            source,
            target,
            opcode24_runtime_enabled_context_summary,
        )
        opcode24_default_effect = opcode24_mode1_default_effect_for(
            source,
            target,
            opcode24_mode1_default_effect_summary,
        )
        frontier_missing_evidence = blocker.get("missingEvidence") or []
        gate_checklist = hard_gate_checklist(
            strict_source_hotspot_context,
            real_gap,
            selected_root_execution_gap,
            runtime_trace_equivalent_rejection,
        )
        failed_gate_ids = [
            row["id"] for row in gate_checklist if row.get("passed") is not True
        ]
        hard_missing_evidence = [
            row["missingEvidence"] for row in gate_checklist if row.get("passed") is not True
        ]
        missing_evidence = unique_list(frontier_missing_evidence + hard_missing_evidence)
        promotion_allowed = not failed_gate_ids
        rows.append({
            "source": source,
            "target": target,
            "blockerStatus": blocker.get("status"),
            "promotionStatus": "ready-for-review" if promotion_allowed else "blocked",
            "promotionAllowed": promotion_allowed,
            "promotionRisk": blocker.get("promotionRisk") or branch.get("promotionRisk"),
            "frontierMissingEvidence": frontier_missing_evidence,
            "missingEvidence": missing_evidence,
            "hardMissingEvidence": hard_missing_evidence,
            "failedGateIds": failed_gate_ids,
            "gateChecklist": gate_checklist,
            "nonPromotingEvidence": blocker.get("nonPromotingEvidence") or [],
            "branchConditions": blocker.get("branchConditions") or [
                step.get("condition") for step in branch.get("branchSteps") or [] if step.get("condition")
            ],
            "leafPointers": blocker.get("leafPointers") or frontier.get("leafPointers") or [],
            "leafStreamCount": len(leaves),
            "directEventTransition": frontier.get("directEventTransition", False),
            "sourceEventCount": frontier.get("sourceEventCount"),
            "targetEventCount": frontier.get("targetEventCount"),
            "sourceTilesetMatch": branch.get("sourceTilesetMatch"),
            "targetTilesetMatch": branch.get("targetTilesetMatch"),
            "selectionBufferOffsetHex": selection_flow.get("branchSelectionBufferOffsetHex"),
            "hasLocalWriterForBranchOffset": selection_flow.get("hasLocalWriterForBranchOffset"),
            "nearestLinearWriter": (writer_chain.get("nearestLinearWriter") or {}).get("writerVaHex"),
            "writerChainConclusion": writer_chain.get("conclusion"),
            "dispatchStopVaHex": gate_path.get("dispatchStopVaHex"),
            "dispatchStopOpcodeHex": gate_path.get("dispatchStopOpcodeHex"),
            "dispatchStopHandlerVaHex": gate_path.get("dispatchStopHandlerVaHex"),
            "dispatchStopHandlerSection": gate_path.get("dispatchStopHandlerSection"),
            "gatePathConclusion": gate_path.get("conclusion"),
            "opcode24Mode1IndirectContext": {
                "mode1SourceHex": (opcode24_mode1_indirect_context or {}).get("mode1SourceHex"),
                "globalBufferBaseHex": (opcode24_mode1_indirect_context or {}).get("globalBufferBaseHex"),
                "mode1OffsetHex": (opcode24_mode1_indirect_context or {}).get("mode1OffsetHex"),
                "mode1DirectRefs": (opcode24_mode1_indirect_context or {}).get("mode1DirectRefs") or [],
                "globalBaseDirectRefs": (opcode24_mode1_indirect_context or {}).get("globalBaseDirectRefs") or [],
                "basePlusOffsetRowCount": (opcode24_mode1_indirect_context or {}).get("basePlusOffsetRowCount"),
                "basePlusOffsetRows": (opcode24_mode1_indirect_context or {}).get("basePlusOffsetRows") or [],
                "basePlusMode1OffsetCandidateCount": (opcode24_mode1_indirect_context or {}).get("basePlusMode1OffsetCandidateCount"),
                "basePlusMode1OffsetCandidates": (opcode24_mode1_indirect_context or {}).get("basePlusMode1OffsetCandidates") or [],
                "baseWindowMode1WriteCandidateCount": (opcode24_mode1_indirect_context or {}).get("baseWindowMode1WriteCandidateCount"),
                "baseWindowMode1WriteCandidates": (opcode24_mode1_indirect_context or {}).get("baseWindowMode1WriteCandidates") or [],
                "nearbyBaseScanRangeHex": (opcode24_mode1_indirect_context or {}).get("nearbyBaseScanRangeHex"),
                "nearbyBaseWindowMode1WriteCandidateCount": (opcode24_mode1_indirect_context or {}).get("nearbyBaseWindowMode1WriteCandidateCount"),
                "nearbyBaseWindowMode1WriteCandidates": (opcode24_mode1_indirect_context or {}).get("nearbyBaseWindowMode1WriteCandidates") or [],
                "noStaticBaseIndirectCandidate": (opcode24_mode1_indirect_context or {}).get("noStaticBaseIndirectCandidate"),
                "conclusion": (opcode24_mode1_indirect_context or {}).get("conclusion"),
            } if opcode24_mode1_indirect_context else None,
            "opcode24Mode1FileReadContext": {
                "mode1SourceHex": (opcode24_mode1_file_read_context or {}).get("mode1SourceHex"),
                "globalBufferBaseHex": (opcode24_mode1_file_read_context or {}).get("globalBufferBaseHex"),
                "mode1OffsetHex": (opcode24_mode1_file_read_context or {}).get("mode1OffsetHex"),
                "readFileIatVaHex": (opcode24_mode1_file_read_context or {}).get("readFileIatVaHex"),
                "readFileCallCount": (opcode24_mode1_file_read_context or {}).get("readFileCallCount"),
                "globalDestinationReadFileCount": (opcode24_mode1_file_read_context or {}).get("globalDestinationReadFileCount"),
                "globalDestinationReadFileRows": (opcode24_mode1_file_read_context or {}).get("globalDestinationReadFileRows") or [],
                "mode1FileReadCandidateCount": (opcode24_mode1_file_read_context or {}).get("mode1FileReadCandidateCount"),
                "mode1FileReadCandidates": (opcode24_mode1_file_read_context or {}).get("mode1FileReadCandidates") or [],
                "mode1FileReadProducerFound": (opcode24_mode1_file_read_context or {}).get("mode1FileReadProducerFound"),
                "promotionStatus": (opcode24_mode1_file_read_context or {}).get("promotionStatus"),
                "conclusion": (opcode24_mode1_file_read_context or {}).get("conclusion"),
            } if opcode24_mode1_file_read_context else None,
            "opcode24Mode1BlockWrites": {
                "mode1SourceHex": (opcode24_mode1_block_writes or {}).get("mode1SourceHex"),
                "scanRangeHex": (opcode24_mode1_block_writes or {}).get("scanRangeHex"),
                "rowCount": (opcode24_mode1_block_writes or {}).get("rowCount"),
                "rows": (opcode24_mode1_block_writes or {}).get("rows") or [],
                "addressLikeCoveringBaseCount": (opcode24_mode1_block_writes or {}).get("addressLikeCoveringBaseCount"),
                "addressLikeCoveringBases": (opcode24_mode1_block_writes or {}).get("addressLikeCoveringBases") or [],
                "directCoveringWriteCount": (opcode24_mode1_block_writes or {}).get("directCoveringWriteCount"),
                "directCoveringWrites": (opcode24_mode1_block_writes or {}).get("directCoveringWrites") or [],
                "blockWriteCandidateCount": (opcode24_mode1_block_writes or {}).get("blockWriteCandidateCount"),
                "blockWriteCandidates": (opcode24_mode1_block_writes or {}).get("blockWriteCandidates") or [],
                "conclusion": (opcode24_mode1_block_writes or {}).get("conclusion"),
            } if opcode24_mode1_block_writes else None,
            "opcode24RuntimeEnabledBlockWrites": {
                "runtimeEnabledFlagHex": (opcode24_runtime_enabled_block_writes or {}).get("runtimeEnabledFlagHex"),
                "scanRangeHex": (opcode24_runtime_enabled_block_writes or {}).get("scanRangeHex"),
                "rowCount": (opcode24_runtime_enabled_block_writes or {}).get("rowCount"),
                "rows": (opcode24_runtime_enabled_block_writes or {}).get("rows") or [],
                "addressLikeCoveringBaseCount": (opcode24_runtime_enabled_block_writes or {}).get("addressLikeCoveringBaseCount"),
                "addressLikeCoveringBases": (opcode24_runtime_enabled_block_writes or {}).get("addressLikeCoveringBases") or [],
                "directCoveringWriteCount": (opcode24_runtime_enabled_block_writes or {}).get("directCoveringWriteCount"),
                "directCoveringWrites": (opcode24_runtime_enabled_block_writes or {}).get("directCoveringWrites") or [],
                "blockWriteCandidateCount": (opcode24_runtime_enabled_block_writes or {}).get("blockWriteCandidateCount"),
                "blockWriteCandidates": (opcode24_runtime_enabled_block_writes or {}).get("blockWriteCandidates") or [],
                "promotionStatus": (opcode24_runtime_enabled_block_writes or {}).get("promotionStatus"),
                "conclusion": (opcode24_runtime_enabled_block_writes or {}).get("conclusion"),
            } if opcode24_runtime_enabled_block_writes else None,
            "opcode24Mode1SourceWrites": opcode24_source_writes,
            "opcode24Mode1RuntimeContext": opcode24_runtime_context,
            "opcode24RuntimeEnabledContext": opcode24_runtime_enabled_context,
            "opcode24Mode1DefaultEffect": opcode24_default_effect,
            "opcode24Globals": {
                "neighborhoodRangeHex": (opcode24_globals or {}).get("neighborhoodRangeHex"),
                "mode1NeighborhoodDirectReadCount": (opcode24_globals or {}).get("mode1NeighborhoodDirectReadCount"),
                "mode1NeighborhoodDirectWriteCount": (opcode24_globals or {}).get("mode1NeighborhoodDirectWriteCount"),
                "mode2DirectWriteCount": (opcode24_globals or {}).get("mode2DirectWriteCount"),
                "neighborhoodDirectWriteAddressHexes": (opcode24_globals or {}).get("neighborhoodDirectWriteAddressHexes"),
                "mode1NearestLowerDirectWriteHex": (opcode24_globals or {}).get("mode1NearestLowerDirectWriteHex"),
                "mode1NearestHigherDirectWriteHex": (opcode24_globals or {}).get("mode1NearestHigherDirectWriteHex"),
                "mode1DirectWriteHoleBetweenNeighborWrites": (opcode24_globals or {}).get(
                    "mode1DirectWriteHoleBetweenNeighborWrites"
                ),
                "mode1UnwrittenRuntimeGlobalSource": (opcode24_globals or {}).get("mode1UnwrittenRuntimeGlobalSource"),
                "mode2WriterContext": (opcode24_globals or {}).get("mode2WriterContext"),
                "conclusion": (opcode24_globals or {}).get("conclusion"),
            } if opcode24_globals else None,
            "strictClusterCandidates": strict_clusters,
            "coordinateVariantScan": coordinate_scan,
            "mapExitCoordinateRefs": coordinate_refs,
            "exitCoordinateContext": exit_coordinate_context,
            "originalCollisionRouteAudit": original_collision_audit,
            "eventShapeScan": event_shape_scan,
            "gateBaseProofGap": gate_base_proof,
            "branchGateConsistency": branch_gate_consistency,
            "branchSelectorEquation": branch_selector_equation,
            "gateOffsetSources": gate_offset_sources,
            "gateOffsetPatterns": gate_offset_patterns,
            "gateBaseCandidates": gate_base_candidates,
            "gateSampleValues": gate_sample_values,
            "gatePassMatrix": gate_pass_matrix,
            "opcode20ObjectBaseCandidates": opcode20_object_base,
            "opcode20OrderSpace": opcode20_order_space,
            "opcode20ContextF2Sources": opcode20_context_f2,
            "opcode20SlotSources": opcode20_slot_sources,
            "opcode20SlotDescriptorWriters": opcode20_slot_descriptor_writers,
            "opcode20DescriptorScripts": opcode20_descriptor_scripts,
            "opcode20SampleOrderEffects": opcode20_sample_order,
            "opcode20RuntimeMaterializers": opcode20_runtime_materializers,
            "opcode20NestedBaseModes": opcode20_nested_base,
            "predecessorStateEffect": predecessor_effect,
            "predecessorPersistenceGap": predecessor_persistence,
            "predecessorBranchStateExecutionGap": predecessor_branch_execution,
            "predecessorFillExecutionOrderGap": predecessor_fill_order_gap,
            "predecessorFillOpcode10Context": predecessor_fill_opcode10_context,
            "predecessorDescriptorBridgeGap": predecessor_descriptor_bridge_gap,
            "predecessorFillSiteExecutionContext": predecessor_fill_site_execution_context,
            "mergeExecutionGap": merge_execution_gap,
            "mergeRuntimeContext": merge_runtime_context,
            "mergeClosureContext": merge_closure_context,
            "activeFlagEffect": active_flag,
            "secondaryFillRoots": secondary_fill_roots,
            "inheritedStateCandidates": inherited_state_candidates,
            "currentStateSources": current_state_sources,
            "predecessorTailReset": predecessor_tail_reset,
            "branchStateWriters": branch_state_writers,
            "branchStateDispatch": branch_state_dispatch,
            "secondaryStateSources": secondary_state_sources,
            "branchStateOpcodeOverlap": branch_state_opcode_overlap,
            "eventObjectBranchState": event_object_branch_state,
            "predecessorRouteOrder": route_order,
            "selectorSetDecomposition": selector_decomposition,
            "selectorRecompositionLattice": selector_recomposition,
            "mapsetAliases": mapset_aliases,
            "targetAliasStateEffects": target_alias_state,
            "addressPredecessorContext": address_predecessor,
            "targetAliasBridge": target_alias_bridge,
            "routeRootRefContext": route_root_refs,
            "predecessorBridgeRefs": bridge_refs,
            "reverseReuseContext": reverse_reuse,
            "mergeBridgeMatrix": merge_bridge_matrix,
            "selectedPointerOpcodePaths": selected_pointer_opcode_paths,
            "globalSelectedPointerPaths": global_selected_pointer_paths,
            "selectedPointerUsage": selected_pointer_usage,
            "selectedRootExecutionGap": selected_root_execution_gap,
            "runtimeTraceEquivalentRejectionClassification": (
                runtime_trace_equivalent_rejection.get("classification")
            ),
            "runtimeTraceEquivalentRejection": runtime_trace_equivalent_rejection,
            "routePairEntryExecutionGap": route_pair_entry_execution_gap,
            "opcode08ActivationWindows": opcode08_activation_windows,
            "opcode08UnreadableProducers": opcode08_unreadable_producers,
            "opcode09PointerCollisions": opcode09_pointer_collisions,
            "secondaryResetScope": secondary_reset,
            "secondaryGlobalResetGap": secondary_global_reset,
            "secondaryBlockWrites": secondary_block_write,
            "runtimeSelectorByteWrites": runtime_selector_byte_writes,
            "postGateResetCandidates": post_gate_reset,
            "secondaryRouteOverlapCandidates": secondary_route_overlap,
            "syntheticSavedataProbe": synthetic_probe,
            "realSavedataEvidenceGap": real_gap,
            "selectionBuffer20Provenance": buffer20_provenance,
            "dataDescriptorOpcodeMap": descriptor_map,
            "opcode24PayloadTable": opcode24_payload_table,
            "opcode24CurrentRootModes": opcode24_current_root_modes,
            "wrapperDescriptorContext": wrapper_descriptor,
            "resourceRefScan": resource_scan,
            "scenePayloadContext": scene_payload,
            "sceneListContext": scene_list,
            "frontierReaderBranchContext": frontier_reader_branch,
            "frontierPayloadShape": frontier_payload_shape,
            "sceneAdjacencyIndex": scene_adjacency,
            "exitTargetRanking": exit_target_ranking,
            "leafTableContext": leaf_table,
            "leafIndexSpace": leaf_index,
            "routePairDescriptorContext": route_pair_descriptor,
            "opcode07IndexedPointers": opcode07_indexed,
            "object61StreamOperands": object61_operands,
            "context58Consumers": context58_consumers,
            "currentRootFrontierPaths": current_root_paths,
            "currentWriterPaths": current_writer_paths,
            "selectionBufferBases": selection_buffer_bases,
            "recordPatternContrast": record_pattern,
            "strictTargetLinkGap": strict_target_gap,
            "hotspotGap": hotspot_gap,
            "entryContext": entry_context,
            "selectorBridgeRefs": selector_bridge,
            "manifestPointScan": manifest_point_scan,
            "rootPointScan": root_point_scan,
            "edgeTriggerGap": edge_trigger_gap,
            "tileHotspotPatternContrast": tile_hotspot_pattern,
            "strictEventTileSignatureScan": strict_event_tile_signature,
            "strictHotspotReviewMatrix": strict_hotspot_review_matrix,
            "strictSourceHotspotContext": strict_source_hotspot_context,
            "runtimeSourceSaveLoadVariantContext": runtime_source_save_load_variant_context,
            "runtimePredecessorRouteAttemptContext": runtime_predecessor_route_attempt_context,
            "nextActions": annotate_next_actions(
                classify_next_actions(
                    blocker,
                    frontier,
                    branch,
                    selection_flow,
                    strict_clusters,
                    coordinate_scan,
                    coordinate_refs,
                    exit_coordinate_context,
                    original_collision_audit,
                    event_shape_scan,
                    gate_base_proof,
                    branch_gate_consistency,
                    branch_selector_equation,
                    gate_offset_sources,
                    gate_offset_patterns,
                    gate_base_candidates,
                    gate_sample_values,
                    gate_pass_matrix,
                    predecessor_effect,
                    predecessor_persistence,
                    predecessor_branch_execution,
                    active_flag,
                    secondary_fill_roots,
                    inherited_state_candidates,
                    current_state_sources,
                    predecessor_tail_reset,
                    branch_state_writers,
                    branch_state_dispatch,
                    secondary_state_sources,
                    branch_state_opcode_overlap,
                    event_object_branch_state,
                    route_order,
                    selector_decomposition,
                    selector_recomposition,
                    mapset_aliases,
                    target_alias_state,
                    address_predecessor,
                    target_alias_bridge,
                    route_root_refs,
                    bridge_refs,
                    reverse_reuse,
                    merge_bridge_matrix,
                    selected_pointer_opcode_paths,
                    global_selected_pointer_paths,
                    selected_pointer_usage,
                    selected_root_execution_gap,
                    route_pair_entry_execution_gap,
                    opcode08_activation_windows,
                    opcode08_unreadable_producers,
                    opcode09_pointer_collisions,
                    synthetic_probe,
                    real_gap,
                    buffer20_provenance,
                    secondary_reset,
                    secondary_global_reset,
                    secondary_block_write,
                    runtime_selector_byte_writes,
                    post_gate_reset,
                    secondary_route_overlap,
                    opcode24_mode1_indirect_context,
                    opcode24_mode1_file_read_context,
                    opcode24_mode1_block_writes,
                    opcode24_runtime_enabled_block_writes,
                    opcode24_source_writes,
                    opcode24_runtime_context,
                    opcode24_runtime_enabled_context,
                    opcode24_default_effect,
                    opcode24_globals,
                    opcode24_payload_table,
                    resource_scan,
                    opcode20_object_base,
                    opcode20_order_space,
                    opcode20_context_f2,
                    opcode20_slot_sources,
                    opcode20_descriptor_scripts,
                    opcode20_sample_order,
                    opcode20_runtime_materializers,
                    opcode20_nested_base,
                    wrapper_descriptor,
                    scene_payload,
                    scene_list,
                    frontier_reader_branch,
                    frontier_payload_shape,
                    scene_adjacency,
                    leaf_table,
                    leaf_index,
                    route_pair_descriptor,
                    opcode07_indexed,
                    object61_operands,
                    context58_consumers,
                    current_root_paths,
                    selection_buffer_bases,
                    record_pattern,
                    strict_target_gap,
                    hotspot_gap,
                    entry_context,
                    selector_bridge,
                    manifest_point_scan,
                    root_point_scan,
                    opcode20_slot_descriptor_writers,
                    opcode24_current_root_modes,
                    current_writer_paths,
                    edge_trigger_gap,
                    strict_event_tile_signature,
                    strict_source_hotspot_context,
                    runtime_source_save_load_variant_context,
                    runtime_predecessor_route_attempt_context,
                    exit_target_ranking,
                    predecessor_fill_order_gap,
                    predecessor_fill_opcode10_context,
                    predecessor_descriptor_bridge_gap,
                    predecessor_fill_site_execution_context,
                    merge_runtime_context,
                    merge_closure_context,
                    runtime_opcode24_flag_context_summary,
                ),
                failed_gate_ids,
            ),
        })
    return rows


def markdown(rows: list[dict]) -> str:
    lines = [
        "# Route Investigation Queue",
        "",
        "Focused next steps for blockers on the confirmed normal route. These rows do not promote selector-only links; they identify the missing evidence needed before promotion.",
        "",
        "| source | target | status | risk | direct event | branch offset | strict clusters | next actions |",
        "| --- | --- | --- | --- | --- | --- | ---: | --- |",
    ]
    for row in rows:
        actions = "<br>".join(
            f"{action['priority']}. {action['task']} ({action['status']}; {action.get('nextInputSummary') or '-'})"
            for action in row.get("nextActions") or []
        )
        lines.append(
            f"| {row['source']} | {row['target']} | {row.get('promotionStatus') or '-'} | "
            f"{row.get('promotionRisk') or '-'} | "
            f"{'yes' if row.get('directEventTransition') else 'no'} | "
            f"{row.get('selectionBufferOffsetHex') or '-'} local writer "
            f"{'yes' if row.get('hasLocalWriterForBranchOffset') else 'no'} | "
            f"{len(row.get('strictClusterCandidates') or [])} | {actions or '-'} |"
        )
    lines.append("")
    for row in rows:
        lines.extend([
            f"## {row['source']} -> {row['target']}",
            "",
            f"- promotion status: {row.get('promotionStatus') or '-'}",
            f"- promotion allowed: {row.get('promotionAllowed')}",
            f"- missing evidence: {', '.join(row.get('missingEvidence') or []) or '-'}",
            f"- frontier missing evidence: {', '.join(row.get('frontierMissingEvidence') or []) or '-'}",
            f"- hard missing evidence: {', '.join(row.get('hardMissingEvidence') or []) or '-'}",
            f"- failed gates: {', '.join(row.get('failedGateIds') or []) or '-'}",
            f"- non-promoting evidence: {', '.join(row.get('nonPromotingEvidence') or []) or '-'}",
            f"- branch conditions: {', '.join(row.get('branchConditions') or []) or '-'}",
            f"- leaf pointers: {', '.join(row.get('leafPointers') or []) or '-'}",
            f"- source/target events: {row.get('sourceEventCount')} / {row.get('targetEventCount')}",
            f"- tileset match: source={row.get('sourceTilesetMatch')} target={row.get('targetTilesetMatch')}",
            f"- nearest linear writer for selectionBuffer[0x20]: {row.get('nearestLinearWriter') or '-'}",
            f"- writer chain note: {row.get('writerChainConclusion') or '-'}",
            f"- gate/dispatch stop: {row.get('dispatchStopVaHex') or '-'} opcode {row.get('dispatchStopOpcodeHex') or '-'} handler {row.get('dispatchStopHandlerVaHex') or '-'} in {row.get('dispatchStopHandlerSection') or '-'}",
            f"- gate path note: {row.get('gatePathConclusion') or '-'}",
            f"- opcode24 mode1 indirect note: {(row.get('opcode24Mode1IndirectContext') or {}).get('conclusion') or '-'}",
            f"- opcode24 mode1 file-read note: {(row.get('opcode24Mode1FileReadContext') or {}).get('conclusion') or '-'}",
            f"- opcode24 mode1 block-write note: {(row.get('opcode24Mode1BlockWrites') or {}).get('conclusion') or '-'}",
            f"- opcode24 runtime enabled block-write note: {(row.get('opcode24RuntimeEnabledBlockWrites') or {}).get('conclusion') or '-'}",
            f"- opcode24 mode1 source writes: {opcode24_mode1_source_writes_brief(row.get('opcode24Mode1SourceWrites'))}",
            f"- opcode24 mode1 runtime context: {opcode24_mode1_runtime_context_brief(row.get('opcode24Mode1RuntimeContext'))}",
            f"- opcode24 runtime enabled context: {opcode24_runtime_enabled_context_brief(row.get('opcode24RuntimeEnabledContext'))}",
            f"- opcode24 mode1 default effect: {opcode24_mode1_default_effect_brief(row.get('opcode24Mode1DefaultEffect'))}",
            f"- opcode24 global neighborhood: {opcode24_globals_brief(row.get('opcode24Globals'))}",
            f"- opcode24 current root modes: {opcode24_current_root_modes_brief(row.get('opcode24CurrentRootModes'))}",
            f"- coordinate variant scan: {coordinate_variant_brief(row.get('coordinateVariantScan'))}",
            f"- coordinate refs: {map_exit_coordinate_refs_brief(row.get('mapExitCoordinateRefs'))}",
            f"- coordinate context: {exit_coordinate_context_brief(row.get('exitCoordinateContext'))}",
            f"- original collision audit: {original_collision_route_audit_brief(row.get('originalCollisionRouteAudit'))}",
            f"- event shape scan: {event_shape_scan_brief(row.get('eventShapeScan'))}",
            f"- resource ref scan: {resource_ref_scan_brief(row.get('resourceRefScan'))}",
            f"- scene payload context: {scene_payload_context_brief(row.get('scenePayloadContext'))}",
            f"- scene list context: {scene_list_context_brief(row.get('sceneListContext'))}",
            f"- frontier reader branch context: {frontier_reader_branch_context_brief(row.get('frontierReaderBranchContext'))}",
            f"- frontier payload shape: {frontier_payload_shape_brief(row.get('frontierPayloadShape'))}",
            f"- scene adjacency index: {scene_adjacency_index_brief(row.get('sceneAdjacencyIndex'))}",
            f"- exit target ranking: {exit_target_ranking_brief(row.get('exitTargetRanking'))}",
            f"- record pattern contrast: {record_pattern_contrast_brief(row.get('recordPatternContrast'))}",
            f"- strict target link gap: {strict_target_link_gap_brief(row.get('strictTargetLinkGap'))}",
            f"- hotspot gap: {hotspot_gap_brief(row.get('hotspotGap'))}",
            f"- entry context: {entry_context_brief(row.get('entryContext'))}",
            f"- selector bridge refs: {selector_bridge_brief(row.get('selectorBridgeRefs'))}",
            f"- manifest point scan: {manifest_point_scan_brief(row.get('manifestPointScan'))}",
            f"- root point scan: {root_point_scan_brief(row.get('rootPointScan'))}",
            f"- edge trigger gap: {edge_trigger_gap_brief(row.get('edgeTriggerGap'))}",
            f"- tile hotspot pattern contrast: {tile_hotspot_pattern_brief(row.get('tileHotspotPatternContrast'))}",
            f"- strict event tile signature scan: {strict_event_tile_signature_brief(row.get('strictEventTileSignatureScan'))}",
            f"- strict hotspot review matrix: {strict_hotspot_review_matrix_brief(row.get('strictHotspotReviewMatrix'))}",
            f"- strict source hotspot context: {strict_source_hotspot_context_brief(row.get('strictSourceHotspotContext'))}",
            f"- gate base proof gap: {gate_base_proof_brief(row.get('gateBaseProofGap'))}",
            f"- branch gate consistency: {branch_gate_consistency_brief(row.get('branchGateConsistency'))}",
            f"- branch selector equation: {branch_selector_equation_brief(row.get('branchSelectorEquation'))}",
            f"- gate offset sources: {gate_offset_sources_brief(row.get('gateOffsetSources'))}",
            f"- gate offset patterns: {gate_offset_patterns_brief(row.get('gateOffsetPatterns'))}",
            f"- gate base candidates: {gate_base_candidates_brief(row.get('gateBaseCandidates'))}",
            f"- gate sample values: {gate_sample_values_brief(row.get('gateSampleValues'))}",
            f"- gate pass matrix: {gate_pass_matrix_brief(row.get('gatePassMatrix'))}",
            f"- selection buffer bases: {selection_buffer_bases_brief(row.get('selectionBufferBases'))}",
            f"- opcode20 object base candidates: {opcode20_object_base_brief(row.get('opcode20ObjectBaseCandidates'))}",
            f"- opcode20 active order space: {opcode20_order_space_brief(row.get('opcode20OrderSpace'))}",
            f"- opcode20 context+0xf2 sources: {opcode20_context_f2_brief(row.get('opcode20ContextF2Sources'))}",
            f"- opcode20 slot sources: {opcode20_slot_sources_brief(row.get('opcode20SlotSources'))}",
            f"- opcode20 slot descriptor writers: {opcode20_slot_descriptor_writers_brief(row.get('opcode20SlotDescriptorWriters'))}",
            f"- opcode20 descriptor scripts: {opcode20_descriptor_scripts_brief(row.get('opcode20DescriptorScripts'))}",
            f"- opcode20 sample order effects: {opcode20_sample_order_brief(row.get('opcode20SampleOrderEffects'))}",
            f"- opcode20 runtime materializers: {opcode20_runtime_materializers_brief(row.get('opcode20RuntimeMaterializers'))}",
            f"- opcode20 nested base modes: {opcode20_nested_base_modes_brief(row.get('opcode20NestedBaseModes'))}",
            f"- predecessor state effect: {predecessor_state_effect_brief(row.get('predecessorStateEffect'))}",
            f"- predecessor persistence gap: {predecessor_persistence_brief(row.get('predecessorPersistenceGap'))}",
            f"- predecessor branch-state execution gap: {predecessor_branch_state_execution_brief(row.get('predecessorBranchStateExecutionGap'))}",
            f"- predecessor fill execution/order gap: {predecessor_fill_execution_order_gap_brief(row.get('predecessorFillExecutionOrderGap'))}",
            f"- predecessor fill opcode10 context: {predecessor_fill_opcode10_context_brief(row.get('predecessorFillOpcode10Context'))}",
            f"- predecessor descriptor bridge gap: {predecessor_descriptor_bridge_gap_brief(row.get('predecessorDescriptorBridgeGap'))}",
            f"- predecessor fill-site execution context: {predecessor_fill_site_execution_context_brief(row.get('predecessorFillSiteExecutionContext'))}",
            f"- selector merge execution gap: {merge_execution_gap_brief(row.get('mergeExecutionGap'))}",
            f"- merge runtime context: {merge_runtime_context_brief(row.get('mergeRuntimeContext'))}",
            f"- merge closure context: {merge_closure_context_brief(row.get('mergeClosureContext'))}",
            f"- active flag effect: {active_flag_effect_brief(row.get('activeFlagEffect'))}",
            f"- secondary fill roots: {secondary_fill_roots_brief(row.get('secondaryFillRoots'))}",
            f"- inherited state candidates: {inherited_state_candidates_brief(row.get('inheritedStateCandidates'))}",
            f"- current state sources: {current_state_sources_brief(row.get('currentStateSources'))}",
            f"- predecessor tail reset: {predecessor_tail_reset_brief(row.get('predecessorTailReset'))}",
            f"- branch state writers: {branch_state_writers_brief(row.get('branchStateWriters'))}",
            f"- branch state dispatch: {branch_state_dispatch_brief(row.get('branchStateDispatch'))}",
            f"- secondary state sources: {secondary_state_sources_brief(row.get('secondaryStateSources'))}",
            f"- branch state opcode overlap: {branch_state_opcode_overlap_brief(row.get('branchStateOpcodeOverlap'))}",
            f"- event/object branch state candidates: {event_object_branch_state_brief(row.get('eventObjectBranchState'))}",
            f"- predecessor route order: {predecessor_route_order_brief(row.get('predecessorRouteOrder'))}",
            f"- selector set decomposition: {selector_set_decomposition_brief(row.get('selectorSetDecomposition'))}",
            f"- selector recomposition lattice: {selector_recomposition_lattice_brief(row.get('selectorRecompositionLattice'))}",
            f"- mapset aliases: {mapset_aliases_brief(row.get('mapsetAliases'))}",
            f"- target alias state effects: {target_alias_state_effects_brief(row.get('targetAliasStateEffects'))}",
            f"- address predecessor context: {address_predecessor_context_brief(row.get('addressPredecessorContext'))}",
            f"- target alias bridge: {target_alias_bridge_brief(row.get('targetAliasBridge'))}",
            f"- route root ref context: {route_root_ref_context_brief(row.get('routeRootRefContext'))}",
            f"- predecessor bridge refs: {predecessor_bridge_refs_brief(row.get('predecessorBridgeRefs'))}",
            f"- reverse reuse context: {reverse_reuse_context_brief(row.get('reverseReuseContext'))}",
            f"- selector merge bridge matrix: {merge_bridge_matrix_brief(row.get('mergeBridgeMatrix'))}",
            f"- selected-pointer opcode paths: {selected_pointer_opcode_paths_brief(row.get('selectedPointerOpcodePaths'))}",
            f"- global selected-pointer paths: {global_selected_pointer_paths_brief(row.get('globalSelectedPointerPaths'))}",
            f"- selected-pointer usage: {selected_pointer_usage_brief(row.get('selectedPointerUsage'))}",
            f"- selected-root execution gap: {selected_root_execution_gap_brief(row.get('selectedRootExecutionGap'))}",
            "- runtime trace/equivalent rejection: "
            f"{runtime_trace_equivalent_rejection_brief(row.get('runtimeTraceEquivalentRejection'))}",
            f"- route-pair entry execution gap: {route_pair_entry_execution_gap_brief(row.get('routePairEntryExecutionGap'))}",
            f"- opcode08 activation windows: {opcode08_activation_windows_brief(row.get('opcode08ActivationWindows'))}",
            f"- opcode08 unreadable producers: {opcode08_unreadable_producers_brief(row.get('opcode08UnreadableProducers'))}",
            f"- opcode09 pointer collisions: {opcode09_pointer_collisions_brief(row.get('opcode09PointerCollisions'))}",
            f"- secondary reset scope: {secondary_reset_scope_brief(row.get('secondaryResetScope'))}",
            f"- secondary global reset gap: {secondary_global_reset_gap_brief(row.get('secondaryGlobalResetGap'))}",
            f"- secondary block writes: {secondary_block_writes_brief(row.get('secondaryBlockWrites'))}",
            f"- runtime selector byte writes: {runtime_selector_byte_writes_brief(row.get('runtimeSelectorByteWrites'))}",
            f"- post-gate reset candidates: {post_gate_reset_brief(row.get('postGateResetCandidates'))}",
            f"- secondary route-overlap candidates: {secondary_route_overlap_brief(row.get('secondaryRouteOverlapCandidates'))}",
            f"- synthetic savedat probe: {synthetic_savedata_probe_brief(row.get('syntheticSavedataProbe'))}",
            f"- real savedata evidence gap: {real_savedata_evidence_gap_brief(row.get('realSavedataEvidenceGap'))}",
            "- runtime source-save load variant context: "
            f"{runtime_source_save_load_variant_context_brief(row.get('runtimeSourceSaveLoadVariantContext'))}",
            f"- selectionBuffer[0x20] provenance: {selection_buffer20_provenance_brief(row.get('selectionBuffer20Provenance'))}",
            f"- data descriptor opcode map: {data_descriptor_opcode_map_brief(row.get('dataDescriptorOpcodeMap'))}",
            f"- opcode24 payload table: {opcode24_payload_table_brief(row.get('opcode24PayloadTable'))}",
            f"- opcode24 current root modes: {opcode24_current_root_modes_brief(row.get('opcode24CurrentRootModes'))}",
            f"- wrapper descriptor context: {wrapper_descriptor_context_brief(row.get('wrapperDescriptorContext'))}",
            f"- leaf table context: {leaf_table_context_brief(row.get('leafTableContext'))}",
            f"- leaf index space: {leaf_index_space_brief(row.get('leafIndexSpace'))}",
            f"- route-pair descriptor context: {route_pair_descriptor_context_brief(row.get('routePairDescriptorContext'))}",
            f"- opcode07 indexed pointers: {opcode07_indexed_pointers_brief(row.get('opcode07IndexedPointers'))}",
            f"- object61 stream operands: {object61_stream_operands_brief(row.get('object61StreamOperands'))}",
            f"- context58 consumers: {context58_consumers_brief(row.get('context58Consumers'))}",
            f"- current root frontier paths: {current_root_frontier_paths_brief(row.get('currentRootFrontierPaths'))}",
            f"- current writer paths: {current_writer_paths_brief(row.get('currentWriterPaths'))}",
            "",
            "### Strict Cluster Candidates",
            "",
        ])
        clusters = row.get("strictClusterCandidates") or []
        if not clusters:
            lines.append("- none")
        else:
            for cluster in clusters:
                events = ", ".join(record.get("recordVaHex", "") for record in cluster.get("eventRecords") or [])
                relevance = ", ".join(cluster.get("relevance") or [])
                sources = ", ".join(cluster.get("eventSources") or []) or "-"
                links = ", ".join(cluster.get("eventFieldLinks") or []) or "-"
                lines.append(
                    f"- `{cluster.get('clusterStartHex')}`..`{cluster.get('clusterEndHex')}` "
                    f"({cluster.get('role') or '-'}): {relevance}; "
                    f"eventSources={sources}; eventLinks={links}; events {events or '-'}"
                )
        lines.extend(["", "### Next Actions", ""])
        for action in row.get("nextActions") or []:
            lines.extend([
                f"{action['priority']}. {action['task']} [{action['status']}]",
                f"   - why: {action['why']}",
                f"   - related failed gates: `{list_text(action.get('relatedFailedGateIds'))}`",
                f"   - next input classes: `{list_text(action.get('nextInputClasses'))}`",
                f"   - next input summary: {action.get('nextInputSummary') or '-'}",
                f"   - evidence: {action['evidence'] or '-'}",
                f"   - refs: {evidence_refs_brief(action.get('evidenceRefs') or [])}",
            ])
        lines.append("")
    return "\n".join(lines)


def html_page(rows: list[dict]) -> str:
    body = [
        "<!doctype html><meta charset=\"utf-8\"><title>Route Investigation Queue</title>",
        "<style>body{font-family:system-ui,sans-serif;background:#111;color:#eee}table{border-collapse:collapse}td,th{border:1px solid #444;padding:6px 8px;vertical-align:top}code{color:#9bd4ff}</style>",
        "<h1>Route Investigation Queue</h1>",
        "<p>Focused next steps for confirmed-route blockers. Selector-only links are not promoted here.</p>",
        "<table><thead><tr><th>source</th><th>target</th><th>status</th><th>risk</th><th>direct event</th><th>branch offset</th><th>strict clusters</th><th>next actions</th></tr></thead><tbody>",
    ]
    for row in rows:
        actions = "<br>".join(
            html.escape(
                f"{action['priority']}. {action['task']} "
                f"({action['status']}; {action.get('nextInputSummary') or '-'})"
            )
            for action in row.get("nextActions") or []
        )
        body.append(
            "<tr>"
            f"<td>{html.escape(row['source'])}</td>"
            f"<td>{html.escape(row['target'])}</td>"
            f"<td>{html.escape(str(row.get('promotionStatus') or '-'))}</td>"
            f"<td>{html.escape(str(row.get('promotionRisk') or '-'))}</td>"
            f"<td>{'yes' if row.get('directEventTransition') else 'no'}</td>"
            f"<td><code>{html.escape(str(row.get('selectionBufferOffsetHex') or '-'))}</code> local writer "
            f"{'yes' if row.get('hasLocalWriterForBranchOffset') else 'no'}</td>"
            f"<td>{len(row.get('strictClusterCandidates') or [])}</td>"
            f"<td>{actions or '-'}</td>"
            "</tr>"
        )
    body.append("</tbody></table>")
    for row in rows:
        body.append(f"<h2>{html.escape(row['source'])} -&gt; {html.escape(row['target'])}</h2>")
        body.append("<ul>")
        body.append(f"<li>promotion status: {html.escape(str(row.get('promotionStatus') or '-'))}</li>")
        body.append(f"<li>promotion allowed: {html.escape(str(row.get('promotionAllowed')))}</li>")
        body.append(f"<li>missing evidence: {html.escape(', '.join(row.get('missingEvidence') or []) or '-')}</li>")
        body.append(f"<li>frontier missing evidence: {html.escape(', '.join(row.get('frontierMissingEvidence') or []) or '-')}</li>")
        body.append(f"<li>hard missing evidence: {html.escape(', '.join(row.get('hardMissingEvidence') or []) or '-')}</li>")
        body.append(f"<li>failed gates: {html.escape(', '.join(row.get('failedGateIds') or []) or '-')}</li>")
        body.append(f"<li>non-promoting evidence: {html.escape(', '.join(row.get('nonPromotingEvidence') or []) or '-')}</li>")
        body.append(f"<li>branch conditions: {html.escape(', '.join(row.get('branchConditions') or []) or '-')}</li>")
        body.append(f"<li>leaf pointers: {html.escape(', '.join(row.get('leafPointers') or []) or '-')}</li>")
        body.append(f"<li>source/target events: {row.get('sourceEventCount')} / {row.get('targetEventCount')}</li>")
        body.append(f"<li>tileset match: source={row.get('sourceTilesetMatch')} target={row.get('targetTilesetMatch')}</li>")
        body.append(f"<li>nearest linear writer for selectionBuffer[0x20]: {html.escape(str(row.get('nearestLinearWriter') or '-'))}</li>")
        body.append(f"<li>writer chain note: {html.escape(str(row.get('writerChainConclusion') or '-'))}</li>")
        body.append(f"<li>gate/dispatch stop: {html.escape(str(row.get('dispatchStopVaHex') or '-'))} opcode {html.escape(str(row.get('dispatchStopOpcodeHex') or '-'))} handler {html.escape(str(row.get('dispatchStopHandlerVaHex') or '-'))} in {html.escape(str(row.get('dispatchStopHandlerSection') or '-'))}</li>")
        body.append(f"<li>gate path note: {html.escape(str(row.get('gatePathConclusion') or '-'))}</li>")
        body.append(f"<li>opcode24 mode1 indirect note: {html.escape(str((row.get('opcode24Mode1IndirectContext') or {}).get('conclusion') or '-'))}</li>")
        body.append(f"<li>opcode24 mode1 file-read note: {html.escape(str((row.get('opcode24Mode1FileReadContext') or {}).get('conclusion') or '-'))}</li>")
        body.append(f"<li>opcode24 mode1 block-write note: {html.escape(str((row.get('opcode24Mode1BlockWrites') or {}).get('conclusion') or '-'))}</li>")
        body.append(f"<li>opcode24 runtime enabled block-write note: {html.escape(str((row.get('opcode24RuntimeEnabledBlockWrites') or {}).get('conclusion') or '-'))}</li>")
        body.append(f"<li>opcode24 mode1 source writes: {html.escape(opcode24_mode1_source_writes_brief(row.get('opcode24Mode1SourceWrites')))}</li>")
        body.append(f"<li>opcode24 mode1 runtime context: {html.escape(opcode24_mode1_runtime_context_brief(row.get('opcode24Mode1RuntimeContext')))}</li>")
        body.append(f"<li>opcode24 runtime enabled context: {html.escape(opcode24_runtime_enabled_context_brief(row.get('opcode24RuntimeEnabledContext')))}</li>")
        body.append(f"<li>opcode24 mode1 default effect: {html.escape(opcode24_mode1_default_effect_brief(row.get('opcode24Mode1DefaultEffect')))}</li>")
        body.append(f"<li>opcode24 global neighborhood: {html.escape(opcode24_globals_brief(row.get('opcode24Globals')))}</li>")
        body.append(f"<li>opcode24 current root modes: {html.escape(opcode24_current_root_modes_brief(row.get('opcode24CurrentRootModes')))}</li>")
        body.append(f"<li>coordinate variant scan: {html.escape(coordinate_variant_brief(row.get('coordinateVariantScan')))}</li>")
        body.append(f"<li>coordinate refs: {html.escape(map_exit_coordinate_refs_brief(row.get('mapExitCoordinateRefs')))}</li>")
        body.append(f"<li>coordinate context: {html.escape(exit_coordinate_context_brief(row.get('exitCoordinateContext')))}</li>")
        body.append(f"<li>original collision audit: {html.escape(original_collision_route_audit_brief(row.get('originalCollisionRouteAudit')))}</li>")
        body.append(f"<li>event shape scan: {html.escape(event_shape_scan_brief(row.get('eventShapeScan')))}</li>")
        body.append(f"<li>resource ref scan: {html.escape(resource_ref_scan_brief(row.get('resourceRefScan')))}</li>")
        body.append(f"<li>scene payload context: {html.escape(scene_payload_context_brief(row.get('scenePayloadContext')))}</li>")
        body.append(f"<li>scene list context: {html.escape(scene_list_context_brief(row.get('sceneListContext')))}</li>")
        body.append(f"<li>frontier reader branch context: {html.escape(frontier_reader_branch_context_brief(row.get('frontierReaderBranchContext')))}</li>")
        body.append(f"<li>frontier payload shape: {html.escape(frontier_payload_shape_brief(row.get('frontierPayloadShape')))}</li>")
        body.append(f"<li>scene adjacency index: {html.escape(scene_adjacency_index_brief(row.get('sceneAdjacencyIndex')))}</li>")
        body.append(f"<li>exit target ranking: {html.escape(exit_target_ranking_brief(row.get('exitTargetRanking')))}</li>")
        body.append(f"<li>record pattern contrast: {html.escape(record_pattern_contrast_brief(row.get('recordPatternContrast')))}</li>")
        body.append(f"<li>strict target link gap: {html.escape(strict_target_link_gap_brief(row.get('strictTargetLinkGap')))}</li>")
        body.append(f"<li>hotspot gap: {html.escape(hotspot_gap_brief(row.get('hotspotGap')))}</li>")
        body.append(f"<li>entry context: {html.escape(entry_context_brief(row.get('entryContext')))}</li>")
        body.append(f"<li>selector bridge refs: {html.escape(selector_bridge_brief(row.get('selectorBridgeRefs')))}</li>")
        body.append(f"<li>manifest point scan: {html.escape(manifest_point_scan_brief(row.get('manifestPointScan')))}</li>")
        body.append(f"<li>root point scan: {html.escape(root_point_scan_brief(row.get('rootPointScan')))}</li>")
        body.append(f"<li>edge trigger gap: {html.escape(edge_trigger_gap_brief(row.get('edgeTriggerGap')))}</li>")
        body.append(f"<li>tile hotspot pattern contrast: {html.escape(tile_hotspot_pattern_brief(row.get('tileHotspotPatternContrast')))}</li>")
        body.append(f"<li>strict event tile signature scan: {html.escape(strict_event_tile_signature_brief(row.get('strictEventTileSignatureScan')))}</li>")
        body.append(f"<li>strict hotspot review matrix: {html.escape(strict_hotspot_review_matrix_brief(row.get('strictHotspotReviewMatrix')))}</li>")
        body.append(f"<li>strict source hotspot context: {html.escape(strict_source_hotspot_context_brief(row.get('strictSourceHotspotContext')))}</li>")
        body.append(f"<li>gate base proof gap: {html.escape(gate_base_proof_brief(row.get('gateBaseProofGap')))}</li>")
        body.append(f"<li>branch gate consistency: {html.escape(branch_gate_consistency_brief(row.get('branchGateConsistency')))}</li>")
        body.append(f"<li>branch selector equation: {html.escape(branch_selector_equation_brief(row.get('branchSelectorEquation')))}</li>")
        body.append(f"<li>gate offset sources: {html.escape(gate_offset_sources_brief(row.get('gateOffsetSources')))}</li>")
        body.append(f"<li>gate offset patterns: {html.escape(gate_offset_patterns_brief(row.get('gateOffsetPatterns')))}</li>")
        body.append(f"<li>gate base candidates: {html.escape(gate_base_candidates_brief(row.get('gateBaseCandidates')))}</li>")
        body.append(f"<li>gate sample values: {html.escape(gate_sample_values_brief(row.get('gateSampleValues')))}</li>")
        body.append(f"<li>gate pass matrix: {html.escape(gate_pass_matrix_brief(row.get('gatePassMatrix')))}</li>")
        body.append(f"<li>selection buffer bases: {html.escape(selection_buffer_bases_brief(row.get('selectionBufferBases')))}</li>")
        body.append(f"<li>opcode20 object base candidates: {html.escape(opcode20_object_base_brief(row.get('opcode20ObjectBaseCandidates')))}</li>")
        body.append(f"<li>opcode20 active order space: {html.escape(opcode20_order_space_brief(row.get('opcode20OrderSpace')))}</li>")
        body.append(f"<li>opcode20 context+0xf2 sources: {html.escape(opcode20_context_f2_brief(row.get('opcode20ContextF2Sources')))}</li>")
        body.append(f"<li>opcode20 slot sources: {html.escape(opcode20_slot_sources_brief(row.get('opcode20SlotSources')))}</li>")
        body.append(f"<li>opcode20 slot descriptor writers: {html.escape(opcode20_slot_descriptor_writers_brief(row.get('opcode20SlotDescriptorWriters')))}</li>")
        body.append(f"<li>opcode20 descriptor scripts: {html.escape(opcode20_descriptor_scripts_brief(row.get('opcode20DescriptorScripts')))}</li>")
        body.append(f"<li>opcode20 sample order effects: {html.escape(opcode20_sample_order_brief(row.get('opcode20SampleOrderEffects')))}</li>")
        body.append(f"<li>opcode20 runtime materializers: {html.escape(opcode20_runtime_materializers_brief(row.get('opcode20RuntimeMaterializers')))}</li>")
        body.append(f"<li>opcode20 nested base modes: {html.escape(opcode20_nested_base_modes_brief(row.get('opcode20NestedBaseModes')))}</li>")
        body.append(f"<li>predecessor state effect: {html.escape(predecessor_state_effect_brief(row.get('predecessorStateEffect')))}</li>")
        body.append(f"<li>predecessor persistence gap: {html.escape(predecessor_persistence_brief(row.get('predecessorPersistenceGap')))}</li>")
        body.append(f"<li>predecessor branch-state execution gap: {html.escape(predecessor_branch_state_execution_brief(row.get('predecessorBranchStateExecutionGap')))}</li>")
        body.append(f"<li>predecessor fill execution/order gap: {html.escape(predecessor_fill_execution_order_gap_brief(row.get('predecessorFillExecutionOrderGap')))}</li>")
        body.append(f"<li>predecessor fill opcode10 context: {html.escape(predecessor_fill_opcode10_context_brief(row.get('predecessorFillOpcode10Context')))}</li>")
        body.append(f"<li>predecessor descriptor bridge gap: {html.escape(predecessor_descriptor_bridge_gap_brief(row.get('predecessorDescriptorBridgeGap')))}</li>")
        body.append(f"<li>predecessor fill-site execution context: {html.escape(predecessor_fill_site_execution_context_brief(row.get('predecessorFillSiteExecutionContext')))}</li>")
        body.append(f"<li>selector merge execution gap: {html.escape(merge_execution_gap_brief(row.get('mergeExecutionGap')))}</li>")
        body.append(f"<li>merge runtime context: {html.escape(merge_runtime_context_brief(row.get('mergeRuntimeContext')))}</li>")
        body.append(f"<li>merge closure context: {html.escape(merge_closure_context_brief(row.get('mergeClosureContext')))}</li>")
        body.append(f"<li>active flag effect: {html.escape(active_flag_effect_brief(row.get('activeFlagEffect')))}</li>")
        body.append(f"<li>secondary fill roots: {html.escape(secondary_fill_roots_brief(row.get('secondaryFillRoots')))}</li>")
        body.append(f"<li>inherited state candidates: {html.escape(inherited_state_candidates_brief(row.get('inheritedStateCandidates')))}</li>")
        body.append(f"<li>current state sources: {html.escape(current_state_sources_brief(row.get('currentStateSources')))}</li>")
        body.append(f"<li>predecessor tail reset: {html.escape(predecessor_tail_reset_brief(row.get('predecessorTailReset')))}</li>")
        body.append(f"<li>branch state writers: {html.escape(branch_state_writers_brief(row.get('branchStateWriters')))}</li>")
        body.append(f"<li>branch state dispatch: {html.escape(branch_state_dispatch_brief(row.get('branchStateDispatch')))}</li>")
        body.append(f"<li>secondary state sources: {html.escape(secondary_state_sources_brief(row.get('secondaryStateSources')))}</li>")
        body.append(f"<li>branch state opcode overlap: {html.escape(branch_state_opcode_overlap_brief(row.get('branchStateOpcodeOverlap')))}</li>")
        body.append(f"<li>event/object branch state candidates: {html.escape(event_object_branch_state_brief(row.get('eventObjectBranchState')))}</li>")
        body.append(f"<li>predecessor route order: {html.escape(predecessor_route_order_brief(row.get('predecessorRouteOrder')))}</li>")
        body.append(f"<li>selector set decomposition: {html.escape(selector_set_decomposition_brief(row.get('selectorSetDecomposition')))}</li>")
        body.append(f"<li>selector recomposition lattice: {html.escape(selector_recomposition_lattice_brief(row.get('selectorRecompositionLattice')))}</li>")
        body.append(f"<li>mapset aliases: {html.escape(mapset_aliases_brief(row.get('mapsetAliases')))}</li>")
        body.append(f"<li>target alias state effects: {html.escape(target_alias_state_effects_brief(row.get('targetAliasStateEffects')))}</li>")
        body.append(f"<li>address predecessor context: {html.escape(address_predecessor_context_brief(row.get('addressPredecessorContext')))}</li>")
        body.append(f"<li>target alias bridge: {html.escape(target_alias_bridge_brief(row.get('targetAliasBridge')))}</li>")
        body.append(f"<li>route root ref context: {html.escape(route_root_ref_context_brief(row.get('routeRootRefContext')))}</li>")
        body.append(f"<li>predecessor bridge refs: {html.escape(predecessor_bridge_refs_brief(row.get('predecessorBridgeRefs')))}</li>")
        body.append(f"<li>reverse reuse context: {html.escape(reverse_reuse_context_brief(row.get('reverseReuseContext')))}</li>")
        body.append(f"<li>selector merge bridge matrix: {html.escape(merge_bridge_matrix_brief(row.get('mergeBridgeMatrix')))}</li>")
        body.append(f"<li>selected-pointer opcode paths: {html.escape(selected_pointer_opcode_paths_brief(row.get('selectedPointerOpcodePaths')))}</li>")
        body.append(f"<li>global selected-pointer paths: {html.escape(global_selected_pointer_paths_brief(row.get('globalSelectedPointerPaths')))}</li>")
        body.append(f"<li>selected-pointer usage: {html.escape(selected_pointer_usage_brief(row.get('selectedPointerUsage')))}</li>")
        body.append(f"<li>selected-root execution gap: {html.escape(selected_root_execution_gap_brief(row.get('selectedRootExecutionGap')))}</li>")
        body.append(
            "<li>runtime trace/equivalent rejection: "
            f"{html.escape(runtime_trace_equivalent_rejection_brief(row.get('runtimeTraceEquivalentRejection')))}</li>"
        )
        body.append(f"<li>route-pair entry execution gap: {html.escape(route_pair_entry_execution_gap_brief(row.get('routePairEntryExecutionGap')))}</li>")
        body.append(f"<li>opcode08 activation windows: {html.escape(opcode08_activation_windows_brief(row.get('opcode08ActivationWindows')))}</li>")
        body.append(f"<li>opcode08 unreadable producers: {html.escape(opcode08_unreadable_producers_brief(row.get('opcode08UnreadableProducers')))}</li>")
        body.append(f"<li>opcode09 pointer collisions: {html.escape(opcode09_pointer_collisions_brief(row.get('opcode09PointerCollisions')))}</li>")
        body.append(f"<li>secondary reset scope: {html.escape(secondary_reset_scope_brief(row.get('secondaryResetScope')))}</li>")
        body.append(f"<li>secondary global reset gap: {html.escape(secondary_global_reset_gap_brief(row.get('secondaryGlobalResetGap')))}</li>")
        body.append(f"<li>secondary block writes: {html.escape(secondary_block_writes_brief(row.get('secondaryBlockWrites')))}</li>")
        body.append(f"<li>runtime selector byte writes: {html.escape(runtime_selector_byte_writes_brief(row.get('runtimeSelectorByteWrites')))}</li>")
        body.append(f"<li>post-gate reset candidates: {html.escape(post_gate_reset_brief(row.get('postGateResetCandidates')))}</li>")
        body.append(f"<li>secondary route-overlap candidates: {html.escape(secondary_route_overlap_brief(row.get('secondaryRouteOverlapCandidates')))}</li>")
        body.append(f"<li>synthetic savedat probe: {html.escape(synthetic_savedata_probe_brief(row.get('syntheticSavedataProbe')))}</li>")
        body.append(f"<li>real savedata evidence gap: {html.escape(real_savedata_evidence_gap_brief(row.get('realSavedataEvidenceGap')))}</li>")
        body.append(f"<li>runtime source-save load variant context: {html.escape(runtime_source_save_load_variant_context_brief(row.get('runtimeSourceSaveLoadVariantContext')))}</li>")
        body.append(f"<li>selectionBuffer[0x20] provenance: {html.escape(selection_buffer20_provenance_brief(row.get('selectionBuffer20Provenance')))}</li>")
        body.append(f"<li>data descriptor opcode map: {html.escape(data_descriptor_opcode_map_brief(row.get('dataDescriptorOpcodeMap')))}</li>")
        body.append(f"<li>opcode24 payload table: {html.escape(opcode24_payload_table_brief(row.get('opcode24PayloadTable')))}</li>")
        body.append(f"<li>wrapper descriptor context: {html.escape(wrapper_descriptor_context_brief(row.get('wrapperDescriptorContext')))}</li>")
        body.append(f"<li>leaf table context: {html.escape(leaf_table_context_brief(row.get('leafTableContext')))}</li>")
        body.append(f"<li>leaf index space: {html.escape(leaf_index_space_brief(row.get('leafIndexSpace')))}</li>")
        body.append(f"<li>route-pair descriptor context: {html.escape(route_pair_descriptor_context_brief(row.get('routePairDescriptorContext')))}</li>")
        body.append(f"<li>opcode07 indexed pointers: {html.escape(opcode07_indexed_pointers_brief(row.get('opcode07IndexedPointers')))}</li>")
        body.append(f"<li>object61 stream operands: {html.escape(object61_stream_operands_brief(row.get('object61StreamOperands')))}</li>")
        body.append(f"<li>context58 consumers: {html.escape(context58_consumers_brief(row.get('context58Consumers')))}</li>")
        body.append(f"<li>current root frontier paths: {html.escape(current_root_frontier_paths_brief(row.get('currentRootFrontierPaths')))}</li>")
        body.append(f"<li>current writer paths: {html.escape(current_writer_paths_brief(row.get('currentWriterPaths')))}</li>")
        body.append("</ul><h3>Strict Cluster Candidates</h3><ul>")
        for cluster in row.get("strictClusterCandidates") or []:
            events = ", ".join(record.get("recordVaHex", "") for record in cluster.get("eventRecords") or [])
            relevance = ", ".join(cluster.get("relevance") or [])
            sources = ", ".join(cluster.get("eventSources") or []) or "-"
            links = ", ".join(cluster.get("eventFieldLinks") or []) or "-"
            body.append(
                f"<li><code>{html.escape(str(cluster.get('clusterStartHex')))}</code>.."
                f"<code>{html.escape(str(cluster.get('clusterEndHex')))}</code>: "
                f"{html.escape(str(cluster.get('role') or '-'))}; "
                f"{html.escape(relevance)}; eventSources={html.escape(sources)}; "
                f"eventLinks={html.escape(links)}; events {html.escape(events or '-')}</li>"
            )
        body.append("</ul><h3>Next Actions</h3><ol>")
        for action in row.get("nextActions") or []:
            body.append(
                f"<li><strong>{html.escape(action['task'])}</strong> "
                f"[{html.escape(action['status'])}]<br>"
                f"why: {html.escape(action['why'])}<br>"
                "related failed gates: "
                f"<code>{html.escape(list_text(action.get('relatedFailedGateIds')))}</code><br>"
                "next input classes: "
                f"<code>{html.escape(list_text(action.get('nextInputClasses')))}</code><br>"
                f"next input summary: {html.escape(action.get('nextInputSummary') or '-')}<br>"
                f"evidence: {html.escape(action['evidence'] or '-')}<br>"
                f"refs: {html.escape(evidence_refs_brief(action.get('evidenceRefs') or []))}</li>"
            )
        body.append("</ol>")
    return "\n".join(body)


def write_outputs(rows: list[dict], out_dir: Path) -> None:
    out_dir.mkdir(parents=True, exist_ok=True)
    (out_dir / "route_investigation_queue.json").write_text(
        json.dumps(rows, ensure_ascii=False, separators=(",", ":")) + "\n",
        encoding="utf-8",
    )
    (out_dir / "route_investigation_queue.html").write_text(html_page(rows), encoding="utf-8")


def main() -> None:
    parser = argparse.ArgumentParser()
    parser.add_argument("--out-dir", type=Path, default=OUT)
    args = parser.parse_args()
    rows = build_rows(
        load_json(args.out_dir / "confirmed_route_blockers.json", []),
        load_json(args.out_dir / "save_selector_frontier.json", []),
        load_json(args.out_dir / "save_selector_frontier_branches.json", []),
        load_json(args.out_dir / "save_selector_frontier_selection_flow.json", []),
        load_json(args.out_dir / "save_selector_leaf_streams.json", []),
        load_json(args.out_dir / "field_map_record_roots.json", {}),
        load_json(args.out_dir / "save_selector_writer_chain.json", []),
        load_json(args.out_dir / "save_selector_gate_paths.json", []),
        load_json(args.out_dir / "save_selector_opcode24_mode1_indirect_context.json", {}),
        load_json(args.out_dir / "save_selector_opcode24_mode1_file_read_context.json", {}),
        load_json(args.out_dir / "save_selector_opcode24_mode1_block_writes.json", {}),
        load_json(args.out_dir / "save_selector_opcode24_runtime_enabled_block_writes.json", {}),
        load_json(args.out_dir / "save_selector_opcode24_mode1_source_writes.json", {}),
        load_json(args.out_dir / "save_selector_opcode24_mode1_runtime_context.json", {}),
        load_json(args.out_dir / "save_selector_opcode24_runtime_enabled_context.json", {}),
        load_json(args.out_dir / "save_selector_opcode24_mode1_default_effect.json", {}),
        load_json(args.out_dir / "map1_01a_exit_coordinate_variant_scan.json", {}),
        load_json(args.out_dir / "map_exit_coordinate_refs.json", {}),
        load_json(args.out_dir / "map1_01a_exit_coordinate_context.json", {}),
        load_json(args.out_dir / "original_collision_route_audit.json", {}),
        load_json(args.out_dir / "save_selector_gate_base_proof_gap.json", {}),
        load_json(args.out_dir / "save_selector_branch_gate_consistency.json", {}),
        load_json(args.out_dir / "save_selector_branch_selector_equation.json", {}),
        load_json(args.out_dir / "save_selector_gate_offset_sources.json", {}),
        load_json(args.out_dir / "save_selector_gate_offset_patterns.json", {}),
        load_json(args.out_dir / "save_selector_gate_base_candidates.json", {}),
        load_json(args.out_dir / "save_selector_gate_sample_values.json", {}),
        load_json(args.out_dir / "save_selector_gate_pass_matrix.json", {}),
        load_json(args.out_dir / "save_selector_predecessor_state_effect.json", {}),
        load_json(args.out_dir / "save_selector_predecessor_persistence_gap.json", {}),
        load_json(args.out_dir / "save_selector_predecessor_branch_state_execution_gap.json", {}),
        load_json(args.out_dir / "save_selector_active_flag_effect.json", {}),
        load_json(args.out_dir / "save_selector_secondary_fill_roots.json", {}),
        load_json(args.out_dir / "save_selector_inherited_state_candidates.json", {}),
        load_json(args.out_dir / "save_selector_current_state_sources.json", {}),
        load_json(args.out_dir / "save_selector_predecessor_tail_reset.json", {}),
        load_json(args.out_dir / "save_selector_branch_state_writers.json", {}),
        load_json(args.out_dir / "save_selector_branch_state_dispatch.json", {}),
        load_json(args.out_dir / "save_selector_secondary_state_sources.json", {}),
        load_json(args.out_dir / "save_selector_branch_state_opcode_overlap.json", {}),
        load_json(args.out_dir / "event_object_branch_state_stream_candidates.json", {}),
        load_json(args.out_dir / "event_object_branch_state_candidate_links.json", {}),
        load_json(args.out_dir / "event_object_branch_state_block_context.json", {}),
        load_json(args.out_dir / "save_selector_predecessor_route_order.json", {}),
        load_json(args.out_dir / "save_selector_set_decomposition.json", {}),
        load_json(args.out_dir / "save_selector_recomposition_lattice.json", {}),
        load_json(args.out_dir / "save_selector_mapset_aliases.json", {}),
        load_json(args.out_dir / "save_selector_target_alias_state_effects.json", {}),
        load_json(args.out_dir / "save_selector_address_predecessor_context.json", {}),
        load_json(args.out_dir / "save_selector_target_alias_bridges.json", {}),
        load_json(args.out_dir / "save_selector_route_root_ref_context.json", {}),
        load_json(args.out_dir / "save_selector_predecessor_bridge_refs.json", {}),
        load_json(args.out_dir / "save_selector_reverse_reuse_context.json", {}),
        load_json(args.out_dir / "save_selector_merge_bridge_matrix.json", {}),
        load_json(args.out_dir / "save_selector_selected_pointer_opcode_paths.json", {}),
        load_json(args.out_dir / "save_selector_global_selected_pointer_paths.json", {}),
        load_json(args.out_dir / "save_selector_selected_pointer_usage.json", {}),
        load_json(args.out_dir / "save_selector_selected_root_execution_gap.json", {}),
        load_json(args.out_dir / "save_selector_route_pair_entry_execution_gap.json", {}),
        load_json(args.out_dir / "save_selector_opcode08_activation_windows.json", {}),
        load_json(args.out_dir / "save_selector_opcode08_unreadable_producers.json", {}),
        load_json(args.out_dir / "save_selector_opcode09_pointer_collisions.json", {}),
        load_json(args.out_dir / "synthetic_savedata_selector_probe.json", {}),
        load_json(args.out_dir / "save_selector_selection_buffer20_provenance.json", {}),
        load_json(args.out_dir / "save_selector_data_descriptor_opcode_map.json", {}),
        load_json(args.out_dir / "save_selector_opcode24_payload_table.json", {}),
        load_json(args.out_dir / "save_selector_real_savedata_evidence_gap.json", {}),
        load_json(args.out_dir / "save_selector_opcode24_globals.json", {}),
        load_json(args.out_dir / "map1_01a_resource_ref_scan.json", {}),
        load_json(args.out_dir / "save_selector_opcode20_object_base_candidates.json", {}),
        load_json(args.out_dir / "save_selector_opcode20_order_space.json", {}),
        load_json(args.out_dir / "save_selector_opcode20_context_f2_sources.json", {}),
        load_json(args.out_dir / "save_selector_opcode20_slot_sources.json", {}),
        load_json(args.out_dir / "save_selector_opcode20_descriptor_scripts.json", {}),
        load_json(args.out_dir / "save_selector_opcode20_sample_order_effects.json", {}),
        load_json(args.out_dir / "save_selector_opcode20_runtime_materializers.json", {}),
        load_json(args.out_dir / "save_selector_opcode20_nested_base_modes.json", {}),
        load_json(args.out_dir / "save_selector_secondary_reset_scope.json", {}),
        load_json(args.out_dir / "save_selector_secondary_global_reset_gap.json", {}),
        load_json(args.out_dir / "save_selector_secondary_block_writes.json", {}),
        load_json(args.out_dir / "save_selector_runtime_selector_byte_writes.json", {}),
        load_json(args.out_dir / "save_selector_post_gate_reset_candidates.json", {}),
        load_json(args.out_dir / "save_selector_secondary_route_overlap_candidates.json", {}),
        load_json(args.out_dir / "save_selector_wrapper_descriptor_context.json", {}),
        load_json(args.out_dir / "map1_01a_scene_payload_context.json", {}),
        load_json(args.out_dir / "save_selector_scene_list_context.json", {}),
        load_json(args.out_dir / "save_selector_scene_adjacency_index.json", {}),
        load_json(args.out_dir / "save_selector_leaf_table_context.json", {}),
        load_json(args.out_dir / "save_selector_leaf_index_space.json", {}),
        load_json(args.out_dir / "save_selector_route_pair_descriptor_context.json", {}),
        load_json(args.out_dir / "save_selector_opcode07_indexed_pointers.json", {}),
        load_json(args.out_dir / "save_selector_object61_stream_operands.json", {}),
        load_json(args.out_dir / "save_selector_context58_consumers.json", {}),
        load_json(args.out_dir / "save_selector_current_root_frontier_paths.json", {}),
        load_json(args.out_dir / "save_selector_selection_buffer_bases.json", {}),
        load_json(args.out_dir / "map1_01a_record_pattern_contrast.json", {}),
        load_json(args.out_dir / "map1_01a_strict_target_link_gap.json", {}),
        load_json(args.out_dir / "map1_01a_entry_context.json", {}),
        load_json(args.out_dir / "map1_01a_selector_bridge_refs.json", {}),
        load_json(args.out_dir / "map1_01a_manifest_point_scan.json", {}),
        load_json(args.out_dir / "map1_01a_root_point_scan.json", {}),
        load_json(args.out_dir / "save_selector_opcode20_slot_descriptor_writers.json", {}),
        load_json(args.out_dir / "save_selector_opcode24_current_root_modes.json", {}),
        load_json(args.out_dir / "map1_01a_event_shape_scan.json", {}),
        load_json(args.out_dir / "save_selector_current_writer_paths.json", []),
        edge_trigger_gap_summary=load_json(args.out_dir / "map1_01a_edge_trigger_gap.json", {}),
        hotspot_gap_summary=load_json(args.out_dir / "map1_01a_hotspot_gap.json", {}),
        tile_hotspot_pattern_summary=load_json(
            args.out_dir / "map1_01a_tile_hotspot_pattern_contrast.json",
            {},
        ),
        strict_event_tile_signature_summary=load_json(
            args.out_dir / "map1_01a_strict_event_tile_signature_scan.json",
            {},
        ),
        strict_hotspot_review_matrix_summary=load_json(
            args.out_dir / "map1_01a_strict_hotspot_review_matrix.json",
            {},
        ),
        strict_source_hotspot_context_summary=load_json(
            args.out_dir / "map1_01a_strict_source_hotspot_context.json",
            {},
        ),
        runtime_source_save_load_variant_context_summary=load_json(
            args.out_dir / "runtime_source_save_load_variant_context.json",
            {},
        ),
        runtime_predecessor_route_attempt_context_summary=load_json(
            args.out_dir / "runtime_predecessor_route_attempt_context.json",
            {},
        ),
        frontier_reader_branch_context_summary=load_json(
            args.out_dir / "save_selector_frontier_reader_branch_context.json",
            {},
        ),
        frontier_payload_shape_summary=load_json(
            args.out_dir / "save_selector_frontier_payload_shape.json",
            {},
        ),
        predecessor_fill_execution_order_gap_summary=load_json(
            args.out_dir / "save_selector_predecessor_fill_execution_order_gap.json",
            {},
        ),
        predecessor_fill_opcode10_context_summary=load_json(
            args.out_dir / "save_selector_predecessor_fill_opcode10_context.json",
            {},
        ),
        predecessor_descriptor_bridge_gap_summary=load_json(
            args.out_dir / "save_selector_predecessor_descriptor_bridge_gap.json",
            {},
        ),
        predecessor_fill_site_execution_context_summary=load_json(
            args.out_dir / "save_selector_predecessor_fill_site_execution_context.json",
            {},
        ),
        merge_execution_gap_summary=load_json(
            args.out_dir / "save_selector_merge_execution_gap.json",
            {},
        ),
        merge_runtime_context_summary=load_json(
            args.out_dir / "save_selector_merge_runtime_context.json",
            {},
        ),
        merge_closure_context_summary=load_json(
            args.out_dir / "save_selector_merge_closure_context.json",
            {},
        ),
        exit_target_ranking_summary=load_json(
            args.out_dir / "map1_01a_exit_target_ranking.json",
            {},
        ),
        runtime_trace_feasibility_summary=load_json(
            args.out_dir / "runtime_trace_feasibility.json",
            {},
        ),
        runtime_opcode24_flag_context_summary=load_json(
            args.out_dir / "runtime_opcode24_flag_context.json",
            {},
        ),
    )
    write_outputs(rows, args.out_dir)
    print(f"wrote {len(rows)} route investigation rows -> {args.out_dir / 'route_investigation_queue.html'}")


if __name__ == "__main__":
    main()
