agentleFS
www-donghanhcungban-orgwww-donghanhcungban-org/X-Templates/tests/AGENTS.md

X-Templates / tests

AGENTS.md16 starsChanged 6 days agoMITView on GitHub

Quy ước riêng của thư mục này, nạp khi làm việc ở tests/ (Claude Code: qua CLAUDE.md cùng thư mục). Luật chung: ../AGENTS.md; mẫu theo thư mục: XC-DOCAI-011.

The file

Files
AGENTS.md

AGENTS.md — tests/

Quy ước riêng của thư mục này, nạp khi làm việc ở tests/ (Claude Code: qua CLAUDE.md cùng thư mục). Luật chung: ../AGENTS.md; mẫu theo thư mục: XC-DOCAI-011.

  • Nhập test khác: sys.path.insert(0, str(Path(__file__).resolve().parent)) rồi from test_x import … (mẫu: test_deploy_receipt.py). Không from tests.test_x import …: test-select không lần theo import dạng tests., nên lớp phụ thuộc bị bỏ ở cổng nhanh (AUD-TEST-136).
  • Chạy: python3 -m unittest tests.test_x. Toàn bộ kèm coverage: PATH=<venv>:$PATH scripts/dev-task.sh test (song song; CI chạy 8 shard). Coverage dòng + nhánh 100 % do CI đo, cả tiến trình con.
  • Không ngưỡng giây/CPU cứng (BASE-GATE-005): dùng cpu_budget.assert_not_quadratic; hạn chống treo qua cpu_budget.run_with_deadline(…, hang="lý do") (sàn HANG_FLOOR). Không dùng chỉ thị bỏ qua coverage, lint hay skip (BASE-GATE-003).
  • Đổi .claude/hooks/guard.py: chạy thêm test_green_shell, test_green_gh, test_signoff2_scripts, test_audit_dot4_har — chúng ghim các quyết định "được qua" và mã BUDGET cũ (AUD-SEC-747, 603). Luật guard mới phải là tập cha của luật cũ: so quyết định thô base với nhánh ở cả hai chính sách (mặc định và XT_GUARD_POLICY=strict). Fixture fixtures/autonomy/guard.json: ca chặn đi kèm ca đối chứng không chặn oan. Agent không tự nới trần byte; nới là quyết định ADR (ADR-0089).
  • Test cần git: tự đặt user.name/user.email trong repo tạm; runner CI không có cấu hình toàn cục.
  • Bench tự hành: ID 🔴/🟠 đã sửa là bắt buộc phủ; chưa có ca thì khai vào fixtures/autonomy/scope.json kèm lý do.
  • Lớp test mới: shard-weights.json giữ trọng số để CI chia shard đều; tests/test_ci_shard.py cho thiếu trọng số tới 15 % số lớp, quá ngưỡng thì chạy scripts/dev-task.sh test-weights.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.