issue-324: Document the worktree config section #330
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-324/document-the-worktree-config-section"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
324: Document the worktree config section
Closes #324 — 324.
Generated in 30m 37s.
Review findings
I'll start by grounding myself in the repo state and the specific finding.
The tree is clean with the Stage 1 change committed. The finding targets the parenthetical "(and the launch-repo run state)" in the README. Before editing, let me verify the factual claim behind the finding against ADR-022 §7 and the code.
The finding is confirmed by both sources. Let me read ADR-022 §7 in full to get the precise phrasing for the fix.
ADR-022 §7 is clear: the registry is at the launch route, and the per-run state (execution directory) is inside the worktree. The parenthetical note in the README is factually incorrect. Applying the minimal fix as suggested.
Now let me check that no other doc has the same "launch-repo run state" contradiction, and verify the edit in context.
The only contradictory statement was the parenthetical in the README. (The general statement in AGENTS.md that "all execution state is under
.pi-loop/runs/<run-id>/" doesn't make any claim about the launch root, so it's fine.) Let me check the corrected paragraph in context:Fix applied. Now let me confirm the gate commands from package.json and run them.
Build and lint pass. Now the test suite:
All gates pass:
npm run build(exit 0),npm run lint(exit 0),npm test(152 files / 2222 tests, all green). Let me do a final check that the working tree contains only my intended change.The single finding is resolved and all gates are green. Final annotated findings:
Review Findings — 324
Summary
Gates run and passed:
npm run build(exit 0,dist/emitted),npm test(152 files / 2222 tests, all green),npm run lint(exit 0). Prettier check on the five touched files flagsDESIGN.md, but that failure is pre-existing (the parent commit fails identically with the same 225 reformat lines, no added line from this change appears in the Prettier diff, and 42 repo files failformat:checkrepo-wide; AGENTS.md's mandated gates are lint + test). The change is docs-only and all material claims were verified against the implementation (src/config/services/configFile.ts,src/config/helpers/validateWorktreeDir.ts,src/shared/git/services/resolveWorktree.ts,src/cli/services/runCli.ts) and ADR-022:enableddefaults totruewhen the section is present,dirrequired when enabled, the four parse-timedirchecks (tilde/absolute/inside-repo/exists-directory, no writability test),ConfigFileError→error.jsonkind: configexit 1, config loaded before origin detection,GitWorktreeErrorearly-abort (stderr, exit 1, noerror.json), registry at launch root consulted beforeworktreeDir, noPILOOP_WORKTREE_*env vars, batch/scan unaffected, and the commented-out example block still parses in its existing test. One genuine finding: a parenthetical in the README that contradicts ADR-022 §7 on where run state lives.Critical
High
Medium
issue-context.json,run.log,error.json,*.diff) is created inside the worktree in worktree mode — verified in code,setupIssueRunreceiveseffectiveCwd(the resolved worktree) andcreateRunContextbuilds<repoRoot>/.pi-loop/runs/<run-id>from it (src/cli/services/runCli.ts:1393-1397,src/run/services/runDirectory.ts:47). Only the worktree registry lives at the launch root. Suggested fix: drop the parenthetical or restate it accurately, e.g. "The worktree registry stays at the repo pi-loop was launched from (per-run state lives inside the worktree — ADR-022 §7); on resume the registry wins, so a changeddirnever moves an in-flight tree."Low