Files
CASAN/optimize-docs/video-steps
thanhnvandClaude Fable 5 da66a36f97 feat(h6): AgentOps hardening — live alerting, provider-API reconcile, hosted dashboard, window breaker (79→80)
Close the three gaps the scoring report itself flagged for H6 plus V15,
each as a real MVP + fail-able adversarial test (same pattern that lifted H5):

- D1 alert-dispatch.sh: alerts POST to a real HTTP webhook (severity routing,
  dedup window, retry) + dead-letter queue with redelivery; fail-loud in strict.
  Wired into agent-metrics.sh so a failing step pages live end-to-end.
- D2 provider-usage-fetch.sh + telemetry-reconcile.sh: pull usage from a provider
  usage HTTP API (all-or-nothing schema gate, fail-loud) + reconcile local vs
  provider ground truth — token under-reporting/hidden runs => TELEMETRY_DISCREPANCY.
- D3 dashboard-serve.sh + dashboard-server.py: serve the dashboard over HTTP with
  a stale-aware /healthz probe (fresh=200 ok, telemetry silent-death=503 stale).
- D4 circuit-breaker-check.sh: sliding-window failure-rate breaker (V15) — interleaved
  successes no longer evade the consecutive-failure breaker (CIRCUIT_OPEN_WINDOW).

New suite phase-h6-agentops-tests.sh: 20/20, all live against local HTTP endpoints
(webhook sink, mock provider API, dashboard server) — deterministic, no model needed.

Also fix sign-policy-bundle.sh key-sync invariant: the local-fallback branch only
exported policy-public.pem when generating a NEW key, so a Vault-DOWN run after a
Vault-signed run verified a local-key signature against the Vault pubkey (RSA padding
error, run-casan4 died mid-suite). Now always re-exports the pubkey before signing —
same fix class as tool-audit-lib.sh / governance-check.sh.

Full battery re-run sequentially: 175/175 PASS, 0 FAIL across 8 suites
(KMS SKIP this run — Vault down; validated live 2026-07-04). Docs synced:
scoring-run-report (H6 79→80, no harness below 80, 155→175), CASAN_HARDENING_STATUS
(Phase 5 D1–D4), Plan-07, submission README, and run-hardening.sh (H6+ scenes HO1–HO4).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 01:14:46 +09:00
..

CASAN — Bộ dựng Video Evidence (H4 · H5 · H6)

⚡ Cách nhanh nhất: chạy 1 script từ đầu đến cuối

run-all.sh gộp TẤT CẢ vector — tới bước nào tự in title card + mô tả + lệnh + exit code ngay trong terminal (chính là "text hiển thị"), rồi dừng chờ Enter.

cd <thư mục gốc dự án có .specify/>          # vd: AINative_OKR_CASAN5
bash /…/optimize-docs/video-steps/run-all.sh   # MẶC ĐỊNH: tự chạy, dừng 5s/bước rồi tiếp
STEP_DELAY=8 bash /…/run-all.sh                 # đổi thời gian dừng mỗi bước
AUTO=0     bash /…/run-all.sh                   # chuyển sang bấm Enter thủ công
  • Tự phát hiện Ollama: tunnel sống → chạy A3/A8/D4; không → in "SKIP" có ghi chú.
  • Đã chạy thật & xác nhận offline + Ollama (2026-07-02): mọi exit code khớp mô tả.
  • Bước cuối CHẤM ĐIỂM THẬT bằng scorecard.sh: mỗi mục checklist H4/H5/H6 gắn 1 gate fail-able chạy live → (✅/5)×100, ra bảng H1–H7 + Average + CASAN Level. Kết quả chạy hiện thời: H4 20→100 · H5 25→100 · H6 30→100 · Avg 58→90 · Level 4 — Automated. (Con số đáng tin là SỐ TEST ĐỐI KHÁNG PASS — điểm 0–100 chỉ là quy đổi; chạy scorecard.sh để ra số hiện thời, đừng chép cứng.)
  • Bố trí màn hình / cửa sổ terminal (tmux 2 pane + bản đồ sống nhấp nháy) → xem LAYOUT.md. Khởi động nhanh: start-tmux.sh.

Bộ tài liệu quay màn hình, tách theo từng bước (dùng khi muốn quay lẻ từng cảnh). Video chỉ có hình + text mô tả (không lồng tiếng) — nên mỗi bước có sẵn 3 thành phần:

File Dùng để làm gì
commands.sh Lệnh copy-paste chạy trên terminal khi quay màn hình
screen-text.md Text hiển thị trên màn hình (title card / caption ngắn — chèn overlay)
script.md Lời mô tả/thuyết minh dạng text (chèn lower-third / khung mô tả)

Thứ tự dựng (trọng tâm chấm điểm)

Cụm Thư mục Bước Thời lượng gợi ý
Chuẩn bị 00-preflight/ môi trường + tunnel Ollama ngoài video
⭐ H4 Security H4-Security/ A1 → A9 (9 vector — thêm A9 secret ở đầu ra) ~5:45
⭐ H5 Governance H5-Governance/ B1 → B8 (8 vector — thêm B6 SoD, B7 least-priv, B8 rate-limit) ~5:00
⭐ H6 AgentOps H6-AgentOps/ D1 → D6 (6 vector — thêm D6 hallucination rate) ~3:00
🔥 Cross-layer CHAIN-cross-layer/ showpiece MAESTRO ~1:15
🏭💰 Pipeline + Money-shot (REAL=1) STEP1 qua wrapper thật + cost-spike trên token đo THẬT ~1:30

Quy ước quay (áp dụng mọi bước)

  1. Luôn để exit code on-screen — mọi lệnh kết thúc bằng echo "exit=$?".
  2. Mỗi bước bắt đầu bằng title card (lấy từ screen-text.md), rồi chạy lệnh, rồi hiện caption kết quả.
  3. script.md là văn bản mô tả — dán làm phụ đề/khung mô tả trong lúc lệnh chạy.
  4. cwd = thư mục gốc dự án (AINative_OKR_CASAN5/, nơi có .specify/). Trong môi trường quay Docker thì là cd casan5/AINative_OKR_CASAN5.
  5. Vector cần Ollama live: chỉ A3, A8, D4 → bật SSH tunnel trước (xem 00-preflight/). Còn lại chạy offline vẫn xanh.
  6. Cảnh KHÔNG được cắt (highlight): A5 (indirect), B1 (tamper), B6 (tự-duyệt bị chặn), D1 + money-shot (cost-spike token thật), CHAIN.
  7. Nên chạy kèm asciinema rec để giám khảo replay terminal thật.

Nguyên tắc nội dung

"Mọi con số là kết quả chạy thật, có exit code on-screen; con số nào chưa tự đo thì nói rõ nguồn — không suy diễn."

  • Điểm = thứ chứng minh được bằng tấn công, không phải thứ khai báo.
  • Harness thấp nhất quyết định trần → nâng đúng 3 harness từng là GAP: H4=20, H5=25, H6=30.