{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "anu_v3.profile_adoption_planner.adoption_plan.v1",
  "title": "task-2553+42 profile engine operational adoption plan + dry-run",
  "description": "Step 2 adoption plan (expected_files allowlist 후보 / conflict set / risk tier) + read-only dry-run schema. 실 in-place adoption 0 (plan + simulate only).",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "plan_schema",
    "planner_module",
    "planner_version",
    "task",
    "adoption_lifecycle_effect",
    "real_in_place_adoption_count",
    "touchpoints",
    "expected_files_allowlist",
    "conflict",
    "risk",
    "byte0_anchors",
    "callback_collector_untouched"
  ],
  "properties": {
    "plan_schema": { "const": "anu_v3.profile_adoption_planner.adoption_plan.v1" },
    "planner_module": { "const": "anu_v3.profile_adoption_planner" },
    "planner_version": { "type": "string", "minLength": 1 },
    "task": { "const": "task-2553+42" },
    "step": { "type": "string" },
    "adoption_lifecycle_effect": { "const": "none" },
    "real_in_place_adoption_count": { "const": 0 },
    "seam_introspection": {
      "type": "object",
      "required": ["engine", "dispatch_seam", "coordinator_binding_seam"],
      "properties": {
        "engine": { "type": "object" },
        "dispatch_seam": { "type": "object" },
        "coordinator_binding_seam": { "type": "object" }
      }
    },
    "touchpoints": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "touchpoint_id",
          "track",
          "seam_module",
          "seam_entrypoint",
          "consumes",
          "live_target_candidates",
          "adoption_kind",
          "in_place_edit_required",
          "touches_frozen_anchor",
          "touches_callback_collector",
          "risk_tier",
          "rationale"
        ],
        "properties": {
          "touchpoint_id": { "type": "string", "minLength": 1 },
          "track": { "type": "string" },
          "seam_module": { "type": "string" },
          "seam_entrypoint": { "type": "string" },
          "consumes": { "type": "string" },
          "live_target_candidates": {
            "type": "array",
            "items": { "type": "string" }
          },
          "adoption_kind": { "type": "string" },
          "in_place_edit_required": { "type": "boolean" },
          "touches_frozen_anchor": { "type": "boolean" },
          "touches_callback_collector": { "type": "boolean" },
          "risk_tier": { "enum": ["LOW", "MED", "HIGH"] },
          "rationale": { "type": "string" }
        }
      }
    },
    "expected_files_allowlist": {
      "type": "array",
      "minItems": 1,
      "items": { "type": "string" }
    },
    "conflict": {
      "type": "object",
      "required": [
        "frozen_anchor_conflicts",
        "callback_collector_conflicts",
        "frozen_anchors",
        "callback_collector_paths",
        "conflict_count"
      ],
      "properties": {
        "frozen_anchor_conflicts": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["touchpoint_id", "candidate", "reason"],
            "properties": {
              "touchpoint_id": { "type": "string", "minLength": 1 },
              "candidate": { "type": "string", "minLength": 1 },
              "reason": { "type": "string", "minLength": 1 },
              "required_mitigation": { "type": "string" }
            }
          }
        },
        "callback_collector_conflicts": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["touchpoint_id", "candidate", "reason"],
            "properties": {
              "touchpoint_id": { "type": "string", "minLength": 1 },
              "candidate": { "type": "string", "minLength": 1 },
              "reason": { "type": "string", "minLength": 1 },
              "required_mitigation": { "type": "string" }
            }
          }
        },
        "frozen_anchors": { "type": "array", "items": { "type": "string" } },
        "callback_collector_paths": { "type": "array", "items": { "type": "string" } },
        "conflict_count": { "type": "integer", "minimum": 0 }
      }
    },
    "risk": {
      "type": "object",
      "required": ["overall_tier", "per_touchpoint", "tiers"],
      "properties": {
        "overall_tier": { "enum": ["LOW", "MED", "HIGH"] },
        "per_touchpoint": { "type": "object" },
        "tiers": {
          "type": "array",
          "items": { "enum": ["LOW", "MED", "HIGH"] }
        }
      }
    },
    "byte0_anchors": {
      "type": "array",
      "minItems": 1,
      "items": { "type": "string" }
    },
    "callback_collector_untouched": { "const": true },
    "auto_confirm_invariant": { "type": "string" },
    "real_adoption_gate": { "type": "string" }
  },
  "definitions": {
    "dry_run": {
      "$id": "anu_v3.profile_adoption_planner.dry_run.v1",
      "type": "object",
      "additionalProperties": true,
      "required": [
        "dry_run_schema",
        "mode",
        "applied_count",
        "writes",
        "merges",
        "cron_ops",
        "pr_ops",
        "callback_collector_touched",
        "frozen_anchor_touched",
        "simulated_diffs",
        "blocked_frozen_routes",
        "blocked_callback_routes",
        "rollback_points",
        "side_effect"
      ],
      "properties": {
        "dry_run_schema": { "const": "anu_v3.profile_adoption_planner.dry_run.v1" },
        "mode": { "const": "READ_ONLY_SIMULATION" },
        "applied_count": { "const": 0 },
        "writes": { "const": 0 },
        "merges": { "const": 0 },
        "cron_ops": { "const": 0 },
        "pr_ops": { "const": 0 },
        "callback_collector_touched": { "const": false },
        "frozen_anchor_touched": { "const": false },
        "simulated_diffs": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["touchpoint_id", "change", "applied"],
            "properties": {
              "touchpoint_id": { "type": "string", "minLength": 1 },
              "change": { "type": "string", "minLength": 1 },
              "expected_hunk": { "type": "string" },
              "applied": { "const": false }
            }
          }
        },
        "blocked_frozen_routes": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["touchpoint_id", "candidate", "decision"],
            "properties": {
              "touchpoint_id": { "type": "string", "minLength": 1 },
              "candidate": { "type": "string", "minLength": 1 },
              "decision": { "type": "string", "minLength": 1 }
            }
          }
        },
        "blocked_callback_routes": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["touchpoint_id", "candidate", "decision"],
            "properties": {
              "touchpoint_id": { "type": "string", "minLength": 1 },
              "candidate": { "type": "string", "minLength": 1 },
              "decision": { "type": "string", "minLength": 1 }
            }
          }
        },
        "rollback_points": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["touchpoint_id", "rollback"],
            "properties": {
              "touchpoint_id": { "type": "string", "minLength": 1 },
              "rollback": { "type": "string", "minLength": 1 }
            }
          }
        },
        "side_effect": { "type": "string" }
      }
    }
  }
}
