{
  "$schema": "./features.schema.json",
  "version": "4.1.4",
  "description": "0xRay Framework - Unified Feature Configuration",
  "suit_temperament": {
    "profile": "auto",
    "host_defaults": {
      "grok": "frontier",
      "hermes": "guided",
      "opencode": "guided",
      "openclaw": "guided",
      "generic": "guided"
    }
  },
  "goggles": {
    "enabled": true
  },
  "token_optimization": {
    "enabled": true,
    "max_context_tokens": 20000,
    "prune_after_task": true,
    "summarize_tool_outputs": true,
    "context_compression": {
      "enabled": true,
      "threshold_tokens": 15000,
      "compression_ratio": 0.4
    }
  },
  "model_routing": {
    "enabled": true
  },
  "batch_operations": {
    "enabled": true,
    "prefer_sed_for_replacements": true,
    "parallel_file_updates": true,
    "max_concurrent_edits": 10,
    "auto_batch_threshold": 5
  },
  "multi_agent_orchestration": {
    "enabled": true,
    "coordination_model": "async-multi-agent",
    "max_concurrent_agents": 3,
    "task_distribution_strategy": "capability-based",
    "conflict_resolution": "expert-priority",
    "progress_tracking": true,
    "session_persistence": true,
    "lead_dev_mode": true,
    "per_suite_test_triage": true,
    "phased_plan_threshold": 25,
    "auto_consult_major_work": true,
    "no_new_surface": true,
    "auto_chain_delegations": true,
    "plan_stale_hours": 8,
    "plan_archive_marker_hours": 24,
    "user_asides": {
      "enabled": true,
      "auto_provision_worktree": false
    }
  },
  "grok_postprocessor_light": false,
  "inference_session_capture": {
    "enabled": true,
    "min_commits": 3,
    "lookback_commits": 20
  },
  "autonomous_reporting": {
    "enabled": false,
    "interval_minutes": 60,
    "auto_schedule": false,
    "include_health_assessment": true,
    "include_agent_activities": true,
    "include_pipeline_operations": true,
    "include_critical_issues": true,
    "include_recommendations": true,
    "report_retention_days": 30,
    "notification_channels": [
      "console"
    ]
  },
  "agent_management": {
    "disabled_agents": [],
    "agent_models": {},
    "performance_limits": {
      "max_task_duration_ms": 30000,
      "max_memory_usage_mb": 512,
      "max_tokens_per_request": 16000
    }
  },
  "refactoring": {
    "enabled": true,
    "automatic_detection": true,
    "require_user_approval": false,
    "max_complexity_threshold": 80,
    "safe_mode": true,
    "batch_mode": true
  },
  "activity_logging": {
    "enabled": true,
    "level": "info",
    "include_performance_metrics": true,
    "include_agent_states": false,
    "include_token_usage": true,
    "retention_days": 3,
    "log_to_file": true,
    "log_path": ".opencode/logs"
  },
  "security": {
    "enabled": true,
    "prompt_sanitization": true,
    "vulnerability_scanning": true,
    "code_review_enforcement": true,
    "security_score_threshold": 70
  },
  "performance_monitoring": {
    "enabled": true,
    "real_time_metrics": true,
    "benchmark_tracking": true,
    "token_tracking": true,
    "cost_tracking": true,
    "alerting": {
      "enabled": true,
      "performance_degradation_threshold": 20,
      "error_rate_threshold": 5,
      "cost_threshold_daily": 10
    }
  },
  "caching": {
    "enabled": true,
    "file_content_cache": true,
    "search_result_cache": true,
    "cache_ttl_seconds": 60,
    "max_cache_size_mb": 25
  },
  "agent_spawn": {
    "max_concurrent": 8,
    "max_per_type": 3,
    "spawn_cooldown_ms": 500,
    "rate_limit_per_minute": 20
  },
  "delegation": {
    "confidence_threshold": 0.5,
    "enable_intelligent_routing": true
  },
  "complexity_thresholds": {
    "simple": 15,
    "moderate": 25,
    "complex": 50,
    "enterprise": 100
  },
  "analytics": {
    "enabled": true,
    "default_limit": 500,
    "min_samples_for_calibration": 3,
    "track_complexity_accuracy": true,
    "track_agent_performance": true
  },
  "pattern_learning": {
    "enabled": true,
    "learning_interval_ms": 300000,
    "auto_apply_threshold": 0.9,
    "min_success_rate": 0.7
  },
  "memory_routing": {
    "enabled": true,
    "provider": "repertoire",
    "module_path": "node_modules/@0xray/repertoire/dist/provider/memory-routing-provider.js",
    "config": {
      "signalsPath": ".xray/state/repertoire/curated_signals.json",
      "statePath": ".xray/state/repertoire/inference-state.json",
      "feedbackDir": ".xray/state/repertoire/feedback"
    }
  },
  "synthesis": {
    "enabled": false,
    "every_n_gates": 12,
    "every_n_turns": 0,
    "every_n_todos_completed": 0,
    "reflection": {
      "mode": "minimal",
      "thresholds": {
        "minimal": {
          "auto_generate": true,
          "commit_threshold": 25,
          "days_threshold": 14
        }
      }
    }
  },
  "inference": {
    "description": "The cycle runs from the CLI command inference:run and the session wake does not start it.",
    "enabled": true,
    "workflow_dir": ".xray/inference",
    "reports_dir": ".xray/reports",
    "pattern_matching": {
      "enabled": true,
      "confidence_threshold": 0.7
    }
  },
  "inference_governance": {
    "enabled": false,
    "request_timeout_ms": 10000,
    "min_confidence_threshold": 0.5,
    "proposal_defaults": {
      "source": "agent",
      "onChain": false
    }
  }
}
