Thiết lập và chạy hàng rào
Tải bản gốc ↓06 Hàng rào kiểm soát
Cài AI Software Toolkit trước khi triển khai ticket. Bắt buộc kiểm thử đơn vị, ghi commit đầu rồi kiểm tra đúng revision. CRM khởi đầu trả BLOCK: bộ kiểm thử nhập không tải được bộ nhập còn thiếu. Năm kiểm thử liên hệ hiện có vẫn đạt.
Áp dụng triển khai CRM-142 đã xét và ghi trong README.md. Xem và commit thay đổi, rồi kiểm tra commit mới với SHA đầu làm cơ sở. Dự án hoàn chỉnh trả ALLOW: cả 17 ca đơn vị đạt. Chính sách kiểm thử không đổi giữa hai điểm.
Cài một lần trong dự án mẫu
Cần Python 3.11+, Node.js 24 và Git. Script đi kèm tải AI Software Toolkit v2.3.3, kiểm tra checksum phát hành và digest ghim rồi cài Proof cục bộ và prepare-safe-change. GitHub Actions vẫn tắt.
python3 setup-guardrails.py --yes
git init
git add .
git commit -m "Record CRM starter with enforced unit tests"
git rev-parse HEAD
PROOF_UNIT_TEST_COMMAND="npm test" python3 .toolkit-cache/ai-toolkit.pyz check --target . --base-ref HEAD --json
Lưu SHA đầu đầy đủ được in ở trên. Dùng danh tính tác giả Git của bạn. .gitignore đi kèm loại kỹ năng đã cài, tải toolkit và sản phẩm runtime.
Kiểm tra revision hoàn chỉnh
Triển khai tính năng và cập nhật README.md. Xem diff trước commit.
git add index.html style.css src/app.js src/import.js docs README.md
git commit -m "Implement CRM-142 and document the import flow"
PROOF_UNIT_TEST_COMMAND="npm test" python3 .toolkit-cache/ai-toolkit.pyz check --target . --base-ref STARTER_COMMIT --json
Thay STARTER_COMMIT bằng SHA đầy đủ đã lưu. Biên nhận ghi revision trước và sau thực của lần chạy lại. Tệp ứng dụng gốc và kiểm thử bất biến khớp lần CRM đã công bố.
Đọc cả khuyến cáo
Điểm cuối có phát hiện kích thước: 549 dòng thêm tính được so với ngân sách 300, và 305 dòng thêm trong một tệp so với ngân sách 150. Diff gồm triển khai và bằng chứng chọn nguồn. Xem diff; giữ ngưỡng không đổi. Kiểm tra tài liệu, kho mã và cơ sở thực tế đạt. Sáu kiểm soát tư vấn khác chưa có kết quả báo cáo.
ALLOW báo cổng kiểm thử đơn vị bắt buộc. Không commit, merge hay triển khai. Kiểm tra trình duyệt là bằng chứng riêng của luồng ứng dụng.
Tệp gốc và chi tiết nguồn
guardrails.md · SHA-256 c1952816fb672c3a7d7e5df106ed6f6ab093dcae2da88b74a5e27824dd4adbc5
# 06 Guardrails
Install AI Software Toolkit before implementing the ticket. Enforce unit tests, record the starter commit, then check that exact revision. The CRM starter returns **BLOCK**: its import suite cannot load the missing importer. Its existing five contact tests still pass.
Apply the reviewed CRM-142 implementation and document it in README.md. Review and commit the changes, then run the same check against that new commit using the starter SHA as the base. The finished project returns **ALLOW**: all 17 unit cases pass. The unit-test policy is unchanged between checkpoints.
## Install once in the sample project
Requires Python 3.11+, Node.js 24 and Git. The included setup script downloads AI Software Toolkit v2.3.3, checks the release checksum and pinned digest, then installs local Proof and prepare-safe-change. GitHub Actions stays off.
```sh
python3 setup-guardrails.py --yes
git init
git add .
git commit -m "Record CRM starter with enforced unit tests"
git rev-parse HEAD
PROOF_UNIT_TEST_COMMAND="npm test" python3 .toolkit-cache/ai-toolkit.pyz check --target . --base-ref HEAD --json
```
Save the full starter SHA printed above. Use your own Git identity. The supplied .gitignore excludes installed skills, toolkit downloads and runtime artifacts.
## Check the finished revision
Implement the feature and update README.md. Review the diff before committing.
```sh
git add index.html style.css src/app.js src/import.js docs README.md
git commit -m "Implement CRM-142 and document the import flow"
PROOF_UNIT_TEST_COMMAND="npm test" python3 .toolkit-cache/ai-toolkit.pyz check --target . --base-ref STARTER_COMMIT --json
```
Replace STARTER_COMMIT with your saved full SHA. The receipt records the actual before and after revisions from this replay. The original application files and immutable tests match the published CRM run.
## Read the advisory too
The finished checkpoint has a change-size finding: 549 counted added lines against a 300-line budget, and 305 added lines in one file against a 150-line budget. The diff includes the implementation and its source-selection evidence. Review the diff; keep the thresholds unchanged. Documentation, repository and ground-truth checks passed. Six other advisory controls have no reported result.
ALLOW reports the enforced unit-test gate. It does not commit, merge or deploy. The browser checks are separate evidence for the application flow.