olympus-ai 4.4.13 → 4.4.14

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 (33) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/features/workflow-engine/checkpoint.d.ts.map +1 -1
  3. package/dist/features/workflow-engine/checkpoint.js +12 -0
  4. package/dist/features/workflow-engine/checkpoint.js.map +1 -1
  5. package/dist/features/workflow-engine/construction/executor.d.ts +38 -3
  6. package/dist/features/workflow-engine/construction/executor.d.ts.map +1 -1
  7. package/dist/features/workflow-engine/construction/executor.js +245 -3
  8. package/dist/features/workflow-engine/construction/executor.js.map +1 -1
  9. package/dist/features/workflow-engine/construction/regression-baseline.d.ts +76 -0
  10. package/dist/features/workflow-engine/construction/regression-baseline.d.ts.map +1 -0
  11. package/dist/features/workflow-engine/construction/regression-baseline.js +274 -0
  12. package/dist/features/workflow-engine/construction/regression-baseline.js.map +1 -0
  13. package/dist/features/workflow-engine/construction/regression-categorizer.d.ts +44 -0
  14. package/dist/features/workflow-engine/construction/regression-categorizer.d.ts.map +1 -0
  15. package/dist/features/workflow-engine/construction/regression-categorizer.js +54 -0
  16. package/dist/features/workflow-engine/construction/regression-categorizer.js.map +1 -0
  17. package/dist/features/workflow-engine/phase-types.d.ts +48 -1
  18. package/dist/features/workflow-engine/phase-types.d.ts.map +1 -1
  19. package/dist/hooks/olympus-hooks.cjs +334 -280
  20. package/dist/hooks/registry.d.ts +18 -0
  21. package/dist/hooks/registry.d.ts.map +1 -1
  22. package/dist/hooks/registry.js +18 -0
  23. package/dist/hooks/registry.js.map +1 -1
  24. package/dist/installer/index.d.ts +1 -1
  25. package/dist/installer/index.js +1 -1
  26. package/package.json +1 -1
  27. package/resources/claude-md.md +44 -0
  28. package/resources/rules/common/pathway-behaviors.md +100 -0
  29. package/resources/rules/common/terminal-formatting.md +161 -0
  30. package/resources/rules/construction/build-and-test.md +58 -0
  31. package/resources/rules/construction/code-generation.md +3 -0
  32. package/resources/rules/construction/test-generation.md +82 -0
  33. package/resources/skills/continue/SKILL.md +4 -0
@@ -3,6 +3,24 @@
3
3
  *
4
4
  * Central registry for all hooks. Hooks are organized by event type
5
5
  * and sorted by priority (lower runs first).
6
+ *
7
+ * Reserved priority ranges (do NOT reuse without updating this table):
8
+ *
9
+ * Priority Owner / Purpose
10
+ * -------- -------------------------------------------------------
11
+ * 5 SessionStart — early session initialization
12
+ * 10 SessionStart — standard session initialization
13
+ * 50 AgentTracking — PreToolUse, tracks Task tool invocations
14
+ * 70 LearningTool — discovery capture, tool-use learning
15
+ * 75 PlanLifecycle — plan creation events
16
+ * 76 PlanLifecycle — plan completion events
17
+ * 84-86 Test infrastructure (Group 1A) — reserved for U-002/U-003
18
+ * 90 LearningStop — session-end learning flush
19
+ * 92 DiscoveryCapture — PostToolUse discovery events
20
+ * 110 CompletePlan — plan completion and archival hook
21
+ * 115 CompletePlan — final plan state persistence
22
+ *
23
+ * Available gaps: 77-83, 87-89
6
24
  */
7
25
  import type { HookDefinition, HookEvent } from './types.js';
8
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/hooks/registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAK5D;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAMvD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,cAAc,EAAE,CAEnE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,cAAc,EAAE,CAE9C;AAED;;;GAGG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAEjC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAMtD"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/hooks/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAK5D;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAMvD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,cAAc,EAAE,CAEnE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,cAAc,EAAE,CAE9C;AAED;;;GAGG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAEjC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAMtD"}
@@ -3,6 +3,24 @@
3
3
  *
4
4
  * Central registry for all hooks. Hooks are organized by event type
5
5
  * and sorted by priority (lower runs first).
