update doc and optimize

This commit is contained in:
thanhnv
2026-07-06 17:47:12 +09:00
parent ace442da0e
commit 4419cd9eae
95 changed files with 2951 additions and 1353 deletions
+14 -3
View File
@@ -7,6 +7,10 @@
>
> Labels: **[implemented+tested]** · **[scaffold+tested]** (works, but a stronger
> production form is documented as TODO) · **[planned]** (not built).
>
> **Vai trò file (single source of truth):** file này là **nguồn chuẩn cho "control
> nào đã implement+test"**. "Còn gì phải làm" → `CASAN_BACKLOG_STATUS.md` (có legend
> chuẩn + ánh xạ nhãn). Mục lục plan → `CASAN_PLAN_00_INDEX.md`.
## 1. What is implemented now
@@ -62,7 +66,7 @@
| C6 | **TRUE runtime isolation (V22)**: container sandbox (`--network=none --read-only --pids-limit --cap-drop=ALL`, workspace-only mount) — the kernel neutralises host-file reads / egress / out-of-workspace writes; upgrades the static scaffold | [implemented+tested] (live via Docker; skip-aware) | `sandbox-container.sh`, `sandbox-run.sh` (`CASAN_SANDBOX_MODE=container`) | phase-c6-sandbox (6) |
| B2 | **Split + classifier injection (V5,V6)**: `context-assemble-scan.sh` scans the concatenated context so a payload split across benign pieces is caught on assembly; verdict-steering patterns (PI-CLS-*) block content that tries to hijack the evaluator | [implemented+tested] | `context-assemble-scan.sh`, `prompt-filter.yaml` (PI-CLS-*) | phase-h4-split-inject (8) |
| B4 | **Model-digest pinning (V16)**: approved Ollama model digest pinned; router verifies live digest before generation/classify/judge; mismatch blocks by default with warn mode for rollout | [implemented+tested] | `model-digest-check.sh`, `model-call.py`, `.specify/security/model-digest.pin` | phase3-model-router (digest cases) |
| Plan-10 | **Traceability REQ→code→test MVP**: parse `FR-*`, require code+test mapping per FR, generate matrix, and include it in Evidence Pack | [implemented+tested] | `traceability-matrix.py`, `.specify/traceability-map.json`, `docs/output/casan/traceability-matrix.json` | phase10-traceability (3) |
| Plan-10 | **Traceability REQ→code→test**: parse `FR-*`, require code+test mapping per FR, generate matrix, include it in Evidence Pack, **plus symbol/line-level refs** (object form `{file,symbols,lines}`; missing symbol/line ⇒ gate FAIL) | [implemented+tested] | `traceability-matrix.py`, `.specify/traceability-map.json`, `docs/output/casan/traceability-matrix.json` | phase10-traceability (6) |
### Phase 7 — Local production-like infra lab (Tier-2 emulation) — [implemented+tested]
@@ -86,9 +90,16 @@
| `phase-h4-multilingual-tests.sh` | 7 | **New** — VI/JA injection block + benign VI/JA 0-FP (B1) |
| `phase-c6-sandbox-tests.sh` | 6 | **New** — TRUE container isolation (C6, live via Docker / skip-aware) |
| `phase-h4-split-inject-tests.sh` | 8 | **New** — split-injection assembly scan + classifier-inject (B2) |
| `phase10-traceability-tests.sh` | 3 | **New** — Plan-10 FR→code→test matrix + fail-able missing-test gate |
| `phase10-traceability-tests.sh` | 6 | **New** — Plan-10 FR→code→test matrix + fail-able missing-test gate + **symbol/line-level** refs (missing symbol/line ⇒ FAIL) |
| `phase08-compression-tests.sh` | 9 | **New** — Plan-08 CASAN-native token-killer: dedup/extractive/structural + must-keep preserve + tee raw-passthrough + fail-able must-keep gate + **settings-govern-harness** (compression.enabled) |
| `phase-control-plane-tests.sh` | 9 | **New** — Plan-13 harness-owned governed settings: deny-by-default + approval gate + versioning/rollback + audit hash-chain tamper detection + effective-setting resolver |
| `phase-rbac-tests.sh` | 12 | **New** — Plan-14 harness-owned RBAC: deny-by-default + action gating + tenant isolation + sensitive-requires-org-admin + Separation of Duties + IdP-claim→role mapping |
| `phase-rai-tests.sh` | 12 | **New** — Plan-15 harness-owned Responsible AI & Data Governance: data classification + PII→cloud denial without approval + model-card enforcement + retention gate/purge-audit + RAI aggregate report |
| `phase-selfimprove-tests.sh` | 7 | **New** — Plan-04 self-improve core: telemetry→proposal (dry-run) + apply-requires-approval + governed-store application + sensitive-needs-approval |
| `phase-governance-report-tests.sh` | 5 | **New** — Plan-09 tie-in: unified governance evidence report (traceability+RBAC+RAI+audit+self-improve) + certified-run gate (tampered audit ⇒ NOT_CERTIFIED) |
| `phase-preflight-tests.sh` | 5 | **New** — Plan-15/13 enforcement wiring: harness preflight blocks PII→cloud without approval BEFORE the model call; `model-router` honors `CASAN_PREFLIGHT` (opt-in, short-circuits) |
| `phase-prod-infra-lab-tests.sh` | 2 | **New optional/local-prod** — Docker Compose infra lab starts + verifies Vault/IdP/MinIO/dashboard/alert/billing |
| **Total** | **218 core + 2 local-prod infra lab** | Baseline 79 preserved; +139 new hardening/traceability checks. Last full harness run 2026-07-06, 0 fail. Direct `phase3-model-router-tests.sh` adds 11/0 including deterministic cloud provider parser coverage; `infra-lab verify` adds 7 internal infra checks. |
| **Total** | **280 core + 2 local-prod infra lab** | Baseline 79 preserved; +201 new checks across traceability/compression/control-plane/RBAC/RAI/self-improve/governance-report/preflight (phase10 3→6; phase08 7→9; phase-control-plane 7→9; phase-rbac 10→12; phase-rai 9→12; +7 phase-selfimprove; +5 phase-governance-report; +5 phase-preflight). Full-suite green xác minh trên CI/Mac có Ollama+Docker; các suite deterministic mới verify **trong WSL** (msys+Python Windows lệch path). Preflight wiring là opt-in (`CASAN_PREFLIGHT` default off) ⇒ không đổi luồng model cũ. Direct `phase3-model-router-tests.sh` adds 11/0 including deterministic cloud provider parser coverage; `infra-lab verify` adds 7 internal infra checks. |
Run order note: `run-casan4-harness-tests.sh` does `rm -rf .specify/logs`, so run it
**first** and never concurrently with the other suites.