{
  "schema_version": "1.0",
  "baseline": "A-admin-control-plane-batch-4-readiness",
  "phase": "2b → 2c readiness",
  "updated_at": "2026-04-19",
  "owner": "session_a",
  "purpose_th": "ขยายตัวอย่าง approval_store จาก approval_examples.json · ครอบคลุมเคสที่ต้องใช้เวลา migrate จริง · รวม signature rows แยก · audit cross-reference · backing_store transitions",
  "purpose_en": "Extended approval store examples that complement approval_examples.json. Each example shows the full target-schema row shape (admin.approval + admin.signature + admin.audit references) that Phase 2c migration will produce. Use these as golden fixtures for parity testing.",
  "honest_note": "These are fixtures, not live data. admin.* tables do not exist yet. Every backing_store_transition marked 'target' reflects the 2c goal state, not today's reality.",
  "pairs_with_source": "docs/runtime/admin-control-plane-service/approval_examples.json",
  "examples": [
    {
      "id": "ASE-01",
      "description_en": "Single-signer valid approval · flag.wizard.interactive_draft precheck · consumed by FF sensitive.check.2b",
      "admin_approval": {
        "approval_id": "APP-100001-abcd",
        "matrix_row": "row-wizard-interactive-review-1",
        "target_type": "feature_flag",
        "target_id": "ff.wizard.interactive_draft",
        "requested_by": "U-wizard-pm",
        "requested_at": "2026-04-18T09:00:00Z",
        "state": "signed_full",
        "required_signer_count": 1,
        "signer_roles": ["product_owner"],
        "sla_deadline": "2026-04-25T09:00:00Z",
        "closed_at": null,
        "closed_by": null,
        "reason": "Enable wizard interactive draft for pilot tenant",
        "context": { "tenant_id": "T-pty-pilot-01" }
      },
      "admin_signatures": [
        {
          "signature_id": "SIG-100001-01",
          "approval_id": "APP-100001-abcd",
          "signer_id": "U-po-1",
          "signer_role": "product_owner",
          "signed_at": "2026-04-18T09:35:00Z",
          "kind": "approve",
          "comment": "Pilot scope · limited to T-pty-pilot-01",
          "evidence": { "slack_thread": "<link-omitted>" }
        }
      ],
      "ff_consumption": {
        "endpoint": "POST /api/policy/sensitive.check.2b",
        "expected_ttl_state": "valid",
        "expected_ff_response": { "enabled": true, "meta": { "approval_ref": "APP-100001-abcd", "ttl_state": "valid" } }
      }
    },
    {
      "id": "ASE-02",
      "description_en": "Dual-signer approval · flag.sensitive_preview · finance + legal · both signed · signed_full",
      "admin_approval": {
        "approval_id": "APP-100002-dual",
        "matrix_row": "row-sensitive-preview",
        "target_type": "feature_flag",
        "target_id": "ff.sensitive_preview",
        "requested_by": "U-platform-lead",
        "requested_at": "2026-04-17T14:00:00Z",
        "state": "signed_full",
        "required_signer_count": 2,
        "signer_roles": ["finance_gate", "legal_gate"],
        "sla_deadline": "2026-04-24T14:00:00Z",
        "closed_at": null,
        "closed_by": null,
        "reason": "Enable preview of sensitive flag in staging for compliance demo",
        "context": { "tenant_id": "T-pty-pilot-01", "environment": "staging" }
      },
      "admin_signatures": [
        {
          "signature_id": "SIG-100002-01",
          "approval_id": "APP-100002-dual",
          "signer_id": "U-finance-1",
          "signer_role": "finance_gate",
          "signed_at": "2026-04-17T16:20:00Z",
          "kind": "approve",
          "comment": "Ledger impact reviewed",
          "evidence": null
        },
        {
          "signature_id": "SIG-100002-02",
          "approval_id": "APP-100002-dual",
          "signer_id": "U-legal-1",
          "signer_role": "legal_gate",
          "signed_at": "2026-04-17T17:05:00Z",
          "kind": "approve",
          "comment": "PDPA scope reviewed · no sensitive PII in preview",
          "evidence": { "legal_memo_id": "LM-2026-0418-001" }
        }
      ],
      "ff_consumption": {
        "endpoint": "POST /api/policy/sensitive.check.2b",
        "expected_ttl_state": "valid",
        "expected_ff_response": { "enabled": true, "meta": { "approval_ref": "APP-100002-dual", "ttl_state": "valid" } }
      }
    },
    {
      "id": "ASE-03",
      "description_en": "Dual-signer signed_partial · only one of two signed · FF must deny",
      "admin_approval": {
        "approval_id": "APP-100003-partial",
        "matrix_row": "row-sensitive-preview",
        "target_type": "feature_flag",
        "target_id": "ff.sensitive_preview",
        "requested_by": "U-platform-lead",
        "requested_at": "2026-04-18T10:00:00Z",
        "state": "signed_partial",
        "required_signer_count": 2,
        "signer_roles": ["finance_gate", "legal_gate"],
        "sla_deadline": "2026-04-25T10:00:00Z",
        "closed_at": null,
        "closed_by": null
      },
      "admin_signatures": [
        {
          "signature_id": "SIG-100003-01",
          "approval_id": "APP-100003-partial",
          "signer_id": "U-finance-2",
          "signer_role": "finance_gate",
          "signed_at": "2026-04-18T12:00:00Z",
          "kind": "approve"
        }
      ],
      "ff_consumption": {
        "endpoint": "POST /api/policy/sensitive.check.2b",
        "expected_ttl_state": "valid",
        "expected_ff_response": { "enabled": false, "reason": "dual_signers_required" }
      }
    },
    {
      "id": "ASE-04",
      "description_en": "Expired approval · past sla_deadline by 3 days",
      "admin_approval": {
        "approval_id": "APP-100004-expired",
        "matrix_row": "row-sensitive-preview",
        "target_type": "feature_flag",
        "target_id": "ff.sensitive_preview",
        "requested_by": "U-platform-lead",
        "requested_at": "2026-04-10T10:00:00Z",
        "state": "signed_full",
        "required_signer_count": 1,
        "signer_roles": ["product_owner"],
        "sla_deadline": "2026-04-16T10:00:00Z",
        "closed_at": null,
        "closed_by": null
      },
      "admin_signatures": [
        {
          "signature_id": "SIG-100004-01",
          "approval_id": "APP-100004-expired",
          "signer_id": "U-po-1",
          "signer_role": "product_owner",
          "signed_at": "2026-04-10T11:00:00Z",
          "kind": "approve"
        }
      ],
      "ff_consumption": {
        "endpoint": "POST /api/policy/sensitive.check.2b",
        "expected_ttl_state": "expired",
        "expected_ff_response": { "enabled": false, "reason": "approval_expired", "meta": { "ttl_state": "expired" } }
      }
    },
    {
      "id": "ASE-05",
      "description_en": "Withdrawn approval · closed_at set · state=withdrawn · TTL not-applicable",
      "admin_approval": {
        "approval_id": "APP-100005-withdrawn",
        "matrix_row": "row-sensitive-preview",
        "target_type": "feature_flag",
        "target_id": "ff.sensitive_preview",
        "requested_by": "U-platform-lead",
        "requested_at": "2026-04-15T09:00:00Z",
        "state": "withdrawn",
        "required_signer_count": 1,
        "signer_roles": ["product_owner"],
        "sla_deadline": "2026-04-22T09:00:00Z",
        "closed_at": "2026-04-16T08:00:00Z",
        "closed_by": "U-platform-lead",
        "reason": "Requester retracted · scope change"
      },
      "admin_signatures": [],
      "ff_consumption": {
        "endpoint": "POST /api/policy/sensitive.check.2b",
        "expected_ttl_state": "not-applicable",
        "expected_ff_response": { "enabled": false, "reason": "approval_withdrawn" }
      }
    },
    {
      "id": "ASE-06",
      "description_en": "Stale approval · way past deadline · more than 24h · should raise operator alert",
      "admin_approval": {
        "approval_id": "APP-100006-stale",
        "matrix_row": "row-sensitive-preview",
        "target_type": "feature_flag",
        "target_id": "ff.sensitive_preview",
        "requested_by": "U-platform-lead",
        "requested_at": "2026-03-20T09:00:00Z",
        "state": "signed_full",
        "required_signer_count": 1,
        "signer_roles": ["product_owner"],
        "sla_deadline": "2026-03-27T09:00:00Z",
        "closed_at": null,
        "closed_by": null
      },
      "admin_signatures": [
        {
          "signature_id": "SIG-100006-01",
          "approval_id": "APP-100006-stale",
          "signer_id": "U-po-1",
          "signer_role": "product_owner",
          "signed_at": "2026-03-20T11:00:00Z",
          "kind": "approve"
        }
      ],
      "ff_consumption": {
        "endpoint": "POST /api/policy/sensitive.check.2b",
        "expected_ttl_state": "stale",
        "expected_ff_response": { "enabled": false, "reason": "approval_expired", "meta": { "ttl_state": "stale", "operator_alert": true } }
      }
    }
  ],
  "backing_store_transitions": [
    { "phase": "2b", "backing_state": "file-backed", "source": "approval_examples.json" },
    { "phase": "2b+", "backing_state": "file-backed", "source": "approval_examples.json + ttl_examples.json (derived)" },
    { "phase": "2c target", "backing_state": "db-backed", "source": "admin.approval + admin.signature + admin.approval_ttl_state view" },
    { "phase": "2c dual-write window", "backing_state": "dual_write_parity", "source": "writes to file AND db · reads from file · harness compares" },
    { "phase": "2c post-cutover", "backing_state": "db_authoritative", "source": "reads from db · file kept as rollback snapshot for 14 days" }
  ],
  "operator_notes": [
    "Use ASE-01 for smoke: simplest single-signer case · both paths must return valid",
    "Use ASE-02 + ASE-03 pair to verify dual-signer arithmetic",
    "Use ASE-04 + ASE-06 to verify ttl_state derivation logic vs ttl_examples.json",
    "ASE-05 verifies that withdrawn never re-activates · even if signatures still exist"
  ],
  "pair_with": {
    "approval_examples": "docs/runtime/admin-control-plane-service/approval_examples.json",
    "approval_store_schema": "docs/runtime/admin-control-plane-service/approval_store_schema.json",
    "ttl_examples": "docs/runtime/admin-control-plane-service/ttl_examples.json",
    "persistence_schema": "docs/runtime/admin-control-plane-service/persistence_schema.json",
    "cutover_readiness_notes": "docs/runtime/admin-control-plane-service/cutover_readiness_notes.json"
  }
}
