Skip to content

Commit 2d4a17f

Browse files
committed
[Maintain 0007] Apply 3-way review feedback
- arch.md: add protocol-schema.json to codev/protocols/ tree - arch.md: correct spir/ subtree (remove nonexistent manifest.yaml, add protocol.json, builder-prompt.md, prompts/, consult-types/) - arch.md: refresh codev-skeleton/protocols/ subtree (add aspir, air, bugfix, spike) - lessons-learned.md: move Spec 653 lessons into Critical section - packages/codev: add @xterm/xterm as explicit devDependency instead of relying on transitive resolution through codev-dashboard - codev/maintain/0007.md: document consultation findings and actions
1 parent 96fbea1 commit 2d4a17f

5 files changed

Lines changed: 42 additions & 9 deletions

File tree

codev/maintain/0007.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Major features merged since run 0006 (partial list):
3333
Other ts-prune/depcheck findings were investigated but retained:
3434

3535
- `@vitest/coverage-v8` — dynamically loaded by vitest config at `vitest.config.ts:30` (`provider: 'v8'`), depcheck can't detect this.
36-
- `@xterm/xterm` missing-dep warning — used only in test file `src/__tests__/filePathLinkProvider.test.ts`, resolved transitively through `@cluesmith/codev-dashboard`; no runtime impact.
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.
3737
- `state.ts` util/annotation/architect exports — used in test files; part of public state API surface.
3838
- `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.
3939
- `cli.ts:378 run()` — exported for bin shims (`afx.js`, `consult.js`).
@@ -44,11 +44,13 @@ Other ts-prune/depcheck findings were investigated but retained:
4444
**`codev/resources/arch.md`**:
4545
- 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`.
4646
- Refreshed `bin/` tree: added `af.js` (deprecation shim) and `generate-image.js`.
47-
- Refreshed `codev/protocols/` tree: added `aspir`, `air`, `bugfix`, `release`, `spike` (were missing).
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`).
4850
- Updated version footer: `v2.0.0-rc.54``v3.0.0-rc.9`; date bumped to 2026-04-17.
4951

5052
**`codev/resources/lessons-learned.md`**:
51-
- Added 3 lessons from Spec 653 (builder handling / TICK removal): start from structural insight, full-repo grep for protocol removal, single verify-pass consultation cadence.
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.
5254
- Updated footer date.
5355

5456
**`AGENTS.md`**:
@@ -80,6 +82,26 @@ Other ts-prune/depcheck findings were investigated but retained:
8082
- **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.
8183
- **`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.
8284

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+
83105
## Summary
84106

85107
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.

codev/resources/arch.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,15 +1112,19 @@ codev/ # Project root (pnpm monorepo)
11121112
│ ├── protocols/ # Working copies for development
11131113
│ │ ├── spir/ # Multi-phase with consultation
11141114
│ │ │ ├── protocol.md
1115+
│ │ │ ├── protocol.json
1116+
│ │ │ ├── builder-prompt.md
11151117
│ │ │ ├── templates/
1116-
│ │ │ └── manifest.yaml
1118+
│ │ │ ├── prompts/
1119+
│ │ │ └── consult-types/
11171120
│ │ ├── aspir/ # Autonomous SPIR (no human gates)
11181121
│ │ ├── air/ # Autonomous Implement & Review
11191122
│ │ ├── bugfix/ # GitHub Issue-driven fixes
11201123
│ │ ├── experiment/ # Disciplined experimentation
11211124
│ │ ├── release/ # Version release procedure
11221125
│ │ ├── spike/ # Time-boxed research
1123-
│ │ └── maintain/ # Codebase maintenance
1126+
│ │ ├── maintain/ # Codebase maintenance
1127+
│ │ └── protocol-schema.json # JSON schema for protocol.json files
11241128
│ ├── specs/ # Our feature specifications
11251129
│ ├── plans/ # Our implementation plans
11261130
│ ├── reviews/ # Our lessons learned
@@ -1135,7 +1139,11 @@ codev/ # Project root (pnpm monorepo)
11351139
│ ├── templates/ # Document templates (CLAUDE.md, arch.md, etc.)
11361140
│ ├── protocols/ # Protocol definitions
11371141
│ │ ├── spir/
1142+
│ │ ├── aspir/
1143+
│ │ ├── air/
1144+
│ │ ├── bugfix/
11381145
│ │ ├── experiment/
1146+
│ │ ├── spike/
11391147
│ │ └── maintain/
11401148
│ ├── specs/ # Empty (placeholder)
11411149
│ ├── plans/ # Empty (placeholder)

