{
  "_documentation": {
    "pin_only_fallback": "EMERGENCY ONLY — default false. When true, the router pins on the first turn and reuses that model for all subsequent turns, skipping turn_envelope, triage, HyDRA, and sub-routing. Use when shadow quality retention regresses (>5% vs baseline) or as a manual operator fallback. See docs/routing-roadmap.md §1 and GitHub #83. Automated trigger wiring is SP-162."
  },
  "frugality": {
    "lambda_cost": 0.5,
    "lambda_latency": 0.1,
    "lambda_verbosity": 0.15
  },
  "loop_escalation": {
    "threshold": 3
  },
  "pricing": {
    "staleness_days": 14
  },
  "local": {
    "min_memory_gb_full": 16,
    "min_memory_gb_classification": 8,
    "battery_threshold_pct": 20
  },
  "hydra": {
    "artifact_cache_path": ".pi-smart-router/models/",
    "encoder": "minilm",
    "_encoder_documentation": "Encoder switch — minilm (shipped default) | granite (opt-in trial, #80/#167). Granite: ibm-granite/granite-embedding-97m-multilingual-r2 ONNX, 384-dim long-context drop-in; fetches on first use into artifact_cache_path. See README 'HyDRA model cache → Granite opt-in dogfood runbook (#167)' for fetch/switch/measure/follow-ups. Do NOT flip the shipped default here — promotion is decided only via #96.",
    "encoder_cascade": {
      "enabled": false,
      "long_context_encoder": "granite",
      "token_threshold": 512
    },
    "_encoder_cascade_documentation": "SP-291 (#173) — opt-in per-prompt encoder cascade. Default OFF: every prompt uses hydra.encoder (MiniLM) and existing installs are unaffected. When enabled, prompts whose estimated token count reaches token_threshold are embedded with long_context_encoder (Granite 97M, long-context) instead of MiniLM (512-token window), avoiding truncation on long prompts. The gate is pure pre-embedding arithmetic (~zero overhead) and reuses the turn-envelope token estimator (estimated_input_tokens ?? prompt_text.length). Hard constraint: encoders embed into different vector spaces — never mix per-encoder artifacts (routing centroids, learned projection); per-encoder artifact sets and the cascading embedder land with SP-292.",
    "hydra_heads": "learned_projection",
    "_onnx_artifact_pins_documentation": "SP-259 (#147) — ONNX artifact supply-chain pinning. Digests live in config/onnx-artifact-pins.json (SHA-256 per cached artifact). Enable with env SMART_ROUTER_ONNX_PIN_MODE=verify (verify configured pins; unpinned models still download) or =enforce (CI/prod: pins required for the loaded model — missing pin file, missing pins, missing cached artifact, or any digest mismatch fails closed). Default off preserves first-run unpinned dogfood downloads. Override pin file path with SMART_ROUTER_ONNX_PIN_FILE. See README 'HyDRA model cache → Supply-chain' for offline cache warm and audit posture.",
    "_hydra_heads_documentation": {
      "learned_projection": "Default — SP-115 384×3 linear projection on MiniLM/Granite embeddings (config/hydra-projection-weights.json). Approximates HyDRA K sigmoid heads; keep until calibration Top-1 error exceeds ~10%.",
      "modernbert_k4": "ModernBERT-base [CLS] with K=4 independent sigmoid heads (config/modernbert-k4-heads.json). Migrating from SP-115: train K=4 head weights offline, set hydra_heads to modernbert_k4, and remove or ignore hydra-projection-weights.json. The fourth debugging dimension is predicted for HyDRA fidelity but excluded from the catalog-decoupled shortfall gate (reasoning, code_gen, tool_use only). See docs/routing-roadmap.md §2 P3 and GitHub #81."
    }
  },
  "low_intensity": {
    "weights": {
      "prompt_shortness": 0.08,
      "token_shortness": 0.08,
      "cyclomatic_low": 0.06,
      "trivial_signal": 0.1,
      "complex_inverse": 0.08,
      "triage_verdict": 0.1,
      "turn_type": 0.08,
      "no_tool_context": 0.06,
      "message_shallow": 0.06,
      "prose_ratio": 0.06,
      "requirement_low": 0.12,
      "cluster_signal": 0.12
    },
    "high_threshold": 0.65,
    "low_threshold": 0.35,
    "p_success_alpha": 0.5
  },
  "saar": {
    "planning_turn_buffer": 2,
    "prefix_cache_weight": 0.2,
    "idle_timeout_seconds": 300,
    "switch_threshold": 0.5
  },
  "planning_delegate": {
    "enabled": true,
    "compressed_context": {
      "max_messages": 12,
      "max_tokens": 16384,
      "exclude_execution_history": true
    },
    "global_timeout_ms": 120000,
    "sub_call_timeout_ms": 30000,
    "_timeouts_documentation": {
      "global_timeout_ms": "Global cap (ms) for the whole delegate stage; mirrors llm-use WORKER_GLOBAL_TIMEOUT. Default 120000 (SP-213, #120).",
      "sub_call_timeout_ms": "Per-call cap (ms) for each delegate sub-call worker; mirrors llm-use WORKER_CALL_TIMEOUT. Default 30000 (SP-213, #120)."
    }
  },
  "local_zero": {
    "enabled": true,
    "max_tool_use_requirement": 0.25,
    "_documentation": {
      "enabled": "When false, skip local_zero entirely (fall through to triage cloud / HyDRA). Default true — does not disable local for trivial traffic.",
      "max_tool_use_requirement": "Ceiling (0–1) on cheap predicted tool_use for local_zero dispatch. Effective limit is min(local model tool_use capability, this value). Default 0.25 keeps format/lint local while skipping agentic git/bash/edit/explore/delete/repo cues (SP-177, #98)."
    }
  },
  "adaptive_reasoning": {
    "enabled": true,
    "min_level": "low",
    "max_level": "high",
    "_documentation": {
      "enabled": "When false, adaptive reasoning is skipped — delegated calls pass the caller (session) thinking level through unchanged. Default true (SP-246, #166).",
      "min_level": "Optional floor on policy-derived thinking levels (minimal | low | medium | high | xhigh | max). Routine tool_result/main_loop turns policy-resolve to minimal/low; a floor raises that. Never lowers an explicit operator /thinking choice. Omit for no floor.",
      "max_level": "Optional ceiling on policy-derived thinking levels, including turn-class upgrades. When min_level would exceed max_level (e.g. via env), the ceiling wins. Omit for no ceiling."
    }
  },
  "pin_only_fallback": false
}
