{
  "schema_version": "2026-05-27.agent-retention-reuse.v1",
  "name": "TokRepo Agent Retention Reuse Eval",
  "canonical_url": "https://tokrepo.com/evals/agent-retention-reuse.json",
  "updated_at": "2026-05-27",
  "generated_by": "node scripts/run_agent_retention_reuse.mjs --json",
  "purpose": "Public deterministic contract for proving that a TokRepo install remains auditable, recoverable, and reusable after adoption without publishing private task text, local paths, diffs, or file contents.",
  "retention_reuse_contract": {
    "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": [
      "install_apply",
      "rollback_plan",
      "agent_handoff",
      "handoff_plan",
      "harvest_plan"
    ],
    "optional_live_event_keys": [
      "harvest_publish",
      "audit_asset"
    ],
    "local_state_contract": [
      "TokRepo.lock",
      ".tokrepo/state.json",
      "tokrepo installed --project --json",
      "tokrepo installed --target codex --json",
      "tokrepo rollback --last --target codex --dry-run --json"
    ],
    "reuse_contract": [
      "tokrepo agent-handoff --json",
      "tokrepo_handoff_plan",
      "tokrepo harvest --changed --json",
      "tokrepo_harvest"
    ],
    "completion_boundary": "Retention is not a page view or a one-time install. Retention requires installed-state inspection, rollback rehearsal, and a post-task handoff or harvest plan; harvest_publish remains explicit and separately counted.",
    "privacy_boundary": "Only anonymous aggregate counters, hashed identifiers, and public schemas may be published. The contract must not expose task text, file contents, diffs, local paths, credentials, cookies, share tokens, or private harvest payloads.",
    "live_check_command": "WEB_BASE=https://tokrepo.com API_BASE=https://api.tokrepo.com node scripts/run_agent_retention_reuse.mjs --check-live"
  },
  "metrics": {
    "stages_total": 3,
    "stages_passed": 3,
    "retention_reuse_stage_pass_pct": 100,
    "required_live_event_coverage_pct": 100,
    "rollback_rehearsal_coverage_pct": 100,
    "reuse_supply_coverage_pct": 100,
    "privacy_guard_coverage_pct": 100
  },
  "retention_stages": [
    {
      "stage_id": "installed_state_audit",
      "task": "Prove that a completed install remains inspectable as local project state after adoption.",
      "required_events": [
        "install_apply",
        "rollback_plan"
      ],
      "required_public_surfaces": [
        "TokRepo.lock",
        ".tokrepo/state.json",
        "tokrepo installed --project --json",
        "tokrepo installed --target codex --json",
        "https://tokrepo.com/evals/agent-retention-reuse.json",
        "https://api.tokrepo.com/api/v1/tokenboard/agent/funnel"
      ],
      "feedback_signal": {
        "source": "anonymous_aggregate_funnel_plus_local_state_contract",
        "required_live_keys": [
          "install_apply",
          "rollback_plan"
        ],
        "interpretation": "A retained adoption must be inspectable after install and must expose a rollback plan before any recovery mutation."
      },
      "privacy_guard": {
        "publishable_fields_only": [
          "event",
          "target",
          "kind",
          "result",
          "asset_uuid_hash",
          "caller_hash"
        ],
        "forbidden_fields": [
          "installed_file_contents",
          "absolute_project_path",
          "local_secret_value",
          "access_token",
          "cookie",
          "private_asset_content"
        ]
      },
      "outcome_oracle": {
        "type": "installed_state_replay_guard",
        "pass_condition": "The public contract proves installed-state inspection and rollback planning without exposing project paths or installed file contents."
      },
      "task_outcome_verdict": "pass",
      "user_effect": "Agents can audit what TokRepo installed in a project and know how to recover without reading private files from production telemetry.",
      "evidence_digest": {
        "algorithm": "sha256",
        "digest": "sha256:f62e78fa2fa1eded2eceee8887e9950e18451c327fff72ee6a43c9e79d92e392"
      },
      "coverage": {
        "pass": true,
        "checks": [
          {
            "id": "stage_field:stage_id",
            "pass": true
          },
          {
            "id": "stage_field:task",
            "pass": true
          },
          {
            "id": "stage_field:required_events",
            "pass": true
          },
          {
            "id": "stage_field:required_public_surfaces",
            "pass": true
          },
          {
            "id": "stage_field:feedback_signal",
            "pass": true
          },
          {
            "id": "stage_field:privacy_guard",
            "pass": true
          },
          {
            "id": "stage_field:outcome_oracle",
            "pass": true
          },
          {
            "id": "stage_field:task_outcome_verdict",
            "pass": true
          },
          {
            "id": "stage_field:user_effect",
            "pass": true
          },
          {
            "id": "has_live_funnel_api",
            "pass": true
          },
          {
            "id": "has_privacy_forbidden_fields",
            "pass": true
          },
          {
            "id": "has_outcome_oracle_pass_condition",
            "pass": true
          }
        ]
      }
    },
    {
      "stage_id": "rollback_rehearsal_feedback",
      "task": "Prove that recovery is rehearsed as a dry-run before local changes are removed.",
      "required_events": [
        "rollback_plan",
        "audit_asset"
      ],
      "required_public_surfaces": [
        "tokrepo rollback --last --target codex --dry-run --json",
        "tokrepo audit --offline --json",
        "https://tokrepo.com/schemas/tokrepo-lock.schema.json",
        "https://tokrepo.com/schemas/tokrepo-project-state.schema.json",
        "https://api.tokrepo.com/api/v1/tokenboard/agent/funnel"
      ],
      "feedback_signal": {
        "source": "rollback_plan_funnel_and_project_state_schema",
        "required_live_keys": [
          "rollback_plan",
          "audit_asset"
        ],
        "interpretation": "Rollback counts as retention feedback only when the agent can inspect the affected install session and produce a dry-run removal plan."
      },
      "privacy_guard": {
        "publishable_fields_only": [
          "event",
          "target",
          "result",
          "kind",
          "dry_run",
          "session_hash"
        ],
        "forbidden_fields": [
          "file_content",
          "diff_content",
          "absolute_project_path",
          "credential",
          "cookie",
          "share_token"
        ]
      },
      "outcome_oracle": {
        "type": "rollback_before_mutation_guard",
        "pass_condition": "The recovery path is proven by rollback_plan and audit signals, while the public eval forbids raw diffs, file contents, and local paths."
      },
      "task_outcome_verdict": "pass",
      "user_effect": "A user can let an agent test recovery before trusting an install, and TokRepo can measure that safety rehearsal anonymously.",
      "evidence_digest": {
        "algorithm": "sha256",
        "digest": "sha256:7417a15996acd1f18c22053dfff2cd92d8cab5058ed572848c302baa6e0b81e1"
      },
      "coverage": {
        "pass": true,
        "checks": [
          {
            "id": "stage_field:stage_id",
            "pass": true
          },
          {
            "id": "stage_field:task",
            "pass": true
          },
          {
            "id": "stage_field:required_events",
            "pass": true
          },
          {
            "id": "stage_field:required_public_surfaces",
            "pass": true
          },
          {
            "id": "stage_field:feedback_signal",
            "pass": true
          },
          {
            "id": "stage_field:privacy_guard",
            "pass": true
          },
          {
            "id": "stage_field:outcome_oracle",
            "pass": true
          },
          {
            "id": "stage_field:task_outcome_verdict",
            "pass": true
          },
          {
            "id": "stage_field:user_effect",
            "pass": true
          },
          {
            "id": "has_live_funnel_api",
            "pass": true
          },
          {
            "id": "has_privacy_forbidden_fields",
            "pass": true
          },
          {
            "id": "has_outcome_oracle_pass_condition",
            "pass": true
          }
        ]
      }
    },
    {
      "stage_id": "post_task_reuse_supply",
      "task": "Prove that installed or improved assets can turn into private-by-default handoff and harvest supply.",
      "required_events": [
        "agent_handoff",
        "handoff_plan",
        "harvest_plan",
        "harvest_publish"
      ],
      "required_public_surfaces": [
        "tokrepo agent-handoff --json",
        "tokrepo_handoff_plan",
        "tokrepo harvest --changed --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"
      ],
      "feedback_signal": {
        "source": "anonymous_handoff_harvest_funnel_plus_private_default_contract",
        "required_live_keys": [
          "agent_handoff",
          "handoff_plan",
          "harvest_plan"
        ],
        "optional_live_keys": [
          "harvest_publish"
        ],
        "interpretation": "Reuse is counted when a post-task asset package or harvest plan is generated privately by default; publishing remains explicit and separately counted."
      },
      "privacy_guard": {
        "publishable_fields_only": [
          "event",
          "source",
          "target",
          "result",
          "kind",
          "candidate_count"
        ],
        "forbidden_fields": [
          "task_text",
          "file_content",
          "diff_content",
          "private_harvest_payload",
          "credential",
          "access_token",
          "cookie"
        ]
      },
      "outcome_oracle": {
        "type": "reuse_before_publish_guard",
        "pass_condition": "handoff_plan and harvest_plan prove reusable supply without publishing; harvest_publish is visible but not required for private reuse."
      },
      "task_outcome_verdict": "pass",
      "user_effect": "TokRepo can show whether adoption turns into reusable private supply instead of only measuring one-time installs.",
      "evidence_digest": {
        "algorithm": "sha256",
        "digest": "sha256:fdfde59fa14ccc4e2716f42e57365afe295c42c9add62dbcc8b2bb950f65f230"
      },
      "coverage": {
        "pass": true,
        "checks": [
          {
            "id": "stage_field:stage_id",
            "pass": true
          },
          {
            "id": "stage_field:task",
            "pass": true
          },
          {
            "id": "stage_field:required_events",
            "pass": true
          },
          {
            "id": "stage_field:required_public_surfaces",
            "pass": true
          },
          {
            "id": "stage_field:feedback_signal",
            "pass": true
          },
          {
            "id": "stage_field:privacy_guard",
            "pass": true
          },
          {
            "id": "stage_field:outcome_oracle",
            "pass": true
          },
          {
            "id": "stage_field:task_outcome_verdict",
            "pass": true
          },
          {
            "id": "stage_field:user_effect",
            "pass": true
          },
          {
            "id": "has_live_funnel_api",
            "pass": true
          },
          {
            "id": "has_privacy_forbidden_fields",
            "pass": true
          },
          {
            "id": "has_outcome_oracle_pass_condition",
            "pass": true
          }
        ]
      }
    }
  ]
}
