Commit Graph

563 Commits

Author SHA1 Message Date
OG T
962b1e75a5 refactor: Rename ClawBot → OpenClaw across documentation
- Update .awoooi-agent-rules.md (4 occurrences)
- Update docs/api/openapi.yaml (all schema references)
- Update apps/web/tailwind.config.ts (comment)
- Update apps/api/src/core/config.py (comment)

Legacy CLAWBOT_URL field kept for backward compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 14:05:53 +08:00
OG T
b0302329f4 fix(web): Pass decision prop to DualStateIncidentCard
Root cause: mapToDualState() was missing decision field,
causing Y/n buttons to be permanently disabled.

Now correctly passes incident.decision to the card component.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 13:54:42 +08:00
OG T
0aaf6a276b feat(api,web): Phase 6.5 DecisionManager with dual-engine fallback
Backend:
- Add DecisionManager with state machine (INIT→ANALYZING→READY→EXECUTING)
- Implement Expert System rules engine (100% local, never fails)
- Dual-engine: LLM (primary) + Expert System (fallback)
- Auto-generate decision_token for each incident
- 30-second timeout guarantee

Frontend:
- Use decision.state to unlock [Y/n] buttons
- Display AI action suggestion in card
- Show source indicator [AI] or [EXP]
- Generate proposal on-demand if needed

Fixes: UI locked with hourglass when LLM times out

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 13:19:55 +08:00
OG T
c01742ef82 fix(web): Phase 6.5c+ enhance [Y/n] tactile feedback & diagnostics
- Add active:scale-95 active:bg-neutral-800 for physical click feedback
- Add disabled:opacity-30 for clearer disabled state
- Add tooltip "大腦分析中..." when proposalId is missing
- Add comprehensive console.log diagnostics for authorization flow
- Add reason parameter "Authorized via WarRoom" for audit trail
- Implement optimistic UI with immediate loading state transition

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 13:07:10 +08:00
OG T
7db5108a1f feat(web): Phase 7.0 minimalist 5-pillar navigation
- Refactor sidebar to Nothing.tech visual compliance
- Add defensive route stubs for /authorizations, /knowledge-base, /settings
- Dynamic badge for pending approvals count
- Ultra-minimal borders (0.5px), no shadows

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 13:02:21 +08:00
OG T
28fa8e6af4 feat(web): Phase 6.5c implement [Y/n] execution wiring
DualStateIncidentCard:
- Add proposalId prop for approval actions
- Add onApprovalChange callback for status updates
- Implement handleApprove() calling POST /api/v1/approvals/{id}/sign
- Implement handleReject() calling POST /api/v1/approvals/{id}/reject
- Add ButtonState management (idle/loading/approved/rejected/error)
- Loading spinner during API call
- Success state: green "已授權" / red "已拒絕"
- Error state: orange "錯誤" with auto-recovery

API Client:
- Fix endpoint mismatch: rename approveApproval to signApproval
- Use correct endpoint /sign instead of /approve
- Add signer parameter for multi-sig support

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 12:37:56 +08:00
OG T
be8ed1f7ba fix(web): resolve interface mismatch + add defensive null checks
- P0/P1/P2 now map to 'alert' status (was P0/P1 only)
- Tier mapping: P0=Tier3, P1=Tier2, P2=Tier1
- Added null/undefined guards in mapToDualState()
- Optional chaining on incidents array access
- Safe fallback for missing serviceName, message, timestamp

Fixes frontend warroom showing no cards despite API returning data.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 12:17:58 +08:00
OG T
cb5d0ecfe4 feat(phase-6.4g-6.5b): API Synaptic Integration + Dual-State WarRoom UI
Phase 6.4g (API 突觸對接):
- lewooogo-brain dependency binding in apps/api/pyproject.toml
- POST /api/v1/incidents/{id}/propose route (proposals.py)
- Guardrails integration (8/8 tests passed)

Phase 6.5a (視覺皮層建置):
- DualStateIncidentCard.tsx with Nothing.tech visual compliance
- Ping radar animation for alert state
- Tier-based decision layer UI (AI 執行中 / 等待親核)

Phase 6.5b (神經網路串接):
- Main warroom page integration (page.tsx)
- IncidentResponse → DualState mapper function
- Empty state: "系統穩定。0 活躍異常。"

Tests:
- test_guardrails.py (8/8)
- test_incident_engine.py (6/6)
- test_skill_loader.py (6/6)
- Frontend build: 0 errors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 11:58:28 +08:00
OG T
68f4cf51b6 fix(web): resolve approval card race condition with polling
Race condition between polling (5s interval) and sign/reject operations
caused cards to flicker and reappear after being approved.

Fix:
- Pause polling during sign/reject API calls
- Resume polling after 1 second delay to allow backend state sync
- Apply same pattern to both signApproval and rejectApproval

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 09:13:35 +08:00
OG T
1c66a05335 feat(qa): add Playwright frontend visual verification script
- Create apps/web/scripts/verify-frontend.js (無頭偵察兵)
- Detects Console errors (zero-error policy)
- Verifies DOM content (INC-*, RPS, Latency)
- Takes full-page screenshot for evidence
- Update SRE Skill with mandatory verification step

Constitutional Law 14/15: No curl-only verification allowed!

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 01:19:08 +08:00
OG T
cc9c9366e7 fix(web): skip ESLint/TypeScript during Docker build
CI/CD 分離策略:
- ESLint 在獨立 lint job 執行
- TypeScript 在獨立 type-check job 執行
- Build 時跳過以加速 Docker 建置

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 19:06:29 +08:00
OG T
196d269b92 feat: add all application source code
- apps/api: FastAPI backend with Dockerfile
- apps/web: Next.js frontend with Dockerfile
- apps/sensor: Signal collection agent
- packages: shared packages

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 18:57:44 +08:00
OG T
ccdf757edd chore: initial commit for AWOOOI project
Phase 0 Day 1 - Project initialization:
- Independent repository (Option A)
- .awoooi-agent-rules.md (AI development contract)
- Project skeleton (apps/web, apps/api, packages, docs)
- ADR template for architecture decisions
- LOGBOOK for progress tracking

Strategic decision: 2026-03-19 Operation Cyber-Shell
Reference: /wooo-aiops/docs/meetings/2026-03-19_FRONTEND_RESTRUCTURE_STRATEGY.md

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-03-19 19:16:12 +08:00