feat(unic-archon-dlc): /cleanup operational janitor (redesign step 11)#271
Merged
Conversation
…p 11) Ships the last off-line box: /cleanup, a repo-global operational janitor that reports (and, on explicit opt-in, prunes) the debris an Archon-driven lifecycle accumulates — merged/stale worktrees, stale branches/PRs, and stale workflows/<slug>/ artifact dirs. Why a command, not an Archon workflow: /cleanup mutates sibling worktrees, branches, and PRs, so it cannot run inside an isolated worktree (ADR-0017). It composes archon isolation/complete for worktree/branch lifecycle and the configured tracker (MCP-first, CLI-fallback) for PR/branch state — no tracker-adapter lib (ADR-0016/0018). Why report-first: destructive actions honour the repo's never-auto-delete and never-touch-LICENSE norms. Pruning requires --apply plus a per-category confirmation; cleanup.dry_run defaults true. A slug dir is prunable only if its PR/branch is merged or closed (cleanup.prune_slug_dirs defaults false). Also retires the legacy unic-dlc-cleanup.yaml + command stub, whose arch-review + ADR-consolidation content moved to /improve-architecture in v0.9.0 (ADR-0027 deferred the disposal to this step). - new commands/cleanup.md - cleanup config block (stale_days/dry_run/prune_slug_dirs) + tests - ADR-0028 + index row; AGENTS/CONTEXT/redesign-README sweep - bump 0.10.0 + CHANGELOG Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces redesign step 11 for unic-archon-dlc by shipping the new /cleanup repo-global operational janitor command, adding a cleanup config block (with defaults + merge tests), documenting the decision in a new ADR, and retiring the legacy unic-dlc-cleanup workflow/stub while bumping the plugin to 0.10.0.
Changes:
- Add
/cleanupcommand documentation/workflow with report-first + opt-in pruning behavior and tracker/Archon composition. - Extend
defaultConfig()with a newcleanupblock and add test coverage ensuring deep-merge/defaulting for older configs. - Retire legacy cleanup workflow artifacts, update ADR index/redesign progress/docs, and bump versions + changelog.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/claude-code/unic-archon-dlc/commands/cleanup.md | New /cleanup command spec and step-by-step operational procedure. |
| apps/claude-code/unic-archon-dlc/lib/config-schema.mjs | Adds cleanup defaults to the merged config shape. |
| apps/claude-code/unic-archon-dlc/test/config-schema.test.mjs | Tests default + merge behavior for the new cleanup config block. |
| apps/claude-code/unic-archon-dlc/docs/adr/0028-cleanup-operational-janitor.md | New ADR documenting /cleanup container choice, config, and safety posture. |
| apps/claude-code/unic-archon-dlc/docs/adr/README.md | Adds ADR-0028 to the ADR index table. |
| apps/claude-code/unic-archon-dlc/CONTEXT.md | Adds vocabulary for “operational hygiene” and the cleanup config block. |
| apps/claude-code/unic-archon-dlc/AGENTS.md | Adds /cleanup to the load-bearing invariants list. |
| apps/claude-code/unic-archon-dlc/docs/redesign/README.md | Marks step 11 as done and updates progress notes. |
| apps/claude-code/unic-archon-dlc/CHANGELOG.md | Adds the 0.10.0 release entry describing /cleanup and legacy cleanup retirement. |
| apps/claude-code/unic-archon-dlc/package.json | Bumps plugin version to 0.10.0. |
| apps/claude-code/unic-archon-dlc/.claude-plugin/plugin.json | Bumps plugin metadata version to 0.10.0. |
| apps/claude-code/unic-archon-dlc/.claude-plugin/marketplace.json | Bumps marketplace metadata version to 0.10.0. |
| apps/claude-code/unic-archon-dlc/.archon/workflows/unic-dlc-cleanup.yaml | Deletes the legacy cleanup Archon workflow. |
| apps/claude-code/unic-archon-dlc/.archon/commands/unic-dlc-cleanup.md | Deletes the legacy cleanup command stub. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot review (PR #271): the degraded/plugin-load config paths can leave PROJECT null, but Step 3 assumed PROJECT.branching to pick the main branch — internally inconsistent. Clarify that merged classification relies on Archon's own --merged signal (not PROJECT.branching), make branching a reporting-only hint with a git-derived fallback (git symbolic-ref → main), and add a Step 1 warning for the PROJECT-unset case. Non-blocking either way. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Ships redesign step 11:
/cleanup, the last off-line box — a repo-global operational janitor that reports (and, on explicit opt-in, prunes) the debris an Archon-driven lifecycle accumulates:archon isolation list/archon isolation cleanup [days] [--merged] [--include-closed])workflows/<slug>/artifact dirs (vianode:fs)Why
/cleanupmutates sibling worktrees, branches, and PRs, so it cannot run inside an isolated worktree — the ADR-0017 litmus makes it a Claude Code command. It composesarchon isolation/archon complete+ the configured tracker rather than reimplementing them (ADR-0016/0018); notracker-adapterlib.LICENSEnorms. Pruning needs--applyplus a per-category confirmation;cleanup.dry_rundefaultstrue. A slug dir is prunable only if its PR/branch is merged or closed (cleanup.prune_slug_dirsdefaultsfalse); slug-dir pruning skips any dir containing aLICENSE.unic-dlc-cleanup.yaml(arch-review + ADR-consolidation) was harvested into/improve-architecturein v0.9.0 (ADR-0027), which deferred disposing of the dormant files to this step — so this PR retires that workflow YAML + command stub.Changes
commands/cleanup.md— the new/unic-archon-dlc:cleanupcommandlib/config-schema.mjs— newcleanupblock (stale_days/dry_run/prune_slug_dirs), non-mandatory;test/config-schema.test.mjscovers defaults + deep-merge.archon/workflows/unic-dlc-cleanup.yaml+.archon/commands/unic-dlc-cleanup.mddocs/adr/0028-cleanup-operational-janitor.md+ index rowAGENTS.mddoctrine bullet,CONTEXT.mdvocabulary,docs/redesign/README.mdprogress row (step 11 → ✅)Verification
pnpm --filter unic-archon-dlc typecheck✓pnpm --filter unic-archon-dlc test✓ (112 pass, incl. new cleanup tests)pnpm --filter unic-archon-dlc verify:changelog✓ (0.10.0)🤖 Generated with Claude Code