{
  "map_id": "or.phases",
  "version": "4.0-draft",
  "book": "book4_opacity_revelation",
  "series": "AI Edition",
  "description": "Defines the six phases of the Book 4 opacity-revelation evaluation cycle. Each phase has strict entry/exit conditions, active operators, and skip conditions.",
  "phase_sequence": "init → measure → threshold → probe → reveal → catalogue",
  "phases": [
    {
      "id": "P-OR-1",
      "label": "init",
      "ordinal": 1,
      "description": "Load Book 1 (FFT) kernel and Book 3 (SD) detection domain. Assert session context. Confirm QMROOT path terminates at 0D. Verify coherence=declared. No OR operators are active in this phase.",
      "operators_active": [],
      "entry_condition": "Session open; kernel import requested",
      "exit_condition": "coherence=declared; Book 3 SD operators available; QMROOT 0D confirmed",
      "import_order": ["book1_fft (kernel)", "book3_structural_detection (detection domain)"],
      "qmroot_check": "6D absent; negative rungs absent; INV-013 = 0D only",
      "skip_condition": null
    },
    {
      "id": "P-OR-2",
      "label": "measure",
      "ordinal": 2,
      "description": "Assign the opacity gradient ω to the target structure via OR-Ω. Declare the observer detection capacity δ via OR-Δ (using SD-Σd as substrate). Both ω and δ must be recorded before the threshold phase begins.",
      "operators_active": ["OR-Ω", "OR-Δ"],
      "entry_condition": "init complete; coherence=declared",
      "exit_condition": "ω(S) recorded; δ(O) recorded",
      "ordering_constraint": "OR-Ω and OR-Δ may run in either order within this phase, but both must complete before P-OR-3.",
      "drift_guard": "ω must not be assigned using observer attributes. δ must be grounded in SD-Σd output.",
      "skip_condition": null
    },
    {
      "id": "P-OR-3",
      "label": "threshold",
      "ordinal": 3,
      "description": "Execute RevelationCheck (OR-Ρ). Compare δ(O) against ω(S). Assign revelation_state ∈ {opaque, threshold, revealed}. If revealed: skip probe phase, proceed to reveal. If opaque or threshold: proceed to probe.",
      "operators_active": ["OR-Ρ"],
      "entry_condition": "ω(S) and δ(O) both recorded from P-OR-2",
      "exit_condition": "revelation_state assigned and recorded",
      "gate_logic": {
        "δ > ω": "revelation_state = revealed → jump to P-OR-5 (reveal)",
        "δ = ω": "revelation_state = threshold → record event → treat as opaque → proceed to P-OR-4",
        "δ < ω": "revelation_state = opaque → proceed to P-OR-4"
      },
      "skip_condition": null
    },
    {
      "id": "P-OR-4",
      "label": "probe",
      "ordinal": 4,
      "description": "Execute LatentProbe (OR-Λ). Enumerate sub(S). Evaluate each s_i against δ. Classify S_latent and S_access. Detect structural shadows within S_access. Record latent_set and shadow_set.",
      "operators_active": ["OR-Λ"],
      "entry_condition": "revelation_state ∈ {opaque, threshold}; sub(S) available",
      "exit_condition": "S_latent, S_access, and shadow_set recorded",
      "sub_structure_requirement": "All s_i must have ω(s_i) assigned before OR-Λ executes.",
      "shadow_handling": "Structural shadows are recorded in shadow_set. They are passed to OR-Π but do not constitute revelation.",
      "skip_condition": "Skip when revelation_state = revealed (all sub-structures fully revealed — S_latent = ∅)"
    },
    {
      "id": "P-OR-5",
      "label": "reveal",
      "ordinal": 5,
      "description": "Execute PartialIndex (OR-Π). For each s_i ∈ sub(S), assign state_i ∈ {revealed, opaque, shadow}. Construct revelation_map: { s_i → state_i }. Identify partial revelation if 0 < |S_access| < |sub(S)|.",
      "operators_active": ["OR-Π"],
      "entry_condition": "S_latent, S_access, shadow_set available from P-OR-4 (or revelation_state = revealed from P-OR-3)",
      "exit_condition": "revelation_map complete; partial revelation flag set if applicable",
      "partial_revelation_flag": "Set to true when |S_access| > 0 and |S_latent| > 0",
      "shadow_in_map": "Sub-structures in shadow_set that are not in S_access are mapped to state = shadow",
      "skip_condition": "Skip revelation_map construction for atomic structures with no sub(S)"
    },
    {
      "id": "P-OR-6",
      "label": "catalogue",
      "ordinal": 6,
      "description": "Record the final revelation_map, ω(S), δ(O), revelation_state, and partial_revelation_flag to the session log. Flag structural shadows for potential Book 3 re-investigation. Mark OR cycle complete.",
      "operators_active": ["OR-Π"],
      "entry_condition": "revelation_map complete from P-OR-5",
      "exit_condition": "cycle_complete = true; all results logged; Book 3 re-investigation flags set if shadow_set is non-empty",
      "downstream_handoffs": {
        "Book_5_TEL": "revelation_map feeds TEL encoding for OR-qualified structures",
        "Book_6_Governance": "opacity profile (ω, revelation_state, shadow_set) feeds regime opacity analysis",
        "Book_8_NoS": "structural opacity properties feed ontological analysis of concealment"
      },
      "skip_condition": null
    }
  ],
  "phase_skip_rules": {
    "P-OR-4_skip": "Applies when revelation_state = revealed from P-OR-3 (no latent structure to probe)",
    "P-OR-5_atomic_skip": "Applies when sub(S) = ∅ (atomic structure). ω(S) and revelation_state are sufficient.",
    "never_skip": ["P-OR-1", "P-OR-2", "P-OR-3", "P-OR-6"]
  }
}
