diff --git a/docs/plans/2026-11-03_request-lifecycle-implementation.md b/docs/plans/2026-11-03_request-lifecycle-implementation.md index 768bbff56..6c291c159 100644 --- a/docs/plans/2026-11-03_request-lifecycle-implementation.md +++ b/docs/plans/2026-11-03_request-lifecycle-implementation.md @@ -142,9 +142,9 @@ Only fixed effect kinds are supported: `bootstrap`, `prd-submit`, `prd-activate` ## Task 2: Protected project bootstrap that becomes usable at runtime (stage 2) -**Files:** Create `packages/business/src/project-bootstrap.mjs`, `packages/bus/src/request-bootstrap.mjs`, `packages/business/tests/project-bootstrap.test.mjs`, `packages/bus/tests/request-bootstrap.test.mjs`. Modify `packages/business/src/organization.mjs`, `packages/project/src/index.mjs`, `packages/bus/src/runtime.mjs`, `packages/bus/src/broker.mjs`, `packages/cli/src/config.mjs`, `packages/cli/src/launcher.mjs`, `packages/bus/src/process.mjs`. Test existing `packages/business/tests/library-projects-protected.test.mjs`, `packages/project/tests/init-failure.test.mjs`, `packages/cli/tests/launcher.test.mjs`. +**Files:** Create `packages/business/src/project-bootstrap.mjs`, `packages/bus/src/request-bootstrap.mjs`, `packages/business/tests/project-bootstrap.test.mjs`, `packages/bus/tests/request-bootstrap.test.mjs`. Modify `packages/business/src/organization.mjs`, `packages/project/src/index.mjs`, `packages/bus/src/runtime.mjs`, `packages/bus/src/broker.mjs`, `packages/cli/src/config.mjs`, `packages/cli/src/launcher.mjs`, `packages/bus/src/process.mjs`, `packages/seat/src/working.mjs`. Test existing `packages/business/tests/library-projects-protected.test.mjs`, `packages/project/tests/init-failure.test.mjs`, `packages/cli/tests/launcher.test.mjs`. -**Interfaces:** `prepareBootstrap({business,request,sourceProject,project,name,mode,dataRoot,organizationRevision,tracker,staff,intent}) -> Promise` in `request-bootstrap.mjs`; `project-bootstrap.mjs` validates the exact mapping/path addition for the organization writer. `executeBootstrap({binding,journal,services}) -> Promise<{project,chat_project,spec_commit,organization_revision}>`. `organizationWriter().addProject(id,{revision,project,entry,receipt},actor)` is a new narrow host method; `entry` is only `{root,repo,remote?}`. `activateManagedProject({business,project,receipt,organization_revision}) -> Promise` is a runtime-only operation. Host IPC `request.admission({business,project}) -> {ready,revision,code}` exposes readiness to the launcher through `process.mjs`; scope it to the host business and fail closed if unavailable. Existing `initProject`, `writeHumanFile` and `project.create` remain compatible. +**Interfaces:** `prepareBootstrap({business,request,sourceProject,project,name,mode,dataRoot,organizationRevision,tracker,staff,intent}) -> Promise` in `request-bootstrap.mjs`; `project-bootstrap.mjs` validates the exact mapping/path addition for the organization writer. `executeBootstrap({binding,journal,services}) -> Promise<{project,chat_project,spec_commit,organization_revision}>`. `organizationWriter().addProject(id,{revision,project,entry,receipt},actor)` is a new narrow host method; `entry` is only `{root,repo,remote?}`. `activateManagedProject({business,project,receipt,organization_revision}) -> Promise` is a runtime-only operation. Host IPC `request.admission({business,project}) -> {ready,revision,code}` exposes readiness to the launcher through `process.mjs`; scope it to the host business and fail closed if unavailable. `initializeWorking({dataRoot,business,project,root,env?}) -> Promise<{repo,commit}>` is a new host-only export in `seat/src/working.mjs`, using its existing repository lock and private safe `seed` helper, with no work ref or push authority. Bootstrap calls it after the code seed commit and journals the returned root commit. Existing `initProject`, `writeHumanFile` and `project.create` remain compatible. - [ ] **Red:** Test `bootstrap_connects_all_resources`: inspect the actual organization file, code `.mosaic/project.json`, records HEAD/spec author, chat association, tracker tree/board, working-repo seed and next launch's project list. Test stale organization/plan, changed source commit, symlink ancestor, path overlap, preexisting unrelated data and partial initialization. Assert every ordinary organization writer still rejects project changes. - [ ] **Red verification:** Run `node --test packages/business/tests/project-bootstrap.test.mjs packages/bus/tests/request-bootstrap.test.mjs`.