diff --git a/apps/api/src/core/feature_flags.py b/apps/api/src/core/feature_flags.py index 22c481c6..ff06f345 100644 --- a/apps/api/src/core/feature_flags.py +++ b/apps/api/src/core/feature_flags.py @@ -173,6 +173,10 @@ class AIOpsFeatureFlags(BaseSettings): default=False, description="P6: Playbook trust 分布漂移偵測是否啟用", ) + AIOPS_P6_GOVERNANCE_ENABLED: bool = Field( + default=False, + description="P6: 治理閉環總開關(offline_replay_service / model_rollback_service 守衛)", + ) def is_phase_enabled(self, phase: int) -> bool: """ diff --git a/apps/api/src/main.py b/apps/api/src/main.py index 1710fa10..4325fd9e 100644 --- a/apps/api/src/main.py +++ b/apps/api/src/main.py @@ -383,6 +383,15 @@ async def lifespan(_app: FastAPI) -> AsyncGenerator[None, None]: except Exception as e: logger.warning("proactive_inspector_schedule_failed", error=str(e)) + # ADR-087 Phase 6: 離線回放(每 7 天)— 決策一致率基線 + # 2026-04-15 ogt + Claude Sonnet 4.6(亞太): Phase 6 初始建立 + try: + from src.jobs.offline_replay_service import run_offline_replay_loop + asyncio.create_task(run_offline_replay_loop()) + logger.info("offline_replay_loop_scheduled", interval_sec=604800) + except Exception as e: + logger.warning("offline_replay_loop_schedule_failed", error=str(e)) + yield # Shutdown diff --git a/k8s/awoooi-prod/04-configmap.yaml b/k8s/awoooi-prod/04-configmap.yaml index 2fe3f537..b069e826 100644 --- a/k8s/awoooi-prod/04-configmap.yaml +++ b/k8s/awoooi-prod/04-configmap.yaml @@ -119,3 +119,33 @@ data: SENTRY_MCP_ENABLED: "true" # Prometheus server 在 110:9090 (非 188) PROMETHEUS_URL: "http://192.168.0.110:9090" + + # ============================================================================ + # AIOps Phase 1-6 Feature Flags (2026-04-15 ogt: 全開,資料先全寫入 DB) + # ============================================================================ + AIOPS_P1_ENABLED: "true" + AIOPS_P1_PRE_DECISION_INVESTIGATOR: "true" + AIOPS_P1_POST_EXECUTION_VERIFIER: "true" + AIOPS_P2_ENABLED: "true" + AIOPS_P2_CRITIC_ENABLED: "true" + AIOPS_P2_AGENT_TIMEOUT_SEC: "15" + AIOPS_P3_ENABLED: "true" + AIOPS_P3_EVOLVER_ENABLED: "true" + AIOPS_P3_FINETUNE_EXPORT: "true" + AIOPS_P3_KNOWLEDGE_DECAY: "true" + AIOPS_P4_ENABLED: "true" + AIOPS_P4_DYNAMIC_BASELINE: "true" + AIOPS_P4_LOG_ANOMALY: "true" + AIOPS_P4_TREND_PREDICTOR: "true" + AIOPS_P4_PROACTIVE_INSPECTOR: "true" + AIOPS_P4_SHADOW_MODE: "true" + AIOPS_P5_ENABLED: "true" + AIOPS_P5_BLAST_RADIUS_CHECK: "true" + AIOPS_P5_GITOPS_PR: "false" + AIOPS_P5_DRY_RUN_ENFORCED: "true" + AIOPS_P6_ENABLED: "true" + AIOPS_P6_GOVERNANCE_ENABLED: "true" + AIOPS_P6_SELF_DEMOTION: "true" + AIOPS_P6_OFFLINE_REPLAY: "true" + AIOPS_P6_KB_ROT_CLEANER: "true" + AIOPS_P6_TRUST_DRIFT_DETECTOR: "true" diff --git a/k8s/awoooi-prod/06-deployment-api.yaml b/k8s/awoooi-prod/06-deployment-api.yaml index bc0f78ad..403ce185 100644 --- a/k8s/awoooi-prod/06-deployment-api.yaml +++ b/k8s/awoooi-prod/06-deployment-api.yaml @@ -61,9 +61,8 @@ spec: - name: USE_AI_ROUTER value: "true" - name: ENABLE_NEMOTRON_COLLABORATION - # 2026-04-12 ogt: 停用 — Ollama 111 tool_call 60s×2 > asyncio.wait_for 30s - # → expert_system fallback → confidence=0.0,待 Ollama 穩定後恢復 - value: "false" + # 2026-04-15 ogt: 重新啟用 — asyncio.wait_for=120s,Ollama 已等待回應 + value: "true" - name: NEMOTRON_TIMEOUT_SECONDS value: "55" - name: TELEGRAM_ENABLE_POLLING