@deriest/ai-engineering-company 1.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/CHANGELOG.md +807 -0
  2. package/LICENSE +8 -0
  3. package/README.md +291 -0
  4. package/assets/knowledge/.gitkeep +0 -0
  5. package/assets/offices/architecture/README.md +32 -0
  6. package/assets/offices/engineering/README.md +53 -0
  7. package/assets/offices/governance/README.md +30 -0
  8. package/assets/offices/product/README.md +37 -0
  9. package/assets/organization/organization.json +260 -0
  10. package/assets/organization/validation.md +107 -0
  11. package/assets/prompts/.gitkeep +0 -0
  12. package/assets/templates/.gitkeep +0 -0
  13. package/assets/workers/architect/AGENTS.md +49 -0
  14. package/assets/workers/architect/SOUL.md +21 -0
  15. package/assets/workers/architect/config.json +7 -0
  16. package/assets/workers/backend-engineer/AGENTS.md +67 -0
  17. package/assets/workers/backend-engineer/HEARTBEAT.md +5 -0
  18. package/assets/workers/backend-engineer/IDENTITY.md +27 -0
  19. package/assets/workers/backend-engineer/SOUL.md +24 -0
  20. package/assets/workers/backend-engineer/TOOLS.md +44 -0
  21. package/assets/workers/backend-engineer/USER.md +21 -0
  22. package/assets/workers/backend-engineer/company/scripts/wp3/harness-spec.md +31 -0
  23. package/assets/workers/backend-engineer/company/scripts/wp3/lib/semver-range.js +81 -0
  24. package/assets/workers/backend-engineer/company/scripts/wp3/lib/test-mr4.js +6 -0
  25. package/assets/workers/backend-engineer/config.json +7 -0
  26. package/assets/workers/backend-engineer/openclaw-workspace-state.json +4 -0
  27. package/assets/workers/designer/AGENTS.md +49 -0
  28. package/assets/workers/designer/SOUL.md +20 -0
  29. package/assets/workers/designer/config.json +7 -0
  30. package/assets/workers/dispatcher/AGENTS.md +158 -0
  31. package/assets/workers/dispatcher/HEARTBEAT.md +5 -0
  32. package/assets/workers/dispatcher/IDENTITY.md +6 -0
  33. package/assets/workers/dispatcher/ROUTING.md +136 -0
  34. package/assets/workers/dispatcher/SOUL.md +18 -0
  35. package/assets/workers/dispatcher/TOOLS.md +32 -0
  36. package/assets/workers/dispatcher/USER.md +15 -0
  37. package/assets/workers/dispatcher/config.json +7 -0
  38. package/assets/workers/dispatcher/openclaw-workspace-state.json +4 -0
  39. package/assets/workers/frontend-engineer/AGENTS.md +53 -0
  40. package/assets/workers/frontend-engineer/SOUL.md +23 -0
  41. package/assets/workers/frontend-engineer/config.json +7 -0
  42. package/assets/workers/governor/AGENTS.md +57 -0
  43. package/assets/workers/governor/SOUL.md +20 -0
  44. package/assets/workers/governor/config.json +7 -0
  45. package/assets/workers/infrastructure-engineer/AGENTS.md +51 -0
  46. package/assets/workers/infrastructure-engineer/SOUL.md +21 -0
  47. package/assets/workers/infrastructure-engineer/config.json +7 -0
  48. package/assets/workers/product-manager/AGENTS.md +52 -0
  49. package/assets/workers/product-manager/HEARTBEAT.md +5 -0
  50. package/assets/workers/product-manager/IDENTITY.md +27 -0
  51. package/assets/workers/product-manager/SOUL.md +20 -0
  52. package/assets/workers/product-manager/TOOLS.md +44 -0
  53. package/assets/workers/product-manager/USER.md +21 -0
  54. package/assets/workers/product-manager/config.json +7 -0
  55. package/assets/workers/product-manager/openclaw-workspace-state.json +4 -0
  56. package/assets/workers/qa-engineer/AGENTS.md +50 -0
  57. package/assets/workers/qa-engineer/HEARTBEAT.md +5 -0
  58. package/assets/workers/qa-engineer/IDENTITY.md +27 -0
  59. package/assets/workers/qa-engineer/SOUL.md +22 -0
  60. package/assets/workers/qa-engineer/TOOLS.md +44 -0
  61. package/assets/workers/qa-engineer/USER.md +21 -0
  62. package/assets/workers/qa-engineer/config.json +7 -0
  63. package/assets/workers/qa-engineer/openclaw-workspace-state.json +4 -0
  64. package/assets/workers/researcher/AGENTS.md +50 -0
  65. package/assets/workers/researcher/HEARTBEAT.md +5 -0
  66. package/assets/workers/researcher/IDENTITY.md +27 -0
  67. package/assets/workers/researcher/SOUL.md +20 -0
  68. package/assets/workers/researcher/TOOLS.md +44 -0
  69. package/assets/workers/researcher/USER.md +21 -0
  70. package/assets/workers/researcher/config.json +7 -0
  71. package/assets/workers/researcher/openclaw-workspace-state.json +4 -0
  72. package/config/offices.json +19 -0
  73. package/config/policies.json +10 -0
  74. package/config/workflows.json +9 -0
  75. package/dist/audit-logger.d.ts +49 -0
  76. package/dist/audit-logger.d.ts.map +1 -0
  77. package/dist/audit-logger.js +131 -0
  78. package/dist/audit-logger.js.map +1 -0
  79. package/dist/cli.d.ts +17 -0
  80. package/dist/cli.d.ts.map +1 -0
  81. package/dist/cli.js +218 -0
  82. package/dist/cli.js.map +1 -0
  83. package/dist/commands/aicompany.d.ts +12 -0
  84. package/dist/commands/aicompany.d.ts.map +1 -0
  85. package/dist/commands/aicompany.js +101 -0
  86. package/dist/commands/aicompany.js.map +1 -0
  87. package/dist/decision-queue.d.ts +31 -0
  88. package/dist/decision-queue.d.ts.map +1 -0
  89. package/dist/decision-queue.js +86 -0
  90. package/dist/decision-queue.js.map +1 -0
  91. package/dist/dispatch-service.d.ts +43 -0
  92. package/dist/dispatch-service.d.ts.map +1 -0
  93. package/dist/dispatch-service.js +569 -0
  94. package/dist/dispatch-service.js.map +1 -0
  95. package/dist/dispatcher.d.ts +24 -0
  96. package/dist/dispatcher.d.ts.map +1 -0
  97. package/dist/dispatcher.js +84 -0
  98. package/dist/dispatcher.js.map +1 -0
  99. package/dist/file-queue-backend.d.ts +16 -0
  100. package/dist/file-queue-backend.d.ts.map +1 -0
  101. package/dist/file-queue-backend.js +93 -0
  102. package/dist/file-queue-backend.js.map +1 -0
  103. package/dist/gateway.d.ts +14 -0
  104. package/dist/gateway.d.ts.map +1 -0
  105. package/dist/gateway.js +138 -0
  106. package/dist/gateway.js.map +1 -0
  107. package/dist/index.d.ts +4 -0
  108. package/dist/index.d.ts.map +1 -0
  109. package/dist/index.js +277 -0
  110. package/dist/index.js.map +1 -0
  111. package/dist/lease-provider.d.ts +31 -0
  112. package/dist/lease-provider.d.ts.map +1 -0
  113. package/dist/lease-provider.js +4 -0
  114. package/dist/lease-provider.js.map +1 -0
  115. package/dist/memory-lease-provider.d.ts +10 -0
  116. package/dist/memory-lease-provider.d.ts.map +1 -0
  117. package/dist/memory-lease-provider.js +54 -0
  118. package/dist/memory-lease-provider.js.map +1 -0
  119. package/dist/memory-queue-backend.d.ts +16 -0
  120. package/dist/memory-queue-backend.d.ts.map +1 -0
  121. package/dist/memory-queue-backend.js +93 -0
  122. package/dist/memory-queue-backend.js.map +1 -0
  123. package/dist/metrics-registry.d.ts +58 -0
  124. package/dist/metrics-registry.d.ts.map +1 -0
  125. package/dist/metrics-registry.js +195 -0
  126. package/dist/metrics-registry.js.map +1 -0
  127. package/dist/openclaw.plugin.json +29 -0
  128. package/dist/org-engine.d.ts +134 -0
  129. package/dist/org-engine.d.ts.map +1 -0
  130. package/dist/org-engine.js +129 -0
  131. package/dist/org-engine.js.map +1 -0
  132. package/dist/pipeline-checkpoint.d.ts +44 -0
  133. package/dist/pipeline-checkpoint.d.ts.map +1 -0
  134. package/dist/pipeline-checkpoint.js +90 -0
  135. package/dist/pipeline-checkpoint.js.map +1 -0
  136. package/dist/pipeline-engine.d.ts +53 -0
  137. package/dist/pipeline-engine.d.ts.map +1 -0
  138. package/dist/pipeline-engine.js +47 -0
  139. package/dist/pipeline-engine.js.map +1 -0
  140. package/dist/prompt-assembler.d.ts +13 -0
  141. package/dist/prompt-assembler.d.ts.map +1 -0
  142. package/dist/prompt-assembler.js +84 -0
  143. package/dist/prompt-assembler.js.map +1 -0
  144. package/dist/queue-backend.d.ts +44 -0
  145. package/dist/queue-backend.d.ts.map +1 -0
  146. package/dist/queue-backend.js +4 -0
  147. package/dist/queue-backend.js.map +1 -0
  148. package/dist/redis-lease-provider.d.ts +16 -0
  149. package/dist/redis-lease-provider.d.ts.map +1 -0
  150. package/dist/redis-lease-provider.js +96 -0
  151. package/dist/redis-lease-provider.js.map +1 -0
  152. package/dist/redis-queue-backend.d.ts +23 -0
  153. package/dist/redis-queue-backend.d.ts.map +1 -0
  154. package/dist/redis-queue-backend.js +131 -0
  155. package/dist/redis-queue-backend.js.map +1 -0
  156. package/dist/src/cli.d.ts +11 -0
  157. package/dist/src/cli.d.ts.map +1 -0
  158. package/dist/src/cli.js +100 -0
  159. package/dist/src/cli.js.map +1 -0
  160. package/dist/src/dispatch-service.d.ts +25 -0
  161. package/dist/src/dispatch-service.d.ts.map +1 -0
  162. package/dist/src/dispatch-service.js +201 -0
  163. package/dist/src/dispatch-service.js.map +1 -0
  164. package/dist/src/dispatcher.d.ts +23 -0
  165. package/dist/src/dispatcher.d.ts.map +1 -0
  166. package/dist/src/dispatcher.js +66 -0
  167. package/dist/src/dispatcher.js.map +1 -0
  168. package/dist/src/gateway.d.ts +10 -0
  169. package/dist/src/gateway.d.ts.map +1 -0
  170. package/dist/src/gateway.js +66 -0
  171. package/dist/src/gateway.js.map +1 -0
  172. package/dist/src/index.d.ts +8 -0
  173. package/dist/src/index.d.ts.map +1 -0
  174. package/dist/src/index.js +85 -0
  175. package/dist/src/index.js.map +1 -0
  176. package/dist/src/org-engine.d.ts +134 -0
  177. package/dist/src/org-engine.d.ts.map +1 -0
  178. package/dist/src/org-engine.js +129 -0
  179. package/dist/src/org-engine.js.map +1 -0
  180. package/dist/src/pipeline-engine.d.ts +53 -0
  181. package/dist/src/pipeline-engine.d.ts.map +1 -0
  182. package/dist/src/pipeline-engine.js +47 -0
  183. package/dist/src/pipeline-engine.js.map +1 -0
  184. package/dist/src/prompt-assembler.d.ts +13 -0
  185. package/dist/src/prompt-assembler.d.ts.map +1 -0
  186. package/dist/src/prompt-assembler.js +84 -0
  187. package/dist/src/prompt-assembler.js.map +1 -0
  188. package/dist/src/task-state.d.ts +27 -0
  189. package/dist/src/task-state.d.ts.map +1 -0
  190. package/dist/src/task-state.js +49 -0
  191. package/dist/src/task-state.js.map +1 -0
  192. package/dist/src/tools.d.ts +9 -0
  193. package/dist/src/tools.d.ts.map +1 -0
  194. package/dist/src/tools.js +107 -0
  195. package/dist/src/tools.js.map +1 -0
  196. package/dist/src/types.d.ts +99 -0
  197. package/dist/src/types.d.ts.map +1 -0
  198. package/dist/src/types.js +4 -0
  199. package/dist/src/types.js.map +1 -0
  200. package/dist/src/validation.d.ts +11 -0
  201. package/dist/src/validation.d.ts.map +1 -0
  202. package/dist/src/validation.js +69 -0
  203. package/dist/src/validation.js.map +1 -0
  204. package/dist/src/workboard-gateway.d.ts +82 -0
  205. package/dist/src/workboard-gateway.d.ts.map +1 -0
  206. package/dist/src/workboard-gateway.js +76 -0
  207. package/dist/src/workboard-gateway.js.map +1 -0
  208. package/dist/src/worker-engine.d.ts +38 -0
  209. package/dist/src/worker-engine.d.ts.map +1 -0
  210. package/dist/src/worker-engine.js +73 -0
  211. package/dist/src/worker-engine.js.map +1 -0
  212. package/dist/task-state.d.ts +27 -0
  213. package/dist/task-state.d.ts.map +1 -0
  214. package/dist/task-state.js +62 -0
  215. package/dist/task-state.js.map +1 -0
  216. package/dist/tools.d.ts +11 -0
  217. package/dist/tools.d.ts.map +1 -0
  218. package/dist/tools.js +183 -0
  219. package/dist/tools.js.map +1 -0
  220. package/dist/types.d.ts +99 -0
  221. package/dist/types.d.ts.map +1 -0
  222. package/dist/types.js +4 -0
  223. package/dist/types.js.map +1 -0
  224. package/dist/validation.d.ts +11 -0
  225. package/dist/validation.d.ts.map +1 -0
  226. package/dist/validation.js +69 -0
  227. package/dist/validation.js.map +1 -0
  228. package/dist/workboard-gateway.d.ts +82 -0
  229. package/dist/workboard-gateway.d.ts.map +1 -0
  230. package/dist/workboard-gateway.js +76 -0
  231. package/dist/workboard-gateway.js.map +1 -0
  232. package/dist/worker-engine.d.ts +38 -0
  233. package/dist/worker-engine.d.ts.map +1 -0
  234. package/dist/worker-engine.js +73 -0
  235. package/dist/worker-engine.js.map +1 -0
  236. package/openclaw.plugin.json +42 -0
  237. package/package.json +50 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,807 @@
