Skip to content

fix(workspace): add artifact-only cleanup plans#161

Merged
chubes4 merged 1 commit into
mainfrom
feat-worktree-artifact-cleanup-profiles
Apr 30, 2026
Merged

fix(workspace): add artifact-only cleanup plans#161
chubes4 merged 1 commit into
mainfrom
feat-worktree-artifact-cleanup-profiles

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented Apr 30, 2026

Summary

  • Add a plan-first worktree artifact cleanup command for profile-derived build outputs.
  • Keep artifact cleanup separate from whole-worktree removal so build directories can be reviewed and removed without deleting worktrees.

Changes

  • Adds datamachine/workspace-worktree-cleanup-artifacts and wp datamachine workspace worktree cleanup-artifacts.
  • Requires dry-run JSON before deletion and revalidates worktree metadata plus exact artifact paths when applying a plan.
  • Protects dirty/unpushed worktrees by default and always protects active Studio plugin/theme symlink targets.
  • Adds artifact-specific summary stats separate from worktree cleanup/removal stats.
  • Adds pure-PHP smoke coverage for planning, apply-plan deletion, plan mismatch rejection, and safety protections.

Closes #145

Tests

  • php -l inc/Workspace/Workspace.php
  • php -l inc/Cli/Commands/WorkspaceCommand.php
  • php -l inc/Abilities/WorkspaceAbilities.php
  • php -l tests/smoke-worktree-cleanup-artifacts.php
  • php -l tests/smoke-worktree-cleanup-cli.php
  • php tests/smoke-worktree-cleanup-artifacts.php
  • php tests/smoke-worktree-cleanup-cli.php
  • php tests/smoke-worktree-cleanup.php
  • git diff --check
  • homeboy audit data-machine-code --path /Users/chubes/Developer/data-machine-code@feat-worktree-artifact-cleanup-profiles --changed-since origin/main

Known environment/pre-existing blockers:

  • homeboy lint data-machine-code --path /Users/chubes/Developer/data-machine-code@feat-worktree-artifact-cleanup-profiles --changed-since origin/main reports existing PHPCS/PHPStan findings in touched files and smoke harnesses.
  • homeboy test data-machine-code --path /Users/chubes/Developer/data-machine-code@feat-worktree-artifact-cleanup-profiles fails during WordPress Playground/Data Machine activation before DMC tests with SQLSTATE[42S02]: Base table or view not found: 1146 Table 'wptests_options' doesn't exist.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (GPT-5.5)
  • Used for: Implemented the artifact-cleanup command/ability and smoke tests; Chris reviews and validates before merge.

@chubes4 chubes4 force-pushed the feat-worktree-artifact-cleanup-profiles branch from 44ef5fd to 4d73773 Compare April 30, 2026 14:52
@chubes4 chubes4 merged commit a16ecb9 into main Apr 30, 2026
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.

Add repo-specific worktree artifact cleanup profiles

1 participant