Files
jason.woltjeandClaude Opus 5.5 c9df996ac1 agents: Rocko row 153 round 1 packet (#1647)
Build packet for row 153, project init cleanup and the nested records repo
refusal. Filbert approved round 1 (comment 28727). Committed by Sage for
Rocko, who has no git authority; secrets scan clean, no binaries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 19:28:02 -05:00

5.3 KiB

Row153 #1647 — initializer cleanup and project confinement

Base686fc1cb6d4ce77a441b2953aa09dfc441ce9a39; detached worktree /mnt/storage/src/mosaic-stack-rocko-153. Claim1476. Reviewer Filbert, gate Sage. Brief third section docs/plans/2026-10-15_landing-followups.md, blob4e620d79. No product code commits, live file/unit/store action, credentials or push.

Before and after

A failed initial commit previously left an uncommitted layout: init couldn't retry, check called it valid and the writer refused the dirty index. Init now records its created file/directory identities. Failure deletes those layout files individually, removes empty created layout directories, and removes the exclusive initializer-owned .git. Newly created parents are removed only when empty. A pre-existing empty target keeps its inode. Unknown files at the root or inside a new layout directory survive; these can leave a non-empty target requiring human inspection before retry. A replacement owned inode refuses project-init-cleanup and is preserved, rather than deleting another actor's path. The private .git is treated as an owned unit; external tools must not modify Git metadata during initialization. This is ordinary exception rollback, not recovery from SIGKILL/power loss or adversarial concurrent filesystem mutation.

The checker separates layout inspection from commit existence. Init checks the layout before its first commit; public checkProject throws ProjectError with code project-no-commit if an otherwise valid repository has no readable HEAD commit. Existing successful check's return shape stays {ok,repo,problems}; other layout errors remain reported in problems. The existing CLI maps ProjectError to exit2. No new CLI command or error-handling branch was added.

projectRepo checks the records path against every declared business project's code root in both directions, including equality. A configured repo inside a sibling project's root now refuses project-path before creating any directory. The loaded multi-project business fixture covers it, and a disjoint path passes. The existing human-definition rejection is pinned by a valid docs write request, with exact project-author code and unchanged files, clean index and HEAD.

Brief path correction — sage-0469

The brief names packages/business/src/business.mjs:projectRepo, but that function lives in packages/project/src/paths.mjs. At Rocko's request Sage agreed in sage-0469 to fix paths.mjs (already in owned packages/project/src/) and leave business.mjs alone. The multi-project loaded-document test remains in packages/business/tests/project-repo.test.mjs as requested. No schema, layout, spec/ authority rule or business configuration shape changed.

Focused evidence and pending gate

Fixture-only singly invoked node --test checks, no browser/Docker/sandbox:

  • project/tests/init-failure.test.mjs:8 pass.
  • project/tests/project.test.mjs:14 pass.
  • business/tests/project-repo.test.mjs:2 pass.
  • cli/tests/project.test.mjs:3 pass. 27 passed, 0 failed/skipped. Red-init.log shows the four missing cleanup/no-commit/ confinement behaviors before implementation; the already-present human refusal passed and is to be validated by Q2's mutant. red-nested-cleanup.log caught the first cleanup implementation recursively removing an unrelated nested file; cleanup now tracks owned layout files individually. The loaded business test initially tried to mutate a frozen validated object; it now revalidates a changed fixture document, and its green run is authoritative.

Eight mutants are prepared and exact-once sites preflighted only. Request sent for the slot; no suite, gate or mutant batch has run. Planned targeted package checks: project, business and cli. Every scripts/test-*.sh is required on Sage's landing gate by the brief. Do not claim gate or mutant results until run.

Authorized package gate and mutants — sage-0472

Completed2026-10-16 00:19:23 UTC on the unchanged686fc1cb6 candidate. Commands: DOCKER_HOST=unix:///nonexistent.sock npm test --prefix packages/NAME, sequentially for project, business and cli. Project22, business108, CLI212:342 passed, 0 failed/skipped, every command exit0. No flake or rerun. Suite logs in this packet. No Docker used or network created. Shell suites remain Sage's landing gate; Rocko has not run them.

Eight mutants killed, none survived/timed out or failed by syntax/import error. Each exact-once edit ran in its own process group with whole-group timeout cleanup and finally restoration. Human-author Q2 fails the exact refusal test.

Check Result Exit
01-cleanup-owned-layout KILLED 1
02-preserve-existing-empty-target KILLED 1
03-remove-created-empty-target KILLED 1
04-preserve-unrelated-nested-file KILLED 1
05-require-readable-commit KILLED 1
06-refuse-other-project-root KILLED 1
07-refuse-human-author-Q2 KILLED 1
08-preserve-replaced-owned-path KILLED 1

All six candidate hashes restored. Cwd-scoped /proc sweep found no node, chromium or python runners under the worktree; every runner exited. Sent Sage clear at the observed stamp above. This supersedes the prepared/unrun status. No source change was needed after the package runs or mutants. Review and Sage's landing gate remain pending; no live steps, push or candidate source commit.