feat(harness): Git Bash + graceful degradation for Windows agentic bridge

Wide-deployment Windows path without WSL2. The agentic bridge already runs
on native Python + PowerShell; the only bash dependency is the H4/H2 gate
scripts, which run under Git Bash (Git for Windows) — much lighter than WSL2.

- h4_scan now returns a status (ok|blocked|timeout|unavailable). Timeout stays
  FAIL-CLOSED (block/deny). "unavailable" (no bash / gate missing) DEGRADES the
  turn to observed_only and does NOT block the developer — never silently
  certifies without a working gate.
- bash interpreter is configurable via CASAN_AGENTIC_BASH; gates use it.
- doctor reports bash_available / gates_runnable + a remediation warning, and
  stays green (degraded, not failed) when bash is absent.
- tests: +4 no-bash cases (degrade to observed_only, tool still allowed,
  non-certified finalize, injection still blocked when bash present). 34/34.
- docs: Windows guide + security guide now point to Git Bash, not WSL2, and
  document the timeout-vs-unavailable distinction.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
thanhnv
2026-07-23 20:52:02 +07:00
co-authored by Claude Opus 4.8
parent 4bb184b935
commit f6d28a3163
4 changed files with 141 additions and 23 deletions
@@ -35,6 +35,16 @@ UI và export H6 **không** được gộp bốn mức trên thành một nhãn
Nếu bất kỳ điều kiện nào thiếu → turn là **non-certified**. Bridge fail-closed:
khi không quyết định được trong internal timeout → block/deny.
**Phân biệt timeout vs gate-unavailable (graceful degradation):**
- **Timeout** (gate tồn tại nhưng không trả lời kịp) → **fail-closed**: block prompt
/ deny tool. Coi như có thể có rủi ro.
- **Gate không chạy được** (ví dụ Windows không có `bash`/Git Bash) → **degrade**:
turn bị hạ cấp `observed_only`, **không certify**, nhưng **không chặn** developer.
Đây là thực tế triển khai, không phải tấn công. CASAN không bao giờ certify âm
thầm khi H4/H2 không chạy, và cũng không biến việc thiếu bash thành lý do chặn
mọi prompt. Cài Git Bash để bật lại certification.
## 3. Những gì CASAN KHÔNG hứa
- **Không** chặn được mọi prompt trong mọi AI extension bên thứ ba.