{
  "schema_version": "2026-05-28.agent-repair-execution.v1",
  "name": "TokRepo Agent Repair Execution Receipts Eval",
  "canonical_url": "https://tokrepo.com/evals/agent-repair-execution.json",
  "updated_at": "2026-05-28",
  "generated_by": "node scripts/run_agent_repair_execution.mjs --json",
  "purpose": "Public deterministic contract for closing the loop between repair recommendations and executable, privacy-safe repair receipts with acceptance oracles and rollback or handoff boundaries.",
  "repair_execution_contract": {
    "source_actions_eval": "https://tokrepo.com/evals/agent-improvement-actions.json",
    "public_feedback_api": "https://api.tokrepo.com/api/v1/tokenboard/agent/funnel",
    "event_ingestion_api": "https://api.tokrepo.com/api/v1/tokenboard/agent/events",
    "required_live_window_days": 14,
    "required_live_event_keys": [
      "mcp_search",
      "mcp_detail",
      "capability_resolve",
      "verify_asset",
      "audit_asset",
      "install_plan",
      "install_dry_run",
      "rollback_plan",
      "agent_handoff",
      "handoff_plan",
      "harvest_plan"
    ],
    "optional_live_event_keys": [
      "install_apply",
      "harvest_publish"
    ],
    "execution_boundary": "A repair is not complete when an action is recommended. It is complete only when a receipt links the source action to a run command, expected artifact, acceptance oracle, rollback or handoff path, live event dependencies, and privacy guards.",
    "privacy_boundary": "Only aggregate event counters, public schema references, receipt ids, source action ids, deterministic coverage metadata, and hashed identifiers may be published. The contract must not expose query text, task text, file contents, raw diffs, local paths, credentials, cookies, share tokens, raw prompts, or private harvest payloads.",
    "live_check_command": "WEB_BASE=https://tokrepo.com API_BASE=https://api.tokrepo.com node scripts/run_agent_repair_execution.mjs --check-live"
  },
  "metrics": {
    "receipts_total": 3,
    "receipts_passed": 3,
    "repair_execution_receipt_coverage_pct": 100,
    "action_linkage_coverage_pct": 100,
    "acceptance_oracle_execution_pct": 100,
    "rollback_or_handoff_coverage_pct": 100,
    "live_funnel_dependency_coverage_pct": 100,
    "privacy_guard_coverage_pct": 100
  },
  "repair_execution_receipts": [
    {
      "receipt_id": "execute_relevance_resolution_repair",
      "source_action_id": "repair_relevance_resolution_gap",
      "execution_boundary": "stage_and_verify_capability_resolution",
      "required_events": [
        "mcp_search",
        "mcp_detail",
        "capability_resolve"
      ],
      "optional_events": [],
      "run_command": "tokrepo resolve <capability> --target codex --explain --json",
      "expected_artifact": {
        "type": "capability_resolution_note",
        "required_fields": [
          "capability",
          "candidate_uuid_hash",
          "fit_score",
          "missing_capabilities",
          "next_safe_action"
        ]
      },
      "acceptance_oracle": {
        "type": "repair_execution_oracle",
        "pass_condition": "The receipt links the repair action to search, detail, and capability_resolve evidence, and names the next safe action without publishing private task text."
      },
      "rollback_or_handoff": {
        "type": "handoff",
        "trigger": "If no candidate satisfies the capability threshold, emit a private handoff note instead of forcing an install.",
        "command": "tokrepo agent-handoff --json"
      },
      "public_surfaces": [
        "https://tokrepo.com/evals/agent-improvement-actions.json",
        "https://tokrepo.com/evals/agent-repair-execution.json",
        "https://tokrepo.com/schemas/capability-resolution.schema.json",
        "https://api.tokrepo.com/api/v1/tokenboard/agent/funnel"
      ],
      "privacy_guard": {
        "publishable_fields_only": [
          "receipt_id",
          "source_action_id",
          "event",
          "target",
          "result",
          "candidate_uuid_hash",
          "fit_score"
        ],
        "forbidden_fields": [
          "query_text",
          "task_text",
          "file_content",
          "local_path",
          "credential",
          "cookie",
          "share_token",
          "raw_prompt"
        ]
      },
      "task_outcome_verdict": "pass",
      "user_effect": "A weak relevance signal now produces a concrete capability-resolution receipt that the next agent can audit or continue.",
      "evidence_digest": {
        "algorithm": "sha256",
        "digest": "sha256:9c4d7ce6b0764650add70711236177ca29d48dc3f6fcb71defc5c9a03fe502b4"
      },
      "coverage": {
        "pass": true,
        "checks": [
          {
            "id": "receipt_field:receipt_id",
            "pass": true
          },
          {
            "id": "receipt_field:source_action_id",
            "pass": true
          },
          {
            "id": "receipt_field:execution_boundary",
            "pass": true
          },
          {
            "id": "receipt_field:required_events",
            "pass": true
          },
          {
            "id": "receipt_field:run_command",
            "pass": true
          },
          {
            "id": "receipt_field:expected_artifact",
            "pass": true
          },
          {
            "id": "receipt_field:acceptance_oracle",
            "pass": true
          },
          {
            "id": "receipt_field:rollback_or_handoff",
            "pass": true
          },
          {
            "id": "receipt_field:privacy_guard",
            "pass": true
          },
          {
            "id": "receipt_field:user_effect",
            "pass": true
          },
          {
            "id": "links_to_improvement_action",
            "pass": true
          },
          {
            "id": "has_actionable_run_command",
            "pass": true
          },
          {
            "id": "has_acceptance_oracle",
            "pass": true
          },
          {
            "id": "has_rollback_or_handoff",
            "pass": true
          },
          {
            "id": "has_privacy_forbidden_fields",
            "pass": true
          }
        ]
      }
    },
    {
      "receipt_id": "execute_trust_gate_repair",
      "source_action_id": "repair_trust_gate_gap",
      "execution_boundary": "stage_trust_gate_with_rollback",
      "required_events": [
        "verify_asset",
        "audit_asset",
        "install_plan",
        "install_dry_run",
        "rollback_plan"
      ],
      "optional_events": [
        "install_apply"
      ],
      "run_command": "tokrepo verify <uuid> --target codex --json && tokrepo audit --offline --json && tokrepo install <uuid> --target codex --dry-run --json && tokrepo rollback --last --target codex --dry-run --json",
      "expected_artifact": {
        "type": "trust_gate_repair_receipt",
        "required_fields": [
          "asset_uuid_hash",
          "verification_result",
          "audit_result",
          "install_plan_result",
          "rollback_plan_result"
        ]
      },
      "acceptance_oracle": {
        "type": "trust_gate_execution_oracle",
        "pass_condition": "The receipt proves verify, audit, install dry-run, and rollback dry-run evidence before any write-capable install is counted as safe."
      },
      "rollback_or_handoff": {
        "type": "rollback",
        "trigger": "If verification, audit, or dry-run fails, stop before install_apply and preserve the rollback plan evidence.",
        "command": "tokrepo rollback --last --target codex --dry-run --json"
      },
      "public_surfaces": [
        "https://tokrepo.com/evals/agent-improvement-actions.json",
        "https://tokrepo.com/evals/agent-repair-execution.json",
        "https://tokrepo.com/schemas/agent-evidence-bundle.schema.json",
        "https://tokrepo.com/schemas/asset-verification.schema.json",
        "https://api.tokrepo.com/api/v1/tokenboard/agent/funnel"
      ],
      "privacy_guard": {
        "publishable_fields_only": [
          "receipt_id",
          "source_action_id",
          "event",
          "target",
          "result",
          "risk_tier",
          "asset_uuid_hash"
        ],
        "forbidden_fields": [
          "raw_diff",
          "file_content",
          "absolute_project_path",
          "secret_value",
          "credential",
          "cookie",
          "access_token",
          "private_patch"
        ]
      },
      "task_outcome_verdict": "pass",
      "user_effect": "A trust warning now becomes a staged execution receipt with rollback proof instead of an unverifiable recommendation.",
      "evidence_digest": {
        "algorithm": "sha256",
        "digest": "sha256:b04a8f4839d5b3d2b264fb95d42683b797f1a1c81640fcbda7e18ad0829552f2"
      },
      "coverage": {
        "pass": true,
        "checks": [
          {
            "id": "receipt_field:receipt_id",
            "pass": true
          },
          {
            "id": "receipt_field:source_action_id",
            "pass": true
          },
          {
            "id": "receipt_field:execution_boundary",
            "pass": true
          },
          {
            "id": "receipt_field:required_events",
            "pass": true
          },
          {
            "id": "receipt_field:run_command",
            "pass": true
          },
          {
            "id": "receipt_field:expected_artifact",
            "pass": true
          },
          {
            "id": "receipt_field:acceptance_oracle",
            "pass": true
          },
          {
            "id": "receipt_field:rollback_or_handoff",
            "pass": true
          },
          {
            "id": "receipt_field:privacy_guard",
            "pass": true
          },
          {
            "id": "receipt_field:user_effect",
            "pass": true
          },
          {
            "id": "links_to_improvement_action",
            "pass": true
          },
          {
            "id": "has_actionable_run_command",
            "pass": true
          },
          {
            "id": "has_acceptance_oracle",
            "pass": true
          },
          {
            "id": "has_rollback_or_handoff",
            "pass": true
          },
          {
            "id": "has_privacy_forbidden_fields",
            "pass": true
          }
        ]
      }
    },
    {
      "receipt_id": "execute_reuse_supply_repair",
      "source_action_id": "repair_reuse_supply_gap",
      "execution_boundary": "private_handoff_before_public_harvest",
      "required_events": [
        "agent_handoff",
        "handoff_plan",
        "harvest_plan"
      ],
      "optional_events": [
        "harvest_publish"
      ],
      "run_command": "tokrepo agent-handoff --json && tokrepo harvest --changed --json",
      "expected_artifact": {
        "type": "private_reuse_supply_receipt",
        "required_fields": [
          "handoff_package_hash",
          "harvest_candidate_count",
          "publish_gate",
          "next_reuse_action"
        ]
      },
      "acceptance_oracle": {
        "type": "reuse_supply_execution_oracle",
        "pass_condition": "The receipt proves private handoff or harvest planning first, and requires an explicit publish gate before public supply creation."
      },
      "rollback_or_handoff": {
        "type": "handoff",
        "trigger": "If the harvest candidate includes private context, keep it as a private handoff package and do not publish.",
        "command": "tokrepo agent-handoff --json"
      },
      "public_surfaces": [
        "https://tokrepo.com/evals/agent-improvement-actions.json",
        "https://tokrepo.com/evals/agent-repair-execution.json",
        "https://tokrepo.com/schemas/handoff-package.schema.json",
        "https://tokrepo.com/schemas/harvest-report.schema.json",
        "https://api.tokrepo.com/api/v1/tokenboard/agent/funnel"
      ],
      "privacy_guard": {
        "publishable_fields_only": [
          "receipt_id",
          "source_action_id",
          "event",
          "target",
          "result",
          "candidate_count",
          "publish_gate"
        ],
        "forbidden_fields": [
          "task_text",
          "file_content",
          "diff_content",
          "private_harvest_payload",
          "secret_value",
          "credential",
          "cookie",
          "local_path"
        ]
      },
      "task_outcome_verdict": "pass",
      "user_effect": "A reuse opportunity now leaves a private handoff or harvest receipt that can feed future agents without leaking private work context.",
      "evidence_digest": {
        "algorithm": "sha256",
        "digest": "sha256:4c3382ba4dcf8ffc088a5490eddd8131683b0f9de8066b7a4a89133e0f2dd8e2"
      },
      "coverage": {
        "pass": true,
        "checks": [
          {
            "id": "receipt_field:receipt_id",
            "pass": true
          },
          {
            "id": "receipt_field:source_action_id",
            "pass": true
          },
          {
            "id": "receipt_field:execution_boundary",
            "pass": true
          },
          {
            "id": "receipt_field:required_events",
            "pass": true
          },
          {
            "id": "receipt_field:run_command",
            "pass": true
          },
          {
            "id": "receipt_field:expected_artifact",
            "pass": true
          },
          {
            "id": "receipt_field:acceptance_oracle",
            "pass": true
          },
          {
            "id": "receipt_field:rollback_or_handoff",
            "pass": true
          },
          {
            "id": "receipt_field:privacy_guard",
            "pass": true
          },
          {
            "id": "receipt_field:user_effect",
            "pass": true
          },
          {
            "id": "links_to_improvement_action",
            "pass": true
          },
          {
            "id": "has_actionable_run_command",
            "pass": true
          },
          {
            "id": "has_acceptance_oracle",
            "pass": true
          },
          {
            "id": "has_rollback_or_handoff",
            "pass": true
          },
          {
            "id": "has_privacy_forbidden_fields",
            "pass": true
          }
        ]
      }
    }
  ]
}
