Skip to content

Post-backlog: complete refactor plan from a fallow static-analysis pass #102

@dividedby

Description

@dividedby

What

Run a full static-analysis pass over the control plane with fallow and turn the findings into a complete refactor PLAN (propose-only — no applied refactors).

Fallow is a Rust-native, zero-config analyzer for TS/JS (MIT, free static layer): unused code/exports/dependencies, duplication clone families, circular deps, complexity hotspots, architecture boundaries. Deterministic output with machine-readable JSON (npx fallow audit --format json, npx fallow health --score --hotspots --targets), explicitly built to feed agents structured evidence. This repo is TypeScript + ESM run via tsx, so it's in scope.

Gate (rescoped 2026-06-10)

Runs last. Dependency narrowed from the full backlog to the three issues being driven through the current autonomous loop: #94, #107, #114 must be closed first. The refactor plan then works against the codebase state those three leave behind, instead of chasing in-flight changes. Do not start this issue while any of #94/#107/#114 is open.

Agent brief

  1. Confirm Pre-stage the CC 2.1.170 Release adoption on skrabe's open PR pair (tf#7 + lcc#6) — current on merge day #94, staleness-review: Node 22→26 cross-major + pnpm minor bump (web-verified, 3 findings) #107, integration-gate: boot-verify claude -p has no --model pin or --max-budget-usd cap #114 are all closed. If any is open, stop — gate unmet.
  2. Run fallow's static layer over the repo; capture the JSON report (audit --format json, health --score --hotspots --targets) as evidence (attach to the proposal).
  3. Feed the findings into /improve-codebase-architecture (which already reads CONTEXT.md + docs/adr/) so the plan respects recorded decisions — notably ADR 0004 (no build step — don't propose a bundler/dist) and ADR 0007 (defer-vs-reinvent verdicts for skrabe's canonical pieces — don't re-litigate Showtime/Driver/Four-zeros/auditMisbinds).
  4. Output: a refactor PLAN, propose-only. Do not apply refactors. Split into issues via /to-issues only if the plan is accepted.

Acceptance

  • fallow JSON evidence captured.
  • A written refactor plan posted for review (no code changes committed, no PRs opened).
  • Plan visibly maps each proposal against ADR 0004 / ADR 0007.

Triage note

Re-triaged ready-for-humanready-for-agent per maintainer decision (2026-06-10): the loop may run this autonomously, but only after #94/#107/#114 are handled. The output stays propose-only, so a human still approves before any refactor is implemented.

Source: Idea Inbox #99.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions