# Worker quality gate - prospective manual handoffs Effective 2026-10-28 for new assignments beginning with Step-04B. This supplements the active assignment and existing protected-file/manual workflow rules. It does not impose new criteria on completed work, authorize agents/automation, or replace repository instructions. Revision 2026-11-01 applies prospectively from Step-14. The existing "test pending work" rule missed post-work cleanup/release ordering in Step-13. The added boundary ledger below makes that review executable, not a claim that more test cases or longer reports alone prevent defects. ## 1. Before coding: make the contract executable Read the assignment, current implementation and its acceptance cases. Establish a compact matrix for the changed behavior, not an inventory of every project: | Case | Input/precondition | Expected result and unchanged state | Test/evidence | |---|---|---|---| | Normal | Valid explicit selection/input | Exact successful output | Named behavior test | | Rejected | Invalid/missing/unknown input | Typed visible failure, no partial mutation/fallback | Negative test | | Boundary/partial | Relevant limit, unknown or incomplete result | Defined explicit outcome, not invented data | Boundary test | | Lifecycle | Only if affected: cancellation/reentry/overlap/close | One owner, valid transitions, no stale publication | Controlled interleaving test | | Integration | Real producer/consumer and UI where affected | Same validated contract end-to-end | Real integration/native evidence | Apply only relevant rows and explain any N/A briefly. The assignment supplies the decisive vectors; add tightly coupled edge cases found during implementation. For bug fixes, execute a real pre-fix regression and record the actual failure. Do not invent results or use compilation failure as a behavioral reproduction. If the intended contract is genuinely ambiguous or requires a material design change, report the exact choice/blocker; do not silently guess a success default. Do not broaden scope to speculative future features. ## 2. Implement and verify the actual boundary - Validate syntax, semantic references, cross-field invariants and eligibility before committing state or publishing success. - Rejected actions leave the prior valid state/ownership intact. An acknowledgement is not verification; a partial/unknown result is not complete success. - Keep exact identity/version/unit/time/source semantics. No role-based fallback, hidden defaults, false zero data, swallowed failure or broad exception mask. - When state/lifetime changes, test competing requests while work is pending, not only sequential commands after each await completes. - Include the completion tail: operation work has returned, but callbacks/ resource release/disposal and the advertised drain task are unfinished. Ownership remains reserved until cleanup and coherent terminal/task settlement; reject competing admission with exact unchanged-owner/task/call assertions. Exercise success, operation failure, cancellation and relevant cleanup failure. A test holding only the HTTP reply before work returns does not cover this tail. - Before adding an owner/lifecycle path, inspect accepted local prior art and use its ordering rather than copying an older incomplete pattern. Keep callbacks/awaited cleanup outside required state gates and verify lock order. - Use controlled schedulers/barriers for timing. No arbitrary sleeps/polling as correctness proof. Always release test barriers/resources in finally cleanup. - Exercise the real implementation under test. Faults may be injected below the feature boundary; do not mock away the feature or bypass transport/validation. - Preserve existing behavior and named regressions; explain intentional contract/ presentation changes. Test counts alone do not prove obligations were covered. Run focused checks, then the assignment's required complete build/regressions sequentially. Package/system changes remain subject to existing authorization. ## 3. After the first green run: self-review before handoff Do one source-path review of the changed flow: 1. List affected public entry points and actual producers/consumers. 2. Walk normal, rejected, partial and relevant overlap/cleanup paths against the matrix. Inspect validation order, not just error messages. 3. Check every success/verified/healthy UI or trace commitment occurs only after required validation, and no old operation can publish into a newer context. 4. Check failure/cancel/close cleanup, state rollback and resource ownership. 5. Check every required matrix row has a meaningful assertion and executed result. 6. Check actual dependencies/Git scope, docs/README, protected files and no secrets. For each changed stateful public flow, include this compact ledger in the required worker report, using actual file/symbol locations and named tests: | Boundary | Source ordering / invariant | Executed evidence | |---|---|---| | Admission | All rejecting checks before dispatch or valid-state/owner mutation | Rejected input/Busy/stale assertions, exact unchanged state and call counts | | Publication | Identity/source/current owner and complete data verified at commit, not only prechecked | Held publication/supersession and exact output assertions | | Completion/close | Reserve owner through callback/release/disposal; coherent terminal state and exact completion task; no late successor mutation | Held post-work cleanup/close/reentry assertions, including failure | | UI/producer-consumer | Real command/render/lifetime uses the same guarded flow, errors observed, canonical values unchanged | Actual rendered/native affected path; mocks identified precisely | Use N/A with a concrete reason for unaffected boundaries (for example a research-only assignment), not fabricated tests. Keep this inside the report; do not create another checklist/notes file or delegate this own review. Review all touched producer/consumer paths once against the frozen matrix, not one attractive happy path followed by a blanket "self-review passed". Fix issues found in this pass inside the current assignment and rerun affected checks. Do not declare COMPLETE after only the first plausible green result or hand known defects to the orchestrator as recommendations. The final validation must cover the last relevant production edits; earlier green runs or an older native binary are not the final changed-path evidence. Separate original historical evidence from the actual rebuilt affected checks. This is the worker's own review; do not invoke another agent or automate handoff. It is a short risk-based check, not a new document/report file or broad unrelated audit. ## 4. COMPLETE means the exit contract passed In the required step report, include the compact contract/evidence matrix, exact commands/outcomes, per-project counts, relevant numerical thresholds, self-review summary and honest native versus headless coverage. Use PASSED, FAILED, NOT EXECUTED or BLOCKED precisely. COMPLETE requires all assigned acceptance checks; use INCOMPLETE/BLOCKED for unresolved requirements. Keep historical reports unchanged and report necessary deviations explicitly. Before returning COMPLETE, reconcile every frozen criterion to a named executed assertion/output, the boundary ledger where applicable, final command exits and unresolved issue list. A full-suite count, prose source review or stub/native substitution cannot close an unsupported row. Fix tightly coupled findings now, within the same assignment, rather than shipping known gaps for another lettered step. Do not invent new scope or silently waive material regressions to reduce the apparent correction count. After saving the single fenced report, STOP. No future step, orchestration edit, automatic agent communication, staging/commit/push or unauthorized system change.