Skip to content

fix: make phase 7 cleanup reversible#331

Open
sjh9714 wants to merge 2 commits into
Egonex-AI:mainfrom
sjh9714:fix/reversible-understand-cleanup
Open

fix: make phase 7 cleanup reversible#331
sjh9714 wants to merge 2 commits into
Egonex-AI:mainfrom
sjh9714:fix/reversible-understand-cleanup

Conversation

@sjh9714

@sjh9714 sjh9714 commented May 30, 2026

Copy link
Copy Markdown

Summary

Fixes #301.

Phase 7 no longer asks the host shell to immediately delete freshly-created .understand-anything/intermediate and tmp work directories. Instead, it calls a bundled cleanup script that moves those directories into timestamped .trash-* directories and only purges trash older than seven days.

Changes

  • Add cleanup-workdirs.mjs to move intermediate/ and tmp/ into reversible trash and prune expired trash.
  • Update /understand Phase 7 to call the bundled cleanup script.
  • Add regression coverage for moving work dirs, retaining recent trash, purging expired trash, and avoiding the old Phase 7 cleanup command.
  • Bump plugin manifest versions to 2.7.6 per the repository versioning note.

Testing

  • pnpm install
  • node --check understand-anything-plugin/skills/understand/cleanup-workdirs.mjs
  • pnpm vitest run tests/skill/understand/test_cleanup_workdirs.test.mjs
  • pnpm lint
  • pnpm test
  • pnpm --filter @understand-anything/core test
  • pnpm --filter @understand-anything/skill build
  • pnpm build
  • git diff --check

Note: I used Codex while preparing this change, reviewed the final diff, and ran the listed checks locally.

@sjh9714 sjh9714 force-pushed the fix/reversible-understand-cleanup branch from 3b7fa15 to 5e85308 Compare June 7, 2026 15:00
@sjh9714

sjh9714 commented Jun 7, 2026

Copy link
Copy Markdown
Author

Rebased this onto the latest main and resolved the Phase 7 cleanup conflict by keeping the shared cleanup script path while preserving the upstream scan-result.json behavior.

Verified locally:

  • pnpm test tests/skill/understand/test_cleanup_workdirs.test.mjs
  • pnpm lint
  • pnpm test
  • pnpm build
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 7 cleanup uses rm -rf which conflicts with destructive-action policies on hardened hosts

1 participant