{
  "schema_version": "1.0",
  "baseline": "A-runtime-phase-1",
  "updated_at": "2026-04-18",
  "owner": "session_a",
  "honest_note": "Runtime Phase 1 — Registry metadata is LIVE (real schema, real entries, validated against schema.json). Evaluator/rollout runtime is NOT bound — no request traffic reads this registry yet. No flag is actually controlling production behaviour. Every flag starts at rollout_stage=draft + default_value=false (where applicable) + binding_status=mapped-not-bound unless otherwise noted.",
  "contract_refs": [
    "docs/kb/data/tenant_scope.json#feature_flag_handoff",
    "docs/kb/data/publish_workflow.json#stages",
    "docs/kb/data/approval_matrix.json#matrix_rows",
    "docs/kb/data/session_a_handoff.json#hand-feature-flags"
  ],
  "flags": [
    {
      "id": "ff-flags-registry-v1",
      "key": "flags.registry_v1",
      "description_th": "เปิดใช้ registry ของระบบ feature flag เอง · self-referential · ต้องเปิดก่อน flag อื่น",
      "description_en": "Enable the feature flag registry itself · self-referential · must be on before any other flag resolves",
      "owner_module": "flags",
      "default_value": true,
      "type": "boolean",
      "allowed_scopes": ["global"],
      "rollout_stage": "internal",
      "rollout_pct": 100,
      "requires_approval": false,
      "sensitive_flag": false,
      "approval_matrix_row": null,
      "dependencies": [],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": "2026-04-18",
        "last_approval_ref": null,
        "last_flipped_by": "session_a_phase1"
      },
      "planning_ref": "docs/planning/feature-flags.html",
      "contract_ref": null,
      "binding_status": "live",
      "honest_note": "Bootstrap flag · registry exists; evaluator not yet reading at request time."
    },

    {
      "id": "ff-dashboard-runtime-v1",
      "key": "dashboard.runtime_v1",
      "description_th": "เปิด Dashboard runtime (query pipeline + chart renderer + preset storage)",
      "description_en": "Enable Dashboard runtime (query pipeline + chart renderer + preset storage)",
      "owner_module": "dashboard",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["global", "tenant", "user"],
      "rollout_stage": "draft",
      "requires_approval": true,
      "sensitive_flag": false,
      "approval_matrix_row": "row-tenant-canonical-promote",
      "dependencies": [
        { "requires_flag": "signal_pipeline.producers_v1", "requires_value": true, "rationale": "Dashboards require metrics in TimescaleDB" },
        { "requires_flag": "signal_pipeline.consumers_v1", "requires_value": true, "rationale": "Gold mart populated" }
      ],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/dashboard-runtime.html",
      "contract_ref": "docs/kb/data/dashboard_contract.json",
      "binding_status": "mapped-not-bound",
      "honest_note": "Flag declared · no runtime consumer yet · dashboard pages are shell only."
    },

    {
      "id": "ff-cases-runtime-v1",
      "key": "cases.runtime_v1",
      "description_th": "เปิด Cases runtime (07:00 queue · 12-stage AI · alerting · SLA)",
      "description_en": "Enable Cases runtime (07:00 queue · 12-stage AI · alerting · SLA)",
      "owner_module": "cases",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["global", "tenant"],
      "rollout_stage": "draft",
      "requires_approval": true,
      "sensitive_flag": false,
      "approval_matrix_row": "row-tenant-canonical-promote",
      "dependencies": [
        { "requires_flag": "signal_pipeline.producers_v1", "requires_value": true },
        { "requires_flag": "admin.control_plane_v1", "requires_value": true, "rationale": "Sign-off capture needed" }
      ],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/cases-runtime.html",
      "contract_ref": "docs/kb/data/case_portal.json",
      "binding_status": "mapped-not-bound",
      "honest_note": "Flag declared · no cron · no AI pipeline · no queue runtime."
    },

    {
      "id": "ff-generate-runtime-v1",
      "key": "generate.runtime_v1",
      "description_th": "เปิด Generate runtime (review queue + sign-off + promotion T5→T4/T3/T2)",
      "description_en": "Enable Generate runtime (review queue + sign-off + promotion T5→T4/T3/T2)",
      "owner_module": "generate",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["global"],
      "rollout_stage": "draft",
      "requires_approval": true,
      "sensitive_flag": false,
      "approval_matrix_row": "row-tenant-canonical-promote",
      "dependencies": [
        { "requires_flag": "admin.control_plane_v1", "requires_value": true }
      ],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/generate-runtime.html",
      "contract_ref": "docs/kb/data/generated_assets.json",
      "binding_status": "mapped-not-bound",
      "honest_note": "Flag declared · no promotion API · registry is read-only mirror."
    },

    {
      "id": "ff-tenant-runtime-v1",
      "key": "tenant.runtime_v1",
      "description_th": "เปิด Tenant runtime (enterprise upload + hybrid intake + tenant registry)",
      "description_en": "Enable Tenant runtime (enterprise upload + hybrid intake + tenant registry)",
      "owner_module": "tenant",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["global"],
      "rollout_stage": "draft",
      "requires_approval": true,
      "sensitive_flag": true,
      "approval_matrix_row": "row-tenant-instantiate-nerve",
      "dependencies": [
        { "requires_flag": "admin.control_plane_v1", "requires_value": true },
        { "requires_flag": "platform.multi_source_intake_engine", "requires_value": true }
      ],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/tenant-runtime.html",
      "contract_ref": "docs/kb/data/tenant_scope.json",
      "binding_status": "placeholder",
      "honest_note": "Sensitive flag · founder sign-off required for first pilot tenant · not flippable without approval."
    },

    {
      "id": "ff-wizard-runtime-v1",
      "key": "wizard.runtime_v1",
      "description_th": "เปิด Premium Wizard runtime (8 steps · AI suggestion · output bundle)",
      "description_en": "Enable Premium Wizard runtime (8 steps · AI suggestion · output bundle)",
      "owner_module": "wizard",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["global", "user"],
      "rollout_stage": "draft",
      "requires_approval": true,
      "sensitive_flag": false,
      "approval_matrix_row": "row-wizard-bundle-finalize",
      "dependencies": [
        { "requires_flag": "admin.control_plane_v1", "requires_value": true },
        { "requires_flag": "dashboard.runtime_v1", "requires_value": true, "rationale": "Output bundle writes personal Dashboard preset" }
      ],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/wizard-runtime.html",
      "contract_ref": "docs/kb/data/premium_wizard.json",
      "binding_status": "mapped-not-bound",
      "honest_note": "Premium-only · output = personal KB view bundle · not tenant · AI suggestions require RAGAS ≥0.70."
    },

    {
      "id": "ff-admin-control-plane-v1",
      "key": "admin.control_plane_v1",
      "description_th": "เปิด Admin Control Plane (approvals · sign-off · audit · alerting)",
      "description_en": "Enable Admin Control Plane (approvals · sign-off · audit · alerting)",
      "owner_module": "admin",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["global"],
      "rollout_stage": "draft",
      "requires_approval": true,
      "sensitive_flag": true,
      "approval_matrix_row": "row-marketplace-go-live",
      "dependencies": [],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/admin-control-plane.html",
      "contract_ref": "docs/kb/data/approval_matrix.json",
      "binding_status": "placeholder",
      "honest_note": "Foundational — multiple runtimes depend on it · cannot bypass."
    },

    {
      "id": "ff-hints-registry-v1",
      "key": "hints.registry_v1",
      "description_th": "เปิด object-level Hint System (content sourced from B JSON)",
      "description_en": "Enable object-level Hint System (content sourced from B JSON)",
      "owner_module": "hints",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["global"],
      "rollout_stage": "draft",
      "requires_approval": false,
      "sensitive_flag": false,
      "approval_matrix_row": null,
      "dependencies": [],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/hint-system.html",
      "contract_ref": "docs/kb/data/page_purpose.json",
      "binding_status": "mapped-not-bound",
      "honest_note": "Content comes from B JSON · A never hand-types hint copy."
    },

    {
      "id": "ff-signal-pipeline-producers-v1",
      "key": "signal_pipeline.producers_v1",
      "description_th": "เปิด producer 12 services ที่ publish เข้า 19 Kafka topics (PII hash + GPS fuzz enforced)",
      "description_en": "Enable 12 producer services publishing to 19 Kafka topics (PII hash + GPS fuzz enforced at emit)",
      "owner_module": "signal_pipeline",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["global"],
      "rollout_stage": "draft",
      "requires_approval": true,
      "sensitive_flag": true,
      "approval_matrix_row": "row-marketplace-go-live",
      "dependencies": [],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/signal-pipeline.html",
      "contract_ref": null,
      "binding_status": "placeholder",
      "honest_note": "Infra gate · sensitive due to PDPA · requires CI pentest on hash/fuzz before flip."
    },

    {
      "id": "ff-signal-pipeline-consumers-v1",
      "key": "signal_pipeline.consumers_v1",
      "description_th": "เปิด consumer groups (lake ingester · alerting · kpi-snapshot · rag-embed · case-ai)",
      "description_en": "Enable consumer groups (lake ingester · alerting · kpi-snapshot · rag-embed · case-ai)",
      "owner_module": "signal_pipeline",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["global"],
      "rollout_stage": "draft",
      "requires_approval": true,
      "sensitive_flag": false,
      "approval_matrix_row": null,
      "dependencies": [
        { "requires_flag": "signal_pipeline.producers_v1", "requires_value": true }
      ],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/signal-pipeline.html",
      "contract_ref": null,
      "binding_status": "placeholder",
      "honest_note": "Requires producers on + k-anon ≥5 filter verified."
    },

    {
      "id": "ff-platform-multi-source-intake",
      "key": "platform.multi_source_intake_engine",
      "description_th": "เปิด multi-source intake engine (ingest · normalise · conflict · coverage)",
      "description_en": "Enable multi-source intake engine (ingest · normalise · conflict · coverage)",
      "owner_module": "tenant",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["global"],
      "rollout_stage": "draft",
      "requires_approval": true,
      "sensitive_flag": false,
      "approval_matrix_row": "row-enterprise-intake-unit-accept",
      "dependencies": [],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/tenant-runtime.html",
      "contract_ref": "docs/kb/data/tenant_scope.json#feature_flag_handoff",
      "binding_status": "mapped-not-bound",
      "honest_note": "Named explicitly in tenant_scope.feature_flag_handoff.flags_needed."
    },

    {
      "id": "ff-platform-marketplace-listing",
      "key": "platform.marketplace_listing_enabled",
      "description_th": "เปิด marketplace listing (read-only catalog · no payments in this phase)",
      "description_en": "Enable marketplace listing (read-only catalog · no payments in this phase)",
      "owner_module": "tenant",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["global", "marketplace-candidate", "marketplace-ready"],
      "rollout_stage": "draft",
      "requires_approval": true,
      "sensitive_flag": true,
      "approval_matrix_row": "row-marketplace-go-live",
      "dependencies": [
        { "requires_flag": "tenant.runtime_v1", "requires_value": true }
      ],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/tenant-runtime.html",
      "contract_ref": "docs/kb/data/tenant_scope.json#feature_flag_handoff",
      "binding_status": "placeholder",
      "honest_note": "Named in tenant_scope.feature_flag_handoff · payment + contract brokering explicitly out of platform scope."
    },

    {
      "id": "ff-tenant-wizard-enabled-template",
      "key": "tenant.<tenant_id>.wizard_enabled",
      "description_th": "Template · เปิด wizard ให้ tenant ใดตัวเดียว (ต้อง substitute <tenant_id> จริง)",
      "description_en": "Template · enable wizard for one tenant (substitute <tenant_id> at flip time)",
      "owner_module": "tenant",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["tenant"],
      "rollout_stage": "draft",
      "requires_approval": true,
      "sensitive_flag": false,
      "approval_matrix_row": "row-tenant-canonical-promote",
      "dependencies": [
        { "requires_flag": "wizard.runtime_v1", "requires_value": true }
      ],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/wizard-runtime.html",
      "contract_ref": "docs/kb/data/tenant_scope.json#feature_flag_handoff",
      "binding_status": "placeholder",
      "honest_note": "Template key · concrete tenant keys spawn from this at tenant onboarding."
    },

    {
      "id": "ff-tenant-enterprise-upload-template",
      "key": "tenant.<tenant_id>.enterprise_upload_enabled",
      "description_th": "Template · เปิด enterprise upload ให้ tenant ใดตัวเดียว",
      "description_en": "Template · enable enterprise upload for one tenant",
      "owner_module": "tenant",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["tenant"],
      "rollout_stage": "draft",
      "requires_approval": true,
      "sensitive_flag": true,
      "approval_matrix_row": "row-enterprise-intake-unit-accept",
      "dependencies": [
        { "requires_flag": "tenant.runtime_v1", "requires_value": true },
        { "requires_flag": "platform.multi_source_intake_engine", "requires_value": true }
      ],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/tenant-runtime.html",
      "contract_ref": "docs/kb/data/tenant_scope.json#feature_flag_handoff",
      "binding_status": "placeholder",
      "honest_note": "Template key · sensitive due to data-handling agreement requirement."
    },

    {
      "id": "ff-tenant-marketplace-contributor-template",
      "key": "tenant.<tenant_id>.marketplace_contributor",
      "description_th": "Template · tenant สามารถเสนอสินทรัพย์ขึ้น marketplace",
      "description_en": "Template · tenant may contribute assets to marketplace",
      "owner_module": "tenant",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["tenant", "marketplace-candidate"],
      "rollout_stage": "draft",
      "requires_approval": true,
      "sensitive_flag": true,
      "approval_matrix_row": "row-marketplace-propose",
      "dependencies": [
        { "requires_flag": "platform.marketplace_listing_enabled", "requires_value": true }
      ],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/tenant-runtime.html",
      "contract_ref": "docs/kb/data/tenant_scope.json#feature_flag_handoff",
      "binding_status": "placeholder",
      "honest_note": "Template key · contributor status requires platform-governance review."
    },

    {
      "id": "ff-tenant-nerve-instance-live-template",
      "key": "tenant.<tenant_id>.nerve_instance_live",
      "description_th": "Template · tenant Nerve instance ทำงานจริง (K8s + DB schema up)",
      "description_en": "Template · tenant Nerve instance is live (K8s + DB schema up)",
      "owner_module": "tenant",
      "default_value": false,
      "type": "boolean",
      "allowed_scopes": ["tenant"],
      "rollout_stage": "draft",
      "requires_approval": true,
      "sensitive_flag": true,
      "approval_matrix_row": "row-tenant-instantiate-nerve",
      "dependencies": [
        { "requires_flag": "tenant.runtime_v1", "requires_value": true }
      ],
      "audit": {
        "created_at": "2026-04-18",
        "created_by": "session_a_phase1",
        "last_flipped_at": null,
        "last_approval_ref": null,
        "last_flipped_by": null
      },
      "planning_ref": "docs/planning/tenant-runtime.html",
      "contract_ref": "docs/kb/data/tenant_scope.json#feature_flag_handoff",
      "binding_status": "placeholder",
      "honest_note": "Founder sign-off required for first pilot tenant (non-delegatable per handoff.what_must_not_be_reinterpreted)."
    }
  ]
}
