# Project Factory V1 Closeout Plan **Goal:** Complete P1-M immutable certified artifacts, P1-N Docker Preview Worker isolation, and P1-O golden-sample acceptance. **Tech stack:** Java 8, Spring, MyBatis, MySQL, Docker CLI contract, Vue 3, Element Plus, JUnit 4, Mockito, Node test runner, Vite. ## Task 1: Certified artifact ledger and store - [x] Write RED schema, mapper and immutable store tests. - [x] Add artifact model, mapper, SQL and local atomic store. - [x] Freeze ZIP plus canonical quality report after four checks pass. - [x] Reject stale, incomplete and non-ready artifacts. ## Task 2: Certified download integration - [x] Write RED controller/service tests proving CERTIFIED never calls live ZIP generation. - [x] Add artifact query/download APIs and integrity verification. - [x] Return artifact identity and hashes in response headers. - [x] Keep DRAFT behavior compatible. ## Task 3: Persistent preview jobs - [x] Write RED schema, mapper and service state-machine tests. - [x] Add project preview job model, mapper and SQL. - [x] Change run-preview service boundary to enqueue/read/stop persistent jobs. - [x] Ensure duplicate starts are idempotent and user scoped. ## Task 4: Docker Preview Worker - [x] Write RED worker, lease fencing, TTL and Docker command tests. - [x] Add runtime abstraction and constrained Docker CLI implementation. - [x] Add worker claim, monitor, stop, expiry, bounded logs and screenshot evidence. - [x] Prohibit fallback to direct host process execution. ## Task 5: V1 acceptance ledger - [x] Write RED schema, mapper and five-check orchestration tests. - [x] Add Acceptance Run/Check models, mapper, service and golden-sample probes. - [x] Verify generation, recovery, rollback, container preview and immutable download. - [x] Add start/latest/history APIs. ## Task 6: EasyCode closeout UI - [x] Write RED source-contract tests for artifact hashes, preview screenshot/TTL and V1 acceptance. - [x] Update API, delivery panel and generation workspace polling/actions. - [x] Remove stale certification wording and direct-process assumptions. - [x] Run main-flow tests and production build. ## Task 7: Regression and V1 closure - [x] Run P1-H through P1-O focused backend tests and `ruoyi-admin` full tests. - [x] Run Mapper XML parsing, SQL consistency, Docker command contract and whitespace checks. - [x] Run EasyCode focused tests/build and verify the dev URL. - [x] Record migration boundary, Docker deployment boundary and V1 completion in the roadmap. ## Completion Record - Completed on 2026-07-12. - P1-H through P1-O focused backend suite: 62 tests passed; the additional preview fencing regression brings the Preview Worker class to 3 passing tests. - `ruoyi-admin` full suite: 44 tests passed. - EasyCode main-flow suite: 73 tests passed; production build passed. - All four affected Mapper XML files parsed successfully, SQL consistency tests passed, Git Bash validated the Worker entrypoint, and `http://localhost:5174` returned HTTP 200. - The current machine has no Docker CLI, so the image was not built or started here. Real container and golden-project execution remains a deployment-environment acceptance action, not an unverified local claim. - No external database migration was executed. Apply `sql/factory_project_v1_closeout.sql` before enabling these APIs.