@cluesmith/codev 3.1.8 → 3.2.0
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/dist/agent-farm/cli.d.ts.map +1 -1
- package/dist/agent-farm/cli.js +12 -5
- package/dist/agent-farm/cli.js.map +1 -1
- package/dist/agent-farm/commands/spawn-roles.d.ts +6 -1
- package/dist/agent-farm/commands/spawn-roles.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn-roles.js +49 -45
- package/dist/agent-farm/commands/spawn-roles.js.map +1 -1
- package/dist/agent-farm/commands/status.d.ts +14 -1
- package/dist/agent-farm/commands/status.d.ts.map +1 -1
- package/dist/agent-farm/commands/status.js +151 -34
- package/dist/agent-farm/commands/status.js.map +1 -1
- package/dist/agent-farm/commands/tower.d.ts +1 -0
- package/dist/agent-farm/commands/tower.d.ts.map +1 -1
- package/dist/agent-farm/commands/tower.js +6 -2
- package/dist/agent-farm/commands/tower.js.map +1 -1
- package/dist/agent-farm/servers/overview.d.ts.map +1 -1
- package/dist/agent-farm/servers/overview.js +2 -0
- package/dist/agent-farm/servers/overview.js.map +1 -1
- package/dist/agent-farm/servers/tower-instances.d.ts +18 -0
- package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-instances.js +9 -1
- package/dist/agent-farm/servers/tower-instances.js.map +1 -1
- package/dist/agent-farm/servers/tower-server.js +34 -0
- package/dist/agent-farm/servers/tower-server.js.map +1 -1
- package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-websocket.js +7 -1
- package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
- package/dist/agent-farm/utils/architect-name.d.ts +13 -0
- package/dist/agent-farm/utils/architect-name.d.ts.map +1 -1
- package/dist/agent-farm/utils/architect-name.js +16 -0
- package/dist/agent-farm/utils/architect-name.js.map +1 -1
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +15 -1
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +26 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +19 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/porch/prompts.d.ts +12 -0
- package/dist/commands/porch/prompts.d.ts.map +1 -1
- package/dist/commands/porch/prompts.js +33 -5
- package/dist/commands/porch/prompts.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +37 -1
- package/dist/commands/update.js.map +1 -1
- package/dist/lib/forge-contracts.d.ts +9 -0
- package/dist/lib/forge-contracts.d.ts.map +1 -1
- package/dist/lib/forge-contracts.js.map +1 -1
- package/dist/lib/framework-ref-audit.d.ts +23 -0
- package/dist/lib/framework-ref-audit.d.ts.map +1 -0
- package/dist/lib/framework-ref-audit.js +84 -0
- package/dist/lib/framework-ref-audit.js.map +1 -0
- package/dist/lib/managed-block.d.ts +31 -0
- package/dist/lib/managed-block.d.ts.map +1 -0
- package/dist/lib/managed-block.js +114 -0
- package/dist/lib/managed-block.js.map +1 -0
- package/dist/lib/scaffold.d.ts +42 -0
- package/dist/lib/scaffold.d.ts.map +1 -1
- package/dist/lib/scaffold.js +81 -0
- package/dist/lib/scaffold.js.map +1 -1
- package/dist/lib/skeleton.d.ts +12 -0
- package/dist/lib/skeleton.d.ts.map +1 -1
- package/dist/lib/skeleton.js +21 -0
- package/dist/lib/skeleton.js.map +1 -1
- package/dist/lib/templates.d.ts.map +1 -1
- package/dist/lib/templates.js +3 -0
- package/dist/lib/templates.js.map +1 -1
- package/dist/terminal/pty-manager.d.ts +18 -2
- package/dist/terminal/pty-manager.d.ts.map +1 -1
- package/dist/terminal/pty-manager.js +27 -2
- package/dist/terminal/pty-manager.js.map +1 -1
- package/dist/terminal/pty-session.d.ts +2 -0
- package/dist/terminal/pty-session.d.ts.map +1 -1
- package/dist/terminal/pty-session.js +13 -0
- package/dist/terminal/pty-session.js.map +1 -1
- package/dist/terminal/ring-buffer.d.ts +25 -1
- package/dist/terminal/ring-buffer.d.ts.map +1 -1
- package/dist/terminal/ring-buffer.js +40 -12
- package/dist/terminal/ring-buffer.js.map +1 -1
- package/dist/terminal/session-manager.d.ts +4 -0
- package/dist/terminal/session-manager.d.ts.map +1 -1
- package/dist/terminal/session-manager.js +74 -9
- package/dist/terminal/session-manager.js.map +1 -1
- package/dist/terminal/shellper-process.d.ts +1 -0
- package/dist/terminal/shellper-process.d.ts.map +1 -1
- package/dist/terminal/shellper-process.js +17 -2
- package/dist/terminal/shellper-process.js.map +1 -1
- package/package.json +22 -23
- 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-search.sh +0 -0
- package/scripts/forge/gitea/issue-view.sh +0 -0
- package/scripts/forge/gitea/pr-exists.sh +0 -0
- package/scripts/forge/gitea/pr-list.sh +14 -1
- 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 +0 -0
- package/scripts/forge/github/issue-search.sh +0 -0
- 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 +0 -0
- package/scripts/forge/github/pr-list.sh +9 -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-search.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 +0 -0
- package/scripts/forge/gitlab/pr-list.sh +11 -1
- 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 +0 -0
- package/scripts/forge/linear/issue-comment.sh +0 -0
- package/scripts/forge/linear/issue-list.sh +0 -0
- package/scripts/forge/linear/issue-search.sh +0 -0
- package/scripts/forge/linear/issue-view.sh +0 -0
- package/scripts/forge/linear/recently-closed.sh +0 -0
- package/scripts/forge/linear/user-identity.sh +0 -0
- package/skeleton/.claude/skills/update-arch-docs/SKILL.md +38 -13
- package/skeleton/porch/prompts/review.md +19 -11
- package/skeleton/protocols/air/builder-prompt.md +7 -1
- package/skeleton/protocols/aspir/builder-prompt.md +7 -2
- package/skeleton/protocols/aspir/prompts/plan.md +2 -34
- package/skeleton/protocols/aspir/prompts/review.md +19 -11
- package/skeleton/protocols/aspir/templates/review.md +4 -4
- package/skeleton/protocols/bugfix/builder-prompt.md +7 -1
- package/skeleton/protocols/bugfix/protocol.md +78 -0
- package/skeleton/protocols/experiment/builder-prompt.md +7 -1
- package/skeleton/protocols/experiment/protocol.md +7 -28
- package/skeleton/protocols/maintain/builder-prompt.md +7 -1
- package/skeleton/protocols/maintain/prompts/maintain.md +5 -4
- package/skeleton/protocols/maintain/prompts/review.md +1 -1
- package/skeleton/protocols/maintain/protocol.md +30 -22
- package/skeleton/protocols/maintain/templates/maintenance-run.md +2 -2
- package/skeleton/protocols/pir/builder-prompt.md +8 -3
- package/skeleton/protocols/pir/prompts/review.md +9 -7
- package/skeleton/protocols/pir/protocol.md +1 -1
- package/skeleton/protocols/research/builder-prompt.md +7 -1
- package/skeleton/protocols/spike/builder-prompt.md +7 -1
- package/skeleton/protocols/spike/protocol.md +7 -1
- package/skeleton/protocols/spir/builder-prompt.md +7 -2
- package/skeleton/protocols/spir/prompts/plan.md +2 -34
- package/skeleton/protocols/spir/prompts/review.md +19 -11
- package/skeleton/protocols/spir/protocol.md +5 -6
- package/skeleton/protocols/spir/templates/review.md +4 -4
- package/skeleton/resources/arch-critical.md +17 -0
- package/skeleton/resources/lessons-critical.md +17 -0
- package/skeleton/roles/builder.md +2 -2
- package/skeleton/templates/arch-critical.md +17 -0
- package/skeleton/templates/arch.starter.md +9 -0
- package/skeleton/templates/lessons-critical.md +17 -0
- package/skeleton/templates/lessons-learned.starter.md +9 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: update-arch-docs
|
|
3
|
-
description: "Audit, prune, and update the project's
|
|
3
|
+
description: "Audit, prune, and update the project's governance docs — the COLD reference archives `codev/resources/arch.md` and `codev/resources/lessons-learned.md` AND their always-on HOT companions `codev/resources/arch-critical.md` and `codev/resources/lessons-critical.md` (Spec 987, hot/cold two-tier model). Use this skill when running MAINTAIN's arch-doc step, or when asked to update / audit / prune any of those four files. It polices the hot-tier cap (capped facts/lessons + a bounded cold-doc map), enforces displacement (demote to cold when full), keeps each hot file's map accurate, and is opinionated about what NOT to put in each tier (per-spec changelogs, exhaustive enumerations, aspirational state). Two modes: diff-mode (apply a specific change) and audit-mode (propose cuts with reasons). Edits files directly via normal file-edit tooling; no destructive shell commands."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# update-arch-docs
|
|
7
7
|
|
|
8
|
-
This skill maintains
|
|
8
|
+
This skill maintains the project's governance docs, each split into **two tiers** (Spec 987):
|
|
9
9
|
|
|
10
|
-
- `codev/resources/arch.md`
|
|
11
|
-
- `codev/resources/
|
|
10
|
+
- **COLD reference archives** — `codev/resources/arch.md` (architecture) and `codev/resources/lessons-learned.md` (durable wisdom). Full, on-demand; grepped/read for depth.
|
|
11
|
+
- **HOT always-on companions** — `codev/resources/arch-critical.md` and `codev/resources/lessons-critical.md`. Tiny, **hard-capped**, **always injected** into every porch prompt and into CLAUDE.md/AGENTS.md. Each holds capped facts/lessons **plus a bounded "consult when…" map** of its cold doc's top-level topics.
|
|
12
12
|
|
|
13
|
-
It is invoked by the MAINTAIN protocol's documentation step, and ad-hoc whenever someone
|
|
13
|
+
It is invoked by the MAINTAIN protocol's documentation step, and ad-hoc whenever someone updates, audits, or prunes any of these files. The skill is opinionated about *what does not belong* in each tier and **polices the hot-tier cap, displacement, and map accuracy**. Use it whenever a doc change touches any of the four files.
|
|
14
14
|
|
|
15
15
|
## What this skill does NOT do
|
|
16
16
|
|
|
@@ -26,12 +26,22 @@ These are the patterns that have, in practice, caused arch.md and lessons-learne
|
|
|
26
26
|
- **Duplication of meta-spec content**. If a subsystem has its own meta-spec under `codev/architecture/<domain>.md` or under `codev/specs/`, arch.md should carry a 1-paragraph summary plus a pointer — not a copy.
|
|
27
27
|
- **Retired-component graveyards**. When a component is removed, delete its section. `git log` retains history; an arch.md that describes things that no longer exist is misleading.
|
|
28
28
|
|
|
29
|
-
### In lessons-
|
|
29
|
+
### In the HOT files (`arch-critical.md`, `lessons-critical.md`)
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- **
|
|
34
|
-
- **Spec-
|
|
31
|
+
These are capped, always-on, and **behavior-changers only**. Bright-line rejections:
|
|
32
|
+
|
|
33
|
+
- **Anything over the cap.** Each hot file fits in a handful of lines (≈10 single-line facts/lessons + a cold-doc map of ≈12 top-level topics, ≤35 lines). To add an entry, **demote** a weaker one into the cold doc (displacement) — never grow the hot file.
|
|
34
|
+
- **Spec-narrow recipes / reference detail.** Those go in the COLD archive (reference), never the hot file.
|
|
35
|
+
- **A full/auto table of contents** in the cold-doc map. The map lists only **top-level** cold-doc sections, each with a one-line "consult when…" — never every entry.
|
|
36
|
+
- **Multi-paragraph entries.** One line each.
|
|
37
|
+
|
|
38
|
+
### In the COLD archives (`arch.md`, `lessons-learned.md`)
|
|
39
|
+
|
|
40
|
+
These are the on-demand **reference**. They may hold spec-narrow recipes and deeper detail — the anti-accretion discipline lives in the hot cap, not here. Still avoid:
|
|
41
|
+
|
|
42
|
+
- **Multi-paragraph lesson entries**. Split or compress to 1–3 sentences.
|
|
43
|
+
- **Duplicate adjacent entries**. Fold variations of the same lesson into one.
|
|
44
|
+
- **Spec-numbered narrative framing** ("Lesson from #0468:…"). State the general principle; link the review if needed.
|
|
35
45
|
|
|
36
46
|
### In either file (process)
|
|
37
47
|
|
|
@@ -51,6 +61,16 @@ Treat the two files as siblings with different purposes. When in doubt about whi
|
|
|
51
61
|
|
|
52
62
|
The "system-shape surprise" routing is the one most often gotten wrong. 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.
|
|
53
63
|
|
|
64
|
+
That arch-vs-lessons routing is the **cold-tier** axis. **Orthogonal to it is the hot/cold axis**: once you know a fact is architecture (or a lesson), decide whether it is *behavior-changing enough* to earn a slot in the capped hot companion, or whether it is reference detail for the cold archive.
|
|
65
|
+
|
|
66
|
+
## Hot tier: cap, displacement, and map accuracy
|
|
67
|
+
|
|
68
|
+
The hot files (`arch-critical.md`, `lessons-critical.md`) are the behavior-changers, and their value depends on staying tiny. When MAINTAIN runs — or any update touches them — enforce:
|
|
69
|
+
|
|
70
|
+
- **Cap.** Each hot file fits in a handful of lines: ≈10 single-line facts/lessons **plus** a cold-doc map of ≈12 top-level topics, ≤35 lines total. If an addition would exceed the cap, **demote** the weakest existing entry into the corresponding cold doc rather than growing the hot file. The cap is load-bearing: it is what keeps the hot tier cheap enough to inject into *every* prompt.
|
|
71
|
+
- **Map accuracy (bounded AND accurate).** Each hot file ends with a "Map of <cold doc> (consult when…)" listing only the cold doc's **top-level** sections, each with a one-line "consult when…". As cold-doc sections are added / renamed / removed, update the map to match — but keep it top-level only; never expand it into a full table of contents (that re-creates the accretion the hot tier exists to avoid).
|
|
72
|
+
- **Behavior-changers only.** A hot entry must be something that should change a decision up front. Reference detail, recipes, and one-offs belong in the cold archive — demote on sight.
|
|
73
|
+
|
|
54
74
|
## Sizing by purpose, not by line count
|
|
55
75
|
|
|
56
76
|
There is no line-count budget for either file. The right size for each section is determined by what the section needs to do. If a subsystem genuinely has unique mechanism that takes 80 lines to explain clearly, 80 lines is the right size. If a subsystem can be described in 5 lines and a pointer to a meta-spec, 5 lines is right.
|
|
@@ -85,11 +105,16 @@ In audit-mode:
|
|
|
85
105
|
- Is it a per-file enumeration that's gone stale? If yes, prune to the directory shape + a few key files.
|
|
86
106
|
- Is it a changelog/narrative section ("Spec 0042 added X")? If yes, absorb the architecturally-relevant facts and remove the spec-numbered framing.
|
|
87
107
|
- Is the component still alive? If retired, delete the section entirely.
|
|
88
|
-
3. For each entry in lessons-learned.md
|
|
89
|
-
- Is it cross-applicable beyond the spec that produced it? If no, remove (the lesson belongs in the spec's review).
|
|
108
|
+
3. For each entry in the COLD `lessons-learned.md`, run the per-entry checklist:
|
|
90
109
|
- Is it terse (1–3 sentences)? If multi-paragraph, split or compress.
|
|
91
110
|
- Is the topic section the right one? If filed under "Architecture (continued)" or a spec-numbered section, move it to the right topical home.
|
|
92
111
|
- Is it a duplicate of an adjacent entry? If yes, fold them.
|
|
112
|
+
- (Spec-narrow recipes are **kept** here as reference — do not cut them just for being spec-narrow. Anti-accretion now lives in the hot cap, not in the cold archive.)
|
|
113
|
+
|
|
114
|
+
Then audit each **HOT** file (`arch-critical.md`, `lessons-critical.md`):
|
|
115
|
+
- **Cap**: within ≈10 entries + a ≈12-topic map, ≤35 lines? If over, **demote** the weakest entries into the cold doc.
|
|
116
|
+
- **Map accuracy**: does every map topic name a real top-level cold-doc section, and is any new/renamed section reflected? Fix drift; keep the map top-level only.
|
|
117
|
+
- **Behavior-changers only**: demote any reference detail that crept in.
|
|
93
118
|
4. **When in doubt, KEEP.** This rule comes from the MAINTAIN protocol and applies in audit-mode too. A confident cut is better than three speculative ones. Bias toward fewer, higher-confidence proposals with clear rationale; do not chase a maximum cut count.
|
|
94
119
|
5. Apply the cuts via the Edit tool — the skill does not produce a "candidate-cuts list and stop." The diff *is* the proposal. The MAINTAIN PR review is the human-confirmation step.
|
|
95
120
|
6. Surface a short reason alongside each cut in the run file (`codev/maintain/NNNN.md`) so PR reviewers can evaluate intent ("removed because: per-spec changelog framing"; "compressed because: duplicates the orchestrator meta-spec").
|
|
@@ -100,7 +125,7 @@ Audit-mode is slower than diff-mode and produces larger diffs. Reserve it for ex
|
|
|
100
125
|
|
|
101
126
|
The skill commits to the following:
|
|
102
127
|
|
|
103
|
-
- It edits `codev/resources/arch.md` and `codev/resources/lessons-learned.md` directly via the Edit tool.
|
|
128
|
+
- It edits the four governance files — `codev/resources/arch.md` / `arch-critical.md` and `codev/resources/lessons-learned.md` / `lessons-critical.md` — directly via the Edit tool.
|
|
104
129
|
- It does not invoke destructive shell commands (no `rm -rf`, no `git rm`, no destructive `sed`). File deletions happen only through Edit removing the relevant content; whole-file removal would be a structural change that is out of scope for this skill.
|
|
105
130
|
- In audit-mode, every removal is paired with a one-line reason in the MAINTAIN run file's `## Audit Findings` section. Rationale lives there so reviewers can evaluate intent without re-deriving it from the diff.
|
|
106
131
|
- The skill does not modify other files (specs, plans, reviews, source code). If a fact belongs somewhere else, the skill flags it; it does not move it.
|
|
@@ -137,17 +137,25 @@ Read the consultation output files from the project directory (`codev/projects/{
|
|
|
137
137
|
|
|
138
138
|
**MANDATORY**: The review document MUST include `## Architecture Updates` and `## Lessons Learned Updates` sections. Porch will block advancement if these are missing.
|
|
139
139
|
|
|
140
|
-
**
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
3.
|
|
150
|
-
|
|
140
|
+
Each governance doc has **two tiers** (Spec 987) — **route** each new fact/lesson to the right tier; do **not** just append to the cold archive:
|
|
141
|
+
- **HOT** — `codev/resources/arch-critical.md` / `lessons-critical.md`: tiny, **hard-capped**, **always injected** into every prompt and into CLAUDE.md/AGENTS.md. The behavior-changer.
|
|
142
|
+
- **COLD** — `codev/resources/arch.md` / `lessons-learned.md`: full, on-demand reference.
|
|
143
|
+
|
|
144
|
+
**Architecture Updates**:
|
|
145
|
+
1. Read `arch-critical.md` (hot) and skim `arch.md` (cold).
|
|
146
|
+
2. If this project produced a system-shape fact, route it:
|
|
147
|
+
- **Behavior-changing + cross-cutting** (an invariant/decision a future builder must know up front) → add to **`arch-critical.md`**. Respect the cap: if the hot file is full, **demote** a weaker entry into `arch.md` to make room. If you add/rename a top-level `arch.md` section, keep the hot file's cold-doc map accurate.
|
|
148
|
+
- **Reference detail** (subsystem mechanism, file location, one-off) → add to **`arch.md`** (cold).
|
|
149
|
+
3. Describe what you routed where in the `## Architecture Updates` section. If nothing qualifies: write "No architecture updates needed" with a brief reason.
|
|
150
|
+
|
|
151
|
+
**Lessons Learned Updates**:
|
|
152
|
+
1. Read `lessons-critical.md` (hot) and skim `lessons-learned.md` (cold).
|
|
153
|
+
2. If this project produced a durable lesson, route it:
|
|
154
|
+
- **Behavior-changing + cross-cutting** (a rule that should change how the next project is built) → add to **`lessons-critical.md`**, respecting the cap (demote a weaker entry into `lessons-learned.md` if full).
|
|
155
|
+
- **Spec-narrow recipe / reference tip** → add to **`lessons-learned.md`** (cold). Spec-narrow recipes belong in the cold archive, never the always-on hot file.
|
|
156
|
+
3. Describe what you routed where in the `## Lessons Learned Updates` section. If nothing qualifies: write "No lessons learned updates needed" with a brief reason.
|
|
157
|
+
|
|
158
|
+
**Never** grow a hot file past its cap by appending — route to cold or displace. The cap is what keeps the hot tier cheap enough to always inject.
|
|
151
159
|
|
|
152
160
|
### 2. Create Pull Request
|
|
153
161
|
|
|
@@ -24,7 +24,7 @@ You are running in STRICT mode. This means:
|
|
|
24
24
|
{{/if}}
|
|
25
25
|
|
|
26
26
|
## Protocol
|
|
27
|
-
Follow the AIR protocol
|
|
27
|
+
Follow the AIR protocol. Read and internalize the protocol before starting any work. The full protocol text is included below under **## Protocol Reference (full text)**.
|
|
28
28
|
|
|
29
29
|
## Baked Decisions
|
|
30
30
|
|
|
@@ -73,3 +73,9 @@ If you encounter **pre-existing flaky tests** (intermittent failures unrelated t
|
|
|
73
73
|
1. Read the AIR protocol
|
|
74
74
|
2. Review the issue details
|
|
75
75
|
3. Implement the feature
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Protocol Reference (full text)
|
|
80
|
+
|
|
81
|
+
{{protocol_reference}}
|
|
@@ -27,8 +27,7 @@ You are running in STRICT mode. This means:
|
|
|
27
27
|
{{/if}}
|
|
28
28
|
|
|
29
29
|
## Protocol
|
|
30
|
-
Follow the ASPIR protocol
|
|
31
|
-
Read and internalize the protocol before starting any work.
|
|
30
|
+
Follow the ASPIR protocol. Read and internalize the protocol before starting any work. The full protocol text is included below under **## Protocol Reference (full text)**.
|
|
32
31
|
|
|
33
32
|
## Baked Decisions
|
|
34
33
|
|
|
@@ -111,3 +110,9 @@ If you encounter **pre-existing flaky tests** (intermittent failures unrelated t
|
|
|
111
110
|
1. Read the protocol document thoroughly
|
|
112
111
|
2. Review the spec and plan (if available)
|
|
113
112
|
3. Begin implementation following the protocol phases
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Protocol Reference (full text)
|
|
117
|
+
|
|
118
|
+
{{protocol_reference}}
|
|
@@ -74,41 +74,9 @@ After completing the plan draft, signal completion. Porch will run 3-way consult
|
|
|
74
74
|
|
|
75
75
|
## Output
|
|
76
76
|
|
|
77
|
-
Create the plan file at `codev/plans/{{artifact_name}}.md
|
|
77
|
+
Create the plan file at `codev/plans/{{artifact_name}}.md`, following the template below:
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
### Plan Structure
|
|
82
|
-
|
|
83
|
-
```markdown
|
|
84
|
-
# Implementation Plan: {{title}}
|
|
85
|
-
|
|
86
|
-
## Overview
|
|
87
|
-
Brief summary of what will be implemented.
|
|
88
|
-
|
|
89
|
-
## Phases
|
|
90
|
-
|
|
91
|
-
### Phase 1: [Name]
|
|
92
|
-
- **Objective**: [Single clear goal]
|
|
93
|
-
- **Files**: [List of files to create/modify]
|
|
94
|
-
- **Dependencies**: None
|
|
95
|
-
- **Success Criteria**: [How to verify completion]
|
|
96
|
-
- **Tests**: [What tests will be written]
|
|
97
|
-
|
|
98
|
-
### Phase 2: [Name]
|
|
99
|
-
- **Objective**: [Single clear goal]
|
|
100
|
-
- **Files**: [List of files]
|
|
101
|
-
- **Dependencies**: Phase 1
|
|
102
|
-
- **Success Criteria**: [Verification method]
|
|
103
|
-
- **Tests**: [Test approach]
|
|
104
|
-
|
|
105
|
-
[Continue for all phases...]
|
|
106
|
-
|
|
107
|
-
## Risk Assessment
|
|
108
|
-
- [Risk 1]: [Mitigation]
|
|
109
|
-
- [Risk 2]: [Mitigation]
|
|
110
|
-
|
|
111
|
-
```
|
|
79
|
+
{{> protocols/spir/templates/plan.md}}
|
|
112
80
|
|
|
113
81
|
## Signals
|
|
114
82
|
|
|
@@ -148,17 +148,25 @@ Read the consultation output files from the project directory (`codev/projects/{
|
|
|
148
148
|
|
|
149
149
|
**MANDATORY**: The review document MUST include `## Architecture Updates` and `## Lessons Learned Updates` sections. Porch will block advancement if these are missing.
|
|
150
150
|
|
|
151
|
-
**
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
3.
|
|
161
|
-
|
|
151
|
+
Each governance doc has **two tiers** (Spec 987) — **route** each new fact/lesson to the right tier; do **not** just append to the cold archive:
|
|
152
|
+
- **HOT** — `codev/resources/arch-critical.md` / `lessons-critical.md`: tiny, **hard-capped**, **always injected** into every prompt and into CLAUDE.md/AGENTS.md. The behavior-changer.
|
|
153
|
+
- **COLD** — `codev/resources/arch.md` / `lessons-learned.md`: full, on-demand reference.
|
|
154
|
+
|
|
155
|
+
**Architecture Updates**:
|
|
156
|
+
1. Read `arch-critical.md` (hot) and skim `arch.md` (cold).
|
|
157
|
+
2. If this project produced a system-shape fact, route it:
|
|
158
|
+
- **Behavior-changing + cross-cutting** (an invariant/decision a future builder must know up front) → add to **`arch-critical.md`**. Respect the cap: if the hot file is full, **demote** a weaker entry into `arch.md` to make room. If you add/rename a top-level `arch.md` section, keep the hot file's cold-doc map accurate.
|
|
159
|
+
- **Reference detail** (subsystem mechanism, file location, one-off) → add to **`arch.md`** (cold).
|
|
160
|
+
3. Describe what you routed where in the `## Architecture Updates` section. If nothing qualifies: write "No architecture updates needed" with a brief reason.
|
|
161
|
+
|
|
162
|
+
**Lessons Learned Updates**:
|
|
163
|
+
1. Read `lessons-critical.md` (hot) and skim `lessons-learned.md` (cold).
|
|
164
|
+
2. If this project produced a durable lesson, route it:
|
|
165
|
+
- **Behavior-changing + cross-cutting** (a rule that should change how the next project is built) → add to **`lessons-critical.md`**, respecting the cap (demote a weaker entry into `lessons-learned.md` if full).
|
|
166
|
+
- **Spec-narrow recipe / reference tip** → add to **`lessons-learned.md`** (cold). Spec-narrow recipes belong in the cold archive, never the always-on hot file.
|
|
167
|
+
3. Describe what you routed where in the `## Lessons Learned Updates` section. If nothing qualifies: write "No lessons learned updates needed" with a brief reason.
|
|
168
|
+
|
|
169
|
+
**Never** grow a hot file past its cap by appending — route to cold or displace. The cap is what keeps the hot tier cheap enough to always inject.
|
|
162
170
|
|
|
163
171
|
### 4b. Update Other Documentation
|
|
164
172
|
|
|
@@ -99,16 +99,16 @@ Iterations that could have been prevented with better builder behavior:
|
|
|
99
99
|
|
|
100
100
|
## Architecture Updates
|
|
101
101
|
|
|
102
|
-
[What
|
|
102
|
+
[What you routed where — HOT `codev/resources/arch-critical.md` (tiny, capped, always-injected) vs COLD `codev/resources/arch.md` (reference) — or why no changes were needed.]
|
|
103
103
|
|
|
104
|
-
-
|
|
104
|
+
- Routed: [hot | cold] — [fact/section] — [what was added/changed; note any demotion if the hot file was full]
|
|
105
105
|
- Or: "No architecture updates needed — [brief reason]"
|
|
106
106
|
|
|
107
107
|
## Lessons Learned Updates
|
|
108
108
|
|
|
109
|
-
[What
|
|
109
|
+
[What you routed where — HOT `codev/resources/lessons-critical.md` (capped) vs COLD `codev/resources/lessons-learned.md` (reference) — or why no changes were needed.]
|
|
110
110
|
|
|
111
|
-
-
|
|
111
|
+
- Routed: [hot | cold] — [category] — [lesson summary]
|
|
112
112
|
- Or: "No lessons learned updates needed — [brief reason]"
|
|
113
113
|
|
|
114
114
|
## Technical Debt
|
|
@@ -25,7 +25,7 @@ You are running in STRICT mode. This means:
|
|
|
25
25
|
{{/if}}
|
|
26
26
|
|
|
27
27
|
## Protocol
|
|
28
|
-
Follow the BUGFIX protocol
|
|
28
|
+
Follow the BUGFIX protocol. Read and internalize the protocol before starting any work. The full protocol text is included below under **## Protocol Reference (full text)**.
|
|
29
29
|
|
|
30
30
|
{{#if issue}}
|
|
31
31
|
## Issue #{{issue.number}}
|
|
@@ -67,3 +67,9 @@ If you encounter **pre-existing flaky tests** (intermittent failures unrelated t
|
|
|
67
67
|
1. Read the BUGFIX protocol
|
|
68
68
|
2. Review the issue details
|
|
69
69
|
3. Reproduce the bug before fixing
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Protocol Reference (full text)
|
|
74
|
+
|
|
75
|
+
{{protocol_reference}}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# BUGFIX Protocol
|
|
2
|
+
|
|
3
|
+
> Lightweight, issue-driven protocol for minor bug fixes. **Investigate → Fix → PR**, with a single `pr` gate before merge. No spec or plan artifacts: the GitHub issue is the spec, and the review goes in the PR body.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
Use BUGFIX when a bug is reported as a GitHub Issue and:
|
|
8
|
+
|
|
9
|
+
- The reproduction is clear (or inferable) and the root cause is isolated
|
|
10
|
+
- The fix is small (guideline: < 300 LOC net diff) and contained to one area
|
|
11
|
+
- No architectural changes or new design decisions are needed
|
|
12
|
+
|
|
13
|
+
Escalate to **SPIR** (or another heavier protocol) instead when:
|
|
14
|
+
|
|
15
|
+
- It is actually a feature request, not a bug
|
|
16
|
+
- The root cause reveals a deeper architectural issue
|
|
17
|
+
- The fix needs design review, spans multiple components, or clearly exceeds ~300 LOC
|
|
18
|
+
|
|
19
|
+
## Phases
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
investigate → fix → pr
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Investigate
|
|
26
|
+
|
|
27
|
+
Read the issue, reproduce the bug, and identify the root cause. Confirm the fix fits BUGFIX scope. If it does not, signal `BLOCKED` and recommend escalation to the architect (`afx send architect "..."`). No code in this phase.
|
|
28
|
+
|
|
29
|
+
### Fix
|
|
30
|
+
|
|
31
|
+
Apply the minimal change that resolves the root cause, and add a regression test that fails without the fix and passes with it. Keep it focused: do not refactor surrounding code, do not fix unrelated bugs (file separate issues), do not add features. Run the build and tests (porch's `checks` block runs `npm run build` and `npm test`).
|
|
32
|
+
|
|
33
|
+
Commit with the issue-driven format:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
[Bugfix #<N>] Fix: <what was fixed>
|
|
37
|
+
[Bugfix #<N>] Test: <regression test added>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### PR (gated by `pr`)
|
|
41
|
+
|
|
42
|
+
1. Push the branch and open a PR with `gh pr create`. The body includes Summary, Root Cause, Fix, and Test Plan, plus `Fixes #<N>` so the issue auto-closes on merge.
|
|
43
|
+
2. Run a multi-agent CMAP review on the PR (Gemini, Codex, Claude) and record each verdict. Address or rebut any `REQUEST_CHANGES`; add a regression test if a real defect surfaced.
|
|
44
|
+
3. Notify the architect: `afx send architect "PR #<M> ready for review (fixes #<N>). CMAP: gemini=..., codex=..., claude=..."`.
|
|
45
|
+
4. Run `porch done <id>` to request the `pr` gate, then wait. **The merge is gated by porch state, never by typed prose in your pane.**
|
|
46
|
+
5. The human reviews the PR and the CMAP results on GitHub, then approves the gate: `porch approve <id> pr --a-human-explicitly-approved-this`.
|
|
47
|
+
6. porch wakes the builder with a merge task. Merge with `gh pr merge --merge` (do **not** pass `--delete-branch`: the builder is checked out on this branch in a worktree), then run `porch done <id>` and notify the architect that it is merged and ready for cleanup.
|
|
48
|
+
|
|
49
|
+
## Gate
|
|
50
|
+
|
|
51
|
+
BUGFIX has one human gate, `pr`, on the merge step. It exists so the merge trigger is structured porch state (approved or not), not free-text typed into the builder's pane. This eliminates the self-merge bug class: a builder cannot infer authorization from ambiguous input.
|
|
52
|
+
|
|
53
|
+
## Multi-Agent Consultation
|
|
54
|
+
|
|
55
|
+
A single CMAP pass at the PR (Gemini, Codex, Claude). There is no per-phase consultation: the issue is the spec and the fix is small, so review effort concentrates on the final PR.
|
|
56
|
+
|
|
57
|
+
## Scope
|
|
58
|
+
|
|
59
|
+
The < 300 LOC threshold is a **guideline**, measured as net diff (additions + deletions) anchored at the merge-base with the default branch. A well-contained 350-LOC fix is fine; a 200-LOC fix smeared across ten files may warrant escalation.
|
|
60
|
+
|
|
61
|
+
## Escalation
|
|
62
|
+
|
|
63
|
+
If, mid-fix, the change outgrows BUGFIX (architectural impact, multiple components, unclear root cause after investigation, or more than ~300 LOC), notify the architect with specifics and recommend escalating to SPIR. Do not silently expand scope.
|
|
64
|
+
|
|
65
|
+
## Branch Naming
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
builder/bugfix-<issue-number>-<slug>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Edge Cases
|
|
72
|
+
|
|
73
|
+
| Scenario | Action |
|
|
74
|
+
|---|---|
|
|
75
|
+
| Cannot reproduce | Document the attempts in an issue comment, ask the reporter for detail, notify the architect |
|
|
76
|
+
| Fix outgrows scope (architectural / multi-component / > ~300 LOC) | Notify the architect, recommend escalation; do not proceed |
|
|
77
|
+
| Unrelated test failures | Out of scope: note them for the architect, do not fix them here |
|
|
78
|
+
| Multiple bugs in one issue | Fix only the primary bug; file separate issues for the rest |
|
|
@@ -24,7 +24,7 @@ You are running in STRICT mode. This means:
|
|
|
24
24
|
{{/if}}
|
|
25
25
|
|
|
26
26
|
## Protocol
|
|
27
|
-
Follow the EXPERIMENT protocol
|
|
27
|
+
Follow the EXPERIMENT protocol. Read and internalize the protocol before starting any work. The full protocol text is included below under **## Protocol Reference (full text)**.
|
|
28
28
|
|
|
29
29
|
## EXPERIMENT Overview
|
|
30
30
|
The EXPERIMENT protocol ensures disciplined experimentation:
|
|
@@ -74,3 +74,9 @@ If you encounter **pre-existing flaky tests** (intermittent failures unrelated t
|
|
|
74
74
|
1. Read the EXPERIMENT protocol document
|
|
75
75
|
2. Define your hypothesis clearly
|
|
76
76
|
3. Follow the phases in order
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Protocol Reference (full text)
|
|
81
|
+
|
|
82
|
+
{{protocol_reference}}
|
|
@@ -37,7 +37,7 @@ mkdir -p experiments/1_experiment_name
|
|
|
37
37
|
cd experiments/1_experiment_name
|
|
38
38
|
|
|
39
39
|
# Initialize notes.md from template
|
|
40
|
-
|
|
40
|
+
touch notes.md # then fill it from the embedded template at the end of this protocol
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
Or ask your AI assistant: "Create a new experiment for [goal]"
|
|
@@ -85,33 +85,6 @@ git add experiments/1_experiment_name/
|
|
|
85
85
|
git commit -m "[Experiment 1] Brief description of findings"
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
## notes.md Template
|
|
89
|
-
|
|
90
|
-
See `templates/notes.md` for the full template. Key sections:
|
|
91
|
-
|
|
92
|
-
```markdown
|
|
93
|
-
# Experiment ####: Name
|
|
94
|
-
|
|
95
|
-
**Status**: In Progress | Complete | Disproved | Aborted
|
|
96
|
-
|
|
97
|
-
**Date**: YYYY-MM-DD
|
|
98
|
-
|
|
99
|
-
## Goal
|
|
100
|
-
What are you trying to learn?
|
|
101
|
-
|
|
102
|
-
## Time Investment
|
|
103
|
-
Wall clock time vs active developer time
|
|
104
|
-
|
|
105
|
-
## Code
|
|
106
|
-
- [experiment.py](experiment.py) - Brief description
|
|
107
|
-
|
|
108
|
-
## Results
|
|
109
|
-
What happened? What did you learn?
|
|
110
|
-
|
|
111
|
-
## Next Steps
|
|
112
|
-
What should be done based on findings?
|
|
113
|
-
```
|
|
114
|
-
|
|
115
88
|
## Best Practices
|
|
116
89
|
|
|
117
90
|
### Keep It Simple
|
|
@@ -222,3 +195,9 @@ Determine if Redis caching improves API response times for repeated queries.
|
|
|
222
195
|
## Next Steps
|
|
223
196
|
Create SPIR spec for production caching implementation.
|
|
224
197
|
```
|
|
198
|
+
|
|
199
|
+
## Template: notes.md
|
|
200
|
+
|
|
201
|
+
Create `notes.md` with the following content:
|
|
202
|
+
|
|
203
|
+
{{> protocols/experiment/templates/notes.md}}
|
|
@@ -23,7 +23,7 @@ You are running in STRICT mode. This means:
|
|
|
23
23
|
{{/if}}
|
|
24
24
|
|
|
25
25
|
## Protocol
|
|
26
|
-
Follow the MAINTAIN protocol
|
|
26
|
+
Follow the MAINTAIN protocol. Read and internalize the protocol before starting any work. The full protocol text is included below under **## Protocol Reference (full text)**.
|
|
27
27
|
|
|
28
28
|
## MAINTAIN Overview
|
|
29
29
|
|
|
@@ -54,3 +54,9 @@ If you encounter **pre-existing flaky tests** (intermittent failures unrelated t
|
|
|
54
54
|
2. Run `porch next` to get your first task
|
|
55
55
|
3. Work through audit → clean → sync → verify in a single pass
|
|
56
56
|
4. Document everything in the maintenance run file
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Protocol Reference (full text)
|
|
61
|
+
|
|
62
|
+
{{protocol_reference}}
|
|
@@ -51,9 +51,9 @@ One removal at a time. Verify after each. Never use `git add -A`.
|
|
|
51
51
|
|
|
52
52
|
## Step 4: Sync Documentation
|
|
53
53
|
|
|
54
|
-
**arch.md
|
|
54
|
+
**arch.md / arch-critical.md** (Spec 987 two-tier): Read both, compare with actual codebase. Route behavior-changing invariants to the HOT `arch-critical.md` (respect its cap + keep its cold-doc map accurate); reference detail to the COLD `arch.md` (directory structure, component descriptions, key files, removals). Explain HOW things work, not just WHAT.
|
|
55
55
|
|
|
56
|
-
**lessons-learned.md
|
|
56
|
+
**lessons-learned.md / lessons-critical.md** (two-tier): Scan `codev/reviews/` for new reviews since the base commit. **Route** each lesson — behavior-changing + cross-cutting → HOT `lessons-critical.md` (cap + displacement); reference recipe → COLD `lessons-learned.md`. Audit the hot caps + maps via the `update-arch-docs` skill.
|
|
57
57
|
|
|
58
58
|
**CLAUDE.md / AGENTS.md**: `diff CLAUDE.md AGENTS.md` — they must be identical. Update the stale one.
|
|
59
59
|
|
|
@@ -61,8 +61,9 @@ One removal at a time. Verify after each. Never use `git add -A`.
|
|
|
61
61
|
|
|
62
62
|
Commit documentation changes:
|
|
63
63
|
```bash
|
|
64
|
-
git add codev/resources/arch.md codev/resources/
|
|
65
|
-
git
|
|
64
|
+
git add codev/resources/arch.md codev/resources/arch-critical.md
|
|
65
|
+
git add codev/resources/lessons-learned.md codev/resources/lessons-critical.md
|
|
66
|
+
git commit -m "[Maintain] Update governance docs (hot + cold tiers)"
|
|
66
67
|
```
|
|
67
68
|
|
|
68
69
|
## Step 5: Final Checks
|
|
@@ -57,7 +57,7 @@ Closes #<N> <!-- Only if this run was triggered by a GitHub issue. Use "Refs #<
|
|
|
57
57
|
|
|
58
58
|
- Dead code removed: X items
|
|
59
59
|
- Dependencies cleaned: Y packages
|
|
60
|
-
- Documentation updated: arch.md, lessons-learned.md
|
|
60
|
+
- Documentation updated: arch.md / arch-critical.md, lessons-learned.md / lessons-critical.md (hot + cold tiers; hot caps + cold-doc maps policed)
|
|
61
61
|
- Tests: all passing
|
|
62
62
|
|
|
63
63
|
## Test plan
|