Summary
Add a partio clean command that removes orphaned and stale state files from .partio/state/. When git hooks are interrupted (crash during commit, failed amend, aborted operations), pre-commit state files can be left behind. Over time these accumulate and can cause spurious checkpoint creation on the next commit.
Default behavior:
- Remove pre-commit state files left by interrupted hook operations
- Remove session state for sessions that ended but whose state files were not cleaned up
With --all flag:
- Remove all session state files regardless of session status
Why
Partio saves detection state to .partio/state/pre-commit.json before each commit and deletes it in post-commit. If the commit is interrupted before post-commit runs, this file lingers. On the next commit, Partio may pick up the stale state and create an incorrect checkpoint linkage. A partio clean command lets users recover without running partio disable && partio enable.
Source
Inspired by entireio/cli PR #846 which fixed entire clean --all to clean all sessions (not just orphaned ones) — changelog 0.5.3.
Acceptance Criteria
Program file
Summary
Add a
partio cleancommand that removes orphaned and stale state files from.partio/state/. When git hooks are interrupted (crash during commit, failed amend, aborted operations), pre-commit state files can be left behind. Over time these accumulate and can cause spurious checkpoint creation on the next commit.Default behavior:
With
--allflag:Why
Partio saves detection state to
.partio/state/pre-commit.jsonbefore each commit and deletes it in post-commit. If the commit is interrupted before post-commit runs, this file lingers. On the next commit, Partio may pick up the stale state and create an incorrect checkpoint linkage. Apartio cleancommand lets users recover without runningpartio disable && partio enable.Source
Inspired by
entireio/cliPR #846 which fixedentire clean --allto clean all sessions (not just orphaned ones) — changelog 0.5.3.Acceptance Criteria
partio cleanremoves orphaned state files from.partio/state/partio clean --allremoves all session state files, including idle sessionsProgram file