6
+ *
7
+ * Reserved priority ranges (do NOT reuse without updating this table):
8
+ *
9
+ * Priority Owner / Purpose
10
+ * -------- -------------------------------------------------------
11
+ * 5 SessionStart — early session initialization
12
+ * 10 SessionStart — standard session initialization
13
+ * 50 AgentTracking — PreToolUse, tracks Task tool invocations
14
+ * 70 LearningTool — discovery capture, tool-use learning
15
+ * 75 PlanLifecycle — plan creation events
16
+ * 76 PlanLifecycle — plan completion events
17
+ * 84-86 Test infrastructure (Group 1A) — reserved for U-002/U-003
18
+ * 90 LearningStop — session-end learning flush
19
+ * 92 DiscoveryCapture — PostToolUse discovery events
20
+ * 110 CompletePlan — plan completion and archival hook
21
+ * 115 CompletePlan — final plan state persistence
22
+ *
23
+ * Available gaps: 77-83, 87-89
6
24
  */
7
25
  /** Map of event type to registered hooks */
8
26
  const hooks = new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/hooks/registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,4CAA4C;AA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@@ export declare const HOOKS_DIR: string;
24
24
  export declare const SETTINGS_FILE: string;
25
25
  export declare const VERSION_FILE: string;
26
26
  /** Current version - MUST match package.json */
27
- export declare const VERSION = "4.4.13";
27
+ export declare const VERSION = "4.4.14";
28
28
  /** Installation result */
