@cluesmith/codev 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/bin/af.js +2 -2
- package/bin/afx.js +8 -0
- package/bin/consult.js +2 -1
- package/bin/team.js +2 -1
- package/{dashboard/dist/assets/index-nr0cXxtf.css → dashboard-dist/assets/index-BWYZtvwm.css} +1 -1
- package/dashboard-dist/assets/index-Dn9zmcKp.js +195 -0
- package/dashboard-dist/assets/index-Dn9zmcKp.js.map +1 -0
- package/{dashboard/dist → dashboard-dist}/index.html +2 -2
- package/dist/agent-farm/cli.d.ts.map +1 -1
- package/dist/agent-farm/cli.js +27 -19
- package/dist/agent-farm/cli.js.map +1 -1
- package/dist/agent-farm/commands/architect.d.ts +4 -4
- package/dist/agent-farm/commands/architect.d.ts.map +1 -1
- package/dist/agent-farm/commands/architect.js +23 -12
- package/dist/agent-farm/commands/architect.js.map +1 -1
- package/dist/agent-farm/commands/attach.d.ts.map +1 -1
- package/dist/agent-farm/commands/attach.js +101 -11
- package/dist/agent-farm/commands/attach.js.map +1 -1
- package/dist/agent-farm/commands/bench.d.ts +1 -1
- package/dist/agent-farm/commands/bench.js +1 -1
- package/dist/agent-farm/commands/cron.js +1 -1
- package/dist/agent-farm/commands/cron.js.map +1 -1
- package/dist/agent-farm/commands/db.d.ts +3 -3
- package/dist/agent-farm/commands/db.js +4 -4
- package/dist/agent-farm/commands/db.js.map +1 -1
- package/dist/agent-farm/commands/open.js +2 -2
- package/dist/agent-farm/commands/open.js.map +1 -1
- package/dist/agent-farm/commands/rename.js +1 -1
- package/dist/agent-farm/commands/rename.js.map +1 -1
- package/dist/agent-farm/commands/send.js +3 -3
- package/dist/agent-farm/commands/send.js.map +1 -1
- package/dist/agent-farm/commands/shell.js +3 -3
- package/dist/agent-farm/commands/shell.js.map +1 -1
- package/dist/agent-farm/commands/spawn-roles.d.ts +9 -5
- package/dist/agent-farm/commands/spawn-roles.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn-roles.js +48 -28
- package/dist/agent-farm/commands/spawn-roles.js.map +1 -1
- package/dist/agent-farm/commands/spawn-worktree.d.ts +5 -5
- package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn-worktree.js +80 -13
- package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
- package/dist/agent-farm/commands/spawn.d.ts +6 -6
- package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn.js +90 -53
- package/dist/agent-farm/commands/spawn.js.map +1 -1
- package/dist/agent-farm/commands/status.d.ts.map +1 -1
- package/dist/agent-farm/commands/status.js +48 -3
- package/dist/agent-farm/commands/status.js.map +1 -1
- package/dist/agent-farm/commands/team-update.d.ts +1 -1
- package/dist/agent-farm/commands/team-update.js +1 -1
- package/dist/agent-farm/commands/team.d.ts +1 -1
- package/dist/agent-farm/commands/team.js +1 -1
- package/dist/agent-farm/commands/tower-cloud.d.ts +2 -2
- package/dist/agent-farm/commands/tower-cloud.js +3 -3
- package/dist/agent-farm/commands/tower-cloud.js.map +1 -1
- package/dist/agent-farm/commands/tower.js +2 -2
- package/dist/agent-farm/commands/tower.js.map +1 -1
- package/dist/agent-farm/db/index.d.ts.map +1 -1
- package/dist/agent-farm/db/index.js +47 -0
- package/dist/agent-farm/db/index.js.map +1 -1
- package/dist/agent-farm/db/schema.d.ts +1 -1
- package/dist/agent-farm/db/schema.d.ts.map +1 -1
- package/dist/agent-farm/db/schema.js +1 -1
- package/dist/agent-farm/db/types.d.ts +1 -1
- package/dist/agent-farm/lib/cloud-config.js +2 -2
- package/dist/agent-farm/lib/cloud-config.js.map +1 -1
- package/dist/agent-farm/lib/tower-client.d.ts +6 -230
- package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
- package/dist/agent-farm/lib/tower-client.js +6 -293
- package/dist/agent-farm/lib/tower-client.js.map +1 -1
- package/dist/agent-farm/lib/tunnel-client.js +1 -1
- package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
- package/dist/agent-farm/servers/message-write.d.ts +24 -0
- package/dist/agent-farm/servers/message-write.d.ts.map +1 -0
- package/dist/agent-farm/servers/message-write.js +63 -0
- package/dist/agent-farm/servers/message-write.js.map +1 -0
- package/dist/agent-farm/servers/overview.d.ts +4 -1
- package/dist/agent-farm/servers/overview.d.ts.map +1 -1
- package/dist/agent-farm/servers/overview.js +38 -5
- package/dist/agent-farm/servers/overview.js.map +1 -1
- package/dist/agent-farm/servers/send-buffer.d.ts +4 -3
- package/dist/agent-farm/servers/send-buffer.d.ts.map +1 -1
- package/dist/agent-farm/servers/send-buffer.js +7 -4
- package/dist/agent-farm/servers/send-buffer.js.map +1 -1
- package/dist/agent-farm/servers/tower-cron-parser.js +1 -1
- package/dist/agent-farm/servers/tower-cron-parser.js.map +1 -1
- package/dist/agent-farm/servers/tower-cron.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-cron.js +4 -5
- package/dist/agent-farm/servers/tower-cron.js.map +1 -1
- package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-instances.js +6 -5
- package/dist/agent-farm/servers/tower-instances.js.map +1 -1
- package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-routes.js +19 -16
- package/dist/agent-farm/servers/tower-routes.js.map +1 -1
- package/dist/agent-farm/servers/tower-server.js +19 -4
- package/dist/agent-farm/servers/tower-server.js.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.d.ts +2 -2
- package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.js +47 -18
- package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
- package/dist/agent-farm/servers/tower-tunnel.js +2 -2
- package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
- package/dist/agent-farm/servers/tower-utils.d.ts +9 -6
- package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-utils.js +12 -6
- package/dist/agent-farm/servers/tower-utils.js.map +1 -1
- package/dist/agent-farm/state.js +1 -1
- package/dist/agent-farm/state.js.map +1 -1
- package/dist/agent-farm/types.d.ts +11 -2
- package/dist/agent-farm/types.d.ts.map +1 -1
- package/dist/agent-farm/utils/config.d.ts +11 -0
- package/dist/agent-farm/utils/config.d.ts.map +1 -1
- package/dist/agent-farm/utils/config.js +21 -0
- package/dist/agent-farm/utils/config.js.map +1 -1
- package/dist/agent-farm/utils/harness.d.ts +85 -0
- package/dist/agent-farm/utils/harness.d.ts.map +1 -0
- package/dist/agent-farm/utils/harness.js +212 -0
- package/dist/agent-farm/utils/harness.js.map +1 -0
- package/dist/agent-farm/utils/server-utils.d.ts +13 -0
- package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
- package/dist/agent-farm/utils/server-utils.js +38 -0
- package/dist/agent-farm/utils/server-utils.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +19 -5
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt.js +2 -2
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/consult/index.d.ts +37 -3
- package/dist/commands/consult/index.d.ts.map +1 -1
- package/dist/commands/consult/index.js +220 -150
- package/dist/commands/consult/index.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +54 -8
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/porch/artifacts.d.ts +69 -0
- package/dist/commands/porch/artifacts.d.ts.map +1 -0
- package/dist/commands/porch/artifacts.js +368 -0
- package/dist/commands/porch/artifacts.js.map +1 -0
- package/dist/commands/porch/checks.d.ts +8 -1
- package/dist/commands/porch/checks.d.ts.map +1 -1
- package/dist/commands/porch/checks.js +98 -1
- package/dist/commands/porch/checks.js.map +1 -1
- package/dist/commands/porch/index.d.ts +18 -7
- package/dist/commands/porch/index.d.ts.map +1 -1
- package/dist/commands/porch/index.js +299 -61
- package/dist/commands/porch/index.js.map +1 -1
- package/dist/commands/porch/next.d.ts.map +1 -1
- package/dist/commands/porch/next.js +72 -74
- package/dist/commands/porch/next.js.map +1 -1
- package/dist/commands/porch/notify.d.ts +2 -2
- package/dist/commands/porch/notify.js +5 -5
- package/dist/commands/porch/notify.js.map +1 -1
- package/dist/commands/porch/prompts.d.ts +2 -1
- package/dist/commands/porch/prompts.d.ts.map +1 -1
- package/dist/commands/porch/prompts.js +23 -14
- package/dist/commands/porch/prompts.js.map +1 -1
- package/dist/commands/porch/state.d.ts +27 -2
- package/dist/commands/porch/state.d.ts.map +1 -1
- package/dist/commands/porch/state.js +96 -9
- package/dist/commands/porch/state.js.map +1 -1
- package/dist/commands/porch/types.d.ts +8 -0
- package/dist/commands/porch/types.d.ts.map +1 -1
- package/dist/lib/config.d.ts +14 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +7 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/forge-contracts.d.ts +10 -1
- package/dist/lib/forge-contracts.d.ts.map +1 -1
- package/dist/lib/forge-contracts.js.map +1 -1
- package/dist/lib/forge.d.ts.map +1 -1
- package/dist/lib/forge.js +25 -7
- package/dist/lib/forge.js.map +1 -1
- package/dist/lib/team-github.d.ts +49 -0
- package/dist/lib/team-github.d.ts.map +1 -1
- package/dist/lib/team-github.js +115 -6
- package/dist/lib/team-github.js.map +1 -1
- package/dist/terminal/pty-manager.d.ts.map +1 -1
- package/dist/terminal/pty-manager.js +2 -0
- package/dist/terminal/pty-manager.js.map +1 -1
- package/dist/terminal/ws-protocol.d.ts +10 -8
- package/dist/terminal/ws-protocol.d.ts.map +1 -1
- package/dist/terminal/ws-protocol.js +3 -0
- package/dist/terminal/ws-protocol.js.map +1 -1
- package/package.json +28 -25
- package/scripts/forge/gitea/auth-status.sh +0 -0
- package/scripts/forge/gitea/issue-comment.sh +0 -0
- package/scripts/forge/gitea/issue-list.sh +0 -0
- package/scripts/forge/gitea/issue-view.sh +0 -0
- package/scripts/forge/gitea/pr-exists.sh +4 -1
- package/scripts/forge/gitea/pr-list.sh +0 -0
- package/scripts/forge/gitea/pr-merge.sh +0 -0
- package/scripts/forge/gitea/pr-view.sh +0 -0
- package/scripts/forge/gitea/recently-closed.sh +0 -0
- package/scripts/forge/gitea/recently-merged.sh +0 -0
- package/scripts/forge/gitea/repo-archive.sh +0 -0
- package/scripts/forge/gitea/user-identity.sh +0 -0
- package/scripts/forge/github/auth-status.sh +0 -0
- package/scripts/forge/github/issue-comment.sh +0 -0
- package/scripts/forge/github/issue-list.sh +2 -2
- package/scripts/forge/github/issue-view.sh +0 -0
- package/scripts/forge/github/on-it-timestamps.sh +0 -0
- package/scripts/forge/github/pr-diff.sh +0 -0
- package/scripts/forge/github/pr-exists.sh +3 -1
- package/scripts/forge/github/pr-list.sh +2 -2
- package/scripts/forge/github/pr-merge.sh +0 -0
- package/scripts/forge/github/pr-search.sh +0 -0
- package/scripts/forge/github/pr-view.sh +0 -0
- package/scripts/forge/github/recently-closed.sh +0 -0
- package/scripts/forge/github/recently-merged.sh +0 -0
- package/scripts/forge/github/repo-archive.sh +0 -0
- package/scripts/forge/github/team-activity.sh +0 -0
- package/scripts/forge/github/user-identity.sh +0 -0
- package/scripts/forge/gitlab/auth-status.sh +0 -0
- package/scripts/forge/gitlab/issue-comment.sh +0 -0
- package/scripts/forge/gitlab/issue-list.sh +0 -0
- package/scripts/forge/gitlab/issue-view.sh +0 -0
- package/scripts/forge/gitlab/pr-diff.sh +0 -0
- package/scripts/forge/gitlab/pr-exists.sh +3 -1
- package/scripts/forge/gitlab/pr-list.sh +0 -0
- package/scripts/forge/gitlab/pr-merge.sh +0 -0
- package/scripts/forge/gitlab/pr-search.sh +0 -0
- package/scripts/forge/gitlab/pr-view.sh +0 -0
- package/scripts/forge/gitlab/recently-closed.sh +0 -0
- package/scripts/forge/gitlab/recently-merged.sh +0 -0
- package/scripts/forge/gitlab/repo-archive.sh +0 -0
- package/scripts/forge/gitlab/user-identity.sh +0 -0
- package/scripts/forge/linear/auth-status.sh +15 -0
- package/scripts/forge/linear/issue-comment.sh +38 -0
- package/scripts/forge/linear/issue-list.sh +35 -0
- package/scripts/forge/linear/issue-view.sh +37 -0
- package/scripts/forge/linear/recently-closed.sh +45 -0
- package/scripts/forge/linear/user-identity.sh +15 -0
- package/scripts/postinstall.mjs +51 -0
- package/skeleton/.claude/skills/afx/SKILL.md +144 -0
- package/skeleton/.claude/skills/codev/SKILL.md +3 -3
- package/skeleton/.claude/skills/consult/SKILL.md +1 -1
- package/skeleton/.claude/skills/porch/SKILL.md +2 -2
- package/skeleton/.claude/skills/update-arch-docs/SKILL.md +107 -0
- package/skeleton/DEPENDENCIES.md +1 -1
- package/skeleton/builders.md +4 -4
- package/skeleton/protocol-schema.json +2 -2
- package/skeleton/protocols/air/builder-prompt.md +6 -6
- package/skeleton/protocols/air/prompts/pr.md +17 -5
- package/skeleton/protocols/air/protocol.md +1 -2
- package/skeleton/protocols/aspir/builder-prompt.md +28 -6
- package/skeleton/protocols/aspir/prompts/review.md +11 -0
- package/skeleton/protocols/aspir/protocol.json +9 -1
- package/skeleton/protocols/aspir/protocol.md +1 -1
- package/skeleton/protocols/aspir/templates/plan.md +0 -20
- package/skeleton/protocols/aspir/templates/spec.md +0 -28
- package/skeleton/protocols/bugfix/builder-prompt.md +6 -6
- package/skeleton/protocols/bugfix/prompts/pr.md +16 -4
- package/skeleton/protocols/experiment/builder-prompt.md +15 -0
- package/skeleton/protocols/experiment/protocol.md +1 -6
- package/skeleton/protocols/maintain/builder-prompt.md +12 -11
- package/skeleton/protocols/maintain/prompts/maintain.md +88 -0
- package/skeleton/protocols/maintain/prompts/review.md +84 -0
- package/skeleton/protocols/maintain/protocol.json +14 -68
- package/skeleton/protocols/maintain/protocol.md +163 -394
- package/skeleton/protocols/maintain/templates/maintenance-run.md +18 -49
- package/skeleton/protocols/protocol-schema.json +1 -1
- package/skeleton/protocols/research/builder-prompt.md +85 -0
- package/skeleton/protocols/research/protocol.json +118 -0
- package/skeleton/protocols/research/protocol.md +169 -0
- package/skeleton/protocols/spike/builder-prompt.md +1 -1
- package/skeleton/protocols/spike/protocol.md +4 -4
- package/skeleton/protocols/spir/builder-prompt.md +28 -5
- package/skeleton/protocols/spir/prompts/review.md +11 -0
- package/skeleton/protocols/spir/protocol.json +9 -1
- package/skeleton/protocols/spir/protocol.md +6 -5
- package/skeleton/protocols/spir/templates/plan.md +0 -20
- package/skeleton/protocols/spir/templates/spec.md +0 -28
- package/skeleton/resources/commands/agent-farm.md +84 -84
- package/skeleton/resources/commands/codev.md +1 -1
- package/skeleton/resources/commands/consult.md +16 -7
- package/skeleton/resources/commands/overview.md +14 -15
- package/skeleton/resources/risk-triage.md +2 -2
- package/skeleton/resources/workflow-reference.md +14 -14
- package/skeleton/roles/architect.md +39 -39
- package/skeleton/roles/builder.md +22 -14
- package/skeleton/templates/AGENTS.md +5 -3
- package/skeleton/templates/CLAUDE.md +5 -3
- package/skeleton/templates/arch.md +100 -30
- package/skeleton/templates/cheatsheet.md +12 -12
- package/skeleton/templates/lessons-learned.md +45 -7
- package/templates/3d-viewer.html +16 -18
- package/templates/tower.html +1 -1
- package/dashboard/dist/assets/index-CTrlY11L.js +0 -194
- package/dashboard/dist/assets/index-CTrlY11L.js.map +0 -1
- package/skeleton/.claude/skills/af/SKILL.md +0 -146
- package/skeleton/porch/prompts/understand.md +0 -61
- package/skeleton/porch/prompts/verify.md +0 -58
- package/skeleton/protocols/maintain/prompts/audit.md +0 -111
- package/skeleton/protocols/maintain/prompts/clean.md +0 -91
- package/skeleton/protocols/maintain/prompts/sync.md +0 -113
- package/skeleton/protocols/maintain/prompts/verify.md +0 -110
- package/skeleton/protocols/tick/builder-prompt.md +0 -65
- package/skeleton/protocols/tick/consult-types/impl-review.md +0 -72
- package/skeleton/protocols/tick/consult-types/plan-review.md +0 -59
- package/skeleton/protocols/tick/consult-types/pr-review.md +0 -72
- package/skeleton/protocols/tick/consult-types/spec-review.md +0 -55
- package/skeleton/protocols/tick/protocol.json +0 -151
- package/skeleton/protocols/tick/protocol.md +0 -277
- package/skeleton/protocols/tick/templates/plan.md +0 -67
- package/skeleton/protocols/tick/templates/review.md +0 -89
- package/skeleton/protocols/tick/templates/spec.md +0 -61
|
@@ -2,456 +2,229 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
MAINTAIN is a
|
|
5
|
+
MAINTAIN is a single-pass maintenance protocol for keeping codebases healthy. The builder does all maintenance work in one phase, then creates a PR with a 3-way review.
|
|
6
6
|
|
|
7
|
-
**Core Principle**:
|
|
7
|
+
**Core Principle**: Do the work in one pass. Don't over-ceremonialize housekeeping.
|
|
8
8
|
|
|
9
|
-
**Key Documents
|
|
10
|
-
- `codev/resources/arch.md` - Architecture documentation
|
|
9
|
+
**Key Documents** MAINTAIN keeps current:
|
|
10
|
+
- `codev/resources/arch.md` - Architecture documentation
|
|
11
11
|
- `codev/resources/lessons-learned.md` - Extracted wisdom from reviews
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
The two governance docs are siblings with **different purposes**: `arch.md` owns system shape (services, transports, mental models, verified-wrong assumptions about *this* system); `lessons-learned.md` owns durable engineering wisdom that applies *across* specs. Use the routing matrix below to decide where each fact belongs.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
### Lives where: routing facts to the right home
|
|
16
|
+
|
|
17
|
+
| Type of fact/insight | Lives in |
|
|
18
|
+
|---|---|
|
|
19
|
+
| Current system shape (services, transports, key mental models) | `codev/resources/arch.md` |
|
|
20
|
+
| Mechanism for a unique subsystem | `codev/resources/arch.md` (subsystem section) OR a meta-spec under `codev/architecture/<domain>.md` if the mechanism is large enough to warrant its own doc |
|
|
21
|
+
| A durable engineering pattern that applies across multiple specs | `codev/resources/lessons-learned.md` |
|
|
22
|
+
| A spec-narrow fix recipe (only relevant inside the originating feature) | Spec review only — does NOT belong in `lessons-learned.md` |
|
|
23
|
+
| A system-shape surprise verified-wrong in production ("looks like X but isn't") | `codev/resources/arch.md` § "Verified-Wrong Assumptions" |
|
|
24
|
+
| Aspirational architectural direction (where we want to go) | The relevant meta-spec or roadmap doc, NOT `arch.md` body |
|
|
25
|
+
| A changelog entry ("we shipped X in spec Y on date Z") | `git log` + the spec/review document — NOT `arch.md`, NOT `lessons-learned.md` |
|
|
26
|
+
| A retired or removed component | Delete the section entirely; do NOT keep a "retired components" graveyard. (`git log` retains history.) |
|
|
27
|
+
|
|
28
|
+
The most commonly-misrouted entry is the system-shape surprise. If a future reader needs to know "the system *looks* like X but actually does Y," that is system shape and lives in `arch.md`. If they need to know "we learned that doing X is generally a bad idea," that is engineering wisdom and lives in `lessons-learned.md`.
|
|
29
|
+
|
|
30
|
+
## When to Use
|
|
16
31
|
|
|
17
|
-
- When the user/architect requests it
|
|
18
32
|
- Before a release (clean slate for shipping)
|
|
19
|
-
- Quarterly maintenance window
|
|
20
33
|
- After completing a major feature
|
|
34
|
+
- Quarterly maintenance window
|
|
21
35
|
- When the codebase feels "crusty"
|
|
22
36
|
|
|
23
37
|
## Execution Model
|
|
24
38
|
|
|
25
|
-
MAINTAIN is orchestrated by porch with 4 sequential phases:
|
|
26
|
-
|
|
27
39
|
```
|
|
28
|
-
|
|
40
|
+
afx spawn --protocol maintain
|
|
29
41
|
↓
|
|
30
|
-
1.
|
|
42
|
+
1. MAINTAIN: Audit → Clean → Sync docs (single pass)
|
|
43
|
+
↓ (build + test checks, 3-way review)
|
|
44
|
+
2. REVIEW: Create PR
|
|
31
45
|
↓ (3-way review)
|
|
32
|
-
2. CLEAN: Remove identified cruft
|
|
33
|
-
↓ (3-way review + build/test checks)
|
|
34
|
-
3. SYNC: Update documentation
|
|
35
|
-
↓ (3-way review)
|
|
36
|
-
4. VERIFY: Final validation + PR
|
|
37
|
-
↓ (3-way review)
|
|
38
|
-
PR with maintenance changes
|
|
39
|
-
↓
|
|
40
46
|
Architect reviews → Merge
|
|
41
47
|
```
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
Two phases total. One consultation during the maintain phase, one before PR.
|
|
44
50
|
|
|
45
51
|
## Prerequisites
|
|
46
52
|
|
|
47
|
-
Before starting
|
|
48
|
-
1. Check `codev/maintain/` for last
|
|
49
|
-
2. Note the base commit
|
|
50
|
-
3. Focus on changes since
|
|
53
|
+
Before starting:
|
|
54
|
+
1. Check `codev/maintain/` for the last run number
|
|
55
|
+
2. Note the base commit: `git log --oneline -1` on the last run file
|
|
56
|
+
3. Focus on changes since then: `git log --oneline <base-commit>..HEAD`
|
|
51
57
|
|
|
52
58
|
---
|
|
53
59
|
|
|
54
|
-
##
|
|
60
|
+
## The Maintain Phase (Single Pass)
|
|
55
61
|
|
|
56
|
-
|
|
62
|
+
The builder works through these tasks in order, committing as they go.
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
codev/maintain/
|
|
60
|
-
├── 1.md
|
|
61
|
-
├── 2.md
|
|
62
|
-
└── ...
|
|
63
|
-
```
|
|
64
|
+
### Step 1: Audit
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
Identify what needs fixing. Don't fix yet — just catalog.
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
- Base commit (starting point)
|
|
69
|
-
- Tasks completed
|
|
70
|
-
- Findings and deferred items
|
|
71
|
-
- Summary
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## Task List
|
|
76
|
-
|
|
77
|
-
### Code Hygiene Tasks
|
|
78
|
-
|
|
79
|
-
| Task | Parallelizable | Human Review? | Description |
|
|
80
|
-
|------|----------------|---------------|-------------|
|
|
81
|
-
| Remove dead code | Yes | No | Delete unused functions, imports, unreachable code |
|
|
82
|
-
| Remove unused dependencies | Yes | Yes | Check package.json/requirements.txt for unused packages |
|
|
83
|
-
| Clean unused flags | Yes | No | Remove feature flags that are always on/off |
|
|
84
|
-
| Fix flaky tests | No | Yes | Investigate and fix intermittently failing tests |
|
|
85
|
-
| Update outdated dependencies | Yes | Yes | Bump dependencies with breaking change review |
|
|
86
|
-
| Identify duplicate code | Yes | Yes | Find repeated patterns that should be utility functions |
|
|
87
|
-
|
|
88
|
-
**Tools**:
|
|
68
|
+
**Dead code**:
|
|
89
69
|
```bash
|
|
90
|
-
# TypeScript
|
|
91
|
-
npx ts-prune
|
|
92
|
-
npx depcheck # Find unused dependencies
|
|
93
|
-
npx jscpd . # Find copy-paste code (optional)
|
|
70
|
+
# Find unused exports (TypeScript)
|
|
71
|
+
npx ts-prune 2>/dev/null || echo "ts-prune not available"
|
|
94
72
|
|
|
95
|
-
#
|
|
96
|
-
|
|
73
|
+
# Find unused dependencies
|
|
74
|
+
npx depcheck 2>/dev/null || echo "depcheck not available"
|
|
97
75
|
```
|
|
98
76
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
| Update arch.md | Yes | No | Sync architecture doc with actual codebase |
|
|
104
|
-
| Generate lessons-learned.md | Yes | Yes | Extract wisdom from review documents |
|
|
105
|
-
| Sync CLAUDE.md ↔ AGENTS.md | Yes | No | Ensure both files match |
|
|
106
|
-
| Prune documentation | Yes | Yes | Remove obsolete info, keep CLAUDE.md/README.md under 400 lines |
|
|
107
|
-
| Check spec/plan/review consistency | Yes | Yes | Find specs without reviews, plans that don't match code |
|
|
108
|
-
| Remove stale doc references | Yes | No | Delete references to deleted code/files |
|
|
109
|
-
|
|
110
|
-
### Project Tracking Tasks
|
|
111
|
-
|
|
112
|
-
| Task | Parallelizable | Human Review? | Description |
|
|
113
|
-
|------|----------------|---------------|-------------|
|
|
114
|
-
| Update GitHub Issue statuses | Yes | No | Close completed issues, update labels |
|
|
115
|
-
|
|
116
|
-
### Framework Tasks
|
|
117
|
-
|
|
118
|
-
| Task | Parallelizable | Human Review? | Description |
|
|
119
|
-
|------|----------------|---------------|-------------|
|
|
120
|
-
| Run codev update | No | Yes | Update codev framework to latest version |
|
|
121
|
-
|
|
122
|
-
---
|
|
123
|
-
|
|
124
|
-
## Task Details
|
|
125
|
-
|
|
126
|
-
### Update arch.md
|
|
127
|
-
|
|
128
|
-
Scan the actual codebase and update `codev/resources/arch.md`:
|
|
129
|
-
|
|
130
|
-
**Discovery phase**:
|
|
131
|
-
1. `git log --oneline <base-commit>..HEAD` - what changed since last maintenance
|
|
132
|
-
2. `ls -R` key directories to find new files/modules
|
|
133
|
-
3. `grep` for new exports, classes, key functions
|
|
134
|
-
4. Review new/modified specs: `git diff <base-commit>..HEAD --name-only -- codev/specs/`
|
|
135
|
-
5. Review new/modified plans: `git diff <base-commit>..HEAD --name-only -- codev/plans/`
|
|
136
|
-
|
|
137
|
-
**Update arch.md**:
|
|
138
|
-
1. Verify directory structure matches documented structure
|
|
139
|
-
2. Update component descriptions for changed modules
|
|
140
|
-
3. Add new utilities/helpers discovered
|
|
141
|
-
4. Remove references to deleted code
|
|
142
|
-
5. Update technology stack if dependencies changed
|
|
143
|
-
6. Document new integration points or APIs
|
|
144
|
-
7. Capture architectural decisions from new specs/plans
|
|
145
|
-
|
|
146
|
-
**Primary sources** (specs/plans):
|
|
147
|
-
- Architectural decisions from specs
|
|
148
|
-
- Component relationships from plans
|
|
149
|
-
- Design rationale and tradeoffs
|
|
150
|
-
|
|
151
|
-
**Secondary sources** (code):
|
|
152
|
-
- File locations and their purpose
|
|
153
|
-
- Key functions/classes and what they do
|
|
154
|
-
- Data flow and dependencies
|
|
155
|
-
- Configuration options
|
|
156
|
-
- CLI commands and flags
|
|
157
|
-
|
|
158
|
-
**What NOT to include**:
|
|
159
|
-
- Implementation details that change frequently
|
|
160
|
-
- Line numbers (they go stale)
|
|
161
|
-
- Full API documentation (use JSDoc/docstrings for that)
|
|
162
|
-
|
|
163
|
-
**Primary Purpose**: arch.md should enable a developer (or AI agent) to rapidly understand the entire system - not just file locations, but **how things actually work**.
|
|
164
|
-
|
|
165
|
-
**Recommended Document Structure**:
|
|
166
|
-
```markdown
|
|
167
|
-
# Project Architecture
|
|
168
|
-
|
|
169
|
-
## Overview
|
|
170
|
-
[High-level description: what the system does, core design philosophy, 2-3 sentences]
|
|
171
|
-
|
|
172
|
-
## Quick Start for Developers
|
|
173
|
-
[The fastest path to understanding: "To understand X, read Y first"]
|
|
174
|
-
|
|
175
|
-
## Technology Stack
|
|
176
|
-
[Technologies, frameworks, key dependencies with versions]
|
|
177
|
-
|
|
178
|
-
## Directory Structure
|
|
179
|
-
[Complete directory tree with explanations for each major directory]
|
|
180
|
-
|
|
181
|
-
## Major Components
|
|
182
|
-
|
|
183
|
-
### [Component Name] (e.g., Agent Farm)
|
|
184
|
-
- **Purpose**: What problem it solves
|
|
185
|
-
- **Location**: path/to/component
|
|
186
|
-
- **How It Works**:
|
|
187
|
-
- Step-by-step explanation of the mechanism
|
|
188
|
-
- Key technologies used (e.g., "uses shellper processes for terminal persistence")
|
|
189
|
-
- Runtime behavior (e.g., "spawns a shellper process per builder terminal")
|
|
190
|
-
- State management (e.g., "state stored in SQLite at .agent-farm/state.db")
|
|
191
|
-
- **Key Files**:
|
|
192
|
-
- `file.ts` - does X
|
|
193
|
-
- `other.ts` - handles Y
|
|
194
|
-
- **Configuration**: How to customize behavior
|
|
195
|
-
- **Common Operations**: Examples of typical usage
|
|
196
|
-
|
|
197
|
-
[Repeat for each major component - be thorough about HOW, not just WHAT]
|
|
198
|
-
|
|
199
|
-
## Utility Functions & Helpers
|
|
200
|
-
### [Utility Category]
|
|
201
|
-
- **File**: path/to/utility.ts
|
|
202
|
-
- **Functions**: `functionName()` - Description and use case
|
|
203
|
-
- **When to Use**: Guidance on appropriate usage
|
|
204
|
-
|
|
205
|
-
## Data Flow
|
|
206
|
-
[How data moves through the system, with concrete examples]
|
|
207
|
-
|
|
208
|
-
## Key Design Decisions
|
|
209
|
-
[Important architectural choices and their rationale - the WHY]
|
|
210
|
-
|
|
211
|
-
## Integration Points
|
|
212
|
-
[External services, APIs, databases, and how they connect]
|
|
77
|
+
**Stale documentation**:
|
|
78
|
+
```bash
|
|
79
|
+
# What changed since last maintenance?
|
|
80
|
+
git log --oneline <base-commit>..HEAD
|
|
213
81
|
|
|
214
|
-
|
|
215
|
-
[
|
|
82
|
+
# Check arch.md references still exist
|
|
83
|
+
grep -oE '[a-zA-Z]+/[a-zA-Z/]+\.[a-z]+' codev/resources/arch.md | sort -u | while read f; do
|
|
84
|
+
[ -e "$f" ] || echo "Missing: $f"
|
|
85
|
+
done
|
|
216
86
|
```
|
|
217
87
|
|
|
218
|
-
**
|
|
88
|
+
**Stale project tracking**:
|
|
89
|
+
- GitHub Issues that should be closed
|
|
90
|
+
- Labels that need updating
|
|
219
91
|
|
|
220
|
-
|
|
92
|
+
Record findings in the maintenance run file (`codev/maintain/NNNN.md`).
|
|
221
93
|
|
|
222
|
-
|
|
223
|
-
|-----------------|---------------------|
|
|
224
|
-
| "Agent Farm manages builders" | "Agent Farm spawns builders in isolated git worktrees. Each builder runs in a shellper-backed terminal session. The Tower dashboard exposes terminals via WebSocket. State is persisted in SQLite." |
|
|
225
|
-
| "Consult tool queries AI models" | "Consult shells out to external CLIs (gemini-cli, codex, claude). It writes the consultant role to a temp file, sets environment variables, and streams stdout/stderr back to the user." |
|
|
94
|
+
### Step 2: Clean
|
|
226
95
|
|
|
227
|
-
|
|
96
|
+
For each finding from the audit:
|
|
97
|
+
1. Verify it's truly unused (grep the codebase)
|
|
98
|
+
2. Remove it (use `git rm` for tracked files)
|
|
99
|
+
3. Verify build + tests still pass
|
|
100
|
+
4. Commit with `[Maintain] Remove unused X`
|
|
228
101
|
|
|
229
|
-
**
|
|
230
|
-
-
|
|
231
|
-
-
|
|
232
|
-
-
|
|
233
|
-
-
|
|
102
|
+
**Rules**:
|
|
103
|
+
- One removal at a time — don't batch unrelated changes
|
|
104
|
+
- Verify after each removal — build must pass
|
|
105
|
+
- Use soft deletion for untracked files: `mv file codev/maintain/.trash/$(date +%Y-%m-%d)/`
|
|
106
|
+
- Never use `git add -A` or `git add .`
|
|
234
107
|
|
|
235
|
-
|
|
108
|
+
### Step 3: Sync Documentation
|
|
236
109
|
|
|
237
|
-
|
|
238
|
-
- Document every utility function with exact location
|
|
239
|
-
- Explain what each does and when to use it
|
|
240
|
-
- Include parameter types and return types
|
|
110
|
+
Step 3 is split into two sub-steps: **Audit first, then update.** This split exists because `arch.md` and `lessons-learned.md` accumulate without bound when MAINTAIN does only "what's new" — the audit pass surfaces what should be cut so the update pass is not purely additive.
|
|
241
111
|
|
|
242
|
-
|
|
243
|
-
- Keep directory tree up-to-date and complete
|
|
244
|
-
- Explain purpose of each major directory
|
|
245
|
-
- Highlight where specific types of files should be placed
|
|
112
|
+
The `update-arch-docs` skill (at `.claude/skills/update-arch-docs/SKILL.md`) is invoked by both sub-steps. Read it before starting Step 3 so the discipline is fresh.
|
|
246
113
|
|
|
247
|
-
|
|
248
|
-
- Document all external dependencies and APIs
|
|
249
|
-
- Explain how different parts connect
|
|
250
|
-
- Note special configuration requirements
|
|
114
|
+
#### Step 3a: Audit documentation
|
|
251
115
|
|
|
252
|
-
**
|
|
253
|
-
- [ ] All file paths are correct and current
|
|
254
|
-
- [ ] All documented functions actually exist
|
|
255
|
-
- [ ] Directory structure matches reality
|
|
256
|
-
- [ ] Architectural decisions are accurately represented
|
|
257
|
-
- [ ] Document is internally consistent
|
|
116
|
+
Invoke the `update-arch-docs` skill in **audit-mode**. The skill reads `codev/resources/arch.md` and `codev/resources/lessons-learned.md` end-to-end against the discipline below and produces a candidate-cuts list (with reasons) recorded in the run file (`codev/maintain/NNNN.md`) under a new `## Audit Findings` section before any edits land.
|
|
258
117
|
|
|
259
|
-
**
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
-
|
|
118
|
+
**Per-arch.md-section pruning checklist** — for each section in `arch.md`, ask:
|
|
119
|
+
- Does it describe **current state**? If aspirational, the section moves to a meta-spec; `arch.md` keeps a 1-paragraph summary + pointer (or nothing, if the meta-spec stands on its own).
|
|
120
|
+
- Does it duplicate a meta-spec? If yes, replace with a 1-paragraph summary + pointer.
|
|
121
|
+
- Is it a per-file enumeration that's gone stale? If yes, prune to the directory shape + a few key files.
|
|
122
|
+
- Is it a changelog/narrative section ("Spec 0042 added X")? If yes, absorb the architecturally-relevant facts and remove the spec-numbered framing.
|
|
123
|
+
- Is the component still alive? If retired, delete the section entirely.
|
|
263
124
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
1. Find new/modified reviews: `git diff <base-commit>..HEAD --name-only -- codev/reviews/`
|
|
270
|
-
2. Read each new/modified review file
|
|
271
|
-
|
|
272
|
-
**Extract from reviews**:
|
|
273
|
-
1. Read all files in `codev/reviews/`
|
|
274
|
-
2. Extract lessons that are:
|
|
275
|
-
- Actionable (not just "we learned X")
|
|
276
|
-
- Durable (still relevant)
|
|
277
|
-
- General (applicable beyond one project)
|
|
278
|
-
3. Organize by topic (Testing, Architecture, Process, etc.)
|
|
279
|
-
4. Link back to source review
|
|
280
|
-
5. Prune outdated lessons
|
|
281
|
-
|
|
282
|
-
**Template**:
|
|
283
|
-
```markdown
|
|
284
|
-
# Lessons Learned
|
|
125
|
+
**Per-lessons-learned.md-entry pruning checklist** — for each entry, ask:
|
|
126
|
+
- Is it cross-applicable beyond the spec that produced it? If no, remove (the lesson belongs in the spec's review).
|
|
127
|
+
- Is it terse (1–3 sentences)? If multi-paragraph, split or compress.
|
|
128
|
+
- Is the topic section the right home? If filed under "Architecture (continued)" or a spec-numbered section, move it to the right topical home.
|
|
129
|
+
- Is it a duplicate of an adjacent entry? If yes, fold them.
|
|
285
130
|
|
|
286
|
-
|
|
287
|
-
- [From 1] Always use XDG sandboxing in tests to avoid touching real $HOME
|
|
288
|
-
- [From 9] Verify dependencies actually export what you expect
|
|
131
|
+
**Sample audit prompt** (paste into the skill invocation if you want a baseline checklist run):
|
|
289
132
|
|
|
290
|
-
## Architecture
|
|
291
|
-
- [From 8] Single source of truth beats distributed state
|
|
292
|
-
- [From 31] SQLite with WAL mode handles concurrency better than JSON files
|
|
293
|
-
|
|
294
|
-
## Process
|
|
295
|
-
- [From 1] Multi-agent consultation catches issues humans miss
|
|
296
133
|
```
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
2. Identify divergence
|
|
304
|
-
3. Update the stale one to match
|
|
305
|
-
4. Both should be identical (per AGENTS.md standard)
|
|
306
|
-
|
|
307
|
-
### Prune Documentation
|
|
308
|
-
|
|
309
|
-
**CRITICAL: Documentation pruning requires JUSTIFICATION for every deletion.**
|
|
310
|
-
|
|
311
|
-
Size targets (~400 lines for CLAUDE.md/README.md) are **guidelines, not mandates**. Never sacrifice clarity or important content just to hit a line count.
|
|
312
|
-
|
|
313
|
-
**Before deleting ANY content, document:**
|
|
314
|
-
1. **What** is being removed (quote or summarize)
|
|
315
|
-
2. **Why** it's being removed:
|
|
316
|
-
- `OBSOLETE` - References deleted code/features
|
|
317
|
-
- `DUPLICATIVE` - Same info exists elsewhere (cite location)
|
|
318
|
-
- `MOVED` - Relocated to another file (cite new location)
|
|
319
|
-
- `VERBOSE` - Can be condensed without losing meaning
|
|
320
|
-
3. **Decision** - Delete, move, or keep with note
|
|
321
|
-
|
|
322
|
-
**Create a deletion log in your maintenance file:**
|
|
323
|
-
```markdown
|
|
324
|
-
## Documentation Changes
|
|
325
|
-
|
|
326
|
-
### arch.md
|
|
327
|
-
| Section | Action | Reason |
|
|
328
|
-
|---------|--------|--------|
|
|
329
|
-
| "Old API docs" | DELETED | OBSOLETE - API removed in v1.2 |
|
|
330
|
-
| "Installation" | MOVED | To INSTALL.md for brevity |
|
|
331
|
-
| "Architecture patterns" | KEPT | Still relevant, referenced by builders |
|
|
134
|
+
Audit codev/resources/arch.md and codev/resources/lessons-learned.md against the
|
|
135
|
+
discipline in the update-arch-docs skill. For each section/entry, run the per-
|
|
136
|
+
arch.md-section and per-lessons-learned.md-entry pruning checklists from the
|
|
137
|
+
MAINTAIN protocol (Step 3a). Produce a candidate-cuts list with one-line reasons.
|
|
138
|
+
Bias toward fewer, higher-confidence cuts ("when in doubt, KEEP"). Record the
|
|
139
|
+
findings in the current run file's ## Audit Findings section before applying.
|
|
332
140
|
```
|
|
333
141
|
|
|
334
|
-
**
|
|
335
|
-
- `codev/resources/arch.md` - remove references to deleted code/modules
|
|
336
|
-
- `codev/resources/lessons-learned.md` - remove outdated lessons
|
|
337
|
-
- `CLAUDE.md` / `AGENTS.md` - target ~400 lines (guideline, not hard limit)
|
|
338
|
-
- `README.md` - target ~400 lines (guideline, not hard limit)
|
|
339
|
-
|
|
340
|
-
**Conservative approach**:
|
|
341
|
-
- When in doubt, KEEP the content
|
|
342
|
-
- If unsure, ASK the architect before deleting
|
|
343
|
-
- Prefer MOVING over DELETING
|
|
344
|
-
- Never delete "development patterns" or "best practices" sections without explicit approval
|
|
345
|
-
|
|
346
|
-
**What to extract (move, don't delete)**:
|
|
347
|
-
- Detailed command references → `codev/resources/commands/`
|
|
348
|
-
- Protocol details → `codev/protocols/*/protocol.md`
|
|
349
|
-
- Tool configuration → `codev/resources/`
|
|
142
|
+
**When in doubt, KEEP.** This rule is preserved from the older Step 3. A confident cut is better than three speculative ones. The audit pass is a *proposal*; the architect's PR review confirms it.
|
|
350
143
|
|
|
351
|
-
|
|
352
|
-
- Git prohibitions and safety rules
|
|
353
|
-
- Critical workflow instructions
|
|
354
|
-
- Protocol selection guidance
|
|
355
|
-
- Consultation requirements
|
|
356
|
-
- Links to detailed docs
|
|
144
|
+
#### Step 3b: Update documentation
|
|
357
145
|
|
|
358
|
-
|
|
359
|
-
- Content duplicated elsewhere (e.g., in protocol files, role files, docs/)
|
|
360
|
-
- **When removing duplicated content**: Replace with a pointer to the canonical location
|
|
361
|
-
```markdown
|
|
362
|
-
## Consult Tool
|
|
146
|
+
Apply the audit decisions from Step 3a, plus any additive content needed.
|
|
363
147
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
-
|
|
148
|
+
**arch.md**: Compare documented structure with actual codebase. Update:
|
|
149
|
+
- Directory structure
|
|
150
|
+
- Component descriptions (explain HOW things work, not just WHAT)
|
|
151
|
+
- Key files and their purposes
|
|
152
|
+
- Remove references to deleted code (per Step 3a audit findings)
|
|
153
|
+
- Add new components/utilities
|
|
367
154
|
|
|
368
|
-
|
|
155
|
+
**lessons-learned.md**: Scan `codev/reviews/` for new reviews since last run. Extract lessons that are actionable, durable, and general. Apply Step 3a's per-entry cuts.
|
|
369
156
|
|
|
370
|
-
|
|
157
|
+
For specific additive changes, invoke `update-arch-docs` in **diff-mode** — it applies the smallest section update needed.
|
|
371
158
|
|
|
372
|
-
|
|
373
|
-
2. Review findings for false positives
|
|
374
|
-
3. Use `git rm` to remove confirmed dead code
|
|
375
|
-
4. Commit with descriptive message
|
|
159
|
+
**CLAUDE.md / AGENTS.md**: Diff the two files. They must be identical. Update the stale one.
|
|
376
160
|
|
|
377
|
-
**
|
|
161
|
+
**Documentation pruning**:
|
|
162
|
+
- Remove obsolete references
|
|
163
|
+
- ~400 line guideline for CLAUDE.md/README.md (not a hard limit)
|
|
164
|
+
- Document every deletion with justification (OBSOLETE, DUPLICATIVE, MOVED, VERBOSE)
|
|
165
|
+
- When in doubt, KEEP the content
|
|
378
166
|
|
|
379
|
-
###
|
|
167
|
+
### Step 4: Final Checks
|
|
380
168
|
|
|
381
|
-
|
|
169
|
+
```bash
|
|
170
|
+
# Build and test from the package directory
|
|
171
|
+
cd packages/codev && pnpm build && pnpm test
|
|
172
|
+
```
|
|
382
173
|
|
|
383
|
-
|
|
384
|
-
2. Categorize updates:
|
|
385
|
-
- Patch: Safe to auto-update
|
|
386
|
-
- Minor: Review changelog
|
|
387
|
-
- Major: Requires human review for breaking changes
|
|
388
|
-
3. Update and test
|
|
389
|
-
4. Document any migration steps
|
|
174
|
+
Both must pass before moving to the review phase.
|
|
390
175
|
|
|
391
|
-
|
|
176
|
+
---
|
|
392
177
|
|
|
393
|
-
|
|
178
|
+
## Maintenance Run File
|
|
394
179
|
|
|
395
|
-
|
|
396
|
-
codev update
|
|
397
|
-
```
|
|
180
|
+
Each run creates `codev/maintain/NNNN.md`:
|
|
398
181
|
|
|
399
|
-
|
|
182
|
+
```markdown
|
|
183
|
+
# Maintenance Run NNNN
|
|
400
184
|
|
|
401
|
-
|
|
185
|
+
**Date**: YYYY-MM-DD
|
|
186
|
+
**Base Commit**: <hash>
|
|
187
|
+
**PR**: #NNN
|
|
402
188
|
|
|
403
|
-
##
|
|
189
|
+
## Changes Since Last Run
|
|
404
190
|
|
|
405
|
-
|
|
191
|
+
<key commits summary>
|
|
406
192
|
|
|
407
|
-
|
|
408
|
-
- [ ] Build succeeds
|
|
409
|
-
- [ ] No import/module errors
|
|
410
|
-
- [ ] Documentation links resolve
|
|
411
|
-
- [ ] Linter passes
|
|
193
|
+
## Audit Findings
|
|
412
194
|
|
|
413
|
-
|
|
195
|
+
Recorded by Step 3a (Audit documentation) before any edits land. One line per candidate cut.
|
|
414
196
|
|
|
415
|
-
|
|
197
|
+
### arch.md
|
|
198
|
+
- <section-name>: <reason for proposed cut/compression>
|
|
416
199
|
|
|
417
|
-
|
|
200
|
+
### lessons-learned.md
|
|
201
|
+
- <entry>: <reason>
|
|
418
202
|
|
|
419
|
-
|
|
203
|
+
## What Was Done
|
|
420
204
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
consult -m codex --protocol maintain --type pr &
|
|
425
|
-
consult -m claude --protocol maintain --type pr &
|
|
426
|
-
wait
|
|
427
|
-
```
|
|
205
|
+
### Dead Code Removed
|
|
206
|
+
- `path/to/file.ts`: `unusedFunction()` — not imported anywhere
|
|
207
|
+
- Removed `some-package` dependency — zero imports
|
|
428
208
|
|
|
429
|
-
|
|
430
|
-
-
|
|
431
|
-
-
|
|
432
|
-
- Are lessons-learned.md entries actionable?
|
|
433
|
-
- Any regressions or side effects?
|
|
209
|
+
### Documentation Updated
|
|
210
|
+
- arch.md: Added VS Code extension section, removed old dashboard-server refs
|
|
211
|
+
- lessons-learned.md: Extracted 3 lessons from reviews 653, 672
|
|
434
212
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
213
|
+
### Documentation Changes Log
|
|
214
|
+
| Document | Section | Action | Reason |
|
|
215
|
+
|----------|---------|--------|--------|
|
|
216
|
+
| arch.md | "Dashboard Server" | DELETED | OBSOLETE — replaced by Tower |
|
|
439
217
|
|
|
440
|
-
|
|
218
|
+
## Deferred
|
|
441
219
|
|
|
442
|
-
|
|
220
|
+
- Items found but not worth fixing now
|
|
443
221
|
|
|
444
|
-
##
|
|
222
|
+
## Summary
|
|
445
223
|
|
|
446
|
-
|
|
447
|
-
```bash
|
|
448
|
-
# Git history preserves everything
|
|
449
|
-
git log --all --full-history -- path/to/file
|
|
450
|
-
git checkout <commit>~1 -- path/to/file
|
|
224
|
+
<2-3 sentences>
|
|
451
225
|
```
|
|
452
226
|
|
|
453
|
-
|
|
454
|
-
Move to `codev/maintain/.trash/YYYY-MM-DD/` before deleting. Retained for 30 days.
|
|
227
|
+
Keep it factual and short. The run file documents what happened, not what might happen.
|
|
455
228
|
|
|
456
229
|
---
|
|
457
230
|
|
|
@@ -459,49 +232,45 @@ Move to `codev/maintain/.trash/YYYY-MM-DD/` before deleting. Retained for 30 day
|
|
|
459
232
|
|
|
460
233
|
```
|
|
461
234
|
[Maintain] Remove 5 unused exports
|
|
462
|
-
[Maintain]
|
|
463
|
-
[Maintain]
|
|
235
|
+
[Maintain] Remove http-proxy dependency
|
|
236
|
+
[Maintain] Update arch.md — add VS Code extension, remove dashboard-server refs
|
|
237
|
+
[Maintain] Generate lessons-learned.md from reviews 653, 672
|
|
464
238
|
[Maintain] Sync CLAUDE.md with AGENTS.md
|
|
465
|
-
[Maintain] Update dependencies (patch)
|
|
466
239
|
```
|
|
467
240
|
|
|
468
241
|
---
|
|
469
242
|
|
|
470
243
|
## Governance
|
|
471
244
|
|
|
472
|
-
MAINTAIN is an
|
|
245
|
+
MAINTAIN is an operational protocol, not a feature protocol:
|
|
473
246
|
|
|
474
247
|
| Document | Required? |
|
|
475
248
|
|----------|-----------|
|
|
476
249
|
| Spec | No |
|
|
477
250
|
| Plan | No |
|
|
478
|
-
| Review | No |
|
|
479
|
-
|
|
|
251
|
+
| Review | No (maintenance run file serves this purpose) |
|
|
252
|
+
| Consultation | Yes — 3-way review before PR |
|
|
480
253
|
|
|
481
|
-
|
|
254
|
+
If maintenance reveals need for architectural changes, those should follow SPIR.
|
|
482
255
|
|
|
483
256
|
---
|
|
484
257
|
|
|
485
|
-
##
|
|
258
|
+
## Rules
|
|
486
259
|
|
|
487
|
-
1. **Don't be aggressive
|
|
488
|
-
2. **Check git blame
|
|
489
|
-
3. **Run full test suite
|
|
490
|
-
4. **Group related changes
|
|
491
|
-
5. **Document
|
|
492
|
-
6. **
|
|
493
|
-
7. **
|
|
494
|
-
8. **Size targets are guidelines**: Never sacrifice clarity to hit a line count
|
|
495
|
-
|
|
496
|
-
---
|
|
260
|
+
1. **Don't be aggressive** — when in doubt, KEEP the content
|
|
261
|
+
2. **Check git blame** — understand why code/docs exist before removing
|
|
262
|
+
3. **Run full test suite** — not just affected tests
|
|
263
|
+
4. **Group related changes** — one commit per logical change
|
|
264
|
+
5. **Document every deletion** — what, why, and where (if moved)
|
|
265
|
+
6. **Prefer moving over deleting** — extract to another file rather than removing
|
|
266
|
+
7. **Size targets are guidelines** — never sacrifice clarity to hit a line count
|
|
497
267
|
|
|
498
268
|
## Anti-Patterns
|
|
499
269
|
|
|
500
|
-
1.
|
|
501
|
-
2.
|
|
502
|
-
3.
|
|
503
|
-
4.
|
|
504
|
-
5.
|
|
505
|
-
6.
|
|
506
|
-
7.
|
|
507
|
-
8. **Making changes the architect can't review**: Big deletions need clear explanations
|
|
270
|
+
1. Aggressive rewriting without explanation
|
|
271
|
+
2. Deleting without documenting why
|
|
272
|
+
3. Hitting line count targets at all costs
|
|
273
|
+
4. Removing "patterns" or "best practices" sections without explicit approval
|
|
274
|
+
5. Deleting everything the audit finds — review each item individually
|
|
275
|
+
6. Skipping validation — "it looked dead" is not validation
|
|
276
|
+
7. Using `rm` instead of `git rm`
|