chore: 未提交變更整理 (API core + docs + scripts)
API 核心: - constants.py: 系統常量定義 - unit_of_work.py: Unit of Work 模式 - incident_approval_service.py: Incident-Approval 同步服務 文檔更新: - LOGBOOK.md: 進度更新 - AWOOOI_AGENTIC_WORKSPACE_ROADMAP.md: 路線圖 - 2026-03-26_llm_testing_evaluation.md: LLM 測試評估 - phase5_telemetry_architecture.md: 遙測架構 - SECRETS_REFERENCE.md: 密鑰參考 配置/腳本: - Skill 02 v1.x: leWOOOgo 後端更新 - .dependency-cruiser.cjs: 依賴規則 - demo-multisig-flow.sh: 演示腳本 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
45
apps/api/src/core/constants.py
Normal file
45
apps/api/src/core/constants.py
Normal file
@@ -0,0 +1,45 @@
|
||||
"""
|
||||
Core Constants
|
||||
==============
|
||||
ADR-027: Incident-Approval 同步架構
|
||||
|
||||
統一定義系統常量,避免散落各處的 magic numbers。
|
||||
|
||||
版本: v1.0
|
||||
建立: 2026-03-26 (台北時區)
|
||||
"""
|
||||
|
||||
# =============================================================================
|
||||
# TTL Settings (秒)
|
||||
# =============================================================================
|
||||
|
||||
# Working Memory TTL: 7 天
|
||||
INCIDENT_TTL_SECONDS = 7 * 24 * 3600 # 604800
|
||||
APPROVAL_TTL_SECONDS = 7 * 24 * 3600 # 604800
|
||||
|
||||
# Decision Token TTL: 24 小時
|
||||
DECISION_TTL_SECONDS = 24 * 3600 # 86400
|
||||
|
||||
# =============================================================================
|
||||
# Redis Key Prefixes
|
||||
# =============================================================================
|
||||
|
||||
REDIS_KEY_INCIDENT = "incident:"
|
||||
REDIS_KEY_APPROVAL = "approval:"
|
||||
REDIS_KEY_PENDING = "pending_approvals"
|
||||
REDIS_KEY_DECISION = "decision:"
|
||||
|
||||
# =============================================================================
|
||||
# Status Mappings (ADR-027)
|
||||
# =============================================================================
|
||||
|
||||
# Approval 狀態 → Incident 狀態
|
||||
APPROVAL_TO_INCIDENT_STATUS = {
|
||||
"pending": "investigating",
|
||||
"approved": "resolved",
|
||||
"rejected": "rejected",
|
||||
"expired": "expired",
|
||||
}
|
||||
|
||||
# Incident 狀態 → 是否活躍
|
||||
INCIDENT_ACTIVE_STATUSES = frozenset({"investigating", "mitigating"})
|
||||
Reference in New Issue
Block a user