Activation Contract
Use only for Phase 4 (VERIFY) after IMPLEMENT reports completed work and its
validation evidence. VERIFY is the final verdict owner; it never fixes code.
When to Use
Use as the final phase of /odf-new after IMPLEMENT is complete. Run real tests and linting — static analysis alone is NOT verification. Review effort scales with the RISK TIER of the frozen diff, never with diff size.
Risk Tier Classification
The tier is decided by the EVIDENCE in the frozen diff, NEVER by the number of lines. A 300-line rename is LOW; 2 lines in ir.model.access.csv are HIGH.
| Tier | Evidence signals (any match → that tier) | Lenses |
|------|------------------------------------------|--------|
| HIGH | ir.model.access.csv, record rules, groups= assignments, permission changes, security inheritance, compute/related fields that WRITE, security onchange, raw SQL (env.cr.execute with interpolation), payments/money, data loss (unlink/archive), subprocess/os.system, public endpoints | 4 lenses: risk, resilience, readability, reliability |
| MEDIUM | Everything not explicitly HIGH or LOW | 1 lens (focus configurable, default readability) |
| LOW | Passive byte-proven: XML view/form/tree/action/menu, manifest metadata, renames/moves, docs | 0 lenses: structural readback + native tool verification |
Lens Selection Policy
| Tier | Lenses | Mechanism |
|------|--------|-----------|
| HIGH | 4 (risk, resilience, readability, reliability) | Judgment Day 3-pass review (reviewer → maintainer → attacker). The risk lens covers the attacker perspective |
| MEDIUM | 1 (focus configurable, default readability) | Single focused review pass |
| LOW | 0 | Structural readback (file exists, parses, breaks nothing) + native tool verification (pre-commit/lint if applicable). Launch NO reviewers |
Hard Rules
| Rule | Requirement |
|------|-------------|
| Classify first | Classify the tier from the frozen diff BEFORE any verification work |
| Execute tests | Run the real module test suite — static analysis and manual browser checks are not substitutes |
| Compare against specs | Every REQ-XX from assess must have a PASSING test |
| Judgment Day | HIGH tier ONLY: 3 review passes (reviewer, maintainer, attacker). NEVER run for LOW/MEDIUM |
| Never fix issues | Only report them — the orchestrator decides what to do |
| Test evidence | Record the exact command, exact database, exit code, and output evidence; a command without exact -d {test_db} is invalid. Disposable databases are preferred. A non-isolated development database is allowed only when the current user-approved scope names that exact database and authorizes its use; the stage role result/evidence must state database_isolation: non-isolated, database_authorization: current-user-approved, and warn that tests may mutate module, schema, and test data. The receipt must also carry candidate_digest (from the injected Policy Gate decision), executor (e.g. "odoo_qa_engineer"), and test_identity (e.g. "{module} test suite") — evidence missing those fields, or outside the freshness window, is rejected by the harness |
| Deferred tests | Skipped, deferred, unavailable, or unrecorded tests yield blocked with verification-deferred; they never yield PASS or PASS WITH WARNINGS |
Decision Gates
| Condition | Verdict |
|-----------|---------|
| Required module test command ran with exact database, exit code 0, output evidence, all specs covered, no CRITICAL issues | PASS |
| Required module test command ran and passed, and only non-blocking warnings exist | PASS WITH WARNINGS |
| Any test fails or a spec is UNTESTED | FAIL |
| Tests skipped, deferred, unavailable, or missing the required result record | BLOCKED (verification-deferred) |
Execution Steps
- Retrieve artifacts: assess (specs), design (tasks), and implement-progress
(what was built) from the selected store
- Freeze the candidate diff: record the base tree/reference and count
original_changed_lines - Classify risk tier from the frozen diff (Risk Tier Classification table)
- Check completeness: Count total vs completed tasks. Flag CRITICAL if core tasks incomplete
- Check OCA compliance: Manifest (version, license, author, depends), security (ir.model.access.csv), code quality (imports, SQL injection, translations), tests
- Run pre-commit:
pre-commit run -a. Flag CRITICAL on non-auto-fixable failures - Run tests: Use the project's
testing.test_commandfromodf-init/{project}with{module}substituted. The persisted Docker template isdocker compose run --rm odoo odoo -d {test_db} -i {module} --test-enable --stop-after-init; the local template isodoo-bin -d {test_db} -i {module} --test-enable --stop-after-init. Read the project config and current user-approved scope first — never guess a runner or database. Disposable databases remain preferred; a named non-isolated development database is allowed only when that scope names the exact{test_db}and authorizes its use. If the exact database or authorization is absent, returnblockedwithverification-deferredand ask the user. Never generate or rundropdb,createdb/reset/restore,DROP DATABASE,DROP TABLE,TRUNCATE,DROP SCHEMA, or destructive re-initialization as test setup; consent to use a non-isolated database is not consent for those operations, which require separate current consent for the exact operation and database.
- Save a test result record containing
command,database(the exact{test_db}),exit_code, andoutput_evidence. When the database is non-isolated, the stage role result/evidence must also statedatabase_isolation: non-isolated,database_authorization: current-user-approved, and warn that tests may mutate module, schema, and test data. Write the receipt to<worktree>/.odf/validation-evidence-{change}.jsonwithphase: "VERIFY", pluscandidate_digest(from the injected Policy Gate decision),executor("odoo_qa_engineer"), andtest_identity("{module} test suite"). A manual browser check is supplementary and cannot replace the module test suite. - User-run evidence: if the user already ran the suite manually, a fresh
<worktree>/.odf/validation-evidence-{change}.jsonwithexecutor: "user-manual"IS valid evidence (recorded viaodf-toolkit manual-evidence). Do NOT re-run the suite and NEVER fabricate output; read the recorded file and use it as the test result record.
- Run pylint-odoo:
pylint --load-plugins=pylint_odoo -d all -e odoolint {module} - Build spec compliance matrix: Cross-reference EVERY REQ-XX scenario against test results. COMPLIANT = test exists AND passed. UNTESTED = CRITICAL
- Review by tier:
- HIGH → 4 lenses: risk, resilience, readability, reliability via Judgment Day 3-pass (reviewer → maintainer → attacker); the risk lens covers the attacker perspective
- MEDIUM → 1 focused lens (default readability, focus configurable)
- LOW → structural readback + native tool verification only — do NOT launch reviewers
- The readability lens uses the fixed smell baseline from
skills/_shared/code-smells.md(repo standards override; skip what tooling enforces). - Every review pass reports two separate axes: Standards (repo/OCA/version rules + smell baseline) and Spec (fidelity to
EXP-XX/REQ-XXand the design tasks: missing, partial, scope creep, or wrong). Never merge or re-rank one axis against the other.
- Persist the verify report in the selected store with its canonical
artifact_ref (see Correction Budget & Single Attempt)
Correction Budget & Single Attempt
- Freeze the candidate diff on VERIFY entry; record the base tree/reference and
original_changed_lines. - Correction budget =
min(200, ceil(original_changed_lines / 2))lines, frozen at that moment. - Max ONE correction attempt per candidate. After the attempt, re-verify ONCE against the SAME frozen diff (
frozen_diff_ref). - If the single attempt fails → DO NOT re-launch. Escalate to the user with ONE actionable question (scope change / re-plan / abandon) with evidence of what failed.
- Inconclusive validator does not consume the attempt: if re-verification could not inspect the frozen diff (tooling failure, corrupted context, network), it does NOT count as the only attempt — retry without penalty. ONLY a re-verification that actually inspected the bytes and returned
failedconsumes the attempt. - The verify report MUST link the frozen diff: save
frozen_diff_refso re-verification compares against the SAME bytes.
Completion Criteria
VERIFY is DONE only when ALL hold:
- The evidence file is fresh (60-min window) with
command, explicitdatabase,exit_code: 0, andoutput_evidence(automated oruser-manual); nothing is invented. - Every EXP-XX is COMPLIANT (passing test or recorded manual evidence) — an UNTESTED EXP is a CRITICAL, not a warning.
- The compliance matrix is complete: every requirement maps to a result row.
- Lint/OCA checks ran and their outcomes are recorded, not assumed.
- The verdict is one of PASS / PASS WITH WARNINGS / FAIL / BLOCKED (
verification-deferred) — never a fuzzy summary.
Output Contract
Return the complete shared ODF Result envelope, including every required common field (especially strategy and skill_resolution), plus executive_summary ("PASS/FAIL/BLOCKED: X/Y specs compliant, Z critical issues"), the compliance matrix (table: requirement, scenario, test, result), test_results (including command, database, exit_code, output_evidence, and, for non-isolated databases, database_isolation, database_authorization, and the mutation warning), lint_results, review_summary, judgment_day_discrepancies (HIGH tier only), and frozen_diff_ref. Use blocked with verification-deferred when required tests are skipped, deferred, unavailable, or lack valid evidence; never report PASS or PASS WITH WARNINGS in that case.
On FAIL: include the failure disposition fields so the orchestrator can write the receipt — cause (validation-failed), evidence.failing (the commands/tests that failed), and evidence.refs (verify-report topic key + frozen ref). The orchestrator records them via odf_receipt before escalating.
References
../_shared/result-contract.md— ODF Result envelope../_shared/persistence-contract.md— selected store and artifact references../_shared/odoo-sources.md— Local source paths