{
  "map_id": "sarg.evaluation_map",
  "version": "7.0-draft",
  "book": "book7_sarg",
  "series": "AI Edition",
  "invariant": "INV-SARG-004",
  "operator_binding": "SARG-Ρ (ReachabilityAudit)",
  "session_context": "rtt=1 | coherence=declared | drift=bounded | paradox=structural",
  "description": "Defines the argument evaluation procedures for SARG. Evaluation determines whether a constructed argument satisfies all four SARG invariants, passes structural soundness checks, achieves warrant coverage across all claim-evidence pairs, and is free from prohibited reflexive loops. Evaluation is a sequential gate process — each gate must pass before the next executes.",

  "evaluation_model": {
    "style": "constraint_satisfaction over structural objects",
    "evaluation_function": "eval_SARG : A → {valid, invalid, suspended}",
    "determinism_guarantee": "INV-TEL-002 applies — the TEL encoding of A has exactly one structural interpretation. Evaluation results are deterministic given the same A and C_A.",
    "session_binding": "Evaluation results are session-scoped. A re-submitted argument with modified N_A or R_A is treated as a new argument A' and evaluated independently.",
    "upstream_prerequisite": "TEL-Σ must have returned PASS on the TEL encoding of A before SARG evaluation begins"
  },

  "evaluation_gates": [
    {
      "gate_id": "EG-001",
      "label": "Integrity Gate",
      "invariant": "INV-SARG-001",
      "operator": "SARG-Ν (NodeConstruct)",
      "description": "Verify that every node in N_A is reachable from root(A) via declared relations in R_A. Compute reach(A) by directed traversal from root(A). Nodes not in reach(A) are classified as orphans.",
      "procedure": [
        "Initialize reach = {root(A)}",
        "Traverse R_A: for each r ∈ R_A, if r.target ∈ reach, add r.source to reach",
        "Repeat until reach stabilizes",
        "orphan_set = N_A \\ reach(A)",
        "If orphan_set ≠ ∅: record all orphans; they are excluded from evaluation",
        "If reach(A) = {root(A)} only: argument has no supporting structure — flag as EG-001 minimal violation"
      ],
      "pass_condition": "reach(A) computed and recorded; orphan_set recorded (may be empty)",
      "fail_condition": "Traversal error (malformed R_A); reach(A) cannot be computed",
      "gate_outcome": {
        "pass": "Proceed to EG-002",
        "fail": "Halt; R_A structure error must be corrected before re-evaluation"
      },
      "notes": "Orphan presence does not fail EG-001 — orphans are excluded from evaluation, not an error condition. The gate fails only if reach(A) itself cannot be computed."
    },
    {
      "gate_id": "EG-002",
      "label": "Warrant Coverage Gate",
      "invariant": "INV-SARG-002",
      "operator": "SARG-Ω (WarrantAudit)",
      "description": "For every claim-evidence pair in reach(A), verify that at least one declared Warrant node in warrants(A) bridges the evidence node to the claim node. Uncovered pairs are INV-SARG-002 violations.",
      "procedure": [
        "Enumerate all CE_pairs(A): pairs (c, e) where c ∈ reach(A) is a Claim node and e ∈ reach(A) is an Evidence node with a relation path e → c",
        "For each (c, e) ∈ CE_pairs(A): check whether ∃w ∈ warrants(reach(A)): w.source = e ∧ w.target = c",
        "Uncovered pairs: CE_pairs where no such w exists",
        "Record uncovered_pairs list",
        "If uncovered_pairs ≠ ∅: record INV-SARG-002 violations for each uncovered pair"
      ],
      "pass_condition": "uncovered_pairs = ∅ (all CE pairs have at least one declared Warrant bridge)",
      "fail_condition": "uncovered_pairs ≠ ∅ — at least one CE pair lacks warrant coverage",
      "gate_outcome": {
        "pass": "Proceed to EG-003",
        "fail": "Argument is invalid at INV-SARG-002. Record all uncovered pairs. Argument construction must add Warrant nodes for uncovered pairs before re-evaluation.",
        "partial_suspension": "If some but not all CE pairs are covered: argument is partially valid — the covered paths may be reported while the uncovered paths are suspended"
      }
    },
    {
      "gate_id": "EG-003",
      "label": "Defeat Completeness Gate",
      "invariant": "INV-SARG-003",
      "operator": "SARG-Δ (DefeatCheck)",
      "description": "Review all registered defeat attempts against A. Verify that each defeat that claims structural completeness has a recorded structural target in (nodes(A) ∪ R_A ∪ C_A). Reclassify incomplete defeats as parallel assertions.",
      "procedure": [
        "Retrieve all defeat records D_1 ... D_k registered against A in the session defeat log",
        "For each D_i: check that D_i.T_D ∈ (reach(A) ∪ R_A ∪ C_A)",
        "For each D_i: confirm that O_D(T_D) produces at least one structural change (DCV-2 check)",
        "Incomplete D_i: reclassify as PA[parallel_assertion] — no effect on A's validity",
        "Complete D_i: apply O_D to A; recompute reach(A); re-run EG-001 and EG-002 on modified A",
        "Record final defeat tally: complete_defeats, reclassified_assertions"
      ],
      "pass_condition": "All registered defeats are either classified complete (with recorded structural effect) or reclassified as parallel assertions. No defeat records are in ambiguous state.",
      "fail_condition": "A defeat record exists with an ambiguous or unresolvable target — neither confirmable as structural nor dismissible as surface",
      "gate_outcome": {
        "pass": "Proceed to EG-004",
        "fail": "Session fault — defeat record must be resolved before proceeding",
        "notes": "A completely defeated argument (all paths to root(A) severed) returns eval_SARG = invalid here; no further gates needed"
      }
    },
    {
      "gate_id": "EG-004",
      "label": "Reflexive Prohibition Gate",
      "invariant": "INV-SARG-004",
      "operator": "SARG-Ρ (ReachabilityAudit)",
      "description": "Detect all paths in reach(A) that return to root(A). For each closed path, verify that at least one node on the path satisfies independent_evidence(n_i, root(A)). Paths that return to root(A) with no independent evidentiary node are prohibited reflexive loops.",
      "procedure": [
        "Enumerate all cycles in the directed graph of reach(A)",
        "For each cycle C_j that includes root(A):",
        "  — Extract all nodes n_i ∈ C_j",
        "  — For each n_i: evaluate independent_evidence(n_i, root(A)) ⟺ provenance(n_i) ∩ derivation_closure(root(A)) = ∅",
        "  — If ∀n_i ∈ C_j: ¬independent_evidence(n_i, root(A)): C_j is a prohibited reflexive loop",
        "If any prohibited loops exist: record them; argument is invalid at INV-SARG-004",
        "If all cycles through root(A) contain at least one independent evidentiary node: gate passes"
      ],
      "pass_condition": "No prohibited reflexive loops found in reach(A), OR all cycles through root(A) contain at least one independent evidentiary node",
      "fail_condition": "At least one cycle through root(A) contains no independent evidentiary node",
      "gate_outcome": {
        "pass": "Proceed to EG-005 (Constraint Satisfaction)",
        "fail": "Argument is invalid at INV-SARG-004. Record prohibited loop(s). Argument must be restructured — either the circular path must be broken, or an independent evidentiary node must be inserted on the path."
      },
      "independence_check": {
        "definition": "n_i is independent of root(A) if: provenance(n_i) ∩ derivation_closure(root(A)) = ∅",
        "derivation_closure": "The set of all nodes that can be derived from or are logically contained within root(A)'s content. Restatements, elaborations, and direct consequences of root(A) are in its derivation closure.",
        "note": "This is a structural check, not a semantic one. SARG does not evaluate propositional truth — it evaluates structural provenance. An evidence node is structurally independent if it was constructed and declared independently of root(A)."
      }
    },
    {
      "gate_id": "EG-005",
      "label": "Constraint Satisfaction Gate",
      "invariant": "INV-SARG-001 through INV-SARG-004 (cumulative)",
      "operator": "SARG-Σ (SynthesisOutput)",
      "description": "Evaluate the argument A against all declared constraints in C_A. C_A may include domain-specific constraints, GRL legitimacy requirements (from Book 6), TEL-encoded invariant assertions, and SARG session constraints. All constraints must be satisfied for eval_SARG = valid.",
      "procedure": [
        "Retrieve C_A from the argument definition",
        "For each c_i ∈ C_A: evaluate whether reach(A) (post-defeat, post-orphan-exclusion) satisfies c_i",
        "Unsatisfied constraints: record as constraint_violations list",
        "If constraint_violations = ∅ and all four EG gates passed: eval_SARG = valid",
        "If constraint_violations ≠ ∅: eval_SARG = invalid; record all violations"
      ],
      "pass_condition": "constraint_violations = ∅ and EG-001 through EG-004 all passed",
      "fail_condition": "Any constraint in C_A is unsatisfied",
      "gate_outcome": {
        "valid": "eval_SARG = valid; proceed to catalogue phase for SARG-Σ output",
        "invalid": "eval_SARG = invalid; record violation log; argument may be revised and re-submitted",
        "suspended": "One or more constraints are in partial defeat suspension — evaluation is pending resolution of the defeat record"
      }
    }
  ],

  "soundness_model": {
    "description": "SARG soundness is distinct from logical soundness. A SARG-sound argument satisfies all structural constraints; it does not guarantee that its propositional conclusions are true.",
    "sarg_soundness_definition": "sound_SARG(A) ⟺ eval_SARG(A) = valid ∧ ∀c ∈ C_A: A ⊨ c",
    "distinction": "An argument can be SARG-sound and propositionally false. An argument can be propositionally true and SARG-invalid. These properties are orthogonal. SARG evaluates structure; propositional truth is outside its scope.",
    "practical_implication": "Downstream consumers of SARG evaluation results (Book 8 NoS, Book 9 PD) receive structural validity reports, not truth assessments. Interpreting a SARG-valid argument as propositionally true is an INV-TEL-002 violation — it reads more into the evaluation result than the result encodes."
  },

  "evaluation_failure_modes": [
    {
      "id": "EFM-SARG-001",
      "label": "Premature Validity Claim",
      "description": "Claiming eval_SARG = valid before all five evaluation gates have completed",
      "detection": "EG completion log is missing one or more gate records",
      "resolution": "Complete all gates; do not report validity until EG-005 completes"
    },
    {
      "id": "EFM-SARG-002",
      "label": "Orphan Inclusion",
      "description": "Including orphan nodes in the evaluation after EG-001 excluded them",
      "detection": "A node in the warrant coverage check (EG-002) is in the orphan_set",
      "resolution": "Re-run EG-002 using reach(A), not N_A"
    },
    {
      "id": "EFM-SARG-003",
      "label": "Defeat Inversion",
      "description": "Using a defeat record that was reclassified as a parallel assertion to modify A's validity status",
      "detection": "A PA[...] record appears in the defeat tally as complete",
      "resolution": "Separate complete_defeats from reclassified_assertions in the tally; only complete_defeats affect A"
    },
    {
      "id": "EFM-SARG-004",
      "label": "Reflexivity Bypass",
      "description": "Skipping EG-004 because no obvious cycle is visible — failure to detect non-obvious cycles in deeply nested argument graphs",
      "detection": "Cycle enumeration was not performed (EG-004 record missing)",
      "resolution": "Run full cycle enumeration on the directed graph of reach(A) regardless of apparent acyclicity"
    },
    {
      "id": "EFM-SARG-005",
      "label": "GRL Feed Ignored",
      "description": "Evaluating a governance-domain argument without loading the regime_status_report from GRL-Σ as a potential evidence source, leading to uncovered CE pairs that could have been covered by legitimacy evidence",
      "detection": "Book 6 GRL was a declared dependency but regime_status_report was not queried",
      "resolution": "In init phase, confirm GRL regime_status_report is available and load it as structured evidence before argument construction begins"
    }
  ],

  "integrity_verification_summary": {
    "description": "Quick-reference table of all four invariants and their evaluation gate assignments",
    "table": [
      { "invariant": "INV-SARG-001", "label": "Argument Integrity", "gate": "EG-001", "operator": "SARG-Ν", "check": "reach(A) computation; orphan detection" },
      { "invariant": "INV-SARG-002", "label": "Warrant Necessity", "gate": "EG-002", "operator": "SARG-Ω", "check": "CE pair warrant coverage; uncovered_pairs detection" },
      { "invariant": "INV-SARG-003", "label": "Defeat Completeness", "gate": "EG-003", "operator": "SARG-Δ", "check": "Defeat structural targeting; parallel assertion reclassification" },
      { "invariant": "INV-SARG-004", "label": "Reflexive Prohibition", "gate": "EG-004", "operator": "SARG-Ρ", "check": "Cycle detection; independent evidence verification" }
    ]
  }
}
