← Назад к задаче

automatic-review-r1-fix.md

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.

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:

.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:

.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
RunResult (exit 0)Log
R1 + migration: original 45 plus 6 new tests51 passed, 2 warnings, 3 subtests passed in 120.15s (0:02:00)r1-evidence/b1-r1-migration.log
Legacy remainder56 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:

FileSHA-256
control_plane/review_cycles.pybdba402d4668bfe0680477eeb2f948f501e56460eef88face9cf641865a46f0c
console/owner_decisions.pyfcb853a6d62c15c957302c4d2441726b6887a6583a9fc5bd41073582377834ad
control_plane/tests/test_review_cycles_r1.py403a1441f62865ecb17a38747eaff5ef36285c6e52bf6f3a27498f0fd5665cb9

Deferred, nonblocking tracking

Follow-upReleaseRequired follow-up; not changed here
Independent review finding 1R2/R3Mutation evidence can be masked by stop/park precedence. Preserve integrity reason and rejection semantics during finalization.
Independent review finding 2R2/R3Stale reviewer mutation is currently record-only. Handle integrity violations across stale deliveries without weakening worker fencing.
Independent review finding 3R3/R4Add the missing CANCELLED transition and owner downgrade/cancellation controls.
Independent review observation 4R4Display PASSED cycle + ACCEPTED task correctly; owner acceptance retains PASSED.
Legacy debtR3/R4Triage the 13 exclusions (8 executor/fallback, 5 UI/template) against the earlier 12-test debt; do not claim historical equivalence.
Adapter test debtR2Repair 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.

Материалы