# ID 87 - C1 STATUS REPORT - BUILDER SAFETY REPAIRS AND REAL BUILD PROOF Branch: avidtech6/freshcards :: feat/id87-builder-multi-agent-safety Worktree: /opt/id87-impl/wt (VPS) Report time: 2026-11-20T02:10Z Status: PAUSED - AWAITING C1 AUTHORISATION --- ## 1. CURRENT TASK C1 assignment "CONTINUE BUILDER SAFETY REPAIRS AND REAL BUILD PROOF", phases 1 to 5. - Phase 1 (recover/protect the uncommitted files): COMPLETE. - Phase 2 (five safety fixes + harness repairs): COMPLETE. - Phase 3 (suite genuinely GREEN from a clean state, twice): tests GREEN twice. The commit/push/read-back leg is OUTSTANDING. - Phase 4 (isolated end-to-end REST Builder test): NOT STARTED. - Phase 5 (final human-readable report to GitHub or FVHQ): this document is the interim report; the final one is not published. --- ## 2. COMPLETED ### Phase 1 - the four uncommitted files are protected Recovery set written OUTSIDE the repository, so no repository operation can destroy it: /opt/id87-impl/recover/20261120T0150Z/ uncommitted.patch 8600 bytes (git diff --binary) files/ byte copies of all four files files.sha256 sha256 manifest numstat.txt, head-at-recovery.txt, RESTORE.txt HEAD at recovery: 6bca894b59d817ae0e905b951eed9739634f9983 ### Phase 2 - the safety fixes and the harness repairs Seven files changed, 338 insertions, 41 deletions (uncommitted). PRODUCT fixes - `modules/router/lib/worktree.cjs` - `worktreeOwnership` now initialises `repoCommonDir` and `repoRoot` as STRINGS on every return path. MEASURED BEFORE: the early returns left them undefined and a consumer read them without a guard, so the sweep logged "the worktree sweep failed: Cannot read properties of undefined (reading 'indexOf')" and ABORTED its tick. The worktrees after the failing one were never examined, so every "it was PRESERVED" assertion passed because the sweep had CRASHED, not because it had preserved anything. That was a FALSE GREEN. - `modules/router/src/fcr-endpoint.mjs` - the repository root is read as a string and `inMine` is only computed for an owned worktree. The sweep now PRESERVES a worktree that belongs to another repository. - `deploy/runtime/builder-deploy.sh` - the door reads `DOOR_ROOT` from `FCR_WORKTREE_ROOT` (default `/opt/worktrees`), the same variable `modules/router/lib/worktree.cjs` reads. MEASURED BEFORE: the door hard-coded `/opt/worktrees` while the endpoint's root is configurable, so the two could disagree and the disagreement surfaced only at deploy time. HARNESS repairs - PID-derived ports in three suites; the environment variable still wins. The cross-process sweep's port assertions are now computed from the same constant, so they cannot disagree with it. - `realpathSync` imported into the sweep suite. MEASURED BEFORE: the cleanup called `fs.realpathSync` in a file that does not import `fs`; the call threw a ReferenceError, a bare `catch` swallowed it, the cwd came back empty, the check decided the process was FOREIGN, and the cleanup SKIPPED the very processes it existed to kill. - The cleanup no longer swallows an exception that changes a control decision; a process that is already gone (ENOENT) is distinguished from a harness fault, which now FAILS the run. - Leak counting reads the process STATE from `/proc//stat`. A zombie is not a leak: `process.kill(pid, 0)` succeeds for an unreaped zombie. - The children write to the log through a file descriptor and are `unref()`ed, and an `after` hook guarantees the cleanup. MEASURED BEFORE: a leaked child held the parent's event loop, so `node --test` NEVER EXITED. The suite HUNG instead of reporting a failure, and a hang is not a receipt. - The sweep assertions read BOTH instance logs. MEASURED BEFORE: only the process holding the sweep lock sweeps, and which one holds it changes from tick to tick, so an assertion on one log asserted on a race. - `waitFor` no longer swallows the predicate's exception. MEASURED BEFORE: a broken predicate was indistinguishable from a condition that had not happened yet, and a one-character typo appeared as a 30-second timeout. - `P1.11` rewritten as a BEHAVIOURAL proof of the door. MEASURED BEFORE: it matched the source literal `/opt/worktrees/*`, so it failed the moment the door was CORRECTED to read the endpoint's root from the environment. ### Phase 3 - the suite is GREEN, twice, from a clean state Runner log: `/opt/id87-impl/runs-all.log` Per-run TAP and stderr: `/opt/id87-impl/runs/` --- ## 3. UNFINISHED - The seven changed files are UNCOMMITTED. Local HEAD = remote tip = `6bca894b59d817ae0e905b951eed9739634f9983`. Nothing from this round has been pushed. - Phase 3's last leg: commit under ID87's own identity, push to the authorised branch, read back the remote SHA and the changed-file list. - Phase 4: the isolated end-to-end REST Builder test is NOT STARTED. - Phase 5: the final human-readable report is NOT published. Working-tree digests (sha256, first 16 hex): e18052cd37b7108b deploy/runtime/builder-deploy.sh 1f54f5787969bd52 modules/router/lib/worktree.cjs 982f845836666726 modules/router/src/fcr-endpoint.mjs 39aeffaa334813be scripts/tests/fvc1594-actor-delegation.test.mjs ee9ee89393ff85da scripts/tests/fvc1594-cross-process-sweep.test.mjs 7d3d309226a21aa0 scripts/tests/fvc1594-deploy-door-binding.test.mjs 58767ca657727a83 scripts/tests/fvc1594-two-agent-builder.test.mjs --- ## 4. TEST RESULTS LAST GENUINELY EXECUTED RESULT: PASS. Command: `cd /opt/id87-impl/wt && node --test scripts/tests/.test.mjs` Runner: `bash /opt/id87-impl/run_suites.sh /opt/id87-impl/wt /opt/id87-impl/runs` Result: `suite_runs=12 suite_runs_that_failed=0` (six suites, two consecutive passes, each pass preceded by a clean-state sweep of fixture processes and fixture directories). suite pass 1 pass 2 fvc1594-worktree-isolation 10/10 PASS 10/10 PASS fvc1594-deploy-door-binding 14/14 PASS 14/14 PASS fvc1594-runtime-drift 10/10 PASS 10/10 PASS fvc1594-cross-process-sweep 9/9 PASS 9/9 PASS fvc1594-two-agent-builder 6/6 PASS 6/6 PASS fvc1594-actor-delegation 6/6 PASS 6/6 PASS 55 assertions per pass, 0 failures, 0 skipped, 0 todo. No leaked endpoint process and no leftover fixture directory after any run. The only live endpoint on the box is the production one, untouched. Earlier results, recorded for the history and NOT retested after the fixes: - cross-process-sweep was 6/9 in the first pass and 6/9 in the second (failures: P3.2, P3.8 and P3.7 in one pass; P3.2, P3.4 and P3.7 in the other). Each failure is explained above: a product TypeError, a harness ReferenceError, a broken predicate call, and a log-side race. - deploy-door-binding was 13/14 (P1.11, the source-literal assertion). --- ## 5. FOUR STATUS LABELS SAVED: The seven-file change set exists as bytes in the worktree, with a sha256 manifest, and a byte-exact recovery copy plus patch outside the repository. It has NOT been committed. INTEGRATED: NO. Not committed, not pushed, not merged into any branch. The remote tip of `feat/id87-builder-multi-agent-safety` is still `6bca894b59d817ae0e905b951eed9739634f9983`. DEPLOYED: NO. Nothing was deployed and no deploy endpoint was invoked. The live endpoint still runs the pre-existing code; the door change and the repository guard are candidate code only. VERIFIED: PARTIAL. The six suites are GREEN twice against the candidate tree, with every negative control proven to fire. Nothing is verified live, and the candidate tree is not on any remote branch. --- ## 6. BLOCKERS - Not a credential blocker for the suites: they ran as root with no credential. - The commit and push leg needs authorisation to write to the shared branch. The suite results are unreproducible for anyone else until that leg lands. - Phase 4 has to be built: a disposable bare Git repo as origin, a disposable endpoint instance (own port, own token, own state, own worktree root, own sandbox map), the real worker at `/opt/vibecoder-bridge/src/modules/vibechat-agents/src/aider-background-worker.cjs`, the real free-model router, and a no-op deploy door so that nothing can be deployed. Not yet built. - Phase 4's outcome is genuinely at risk of FAILING, by the acceptance criteria: the newest live job's recorded result is a greeting ("I'm not sure what you say. How can I help you build today?"). A job that returns a greeting and changes no file must NOT count as a build. - Open, unrelated, untouched this round, operator action: the admin-scoped GitHub PAT in thread 87's HQ secrets row is retrievable unauthenticated via `POST /api/mavis/register {"id":87}`, and the panel repository's origin URL embeds a PAT in cleartext. Both need revocation and a re-gated route. - `GET /api/mavis/me` echoes the caller's own token in cleartext. It was called once and NOT called again; the token is not repeated anywhere in this report. --- ## 7. NEXT ACTIONS 1. Commit the seven files under ID87's own identity on `feat/id87-builder-multi-agent-safety`, push to the authorised branch, and read back the remote SHA and the changed-file list. That closes Phase 3 and makes the GREEN result reproducible for a peer. 2. Build and execute the isolated end-to-end REST Builder test (Phase 4): Request -> real free-model router -> real Builder worker -> isolated worktree -> changed source file -> tests -> commit -> push to a disposable local bare Git repo. Prove project/repo/worktree/changed-file/ commit/actor-result correctness, prove that a greeting or a "done" without changed code does NOT count, and prove that concurrent jobs, failed jobs and retries cannot interfere. 3. Publish the final human-readable report to GitHub or FVHQ with a C1-readable canonical link, and post the HQ receipts (Phase 5). --- ## 8. EVIDENCE - Branch: `avidtech6/freshcards` :: `feat/id87-builder-multi-agent-safety` - Pushed tip (unchanged this round): `6bca894b59d817ae0e905b951eed9739634f9983` - Base and `origin/main` (unchanged): `a2fb27b5a170c96207d3ba08568c3e1823848256` - Living plan (owned by C1; ID87 did not edit it in this round): `avidtech6/fvhq` :: `coordination/c1-brain-isolation-and-release-20261119` at `be35298a20cbbf677af67e322936e670ecab0453` - Prior FVHQ receipts for this lane: bulletin `21653` with prompts `120`/`121`/`122` (C1 mega brief); bulletin `21666` with prompts `124`/`125`/`126` (Peerlist A ACK). - Runner log: `/opt/id87-impl/runs-all.log` (summary line `suite_runs=12 suite_runs_that_failed=0`). - Per-run TAP and stderr: `/opt/id87-impl/runs/`. - Recovery set: `/opt/id87-impl/recover/20261120T0150Z/`. - Test run log from the previous round (kept, not overwritten): `/workspace/output/arc2-builder-multi-agent/report-mega.md`.