Merge pull request #1764 from entireio/protected-dirs · Entire
Merge pull request #1764 from entireio/protected-dirs
324995d→main·pjbgf·2d ago·7 files·+254 added/-11 removed
fix(checkpoint): exclude protected dirs from first-checkpoint snapshot
Changes
7
cmd/entire/cli
checkpoint
- Mcheckpoint_test.go+95
- Mephemeral.go+34/-5
paths
- Mpaths.go+54/-2
- Mpaths_test.go+59
Mrewind_test.go+9
- Mstate.go+2/-3
strategy
- Mcommon.go+1/-1
13 unmodified lines
....
func (fakePluginAgent) Description() string { return "fake external plugin for tests" }
func (fakePluginAgent) IsPreview() bool { return true }
func (fakePluginAgent) ProtectedDirs() []string { return []string{".terminalhire"} }
func (fakePluginAgent) ProtectedFiles() []string { return []string{".terminalhirerc"} }
// TestCollectChangedFiles_ExcludesProtectedDirs verifies that the // first-checkpoint path keeps agent-protected dirs (e.g. .claude) and the // .entire infrastructure dir out of the checkpoint snapshot, while ordinary // untracked files are still captured. Regression for protected-dir content // leaking into the shadow tree on session start. func TestCollectChangedFiles_ExcludesProtectedDirs(t *testing.T) {
t.Parallel()
..(remaining code)...
}
// isProtectedCheckpointPath reports whether a repo-relative path must be kept // out of checkpoint snapshots: the .entire infrastructure dir, or any // registered agent's declared protected dir/file.
func isProtectedCheckpointPath(relPath string) bool { ..(remaining code)... }
// collectChangedFiles returns all changed files from git status for the first checkpoint.
func collectChangedFiles(context.Context, *git.Repository) (Result, error) { ..(remaining code)... }
// IsInfrastructurePath returns true if the path is part of CLI infrastructure func IsInfrastructurePath(path string) bool { return IsSubpath(EntireDir, path) }
// IsSubpath reports whether child is lexically under parent (or equal to it). func IsSubpath(parent, child string) bool { ..(remaining code)... }