Skip to content

feat(unic-archon-dlc): /cleanup operational janitor (redesign step 11)#271

Merged
orioltf merged 3 commits into
developfrom
feature/unic-archon-dlc-cleanup
Jul 3, 2026
Merged

feat(unic-archon-dlc): /cleanup operational janitor (redesign step 11)#271
orioltf merged 3 commits into
developfrom
feature/unic-archon-dlc-cleanup

Conversation

@orioltf

@orioltf orioltf commented Jul 3, 2026

Copy link
Copy Markdown
Member

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:

  • merged/stale worktrees (via archon isolation list / archon isolation cleanup [days] [--merged] [--include-closed])
  • stale branches/PRs (via the configured tracker, MCP-first / CLI-fallback)
  • stale workflows/<slug>/ artifact dirs (via node:fs)

Why

  • Command, not an Archon workflow. /cleanup mutates sibling worktrees, branches, and PRs, so it cannot run inside an isolated worktree — the ADR-0017 litmus makes it a Claude Code command. It composes archon isolation/archon complete + the configured tracker rather than reimplementing them (ADR-0016/0018); no tracker-adapter lib.
  • Report-first, never auto-deletes. Honours the repo's destructive-action + never-touch-LICENSE norms. Pruning needs --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); slug-dir pruning skips any dir containing a LICENSE.
  • Name repointed. The old unic-dlc-cleanup.yaml (arch-review + ADR-consolidation) was harvested into /improve-architecture in 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:cleanup command
  • lib/config-schema.mjs — new cleanup block (stale_days/dry_run/prune_slug_dirs), non-mandatory; test/config-schema.test.mjs covers defaults + deep-merge
  • Deleted .archon/workflows/unic-dlc-cleanup.yaml + .archon/commands/unic-dlc-cleanup.md
  • docs/adr/0028-cleanup-operational-janitor.md + index row
  • Docs sweep: AGENTS.md doctrine bullet, CONTEXT.md vocabulary, docs/redesign/README.md progress row (step 11 → ✅)
  • Bump 0.10.0 + CHANGELOG

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)
  • Biome + Prettier clean on all changed files

🤖 Generated with Claude Code

orioltf and others added 2 commits July 3, 2026 12:32
…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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 /cleanup command documentation/workflow with report-first + opt-in pruning behavior and tracker/Archon composition.
  • Extend defaultConfig() with a new cleanup block 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.

Comment thread apps/claude-code/unic-archon-dlc/commands/cleanup.md Outdated
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>
@orioltf
orioltf merged commit 084516b into develop Jul 3, 2026
9 checks passed
@orioltf
orioltf deleted the feature/unic-archon-dlc-cleanup branch July 3, 2026 10:43
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.

2 participants