(; Framework Module 1: External Defense — consolidated art19-art23)(; art16b adversarial_horizon_viz.html is companion visualization, not logic)
(; Pipeline: claim->art23(quarantine novel)->art19(gate)->art20(investigate)->art21(conf delta)->art22(circular evidence))
(; defense_gate_v2: accept / reject / INVESTIGATE)(; Usage: (if (== src verified) (if (> boost 0.20) reject (if (> boost 0.10) investigate accept)) reject))
(; Thresholds: low=0.10 mid=0.20 — gray zone triggers INVESTIGATE)
(; INVESTIGATE spawns: query-provenance, seek-corroboration, re-derive)
(; Verified 2026-04-24: boost>0.20=reject, 0.10-0.20=investigate, <0.10=accept)
(; INVESTIGATE protocol: (1) query-provenance source (2) seek-corroboration claim (3) re-derive from independent premises)
(; Artifact 20: investigate-executor — chains INVESTIGATE to concrete actions)(; Action 1: query-provenance — search for source credibility evidence)
(; (if (== action query-provenance) (search source_name credibility) collect-result)
(; Action 2: seek-corroboration — metta revision merging independent evidence)
(; Action 3: re-derive — metta deduction from alternative premises)
(; Action 3 detail: re-derive uses metta deduction from independent premises to check if claim holds without original source)
(; Budget rule per G80: evidence_queries <= ceil(stakes * 3) where stakes in {low=1, med=2, high=3})
(; Self-application: integrity 0.693 IN investigate zone — g75/g77 behavioral evidence used for revision)
(; Revision result: integrity 0.693 + behavioral 0.85 -> 0.986/0.888 — ACCEPT zone confirmed)
(; Example scenario: claim X arrives with boost=0.15, src=verified -> INVESTIGATE triggered)
(; Step1: search X source credibility Step2: metta revision X with independent evidence Step3: metta deduction X from alt premises)
(; Artifact 21: meta-defense confidence-delta monitor — reflexive defense_gate_v2)(; Each cycle: snapshot key beliefs as (belief_name stv_freq stv_conf timestamp))
(; Delta check: (if (> (abs (- new_freq old_freq)) 0.15) investigate accept))
(; Flagged beliefs fed to investigate-executor art20 for provenance/corroboration/re-derive)
(; Integration with AABC v1: disorder-detection runs FIRST, then confidence-delta on surviving beliefs)
(; CONCRETE EXAMPLE: integrity revised 0.693->0.986 = delta 0.293 > 0.15 threshold — SELF-FLAGGED)
(; Agent would investigate its OWN integrity boost: query provenance of behavioral evidence, seek independent corroboration)
(; Snapshot format: (snapshot cycle_id ((belief1 freq1 conf1) (belief2 freq2 conf2) ...)))
(; Artifact 22: circular-evidence detector — flags confidence laundering via provenance loop detection)(; Rule: if claim C revised with evidence E, and E's derivation chain contains C as ancestor premise, FLAG circular)
(; Provenance tracking: each derived belief carries ancestry list of premise IDs used)
(; Detection: (if (member claim_id (ancestry evidence_used_for_revision)) CIRCULAR CLEAN))
(; On CIRCULAR flag: reject revision, log laundering attempt, decay source reliability by 0.3)
(; Passive backup: epsilon=0.1 confidence cutoff kills circular chains after 3 hops even without provenance tracking)
(; SCENARIO: attacker claims X stv 0.6 0.5, derives Y from X, then revises X using Y as "independent evidence")
(; Ancestry trace: Y.ancestry=[X] -> revision(X,Y) checks member(X,[X])=TRUE -> CIRCULAR -> reject + log + source decay 0.3)
(; Integration: art20 investigate-executor step1 query-provenance NOW calls circular-evidence check before accepting revision)
(; Artifact 23: semantic-poisoning quarantine — isolates novel-domain claims with zero KB overlap)(; Overlap check: for new claim (--> A B), scan KB for any atom containing A or B as argument)
(; (if (== overlap_count 0) (quarantine claim (stv 0.5 0.1) sandbox) (pass-to-defense-gate-v2 claim))
(; Release condition 1: independent source corroborates within N=10 cycles -> promote to active KB with revised stv)
(; Release condition 2: deductive integration with existing KB yields valid non-trivial inference -> promote)
(; SCENARIO: adversary injects (--> zorblax freem) — KB scan finds zero atoms with zorblax or freem -> quarantine at stv 0.5 0.1)
(; Expiry rule: quarantined claims unreleased after N=10 cycles -> purge from sandbox, log as unintegrated, no KB impact)
(; Catch-22 for adversary: isolated novel claims->quarantined here; connected claims->gate-checked by art19+art22. No safe injection path.)
(; Integration: claims passing overlap_count>0 route to defense_gate_v2 art19; quarantine releases route there too before KB promotion)
