Files
CASAN/docs/plans/CASAN_PLAN_06_ONBOARD.md
T
thanhnvandClaude Opus 4.8 4918012199 docs(plans): sync roadmap status + paths to post-restructure state
- Plan-01 marked ✅ DONE (INDEX table + P3 tier + BACKLOG row + plan header).
- Plan-06 / Plan-12 dependency on 01 satisfied → 🔓 unblocked (headers + BACKLOG rows).
- Repoint command/path refs in all plans (except Plan-01's migration narrative):
  .specify/{scripts,tests,security,config,templates,governance} -> packages/casan-harness/...;
  golden-runs/traceability-map/docs-input -> apps/okr/domain/...; `cd AINative_OKR_CASAN5`
  -> `cd $(git rev-parse --show-toplevel)`; fix relative links + Plan-13 control-plane location.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 14:57:01 +09:00

4.6 KiB

KẾ HOẠCH 06 — Onboard dự án thật thứ 2 (chứng minh reuse)

project-registry.json hiện có 1 dự án active (OKR) + 2 entry demo (A/B) [demo]. Kế hoạch: onboard một dự án thật khác domain để verify-harness-reuse.sh trả HARNESS_REUSE_VALID một cách có thật — bằng chứng harness tái dùng được. Task-level, chưa thực thi.

Status 2026-07-08: 🔓 đã mở khoá — Plan-01 ✅ done (harness = packages/casan-harness/, domain = apps/okr/domain/). Onboard app mới giờ chỉ cần: tạo apps/<project>/domain/ (golden/corpus/input), thêm entry vào project-registry.json với domain_root riêng, set CASAN_DOMAIN_ROOT — KHÔNG sửa gate. Chưa thực thi (task-level).

Phụ thuộc: 01 ✅ (package tách + config/domain — DONE), 05 (CI). Đây là mảng thuyết phục nhất về "tái sử dụng".

Mục tiêu

  • Chọn 1 domain khác OKR (ví dụ: quản lý công việc/ticket, kho hàng, hoặc CRUD nghiệp vụ khác).
  • Cắm harness không sửa gate, chỉ nạp config + domain (golden/corpus/input).
  • Chạy pipeline + harness tests đạt PASS + đăng ký registry → reuse hợp lệ thật.

Nguyên tắc

  • Không chạm src/gates: nếu phải sửa gate → nghĩa là chưa đủ tách; ghi nhận nợ kỹ thuật.
  • Domain data tách bạch: golden/corpus/input của dự án 2 nằm ở apps/<x>/domain/, không lẫn OKR.
  • Cùng version package: dự án 2 dùng đúng harness_version với OKR để reuse có nghĩa.

Tasks

Task Việc File/Đối tượng Verify Done khi
6.1 Chọn domain + viết okr-requirement-tương đương cho dự án 2 mới apps/<x>/domain/input/*.md có requirement + architecture input sẵn sàng
6.2 Tạo apps/<x>/ theo khuôn app (pipeline trỏ package) mới casan run gọi được app khung chạy
6.3 Nạp config/thresholds.yaml riêng (hoặc dùng default) apps/<x>/config override hoạt động config áp đúng
6.4 Tạo golden-runs cho artifact chính của domain 2 apps/<x>/domain/golden-runs/ drift-detect có mốc golden sẵn
6.5 Tạo redteam-corpus cho domain 2 (injection theo ngữ cảnh mới) apps/<x>/domain/redteam-corpus/ H4 chấm recall corpus sẵn
6.6 Chạy pipeline dự án 2 qua harness pipeline mỗi step qua H1→H7, có verdict chạy trọn
6.7 Chạy harness tests cho dự án 2 tests các gate PASS (điều chỉnh fixture theo domain) test xanh
6.8 casan register --project <x> --domain <name> project-registry.json entry status: active đã đăng ký
6.9 verify-harness-reuse.sh script HARNESS_REUSE_VALID ... project_count=2 reuse thật
6.10 Ghi lại "phần phải sửa" (nếu có) làm nợ kỹ thuật cho 01/03 mới notes có danh sách gap rút kinh nghiệm

Tiêu chí "tái sử dụng thật" (đo được)

flowchart LR
    PKG["packages/casan-harness v1.x<br/>(không sửa gate)"] --> A["apps/okr<br/>domain OKR"]
    PKG --> B["apps/&lt;x&gt;<br/>domain mới"]
    A --> REG["project-registry.json"]
    B --> REG
    REG --> V{"verify-harness-reuse"}
    V --> OK["HARNESS_REUSE_VALID<br/>project_count=2"]

    style PKG fill:#d0e8ff,stroke:#2c3e91,stroke-width:2px
    style OK fill:#d0ffd0,stroke:#1e8449,stroke-width:2px

Rủi ro

Rủi ro Giảm thiểu
Phải sửa gate cho domain mới ghi nợ (6.10) → đẩy về 01/03 tách thêm; không hack tạm
Corpus/golden domain 2 sơ sài → gate vô nghĩa tối thiểu N mẫu/gate; review chất lượng
Reuse "giả" (chỉ copy folder) bắt buộc cùng harness_version + verify script
Tốn công dựng app 2 chọn domain nhỏ, đủ để chứng minh, không cần đầy đủ tính năng

Tiêu chí HOÀN THÀNH

  • Dự án 2 chạy pipeline qua harness không sửa src/gates.
  • Golden + corpus domain 2 có thật, gate chấm được.
  • project-registry.json có 2 entry active thật (bỏ/đổi demo A/B).
  • verify-harness-reuse.sh → HARNESS_REUSE_VALID project_count=2.
  • Nợ kỹ thuật (nếu có) được ghi lại cho kế hoạch 01/03.

Đây là bằng chứng mạnh nhất cho tuyên bố "harness tái sử dụng cho nhiều dự án" — trước khi hoàn thành, chỉ nên nói "cơ chế reuse có, dự án thật = 1, đang onboard dự án 2".