QA and context compress

This commit is contained in:
thanhnv
2026-07-29 18:53:08 +07:00
parent 7f01cf980a
commit 8b477f3800
48 changed files with 4208 additions and 119 deletions
@@ -2,13 +2,19 @@
> Năng lực **nén prompt/context để giảm token · latency · cost** — nhưng **không phá governance**.
>
> Status 2026-07-06: **🟡 Track 3 MVP implemented + tested (CASAN-native token-killer).**
> `packages/casan-harness/scripts/bash/context-compress.py` — compressor deterministic của CASAN
> (KHÔNG dùng lại RTK): modes `dedup`/`extractive`/`structural`, must-keep luôn giữ,
> tee raw-passthrough khi lệnh fail, báo `token_saved`/`ratio`, và gate must-keep
> fail-able. Test `packages/casan-harness/tests/phase08-compression-tests.sh` **7/0 (WSL)**; đã nối
> vào `ci-harness-gate.sh` (`phase08-compression`). Còn: Track 1 nén INPUT + Track 2
> nén VIEW liên-bước + Track 4 abstractive (gated) + nối H4/H5 scan/hash trong pipeline thật.
> Status 2026-07-29: **🟡 Track 3 hardened + regression-tested (CASAN-native token-killer).**
> `packages/casan-harness/scripts/bash/context-compress.py` — compressor deterministic của CASAN
> (KHÔNG dùng lại RTK): modes `dedup`/`extractive`/`structural`; nhận diện severity
> `[ERR]/[WRN]`; giữ multiplicity của warning/must-keep; invalid regex/input rỗng sau nén
> đều fail-closed; preservation fail mặc định trả RAW + exit 1; có lựa chọn `halt`; JSON
> evidence bind SHA-256 raw/candidate/output và ghi rõ `whitespace_estimate` khác provider
> telemetry. Test `packages/casan-harness/tests/phase08-compression-tests.sh` **19/0 (macOS)**;
> SEC-09 **7/0**; loop consumer **16/0**; đã nối `ci-harness-gate.sh`
> (`phase08-compression`). Log thật NEHOPS `analyzer-20260507.log` đo **1.620 → 76
> whitespace-estimate units**, giữ đủ **4/4 `[WRN]`**, preservation pass; con số này vẫn
> **không phải provider token saving claim** cho đến khi qua H3 end-to-end/A-B. Còn:
> Track 1 nén INPUT + Track 2 nén VIEW liên-bước + Track 4 abstractive (gated) + nối
> H4 scan raw/compressed và H5 audit binding trong pipeline thật.
>
> Nhãn: [có] tồn tại thật · [đo] đã kiểm chứng · [mới] cần làm · [chưa tự động] có đo/người quyết.
> Phụ thuộc: **01** (đường dẫn sau restructure) · **07** (thứ tự scan/audit an toàn, V19/V5) · **03** (chế độ abstractive dùng model).