codev/resources/lessons-learned.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ Generalizable wisdom extracted from review documents, ordered by impact. Updated
3838
- [From 0324] `detached: true` and `child.unref()` are necessary but not sufficient for process independence -- any pipe-based stdio (e.g., `stdio: ['ignore', 'pipe', 'pipe']`) creates a lifecycle dependency between parent and child processes. When the parent exits, the broken pipe triggers unhandled EPIPE errors in the child. Use file FDs or `'ignore'` for truly independent daemon children.
3939
- [From bugfix-274] Startup ordering matters when multiple subsystems share resources (Shellper sockets). Initialization order creates implicit synchronization -- calling `initInstances()` before `reconcileTerminalSessions()` allowed dashboard polls to race with reconciliation. Document ordering constraints in comments.
4040
- [From bugfix-274] Defense in depth for race conditions: the startup reorder closes the primary race path, but the `_reconciling` guard provides a safety net for code paths that bypass the primary fix (e.g., direct `/project/.../api/state` requests bypassing `getInstances()`).
41+
- [From 653] Start from the structural insight, not the feature list. The first three spec drafts built elaborate gate-ceremony machinery (checkpoint PRs, feedback commands, verify notes) that was all eliminated once the core insight — break the 1:1 builder↔PR assumption — was identified. When a spec feels bloated, look for the one structural change that makes the ceremony unnecessary.
42+
- [From 653] Protocol removal requires full-repo grep, not targeted searches. Removing a protocol touches ~50 files across source, docs, templates, skills, tests, and CLI help text. Scoped searches miss skeleton templates, test fixtures, and user-facing help strings. Run `rg` across the entire repo and verify zero hits before committing.
43+
- [From 653] Single verify pass + rebuttal is the right consultation cadence. Multi-iteration consult loops (running `consult` manually after each fix) violate `max_iterations=1` and add little marginal value over one rigorous verify pass followed by rebuttals.
4144

4245
## Security
4346

@@ -362,10 +365,6 @@ Generalizable wisdom extracted from review documents, ordered by impact. Updated
362365
- [From 627] Lifecycle phases (initial-load → buffer-replay → interactive) eliminate magic thresholds. Instead of asking "is this scroll event real?", ask "what phase am I in?" to determine behavior.
363366
- [From 627] Always add a `reset()` method to state machines that persist across reconnections. The ScrollController's phase transitions were one-way until reconnection revealed the need to return to initial-load.
364367

365-
- [From 653] Start from the structural insight, not the feature list. The first three spec drafts built elaborate gate-ceremony machinery (checkpoint PRs, feedback commands, verify notes) that was all eliminated once the core insight — break the 1:1 builder↔PR assumption — was identified. When a spec feels bloated, look for the one structural change that makes the ceremony unnecessary.
366-
- [From 653] Protocol removal requires full-repo grep, not targeted searches. Removing a protocol touches ~50 files across source, docs, templates, skills, tests, and CLI help text. Scoped searches miss skeleton templates, test fixtures, and user-facing help strings. Run `rg` across the entire repo and verify zero hits before committing.
367-
- [From 653] Single verify pass + rebuttal is the right consultation cadence. Multi-iteration consult loops (running `consult` manually after each fix) violate `max_iterations=1` and add little marginal value over one rigorous verify pass followed by rebuttals.
368-
369368
---
370369

371370
*Last updated: 2026-04-17 (Maintenance run 0007 — v3.0.0 pre-release)*

packages/codev/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"@cluesmith/codev-dashboard": "workspace:*",
5656
"@cluesmith/codev-types": "workspace:*",
5757
"@playwright/test": "^1.58.0",
58+
"@xterm/xterm": "^5.5.0",
5859
"@types/better-sqlite3": "^7.6.13",
5960
"@types/js-yaml": "^4.0.9",
6061
"@types/node": "^22.10.1",

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)