Verify Contract
Purpose
Prove the task actually works and leave durable evidence.
Verification also checks that the implementation did not exceed the behavioral contract or frozen write boundary merely because the extra work looked reasonable.
When to use
After implementation, tests, bug fixes, data runs, or smoke checks.
Inputs
- Task name
SPEC.md acceptance criteria, non-goals, constraints, and invalid-if rules
- Optional persisted
SCOPE.md plus its frozen Git base
- Commands run or to run
- Changed files
- Evidence to record
- Known risks or untested areas
Workflow
Update VERIFY.md with date + task name.
Record commands run as short evidence entries with command, exit code, relevant
output, interpretation, acceptance criterion covered, and remaining uncertainty.
Keep each entry concise and auditable.
When SCOPE.md and scripts/scope_gate.py are available, run:
python scripts/scope_gate.py --base <frozen-base>
Record its status and relevant violations or review triggers. A scope-gate FAIL prevents PASS. REVIEW_REQUIRED also prevents PASS until the named review is resolved.
If scripts/verify_gate.py is available, run it before marking verification complete.
If repeated iterations were used, check for a loop contract, budget, ledger,
revert rule, and stop condition before calling the work done.
List changed files.
Run the spec ceiling check against the implemented behavior and diff.
Note working directory / environment assumptions if relevant.
Link artifacts/screenshots if relevant (supporting evidence only; automated checks preferred).
Note what was not tested and remaining risks.
Name the next safest task.
Verify gate
Status: PASS | FAIL | REVIEW_REQUIRED
- PASS only when contract probes pass, the scope gate passes when a persisted scope exists, no diff guard requires review, and no spec ceiling violation is present.
- FAIL when behavior or contract probes fail, the scope gate fails, or an explicit non-goal / invalid-if rule was violated.
- REVIEW_REQUIRED when behavior passes but evidence integrity is questionable, the scope gate requires review, or plausible extra behavior exceeds the written acceptance criteria and intent is ambiguous.
- REVIEW_REQUIRED is not the same as functional failure.
- If repeated iterations occurred without a loop contract, use REVIEW_REQUIRED.
- If loop budget, ledger, revert rule, or stop condition was violated, use REVIEW_REQUIRED
or FAIL depending on whether the behavior contract failed.
- Do not treat loop activity as success merely because the final output looks plausible.
Contract probes:
- Public import/API seams:
- CLI/output behavior:
- Edge/no-match behavior:
- Existing behavior preserved:
Scope adherence:
- Scope gate: PASS | FAIL | REVIEW_REQUIRED | NOT_APPLICABLE
- Out-of-scope writes: none | describe
- Read-only / forbidden paths touched: none | describe
- Review triggers resolved: yes/no/not applicable
- Scope artifact widened after implementation began: no | describe
Any scope-gate FAIL prevents PASS. Unresolved scope-gate REVIEW_REQUIRED also prevents PASS.
Spec ceiling:
- Unspecified user-visible / API / schema behavior added: yes/no
- Explicit non-goal implemented: yes/no
- Adjacent refactor or cleanup beyond necessary support: yes/no
- Necessary spec expansion discovered but not written down first: yes/no
Any yes above prevents PASS. Use FAIL for a clear contract violation; use
REVIEW_REQUIRED when the extra behavior may be reasonable but was not authorized by the
written spec.
Diff guards:
- Protected paths touched: yes/no
- Tests changed: yes/no
- Fixture/data changed: yes/no
- Dependencies changed: yes/no
Credential boundary check:
- Confirm
.env or local secret files were not modified unless they were explicitly in scope.
- Confirm no API keys, tokens, cookies, passwords, or private URLs were added.
- If a secret is needed, document only the environment variable name. Environment variable names are okay; raw secret values are not.
- Run a repo secret scan if one already exists and is easy to invoke.
- Mark
REVIEW_REQUIRED if credential exposure is uncertain.
This is a lightweight workflow check, not a secret scanner or a replacement for
permissions, secret scanning, or runtime controls.
Review required because:
Outputs
- VERIFY.md entry with evidence
- Verify gate status
- Scope-gate status when a persisted scope exists
- Pass/fail summary + automated/manual/inferred status
- Spec ceiling result
- Remaining / untested risks
- Next safest task
Success looks like
Good VERIFY.md entry:
2026-06-09 - Implement user export
Environment: Python 3.11, clean venv
Command: ./run_export_test.sh
Exit code: 0
Relevant output: export summary matched fixture
Interpretation: passed
Acceptance criterion covered: user export happy path
Remaining uncertainty: large dataset edge case
Command: python -m pytest tests/export_test.py
Exit code: 0
Relevant output: 12 passed
Interpretation: passed
Acceptance criterion covered: test coverage for export behavior
Remaining uncertainty: none known
Scope gate: PASS — all changed files remained within SCOPE.md
Spec ceiling: PASS — no unspecified behavior or adjacent cleanup added
Changed: src/export.py, tests/export_test.py
Not tested: large dataset edge case
Remaining risks: large dataset edge case (monitor in prod)
Next: Add scheduling wrapper
Stop conditions
- Evidence is recorded clearly.
- Persisted scope was checked against the live diff.
- Spec ceiling was checked against the actual diff and behavior.
- Scope or verification failures trigger diagnosis; do not mark them as passed.
Anti-patterns
- "Looks good" without evidence.
- Hiding failed commands.
- Marking PASS after a scope-gate failure or unresolved review trigger.
- Rewriting
SCOPE.md after implementation to retroactively authorize the diff.
- Calling extra behavior harmless because tests still pass.
- Using screenshots as primary evidence for non-visual tasks.
1---2name: verify-contract3description: Record clear evidence that a task works, including commands, results, remaining risks, scope adherence, and whether the implementation stayed under the spec ceiling.4---56# Verify Contract78## Purpose910Prove the task actually works and leave durable evidence.1112Verification also checks that the implementation did not exceed the behavioral contract or frozen write boundary merely because the extra work looked reasonable.1314## When to use1516After implementation, tests, bug fixes, data runs, or smoke checks.1718## Inputs1920- Task name21- `SPEC.md` acceptance criteria, non-goals, constraints, and invalid-if rules22- Optional persisted `SCOPE.md` plus its frozen Git base23- Commands run or to run24- Changed files25- Evidence to record26- Known risks or untested areas2728## Workflow29301. Update VERIFY.md with date + task name.312. Record commands run as short evidence entries with command, exit code, relevant32 output, interpretation, acceptance criterion covered, and remaining uncertainty.33 Keep each entry concise and auditable.343. When `SCOPE.md` and `scripts/scope_gate.py` are available, run:3536 ```bash37 python scripts/scope_gate.py --base <frozen-base>38 ```3940 Record its status and relevant violations or review triggers. A scope-gate `FAIL` prevents PASS. `REVIEW_REQUIRED` also prevents PASS until the named review is resolved.414. If `scripts/verify_gate.py` is available, run it before marking verification complete.42 If repeated iterations were used, check for a loop contract, budget, ledger,43 revert rule, and stop condition before calling the work done.445. List changed files.456. Run the spec ceiling check against the implemented behavior and diff.467. Note working directory / environment assumptions if relevant.478. Link artifacts/screenshots if relevant (supporting evidence only; automated checks preferred).489. Note what was **not** tested and remaining risks.4910. Name the next safest task.5051## Verify gate5253Status: PASS | FAIL | REVIEW_REQUIRED5455- PASS only when contract probes pass, the scope gate passes when a persisted scope exists, no diff guard requires review, and no spec ceiling violation is present.56- FAIL when behavior or contract probes fail, the scope gate fails, or an explicit non-goal / invalid-if rule was violated.57- REVIEW_REQUIRED when behavior passes but evidence integrity is questionable, the scope gate requires review, or plausible extra behavior exceeds the written acceptance criteria and intent is ambiguous.58- REVIEW_REQUIRED is not the same as functional failure.59- If repeated iterations occurred without a loop contract, use REVIEW_REQUIRED.60- If loop budget, ledger, revert rule, or stop condition was violated, use REVIEW_REQUIRED61 or FAIL depending on whether the behavior contract failed.62- Do not treat loop activity as success merely because the final output looks plausible.6364Contract probes:6566- Public import/API seams:67- CLI/output behavior:68- Edge/no-match behavior:69- Existing behavior preserved:7071Scope adherence:7273- Scope gate: PASS | FAIL | REVIEW_REQUIRED | NOT_APPLICABLE74- Out-of-scope writes: none | describe75- Read-only / forbidden paths touched: none | describe76- Review triggers resolved: yes/no/not applicable77- Scope artifact widened after implementation began: no | describe7879Any scope-gate `FAIL` prevents PASS. Unresolved scope-gate `REVIEW_REQUIRED` also prevents PASS.8081Spec ceiling:8283- Unspecified user-visible / API / schema behavior added: yes/no84- Explicit non-goal implemented: yes/no85- Adjacent refactor or cleanup beyond necessary support: yes/no86- Necessary spec expansion discovered but not written down first: yes/no8788Any `yes` above prevents PASS. Use FAIL for a clear contract violation; use89REVIEW_REQUIRED when the extra behavior may be reasonable but was not authorized by the90written spec.9192Diff guards:9394- Protected paths touched: yes/no95- Tests changed: yes/no96- Fixture/data changed: yes/no97- Dependencies changed: yes/no9899Credential boundary check:100101- Confirm `.env` or local secret files were not modified unless they were explicitly in scope.102- Confirm no API keys, tokens, cookies, passwords, or private URLs were added.103- If a secret is needed, document only the environment variable name. Environment variable names are okay; raw secret values are not.104- Run a repo secret scan if one already exists and is easy to invoke.105- Mark `REVIEW_REQUIRED` if credential exposure is uncertain.106107This is a lightweight workflow check, not a secret scanner or a replacement for108permissions, secret scanning, or runtime controls.109110Review required because:111112- _TBD_113114## Outputs115116- VERIFY.md entry with evidence117- Verify gate status118- Scope-gate status when a persisted scope exists119- Pass/fail summary + automated/manual/inferred status120- Spec ceiling result121- Remaining / untested risks122- Next safest task123124## Success looks like125126**Good VERIFY.md entry:**127128```text1292026-06-09 - Implement user export130Environment: Python 3.11, clean venv131132Command: ./run_export_test.sh133Exit code: 0134Relevant output: export summary matched fixture135Interpretation: passed136Acceptance criterion covered: user export happy path137Remaining uncertainty: large dataset edge case138139Command: python -m pytest tests/export_test.py140Exit code: 0141Relevant output: 12 passed142Interpretation: passed143Acceptance criterion covered: test coverage for export behavior144Remaining uncertainty: none known145146Scope gate: PASS — all changed files remained within SCOPE.md147Spec ceiling: PASS — no unspecified behavior or adjacent cleanup added148Changed: src/export.py, tests/export_test.py149Not tested: large dataset edge case150Remaining risks: large dataset edge case (monitor in prod)151Next: Add scheduling wrapper152```153154## Stop conditions155156- Evidence is recorded clearly.157- Persisted scope was checked against the live diff.158- Spec ceiling was checked against the actual diff and behavior.159- Scope or verification failures trigger diagnosis; do not mark them as passed.160161## Anti-patterns162163- "Looks good" without evidence.164- Hiding failed commands.165- Marking PASS after a scope-gate failure or unresolved review trigger.166- Rewriting `SCOPE.md` after implementation to retroactively authorize the diff.167- Calling extra behavior harmless because tests still pass.168- Using screenshots as primary evidence for non-visual tasks.