valent-pipeline 0.3.2 → 0.3.4

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.
Files changed (61) hide show
  1. package/package.json +1 -1
  2. package/pipeline/agents-manifest.yaml +23 -33
  3. package/pipeline/docs/knowledge-system.md +16 -18
  4. package/pipeline/docs/lead-lifecycle.md +3 -12
  5. package/pipeline/docs/npx-packaging.md +0 -1
  6. package/pipeline/docs/template-skeleton.md +1 -1
  7. package/pipeline/prompts/bend.md +12 -2
  8. package/pipeline/prompts/critic.md +15 -8
  9. package/pipeline/prompts/fend.md +12 -2
  10. package/pipeline/prompts/judge.md +12 -2
  11. package/pipeline/prompts/lead.md +231 -71
  12. package/pipeline/prompts/qa-a.md +1 -1
  13. package/pipeline/prompts/qa-b.md +12 -2
  14. package/pipeline/prompts/reqs.md +1 -1
  15. package/pipeline/prompts/uxa.md +1 -1
  16. package/pipeline/providers/claude-code/runtime.md +31 -10
  17. package/pipeline/providers/codex/AGENTS.md +8 -3
  18. package/pipeline/providers/codex/cloud-task-prompts/implementation.md +2 -0
  19. package/pipeline/providers/codex/codex-project-files/.codex/agents/review-explorer.toml +2 -2
  20. package/pipeline/providers/codex/runtime.md +91 -208
  21. package/pipeline/providers/codex/spawn.template.md +3 -1
  22. package/pipeline/scripts/query-kb.ts +1 -1
  23. package/pipeline/spawn-templates/pipeline-context.template.md +1 -3
  24. package/pipeline/steps/bend/read-inputs.md +2 -5
  25. package/pipeline/steps/common/agent-protocol.md +9 -1
  26. package/pipeline/steps/data/read-inputs.md +2 -5
  27. package/pipeline/steps/docgen/read-inputs.md +2 -5
  28. package/pipeline/steps/fend/read-inputs.md +2 -5
  29. package/pipeline/steps/iac/read-inputs.md +2 -5
  30. package/pipeline/steps/libdev/read-inputs.md +2 -5
  31. package/pipeline/steps/mcp-dev/read-inputs.md +2 -5
  32. package/pipeline/steps/mobile/read-inputs.md +2 -5
  33. package/pipeline/steps/orchestration/adopt-lead-and-create-team.md +97 -24
  34. package/pipeline/steps/orchestration/sprint-execute.md +30 -10
  35. package/pipeline/steps/orchestration/validate-story-inputs.md +1 -1
  36. package/pipeline/steps/qa-a/read-inputs.md +2 -6
  37. package/pipeline/steps/reqs/read-inputs.md +3 -7
  38. package/pipeline/steps/uxa/read-inputs.md +2 -6
  39. package/pipeline/task-graphs/backend-api.yaml +0 -8
  40. package/pipeline/task-graphs/data-pipeline.yaml +0 -8
  41. package/pipeline/task-graphs/document-generation.yaml +0 -8
  42. package/pipeline/task-graphs/frontend-only.yaml +0 -8
  43. package/pipeline/task-graphs/fullstack-web.yaml +0 -8
  44. package/pipeline/task-graphs/library.yaml +0 -8
  45. package/pipeline/task-graphs/mcp-server.yaml +0 -8
  46. package/pipeline/task-graphs/mobile-app.yaml +0 -8
  47. package/pipeline/templates/embed-instructions.template.md +1 -1
  48. package/pipeline/templates/retrospective.template.md +1 -1
  49. package/skills/valent-help/SKILL.md +2 -2
  50. package/skills/valent-knowledge/SKILL.md +68 -0
  51. package/skills/valent-run-epic/SKILL.md +4 -9
  52. package/skills/valent-run-project/SKILL.md +4 -7
  53. package/skills/valent-run-story/SKILL.md +1 -1
  54. package/skills/valent-setup-backlog/SKILL.md +3 -3
  55. package/src/commands/init.js +16 -4
  56. package/src/lib/config-schema.js +2 -2
  57. package/pipeline/prompts/knowledge.md +0 -94
  58. package/pipeline/providers/claude-code/knowledge-spawn.template.md +0 -17
  59. package/pipeline/providers/codex/codex-project-files/.codex/agents/knowledge-service.toml +0 -14
  60. package/pipeline/providers/codex/knowledge-spawn.template.md +0 -19
  61. package/pipeline/spawn-templates/knowledge-spawn.template.md +0 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valent-pipeline",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "v3 multi-agent AI pipeline for software development lifecycle",
5
5
  "type": "module",
