a↗agentbay.Obtenir AgentBay
Mon compte ▾
Menu
← Retour au guide
RÉSULTAT DU GUIDE

Configurer et exécuter les protections

Télécharger l’original ↓

06 Protections

Installez AI Software Toolkit avant d’implémenter le ticket. Imposez les tests unitaires, enregistrez le commit de départ, puis vérifiez cette révision exacte. Le projet CRM de départ renvoie BLOCK : sa suite d’import ne peut pas charger l’importateur absent. Ses cinq tests de contacts existants réussissent toujours.

Appliquez l’implémentation CRM-142 examinée et documentez-la dans README.md. Examinez et committez les modifications, puis exécutez le même contrôle sur ce nouveau commit avec le SHA de départ comme base. Le projet terminé renvoie ALLOW : les 17 cas unitaires réussissent. La politique de tests unitaires est inchangée entre les étapes.

Installer une fois dans le projet d’exemple

Nécessite Python 3.11+, Node.js 24 et Git. Le script de configuration inclus télécharge AI Software Toolkit v2.3.3, vérifie la somme de contrôle de publication et l’empreinte épinglée, puis installe Proof local et prepare-safe-change. GitHub Actions reste désactivé.

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

Conservez le SHA complet de départ affiché ci-dessus. Utilisez votre propre identité Git. Le .gitignore fourni exclut les skills installés, téléchargements du toolkit et artefacts d’exécution.

Vérifier la révision terminée

Implémentez la fonctionnalité et mettez README.md à jour. Examinez le diff avant de committer.

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

Remplacez STARTER_COMMIT par votre SHA complet enregistré. Le reçu enregistre les vraies révisions avant/après de cette répétition. Les fichiers d’application originaux et les tests immuables correspondent à l’exécution CRM publiée.

Lisez aussi l’avis consultatif

L’étape terminée comporte un constat de taille : 549 lignes ajoutées comptées contre un budget de 300, et 305 lignes ajoutées dans un fichier contre un budget de 150. Le diff inclut l’implémentation et ses preuves de sélection des sources. Examinez le diff ; gardez les seuils inchangés. Les contrôles documentation, dépôt et état de référence ont réussi. Six autres contrôles consultatifs n’ont aucun résultat rapporté.

ALLOW rapporte le contrôle bloquant des tests unitaires. Il ne fait ni commit, ni fusion, ni déploiement. Les contrôles navigateur constituent des preuves distinctes du parcours applicatif.

Fichier original et détails de la source

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.