|
| 1 | +# Maintenance Run 0007 |
| 2 | + |
| 3 | +**Date**: 2026-04-17 |
| 4 | +**Base Commit**: 47cb2c86 (Maintenance Run 0006 merge) |
| 5 | +**Current HEAD**: eaefd35b |
| 6 | +**Scope**: Pre-release maintenance for v3.0.0 |
| 7 | +**Commits since last run**: 1751 (261 merges) |
| 8 | + |
| 9 | +## Changes Since Last Run |
| 10 | + |
| 11 | +Major features merged since run 0006 (partial list): |
| 12 | + |
| 13 | +- **VS Code extension** (Spec 0602): New `packages/vscode/` thin client over Tower API — Pseudoterminal↔WebSocket terminals, sidebar TreeViews, auto-Tower startup, SecretStorage auth |
| 14 | +- **codev-core package** (Spec 0602): Shared runtime extracted from codev — `TowerClient`, `auth`, `workspace`, `EscapeBuffer` — published as `@cluesmith/codev-core` |
| 15 | +- **TICK protocol removed** (Spec 653): Replaced by multi-PR workflow in SPIR/ASPIR; verify phase added; worktree reused across multiple PRs |
| 16 | +- **Hermes consult backend** (Spec 671): Optional 4th consultation model; kept off by default |
| 17 | +- **afx rename** (Spec 647): `af` → `afx` across CLI, bin shims, and docs |
| 18 | +- **Configuration overhaul** (Spec 618): Systematic config reorganization |
| 19 | +- **Terminal scroll consolidation** (Spec 627): `ScrollController` state machine replaces three competing mechanisms |
| 20 | +- **Team standalone CLI** (Spec 599): `team` extracted from `afx team` |
| 21 | +- **pnpm monorepo migration** (PR #669): Yarn/npm workspaces → pnpm 10 |
| 22 | +- **MAINTAIN protocol simplification** (current branch base): Reduced from 4 phases to 2 |
| 23 | + |
| 24 | +## What Was Done |
| 25 | + |
| 26 | +### Dead Code / Dependencies Removed |
| 27 | + |
| 28 | +| Item | Location | Why | |
| 29 | +|------|----------|-----| |
| 30 | +| `http-proxy` | `packages/codev/package.json` | Zero imports in `src/`; leftover from pre-Tower dashboard proxy. Flagged in run 0006 but not removed then. | |
| 31 | +| `@types/http-proxy` | `packages/codev/package.json` | Types for the now-unused `http-proxy` package. | |
| 32 | + |
| 33 | +Other ts-prune/depcheck findings were investigated but retained: |
| 34 | + |
| 35 | +- `@vitest/coverage-v8` — dynamically loaded by vitest config at `vitest.config.ts:30` (`provider: 'v8'`), depcheck can't detect this. |
| 36 | +- `@xterm/xterm` — was flagged as transitively resolved; per Gemini's 3-way review, pinned explicitly in `devDependencies` (`^5.5.0`) since the test file imports it directly. Relying on a transitive dashboard dep was fragile. |
| 37 | +- `state.ts` util/annotation/architect exports — used in test files; part of public state API surface. |
| 38 | +- `forge.ts`, `github.ts`, `templates.ts`, `scaffold.ts`, `skeleton.ts`, `team.ts` unused exports — all used by their sibling test files. Conservative: keep public API stable. |
| 39 | +- `cli.ts:378 run()` — exported for bin shims (`afx.js`, `consult.js`). |
| 40 | +- `terminal/index.ts` re-exports — barrel file for external consumers; not dead. |
| 41 | + |
| 42 | +### Documentation Updated |
| 43 | + |
| 44 | +**`codev/resources/arch.md`**: |
| 45 | +- Refreshed `afx` commands tree: added `spawn-worktree`, `spawn-roles`, `attach`, `architect`, `shell`, `tower`, `tower-cloud`, `cron`, `team`, `team-update`, `db`; removed non-existent `util.ts`. |
| 46 | +- Refreshed `bin/` tree: added `af.js` (deprecation shim) and `generate-image.js`. |
| 47 | +- Refreshed `codev/protocols/` tree: added `aspir`, `air`, `bugfix`, `release`, `spike`, and `protocol-schema.json` (were missing). |
| 48 | +- Corrected `spir/` subtree: removed nonexistent `manifest.yaml`; added actual files (`protocol.json`, `builder-prompt.md`, `prompts/`, `consult-types/`). |
| 49 | +- Refreshed `codev-skeleton/protocols/` subtree: added `aspir`, `air`, `bugfix`, `spike` (was stale — only listed `spir`, `experiment`, `maintain`). |
| 50 | +- Updated version footer: `v2.0.0-rc.54` → `v3.0.0-rc.9`; date bumped to 2026-04-17. |
| 51 | + |
| 52 | +**`codev/resources/lessons-learned.md`**: |
| 53 | +- Added 3 lessons from Spec 653 (builder handling / TICK removal) at the end of the **Critical (Prevent Major Failures)** section: start from structural insight, full-repo grep for protocol removal, single verify-pass consultation cadence. |
| 54 | +- Updated footer date. |
| 55 | + |
| 56 | +**`AGENTS.md`**: |
| 57 | +- Synced with `CLAUDE.md` — local-install instructions updated to pnpm 10 monorepo flow (`pnpm local-install` targets both `codev-core` and `codev` tarballs in one `npm install -g` call). Prior AGENTS.md copy still referenced the pre-monorepo `cd packages/codev && pnpm pack` flow. |
| 58 | +- `diff CLAUDE.md AGENTS.md` is now clean. |
| 59 | + |
| 60 | +### Documentation Changes Log |
| 61 | + |
| 62 | +| Document | Section | Action | Reason | |
| 63 | +|----------|---------|--------|--------| |
| 64 | +| arch.md | afx commands tree | UPDATED | Tree was missing 10 commands added since run 0006; listed obsolete `util.ts` | |
| 65 | +| arch.md | bin scripts tree | UPDATED | Missing `af.js` deprecation shim and `generate-image.js` | |
| 66 | +| arch.md | codev protocols tree | UPDATED | Missing `aspir`, `air`, `bugfix`, `release`, `spike` | |
| 67 | +| arch.md | version footer | UPDATED | Was stamped at v2.0.0-rc.54; now v3.0.0-rc.9 pre-release | |
| 68 | +| lessons-learned.md | Critical | APPENDED | 3 entries from Spec 653 review | |
| 69 | +| lessons-learned.md | footer | UPDATED | Run date 2026-04-17 | |
| 70 | +| AGENTS.md | Local Build Testing | REWRITTEN | OBSOLETE — pre-pnpm-monorepo; drifted from CLAUDE.md during PR #669 | |
| 71 | + |
| 72 | +## Verification |
| 73 | + |
| 74 | +- `pnpm install` → clean |
| 75 | +- `pnpm build` → passes (codev-core, codev, dashboard all built) |
| 76 | +- `pnpm --filter @cluesmith/codev test` → **122 test files, 2462 passed, 13 skipped** |
| 77 | + |
| 78 | +## Deferred |
| 79 | + |
| 80 | +- **`@vitest/coverage-v8` depcheck false positive** — could add explicit import to silence depcheck, but the `provider: 'v8'` string is the idiomatic vitest pattern. Not worth special-casing. |
| 81 | +- **`@xterm/xterm` missing-dep warning** — would need to add as explicit dev dep in `packages/codev` or refactor the test to import through dashboard. Not runtime-critical. |
| 82 | +- **arch.md full rewrite** — `arch.md` is 1,776 lines; ~90% still accurate. A full rewrite is out of scope for a pre-release MAINTAIN pass. |
| 83 | +- **`ts-prune` noise from barrel files** — `terminal/index.ts` re-exports would need per-file annotation (`// ts-prune-ignore-next`) or a config file to silence. Low value. |
| 84 | + |
| 85 | +## Consultation Log |
| 86 | + |
| 87 | +3-way review run before opening PR (prompt at `/tmp/maintain-0007-consult-prompt.md`): |
| 88 | + |
| 89 | +| Reviewer | Verdict | Key findings | |
| 90 | +|----------|---------|--------------| |
| 91 | +| **Gemini** | REQUEST_CHANGES | Missed `protocol-schema.json` in tree; `codev-skeleton/protocols/` subtree still stale; lessons placed under wrong section heading (ran report said Critical, actually appended to end of file); push back on deferring `@xterm/xterm` — one-line fix, just add the devDep. | |
| 92 | +| **Codex** | APPROVE_WITH_COMMENTS | `spir/` subtree listed nonexistent `manifest.yaml`; `codev-skeleton/protocols/` still stale (same as Gemini); noted CLI examples elsewhere in arch.md (`afx util`, `afx tunnel`, `afx ports`) are stale but out of scope. | |
| 93 | +| **Claude** | APPROVE_WITH_COMMENTS | All three trees and dep removal verified against filesystem. Noted pre-existing duplicate step numbering (`# 3`) in local-install section of CLAUDE.md/AGENTS.md (not introduced here). | |
| 94 | + |
| 95 | +### Actions taken in response |
| 96 | + |
| 97 | +- Added `protocol-schema.json` to `codev/protocols/` tree (Gemini) |
| 98 | +- Fixed `spir/` subtree to match actual files (Codex) |
| 99 | +- Refreshed `codev-skeleton/protocols/` subtree (Gemini + Codex) |
| 100 | +- Moved Spec 653 lessons into the **Critical** section (Gemini) |
| 101 | +- Added `@xterm/xterm` to `packages/codev` devDependencies (Gemini) |
| 102 | +- Not addressed: the stale CLI examples elsewhere in arch.md — Codex flagged these as out-of-scope, and fixing them well would require a broader CLI audit. Deferred to a future MAINTAIN pass. |
| 103 | +- Not addressed: duplicate `# 3` step numbering in CLAUDE.md/AGENTS.md. Pre-existing on `main`; belongs in a separate doc tweak. |
| 104 | + |
| 105 | +## Summary |
| 106 | + |
| 107 | +First run on the simplified (2-phase) MAINTAIN protocol. The dependency cleanup caught up on the one un-acted item from run 0006's findings (`http-proxy`). Documentation sync was the bulk of the work: arch.md's directory trees had drifted significantly over 1,751 commits (VS Code extension, codev-core split, pnpm migration, afx rename, TICK removal). Everything builds and all unit tests pass against the refreshed tree. |
0 commit comments