FACTORY_OUTCOME: COMPLETED ## Сводка для владельца Итог: B-1 исправлен: revise/hold после PASS работают, stale owner outcome возвращает 409; подготовлено к независимому повторному ревью. Проблемы: неблокирующие замечания оставлены для R2/R3/R4; production остаётся PARKED. Решение: передать правку на независимое ревью; включение, миграция, деплой и рестарт не разрешены. ## Scope and implementation 2026-11-29, FACTORY-RUNTIME. Read security rules (`docs/operating-model/02-security.md`), accepted design v4 and its review, R1 implementation report and independent `automatic-review-r1-review.md`. This delivery addresses **B-1 only**. - `control_plane/review_cycles.py`: PASSED/STOPPED fence applies to worker deliveries. Owner `change_requirements` can supersede PASSED, move task to PLANNED, append the revision request and clear approval; owner `stop` can move PASSED to STOPPED/MANUAL_STOP and task REVIEW. Cycle hold deliberately uses REVIEW per design, not legacy PAUSED. Both advance the cycle version. SUPERSEDED/CANCELLED fences remain unchanged. - `console/owner_decisions.py`: inspect the returned transition; STALE_OUTCOME raises Conflict, mapped to HTTP 409, rather than redirecting with false success. Existing version/token and live-execution guards remain. - `control_plane/tests/test_review_cycles_r1.py`: six new tests. Four cover revise/hold after PASS for both completed and checkpoint tasks, HTTP 303, version/state/status/instruction, approval clearing for revise, denied acceptance, stale token HTTP 409, and late worker fencing after each action. One tests returned STALE_OUTCOME → 409 for revise/hold/accept with a mocked model return (separate from token rejection). One verifies late worker delivery after PASSED remains record-only and cannot overwrite cycle, task or consumed execution evidence; acceptance remains valid. No changes to schemas, migrations, adapters, dispatcher or unrelated behavior. Source inventory comparison found changes in exactly the three files above; the other eight recorded source hashes were unchanged. No historical Git diff is claimed. ## Verification evidence Commands run from `/home/iovon/ai-factory`; logs are in `r1-evidence/`. Tests use temporary SQLite databases/workspaces and fake executors; new tests synthesize producer/reviewer evidence without launching executors. Route checks call existing handlers directly, not a running HTTP server. No real CLI/E2E or adapter suite was run. Before the fix: ```sh .venv/bin/python -m pytest -q control_plane/tests/test_review_cycles_r1.py -k test_b1 ``` `b1-before.log`: exit 1; pytest reports **7 failed, 2 passed, 44 deselected**, 2 warnings, 12.96 s. Counts include three failing subtests (revise/hold/accept stale-return checks). Four owner-action tests fail because the version never advances; worker fencing already passes. This establishes the regressions detect B-1. Initial command preparation used unavailable `python`; rerun with `python3` created the tests successfully; no source change occurred in that failed preparation. Final runs: ```sh .venv/bin/python -m pytest -q control_plane/tests/test_review_cycles_r1.py control_plane/tests/test_runtime.py::RuntimeTests::test_migration_is_additive_and_repeatable .venv/bin/python data/project_materials/FACTORY-RUNTIME/review/r1-evidence/legacy_probe.py ``` | Run | Result (exit 0) | Log | |---|---|---| | R1 + migration: original 45 plus 6 new tests | **51 passed, 2 warnings, 3 subtests passed in 120.15s (0:02:00)** | `r1-evidence/b1-r1-migration.log` | | Legacy remainder | **56 passed, 13 deselected, 2 warnings, 15 subtests passed in 146.15s (0:02:26)** | `r1-evidence/b1-legacy.log` | All three changed Python files also passed `ast.parse`. The legacy probe uses the existing explicit `legacy-known-failures.json` exclusions (13); none were added or changed. The migration test overlaps both runs; counts are not a unique-test total. Two FastAPI startup-event deprecation warnings are unrelated to B-1. Updated `r1-evidence/source-sha256.json` for all 11 source files; recomputed SHA-256 and byte counts verified against disk. Changed source hashes: | File | SHA-256 | |---|---| | `control_plane/review_cycles.py` | `bdba402d4668bfe0680477eeb2f948f501e56460eef88face9cf641865a46f0c` | | `console/owner_decisions.py` | `fcb853a6d62c15c957302c4d2441726b6887a6583a9fc5bd41073582377834ad` | | `control_plane/tests/test_review_cycles_r1.py` | `403a1441f62865ecb17a38747eaff5ef36285c6e52bf6f3a27498f0fd5665cb9` | ## Deferred, nonblocking tracking | Follow-up | Release | Required follow-up; not changed here | |---|---|---| | Independent review finding 1 | R2/R3 | Mutation evidence can be masked by stop/park precedence. Preserve integrity reason and rejection semantics during finalization. | | Independent review finding 2 | R2/R3 | Stale reviewer mutation is currently record-only. Handle integrity violations across stale deliveries without weakening worker fencing. | | Independent review finding 3 | R3/R4 | Add the missing CANCELLED transition and owner downgrade/cancellation controls. | | Independent review observation 4 | R4 | Display PASSED cycle + ACCEPTED task correctly; owner acceptance retains PASSED. | | Legacy debt | R3/R4 | Triage the 13 exclusions (8 executor/fallback, 5 UI/template) against the earlier 12-test debt; do not claim historical equivalence. | | Adapter test debt | R2 | Repair mocks for the two real-CLI adapter tests before running them; current implementation uses Popen while those tests mock run. | These are tracked, not fixed or newly accepted as resolved. Independent re-review remains outstanding. ## Production boundary No production DB access/migration, service restart, deployment, switch change, permission change, external outreach, or Coral/L-IT work was performed in this fix. PARKED is preserved; opt-in was enabled only inside temporary test fixtures. Per the current owner-provided context, production migration was already applied using Python `sqlite3.Connection.backup` and copy-tested. This records the supplied backup method and prior verification, not a new backup/copy test or newly observed production integrity result. No further production migration is needed or authorized by this report.