Skip to content

feat(workspace): add hygiene report#150

Merged
chubes4 merged 1 commit into
mainfrom
feat-workspace-hygiene-report
Apr 30, 2026
Merged

feat(workspace): add hygiene report#150
chubes4 merged 1 commit into
mainfrom
feat-workspace-hygiene-report

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented Apr 29, 2026

Summary

  • Adds a non-destructive workspace hygiene report that surfaces workspace size, free disk, worktree counts, and local cleanup candidates.
  • Provides both on-demand CLI/ability access and an opt-in weekly system task for recurring visibility.
  • Keeps the default report bounded and local-only so it does not require GitHub lookups or perform cleanup.

Changes

  • Adds wp datamachine-code workspace hygiene with table and JSON output, plus --skip-cleanup, --skip-sizes, and --size-limit options.
  • Registers datamachine/workspace-hygiene-report for agent/runtime use.
  • Adds workspace_hygiene_report as a disabled-by-default system task and weekly recurring schedule.
  • Reuses existing worktree listing and cleanup dry-run logic, enriching cleanup candidates with best-effort size data when available.
  • Adds focused smoke coverage for CLI rendering and task gating/completion behavior.

Incident context

  • On 2026-04-29, the local workspace fell to about 1.1 GiB free because stale worktrees grew to roughly 712.6 GiB.
  • This report is intended to make that class of disk-pressure failure visible before cleanup becomes urgent, while keeping the default path review-only and non-destructive.

Tests

  • php -l data-machine-code.php inc/Abilities/WorkspaceAbilities.php inc/Cli/Commands/WorkspaceCommand.php inc/Workspace/Workspace.php inc/Tasks/WorkspaceHygieneReportTask.php tests/smoke-workspace-hygiene-cli.php tests/smoke-workspace-hygiene-task.php
  • php tests/smoke-workspace-hygiene-cli.php
  • php tests/smoke-workspace-hygiene-task.php
  • php tests/smoke-worktree-cleanup-cli.php
  • git diff --check
  • homeboy lint data-machine-code --path /Users/chubes/Developer/data-machine-code@feat-workspace-hygiene-report --file inc/Tasks/WorkspaceHygieneReportTask.php --summary
  • homeboy lint data-machine-code --path /Users/chubes/Developer/data-machine-code@feat-workspace-hygiene-report --file tests/smoke-workspace-hygiene-cli.php --summary
  • homeboy lint data-machine-code --path /Users/chubes/Developer/data-machine-code@feat-workspace-hygiene-report --file tests/smoke-workspace-hygiene-task.php --summary

Full scoped lint on the broader touched legacy files still reports pre-existing PHPStan/PHPCS drift in Workspace.php, WorkspaceCommand.php, WorkspaceAbilities.php, and data-machine-code.php; the new task and smoke files are clean.

Closes #146

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (GPT-5.5)
  • Used for: Implemented the workspace hygiene report, CLI/ability/task wiring, smoke tests, and PR description. Chris remains responsible for review and merge.

@chubes4 chubes4 force-pushed the feat-workspace-hygiene-report branch from 4ff27a6 to bd789ff Compare April 30, 2026 00:19
@chubes4 chubes4 merged commit fb4c959 into main Apr 30, 2026
@chubes4 chubes4 deleted the feat-workspace-hygiene-report branch April 30, 2026 00:19
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 scheduled workspace hygiene reports

1 participant