{
  "schema_version": "1.0",
  "baseline": "A-document-access-service-v1",
  "phase": "Batch 8 · local/dev auth",
  "updated_at": "2026-04-20",
  "owner": "session_a",
  "purpose_en": "Golden examples of access resolution outcomes. Given an email and a doc_id, the server should produce exactly this shape. Consumed by the debug/service page and a future parity harness.",
  "purpose_th": "ตัวอย่าง outcome ของ resolution · ใช้ใน debug page และ parity ในอนาคต",
  "examples": [
    {
      "id": "ADX-01",
      "note": "Admin · any doc · visible",
      "input":  { "email": "admin@pattayatogether.example", "doc_id": "/planning/feature-flags-batch-4-readiness.html" },
      "expected": {
        "state": "visible", "allow_read": true, "allow_share": true, "allow_export": true,
        "group_id": "planning"
      }
    },
    {
      "id": "ADX-02",
      "note": "Governance · runtime doc · hidden-group",
      "input":  { "email": "governance@pattayatogether.example", "doc_id": "/runtime/feature-flags-service/phase-2b-plus.html" },
      "expected": {
        "state": "hidden-group", "allow_read": false, "allow_share": false, "allow_export": false,
        "group_id": "runtime",
        "banner_en": "This document's group is not visible under your current access profile."
      }
    },
    {
      "id": "ADX-03",
      "note": "Sales · planning doc · hidden-group",
      "input":  { "email": "sales@pattayatogether.example", "doc_id": "/planning/admin-control-plane-batch-4-readiness.html" },
      "expected": {
        "state": "hidden-group", "allow_read": false, "allow_share": false, "allow_export": false,
        "group_id": "planning"
      }
    },
    {
      "id": "ADX-04",
      "note": "External partner · restricted planning doc · restricted",
      "input":  { "email": "partner@external.example", "doc_id": "/planning/feature-flags-batch-4-readiness.html" },
      "expected": {
        "state": "hidden-group", "allow_read": false, "allow_share": false, "allow_export": false,
        "group_id": "planning",
        "note": "Group rule fires first (planning not in visible_groups). Restricted list would fire only if the group were allowed."
      }
    },
    {
      "id": "ADX-05",
      "note": "External partner · knowledge doc · visible",
      "input":  { "email": "partner@external.example", "doc_id": "/kb/phase-overview-1a-12f.html" },
      "expected": {
        "state": "visible", "allow_read": true, "allow_share": true, "allow_export": true,
        "group_id": "knowledge"
      }
    },
    {
      "id": "ADX-06",
      "note": "External · denied profile · explicit not-granted on access model page",
      "input":  { "email": "denied@external.example", "doc_id": "/planning/document-access-model.html" },
      "expected": {
        "state": "hidden-group", "allow_read": false,
        "group_id": "planning",
        "note": "Knowledge + planning are hidden at the group level for this profile so group rule fires before doc-level deny."
      }
    },
    {
      "id": "ADX-07",
      "note": "Anonymous · journey hub · visible",
      "input":  { "email": null, "doc_id": "/journey-console.html" },
      "expected": {
        "state": "visible", "allow_read": true,
        "group_id": "start",
        "profile_email": "(anonymous)"
      }
    },
    {
      "id": "ADX-08",
      "note": "Anonymous · admin planning · hidden-group",
      "input":  { "email": null, "doc_id": "/planning/admin-control-plane-phase-2b.html" },
      "expected": {
        "state": "hidden-group", "allow_read": false,
        "group_id": "planning"
      }
    },
    {
      "id": "ADX-09",
      "note": "Developer · runtime doc · visible",
      "input":  { "email": "dev@pattayatogether.example", "doc_id": "/runtime/feature-flags-service/phase-2b.html" },
      "expected": {
        "state": "visible", "allow_read": true,
        "group_id": "runtime"
      }
    },
    {
      "id": "ADX-10",
      "note": "Unknown group · journey tourist demo (not in map) · visible by default",
      "input":  { "email": "admin@pattayatogether.example", "doc_id": "/some/unlisted/page.html" },
      "expected": {
        "state": "visible", "allow_read": true,
        "group_id": null,
        "note": "When doc_id is not in the group→doc map, the group filter is skipped; only explicit hidden_documents/restricted_documents apply."
      }
    }
  ],
  "cross_references": {
    "access_contract": "docs/runtime/document-access-service/access_contract.json",
    "user_store":      "docs/runtime/document-access-service/user_store_examples.json",
    "visibility_matrix":"docs/assets/access/document_visibility_matrix.json"
  }
}