29
29
  export interface InstallResult {
30
30
  success: boolean;
@@ -40,7 +40,7 @@ export const HOOKS_DIR = join(CLAUDE_CONFIG_DIR, 'hooks');
40
40
  export const SETTINGS_FILE = join(CLAUDE_CONFIG_DIR, 'settings.json');
41
41
  export const VERSION_FILE = join(CLAUDE_CONFIG_DIR, '.olympus-version.json');
42
42
  /** Current version - MUST match package.json */
43
- export const VERSION = '4.4.13';
43
+ export const VERSION = '4.4.14';
44
44
  /**
45
45
  * Read a content file from the resources/ directory.
46
46
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "olympus-ai",
3
- "version": "4.4.13",
3
+ "version": "4.4.14",
4
4
  "description": "Olympus: Multi-agent orchestration for Claude Code. Summon the gods of code.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -199,6 +199,50 @@ olympus learn --budget-status
199
199
  4. **Verify**: Check your todo list before declaring completion
200
200
  5. **Plan First**: For complex tasks, use Prometheus to create a plan
201
201
 
202
+ ## Terminal Output Formatting
203
+
204
+ Plain paragraphs are invisible in the terminal. Use visual elements to create hierarchy.
205
+
206
+ **Phase banners** — fenced with `---`, use `## 🚀` header:
207
+
208
+ ```text
209
+ ---
210
+ ## 🚀 Starting Phase Name
211
+ **Key:** `value` — description
212
+ ---
213
+ ```
214
+
215
+ **Action prompts** — ALWAYS use this pattern when the user must do something:
216
+
217
+ ```text
218
+ ---
219
+ ## 📌 Action Required
220
+ Do the thing with `command`, then say **"done"**.
221
+ > Secondary instructions go in a blockquote.
222
+ ---
223
+ ```
224
+
225
+ **Status lines** — emoji-first for scannability:
226
+
227
+ ```text
228
+ ✅ Tests pass (3,360 / 3,360)
229
+ ⚠️ Missing optional config
230
+ ❌ Contract validation failed
231
+ ⏳ Generating artifacts...
232
+ ```
233
+
234
+ **Emoji vocabulary:** 🚀 workflow start, 📌 action required, ✅ success, ⚠️ warning, ❌ error, 🔍 context/analysis, 📋 summary, 💡 recommendation
235
+
236
+ **Rules:**
237
+
238
+ 1. Action prompts use `## 📌 Action Required` — never plain paragraphs
239
+ 2. Phase transitions get `---` fenced `##` headers with emoji
240
+ 3. File paths, commands, user inputs always in `inline code`
241
+ 4. Key action words in **bold**
242
+ 5. Secondary instructions in `> blockquotes`
243
+ 6. Action prompts go at the END of the response
244
+ 7. No emojis in headers written to files (breaks parsers)
245
+
202
246
  ## Background Task Execution
203
247
 
204
248
  For long-running operations, use `run_in_background: true`:
@@ -0,0 +1,100 @@
1
+ # Pathway Behaviors
2
+
3
+ **Loading note**: The orchestrator loads this file at the start of each Construction unit and
4
+ injects the section matching `checkpoint.pathway_type` into the agent context. Only the
5
+ relevant section is injected — the agent sees its pathway section, not the full file.
6
+
7
+ ---
8
+
9
+ ## Bugfix Pathway
10
+
11
+ These rules are non-negotiable. Every bugfix unit must satisfy all items in the quality gate
12
+ before the unit is marked complete.
13
+
14
+ ### Autonomous Diagnosis
15
+
16
+ Before writing any code change, the agent must:
17
+
18
+ 1. Reproduce the defect with a failing test or a documented reproduction recipe
19
+ 2. Identify the root cause — the specific code path, assumption, or edge case that causes
20
+ the failure
21
+ 3. Document the root cause in the `## Root Cause` section of the unit's `test-report.md`
22
+
23
+ Do not write a fix before completing the diagnosis. A fix that addresses only the symptom
24
+ will likely fail the quality gate.
25
+
26
+ ### Root Cause Analysis Requirement
27
+
28
+ The `test-report.md` for a bugfix unit must contain a `## Root Cause` section with:
29
+ - File path and line number(s) of the defect
30
+ - A one-paragraph explanation of why the failure occurs
31
+ - Confirmation that the fix targets the root cause, not a workaround
32
+
33
+ ### Missing Test Rule (Non-Negotiable)
34
+
35
+ Every bugfix unit MUST produce at least one new test that:
36
+ - Reproduces the original defect (fails before the fix, passes after)
37
+ - Is placed in the appropriate test file for the affected module
38
+ - Is named to clearly identify the defect it guards against
39
+
40
+ This rule cannot be overridden via `allowFailures`. The engine blocks unit completion if
41
+ `tests_total === 0` for any bugfix unit, regardless of options passed.
42
+
43
+ ### Quality Gate Checklist
44
+
45
+ All items must be satisfied before the bugfix unit is marked complete:
46
+
47
+ - [ ] Root cause identified and documented in `test-report.md`
48
+ - [ ] Fix addresses the root cause (not just the symptom)
49
+ - [ ] All existing tests still pass (zero regressions)
50
+ - [ ] At least one new test reproduces the original defect
51
+ - [ ] New test passes with the fix applied
52
+
53
+ ---
54
+
55
+ ## Optimization Pathway
56
+
57
+ ### Baseline Measurement
58
+
59
+ Before making any code changes:
60
+
61
+ 1. Run the relevant benchmark or performance test
62
+ 2. Record the baseline metric (e.g., execution time, memory usage, throughput) in the
63
+ `## Baseline` section of the unit's `test-report.md`
64
+ 3. Note the test command used and any environment conditions that could affect the result
65
+
66
+ Do not proceed with changes until the baseline is captured. A comparison without a baseline
67
+ is not a valid optimization result.
68
+
69
+ ### Performance Comparison
70
+
71
+ After applying changes:
72
+
73
+ 1. Run the same benchmark or performance test under the same conditions
74
+ 2. Record the result in the `## Performance Comparison` section of `test-report.md`:
75
+ - Baseline metric
76
+ - Post-change metric
77
+ - Delta (absolute and percentage)
78
+ 3. Confirm the improvement meets the acceptance criteria defined in the unit spec
79
+
80
+ If performance has not improved, investigate before marking the unit complete.
81
+
82
+ ### Rollback Plan
83
+
84
+ Document in `test-report.md` how to revert the optimization if it causes a regression in
85
+ production:
86
+ - Which files were changed
87
+ - The prior behavior that would need to be restored
88
+ - Any feature flags or config knobs that could disable the optimization without a deploy
89
+
90
+ ---
91
+
92
+ ## Standard / Enhancement / Greenfield Pathways
93
+
94
+ No additional behavioral constraints apply beyond the standard rules defined in:
95
+
96
+ - `resources/rules/construction/code-generation.md`
97
+ - `resources/rules/construction/test-generation.md`
98
+
99
+ Follow those rules as written. The orchestrator does not inject any additional context for
100
+ these pathways.
@@ -0,0 +1,161 @@
1
+ # Terminal Output Formatting Standards
2
+
3
+ Claude Code renders markdown via an Ink/React TUI renderer with ANSI escape codes. Plain paragraphs are visually invisible — they blend into the response stream. These rules ensure critical information is scannable.
4
+
5
+ ## The Core Problem
6
+
7
+ In a terminal, the user sees a continuous stream of white text. Only these elements create visual differentiation:
8
+
9
+ | Element | Renders As | Use For |
10
+ |---------|-----------|---------|
11
+ | `# H1` / `## H2` | Colored text (red/orange) | Section breaks, banners |
12
+ | `**bold**` | Bold weight | Key terms, labels |
13
+ | `` `inline code` `` | Distinct background/color | Commands, file paths, values |
14
+ | `> blockquote` | Indented with left border | Callouts, important notes |
15
+ | `---` | Horizontal rule | Visual fences/separators |
16
+ | Emojis | Colored glyphs | Status indicators, anchors |
17
+ | Code blocks | Syntax-highlighted box | Code, structured data |
18
+
19
+ **Rule: Anything the user must act on or notice MUST use at least two of these elements. Never deliver critical info as a plain paragraph.**
20
+
21
+ ---
22
+
23
+ ## Emoji Vocabulary (Standardized)
24
+
25
+ Use consistently so users learn the visual language:
26
+
27
+ | Emoji | Meaning | When to Use |
28
+ |-------|---------|-------------|
29
+ | 🚀 | Workflow start / launch | Welcome banners, phase kickoffs |
30
+ | 📌 | Action required | User needs to do something NOW |
31
+ | ✅ | Success / complete | Task done, tests pass, validation pass |
32
+ | ⚠️ | Warning / attention | Non-blocking but important |
33
+ | ❌ | Error / failure | Something broke, blocking issue |
34
+ | 🔍 | Context / analysis | Showing inferred or extracted info |
35
+ | 📋 | Summary / recap | Phase summaries, status reports |
36
+ | 💡 | Recommendation / tip | AI suggestions, best practices |
37
+ | ⏳ | In progress / waiting | Long-running operations |
38
+ | 🔄 | Iteration / retry | Re-running, looping back |
39
+
40
+ **Do NOT use emojis in markdown headers that will be written to files** (breaks TOCs and parsers). Emojis are for terminal display output only.
41
+
42
+ ---
43
+
44
+ ## Output Patterns
45
+
46
+ ### Pattern 1: Welcome / Phase Banner
47
+
48
+ ```markdown
49
+ ---
50
+ ## 🚀 Welcome to AI-DLC! Starting a new workflow for Group 1B
51
+
52
+ **Workflow:** `group-1b-test-quality` — Test Quality & Traceability
53
+ **Builds on:** Group 1A test infrastructure (confirmed ✅)
54
+ ---
55
+ ```
56
+
57
+ Why it works: `---` fences create a visual box. `##` renders in color. Emoji grabs the eye. Bold labels + inline code for scannable key-value pairs.
58
+
59
+ ---
60
+
61
+ ### Pattern 2: Action Required (MOST IMPORTANT)
62
+
63
+ Use this whenever the user needs to do something. This is the pattern that matters most.
64
+
65
+ ```markdown
66
+ ---
67
+ ## 📌 Action Required
68
+
69
+ Fill in the `[Answer]:` tags in the file below, then say **"done"** to continue.
70
+
71
+ > For multi-select questions, provide comma-separated letters (e.g., `A, B, E`).
72
+
73
+ **File:** `aidlc-docs/group-1b-test-quality/inception/intent-questions.md`
74
+ ---
75
+ ```
76
+
77
+ Why it works: The `📌 Action Required` header is an unmissable colored+emoji signal. The command uses `inline code` and `**bold**`. The secondary instruction lives in a `> blockquote` so it's visually subordinate but still distinct. File path is in code formatting.
78
+
79
+ ---
80
+
81
+ ### Pattern 3: Status / Progress Update
82
+
83
+ ```markdown
84
+ ✅ All 3,360 tests pass — Group 1A prerequisite confirmed.
85
+
86
+ ⏳ Generating intent questions file...
87
+ ```
88
+
89
+ Why it works: Emoji-first lines create a scannable status log. Each line starts with a visual indicator.
90
+
91
+ ---
92
+
93
+ ### Pattern 4: Validation Summary
94
+
95
+ ```markdown
96
+ ## 📋 Validation Summary
97
+
98
+ | Check | Status | Detail |
99
+ |-------|--------|--------|
100
+ | Tests pass | ✅ | 3,360 / 3,360 |
101
+ | Prerequisites met | ✅ | Group 1A complete |
102
+ | Manifest valid | ⚠️ | Missing `coverage-config.json` |
103
+ ```
104
+
105
+ Why it works: Tables with emoji status create an at-a-glance dashboard. The `##` header separates it from surrounding text.
106
+
107
+ ---
108
+
109
+ ### Pattern 5: Error / Blocking Issue
110
+
111
+ ```markdown
112
+ ---
113
+ ## ❌ Blocking Issue
114
+
115
+ **What failed:** Contract validation for `UserService.create()`
116
+ **Why:** Missing required field `email` in test fixture at `tests/fixtures/users.ts:42`
117
+
118
+ > Fix the fixture and re-run with **"retry"**.
119
+ ---
120
+ ```
121
+
122
+ ---
123
+
124
+ ### Pattern 6: Context Extraction / Inference Review
125
+
126
+ ```markdown
127
+ ## 🔍 Context Extracted from Your Input
128
+
129
+ - **Problem:** AI-generated tests have documented failure modes...
130
+ - **Primary users:** Olympus OSS users running AI-DLC workflows...
131
+ - **Scope:** Four capabilities — anti-pattern detection, traceability...
132
+ - **Success criteria:** Each capability integrates into the pipeline...
133
+
134
+ > Please correct anything that is wrong, then say **"confirmed"**.
135
+ ```
136
+
137
+ Why it works: The `🔍` signals "I'm showing you what I understood." Bold labels on each bullet make it scannable. The blockquote at the end is the action prompt.
138
+
139
+ ---
140
+
141
+ ## Anti-Patterns (Never Do This)
142
+
143
+ | Bad | Good | Why |
144
+ |-----|------|-----|
145
+ | Plain paragraph for action prompts | `## 📌 Action Required` header | Paragraphs are invisible |
146
+ | Burying instructions in the middle of text | Action prompt at the END, fenced with `---` | Users scan bottom-first for "what do I do now" |
147
+ | Multiple action items in one paragraph | One action per bold line or bullet | Cognitive overload |
148
+ | Emoji in file-output headers (`# 🔍 Intent`) | Emoji only in terminal display text | Breaks file parsers/TOCs |
149
+ | Wall of unbroken text explaining context | Bullet list with `**bold labels**` | Scannable vs. readable |
150
+
151
+ ---
152
+
153
+ ## Quick Rules (For Skill Authors)
154
+
155
+ 1. **Every phase transition** gets a `---` fenced `##` header with emoji
156
+ 2. **Every action prompt** uses `## 📌 Action Required` pattern
157
+ 3. **Every status update** starts with an emoji indicator (✅ ⚠️ ❌ ⏳)
158
+ 4. **Every user-facing value** (file paths, commands, inputs) uses `inline code`
159
+ 5. **Every "what to do next"** instruction uses `**bold**` for the key action word
160
+ 6. **Never deliver critical information as a plain paragraph**
161
+ 7. **Action prompts go at the END** of the response, not buried in the middle
@@ -269,6 +269,64 @@ Create `aidlc-docs/construction/build-and-test/e2e-test-instructions.md`:
269
269
 
270
270
  ---
271
271
 
272
+ ## Step 6b: Run Smoke Tests
273
+
274
+ Run the full test suite (or a targeted subset for bugfix pathway) and generate a structured
275
+ test report that aggregates results across all units.
276
+
277
+ **Scope parameter** — determined by `pathway_type`:
278
+
279
+ | Scope | Pathway | What runs |
280
+ |-------|---------|-----------|
281
+ | `full` | standard, comprehensive, brownfield-enhancement, brownfield-refactor | Entire test suite |
282
+ | `targeted` | bugfix | Only tests for changed units (scoped by file path filter) |
283
+ | `summary` | minimal, optimization | Smoke pass — quick sanity check only |
284
+
285
+ **Delegation**: Delegate test execution to `qa-tester` using the same pattern established
286
+ in the Agent Delegation Strategy section. The orchestrator generates the scope instruction
287
+ first, then delegates; after the agent reports, the orchestrator runs the test command
288
+ independently to verify (see Orchestrator Verification Requirements above).
289
+
290
+ **Output artifact**: `aidlc-docs/{workflow-id}/construction/build-and-test/test-report.md`
291
+
292
+ Aggregate per-unit test reports from `aidlc-docs/{workflow-id}/construction/{unit}/testing/test-report.md`
293
+ into the build-level report using this schema:
294
+
295
+ ```markdown
296
+ # Test Report — Build and Test
297
+
298
+ ## Summary
299
+
300
+ | Metric | Value |
301
+ |--------|-------|
302
+ | total_tests | [X] |
303
+ | passed | [X] |
304
+ | failed | [X] |
305
+ | skipped | [X] |
306
+
307
+ ## Per-Unit Breakdown
308
+
309
+ | Unit | Total | Passed | Failed | Skipped | Status |
310
+ |------|-------|--------|--------|---------|--------|
311
+ | [unit-id] | [X] | [X] | [X] | [X] | Pass/Fail |
312
+
313
+ ## Failure Details
314
+
315
+ [For each failing test: unit, test name, file path, error message]
316
+
317
+ ## Remediation Guidance
318
+
319
+ [Populated only when failures exist — links to the failing unit's test-report.md]
320
+ \`\`\`
321
+
322
+ **Critical failure gate**: If `tests_failed > 0` and `allowFailures` is not set:
323
+ - Block workflow progression
324
+ - Surface the failing unit's `test-report.md` path in the Remediation Guidance section
325
+ - Do NOT proceed to Step 7 until all failures are resolved or `allowFailures` is explicitly
326
+ confirmed by the user
327
+
328
+ ---
329
+
272
330
  ## Step 7: Generate Test Summary
273
331
 
274
332
  Create `aidlc-docs/construction/build-and-test/build-and-test-summary.md`:
@@ -341,5 +341,8 @@ When generating UI code (web, mobile, desktop), ensure elements are automation-f
341
341
  - All steps in unit code generation plan marked [x]
342
342
  - All unit stories implemented according to plan
343
343
  - All code and tests generated (tests will be executed in Build & Test phase)
344
+ - After code generation completes for a unit, proceed to the **Test Generation** stage
345
+ (see `resources/rules/construction/test-generation.md`) before moving to the next unit
346
+ or Build & Test.
344
347
  - Deployment artifacts generated
345
348
  - Complete unit ready for build and verification
@@ -0,0 +1,82 @@
1
+ # Test Generation - Detailed Steps
2
+
3
+ ## Overview
4
+
5
+ This stage generates and runs tests for the current unit after code generation completes.
6
+
7
+ - Agent responsible: `qa-tester` (primary) or `olympian` for test writing
8
+ - Output artifact: `aidlc-docs/{workflowId}/construction/{unitId}/testing/test-report.md`
9
+
10
+ ## Prerequisites
11
+
12
+ - Code generation must be complete (`code-summary.md` must exist at `aidlc-docs/{workflowId}/construction/{unitId}/code/code-summary.md`)
13
+ - Unit files in scope are read from `code-summary.md`
14
+ - If `code-summary.md` does not exist, halt and report to orchestrator before proceeding
15
+
16
+ ## Step 1 — Framework Detection (Hybrid)
17
+
18
+ - **1a**: The engine stores the detected framework in `test_framework` on `ConstructionUnitProgress`
19
+ - **1b**: Agent independently verifies: read `package.json`, `vitest.config.*`, `jest.config.*` at project root
20
+ - **1c**: If engine value and agent value disagree, agent value wins; log the discrepancy
21
+
22
+ Known frameworks and their test commands:
23
+
24
+ | Framework | Test Command |
25
+ |-----------|-------------|
26
+ | `vitest` | `npx vitest run` |
27
+ | `jest` | `npx jest` |
28
+ | `mocha` | `npx mocha` |
29
+ | Unknown | Ask user before proceeding |
30
+
31
+ ## Step 2 — Determine Test Types (Auditable Criteria)
32
+
33
+ Evaluate each criterion explicitly and record which test types apply in `test-report.md`:
34
+
35
+ - **Unit tests**: Required for all pure functions, class methods, utilities. File naming: `*.test.ts` or `*.spec.ts` co-located with source.
36
+ - **Integration tests**: Required when the unit touches 2 or more modules, external APIs, databases, or file I/O. Placed in `tests/integration/`.
37
+ - **E2E tests**: Required only when the unit includes a user-facing entry point (HTTP endpoint, CLI command, UI page). Placed in `tests/e2e/`.
38
+
39
+ ## Step 3 — Generate Tests
40
+
41
+ - Scope: only modify or create files listed in `code-summary.md`'s "Files created/modified" sections
42
+ - Do NOT modify files from other units
43
+ - Follow existing test file conventions in the project (import style, describe/it structure, mock patterns)
44
+ - Use `data-testid` attributes for UI component tests
45
+
46
+ ## Step 4 — Run Tests
47
+
48
+ - Execute the framework test command for the unit's files only (scope by file path filter where possible)
49
+ - Capture: total count, passed count, failed count
50
+ - Write results into `test-report.md`
51
+
52
+ ## Step 5 — Failure Handling
53
+
54
+ - On first failure: attempt one automated fix per failing test (fix the test or the implementation; prefer fixing the test unless the implementation has a clear bug)
55
+ - On second failure: attempt a second fix with a different strategy
56
+ - After two failed attempts: escalate — write the failure details to `test-report.md` and set `tests_failed` count; do NOT attempt a third fix
57
+ - Escalation message format: surface to the orchestrator with file path, test name, error message
58
+
59
+ ## Engine Gating Rules
60
+
61
+ - The engine blocks unit completion if `tests_total === 0` (no tests detected)
62
+ - The engine blocks unit completion if `tests_failed > 0`
63
+ - Both blocks can be overridden by setting `allowFailures: true` in `TestGenerationOptions`
64
+ - Override must be logged in `test-report.md` under the `## Override` section
65
+
66
+ ## Code Modification Scope
67
+
68
+ - The agent may ONLY modify files listed in `code-summary.md` for this unit
69
+ - `code-summary.md` is at: `aidlc-docs/{workflowId}/construction/{unitId}/code/code-summary.md`
70
+ - If `code-summary.md` does not exist, halt and report to orchestrator before proceeding
71
+
72
+ ## Output Artifact
73
+
74
+ - Path: `aidlc-docs/{workflowId}/construction/{unitId}/testing/test-report.md`
75
+ - Must exist before the unit is marked complete
76
+
77
+ ## Completion Criteria
78
+
79
+ - `test-report.md` written with actual counts (not placeholders)
80
+ - `tests_total > 0`
81
+ - `tests_failed === 0` (or override documented)
82
+ - `ConstructionUnitProgress.stages['test-generation'].status === 'completed'`
@@ -138,6 +138,8 @@ If `current_phase === 'construction'`:
138
138
  - Check `construction_units` for the active unit
139
139
  - Determine which design stage is `in_progress` or `not_started`
140
140
  - Resume from that point
141
+ - If a `construction_units` entry has `stages['test-generation'].status === 'in_progress'` or `test_generation_status === 'in_progress'`, resume at test-generation for that unit
142
+ - Note: test-generation runs after code-generation for each unit; check `test_generation_status` in the unit progress
141
143
 
142
144
  ### 4d. Other Phases
143
145
 
@@ -163,6 +165,7 @@ Based on the resume point determined in Step 4, read the corresponding rule file
163
165
  | nfr-design | `~/.claude/olympus/rules/construction/nfr-design.md` |
164
166
  | infrastructure-design | `~/.claude/olympus/rules/construction/infrastructure-design.md` |
165
167
  | code-generation | `~/.claude/olympus/rules/construction/code-generation.md` |
168
+ | test-generation | `~/.claude/olympus/rules/construction/test-generation.md` |
166
169
 
167
170
  ---
168
171
 
@@ -217,6 +220,7 @@ Wait for user response before proceeding.
217
220
  | infrastructure-design | `oracle-medium` |
218
221
  | code-generation (backend) | `olympian` or `olympian-high` |
219
222
  | code-generation (frontend) | `frontend-engineer` or `frontend-engineer-high` |
223
+ | test-generation | `qa-tester` |
220
224
  | build-and-test | `qa-tester` |
221
225
 
222
226
  ### If user chose B (Review)