6
6
  "bin": {
@@ -75,7 +75,7 @@ agents:
75
75
 
76
76
  readiness:
77
77
  name: READINESS
78
- model: sonnet
78
+ model: opus
79
79
  lifecycle: per-story
80
80
  role: "Spec quality gate — validates reqs, UXA spec, and test specs are implementation-ready"
81
81
  prompt_template: .valent-pipeline/prompts/readiness.md
@@ -85,8 +85,8 @@ agents:
85
85
 
86
86
  bend:
87
87
  name: BEND
88
- model: sonnet
89
- lifecycle: per-story
88
+ model: opus
89
+ lifecycle: per-sprint # persists across stories; receives [STORY-RESET] between stories
90
90
  role: "Backend developer — implements production code and tests"
91
91
  prompt_template: .valent-pipeline/prompts/bend.md
92
92
  reads_from: [reqs-brief.md, qa-test-spec.md]
@@ -95,8 +95,8 @@ agents:
95
95
 
96
96
  fend:
97
97
  name: FEND
98
- model: sonnet
99
- lifecycle: per-story
98
+ model: opus
99
+ lifecycle: per-sprint # persists across stories; receives [STORY-RESET] between stories
100
100
  role: "Frontend developer — implements UI components and tests"
101
101
  prompt_template: .valent-pipeline/prompts/fend.md
102
102
  reads_from: [reqs-brief.md, uxa-spec.md, qa-test-spec.md]
@@ -105,8 +105,8 @@ agents:
105
105
 
106
106
  mobile:
107
107
  name: MOBILE
108
- model: sonnet
109
- lifecycle: per-story
108
+ model: opus
109
+ lifecycle: per-sprint # persists across stories; receives [STORY-RESET] between stories
110
110
  role: "Mobile developer — implements RN/Flutter screens, components, Maestro E2E flows"
111
111
  prompt_template: .valent-pipeline/prompts/mobile.md
112
112
  reads_from: [reqs-brief.md, uxa-spec.md, qa-test-spec.md]
@@ -115,8 +115,8 @@ agents:
115
115
 
116
116
  data:
117
117
  name: DATA
118
- model: sonnet
119
- lifecycle: per-story
118
+ model: opus
119
+ lifecycle: per-sprint # persists across stories; receives [STORY-RESET] between stories
120
120
  role: "Data pipeline developer — implements ETL, transforms, data quality, checkpointing"
121
121
  prompt_template: .valent-pipeline/prompts/data.md
122
122
  reads_from: [reqs-brief.md, qa-test-spec.md]
@@ -125,8 +125,8 @@ agents:
125
125
 
126
126
  mcp_dev:
127
127
  name: MCP-DEV
128
- model: sonnet
129
- lifecycle: per-story
128
+ model: opus
129
+ lifecycle: per-sprint # persists across stories; receives [STORY-RESET] between stories
130
130
  role: "Protocol developer — implements MCP server tools, JSON-RPC handlers, transport"
131
131
  prompt_template: .valent-pipeline/prompts/mcp-dev.md
132
132
  reads_from: [reqs-brief.md, qa-test-spec.md]
@@ -135,8 +135,8 @@ agents:
135
135
 
136
136
  libdev:
137
137
  name: LIBDEV
138
- model: sonnet
139
- lifecycle: per-story
138
+ model: opus
139
+ lifecycle: per-sprint # persists across stories; receives [STORY-RESET] between stories
140
140
  role: "Library developer — implements public API, exports, packaging, type declarations"
141
141
  prompt_template: .valent-pipeline/prompts/libdev.md
142
142
  reads_from: [reqs-brief.md, qa-test-spec.md]
@@ -145,8 +145,8 @@ agents:
145
145
 
146
146
  docgen:
147
147
  name: DOCGEN
148
- model: sonnet
149
- lifecycle: per-story
148
+ model: opus
149
+ lifecycle: per-sprint # persists across stories; receives [STORY-RESET] between stories
150
150
  role: "Document generation developer — implements templates, render pipeline, output formatting"
151
151
  prompt_template: .valent-pipeline/prompts/docgen.md
152
152
  reads_from: [reqs-brief.md, qa-test-spec.md]
@@ -155,8 +155,8 @@ agents:
155
155
 
156
156
  iac:
157
157
  name: IAC
158
- model: sonnet
159
- lifecycle: per-story
158
+ model: opus
159
+ lifecycle: per-sprint # persists across stories; receives [STORY-RESET] between stories
160
160
  role: "Infrastructure developer — implements IaC definitions, deployment configs, infrastructure tests"
161
161
  prompt_template: .valent-pipeline/prompts/iac.md
162
162
  reads_from: [reqs-brief.md, qa-test-spec.md]
@@ -165,7 +165,7 @@ agents:
165
165
  critic:
166
166
  name: CRITIC
167
167
  model: opus
168
- lifecycle: per-story
168
+ lifecycle: per-sprint # persists across stories; receives [STORY-RESET] between stories
169
169
  role: "Code reviewer — 3-pass adversarial review of production and test code"
170
170
  prompt_template: .valent-pipeline/prompts/critic.md
171
171
  review_passes: [blind-hunt, edge-case-hunt, acceptance-audit, triage]
@@ -174,8 +174,8 @@ agents:
174
174
 
175
175
  qa_b:
176
176
  name: QA-B
177
- model: sonnet
178
- lifecycle: per-story
177
+ model: opus
178
+ lifecycle: per-sprint # persists across stories; receives [STORY-RESET] between stories
179
179
  role: "Test executor — runs tests, validates spec alignment, files bugs"
180
180
  prompt_template: .valent-pipeline/prompts/qa-b.md
181
181
  reads_from: [qa-test-spec.md, critic-review.md, reqs-brief.md]
@@ -184,23 +184,13 @@ agents:
184
184
 
185
185
  judge:
186
186
  name: JUDGE
187
- model: sonnet
188
- lifecycle: per-story
187
+ model: opus
188
+ lifecycle: per-sprint # persists across stories; receives [STORY-RESET] between stories
189
189
  role: "Final quality gate — bug priority review + evidence-based ship decision"
190
190
  prompt_template: .valent-pipeline/prompts/judge.md
191
191
  reads_from: [execution-report.md, traceability-matrix.md, pmcp-evidence.md, bugs.md, qa-test-spec.md] # critic-review.md intentionally excluded — JUDGE validates test/execution evidence, not code review; qa-test-spec.md used as reference for assertion cross-check
192
192
  writes_to: [judge-review.md, judge-decision.md, story-report.md]
193
193
 
194
- knowledge:
195
- name: Knowledge
196
- model: haiku
197
- lifecycle: per-story
198
- role: "Knowledge retrieval — answers queries from persistent data sources"
199
- prompt_template: .valent-pipeline/prompts/knowledge.md
200
- data_sources: [chromadb, curated-knowledge-files, correction-directives]
201
- context_variables: [knowledge_mode, chromadb_host, chromadb_collection_prefix, curated_files_path, correction_directives]
202
- # No writes_to — Knowledge Agent responds via inbox only, no file output
203
-
204
194
  ephemeral_agents:
205
195
  pmcp:
206
196
  name: PMCP
@@ -223,7 +213,7 @@ ephemeral_agents:
223
213
 
224
214
  retrospective:
225
215
  name: Retrospective
226
- model: sonnet
216
+ model: opus
227
217
  role: "Batch reviewer — analyzes last N stories for recurring patterns"
228
218
  prompt_template: .valent-pipeline/prompts/retrospective.md
229
219
  spawned_by: lead
@@ -4,7 +4,7 @@ Reference documentation for the v3 pipeline knowledge subsystem -- how the pipel
4
4
 
5
5
  ## 1. Architecture Overview
6
6
 
7
- The knowledge system has three data sources, three agents, and one principle: the Retrospective Agent is the sole gatekeeper for what enters persistent knowledge.
7
+ The knowledge system has three data sources, two curation agents, and one principle: the Retrospective Agent is the sole gatekeeper for what enters persistent knowledge. Agents self-serve from these data sources directly during their read-inputs step — there is no separate Knowledge Agent.
8
8
 
9
9
  ### Data Sources
10
10
 
@@ -12,15 +12,14 @@ The knowledge system has three data sources, three agents, and one principle: th
12
12
  |--------|--------|---------|
13
13
  | **Curated knowledge files** | Markdown in `.valent-pipeline/knowledge/curated/` | Conventions, validated patterns, known pitfalls, test stability data |
14
14
  | **Correction directives** | YAML in `.valent-pipeline/knowledge/correction-directives.yaml` | Behavioral changes for agents -- translates observations into prompt-level guidance |
15
- | **ChromaDB** (optional) | Vector store via Docker or remote host | Embedding-based retrieval for code patterns and build artifacts |
15
+ | **SQLite database** (optional) | SQLite via CLI | Indexed artifacts, full-text search, cross-story queries |
16
16
 
17
- ### Agents
17
+ ### Curation Agents
18
18
 
19
19
  | Agent | Model | Lifecycle | Role |
20
20
  |-------|-------|-----------|------|
21
- | **Knowledge** | Haiku | Per-story | Reads all three sources, responds to teammate queries via inbox |
22
21
  | **Retrospective** | Sonnet | Ephemeral (every N stories) | Sole gatekeeper -- analyzes batch outputs, writes correction directives and embed instructions |
23
- | **Embed** | Haiku | Ephemeral (after Retrospective) | Executes indexing instructions -- writes to ChromaDB and/or curated files |
22
+ | **Embed** | Haiku | Ephemeral (after Retrospective) | Executes indexing instructions -- writes to curated files and/or SQLite |
24
23
 
25
24
  ### Data Flow
26
25
 
@@ -33,14 +32,13 @@ Retrospective Agent
33
32
  |--- writes ---> embed-instructions.md
34
33
  v
35
34
  Embed Agent
36
- |--- indexes ---> ChromaDB collections (if configured)
35
+ |--- indexes ---> SQLite database (if configured)
37
36
  |--- writes ---> .valent-pipeline/knowledge/curated/ files
38
37
  v
39
- Knowledge Agent (next story)
38
+ Pipeline agents (next story)
40
39
  |--- reads ---> correction directives (active only)
41
40
  |--- reads ---> curated files
42
- |--- queries ---> ChromaDB (if configured)
43
- |--- responds --> teammate queries via inbox
41
+ |--- queries ---> SQLite (if configured)
44
42
  ```
45
43
 
46
44
  ---
@@ -118,13 +116,13 @@ No per-story indexing occurs. This is the core design decision that prevents ind
118
116
 
119
117
  6. **Lead spawns Embed Agent** after Retrospective completes. Embed reads the manifest and executes indexing. No lead interpretation needed.
120
118
 
121
- 7. **Knowledge Agent** (spawned fresh each story) reads active correction directives and curated files, then responds to queries during the story.
119
+ 7. **Pipeline agents** (next story) read active correction directives and curated files directly during their read-inputs step.
122
120
 
123
121
  ---
124
122
 
125
123
  ## 4. RAG Assessment Framework
126
124
 
127
- Before investing further in ChromaDB-based RAG, run a Knowledge Retrieval Audit after 5-10 stories with the Knowledge Agent active.
125
+ Before investing further in ChromaDB-based RAG, run a Knowledge Retrieval Audit after 5-10 stories with the knowledge system active.
128
126
 
129
127
  ### Three Failure Modes
130
128
 
@@ -132,15 +130,15 @@ Before investing further in ChromaDB-based RAG, run a Knowledge Retrieval Audit
132
130
 
133
131
  2. **Index pollution.** Without garbage collection or versioning, ChromaDB collections accumulate stale and contradictory entries. The Retrospective-gated curation directly addresses this.
134
132
 
135
- 3. **Brief quality.** Does BEND perform measurably better with the Knowledge Agent's brief than without it? If not, those 2-3k tokens of context are displacing something more useful.
133
+ 3. **Brief quality.** Does BEND perform measurably better with knowledge context than without it? If not, those 2-3k tokens of context are displacing something more useful.
136
134
 
137
135
  ### Assessment Questions
138
136
 
139
137
  | Question | How to Measure | Implication |
140
138
  |----------|---------------|-------------|
141
- | Do agents actually query the Knowledge Agent mid-task? | Count on-demand queries per story across last 10 stories | If near-zero, agents are not finding it useful |
139
+ | Do agents actually use knowledge data during tasks? | Check if agents reference knowledge sources in their frontmatter across last 10 stories | If near-zero, agents are not finding it useful |
142
140
  | Do startup briefs reduce rejection cycles? | Compare CRITIC rejection rates for stories with vs without relevant prior patterns | If no difference, briefs are not helping |
143
- | Are retrieval results relevant? | Sample 20 Knowledge Agent queries, manually rate top-3 results for relevance | If <50% relevant, embedding strategy needs work |
141
+ | Are retrieval results relevant? | Sample 20 knowledge queries, manually rate top-3 results for relevance | If <50% relevant, embedding strategy needs work |
144
142
  | Is index pollution growing? | Count contradictory entries in `corrections` collection | If significant, need versioning/expiry |
145
143
 
146
144
  ### Three Possible Outcomes
@@ -152,13 +150,13 @@ Before investing further in ChromaDB-based RAG, run a Knowledge Retrieval Audit
152
150
 
153
151
  **B. RAG is noise -- simplify to curated context:**
154
152
  - Replace ChromaDB with curated knowledge files maintained by Retrospective Agent
155
- - Knowledge Agent becomes a simple file reader, not a retrieval system
153
+ - Knowledge becomes simple file reading, not a retrieval system
156
154
  - Cheaper, more predictable, easier to debug
157
155
 
158
156
  **C. RAG is partially working -- hybrid approach:**
159
157
  - Keep ChromaDB for `source-code` and `build-patterns` collections (embedding similarity works for code)
160
158
  - Move `corrections`, `conventions`, and `qa-lessons` to curated files (human-readable, not embedding-dependent)
161
- - Knowledge Agent uses both: curated files for startup briefs, ChromaDB for on-demand "find similar code" queries
159
+ - Agents use both: curated files for startup briefs, ChromaDB for on-demand "find similar code" queries
162
160
 
163
161
  ---
164
162
 
@@ -168,7 +166,7 @@ Configured via `knowledge.mode` in `pipeline-config.yaml`.
168
166
 
169
167
  ### `none` (default)
170
168
 
171
- - Knowledge Agent reads curated files + correction directives only
169
+ - Agents read curated files + correction directives only
172
170
  - Embed Agent IS triggered but only writes to curated files (no ChromaDB operations)
173
171
  - Zero external dependencies
174
172
  - ChromaDB can be added later without pipeline changes
@@ -176,7 +174,7 @@ Configured via `knowledge.mode` in `pipeline-config.yaml`.
176
174
  ### `local-docker`
177
175
 
178
176
  - ChromaDB runs locally via `docker compose -f .valent-pipeline/docker-compose.chromadb.yml up -d`
179
- - Knowledge Agent connects to ChromaDB at the configured `chromadb_host` (typically `http://localhost:8000`)
177
+ - Agents can connect to ChromaDB at the configured `chromadb_host` (typically `http://localhost:8000`)
180
178
  - Falls back to curated-only mode if ChromaDB is unreachable
181
179
  - Embed Agent indexes into both ChromaDB collections and curated files
182
180
 
@@ -8,9 +8,7 @@
8
8
 
9
9
  ### Persistent vs Per-Story Agents
10
10
 
11
- The lead is the **only persistent agent** in the pipeline. It carries `pipeline-state.json` and backlog position forward across stories. All other agents (REQS, UXA, QA-A, BEND, FEND, CRITIC, QA-B, READINESS, JUDGE, Knowledge) are **per-story** -- spawned fresh when a story starts, torn down when it ships.
12
-
13
- The Knowledge Agent's value is in its persistent data sources (ChromaDB collections and curated knowledge files on disk), not its conversation history. A fresh spawn reads from the same store.
11
+ The lead is the **only persistent agent** in the pipeline. It carries `pipeline-state.json` and backlog position forward across stories. All other agents (REQS, UXA, QA-A, BEND, FEND, CRITIC, QA-B, READINESS, JUDGE) are **per-story** -- spawned fresh when a story starts, torn down when it ships. Knowledge is self-served by each agent directly from curated files and correction directives on disk.
14
12
 
15
13
  Ephemeral agents (PMCP, Embed, Retrospective, Help) are spawned on-demand for a specific task and killed when done. They are not teammates -- they do not receive inbox messages mid-story.
16
14
 
@@ -35,7 +33,7 @@ The lead validates the story input before spawning any teammates.
35
33
  - **Trigger map** -- enables UXA strategic validation (driving force cross-referencing). Without it, UXA runs in translation-only mode.
36
34
  - **Scenario outlines** -- enables scenario-driven UXA specs.
37
35
  - **Architecture decisions** -- enables REQS to incorporate technical constraints.
38
- - **Existing project context** -- codebase documentation, conventions, prior patterns. Loaded by Knowledge Agent if available.
36
+ - **Existing project context** -- codebase documentation, conventions, prior patterns. Loaded from curated knowledge files.
39
37
 
40
38
  If required fields are missing, the story is rejected via CLI escalation (see Backlog Management below).
41
39
 
@@ -120,7 +118,7 @@ All code committed and pushed to the branch specified by the user. The pipeline
120
118
  2. Code committed and pushed to user-specified branch
121
119
  3. All agent outputs persist in the story folder (handoff files, reviews, bug reports, execution reports, PMCP evidence)
122
120
  4. Lead writes `story-report.md`: task completion times, rejection cycles, cost metrics
123
- 5. Lead tears down all story teammates including Knowledge Agent
121
+ 5. Lead tears down all story teammates
124
122
  6. Lead persists -- carries pipeline state and backlog position forward
125
123
  7. Lead picks next story from backlog and returns to Phase 1 with a fresh story team
126
124
 
@@ -256,13 +254,6 @@ The lead manages the backlog as a dependency-aware queue, not a simple FIFO list
256
254
  - "You are replacing a crashed agent. Steps completed: [from frontmatter]. Prior work: [from handoff files on disk]. Resume from step: [next incomplete step]."
257
255
  7. Fresh teammate picks up from where the crashed agent left off
258
256
 
259
- ### Crash Type: Knowledge Agent Crashes
260
-
261
- 1. Spawn a new Knowledge Agent with the same role definition
262
- 2. New agent has immediate access to ChromaDB and curated knowledge files (both on disk)
263
- 3. On-demand queries are stateless by design -- no conversation history needed
264
- 4. The Knowledge Agent is killed and respawned fresh per story anyway, so mid-story crashes are the only case that matters
265
-
266
257
  ### Crash Type: Lead Crashes
267
258
 
268
259
  1. Human restarts the lead (this is the one case requiring manual intervention)
@@ -27,7 +27,6 @@ The v3 pipeline splits into three categories of files:
27
27
  | `.valent-pipeline/task-graphs/frontend-only.yaml` | Pipeline infrastructure | Shipped with package |
28
28
  | `.valent-pipeline/spawn-templates/pipeline-context.template.md` | Pipeline infrastructure | Shipped with package; filled at runtime |
29
29
  | `.valent-pipeline/spawn-templates/agent-spawn.template.md` | Pipeline infrastructure | Shipped with package |
30
- | `.valent-pipeline/spawn-templates/knowledge-spawn.template.md` | Pipeline infrastructure | Shipped with package |
31
30
  | `.valent-pipeline/agents-manifest.yaml` | Pipeline infrastructure | Shipped with package; models section overridable via project config |
32
31
  | `.valent-pipeline/scripts/embed.ts` | Pipeline infrastructure | Shipped with package |
33
32
  | `.valent-pipeline/docker-compose.chromadb.yml` | Pipeline infrastructure | Shipped with package |
@@ -278,5 +278,5 @@ The 16 templates in `.valent-pipeline/templates/`, mapped to their producing age
278
278
  | `judge-decision.template.md` | JUDGE | Lead |
279
279
  | `story-report.template.md` | Lead | User |
280
280
  | `pmcp-evidence.template.md` | PMCP | JUDGE |
281
- | `retrospective.template.md` | Retrospective Agent | Lead, Knowledge Agent |
281
+ | `retrospective.template.md` | Retrospective Agent | Lead, pipeline agents |
282
282
  | `embed-instructions.template.md` | Lead | Embed Agent |
@@ -1,5 +1,5 @@
1
1
  # BEND
2
- <!-- Prompt version: 2.1 | Model: Opus | Lifecycle: per-story -->
2
+ <!-- Prompt version: 2.2 | Model: Opus | Lifecycle: per-sprint -->
3
3
 
4
4
  You are BEND, the backend developer agent. You implement production code and test code to satisfy the behavioral test specifications written by QA-A.
5
5
 
@@ -7,14 +7,24 @@ Read `.valent-pipeline/steps/common/agent-protocol.md` for Communication Standar
7
7
 
8
8
  ## Trigger Protocol
9
9
 
10
- You are spawned at story kick-off but do NOT begin work immediately.
10
+ For the first sprint story, you are spawned at story kick-off. For subsequent stories, you receive a `[STORY-RESET]` signal and return to your trigger wait state. Do NOT begin work until triggered.
11
11
 
12
12
  - **Wait for:** `[READINESS-APPROVAL]` (Pass 1) from READINESS
13
13
  - **On completion:** Write handoff file with verdict. If signal_delivery is sendmessage: also send `[HANDOFF]` to CRITIC and CC Lead via inbox. If FEND is active, CRITIC waits for both -- send your handoff; CRITIC starts when it has both.
14
14
  - **On rejection (from CRITIC, via inbox or Lead steering):** Read rejection at critic-review.md. Fix code. Write updated handoff. If signal_delivery is sendmessage: re-send `[HANDOFF]` to CRITIC via inbox.
15
15
  - **On bug (from QA-B, via inbox or Lead steering):** Fix bug. If signal_delivery is sendmessage: notify QA-B via inbox when fixed.
16
+ - **On `cache-keepalive`:** Respond `[BEND-ACK] ack` and stop. This is a prompt cache keep-alive ping — do no work.
16
17
  - **Escalate to:** Lead. If signal_delivery is sendmessage: send `[BLOCKER]` or `[ESCALATION]` via inbox. If thread: write status: blocked to output frontmatter.
17
18
 
19
+ ## Story Reset Protocol (Sprint Mode)
20
+
21
+ On `[STORY-RESET]` message (via inbox or Lead steering):
22
+ 1. Update `{story_id}` and `{story_output_dir}` to new values from the message
23
+ 2. Re-read new story's grooming context: `reqs-brief.md`, `qa-test-spec.md`
24
+ 3. Discard any in-memory state from the prior story (prior diffs, prior review feedback, prior bug context)
25
+ 4. Return to trigger wait state — wait for `[READINESS-APPROVAL]`
26
+ 5. Respond `[BEND-READY]` to Lead
27
+
18
28
  ## Context
19
29
 
20
30
  - **Story:** {story_id}
@@ -1,5 +1,5 @@
1
1
  # CRITIC
2
- <!-- Prompt version: 2.1 | Model: Opus | Lifecycle: per-story -->
2
+ <!-- Prompt version: 2.2 | Model: Opus | Lifecycle: per-sprint -->
3
3
 
4
4
  You are CRITIC, the adversarial code reviewer. You perform a multi-pass sequential review of all production and test code, followed by triage. Your role is to find defects before QA-B runs the test suite -- catching issues in code review is cheaper than catching them in test execution.
5
5
 
@@ -9,13 +9,23 @@ Additional frontmatter field: `review_depth`.
9
9
 
10
10
  ## Trigger Protocol
11
11
 
12
- You are spawned at story kick-off but do NOT begin work immediately.
12
+ For the first sprint story, you are spawned at story kick-off. For subsequent stories, you receive a `[STORY-RESET]` signal and return to your trigger wait state. Do NOT begin work until triggered.
13
13
 
14
14
  - **Wait for:** `[HANDOFF]` from BEND (and FEND if active). If both are active, wait for BOTH before starting review.
15
15
  - **On approval:** Write critic-review.md with verdict: APPROVED. If signal_delivery is sendmessage: also send `[CRITIC-APPROVED]` to QA-B and `[DONE]` to Lead via inbox. Mark your task completed. This unblocks QA-B.
16
16
  - **On rejection:** Write critic-review.md with verdict and rejection_target in frontmatter. If signal_delivery is sendmessage: also send `[CRITIC-REJECTION]` to BEND or FEND (whichever owns the finding) AND to Lead via inbox. Do NOT send `[DONE]`. Do NOT mark your task completed. Your task stays in_progress — this keeps QA-B blocked. After dev fixes and re-sends `[HANDOFF]` (via inbox or Lead steering), perform delta review (only changed files). Re-evaluate verdict.
17
+ - **On `cache-keepalive`:** Respond `[CRITIC-ACK] ack` and stop. This is a prompt cache keep-alive ping — do no work.
17
18
  - **Escalate to:** Lead. If signal_delivery is sendmessage: send `[BLOCKER]` or `[ESCALATION]` via inbox. If thread: write status: blocked to output frontmatter.
18
19
 
20
+ ## Story Reset Protocol (Sprint Mode)
21
+
22
+ On `[STORY-RESET]` message (via inbox or Lead steering):
23
+ 1. Update `{story_id}` and `{story_output_dir}` to new values from the message
24
+ 2. Re-read new story's grooming context: `reqs-brief.md`, `qa-test-spec.md`
25
+ 3. Discard any in-memory state from the prior story (prior review findings, prior rejection context, prior diffs)
26
+ 4. Return to trigger wait state — wait for `[HANDOFF]` from BEND (and FEND if active)
27
+ 5. Respond `[CRITIC-READY]` to Lead
28
+
19
29
  ## Context Variables
20
30
 
21
31
  - **Story:** {story_id}
@@ -50,7 +60,7 @@ After triage-depth, execute only the passes indicated by your selected depth lev
50
60
  | 0. Triage Depth | `.valent-pipeline/steps/critic/triage-depth.md` | Always |
51
61
  | 1. Read git diff | (inline) | Always |
52
62
  | 2. Pass 1: Blind Hunt | `.valent-pipeline/steps/critic/blind-hunt.md` | standard, deep |
53
- | 2b. Query Knowledge Agent | (inline -- conditional) | If Knowledge Agent available |
63
+ | 2b. Query Knowledge Base | (inline) | Always |
54
64
  | 3. Pass 2: Edge Case Hunt | `.valent-pipeline/steps/critic/edge-case-hunt.md` | deep only |
55
65
  | 3b. Load profile steps for edge-case-hunt | Conditional per `{testing_profiles}`: `.valent-pipeline/steps/critic/api.md`, `ui.md`, `data-pipeline.md`, `mcp-server.md`, `library.md`, `document-generation.md`, `iac.md` | deep only |
56
66
  | 4. Pass 3: Acceptance Audit | `.valent-pipeline/steps/critic/acceptance-audit.md` | Always |
@@ -62,11 +72,8 @@ After triage-depth, execute only the passes indicated by your selected depth lev
62
72
  ### Step 1: Read the git diff
63
73
  Read ALL changed files. Categorize into production code vs test code. Note file count and line count for the Review Scope section.
64
74
 
65
- ### Step 2b: Query Knowledge Agent (Conditional)
66
- If a Knowledge Agent is available:
67
- - If signal_delivery is sendmessage: send `[KNOWLEDGE-QUERY] What recurring code quality issues, known anti-patterns, and correction directives should I apply during review? Context: I am CRITIC reviewing code for {story_id}.` to Knowledge via inbox.
68
- - If signal_delivery is thread: write query to `{story_output_dir}/knowledge-queries/critic-1.md`. Continue without waiting.
69
- - If no response within a reasonable time or no Knowledge Agent is spawned, proceed without.
75
+ ### Step 2b: Query Knowledge Base
76
+ Read curated knowledge files in `{curated_files_path}` for recurring code quality issues, known anti-patterns, and correction directives relevant to CRITIC reviewing code for {story_id}. If `{story_output_dir}/knowledge-context.md` exists, read it instead. If `{knowledge_mode}` is `sqlite`, query: `node .valent-pipeline/bin/cli.js db query-directives --agent CRITIC`. If no relevant knowledge found, proceed without.
70
77
 
71
78
  ### Step 3b: Load Profile Steps for Edge Case Hunt (Conditional)
72
79
  For edge-case-hunt, also read profile-specific step files based on `{testing_profiles}`: `.valent-pipeline/steps/critic/api.md`, `ui.md`, `data-pipeline.md`, `mcp-server.md`, `library.md`, `document-generation.md`, `iac.md`. If a profile step file does not exist, note it and proceed. Apply domain-specific focus areas alongside the generic ones.
@@ -1,5 +1,5 @@
1
1
  # FEND
2
- <!-- Prompt version: 2.1 | Model: Opus | Lifecycle: per-story -->
2
+ <!-- Prompt version: 2.2 | Model: Opus | Lifecycle: per-sprint -->
3
3
 
4
4
  You are FEND, the frontend developer agent. You implement UI components, pages, and test code to satisfy the UX/accessibility spec and behavioral test specifications.
5
5
 
@@ -7,14 +7,24 @@ Read `.valent-pipeline/steps/common/agent-protocol.md` for Communication Standar
7
7
 
8
8
  ## Trigger Protocol
9
9
 
10
- You are spawned at story kick-off but do NOT begin work immediately.
10
+ For the first sprint story, you are spawned at story kick-off. For subsequent stories, you receive a `[STORY-RESET]` signal and return to your trigger wait state. Do NOT begin work until triggered.
11
11
 
12
12
  - **Wait for:** `[READINESS-APPROVAL]` (Pass 1) from READINESS
13
13
  - **On completion:** Write handoff file with verdict. If signal_delivery is sendmessage: also send `[HANDOFF]` to CRITIC and CC Lead via inbox. CRITIC waits for both BEND and FEND -- send your handoff; CRITIC starts when it has both.
14
14
  - **On rejection (from CRITIC, via inbox or Lead steering):** Read rejection at critic-review.md. Fix code. Write updated handoff. If signal_delivery is sendmessage: re-send `[HANDOFF]` to CRITIC via inbox.
15
15
  - **On bug (from QA-B, via inbox or Lead steering):** Fix bug. If signal_delivery is sendmessage: notify QA-B via inbox when fixed.
16
+ - **On `cache-keepalive`:** Respond `[FEND-ACK] ack` and stop. This is a prompt cache keep-alive ping — do no work.
16
17
  - **Escalate to:** Lead. If signal_delivery is sendmessage: send `[BLOCKER]` or `[ESCALATION]` via inbox. If thread: write status: blocked to output frontmatter.
17
18
 
19
+ ## Story Reset Protocol (Sprint Mode)
20
+
21
+ On `[STORY-RESET]` message (via inbox or Lead steering):
22
+ 1. Update `{story_id}` and `{story_output_dir}` to new values from the message
23
+ 2. Re-read new story's grooming context: `reqs-brief.md`, `uxa-spec.md`, `qa-test-spec.md`
24
+ 3. Discard any in-memory state from the prior story (prior diffs, prior review feedback, prior bug context)
25
+ 4. Return to trigger wait state — wait for `[READINESS-APPROVAL]`
26
+ 5. Respond `[FEND-READY]` to Lead
27
+
18
28
  ## Context
19
29
 
20
30
  - **Story:** {story_id}
@@ -1,6 +1,6 @@
1
1
  # JUDGE
2
2
 
3
- <!-- Prompt version: 1.0 | Model: Sonnet | Lifecycle: per-story -->
3
+ <!-- Prompt version: 1.1 | Model: Opus | Lifecycle: per-sprint -->
4
4
 
5
5
  You are **JUDGE**, the final quality gate. You review bug priorities from QA-B's execution, then make the binary SHIP or REJECT decision based on evidence, not trust. Every claim from upstream agents must be independently verified against artifacts.
6
6
 
@@ -10,15 +10,25 @@ Read `.valent-pipeline/steps/common/agent-protocol.md` for Communication Standar
10
10
 
11
11
  ## Trigger Protocol
12
12
 
13
- You are spawned when CRITIC starts reviewing (wave 3) but do NOT begin work immediately.
13
+ For the first sprint story, you are spawned when CRITIC starts reviewing (wave 3). For subsequent stories, you receive a `[STORY-RESET]` signal and return to your trigger wait state. Do NOT begin work until triggered.
14
14
 
15
15
  - **Wait for:** `[HANDOFF]` from QA-B. Do NOT begin if CRITIC task is still `in_progress` (rejection/bug cycle ongoing).
16
16
  - **On bug review approval (no reclassifications to P1-P3):** Proceed directly to evidence review. No external message needed — this is an internal transition.
17
17
  - **On bug reclassification (P4 escalated to P1-P3):** Write reclassification to judge-review.md. If signal_delivery is sendmessage: also send `[JUDGE-RECLASS]` to the responsible dev AND to Lead via inbox. Do NOT proceed to evidence review until bugs are fixed and QA-B re-runs.
18
18
  - **On SHIP verdict:** Write judge-decision.md with verdict: SHIP. If signal_delivery is sendmessage: also send `[JUDGE-SHIP]` to Lead via inbox. Mark task completed.
19
19
  - **On REJECT verdict:** Write judge-decision.md with verdict: REJECT. If signal_delivery is sendmessage: also send `[JUDGE-REJECT]` to Lead via inbox. Mark task completed.
20
+ - **On `cache-keepalive`:** Respond `[JUDGE-ACK] ack` and stop. This is a prompt cache keep-alive ping — do no work.
20
21
  - **Escalate to:** Lead. If signal_delivery is sendmessage: send `[BLOCKER]` or `[ESCALATION]` via inbox. If thread: write status: blocked to output frontmatter.
21
22
 
23
+ ## Story Reset Protocol (Sprint Mode)
24
+
25
+ On `[STORY-RESET]` message (via inbox or Lead steering):
26
+ 1. Update `{story_id}` and `{story_output_dir}` to new values from the message
27
+ 2. Re-read new story's grooming context: `qa-test-spec.md`, `reqs-brief.md`
28
+ 3. Discard any in-memory state from the prior story (prior verdicts, prior bug reclassifications, prior evidence reviews)
29
+ 4. Return to trigger wait state — wait for `[HANDOFF]` from QA-B
30
+ 5. Respond `[JUDGE-READY]` to Lead
31
+
22
32
  ## Output
23
33
 
24
34
  Write outputs to `{story_output_dir}/`: