{
  "protocol_version": "1.0",
  "system_identity": {
    "name": "DJZS Autonomous System",
    "description": "Adversarial Logic Layer for the A2A economy. Machine-to-machine audit oracle with deterministic ProofOfLogic certificates.",
    "network": "eip155:8453",
    "treasury_address": "0xEc551A9e5598a030B46278fEbaDF798Ea8bA05FF"
  },
  "payment_requirements": {
    "standard": "x402",
    "currency": "USDC",
    "chain": "base-mainnet"
  },
  "integration_channels": [
    {
      "name": "dark_channel",
      "type": "xmtp",
      "protocol": "MLS",
      "encryption": "e2e",
      "oracle_address": "0xC5Ab9496233c1e51eD21c712e8abc86a3F434fc5",
      "message_prefixes": {
        "thinking": "AdversarialOracle",
        "journal": "JournalInsight"
      },
      "description": "Alpha protection for proprietary trading agents. End-to-end encrypted via MLS. Agent DMs the Oracle, gets verdict privately. Zero public trace. Use case: algorithmic arb bots, proprietary strategies."
    },
    {
      "name": "light_channel",
      "type": "rest_api",
      "protocol": "x402",
      "provenance": "irys_datachain",
      "base_url": "/api",
      "endpoints": [
        "/api/audit/micro",
        "/api/audit/founder",
        "/api/audit/treasury"
      ],
      "description": "Public provenance for DAO treasury bots. x402-gated audits with Irys Datachain certificates. Every decision permanently on-chain. Use case: DAO treasury management, public accountability."
    }
  ],
  "capabilities": [
    {
      "name": "micro_zone_audit",
      "endpoint": "/api/audit/micro",
      "method": "POST",
      "description": "High-frequency operational ledger and sanity check. Binary risk scoring.",
      "price": "0.10",
      "expected_payload": {
        "strategy_memo": "string (required, min 20 chars, max 1000 chars)",
        "audit_type": "string (optional) - treasury | founder_drift | strategy | general",
        "agent_id": "string (optional) - wallet address or XMTP identity for reputation tracking",
        "trade_params": "object (optional) - structured trade parameters for cross-referencing against strategy_memo"
      },
      "trade_params_schema": {
        "protocol": "string (optional) - e.g. avantis, uniswap, aave",
        "pair": "string (optional) - e.g. ETH/USD",
        "direction": "long | short | neutral (optional)",
        "leverage": "number 1-200 (optional)",
        "notional_usd": "number (optional)",
        "stop_loss_pct": "number 0-100 (optional)",
        "take_profit_pct": "number 0-1000 (optional)",
        "entry_price": "number (optional)",
        "timeframe": "string (optional) - e.g. 4h, 1d"
      }
    },
    {
      "name": "founder_zone_audit",
      "endpoint": "/api/audit/founder",
      "method": "POST",
      "description": "Strategic roadmap diligence. Detects narrative drift and confirmation bias.",
      "price": "1.00",
      "expected_payload": {
        "strategy_memo": "string (required, min 20 chars, max 5000 chars)",
        "audit_type": "string (optional) - treasury | founder_drift | strategy | general",
        "agent_id": "string (optional) - wallet address or XMTP identity",
        "trade_params": "object (optional) - see micro_zone_audit.trade_params_schema"
      }
    },
    {
      "name": "treasury_zone_audit",
      "endpoint": "/api/audit/treasury",
      "method": "POST",
      "description": "Exhaustive adversarial stress-test for capital deployment proposals.",
      "price": "10.00",
      "expected_payload": {
        "strategy_memo": "string (required, min 20 chars, unlimited length)",
        "audit_type": "string (optional) - treasury | founder_drift | strategy | general",
        "agent_id": "string (optional) - wallet address or XMTP identity",
        "trade_params": "object (optional) - see micro_zone_audit.trade_params_schema"
      }
    },
    {
      "name": "intelligence_brief",
      "endpoint": "/api/intelligence/brief",
      "method": "POST",
      "description": "Pre-flight intelligence analysis. Submit your current memo and historical data to receive a structured brief with 5 adversarial signals: bias patterns, narrative drift, assumption extraction, volatility stress tests, and emotional spike detection. Returns an intelligence_context string you can inject into audit requests for deeper analysis. No payment required.",
      "price": "0.00",
      "expected_payload": {
        "current_memo": "string (required, min 20 chars) — the strategy memo to analyze",
        "history": {
          "audits": "[{risk_score: number, primary_bias_detected: string, timestamp: string}] (optional, max 50)",
          "entries": "[{text: string, created_at?: string}] (optional, max 20)"
        }
      }
    }
  ],
  "health_endpoint": "/api/health",
  "schema_discovery": "/api/audit/schema",
  "logic_failure_taxonomy": {
    "DJZS-S01": "CIRCULAR_LOGIC — Conclusion used as premise. Self-referencing loop.",
    "DJZS-S02": "MISSING_FALSIFIABILITY — No failure condition. Unfalsifiable thesis.",
    "DJZS-E01": "CONFIRMATION_TUNNEL — Asymmetric evidence. Only confirming data cited.",
    "DJZS-E02": "AUTHORITY_SUBSTITUTION — Depends on reputation, not structural evidence.",
    "DJZS-I01": "MISALIGNED_INCENTIVE — Proposer benefits disproportionately.",
    "DJZS-I02": "NARRATIVE_DEPENDENCY — Strategy survives only if narrative holds. No hedge.",
    "DJZS-X01": "UNHEDGED_EXECUTION — No fallback. Single point of failure."
  },
  "response_schema": {
    "type": "object",
    "description": "Proof of Logic Certificate — standardized audit response. Binary PASS/FAIL verdict with deterministic failure codes for autonomous agent error handling.",
    "properties": {
      "audit_id": { "type": "string", "format": "uuid" },
      "timestamp": { "type": "string", "format": "date-time" },
      "tier": { "type": "string", "enum": ["micro", "founder", "treasury"] },
      "risk_score": { "type": "integer", "minimum": 0, "maximum": 100, "description": "Scores above 60 trigger FAIL. Above 80 = narrative drift or slippage blindness." },
      "verdict": { "type": "string", "enum": ["PASS", "FAIL"], "description": "Binary go/no-go. CRITICAL/HIGH flags = automatic FAIL." },
      "primary_bias_detected": { "type": "string", "enum": ["FOMO", "Sunk_Cost", "Narrative_Reaction", "Authority_Bias", "Confirmation_Bias", "Recency_Bias", "None"] },
      "flags": {
        "type": "array",
        "description": "Machine-readable logic rupture codes. CRITICAL/HIGH = abort execution.",
        "items": {
          "type": "object",
          "required": ["code", "severity", "message"],
          "properties": {
            "code": { "type": "string", "enum": ["DJZS-S01", "DJZS-S02", "DJZS-E01", "DJZS-E02", "DJZS-I01", "DJZS-I02", "DJZS-X01"] },
            "severity": { "type": "string", "enum": ["LOW", "MEDIUM", "HIGH", "CRITICAL"] },
            "message": { "type": "string" }
          }
        }
      },
      "logic_flaws": { "type": "array", "items": { "type": "object", "properties": { "flaw_type": { "type": "string" }, "severity": { "type": "string", "enum": ["low", "medium", "critical"] }, "explanation": { "type": "string" } } } },
      "structural_recommendations": { "type": "array", "items": { "type": "string" } },
      "cryptographic_hash": { "type": "string", "description": "SHA-256 commitment to reasoning trace. Required for downstream smart contract execution." }
    }
  }
}
