feat: add governed chat console

This commit is contained in:
thanhnv
2026-07-08 21:14:40 +09:00
parent 3be9970c15
commit 5561bcf864
28 changed files with 2023 additions and 43 deletions
+16 -2
View File
@@ -7,7 +7,7 @@ harness-owned governance CLI; the UI never writes harness files directly or bypa
```
backend/ NestJS API (/api/v1 + /healthz) over .specify telemetry + governed settings
frontend/ React + Vite + Tailwind + TanStack Query Ops Console + Settings/Approvals/Kill-switch/FinOps/Command pages
frontend/ React + Vite + Tailwind + TanStack Query Ops Console + Settings/Approvals/Kill-switch/FinOps/Command/Chat pages
```
## Run (local)
@@ -56,6 +56,20 @@ Approval inbox / HITL:
- `POST /api/v1/approvals/decide` — approve/reject with SoD and reason; approved
settings proposals apply through `control-plane-settings.py`.
Governed Chat (Plan-18 MVP-0/1):
- `POST /api/v1/chat/ask` — Ask CASAN endpoint. The API only wraps harness
`chat-turn.py`; router verdicts, H4 input/output scan, action-gate decisions,
H5 chat audit, H6 token metrics, evidence source selection, and operator action
execution remain harness-owned.
- `GET /api/v1/chat/actions` — list registered operator actions from
`operator-actions.yaml`; no free-command execution is exposed.
- `GET /api/v1/chat/audit/verify` — verifies the chat audit hash chain.
- `/chat` UI shows actor/role scope, `mode/risk/decision` badges, certified answer,
evidence sources, registered operator actions, action-gate status, router details,
and audit hash. Side-effect requests outside registered actions return governed
`BLOCK` or `NOT_SUPPORTED` responses.
FinOps/SLO:
- `/finops` UI reads `GET /api/v1/cost` plus `GET /api/v1/settings`.
@@ -77,7 +91,7 @@ the same harness engine.
## Test
```bash
npm run console:test # backend telemetry/settings/approvals/kill-switch/auth mapping/command contract
npm run console:test # backend telemetry/settings/approvals/kill-switch/auth mapping/command/chat contract
npm run console:build # backend tsc + frontend typecheck/vite build
```