1
+ # Changelog
2
+
3
+ All notable changes to the AI Engineering Company plugin will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.15.2] - 2026-07-05
9
+
10
+ ### Private npm Publication Preparation
11
+
12
+ No runtime changes. No TypeScript changes.
13
+
14
+ #### Changed
15
+
16
+ - **Package scope migration** — Renamed from `@openclaw/ai-engineering-company` to `@deriest/ai-engineering-company` for private npm publishing under the @deriest scope.
17
+ - **Package hardening** — Added `"files"` whitelist to minimize package size (467 files → 237 files, 1,641 KB → 549 KB). Excludes source, docs, scripts, tests, and dev config.
18
+ - **License consistency** — Changed LICENSE from MIT to UNLICENSED to match `"license": "UNLICENSED"` in package.json.
19
+ - **npm publish readiness** — Removed `"private": true`, added `"license": "UNLICENSED"` to package.json.
20
+
21
+ ---
22
+
23
+ ## [1.15.1] - 2026-07-05
24
+
25
+ ### Plugin Metadata Compliance Patch
26
+
27
+ No runtime changes. No TypeScript changes.
28
+
29
+ #### Fixed
30
+
31
+ - **Missing contracts.tools declarations** — Added `ai_company_approve`, `ai_company_reject`, `ai_company_list_approvals` to `openclaw.plugin.json` contracts.tools. These tools were implemented (WP-11, v1.1.0) and registered in both agent tools and gateway, but were not declared in the plugin manifest. `openclaw plugins doctor` now reports zero issues.
32
+
33
+ ---
34
+
35
+ ## [1.15.0] - 2026-07-05
36
+
37
+ ### Pipeline Task State & Error Propagation Fixes [WP-25]
38
+
39
+ **Status**: CLOSED
40
+ **Baseline**: bf70639 (v1.0.0)
41
+ **Gate 3**: PASS
42
+
43
+ #### Fixed
44
+
45
+ - **Defect #1 — Task state initialization on resume** — `resumePipeline()` now creates a task state entry via `taskState.create()` before calling `executePipeline()`. Without this, all task state transitions during the resumed pipeline silently failed (returned `null`) because `TaskStateManager.get()` returned `undefined` for unknown session keys. (`src/dispatch-service.ts:resumePipeline()`)
46
+ - **Defect #2 — Pipeline failure error propagation** — `executePipeline()` now captures the per-stage error message (`result.error`) when a stage fails, and includes it in both the returned `DispatchResult.error` string and the `pipelineCheckpoint.fail()` reason. Previously, the error said "Pipeline failed at stage N" with no indication of what went wrong. (`src/dispatch-service.ts:executePipeline()`)
47
+ - **Pipeline mode for executeStage()** — Added `pipelineMode` parameter (default `false`) to `executeStage()`. When `true`, all 5 task state transitions inside executeStage are skipped, and the pipeline loop manages state directly. This prevents `executeStage()` from transitioning to `"completed"` (a terminal state) after each stage, which blocked subsequent stages from transitioning to `"running"`. (`src/dispatch-service.ts:executeStage()`)
48
+
49
+ #### Changed
50
+
51
+ - **`executeStage()` signature** — Extended with optional `pipelineMode` parameter (6th param, default `false`). Public API unchanged; existing callers unaffected. (`src/dispatch-service.ts`)
52
+ - **`executePipeline()` call site** — Passes `pipelineMode: true` to `executeStage()` for all pipeline stage executions. (`src/dispatch-service.ts`)
53
+
54
+ #### Design
55
+
56
+ - **Minimal diff** — 3 targeted changes in a single file. No new modules, no interface changes, no dependency additions.
57
+ - **Backward compatible** — `pipelineMode` defaults to `false`, preserving existing standalone dispatch behavior.
58
+ - **Root cause** — `executeStage()` was shared between standalone and pipeline contexts. Terminal task state transitions (`completed`) in pipeline context blocked the pipeline loop's state management.
59
+
60
+ #### Verification
61
+
62
+ - `npx tsc --noEmit` — zero TypeScript errors
63
+ - `npx vitest run` — 351 tests pass (23 files), zero failures
64
+ - B3 re-validation: Q3 and Q6 now PASS (were FAIL). Q1, Q2, Q4, Q5, Q7 unchanged (no regression).
65
+ - Full verification checklist: 8/8 PASS
66
+
67
+ ---
68
+
69
+ ## [1.14.0] - 2026-07-05
70
+
71
+ ### Distributed Foundation [WP-24]
72
+
73
+ **Status**: CLOSED
74
+ **Baseline**: bf70639 (v1.0.0)
75
+ **Gate 3**: PASS
76
+
77
+ #### Added
78
+
79
+ - **RedisQueueBackend** — Redis-backed QueueBackend implementation using hashes + sets. All methods async, returns `Promise<T>`. (`src/redis-queue-backend.ts`)
80
+ - **RedisLeaseProvider** — Redis-backed LeaseProvider using SET NX EX for atomic acquire with TTL. Ownership validation on renew/release. (`src/redis-lease-provider.ts`)
81
+ - **Promise-only backend interfaces** — All `QueueBackend` and `LeaseProvider` methods return `Promise<T>`. No union types. (`src/queue-backend.ts`, `src/lease-provider.ts`)
82
+ - **Memory implementations with `Promise.resolve()`** — MemoryQueueBackend, MemoryLeaseProvider, FileQueueBackend wrap sync logic in `Promise.resolve()`. (`src/memory-queue-backend.ts`, `src/memory-lease-provider.ts`, `src/file-queue-backend.ts`)
83
+ - **Optional Redis activation** — Redis enables via `AI_COMPANY_REDIS_URL` env var or `config.redis.url`. Falls back to memory on failure. (`src/index.ts`)
84
+ - **Node identity resolution** — `nodeId` resolved from `config.nodeId` or `os.hostname()` at startup. (`src/index.ts`)
85
+ - **Redis backend tests** — 29 tests covering RedisQueueBackend, RedisLeaseProvider, nodeId resolution, activation, fallback. (`src/redis-backends.test.ts`)
86
+
87
+ #### Changed
88
+
89
+ - **QueueBackend interface** — All methods return `Promise<T>` (was sync or union types). (`src/queue-backend.ts`)
90
+ - **LeaseProvider interface** — All methods return `Promise<T>` (was sync or union types). (`src/lease-provider.ts`)
91
+ - **DecisionQueue** — All methods `async`, uses `await` for backend calls. (`src/decision-queue.ts`)
92
+ - **DispatchService** — Constructor accepts `leaseProvider` and `nodeId`. Lease operations use `this.nodeId`. (`src/dispatch-service.ts`)
93
+ - **Composition root** — Memory remains default. Redis activates when configured. Fallback on failure. (`src/index.ts`)
94
+ - **All consumers** — CLI, Gateway, Agent Tools use `async/await` consistently. (`src/cli.ts`, `src/gateway.ts`, `src/tools.ts`)
95
+ - **All test files** — Updated to use `async/await` for Promise-returning methods.
96
+
97
+ #### Design
98
+
99
+ - **Promise-only** — No union return types, no sync adapters, no fire-and-forget.
100
+ - **Optional Redis** — Zero-config default (memory). Redis activates only when configured.
101
+ - **Graceful fallback** — Redis connection failure falls back to memory mode at startup.
102
+ - **Node identity** — Resolved once at startup. Not persisted. Not registered.
103
+ - **No scope expansion** — No Pub/Sub, heartbeat, leader election, distributed metrics, cluster management.
104
+
105
+ #### Verification
106
+
107
+ - `npx tsc --noEmit` — zero TypeScript errors
108
+ - `npx vitest run` — 351 tests pass (23 files), zero failures
109
+ - Zero regressions. All existing behavior unchanged.
110
+
111
+ ---
112
+
113
+ ## [1.13.0] - 2026-07-04
114
+
115
+ ### OpenClaw Identity Integration [WP-23]
116
+
117
+ **Status**: CLOSED
118
+ **Baseline**: bf70639 (v1.0.0)
119
+ **Gate 3**: PASS
120
+
121
+ #### Added
122
+
123
+ - **Verified operator identity for gateway approvals** — Gateway `approve` and `reject` handlers now resolve operator identity from SDK-provided `client` parameter. Resolution order: `client.connect.client.displayName` → `client.connId` → `params.operator` (fallback). (`src/gateway.ts`)
124
+ - **`resolveOperator()` helper** — Private function implementing the fallback chain. (`src/gateway.ts`)
125
+ - **Identity resolution tests** — 5 tests covering: displayName priority, connId fallback, null client fallback, no identity fallback, reject handler. (`src/gateway.test.ts`)
126
+
127
+ #### Changed
128
+
129
+ - **Gateway `approve` handler** — Destructures `client` from handler options. (`src/gateway.ts`)
130
+ - **Gateway `reject` handler** — Same identity resolution as approve. (`src/gateway.ts`)
131
+
132
+ #### Design
133
+
134
+ - **SDK-first** — Uses OpenClaw verified identity model. No plugin-level auth or RBAC.
135
+ - **Backward compatible** — Falls back to self-reported `params.operator` when client is null or lacks identity.
136
+ - **Audit propagation** — Verified identity flows through existing DecisionQueue → EventEmitter → AuditLogger pipeline unchanged.
137
+
138
+ #### Verification
139
+
140
+ - Build: `tsc --noEmit` clean
141
+ - Tests: 322 passed (22 files)
142
+ - No scope, API, or interface changes
143
+
144
+ ## [1.12.0] - 2026-07-04
145
+
146
+ ### Operator-Assisted Pipeline Resume [WP-22]
147
+
148
+ **Status**: CLOSED
149
+ **Baseline**: bf70639 (v1.0.0)
150
+ **Gate 3**: PASS
151
+
152
+ #### Added
153
+
154
+ - **`resumePipeline()` method** — Resumes an interrupted pipeline from its last checkpoint. Reconstructs `StagePlan[]` from checkpoint stages, slices at `currentStageIndex`, restores execution history, and delegates to `executePipeline()`. Preserves original objective. (`src/dispatch-service.ts`)
155
+ - **`recover --resume` option** — CLI command `openclaw ai-company recover --resume <sessionKey>` resumes an interrupted pipeline from checkpoint. Validates checkpoint exists, calls `resumePipeline()`, outputs result. (`src/cli.ts`)
156
+ - **Startup `awaiting_approval` re-enqueue** — On startup, `awaiting_approval` checkpoints are re-enqueued into `DecisionQueue` if not already present. Operators see pending approvals without re-dispatching. (`src/index.ts`)
157
+ - **Pipeline resume tests** — 5 new tests covering: resume from checkpoint skipping completed stages, history preservation, missing worker error, missing dispatcher error, existing dispatch path unchanged. (`src/dispatch-service.test.ts`)
158
+
159
+ #### Changed
160
+
161
+ - **`executePipeline()` signature** — Extended with optional `resumeHistory` parameter for injecting restored stage history. (`src/dispatch-service.ts`)
162
+ - **`AiCompanyCliDeps.dispatchService`** — Pick type extended with `resumePipeline`. (`src/cli.ts`)
163
+
164
+ #### Design
165
+
166
+ - **Operator-assisted** — No automatic resume. Operator explicitly triggers via `recover --resume`.
167
+ - **Stage idempotency** — All 6 pipeline stages are safe to re-execute. `subagent.run()` uses `deliver: false` and produces only text output. New `runId` each call.
168
+ - **History restoration** — Completed stage outputs restored from `checkpoint.history[]`. New stages append to restored history.
169
+ - **Lease lifecycle** — Resume acquires/releases lease identically to normal dispatch through `executePipeline()`.
170
+ - **Audit** — Single `pipeline_started` event emitted by `executePipeline()`. No duplicate events.
171
+
172
+ #### Verification
173
+
174
+ - `npx tsc --noEmit` — zero TypeScript errors
175
+ - `npx vitest run` — 320 tests pass (22 files), zero failures
176
+ - Zero regressions. All existing behavior unchanged
177
+
178
+ ---
179
+
180
+ ## [1.11.0] - 2026-07-04
181
+
182
+ ### Queue Backend Abstraction [WP-21]
183
+
184
+ **Status**: CLOSED
185
+ **Baseline**: bf70639 (v1.0.0)
186
+ **Gate 3**: PASS
187
+
188
+ #### Added
189
+
190
+ - **QueueBackend interface** — Abstracts storage for DecisionQueue. Operations: `enqueue`, `get`, `list`, `update`, `remove`, `load`, `save`, `trySave`, `cleanup`. (`src/queue-backend.ts`)
191
+ - **QueueEntry, QueueEvent, QueueEntryUpdate types** — Shared data types for queue operations. (`src/queue-backend.ts`)
192
+ - **MemoryQueueBackend** — Default in-memory QueueBackend implementation. Map-based storage with JSON file persistence and atomic write (.tmp + rename). (`src/memory-queue-backend.ts`)
193
+ - **FileQueueBackend** — JSON file-backed QueueBackend implementation. Same semantics as MemoryQueueBackend, distinct class for future differentiation. (`src/file-queue-backend.ts`)
194
+ - **LeaseProvider interface** — Abstracts ownership leasing for pipeline execution. Operations: `acquire`, `renew`, `release`, `get`, `cleanup`. (`src/lease-provider.ts`)
195
+ - **Lease type** — Lease record with `sessionKey`, `nodeId`, `acquiredAt`, `expiresAt`. (`src/lease-provider.ts`)
196
+ - **MemoryLeaseProvider** — Default in-memory LeaseProvider with TTL expiration and ownership validation. (`src/memory-lease-provider.ts`)
197
+ - **Lease lifecycle in DispatchService** — `acquire()` at pipeline start, `release()` on success/failure/rejection. Audit events emitted on failure. (`src/dispatch-service.ts`)
198
+ - **Audit events** — `lease_acquire_failed` and `lease_release_failed` for lease lifecycle observability. (`src/audit-logger.ts`)
199
+
200
+ #### Changed
201
+
202
+ - **DecisionQueue** — Delegates storage to QueueBackend. Constructor: `(metrics?, backend?)`. Default backend: MemoryQueueBackend. EventEmitter preserved. (`src/decision-queue.ts`)
203
+ - **DecisionEntry** — Now a type alias for QueueEntry (backward compatible). (`src/decision-queue.ts`)
204
+ - **DecisionEvent** — Now a type alias for QueueEvent (backward compatible). (`src/decision-queue.ts`)
205
+ - **DispatchService** — Added optional `leaseProvider` constructor parameter. (`src/dispatch-service.ts`)
206
+ - **Composition root** — Instantiates MemoryQueueBackend, MemoryLeaseProvider and injects through constructors. (`src/index.ts`)
207
+
208
+ #### Preserved
209
+
210
+ - All existing DecisionQueue public APIs unchanged
211
+ - All existing PipelineCheckpoint behavior unchanged (WP-20 implementation restored)
212
+ - FCFS semantics preserved
213
+ - EventEmitter event behavior preserved
214
+ - Persistence behavior preserved
215
+ - No external dependencies added
216
+ - No Redis, PostgreSQL, SQLite, or distributed networking
217
+
218
+ #### Verification
219
+
220
+ - `npx tsc --noEmit` — zero TypeScript errors
221
+ - `npx vitest run` — 315 tests pass (22 files), zero failures
222
+ - Zero regressions. All external behavior unchanged
223
+
224
+ ---
225
+
226
+ ## [1.10.0] - 2026-07-04
227
+
228
+ ### Pipeline Checkpoint [WP-20]
229
+
230
+ **Status**: CLOSED
231
+ **Baseline**: bf70639 (v1.0.0)
232
+
233
+ #### Note
234
+
235
+ WP-20 implementation was developed alongside WP-21 and restored as part of the Queue Backend Abstraction milestone. The PipelineCheckpoint module (`src/pipeline-checkpoint.ts`) provides stage-level crash recovery persistence with atomic JSON writes, following the same persistence pattern as DecisionQueue.
236
+
237
+ #### Added
238
+
239
+ - **`PipelineCheckpoint`** — Stage-level crash recovery persistence. Atomic JSON write. (`src/pipeline-checkpoint.ts`)
240
+ - **`PipelineCheckpointEntry` interface** — Typed checkpoint with sessionKey, objective, category, stage index, stage definitions, execution history, status, decidedBy, and timestamps. (`src/pipeline-checkpoint.ts`)
241
+ - **Checkpoint lifecycle** — `set()` after stage completion and approval acceptance, `fail()` on rejection/stage failure, `complete()` on pipeline success. (`src/dispatch-service.ts`)
242
+ - **Startup detection** — Loads persisted checkpoints, logs count of interrupted pipelines. (`src/index.ts`)
243
+ - **Startup cleanup** — `cleanup(24h)` removes stale `failed`/`completed` entries; preserves `running`/`awaiting_approval`. (`src/index.ts`)
244
+ - **`openclaw ai-company recover`** — CLI command listing interrupted pipelines with sessionKey, objective, category, stage progress, and timestamps. (`src/cli.ts`)
245
+ - **Lifecycle safeguard** — `pipelineCheckpoint.save()` on application shutdown. (`src/index.ts`)
246
+
247
+ #### Changed
248
+
249
+ - **`DispatchService`** — Constructor extended with optional `PipelineCheckpoint` parameter. `executePipeline()` writes checkpoints at approved boundaries. (`src/dispatch-service.ts`)
250
+ - **`AiCompanyCliDeps`** — Extended with optional `pipelineCheckpoint` property. (`src/cli.ts`)
251
+ - **Composition root** — PipelineCheckpoint instantiated, loaded, scanned, cleaned, and passed to DispatchService and CLI. (`src/index.ts`)
252
+
253
+ #### Verification
254
+
255
+ - `npx tsc --noEmit` — zero TypeScript errors.
256
+ - `npx vitest run` — 241 tests pass (18 suites), zero failures.
257
+ - Zero regressions. All external behavior unchanged.
258
+
259
+ ---
260
+
261
+ ## [1.9.0] - 2026-07-04
262
+
263
+ ### Multi-user Approval [WP-19]
264
+
265
+ **Status**: CLOSED
266
+ **Baseline**: bf70639 (v1.0.0)
267
+ **Gate 3**: PASS
268
+
269
+ #### Added
270
+
271
+ - **Operator attribution on approve/reject** — `DecisionEntry.operator?: string` and `DecisionEvent.operator?: string` store and emit the identity of the operator who made the decision. (`src/decision-queue.ts`)
272
+ - **`approve(sessionKey, operator?, reason?)`** — Extended signature accepts optional operator parameter. Stores `entry.operator` and includes operator in emitted event. (`src/decision-queue.ts`)
273
+ - **`reject(sessionKey, operator?, reason?)`** — Extended signature accepts optional operator parameter. Stores `entry.operator` and includes operator in emitted event. (`src/decision-queue.ts`)
274
+ - **Gateway operator support** — `ai-company.approve` and `ai-company.reject` accept optional `operator` parameter and pass it to DecisionQueue. (`src/gateway.ts`)
275
+ - **CLI `--operator` flag** — `approve` and `reject` commands accept `--operator <name>` option. (`src/cli.ts`)
276
+ - **Agent tool operator parameter** — `ai_company_approve` and `ai_company_reject` tool schemas extended with optional `operator` field. (`src/tools.ts`)
277
+ - **AuditLogger `operator` field** — `AuditEvent.operator?: string` records operator identity on approved/rejected events. (`src/audit-logger.ts`)
278
+ - **PipelineCheckpoint `decidedBy` field** — `PipelineCheckpointEntry.decidedBy?: string` records which operator made the approval decision. (`src/pipeline-checkpoint.ts`)
279
+ - **Audit event forwarding** — DecisionQueue decision events forwarded to AuditLogger with operator. (`src/index.ts`)
280
+ - **DispatchService operator propagation** — `waitForDecision()` return type includes `operator`; propagated to checkpoint writes. (`src/dispatch-service.ts`)
281
+
282
+ #### Changed
283
+
284
+ - **`DecisionEntry`** — Added `operator?: string` field. (`src/decision-queue.ts`)
285
+ - **`DecisionEvent`** — Added `operator?: string` field. (`src/decision-queue.ts`)
286
+ - **`AuditEvent`** — Added `operator?: string` field. (`src/audit-logger.ts`)
287
+ - **`PipelineCheckpointEntry`** — Added `decidedBy?: string` field. (`src/pipeline-checkpoint.ts`)
288
+ - **`DispatchService.waitForDecision()`** — Return type extended with `operator?: string`. (`src/dispatch-service.ts`)
289
+
290
+ #### Preserved
291
+
292
+ - FCFS semantics: first decision wins, `null` returned for already-decided entries
293
+ - All existing API response contracts unchanged
294
+ - No new response statuses or response fields
295
+ - Existing test patterns preserved
296
+
297
+ #### Verification
298
+
299
+ - `npx tsc --noEmit` — zero TypeScript errors.
300
+ - `npx vitest run` — 254 tests pass (18 suites), zero failures.
301
+ - Zero regressions. All external behavior unchanged. Operator is purely additive (`?: string`).
302
+
303
+ ---
304
+
305
+ ## [1.8.0] - 2026-07-04
306
+
307
+ ### Runtime Recovery [WP-18]
308
+
309
+ **Status**: CLOSED
310
+ **Baseline**: bf70639 (v1.0.0)
311
+ **Gate 3**: PASS
312
+
313
+ #### Added
314
+
315
+ - **`PipelineCheckpoint`** — Stage-level crash recovery persistence. Atomic JSON write, follows DecisionQueue pattern. (`src/pipeline-checkpoint.ts`)
316
+ - **`PipelineCheckpointEntry` interface** — Typed checkpoint with sessionKey, objective, category, stage index, stage definitions, execution history, status, and timestamps. (`src/pipeline-checkpoint.ts`)
317
+ - **Checkpoint write after stage completion** — After `history.push()` and `stage_completed` audit event. (`src/dispatch-service.ts`)
318
+ - **Checkpoint write after approval acceptance** — After `decisionQueue.remove()` and `taskState.transition("running")`. (`src/dispatch-service.ts`)
319
+ - **Checkpoint `.fail()` on rejection** — Pipeline rejection persists failure reason. (`src/dispatch-service.ts`)
320
+ - **Checkpoint `.fail()` on stage failure** — Pipeline stage failure persists error. (`src/dispatch-service.ts`)
321
+ - **Checkpoint `.complete()` on pipeline success** — Removes checkpoint from persistence. (`src/dispatch-service.ts`)
322
+ - **Startup detection** — Loads persisted checkpoints, logs count of interrupted pipelines. (`src/index.ts`)
323
+ - **Startup cleanup** — `cleanup(24h)` removes stale `failed`/`completed` entries; preserves `running`/`awaiting_approval`. (`src/index.ts`)
324
+ - **`openclaw ai-company recover`** — CLI command listing interrupted pipelines with sessionKey, objective, category, stage progress, and timestamps. (`src/cli.ts`)
325
+ - **Lifecycle safeguard** — `pipelineCheckpoint.save()` on application shutdown alongside `decisionQueue.save()`. (`src/index.ts`)
326
+
327
+ #### Changed
328
+
329
+ - **`DispatchService`** — Constructor extended with optional `PipelineCheckpoint` parameter (12th param). `executePipeline()` writes checkpoints at approved boundaries. (`src/dispatch-service.ts`)
330
+ - **`AiCompanyCliDeps`** — Extended with optional `pipelineCheckpoint` property. (`src/cli.ts`)
331
+ - **Composition root** — PipelineCheckpoint instantiated, loaded, scanned, cleaned, and passed to DispatchService and CLI. (`src/index.ts`)
332
+
333
+ #### Verification
334
+
335
+ - `npx tsc --noEmit` — zero TypeScript errors.
336
+ - `npx vitest run` — 241 tests pass (18 suites), zero failures.
337
+ - Zero regressions. All external behavior unchanged. PipelineCheckpoint is optional dependency (`?.` calls).
338
+
339
+ ---
340
+
341
+ ## [1.7.0] - 2026-07-04
342
+
343
+ ### Technical Debt Resolution [WP-17]
344
+
345
+ **Status**: CLOSED
346
+ **Baseline**: bf70639 (v1.0.0)
347
+
348
+ #### Added
349
+
350
+ - **TaskState transition validation** — `VALID_TRANSITIONS` map enforces state machine. Invalid transitions return `null` instead of silently allowing. (`src/task-state.ts`)
351
+ - **Approval timeout** — Configurable `approvalTimeoutMs` (default 30 min) prevents pipeline hangs. Timeout returns `approval_timeout` reason. (`src/dispatch-service.ts`)
352
+ - **DecisionQueue startup cleanup** — `cleanup(maxAgeMs)` removes expired pending entries on startup. Sequence: `load()` → `cleanup(24h)` → `save()`. No events emitted, no audit generated, no task state transitions. (`src/decision-queue.ts`, `src/index.ts`)
353
+ - **Audit retention** — `cleanup(maxAgeDays)` removes old JSONL files (default 30 days). Silent I/O failure handling. (`src/audit-logger.ts`)
354
+ - **Audit query CLI** — `openclaw ai-company audit` command with filters: `--session`, `--event`, `--source`, `--from`, `--to`. Skips malformed JSONL lines. CLI-only, no Gateway RPC. (`src/cli.ts`, `src/audit-logger.ts`)
355
+ - **Legacy test cleanup** — Moved 4 unique tests from `src/__tests__/` to `src/`. Deleted 16 broken duplicate test files. All imports corrected.
356
+
357
+ #### Changed
358
+
359
+ - **TaskStateManager** — `transition()` now validates against `VALID_TRANSITIONS` map. Invalid transitions return `null`. Valid transitions unchanged. (`src/task-state.ts`)
360
+ - **DispatchService** — Constructor extended with `approvalTimeoutMs` parameter (11th param). `waitForDecision()` uses `Promise.race` with timeout. (`src/dispatch-service.ts`)
361
+ - **AuditLogger** — Extended with `cleanup(maxAgeDays)` and `query(filter)` methods. (`src/audit-logger.ts`)
362
+ - **CLI** — `AiCompanyCliDeps` extended with optional `auditLogger`. New `audit` subcommand. (`src/cli.ts`)
363
+ - **Composition root** — DecisionQueue startup cleanup wired. AuditLogger passed to CLI registration. (`src/index.ts`)
364
+
365
+ #### Verification
366
+
367
+ - `npx tsc --noEmit` — zero TypeScript errors.
368
+ - `npx vitest run` — 241 tests pass (18 suites).
369
+ - Zero regressions. All external behavior unchanged.
370
+
371
+ ---
372
+
373
+ ## [1.6.0] - 2026-07-04
374
+
375
+ ### Audit Logging [WP-16]
376
+
377
+ **Status**: CLOSED
378
+ **Baseline**: bf70639 (v1.0.0)
379
+
380
+ #### Added
381
+
382
+ - **`AuditLogger`** — Append-only JSONL writer with silent I/O failure handling. Writes to `.openclaw/audit/audit-YYYY-MM-DD.jsonl`. (`src/audit-logger.ts`)
383
+ - **`AuditEvent` interface** — Typed audit event with common fields (ts, sessionKey, event) and optional context fields (source, worker, stage, decisionStatus, reason, etc.). (`src/audit-logger.ts`)
384
+ - **`AuditEventType` union** — 13 approved event types: dispatch_requested, plan_created, task_created, pipeline_started, stage_started, approval_requested, approved, rejected, stage_completed, stage_failed, pipeline_completed, pipeline_failed, dispatch_completed. (`src/audit-logger.ts`)
385
+ - **`DispatchSource` type** — Source tagging enum: gateway, cli, tool, command. (`src/audit-logger.ts`)
386
+ - **DispatchService instrumentation** — Optional `auditLogger` constructor parameter. Writes audit events at all approved lifecycle points. (`src/dispatch-service.ts`)
387
+ - **Source tagging** — Optional `source` parameter on `dispatch()` method. Entry points pass source: gateway, cli, tool, command. (`src/dispatch-service.ts`, `src/gateway.ts`, `src/cli.ts`, `src/tools.ts`, `src/commands/aicompany.ts`)
388
+ - **DecisionQueue event subscription** — Composition root subscribes to DecisionQueue "decision" event. Writes approved/rejected audit events. (`src/index.ts`)
389
+ - **Audit logger tests** — 8 new tests covering: valid JSON, append behavior, JSONL parsing, directory creation, silent failure, field round-trip, date-based filename, all event types. Total: 236 tests.
390
+
391
+ #### Changed
392
+
393
+ - **`DispatchService`** — Extended with optional `auditLogger` constructor parameter (10th param). `dispatch()` method accepts optional `source` parameter (3rd arg). (`src/dispatch-service.ts`)
394
+ - **Composition root** — `AuditLogger` instantiated at `.openclaw/audit`. Passed to `DispatchService`. DecisionQueue event subscription wired. (`src/index.ts`)
395
+ - **Entry points** — Gateway, CLI, Tools, Command now pass `source` parameter to `dispatch()`. (`src/gateway.ts`, `src/cli.ts`, `src/tools.ts`, `src/commands/aicompany.ts`)
396
+ - **Test assertions** — Fixed 5 test assertions in `cli.test.ts`, `tools.test.ts`, `commands/aicompany.test.ts` to expect 3-arg `dispatch()` calls.
397
+
398
+ #### Verification
399
+
400
+ - `npx tsc --noEmit` — zero TypeScript errors.
401
+ - `npx vitest run` — 236 tests pass. 11 pre-existing `src/__tests__/` failures unrelated to WP-16.
402
+ - Zero regressions. All external behavior unchanged.
403
+
404
+ ---
405
+
406
+ ## [1.5.0] - 2026-07-04
407
+
408
+ ### DecisionQueue Persistence [WP-15]
409
+
410
+ **Status**: CLOSED
411
+ **Baseline**: bf70639 (v1.0.0)
412
+
413
+ #### Added
414
+
415
+ - **`DecisionQueue.load(filePath)`** — Instance method that hydrates pending entries from a JSON file. No-op on missing or corrupt file. (`src/decision-queue.ts`)
416
+ - **`DecisionQueue.save(filePath?)`** — Instance method that persists pending entries to a JSON file using atomic write (`.tmp` + `rename`). No-op if no file path configured. (`src/decision-queue.ts`)
417
+ - **Automatic persistence** — `enqueue()`, `approve()`, `reject()`, and `remove()` now auto-save after every mutation. (`src/decision-queue.ts`)
418
+ - **Persistence store path** — `rootDir/.openclaw/decisions.json`. (`src/index.ts`)
419
+ - **Lifecycle safeguard** — Best-effort `save()` on application shutdown. (`src/index.ts`)
420
+ - **Persistence tests** — 11 new tests covering: save/load round-trip, non-pending exclusion, missing file, corrupt JSON, auto-save after all mutations, no-op without path, parent directory creation. Total: 228 tests.
421
+
422
+ #### Changed
423
+
424
+ - **`DecisionQueue`** — Extended with `filePath` private field, `load()`, `save()`, and `trySave()` methods. Constructor signature unchanged. (`src/decision-queue.ts`)
425
+ - **Composition root** — `DecisionQueue` constructed then loaded from persistence path. Lifecycle cleanup calls `save()`. (`src/index.ts`)
426
+
427
+ #### Verification
428
+
429
+ - `npx tsc --noEmit` — zero TypeScript errors.
430
+ - `npx vitest run` — 228 tests pass. 11 pre-existing `src/__tests__/` failures unrelated to WP-15.
431
+ - Zero regressions. All external behavior unchanged.
432
+
433
+ ---
434
+
435
+ ## [1.4.0] - 2026-07-04
436
+
437
+ ### Gateway RPC [WP-14]
438
+
439
+ **Status**: CLOSED
440
+ **Baseline**: bf70639 (v1.0.0)
441
+
442
+ #### Added
443
+
444
+ - **`ai-company.list_approvals`** — Gateway method (scope: `operator.read`) listing pending approval requests. Returns count and entry list. (`src/gateway.ts`)
445
+ - **`ai-company.approve`** — Gateway method (scope: `operator.write`) approving a pending task by sessionKey. Optional `reason` parameter. Returns `not_found` for unknown/already-decided entries. (`src/gateway.ts`)
446
+ - **`ai-company.reject`** — Gateway method (scope: `operator.write`) rejecting a pending task by sessionKey. Optional `reason` parameter. Returns `not_found` for unknown/already-decided entries. (`src/gateway.ts`)
447
+ - **Gateway tests** — 9 new tests in `src/__tests__/gateway.test.ts` covering list_approvals, approve, reject, missing parameters, and unknown sessions. Total: 217 tests.
448
+
449
+ #### Changed
450
+
451
+ - **`AiCompanyGatewayDeps`** — Extended with optional `decisionQueue` property. (`src/gateway.ts`)
452
+ - **Composition root** — DecisionQueue wired into Gateway registration. (`src/index.ts`)
453
+
454
+ #### Verification
455
+
456
+ - `npx tsc --noEmit` — zero TypeScript errors.
457
+ - `npx vitest run` — 217 tests pass. 12 pre-existing `src/__tests__/` failures unrelated to WP-14.
458
+ - Zero regressions. External behavior unchanged.
459
+
460
+ ---
461
+
462
+ ## [1.3.0] - 2026-07-04
463
+
464
+ ### Event-driven DecisionQueue [WP-13]
465
+
466
+ **Status**: CLOSED
467
+ **Baseline**: bf70639 (v1.0.0)
468
+
469
+ #### Changed
470
+
471
+ - **DecisionQueue** — Extended with Node.js `EventEmitter`. Emits `"decision"` event when `approve()` or `reject()` is called. (`src/decision-queue.ts`)
472
+ - **DecisionEvent interface** — New exported type: `{sessionKey, status, reason}`. (`src/decision-queue.ts`)
473
+ - **DispatchService.waitForDecision()** — Replaced 500ms polling loop with event-driven Promise. Listens for `"decision"` event filtered by sessionKey. Removes listener after resolution. Race-condition guard checks existing status before listening. (`src/dispatch-service.ts`)
474
+
475
+ #### Added
476
+
477
+ - **Event emission tests** — 4 new tests in `decision-queue.test.ts` covering approve event, reject event, and idempotency guards.
478
+
479
+ #### Removed
480
+
481
+ - **Polling loop** — `while(true)` + `setTimeout(500)` polling in `waitForDecision()` eliminated.
482
+
483
+ #### Verification
484
+
485
+ - `npx tsc --noEmit` — zero TypeScript errors.
486
+ - `npx vitest run` — 199 tests pass. 12 pre-existing `src/__tests__/` failures unrelated to WP-13.
487
+ - Zero regressions. External behavior unchanged.
488
+
489
+ ---
490
+
491
+ ## [1.2.0] - 2026-07-04
492
+
493
+ ### Production Validation [WP-12]
494
+
495
+ **Status**: CLOSED
496
+ **Baseline**: bf70639 (v1.0.0)
497
+ **Validation Result**: PARTIAL PASS
498
+
499
+ #### Validated
500
+
501
+ - **Level 1 — Static Validation** — Build passes with zero errors. Typecheck passes. 195 tests pass across 17 executable test suites.
502
+ - **Level 2 — Integration Validation** — All components validated: Dispatcher (classification + worker selection), Pipeline (6 stages), DecisionQueue (6 operations), TaskStateManager (6 states), CLI (6 subcommands), Agent Tools (6 tools), Worker Health (10 workers).
503
+ - **Level 3 — Runtime Validation** — BLOCKED. Runtime environment (OpenClaw instance) not available. Deferred until runtime is provided.
504
+
505
+ #### Verification
506
+
507
+ - Phase 3 verification completed. All evidence verified against repository state.
508
+ - No implementation occurred during validation.
509
+ - No architecture changes introduced.
510
+ - No scope expansion.
511
+
512
+ #### Documentation
513
+
514
+ - CHANGELOG updated with Production Validation results.
515
+ - CHECKPOINT updated with validation status.
516
+ - Technical notes documented in docs/WP-12-PRODUCTION-VALIDATION.md.
517
+
518
+ ---
519
+
520
+ ## [1.1.0] - 2026-07-04
521
+
522
+ ### Human-in-the-Loop Approval [WP-11]
523
+
524
+ **Status**: CLOSED
525
+ **Baseline**: bf70639 (v1.0.0)
526
+
527
+ #### Added
528
+
529
+ - **DecisionQueue** — In-memory queue for operator approval decisions. Supports enqueue, approve, reject, get, list, and remove operations. (`src/decision-queue.ts`)
530
+ - **Approval Gate** — Pipeline stages following the approval gate (after VERIFY) pause for operator approval when `requiresApproval` is set on the StagePlan. (`src/dispatch-service.ts`)
531
+ - **StagePlan.requiresApproval** — Boolean flag on StagePlan indicating whether a stage requires operator approval before execution. Set by Dispatcher when the task category has an approval gate defined in ROUTING.md. (`src/dispatcher.ts`)
532
+ - **`awaiting_approval` task state** — New task state between `running` and `completed`/`failed`. Task transitions to this state while waiting for operator decision. (`src/task-state.ts`)
533
+ - **CLI approval commands** — `openclaw ai-company approvals` (list pending), `openclaw ai-company approve <sessionKey>`, `openclaw ai-company reject <sessionKey>`. (`src/cli.ts`)
534
+ - **Agent approval tools** — `ai_company_approve`, `ai_company_reject`, `ai_company_list_approvals` for operator-facing approval via agent interface. (`src/tools.ts`)
535
+ - **ROUTING.md approval gates** — Policy section defining which task types require operator approval after which stage. Currently: `engineering` and `security_review` require approval after VERIFY. (`assets/workers/dispatcher/ROUTING.md`)
536
+ - **`decision-queue.test.ts`** — 9 unit tests covering full DecisionQueue lifecycle.
537
+ - **`dispatcher-approval.test.ts`** — 3 tests covering approval gate classification and StagePlan flag.
538
+
539
+ #### Changed
540
+
541
+ - `Dispatcher.classify()` — `add`, `implement`, `feature`, `build` keywords now classify as `engineering` (unified with existing engineering classification). `security_review` remains a distinct classification for security-related keywords.
542
+ - `Dispatcher.createPlan()` — Iterates pipeline stages and sets `requiresApproval: true` on stages following the approval gate.
543
+ - `DispatchService` constructor — Accepts optional `DecisionQueue` dependency.
544
+ - `DispatchService.executePipeline()` — Checks `stagePlan.requiresApproval` before each stage; if set, transitions task to `awaiting_approval`, enqueues decision, and waits for operator response.
545
+ - `index.ts` — Wires DecisionQueue into DispatchService, CLI, and agent tools.
546
+ - `cli.ts` — `AiCompanyCliDeps` interface extended with optional `DecisionQueue`.
547
+ - `tools.ts` — `AiCompanyToolsDeps` interface extended with optional `DecisionQueue`.
548
+
549
+ #### Deferred
550
+
551
+ - ~~Event-driven decision notification~~ **COMPLETE (WP-13, v1.3.0)**
552
+ - ~~Gateway RPC for approval operations~~ **COMPLETE (WP-14, v1.4.0)**
553
+ - Persistence for DecisionQueue
554
+ - Timeout/expiration for pending approvals
555
+ - Audit logging
556
+ - Multi-user approval
557
+
558
+ #### Verification
559
+
560
+ - `npx tsc` — zero TypeScript errors.
561
+ - `npx vitest run` — 195 tests pass (17 suites). 12 pre-existing `src/__tests__/` failures unrelated to WP-11.
562
+ - Zero regressions in existing functionality.
563
+
564
+ ---
565
+
566
+ ## [1.0.1] - 2026-07-04
567
+
568
+ ### Pipeline Execution & UX Polish
569
+
570
+ **Status**: CLOSED
571
+ **Baseline**: bf70639 (v1.0.0)
572
+
573
+ #### Fixed
574
+
575
+ - **Multi-stage pipeline execution** [WP-10] — `DispatchService` now executes all 6 pipeline stages (INTAKE → UNDERSTAND → PLAN → BUILD → VERIFY → SHIP) instead of only `plan.stages[0]`.
576
+ - **Context accumulation** [WP-10] — Each stage receives the original task plus full output history of all preceding stages. `buildStageMessage()` constructs structured context with original task, pipeline history, current stage, and worker assignment.
577
+ - **Pipeline failure handling** [WP-10] — Stages that error or timeout abort the pipeline immediately with proper error propagation and duration reporting.
578
+ - **Task state machine** [WP-10] — `executeStage()` now transitions task state through `submitted → completed | failed` for both single-stage and pipeline paths. Previously state was never advanced beyond `created`.
579
+
580
+ #### Changed
581
+
582
+ - **UX output format** [WP-9] — `/aicompany` slash command displays company branding (`🏢 AI Engineering Company`), capitalized task, "Assigned To" with worker name, status label, duration, error details, and worker response with separator.
583
+ - **Command handler DI** [WP-9] — `handleAiCompanyCommand()` accepts optional `dispatcher` dependency for routing display. Backward-compatible degraded mode without dispatcher.
584
+ - **README.md** [WP-9] — Rewritten with Quick Start, `/aicompany` documentation, example output format, config options table.
585
+ - Pipeline execution forces `wait: true` for multi-stage runs (context chaining requires each stage's output).
586
+ - `executePipeline()` and `executeStage()` refactored to dedicated methods.
587
+
588
+ #### Added
589
+
590
+ - **`aicompany.test.ts`** [WP-9] — 8 tests covering dispatch formatting, error handling, whitespace trimming, degraded mode, capitalization.
591
+ - `buildStageMessage()`, `extractStageOutput()` — pipeline context assembly functions.
592
+
593
+ #### Verification
594
+
595
+ - `npm run build` — zero TypeScript errors.
596
+ - `npm test` — 101 tests pass (7 suites).
597
+ - `npm run typecheck` — clean.
598
+ - Single-stage dispatch unchanged (no regression).
599
+ - Pipeline dispatch executes all stages with accumulated context.
600
+
601
+ #### Historical Note
602
+
603
+ > During development, "WP-9.1" was temporarily used as an intermediate tracking label for UX and documentation improvements. Under the current engineering workflow, sub-work-packages are no longer used. WP-9.1 is therefore considered part of WP-9 and is not treated as an independent Work Package.
604
+
605
+ ---
606
+
607
+ ## [1.0.0] - 2026-07-04
608
+
609
+ ### OpenClaw Plugin Integration — COMPLETE
610
+
611
+ **Status**: CLOSED
612
+ **Architecture**: FROZEN (ADR-001)
613
+ **Baseline**: ad2e23c (v1.0.0)
614
+
615
+ #### Changed
616
+
617
+ - **Plugin SDK Migration** — Replaced `@openclaw/plugin-sdk` stub with official `openclaw` devDependency. Plugin consumes SDK via subpath exports.
618
+ - **Module Resolution** — TypeScript `module: "NodeNext"`, `moduleResolution: "NodeNext"`. All relative imports use `.js` extensions.
619
+ - **Build Configuration** — Added `rootDir: "./src"` to tsconfig. Output path fixed from `dist/src/` to `dist/`.
620
+ - **Gateway Error Handling** — All gateway error responses include required `code` property.
621
+ - **Session API Alignment** — `getSessionEntry` parameter aligned to `{ sessionKey }`.
622
+ - **Lifecycle Registration** — Uses `api.lifecycle.registerRuntimeLifecycle()`.
623
+
624
+ #### Fixed
625
+
626
+ - `AgentToolResult` import from `openclaw/plugin-sdk/agent-core`.
627
+ - Gateway error objects include `code` field (INVALID_PARAMS, INTERNAL_ERROR, DISPATCH_ERROR, STATUS_ERROR, RESULT_ERROR).
628
+ - `DispatchService.getSessionEntry` parameter corrected to `{ sessionKey }`.
629
+
630
+ #### Verification
631
+
632
+ - `npm run build` — zero TypeScript errors.
633
+ - `openclaw plugins build` — succeeds.
634
+ - `openclaw plugins validate` — valid.
635
+ - `openclaw plugins install --link` — installs successfully.
636
+ - Gateway loads plugin, lists in `openclaw plugins list` (enabled).
637
+ - 14 test suites pass, 175 tests pass.
638
+
639
+ #### Known Limitations (updated)
640
+
641
+ - ~~`@openclaw/plugin-sdk` not published to npm~~ **RESOLVED**.
642
+ - 12 pre-existing `src/__tests__/` failures (`.js` extension in Vitest, equivalent `src/` tests pass).
643
+
644
+ ---
645
+
646
+ ## [0.9.0] - 2026-07-03
647
+
648
+ ### Knowledge-Runtime Alignment Milestone — COMPLETE
649
+
650
+ **Status**: CLOSED
651
+ **Architecture**: FROZEN (ADR-001)
652
+ **Baseline**: ad2e23c (v0.8.0)
653
+
654
+ #### Added
655
+
656
+ - **WP-01: Office ID Normalization** — Removed `office_` prefix from office identifiers. Offices now use bare IDs: `product`, `engineering`, `governance`.
657
+ - **WP-02: Worker Config Generation** — Created `config.json` for all 10 workers. Schema: `{name, office, description, capabilities[], model}`.
658
+ - **WP-03: OrgEngine Extension** — Extended `OrgEngine` to load `organization.json` alongside `offices.json`. Added schemas for roles, workers, collaboration pairs, and escalation triggers.
659
+ - **WP-04: PromptAssembler** — New module (`src/prompt-assembler.ts`) that builds identity-aware prompts from SOUL.md + AGENTS.md + organizational context.
660
+ - **WP-05: DispatchService Prompt Injection** — Modified `DispatchService` to inject assembled prompts into `subagent.run()` calls.
661
+ - **WP-06: Classification Fixes** — Fixed `Dispatcher.classify()`: frontend keywords now route to `engineering` (was `product`), QA keywords now route to `engineering` (was `governance`). Updated `stageCapabilities` to match `organization.json` vocabulary.
662
+ - **ADR-001**: Knowledge-Runtime Alignment architecture decision record. 8 decisions, 6 principles.
663
+ - **Operational Validation**: 21 test scenarios across 8 categories. All pass. System verified against real data paths.
664
+
665
+ #### Fixed
666
+
667
+ - `WorkerConfigSchema.office` now allows `null` (accommodates dispatcher worker).
668
+ - Dispatcher classification misrouting (frontend→product, QA→governance) corrected.
669
+ - `stageCapabilities` strings aligned with `organization.json` vocabulary.
670
+
671
+ #### Changed
672
+
673
+ - `OrgEngine` constructor: `(configPath)` → `(configPath, orgPath?)`
674
+ - `DispatchService` constructor: added optional `orgEngine` and `workersDir` parameters
675
+ - `WorkerConfigSchema`: `office: z.string()` → `office: z.string().nullable()`
676
+
677
+ #### Tests
678
+
679
+ - 142 tests passing (13 new from milestone work)
680
+ - 21 operational validation scenarios passing
681
+
682
+ #### Known Limitations
683
+
684
+ - `@openclaw/plugin-sdk` not published to npm — requires local stub for testing
685
+ - 13 pre-existing test files in `src/__tests__/` have broken import paths (not caused by this milestone)
686
+ - Multi-phase orchestration deferred (ADR-001 D6)
687
+ - `policies.json` not loaded (no consumer)
688
+ - SOUL.md voice inconsistency (deferred)
689
+
690
+ ---
691
+
692
+ ## [0.3.0] - 2026-07-03
693
+
694
+ ### Added
695
+
696
+ - **WP-8: Organizational Execution** - Worker-aware delivery, org routing, pipeline planning
697
+ - WorkerEngine for worker discovery and capability matching
698
+ - OrgEngine for organizational structure and routing
699
+ - Pipeline planning for multi-stage task execution
700
+ - 141 tests passing (all work packages)
701
+
702
+ - **WP-7: Workflow Intelligence** - Worker validation, task state tracking, reliability fixes
703
+ - TaskStateManager for ephemeral runtime task lifecycle tracking
704
+ - Worker validation in DispatchService before dispatch
705
+ - Session key collision prevention with random suffix
706
+ - Workboard timeout guard (30s RPC call timeout)
707
+ - Worker identity configs for all 9 workers
708
+
709
+ - **WP-6: Workboard Integration** - Dual-path dispatch (workboard + fallback)
710
+ - WorkboardGateway for task card management
711
+ - Dual-path dispatch: workboard + direct execution
712
+ - 115 tests passing
713
+
714
+ - **WP-5: Production Hardening** - DispatchService consolidation, input validation
715
+ - Consolidated triplicated dispatch logic into single DispatchService
716
+ - Input validation for all entry points
717
+ - 92 tests passing
718
+
719
+ - **WP-4: Operator Interface** - CLI commands, agent tools, gateway RPC
720
+ - CLI commands for dispatch and management
721
+ - Agent tools for worker interaction
722
+ - Gateway RPC interface
723
+ - 43 tests passing
724
+
725
+ - **WP-3: Multi-Worker Orchestration** - BE → QA handoff, self-healing rework loop
726
+ - Backend Engineer → QA Engineer handoff
727
+ - Self-healing rework loop (FAIL → Dispatcher → BE → QA PASS)
728
+ - 12/12 verification criteria passing
729
+
730
+ - **WP-2: Single Worker Orchestration** - Dispatcher → Backend Engineer delegation
731
+ - Dispatcher orchestrates workers end-to-end
732
+ - Vertical slice test (8/8 criteria passing)
733
+
734
+ - **WP-1: Foundation** - OpenClaw gateway, 9Router model router, dispatcher agent, 9 worker workspaces
735
+ - 10 agents registered in OpenClaw
736
+ - 9Router integration with 3 model profiles (Opus, Sonnet, Haiku)
737
+ - Dispatcher configured to orchestrate all 9 workers
738
+ - All workspace files created (AGENTS.md, SOUL.md)
739
+
740
+ ### Changed
741
+
742
+ - **Repository Migration** - Standalone repository structure
743
+ - Migrated from `/home/tvd/office` to `/home/tvd/ai-engineering-company`
744
+ - Updated package.json: removed `workspace:*` dependency, added proper version constraints
745
+ - Expanded openclaw.plugin.json with compatibility and build information
746
+ - Comprehensive documentation archive (133 markdown files)
747
+
748
+ ---
749
+
750
+ ## [0.2.0] - 2026-06-30
751
+
752
+ ### Added
753
+
754
+ - **Gate 1: Architecture** - Architecture design and validation
755
+ - **Gate 2: Design** - Design review and approval
756
+ - **Integration Contract** - 9Router integration determined
757
+ - **Runtime Model Selection** - Behavior verified via source code analysis
758
+
759
+ ---
760
+
761
+ ## [0.1.0] - 2026-06-29
762
+
763
+ ### Added
764
+
765
+ - **Initial Project Setup** - Repository structure and configuration
766
+ - **Plugin Manifest** - openclaw.plugin.json definition
767
+ - **Build Configuration** - package.json, tsconfig.json
768
+ - **Documentation Structure** - docs/ directory organization
769
+
770
+ ---
771
+
772
+ ## Work Package Summary
773
+
774
+ | WP | Name | Version | Status | Tests | Date |
775
+ |----|------|---------|--------|-------|------|
776
+ | WP-1 | Foundation | 0.3.0 | ✅ COMPLETE | 7 | 2026-06-30 |
777
+ | WP-2 | Single Worker Orchestration | 0.3.0 | ✅ COMPLETE | 8/8 | 2026-07-01 |
778
+ | WP-3 | Multi-Worker Orchestration | 0.3.0 | ✅ COMPLETE | 12/12 | 2026-07-02 |
779
+ | WP-4 | Operator Interface | 0.3.0 | ✅ COMPLETE | 43 | 2026-07-02 |
780
+ | WP-5 | Production Hardening | 0.3.0 | ✅ COMPLETE | 92 | 2026-07-03 |
781
+ | WP-6 | Workboard Integration | 0.3.0 | ✅ COMPLETE | 115 | 2026-07-03 |
782
+ | WP-7 | Workflow Intelligence | 0.3.0 | ✅ COMPLETE | 129 | 2026-07-03 |
783
+ | WP-8 | Organizational Execution | 0.3.0 | ✅ COMPLETE | 141 | 2026-07-03 |
784
+ | WP-9 | Slash Command & UX | 1.0.1 | ✅ CLOSED | 101 (7 suites) | 2026-07-04 |
785
+ | WP-10 | Pipeline Execution | 1.0.1 | ✅ CLOSED | 101 (7 suites) | 2026-07-04 |
786
+ | WP-11 | Human-in-the-Loop Approval | 1.1.0 | ✅ CLOSED | 195 (17 suites) | 2026-07-04 |
787
+ | WP-12 | Production Validation | 1.2.0 | ✅ CLOSED | 195 (17 suites) | 2026-07-04 |
788
+ | WP-13 | Event-driven DecisionQueue | 1.3.0 | ✅ CLOSED | 199 (17 suites) | 2026-07-04 |
789
+ | WP-14 | Gateway RPC | 1.4.0 | ✅ CLOSED | 217 | 2026-07-04 |
790
+ | WP-15 | DecisionQueue Persistence | 1.5.0 | ✅ CLOSED | 228 | 2026-07-04 |
791
+ | WP-16 | Audit Logging | 1.6.0 | ✅ CLOSED | 236 | 2026-07-04 |
792
+ | WP-17 | Technical Debt Resolution | 1.7.0 | ✅ CLOSED | 241 | 2026-07-04 |
793
+ | WP-18 | Runtime Recovery | 1.8.0 | ✅ CLOSED | 241 | 2026-07-04 |
794
+ | WP-19 | Multi-user Approval | 1.9.0 | ✅ CLOSED | 254 | 2026-07-04 |
795
+ | WP-20 | Pipeline Checkpoint | 1.10.0 | ✅ CLOSED | 241 | 2026-07-04 |
796
+ | WP-21 | Queue Backend Abstraction | 1.11.0 | ✅ CLOSED | 315 | 2026-07-04 |
797
+ | WP-22 | Pipeline Resume | 1.12.0 | ✅ CLOSED | 320 | 2026-07-04 |
798
+ | WP-23 | OpenClaw Identity Integration | 1.13.0 | ✅ CLOSED | 322 | 2026-07-04 |
799
+ | WP-24 | Distributed Foundation | 1.14.0 | ✅ CLOSED | 351 | 2026-07-05 |
800
+ | WP-25 | Pipeline Task State & Error Propagation | 1.15.0 | ✅ CLOSED | 351 | 2026-07-05 |
801
+
802
+ ## Documentation
803
+
804
+ - **PROJECT-ARCHIVE.md** - Complete project archive and operational handover (1748 lines)
805
+ - **docs/roadmap/** - Implementation roadmap, milestones, completion reports
806
+ - **docs/architecture/** - System architecture and principles
807
+ - **docs/ai-resource/** - AI resource management and routing