Remove gitExclude and assertCleanWorkingTree #53

Merged
david merged 2 commits from issue-52/remove-gitexclude-and-clean-working-tree-check into main 2026-07-30 11:39:23 +00:00
Owner

Summary

Fix resume failure at implement stage caused by two mechanisms that conflicted with resume semantics:

  1. gitExclude modified .gitignore, dirtying the tree — cleanPiLoopGitignore() removed .pi-loop/ from .gitignore during createRunContext(), making the working tree dirty.
  2. assertCleanWorkingTree() threw unconditionally during resume — Resume from implement has uncommitted code from the previous partial LLM run — exactly the state resume is designed to handle.

Solution: Remove both mechanisms entirely. Rely on .pi-loop/ being in the target repo's .gitignore for exclusion — git naturally excludes ignored paths from diff and add.

Changes

  • Delete src/run/services/gitExclude.ts and its tests
  • Remove cleanPiLoopGitignore from runDirectory.ts and run/index.ts
  • Simplify DIFF_PATHSPEC to ['--', '.'] in captureDiff.ts
  • Remove assertCleanWorkingTree from gitState.ts and implement stage
  • Simplify git add in runMrStage.ts (no :(exclude) pathspec)
  • Update AGENTS.md and IMPLEMENTATION_PLAN.md documentation
  • Update all affected tests

Testing

  • All 849 tests pass
  • Full test suite run with no regressions
  • npm run lint passes
  • npm run build passes

Checklist

  • Self-reviewed the diff
  • Code follows project conventions
  • Descriptive naming
  • Documentation updated
## Summary Fix resume failure at implement stage caused by two mechanisms that conflicted with resume semantics: 1. **gitExclude modified .gitignore, dirtying the tree** — cleanPiLoopGitignore() removed .pi-loop/ from .gitignore during createRunContext(), making the working tree dirty. 2. **assertCleanWorkingTree() threw unconditionally during resume** — Resume from implement has uncommitted code from the previous partial LLM run — exactly the state resume is designed to handle. **Solution:** Remove both mechanisms entirely. Rely on .pi-loop/ being in the target repo's .gitignore for exclusion — git naturally excludes ignored paths from diff and add. ## Changes - Delete src/run/services/gitExclude.ts and its tests - Remove cleanPiLoopGitignore from runDirectory.ts and run/index.ts - Simplify DIFF_PATHSPEC to ['--', '.'] in captureDiff.ts - Remove assertCleanWorkingTree from gitState.ts and implement stage - Simplify git add in runMrStage.ts (no :(exclude) pathspec) - Update AGENTS.md and IMPLEMENTATION_PLAN.md documentation - Update all affected tests ## Testing - [x] All 849 tests pass - [x] Full test suite run with no regressions - [x] npm run lint passes - [x] npm run build passes ## Checklist - [x] Self-reviewed the diff - [x] Code follows project conventions - [x] Descriptive naming - [x] Documentation updated
Resume from implement failed because:
1. gitExclude modified .gitignore (dirtying the tree)
2. assertCleanWorkingTree threw unconditionally during resume

Fix: remove both mechanisms entirely. Rely on .pi-loop/ being
in the target repo's .gitignore for exclusion — git naturally
excludes ignored paths from diff and add.

Changes:
- Delete src/run/services/gitExclude.ts and its tests
- Remove cleanPiLoopGitignore from runDirectory and run/index
- Simplify DIFF_PATHSPEC to ['--', '.'] in captureDiff
- Remove assertCleanWorkingTree from gitState and implement stage
- Simplify git add in runMrStage (no :(exclude) pathspec)
- Update AGENTS.md and IMPLEMENTATION_PLAN.md documentation
Update documentation to reflect the new .gitignore-based approach
after removing ensureGitExclude and the assertCleanWorkingTree preflight:

- buildMrWrapper.ts: replace stale JSDoc NOTE about ensureGitExclude
  with the new .gitignore-based convention
- DOMAIN.md: update Diff capture glossary entry, remove git-exclude entry
- DESIGN.md: update run directory hygiene, Stage 1 output, D13 rationale,
  risk table, and test list to remove :(exclude) and git-exclude references
- CODING_STANDARDS.md: remove git-exclude from deterministic seams list
david merged commit 4183f8a886 into main 2026-07-30 11:39:23 +00:00
david deleted branch issue-52/remove-gitexclude-and-clean-working-tree-check 2026-07-30 11:39:23 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
david/pi-loop!53
No description provided.