Add selectable CASAN IDE integrations

This commit is contained in:
thanhnv
2026-07-23 23:04:54 +07:00
parent ff4e9d5a53
commit ce708fafe5
28 changed files with 1658 additions and 407 deletions
@@ -8,9 +8,9 @@ carries an H1→H7 trace and an H6 record.
- The hook command resolves the repo root via `$CLAUDE_PROJECT_DIR`, so **no
machine-specific path is committed**.
- It invokes `packages/casan-harness/adapters/claude-code/claude_hook.py`, a thin
renderer that calls the core bridge. The bridge **never runs a model** — Claude
remains the sole model executor (single-model invariant).
- It invokes `.casan/casan-hook.py`. That bootstrap reads project config,
resolves the pinned global harness, verifies its live hash, then dispatches
the thin Claude renderer. The bridge **never runs a model**.
- This is a **`project_hook`** integration: strong for a trusted project, but a
member who can edit `.claude/settings.json` can disable it. For organization
enforcement use a managed/pinned deployment (`managed_hook`) — see
@@ -19,18 +19,16 @@ carries an H1→H7 trace and an H6 record.
## Install (cross-platform)
```bash
packages/casan-devkit/install.sh --target <repo> --project <id>
# then enable the agentic client hooks:
cp packages/casan-devkit/templates/claude/settings.json <repo>/.claude/settings.json
cd <repo>
casan init --client claude --mode enforce
casan doctor --client claude
```
Windows: use `packages/casan-devkit/windows/install-agentic.ps1 -Client claude`.
## Feature flags (environment)
| Variable | Default | Meaning |
|---|---|---|
| `CASAN_AGENTIC_BRIDGE_ENABLED` | `1` | Master on/off. |
| `CASAN_AGENTIC_ENFORCEMENT_MODE` | `observe` | `observe` (telemetry-only, never certified) → `enforce` (gates + certification). |
| `CASAN_AGENTIC_ENFORCEMENT_MODE` | `enforce` via init | `observe` (telemetry-only) or `enforce`. |
| `CASAN_AGENTIC_INTEGRATION_MODE` | `project_hook` | `project_hook` / `managed_hook` / `casan_owned`. |
| `CASAN_AGENTIC_CLIENT_ALLOWLIST` | (unset) | Comma list; clients outside it are `observed_only`. |