Files
CASAN/.claude/agents/protocols/hallucination-prevention-checklist.md
T
thanhnvandClaude Opus 4.8 36a4812ef3 refactor(structure): promote app to repo root + remove redundant workspace cruft
Standard production layout: the OKR app (was nested under AINative_OKR_CASAN5/) is now
the repository root. No more wrapper directory.

- Promote AINative_OKR_CASAN5/* -> repo root (backend/ frontend/ packages/ apps/
  .specify/ docs/ infra/ nginx/ scripts/ + configs). Merge tool dirs: .gitea (kept the
  active deploy ci.yml, added harness-ci.yml + runbooks), .claude (agents/commands +
  launch.json), .github moved up.
- Remove redundant: 00_SUBMISSION_PACKAGE, scattered root notes (FPT_CASAN_Full.md,
  tu-tuong-casan.md, casan-tu-sinh..., casan_harness_assessment.md, source-review...,
  README_CASAN5_REFINED.md), casan-next-plans/ and optimize-docs/ (competition/planning
  artifacts — roadmap + design history preserved in git log / commit messages).
- Update all references to the old layout:
  - .gitea/workflows/{ci,harness-ci}.yml, .github/workflows/{ci,deploy}.yml:
    working-directory .; drop AINative_OKR_CASAN5/ prefix; .specify/{tests,scripts}
    -> packages/casan-harness/... (.specify/logs state kept)
  - .claude/launch.json, .gitea/*-runbook.md: path prefixes
  - CLAUDE.md, README.md: docs/input -> apps/okr/domain/input
  - policy-bundle.yaml: 8 policy paths -> packages/casan-harness/...; manifest re-signed
- secrets-scan.sh: fixture excludes -> new package/domain paths.

Full gate from the new root: PASS=64 FAIL=0 SKIP=3.

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

22 lines
2.2 KiB
Markdown

# Giao thức Kiểm soát Ảo giác (Hallucination Prevention Checklist)
Giao thức này cung cấp bộ checklist bắt buộc để các Review Agents và bản thân Sub-agents đối chiếu chéo kết quả nhằm triệt tiêu hoàn toàn hiện tượng ảo giác (hallucination).
## 1. Nguyên lý đối chiếu chéo (Grounding)
- Không có bất kỳ chi tiết thiết kế hoặc logic code nào được phép tự ý phát minh nếu không có cơ sở chứng cứ rõ ràng từ:
- Tài liệu Yêu cầu nghiệp vụ (`docs/input/okr-requirement.md`).
- Bản vẽ thiết kế Basic Design (`bd-*.md`) hoặc Detail Design (`dd-*.md`).
- Tệp thông tin Context hiện tại (`pipeline-context.yaml`).
## 2. Checklist rà soát chất lượng (Hallucination Checks)
Trước khi đánh dấu một bước là hoàn thành, Agent phải tự xác nhận qua checklist sau:
- [ ] **Sự nhất quán dữ liệu (Data Conformance):** Các kiểu dữ liệu, các bảng và trường thông tin trong code có khớp 100% với file `data-model.md` và `plan.md` không?
- [ ] **Xác thực đường dẫn (Path Verification):** Mọi đường dẫn file được tham chiếu trong spec/plan/tasks có tồn tại vật lý trên đĩa hoặc được định nghĩa trong context không? (Tuyệt đối không đoán đường dẫn).
- [ ] **Độ phủ yêu cầu (Requirement Coverage):** Tất cả các câu trả lời và dòng code có giải quyết đúng mục tiêu nghiệp vụ được giao không? Có thêm thắt tính năng dư thừa ngoài đặc tả (Feature Creep) không?
- [ ] **Độ chính xác của API/Contract:** Các endpoint, headers, và payload API trong frontend và backend có khớp nhau hoàn toàn theo mô tả trong `contracts/` không?
## 3. Quy trình phản biện (Judge Gate)
- Khi Review Agent thực hiện đánh giá (Step 5, 7, 11), nếu phát hiện bất kỳ điểm nào không nhất quán hoặc tự ý sáng tạo không có căn cứ, Review Agent phải từ chối phê duyệt với verdict `REJECTED`.
- Phải liệt kê cụ thể các điểm nghi ngờ ảo giác vào mục `critical-issues` trong Step-Result block để fix agent thực hiện điều chỉnh.