Add selectable CASAN IDE integrations
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
> Ngày lập: 2026-07-22
|
||||
> Cập nhật: 2026-07-23
|
||||
> Trạng thái: **IMPLEMENTED (Wave 0 + Wave 1 core) — bridge, adapters, tests, devkit, docs đã ship và xanh; Codex/VS Code black-box trên client thật còn CONDITIONAL**
|
||||
> Trạng thái: **IMPLEMENTED + Plan-21 hardening — Claude black-box verified; Codex current hook schema + trust onboarding implemented; VS Code `@casan` packaged, host black-box còn CONDITIONAL**
|
||||
> Thứ tự bắt buộc: **Claude Code → Codex → Claude/Codex trên VS Code**
|
||||
|
||||
Kết quả khảo sát và test matrix: [CASAN Spike-20](../spikes/CASAN_SPIKE_20_AGENTIC_CLIENT_HOOKS.md).
|
||||
@@ -310,14 +310,16 @@ nguồn), **certification strength** (bốn mức, không gộp).
|
||||
| Bridge state machine (20.0.2/0.3/0.4) | `packages/casan-harness/scripts/python/agentic_bridge.py` (stdlib-only, Py3.9+) | ✅ |
|
||||
| Claude Code adapter (20.1.1–20.1.3) | `packages/casan-harness/adapters/claude-code/` (`claude_hook.py`, `settings.template.json`) | ✅ |
|
||||
| Codex adapter (20.3.1/0.2) | `packages/casan-harness/adapters/codex/` (`codex_hook.py`, `hooks.template.json`, `config.template.toml`) | ✅ mapping defensive, chờ pin trên client thật |
|
||||
| Threat + acceptance suite (20.0.5/1.6) | `packages/casan-harness/tests/phase-agentic-bridge-tests.sh` | ✅ **30/30 PASS** (C1–C12 + threat) |
|
||||
| Threat + acceptance suite (20.0.5/1.6) | `packages/casan-harness/tests/phase-agentic-bridge-tests.sh` | ✅ **37/37 PASS** (C1–C12 + threat + adapters) |
|
||||
| DevKit templates + Windows installer (Wave 5) | `packages/casan-devkit/templates/{claude,codex}/`, `packages/casan-devkit/windows/install-agentic.ps1` | ✅ (install/doctor/uninstall + manifest) |
|
||||
| Global project bootstrap | `.casan/casan-hook.py` from `packages/casan-devkit/templates/project/` | ✅ auto-load config + live pin verify |
|
||||
| VS Code/Copilot explicit route | `packages/casan-harness/adapters/vscode/extension/`, `adapters/vscode/` | ✅ packaged dependency-free VSIX; `@casan` only |
|
||||
| Docs Windows + Security/bypass | `docs/casan/CASAN_AGENTIC_CLIENTS_WINDOWS.md`, `docs/casan/CASAN_AGENTIC_CLIENT_SECURITY.md` | ✅ |
|
||||
| H6 provenance + report filter (20.0.4) | superset record trong bridge + `agentic_bridge.py report --client/--integration-mode/--trace-id/--project-id` | ✅ null-not-zero, filter được |
|
||||
|
||||
### Ánh xạ exit gate (mục 8)
|
||||
|
||||
- ✅ 100% test lifecycle fixtures pass (30/30).
|
||||
- ✅ 100% test lifecycle fixtures pass (37/37).
|
||||
- ✅ 100% side-effect test bị deny khi thiếu admission (C4, cross-project, expired, traversal).
|
||||
- ✅ Không có double model execution (invariant test trên nguồn bridge).
|
||||
- ✅ Timeout/hook failure tạo non-certified + H6 failure (C6, abort).
|
||||
@@ -327,9 +329,12 @@ nguồn), **certification strength** (bốn mức, không gộp).
|
||||
|
||||
### Còn CONDITIONAL (đúng theo phạm vi Spike-20, chưa đóng)
|
||||
|
||||
- **Codex payload keys**: adapter đọc nhiều alias phòng thủ; cần pin trên Codex thật (Wave 3.1).
|
||||
- **VS Code / extension**: chưa black-box trên client thật; `@casan` Chat Participant (Wave 4)
|
||||
chưa hiện thực — vẫn giữ badge `unsupported` cho tới khi có evidence độc lập.
|
||||
- **Codex host trust**: schema đã pin theo current Codex manual; project hook
|
||||
chỉ load sau project + exact-hook-hash trust qua `/hooks`, nên clean untrusted
|
||||
black-box phải giữ `pending_trust`, không giả `verified`.
|
||||
- **VS Code / extension host**: `@casan` Chat Participant đã hiện thực và đóng
|
||||
gói VSIX; môi trường phát triển hiện không có `code` CLI để black-box extension
|
||||
host. Built-in Copilot vẫn `unsupported_global_interception`.
|
||||
- **Windows exit-gate smoke**: cần chạy `install-agentic.ps1` trên clean Windows clone.
|
||||
|
||||
### Quyết định thiết kế cần lưu
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# CASAN Plan-21 — Hybrid Global Install + `casan init`
|
||||
|
||||
> Ngày lập: 2026-07-23
|
||||
> Trạng thái: **IMPLEMENTED — global install + `casan init` + pin/verify + level-aware + merge-safe (41/41 test)**
|
||||
> Trạng thái: **IMPLEMENTED + HARDENED — global install + selectable IDE init + pinned global bootstrap + VS Code `@casan` + merge-safe (60/60 hybrid acceptance)**
|
||||
> Liên quan: [Plan-20](CASAN_PLAN_20_AGENTIC_CLIENT_INTEGRATION.md) (adapter/hook là base phổ quát), [CASAN_INSTALL_HYBRID.md](../casan/CASAN_INSTALL_HYBRID.md)
|
||||
|
||||
## 1. Mục tiêu
|
||||
@@ -27,7 +27,7 @@ harness global thao tác đúng trên state của dự án hiện tại.
|
||||
## 3. Pin + Verify (giữ đảm bảo Plan-16 khi harness ở ngoài repo)
|
||||
|
||||
- Installer tính **hash toàn vẹn gate-code** (`scripts/bash`, `scripts/python`,
|
||||
`security`, `level5`) và ghi `.harness-hash`.
|
||||
`security`, `level5`, `adapters`, `schemas`) và ghi `.harness-hash`.
|
||||
- `casan init` **pin** version + hash vào `.casan/version.lock`.
|
||||
- `casan verify-harness` **tính lại live** từ file thật và so với pin → phát hiện
|
||||
drift/tamper (rc 3). Không tin hash cache.
|
||||
@@ -42,7 +42,7 @@ harness global thao tác đúng trên state của dự án hiện tại.
|
||||
| Integrity hash primitive | `packages/casan-harness/scripts/python/harness_hash.py` |
|
||||
| `casan init` / `verify` | `packages/casan-devkit/casan-init.py` |
|
||||
| CLI wiring | `bin/casan` (`init`, `verify-harness`) |
|
||||
| Acceptance suite | `packages/casan-devkit/tests/hybrid-install-tests.sh` — **41/41 PASS** |
|
||||
| Acceptance suite | `packages/casan-devkit/tests/hybrid-install-tests.sh` — **60/60 PASS** |
|
||||
| Adoption doc | `docs/casan/CASAN_INSTALL_HYBRID.md` |
|
||||
|
||||
### Level selection (4 packaging levels) & safe adoption
|
||||
@@ -52,10 +52,17 @@ harness global thao tác đúng trên state của dự án hiện tại.
|
||||
`.casan-level`; launcher self-locates its own install (no cross-home talk).
|
||||
- `casan init --level 1..4`: L1 = gate + Plan-20 hooks only; L2 = + CI workflow +
|
||||
domain-pack; L3 = L2 base + preview note; L4 = refused. `casan level show`/`set`.
|
||||
- `casan init` trên TTY hiển thị menu chọn `claude`, `codex`,
|
||||
`vscode-copilot`; automation dùng repeatable/comma-separated `--client`.
|
||||
- **Merge, not clobber:** `init` merges Plan-20 hooks into an existing
|
||||
`.claude/settings.json` / `.codex/{hooks.json,config.toml}` idempotently,
|
||||
preserving the project's own hooks/agents/skills. Never re-indexes or rewrites
|
||||
the project shell.
|
||||
`.claude/settings.json` / `.codex/hooks.json` idempotently, preserving the
|
||||
project's own hooks/agents/skills. Legacy CASAN-only TOML blocks are removed
|
||||
precisely; user TOML is preserved. Never re-indexes or rewrites the project shell.
|
||||
- **Global-hook bootstrap:** hook chỉ gọi `.casan/casan-hook.py`; bootstrap tự
|
||||
load enforcement config, resolve harness global và verify live hash trước khi
|
||||
dispatch. Không còn đường dẫn sai `packages/casan-harness` trong consumer repo.
|
||||
- **VS Code/Copilot:** build/install dependency-free VSIX đóng góp explicit
|
||||
`@casan` Chat Participant. Built-in Copilot không bị claim là global-intercept.
|
||||
- **Source-hub guardrail:** `init` refuses to adopt a CASAN source hub into itself
|
||||
(would block the developing agent); `--force` overrides.
|
||||
|
||||
@@ -65,6 +72,11 @@ harness global thao tác đúng trên state của dự án hiện tại.
|
||||
- ✅ `casan init` ghi CHỈ config per-project; **không** copy harness.
|
||||
- ✅ `version.lock` pin đúng hash; `verify-harness` ok khi sạch, drift (rc 3) khi tamper.
|
||||
- ✅ Bridge Plan-20 chạy qua harness global, state ghi vào `.specify` của dự án.
|
||||
- ✅ Generated Claude/Codex commands được acceptance test thực thi end-to-end
|
||||
qua harness global; Codex template dùng current nested command-hook schema.
|
||||
- ✅ `casan doctor` kiểm tra pin/bootstrap/client smoke/VS Code extension state.
|
||||
- ✅ Claude Code 2.1.197 black-box: prompt injection bị UserPromptSubmit hook
|
||||
chặn, `duration_api_ms=0`, token/cost = 0.
|
||||
- ✅ Project id mặc định theo tên thư mục, được sanitize.
|
||||
|
||||
## 6. Còn lại / bước tiếp
|
||||
|
||||
Reference in New Issue
Block a user