@gotgenes/pi-subagents 18.0.1 → 18.0.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 (260) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/docs/architecture/architecture.md +157 -204
  3. package/docs/architecture/history/phase-19-implement-ui-decisions.md +282 -0
  4. package/package.json +5 -6
  5. package/src/lifecycle/subagent.ts +5 -9
  6. package/src/observation/notification.ts +23 -10
  7. package/src/observation/subagent-events-observer.ts +1 -3
  8. package/src/tools/get-result-report.ts +60 -0
  9. package/src/tools/get-result-tool.ts +25 -40
  10. package/src/types.ts +1 -1
  11. package/src/ui/session-navigator.ts +0 -2
  12. package/.prettierignore +0 -5
  13. package/AGENTS.md +0 -7
  14. package/docs/plans/0048-implement-subagents-api.md +0 -304
  15. package/docs/plans/0049-remove-group-join-output-file-rpc.md +0 -180
  16. package/docs/plans/0051-update-adr-0001-hard-fork.md +0 -77
  17. package/docs/plans/0052-remove-scheduled-subagents.md +0 -133
  18. package/docs/plans/0053-extract-model-resolution-from-execute.md +0 -181
  19. package/docs/plans/0054-decompose-index-into-modules.md +0 -302
  20. package/docs/plans/0057-structured-debug-logging.md +0 -154
  21. package/docs/plans/0061-session-format-transcript.md +0 -284
  22. package/docs/plans/0066-replace-as-any-with-sdk-types.md +0 -215
  23. package/docs/plans/0069-create-subagent-runtime.md +0 -345
  24. package/docs/plans/0070-extract-event-handlers.md +0 -306
  25. package/docs/plans/0071-extract-session-config-assembler.md +0 -362
  26. package/docs/plans/0072-inject-agent-manager-collaborators.md +0 -329
  27. package/docs/plans/0076-inject-cwd-into-agent-manager.md +0 -102
  28. package/docs/plans/0077-inject-project-agents-dir.md +0 -115
  29. package/docs/plans/0080-consolidate-agent-config-lookup.md +0 -247
  30. package/docs/plans/0084-extract-git-worktree-manager.md +0 -142
  31. package/docs/plans/0087-evolve-subagent-runtime-methods.md +0 -240
  32. package/docs/plans/0098-extract-agent-record-state-machine.md +0 -435
  33. package/docs/plans/0099-replace-ctx-with-parent-snapshot.md +0 -488
  34. package/docs/plans/0100-replace-callback-threading-with-session-subscription.md +0 -454
  35. package/docs/plans/0102-consolidate-test-record-factory.md +0 -176
  36. package/docs/plans/0108-extract-agent-type-registry.md +0 -322
  37. package/docs/plans/0109-extract-settings-manager.md +0 -276
  38. package/docs/plans/0110-agent-activity-tracker.md +0 -297
  39. package/docs/plans/0111-split-agent-record-lifecycle.md +0 -582
  40. package/docs/plans/0112-replace-agent-manager-callbacks.md +0 -241
  41. package/docs/plans/0113-disambiguate-spawn-options.md +0 -155
  42. package/docs/plans/0114-narrow-agent-tool-menu-deps.md +0 -279
  43. package/docs/plans/0115-decompose-agent-tool.md +0 -337
  44. package/docs/plans/0116-type-housekeeping.md +0 -351
  45. package/docs/plans/0118-settings-manager-apply-methods.md +0 -271
  46. package/docs/plans/0123-remove-vi-fn-cast-smell.md +0 -179
  47. package/docs/plans/0131-consolidate-shared-test-fixtures.md +0 -207
  48. package/docs/plans/0132-inject-io-into-session-config.md +0 -219
  49. package/docs/plans/0133-inject-sdk-boundary-into-agent-runner.md +0 -373
  50. package/docs/plans/0134-reduce-as-any-casts.md +0 -366
  51. package/docs/plans/0135-extract-display-helpers.md +0 -182
  52. package/docs/plans/0136-decompose-agent-menu.md +0 -300
  53. package/docs/plans/0144-consolidate-observation-model.md +0 -263
  54. package/docs/plans/0145-decompose-execute-push-ctx-to-boundary.md +0 -290
  55. package/docs/plans/0146-narrow-ui-context.md +0 -319
  56. package/docs/plans/0147-inject-wrap-text-into-conversation-viewer.md +0 -166
  57. package/docs/plans/0148-split-agent-widget-rendering.md +0 -255
  58. package/docs/plans/0152-add-prompt-snippet.md +0 -91
  59. package/docs/plans/0164-reorganize-into-domain-directories.md +0 -409
  60. package/docs/plans/0165-decompose-resolved-spawn-config.md +0 -157
  61. package/docs/plans/0166-extract-parent-session-info.md +0 -231
  62. package/docs/plans/0167-narrow-runner-io.md +0 -150
  63. package/docs/plans/0168-extract-tool-filter-config.md +0 -173
  64. package/docs/plans/0169-extract-run-context-from-run-options.md +0 -194
  65. package/docs/plans/0170-reduce-build-content-lines-complexity.md +0 -225
  66. package/docs/plans/0171-reduce-render-result-complexity.md +0 -200
  67. package/docs/plans/0172-extract-turn-formatting.md +0 -206
  68. package/docs/plans/0180-reorder-append-prompt-for-kv-cache.md +0 -100
  69. package/docs/plans/0185-remove-persistent-agent-memory.md +0 -161
  70. package/docs/plans/0188-replace-any-casts-with-sdk-types.md +0 -162
  71. package/docs/plans/0192-define-session-context-interface.md +0 -107
  72. package/docs/plans/0193-runtime-owns-context-queries.md +0 -245
  73. package/docs/plans/0194-align-tool-interfaces-for-structural-typing.md +0 -139
  74. package/docs/plans/0195-convert-tool-factories-to-classes.md +0 -264
  75. package/docs/plans/0196-convert-runner-menu-to-classes.md +0 -268
  76. package/docs/plans/0205-decompose-render-widget-lines.md +0 -140
  77. package/docs/plans/0206-decompose-show-agent-detail.md +0 -211
  78. package/docs/plans/0207-decompose-agent-widget-update.md +0 -242
  79. package/docs/plans/0208-extract-shared-test-fixtures.md +0 -298
  80. package/docs/plans/0214-convert-remaining-closure-factories-to-classes.md +0 -261
  81. package/docs/plans/0215-decompose-build-parent-context.md +0 -166
  82. package/docs/plans/0216-decompose-start-agent.md +0 -255
  83. package/docs/plans/0217-extract-overwrite-guard.md +0 -176
  84. package/docs/plans/0218-push-sdk-boundary-in-settings.md +0 -172
  85. package/docs/plans/0219-reduce-test-duplication-top-3-clone-families.md +0 -162
  86. package/docs/plans/0227-evolve-agent-record-into-agent.md +0 -322
  87. package/docs/plans/0228-async-start-agent-dissolve-run-handle.md +0 -288
  88. package/docs/plans/0229-agent-born-complete.md +0 -564
  89. package/docs/plans/0230-extract-concurrency-queue.md +0 -265
  90. package/docs/plans/0231-push-exec-registry-to-runner.md +0 -245
  91. package/docs/plans/0232-agent-resume-internal-observer-lifecycle.md +0 -180
  92. package/docs/plans/0237-remove-disallowed-tools.md +0 -180
  93. package/docs/plans/0238-remove-extensions-filtering.md +0 -191
  94. package/docs/plans/0239-collapse-filter-active-tools.md +0 -217
  95. package/docs/plans/0242-rename-agent-tool-to-subagent.md +0 -165
  96. package/docs/plans/0256-extract-worktree-isolation.md +0 -256
  97. package/docs/plans/0257-extract-child-session-factory.md +0 -285
  98. package/docs/plans/0262-add-workspace-provider-seam.md +0 -264
  99. package/docs/plans/0264-remove-extension-lifecycle-control.md +0 -277
  100. package/docs/plans/0265-born-complete-subagent-session.md +0 -333
  101. package/docs/plans/0270-type-consumable-public-surface.md +0 -204
  102. package/docs/plans/0272-export-workspace-collaborator-types.md +0 -147
  103. package/docs/plans/0277-encapsulate-agent-session.md +0 -304
  104. package/docs/plans/0280-rename-agent-to-subagent.md +0 -197
  105. package/docs/plans/0360-custom-agents-default-append.md +0 -132
  106. package/docs/plans/0373-extract-subagent-state.md +0 -250
  107. package/docs/plans/0374-encapsulate-subagent-start-notification.md +0 -268
  108. package/docs/plans/0375-extract-run-listener-workspace-bracket.md +0 -300
  109. package/docs/plans/0376-extract-manager-observer.md +0 -232
  110. package/docs/plans/0377-split-widget-delegation-from-runtime.md +0 -254
  111. package/docs/plans/0378-consolidate-lifecycle-test-fixtures.md +0 -243
  112. package/docs/plans/0379-consolidate-ui-tools-test-fixtures.md +0 -335
  113. package/docs/plans/0380-extract-layered-settings-loader.md +0 -223
  114. package/docs/plans/0381-replace-concurrency-queue-with-limiter.md +0 -267
  115. package/docs/plans/0400-include-parent-prompt-in-replace-mode.md +0 -199
  116. package/docs/plans/0403-abort-subagents-on-interrupt.md +0 -180
  117. package/docs/plans/0412-unify-session-mock-builders.md +0 -146
  118. package/docs/plans/0420-fold-run-metrics-live-activity-onto-record.md +0 -228
  119. package/docs/plans/0421-migrate-activity-readers-to-record-getters.md +0 -309
  120. package/docs/plans/0422-delete-activity-tracker-ui-observer.md +0 -204
  121. package/docs/plans/0423-widget-self-drive-from-lifecycle.md +0 -264
  122. package/docs/plans/0424-drop-widget-dep-from-subagent-tool.md +0 -166
  123. package/docs/plans/0425-reconcile-subagent-events-contract.md +0 -144
  124. package/docs/plans/0426-consolidate-residual-test-clone-families.md +0 -235
  125. package/docs/plans/0427-reconsider-ui-direction.md +0 -212
  126. package/docs/plans/0441-remove-agent-definition-management-subtree.md +0 -180
  127. package/docs/plans/0442-dissolve-agents-conversation-viewer.md +0 -195
  128. package/docs/plans/0443-consolidate-remaining-test-clone-families.md +0 -268
  129. package/docs/plans/0444-shrink-widget-to-background-agents.md +0 -156
  130. package/docs/plans/0445-native-session-navigation.md +0 -365
  131. package/docs/plans/0446-spike-session-navigation-entry-criteria.md +0 -171
  132. package/docs/plans/0447-extract-subagents-settings-command.md +0 -220
  133. package/docs/plans/0448-block-disabled-agent-spawn.md +0 -207
  134. package/docs/plans/0462-navigation-renderer-tui-components.md +0 -338
  135. package/docs/plans/0463-file-snapshot-source-evicted-agents.md +0 -306
  136. package/docs/plans/0470-refresh-readme-command-surface.md +0 -159
  137. package/docs/retro/0048-implement-subagents-api.md +0 -44
  138. package/docs/retro/0049-remove-group-join-output-file-rpc.md +0 -49
  139. package/docs/retro/0051-update-adr-0001-hard-fork.md +0 -39
  140. package/docs/retro/0053-extract-model-resolution-from-execute.md +0 -40
  141. package/docs/retro/0054-decompose-index-into-modules.md +0 -53
  142. package/docs/retro/0057-structured-debug-logging.md +0 -77
  143. package/docs/retro/0061-session-format-transcript.md +0 -41
  144. package/docs/retro/0066-replace-as-any-with-sdk-types.md +0 -44
  145. package/docs/retro/0069-create-subagent-runtime.md +0 -43
  146. package/docs/retro/0070-extract-event-handlers.md +0 -49
  147. package/docs/retro/0071-extract-session-config-assembler.md +0 -60
  148. package/docs/retro/0072-inject-agent-manager-collaborators.md +0 -46
  149. package/docs/retro/0076-inject-cwd-into-agent-manager.md +0 -35
  150. package/docs/retro/0077-inject-project-agents-dir.md +0 -33
  151. package/docs/retro/0080-consolidate-agent-config-lookup.md +0 -35
  152. package/docs/retro/0084-extract-git-worktree-manager.md +0 -37
  153. package/docs/retro/0087-evolve-subagent-runtime-methods.md +0 -42
  154. package/docs/retro/0098-extract-agent-record-state-machine.md +0 -46
  155. package/docs/retro/0099-replace-ctx-with-parent-snapshot.md +0 -37
  156. package/docs/retro/0100-replace-callback-threading-with-session-subscription.md +0 -36
  157. package/docs/retro/0102-consolidate-test-record-factory.md +0 -30
  158. package/docs/retro/0108-extract-agent-type-registry.md +0 -41
  159. package/docs/retro/0109-extract-settings-manager.md +0 -55
  160. package/docs/retro/0110-agent-activity-tracker.md +0 -44
  161. package/docs/retro/0111-split-agent-record-lifecycle.md +0 -61
  162. package/docs/retro/0112-replace-agent-manager-callbacks.md +0 -35
  163. package/docs/retro/0113-disambiguate-spawn-options.md +0 -29
  164. package/docs/retro/0114-narrow-agent-tool-menu-deps.md +0 -38
  165. package/docs/retro/0115-decompose-agent-tool.md +0 -51
  166. package/docs/retro/0116-type-housekeeping.md +0 -42
  167. package/docs/retro/0118-settings-manager-apply-methods.md +0 -40
  168. package/docs/retro/0123-remove-vi-fn-cast-smell.md +0 -49
  169. package/docs/retro/0131-consolidate-shared-test-fixtures.md +0 -46
  170. package/docs/retro/0132-inject-io-into-session-config.md +0 -33
  171. package/docs/retro/0133-inject-sdk-boundary-into-agent-runner.md +0 -45
  172. package/docs/retro/0134-reduce-as-any-casts.md +0 -56
  173. package/docs/retro/0135-extract-display-helpers.md +0 -38
  174. package/docs/retro/0136-decompose-agent-menu.md +0 -43
  175. package/docs/retro/0144-consolidate-observation-model.md +0 -39
  176. package/docs/retro/0145-decompose-execute-push-ctx-to-boundary.md +0 -56
  177. package/docs/retro/0146-narrow-ui-context.md +0 -70
  178. package/docs/retro/0147-inject-wrap-text-into-conversation-viewer.md +0 -90
  179. package/docs/retro/0148-split-agent-widget-rendering.md +0 -39
  180. package/docs/retro/0152-add-prompt-snippet.md +0 -34
  181. package/docs/retro/0164-reorganize-into-domain-directories.md +0 -82
  182. package/docs/retro/0165-decompose-resolved-spawn-config.md +0 -78
  183. package/docs/retro/0166-extract-parent-session-info.md +0 -66
  184. package/docs/retro/0167-narrow-runner-io.md +0 -63
  185. package/docs/retro/0168-extract-tool-filter-config.md +0 -76
  186. package/docs/retro/0169-extract-run-context-from-run-options.md +0 -68
  187. package/docs/retro/0170-reduce-build-content-lines-complexity.md +0 -72
  188. package/docs/retro/0171-reduce-render-result-complexity.md +0 -77
  189. package/docs/retro/0172-extract-turn-formatting.md +0 -80
  190. package/docs/retro/0180-reorder-append-prompt-for-kv-cache.md +0 -62
  191. package/docs/retro/0185-remove-persistent-agent-memory.md +0 -73
  192. package/docs/retro/0188-replace-any-casts-with-sdk-types.md +0 -69
  193. package/docs/retro/0192-define-session-context-interface.md +0 -59
  194. package/docs/retro/0193-runtime-owns-context-queries.md +0 -75
  195. package/docs/retro/0194-align-tool-interfaces-for-structural-typing.md +0 -62
  196. package/docs/retro/0195-convert-tool-factories-to-classes.md +0 -84
  197. package/docs/retro/0196-convert-runner-menu-to-classes.md +0 -73
  198. package/docs/retro/0205-decompose-render-widget-lines.md +0 -64
  199. package/docs/retro/0206-decompose-show-agent-detail.md +0 -67
  200. package/docs/retro/0207-decompose-agent-widget-update.md +0 -92
  201. package/docs/retro/0208-extract-shared-test-fixtures.md +0 -102
  202. package/docs/retro/0214-convert-remaining-closure-factories-to-classes.md +0 -66
  203. package/docs/retro/0215-decompose-build-parent-context.md +0 -61
  204. package/docs/retro/0216-decompose-start-agent.md +0 -80
  205. package/docs/retro/0217-extract-overwrite-guard.md +0 -63
  206. package/docs/retro/0218-push-sdk-boundary-in-settings.md +0 -72
  207. package/docs/retro/0219-reduce-test-duplication-top-3-clone-families.md +0 -64
  208. package/docs/retro/0227-evolve-agent-record-into-agent.md +0 -80
  209. package/docs/retro/0228-async-start-agent-dissolve-run-handle.md +0 -80
  210. package/docs/retro/0229-agent-born-complete.md +0 -89
  211. package/docs/retro/0230-extract-concurrency-queue.md +0 -38
  212. package/docs/retro/0231-push-exec-registry-to-runner.md +0 -71
  213. package/docs/retro/0232-agent-resume-internal-observer-lifecycle.md +0 -109
  214. package/docs/retro/0237-remove-disallowed-tools.md +0 -78
  215. package/docs/retro/0238-remove-extensions-filtering.md +0 -72
  216. package/docs/retro/0239-collapse-filter-active-tools.md +0 -70
  217. package/docs/retro/0242-rename-agent-tool-to-subagent.md +0 -82
  218. package/docs/retro/0256-extract-worktree-isolation.md +0 -89
  219. package/docs/retro/0257-extract-child-session-factory.md +0 -33
  220. package/docs/retro/0262-add-workspace-provider-seam.md +0 -89
  221. package/docs/retro/0264-remove-extension-lifecycle-control.md +0 -91
  222. package/docs/retro/0265-born-complete-subagent-session.md +0 -97
  223. package/docs/retro/0270-type-consumable-public-surface.md +0 -108
  224. package/docs/retro/0272-export-workspace-collaborator-types.md +0 -38
  225. package/docs/retro/0277-encapsulate-agent-session.md +0 -80
  226. package/docs/retro/0280-rename-agent-to-subagent.md +0 -96
  227. package/docs/retro/0360-custom-agents-default-append.md +0 -81
  228. package/docs/retro/0373-extract-subagent-state.md +0 -94
  229. package/docs/retro/0374-encapsulate-subagent-start-notification.md +0 -171
  230. package/docs/retro/0375-extract-run-listener-workspace-bracket.md +0 -104
  231. package/docs/retro/0376-extract-manager-observer.md +0 -81
  232. package/docs/retro/0377-split-widget-delegation-from-runtime.md +0 -105
  233. package/docs/retro/0378-consolidate-lifecycle-test-fixtures.md +0 -100
  234. package/docs/retro/0379-consolidate-ui-tools-test-fixtures.md +0 -52
  235. package/docs/retro/0380-extract-layered-settings-loader.md +0 -97
  236. package/docs/retro/0381-replace-concurrency-queue-with-limiter.md +0 -95
  237. package/docs/retro/0400-include-parent-prompt-in-replace-mode.md +0 -84
  238. package/docs/retro/0403-abort-subagents-on-interrupt.md +0 -90
  239. package/docs/retro/0412-unify-session-mock-builders.md +0 -80
  240. package/docs/retro/0420-fold-run-metrics-live-activity-onto-record.md +0 -90
  241. package/docs/retro/0421-migrate-activity-readers-to-record-getters.md +0 -105
  242. package/docs/retro/0422-delete-activity-tracker-ui-observer.md +0 -97
  243. package/docs/retro/0423-widget-self-drive-from-lifecycle.md +0 -112
  244. package/docs/retro/0424-drop-widget-dep-from-subagent-tool.md +0 -89
  245. package/docs/retro/0425-reconcile-subagent-events-contract.md +0 -101
  246. package/docs/retro/0426-consolidate-residual-test-clone-families.md +0 -100
  247. package/docs/retro/0427-reconsider-ui-direction.md +0 -102
  248. package/docs/retro/0441-remove-agent-definition-management-subtree.md +0 -97
  249. package/docs/retro/0442-dissolve-agents-conversation-viewer.md +0 -108
  250. package/docs/retro/0443-consolidate-remaining-test-clone-families.md +0 -28
  251. package/docs/retro/0444-shrink-widget-to-background-agents.md +0 -81
  252. package/docs/retro/0445-native-session-navigation.md +0 -122
  253. package/docs/retro/0446-spike-session-navigation-entry-criteria.md +0 -99
  254. package/docs/retro/0447-extract-subagents-settings-command.md +0 -91
  255. package/docs/retro/0448-block-disabled-agent-spawn.md +0 -75
  256. package/docs/retro/0462-navigation-renderer-tui-components.md +0 -105
  257. package/docs/retro/0463-file-snapshot-source-evicted-agents.md +0 -103
  258. package/docs/retro/0470-refresh-readme-command-surface.md +0 -40
  259. package/src/observation/notification-state.ts +0 -27
  260. package/vitest.config.ts +0 -14
@@ -1,78 +0,0 @@
1
- ---
2
- issue: 237
3
- issue_title: "Remove disallowed_tools from pi-subagents (Phase 14, Step 1)"
4
- ---
5
-
6
- # Retro: #237 — Remove disallowed_tools from pi-subagents
7
-
8
- ## Stage: Planning (2026-05-27T00:52:26Z)
9
-
10
- ### Session summary
11
-
12
- Produced a 6-step TDD plan to remove `disallowedTools` from `AgentConfig`, `disallowedSet` from `ToolFilterConfig`, and all parsing/serialization/UI/test code that references them.
13
- The plan covers 7 source files, 4 test files, README, and the architecture doc.
14
-
15
- ### Observations
16
-
17
- - The issue label `pkg:pi-permission-system` was incorrect — all target files live in `packages/pi-subagents`.
18
- Confirmed with the user that the plan targets pi-subagents.
19
- - The README still references `disallowed_tools` in the context of memory write-capability detection, but memory was already removed in #185.
20
- The plan treats this as a stale reference to clean up.
21
- - After removing `disallowedSet`, the `filterActiveTools` `extensions === false` branch simplifies to a trivial passthrough (`return activeTools`), and both guard conditions at the call sites drop the `|| cfg.toolFilter.disallowedSet` arm.
22
- This leaves the function in the exact shape that Step 3 (#239) expects.
23
- - The plan orders steps to follow the type dependency chain: `AgentConfig` first (surfaces all downstream errors), then `ToolFilterConfig`, then `filterActiveTools`, then UI, then docs.
24
-
25
- ## Stage: Implementation — TDD (2026-05-27T00:59:19Z)
26
-
27
- ### Session summary
28
-
29
- All 6 TDD steps completed in one session, producing 7 commits (6 planned + 1 fixup for dead code).
30
- Test count dropped from 983 to 978 (5 tests removed: 2 from `custom-agents.test.ts`, 1 from `session-config.test.ts`, 2 from `agent-runner-extension-tools.test.ts` after renaming one deleted test into a retained form).
31
- All checks (type check, lint, fallow dead-code gate) pass clean.
32
-
33
- ### Observations
34
-
35
- - `csvListOptional` in `custom-agents.ts` was left dead after removing the `disallowedTools` parsing call; Biome flagged it as unused.
36
- Removed as a separate `refactor:` commit since it couldn't be amended into the `feat!:` commit (later commits already on top of it).
37
- - One of the three deleted `agent-runner-extension-tools.test.ts` denylist tests ("extensions: false with no disallowedTools skips the filter") was reformulated into a new test ("extensions: false skips the filter entirely") rather than simply deleted, because it covers genuinely different behavior after the simplification: `extensions: false` now always skips the filter, not just when no denylist is present.
38
- This adds coverage for the simplified code path.
39
- - The `filterActiveTools` `extensions === false` branch simplified from "apply denylist to built-in tools" to `return activeTools`, exactly as the plan specified.
40
- Both guard conditions at the call sites simplified to `cfg.toolFilter.extensions !== false`.
41
- - No deviations from the plan's module-level changes list; all 7 source files and 4 test files were touched as specified.
42
-
43
- ## Stage: Final Retrospective (2026-05-27T01:12:34Z)
44
-
45
- ### Session summary
46
-
47
- Three-stage lifecycle (planning → TDD → ship) completed in one session for Phase 14, Step 1.
48
- All 6 TDD steps landed in 7 commits (6 planned + 1 fixup for dead `csvListOptional`).
49
- Test count: 983 → 978 (−5).
50
- Released as `pi-subagents-v8.0.0` (major bump from the `feat!:` breaking change).
51
-
52
- ### Observations
53
-
54
- #### What went well
55
-
56
- - The plan's type-dependency-chain ordering (AgentConfig → ToolFilterConfig → `filterActiveTools` → UI → docs) meant each step produced the exact downstream type errors expected for the next step, with zero surprises.
57
- This ordering pattern is worth preserving for future removal issues.
58
- - Incremental verification ran after every step: `pnpm run check` after type changes, `pnpm vitest run <file>` after logic changes, full suite + lint + fallow at the end.
59
- No regressions discovered at the final sweep.
60
- - The reformulation of one deleted test into "extensions: false skips the filter entirely" added coverage for the simplified code path rather than just deleting it.
61
- Good judgment call during implementation.
62
-
63
- #### What caused friction (agent side)
64
-
65
- - `missing-context` — The plan said "remove `disallowedTools: csvListOptional(fm.disallowed_tools)`" from `custom-agents.ts` but did not check whether `csvListOptional` had other callers.
66
- It was the sole call site, so the function became dead code.
67
- Biome caught it at the final lint sweep, requiring a separate `refactor:` commit (`f1ee7c1`).
68
- Impact: one unplanned commit; no rework but added friction.
69
- Self-identified at final lint.
70
- Root cause: the `plan-issue.md` template had a rule for grepping removed *exports* but not for checking private-function orphans.
71
-
72
- #### What caused friction (user side)
73
-
74
- - No friction observed — the user's involvement was limited to confirming the target package (pi-subagents vs pi-permission-system) during planning, which was an appropriate clarification given the incorrect `pkg:` label on the issue.
75
-
76
- ### Changes made
77
-
78
- 1. `.pi/prompts/plan-issue.md` — Added rule: when a step removes a call to a private function, grep the file for other callers and list the function for removal if the removed call was the sole call site.
@@ -1,72 +0,0 @@
1
- ---
2
- issue: 238
3
- issue_title: "Remove extensions filtering from pi-subagents (Phase 14, Step 2)"
4
- ---
5
-
6
- # Retro: #238 — Remove extensions filtering from pi-subagents
7
-
8
- ## Stage: Planning (2026-05-27T01:31:01Z)
9
-
10
- ### Session summary
11
-
12
- Produced a 6-step TDD plan for narrowing `extensions` from `true | string[] | false` to `boolean` across `AgentConfig`, `ToolFilterConfig`, `filterActiveTools`, custom agent frontmatter parsing, UI serialization, and tests.
13
- The plan mirrors the structure of the completed #237 plan (Step 1 of Phase 14) and explicitly defers `filterActiveTools` collapse to #239.
14
-
15
- ### Observations
16
-
17
- - The `pkg:pi-permission-system` label on this issue is intentional context (pi-permission-system becomes the sole tool-policy authority) but all code changes are in pi-subagents.
18
- - The `inheritField()` helper is shared between `extensions` and `skills` parsing — it cannot be simplified since `skills` still supports `string[]`.
19
- The plan coerces at the call site instead.
20
- - After removing the `Array.isArray(extensions)` branch, the `builtinToolNameSet.has(t)` check in `filterActiveTools` becomes logically redundant (both branches return `true`), but simplifying further is #239's scope.
21
- - Only 2 tests are removed and 3 updated; the boolean paths (`true`/`false`) are well-covered and unchanged.
22
-
23
- ## Stage: Implementation — TDD (2026-05-27T01:39:43Z)
24
-
25
- ### Session summary
26
-
27
- All 6 TDD steps completed across 6 commits.
28
- Test count went from 978 to 977 (net −1: 2 removed, 1 added for the deprecation warning).
29
- Full suite: 62 files, 977 tests, all passing; type check and lint clean.
30
-
31
- ### Observations
32
-
33
- - **Plan deviation — step consolidation**: The type narrowing in step 1 caused immediate `tsc` errors in test files that the plan assigned to steps 2–4 (the `string[]`-specific tests in `agent-runner-extension-tools.test.ts`, `session-config.test.ts`, and `agent-config-editor.test.ts`).
34
- All test fixes were folded into the step 1 commit to keep the build green at every commit.
35
- Steps 2–4 became purely production-code changes.
36
- - **Plan deviation — deprecation warning**: The plan said to use `debugLog` for the deprecation warning, but `debugLog` is debug-only (requires `PI_SUBAGENTS_DEBUG=1`) and its signature requires an error object as the second argument. `console.warn` was used instead, which is user-visible without special env vars and testable with `vi.spyOn`.
37
- - **ESLint auto-fix in step 2**: ESLint rewrote `extensions === false` to `!extensions` and `cfg.toolFilter.extensions === false` to `!cfg.toolFilter.extensions` after the type narrowed to `boolean`.
38
- Both are semantically identical; the changes were staged and included in the same commit.
39
- - The `resolveBoolExtensions` helper in `custom-agents.ts` is a clean seam — if `skills` is ever also simplified to `boolean`, the same pattern applies.
40
-
41
- ## Stage: Final Retrospective (2026-05-27T01:48:04Z)
42
-
43
- ### Session summary
44
-
45
- All three stages (planning, TDD, shipping) completed in a single continuous session.
46
- Six implementation commits landed as `pi-subagents-v9.0.0` (major bump from `feat!:`).
47
- Issue #238 closed; unblocks #239 (collapse `filterActiveTools`).
48
-
49
- ### Observations
50
-
51
- #### What went well
52
-
53
- - The plan’s structure closely followed the successful #237 pattern, making execution predictable.
54
- - The implementer caught the type-narrowing cascade on the first `pnpm run check` and adapted immediately — no user intervention needed.
55
- - The `resolveBoolExtensions` helper extraction was a clean design choice that keeps `inheritField` reusable for `skills`.
56
- - ESLint auto-fix of `=== false` → `!` after the type narrowed to `boolean` was handled smoothly within the same commit.
57
-
58
- #### What caused friction (agent side)
59
-
60
- - `instruction-violation` (self-identified) — The planner did not apply the testing skill’s existing rule: “When a TDD plan lists separate steps that share a type definition, changing that type in step N breaks steps N+1…N+k.”
61
- The plan assigned test-fixture fixes (removing `extensions: string[]` values) to steps 2–4, but the type change in step 1 broke them all immediately.
62
- Impact: no rework — the implementer folded fixes into step 1 — but the plan’s step boundaries were misleading.
63
- - `missing-context` — The plan recommended `debugLog` for the deprecation warning without checking its function signature (`(context: string, err: unknown)`) or its debug-only behavior.
64
- Impact: minor — switched to `console.warn` during implementation with no rework, but the plan was wrong.
65
-
66
- #### What caused friction (user side)
67
-
68
- - Nothing notable — no user corrections were needed across all three stages.
69
-
70
- ### Changes made
71
-
72
- 1. `.pi/skills/testing/SKILL.md` — Added type-narrowing-specific TDD planning rule: when a step narrows a union type, grep test files for fixtures using the removed variant and fold those fixes into the same step.
@@ -1,70 +0,0 @@
1
- ---
2
- issue: 239
3
- issue_title: "Collapse filterActiveTools to recursion guard (Phase 14, Step 3)"
4
- ---
5
-
6
- # Retro: #239 — Collapse filterActiveTools to recursion guard
7
-
8
- ## Stage: Planning (2026-05-27T20:00:00Z)
9
-
10
- ### Session summary
11
-
12
- Produced a 3-step TDD plan to flatten `SessionConfig.toolFilter` into top-level `toolNames` and `extensions` fields, simplify `filterActiveTools` to a one-liner recursion guard, remove the pre-bind filter call, and update architecture docs.
13
- Both dependencies (#237, #238) are confirmed closed.
14
-
15
- ### Observations
16
-
17
- - The `builtinToolNameSet` membership check in `filterActiveTools` is fully dead code — both branches return `true` after #238 removed the `string[]` extensions path.
18
- - `ToolFilterConfig` is only imported by `agent-runner.ts` and never referenced in test files, so deletion is clean.
19
- - The pre-bind filter call is safe to remove because `EXCLUDED_TOOL_NAMES` tools (`subagent`, `get_subagent_result`, `steer_subagent`) are registered by this extension during `bindExtensions`, not before — they cannot appear in the pre-bind active set.
20
- - The `agent-runner-extension-tools.test.ts` file has 4 tests; 1 becomes structurally impossible (pre-bind/post-bind ordering) and the remaining 3 need assertion index adjustments (`calls[1]` → `calls[0]`).
21
- - `SessionConfig` is internal-only (not package-exported), so flattening has no external API impact.
22
-
23
- ## Stage: Implementation — TDD (2026-05-27T22:00:00Z)
24
-
25
- ### Session summary
26
-
27
- Completed all 3 TDD cycles: (1) flattened `SessionConfig` and deleted `ToolFilterConfig`, (2) simplified `filterActiveTools` to a one-liner and removed the pre-bind filter call, (3) updated architecture docs to mark Phase 14 Step 3 complete.
28
- Test count held at 977 (no net change — the extension-tools test file was rewritten, removing 1 test and updating 3 others while keeping the same total count).
29
- A follow-up skill maintenance commit updated `.pi/skills/package-pi-subagents/SKILL.md` to remove stale Patch 2 references.
30
-
31
- ### Observations
32
-
33
- - The plan's step order (SessionConfig first → expected compile errors in `agent-runner.ts` → green after runner update) worked exactly as designed with no surprises.
34
- - `agent-runner.test.ts` needed no changes — the default test config has `extensions: false`, so the filter call never ran in those tests.
35
- - Pre-completion reviewer returned **WARN** for stale `package-pi-subagents` skill content: the "Patch 2 scheduled for removal" note and the `// Patch 2 (RepOne` grep instruction were both stale after #239 completion.
36
- Fixed immediately as a follow-up `docs:` commit before writing retro notes.
37
- - `pnpm fallow dead-code` passed with 0 issues — no orphaned exports left behind.
38
-
39
- ## Stage: Final Retrospective (2026-05-27T14:40:00Z)
40
-
41
- ### Session summary
42
-
43
- Completed the full issue lifecycle (plan → TDD → ship → retro) in a single continuous session.
44
- Issue #239 shipped as `pi-subagents-v10.0.1` with 7 commits (2 refactor, 4 docs, 1 release).
45
- Phase 14 is now fully complete, unblocking Phase 15 (#227–#232).
46
-
47
- ### Observations
48
-
49
- #### What went well
50
-
51
- - The plan's type-dependency-chain ordering (`SessionConfig` first → expected compile errors → `agent-runner.ts` resolves them) produced zero surprises during TDD.
52
- Each step's red/green boundary was exactly where the plan predicted.
53
- - Pre-completion reviewer caught stale `package-pi-subagents` skill content ("Patch 2 scheduled for removal" and a `// Patch 2 (RepOne` grep instruction) that no longer matched source.
54
- Fixed before shipping — the reviewer earned its keep.
55
- - Multi-model routing was well-matched: `claude-sonnet-4-6` for planning and TDD (judgment + code), `deepseek-v4-flash` for shipping (mechanical checklist), `claude-opus-4-6` for retrospective (synthesis).
56
- - Feedback loops were incremental: `pnpm vitest run` after each test change, `pnpm run check` after Step 1 to confirm expected errors, full suite + lint + dead-code after all steps.
57
-
58
- #### What caused friction (agent side)
59
-
60
- No friction points identified.
61
- This was the final step of a 3-step phase with both dependencies already closed, a well-scoped plan, and internal-only API changes — the simplest possible lifecycle.
62
-
63
- #### What caused friction (user side)
64
-
65
- None observed.
66
- The user's involvement was limited to issuing the four standard lifecycle commands (`/plan-issue`, `/tdd-plan`, `/ship-issue`, `/retro`) with no corrections or redirections needed.
67
-
68
- ### Changes made
69
-
70
- 1. Appended Final Retrospective stage entry to `packages/pi-subagents/docs/retro/0239-collapse-filter-active-tools.md`.
@@ -1,82 +0,0 @@
1
- ---
2
- issue: 242
3
- issue_title: "Rename `Agent` tool to `subagent`"
4
- ---
5
-
6
- # Retro: #242 — Rename `Agent` tool to `subagent`
7
-
8
- ## Stage: Planning (2026-05-27T13:45:29Z)
9
-
10
- ### Session summary
11
-
12
- Produced a plan for renaming the `Agent` tool to `subagent` across pi-subagents source, tests, README, and architecture docs.
13
- Verified that pi-permission-system docs do not reference the `Agent` tool name and require no changes.
14
- Scoped the plan to two commits: one `feat!:` for source + tests, one `docs:` for documentation.
15
-
16
- ### Observations
17
-
18
- - The general-purpose agent type's `displayName` (`"Agent"` in `default-agents.ts` and `agent-types.ts` fallback) is a separate concept from the tool name and stays unchanged.
19
- Several test files assert this `displayName` — they are not affected by the rename.
20
- - Issue #239 (Step 3, collapse `filterActiveTools`) is still open but independent — #242 only changes the string value in `EXCLUDED_TOOL_NAMES`, not its structure.
21
- - The architecture doc already contains `(née \`Agent\`)` in the "What the core owns" section, anticipating the rename.
22
- - The `widget-renderer.test.ts` comment references `"Agent"` as the general-purpose display name, not the tool name — only the comment text needs updating for clarity.
23
-
24
- ## Stage: Implementation — TDD (2026-05-27T13:55:33Z)
25
-
26
- ### Session summary
27
-
28
- Completed 2 TDD cycles: one `feat!:` commit renaming the tool in source + tests, one `docs:` commit updating `README.md` and `docs/architecture/architecture.md`.
29
- Baseline was 977 tests; test count unchanged at 977 after the changes.
30
- Pre-completion reviewer returned **PASS**.
31
-
32
- ### Observations
33
-
34
- - All changes were pure string-literal replacements in 2 source files, 4 test files, `README.md`, and the architecture doc — no logic, type, or structural changes.
35
- - The general-purpose agent type's `displayName: "Agent"` in `default-agents.ts` and `agent-types.ts` fallback was correctly left unchanged; `display.test.ts` still passes with `"Agent"`.
36
- - The description body inside the `agent-tool.ts` template literal needed separate edits because the guideline lines are not tab-indented (inside a backtick template literal, tab indentation does not apply).
37
- - Pre-completion reviewer: PASS — all deterministic checks, conventional commits, documentation, code design, tests, Mermaid diagrams, and dead-code gate all passed.
38
-
39
- ## Stage: Final Retrospective (2026-05-27T14:07:32Z)
40
-
41
- ### Session summary
42
-
43
- Completed the full plan→TDD→ship→retro lifecycle for #242 in a single session.
44
- Released as `pi-subagents-v10.0.0` (major bump from `feat!:` breaking change).
45
- Found and fixed one stale `Agent` tool reference in `.pi/skills/pre-completion/SKILL.md`.
46
-
47
- ### Observations
48
-
49
- #### What went well
50
-
51
- - Three-model pipeline (opus for planning, sonnet for TDD, deepseek-flash for shipping) matched task complexity to model capability with no quality issues.
52
- - The plan's distinction between tool name (`"Agent"`) and agent-type `displayName` (`"Agent"`) prevented false-positive test updates — 8 test files reference `"Agent"` but only 4 needed changes.
53
- - Pre-completion reviewer caught no issues (PASS), confirming thorough planning.
54
-
55
- #### What caused friction (agent side)
56
-
57
- 1. `missing-context` — Two failed `Edit` calls on `agent-tool.ts` line 175: the template literal's guideline lines have no tab indentation, but the agent initially assumed tab depth from the surrounding function.
58
- Impact: 3 extra tool calls (grep to inspect actual indentation, then successful edit); no rework.
59
- Self-identified.
60
- 2. `wrong-abstraction` — Retro file edit duplicated Planning observations into the TDD stage because the `Edit` `oldText` matched from the Observations heading and the replacement included both old and new content.
61
- Impact: 2 extra tool calls (read file, full `write` to fix); no rework.
62
- Self-identified.
63
- 3. `missing-context` — `.pi/skills/pre-completion/SKILL.md` line 32 references the `Agent` tool by name but was not in the plan's scope.
64
- The plan checked pi-permission-system docs, `README.md`, and architecture docs but did not grep skill files for the old tool name.
65
- Impact: discovered during retro; fixed as a retro change.
66
-
67
- #### What caused friction (user side)
68
-
69
- - None — the full pipeline ran with zero user corrections.
70
-
71
- ### Diagnostic details
72
-
73
- - **Model-performance correlation** — Pre-completion reviewer ran as a default-model subagent (292.7s, 36 tool uses, 63.9k tokens).
74
- Appropriate for the judgment-heavy review task.
75
- Ship stage on `deepseek-v4-flash` was notably efficient for purely mechanical work.
76
- - **Feedback-loop gap analysis** — Verification was incremental: baseline check before TDD, per-file tests after Red and Green phases, full suite after implementation, then check + lint + fallow.
77
- No gaps.
78
-
79
- ### Changes made
80
-
81
- 1. `.pi/skills/pre-completion/SKILL.md` — updated stale `Agent` tool reference to `subagent` on line 32.
82
- 2. `.pi/agents/pre-completion-reviewer.md` — added rename-grep heuristic to the Skills bullet under Forward documentation checks: "When the change renames a symbol, grep `.pi/skills/` and `.pi/prompts/` for the old name."
@@ -1,89 +0,0 @@
1
- ---
2
- issue: 256
3
- issue_title: "Extract WorktreeIsolation collaborator"
4
- ---
5
-
6
- # Retro: #256 — Extract WorktreeIsolation collaborator
7
-
8
- ## Stage: Planning (2026-05-28T23:44:23Z)
9
-
10
- ### Session summary
11
-
12
- Produced a numbered implementation plan for extracting a `WorktreeIsolation` collaborator (Phase 16, Step 1) that owns the worktree lifecycle (`setup`, `path`, `cleanup`) so `Agent` tells one collaborator instead of orchestrating `_worktrees` + `_isolation` + `worktreeState` itself.
13
- The plan covers the new module, `Agent`/`AgentManager`/`service-adapter` wiring, the `WorktreeState` deletion, doc updates, and a 4-cycle TDD order.
14
-
15
- ### Observations
16
-
17
- - Decision: fold `WorktreeState` into `WorktreeIsolation` (delete `worktree-state.ts`) rather than wrap it.
18
- The architecture target table already lists `WorktreeIsolation` as absorbing `worktrees` + `isolation` + `worktreeState`, and the user confirmed a fold preference when the doc had already decided it.
19
- - `WorktreeManager.cleanup(wt, ...)` mutates `wt.branch` in place; `WorktreeIsolation` must store a mutable `WorktreeInfo` (`_info`) to preserve that behavior — flagged as the top risk.
20
- - `AgentInit` net field change is −1 (removes `worktrees` + `isolation`, adds `worktree`), not −2 as the issue text loosely states; instance fields drop by 2 and `setupWorktree()` is removed.
21
- - The `missing worktrees dependency` defensive branch becomes structurally impossible (collaborator is only built with a manager) and is dropped.
22
- - Verified no consumer imports the `WorktreeCleanupResult`/`WorktreeInfo` re-exports from `worktree-state.ts` — they all import from `worktree.ts`, so deletion is safe.
23
- - Step 2 (the integration) is a single commit because the type checker forbids removing `AgentInit` fields while call sites still pass them; bulk of `agent.test.ts` is untouched, only worktree helpers/describe blocks change.
24
- - Doc updates needed: architecture class diagram + layout listing, and the package `SKILL.md` Lifecycle domain row (module count stays 9).
25
- - This step is independent of Step 2 (#257, `ChildSessionFactory`) per the architecture's Track A.
26
-
27
- ## Stage: Implementation — TDD (2026-05-29T00:01:54Z)
28
-
29
- ### Session summary
30
-
31
- Implemented all 4 planned TDD cycles: added `WorktreeIsolation` + unit tests, wired it into `Agent`/`AgentManager`/`service-adapter` (removing `_worktrees`/`_isolation`/`worktreeState`/`setupWorktree()`), deleted the folded `WorktreeState` class and its test, and updated the architecture doc + package skill.
32
- Full suite green at 1047 tests (baseline 1053; +7 new `worktree-isolation` tests, −4 removed `setupWorktree` tests, −9 removed `worktree-state` tests); `check`, `lint`, and `fallow dead-code` all clean.
33
-
34
- ### Observations
35
-
36
- - One pre-existing baseline failure: `rumdl` flagged 5 orphaned issue link definitions (`[#227]`–`[#232]`, minus the still-used `[#231]`) in `architecture.md`, introduced by an earlier Phase 15 archive commit.
37
- Fixed as a separate `docs:` cleanup commit before starting TDD to establish a green baseline.
38
- - Deviation from a literal 1:1 test mapping: `WorktreeIsolation` deliberately exposes `path` + `cleanupResult` but no `branch` getter (branch is an internal `_info` detail surfaced via `cleanupResult`).
39
- The two `agent-manager.test.ts` tests that asserted `worktreeState.branch` now assert `record.worktree?.path` and `record.worktree?.cleanupResult`.
40
- Noted in the Step 2 commit body.
41
- - `Agent.worktree` is `readonly` (set at construction), unlike the old mutable public `worktreeState` field.
42
- Tests that previously mutated `record.worktreeState = new WorktreeState(...)` after construction were reworked to pass a pre-`setup()` `WorktreeIsolation` via the constructor (`createSetUpWorktree` helper in `agent.test.ts`; `setUpWorktree` helper in `service-adapter.test.ts`).
43
- - `createTestAgent` spreads `init` into the `Agent` constructor, so injecting `worktree` needed no helper change.
44
- - The Step 2 integration landed cleanly in a single commit as the plan predicted; the type checker pinpointed every stale call site.
45
- - Pre-completion reviewer: PASS (all deterministic checks, acceptance criteria, conventional commits, docs, code design, test artifacts, Mermaid, and dead-code gates green).
46
-
47
- ## Stage: Final Retrospective (2026-05-29T00:18:13Z)
48
-
49
- ### Session summary
50
-
51
- Shipped #256 end-to-end across one continuous session: planning → 4-cycle TDD → ship.
52
- The `WorktreeIsolation` collaborator landed, `WorktreeState` was folded in and deleted, the suite stayed green (1047 tests), the pre-completion reviewer returned PASS on first dispatch, CI passed, and `pi-subagents-v11.3.0` released cleanly.
53
- The session was notably low-friction; the only judgment calls were a pre-existing baseline lint failure and a fold-vs-wrap confirmation.
54
-
55
- ### Observations
56
-
57
- #### What went well
58
-
59
- - The planning-stage lift-and-shift analysis precisely predicted the TDD shape: Step 2 was a single forced commit (the type checker rejects removing `AgentInit` fields while call sites still pass them), and `tsc` pinpointed every stale call site exactly as planned.
60
- Zero TDD surprises followed from an accurate plan.
61
- - The fold decision (delete `WorktreeState`, store a mutable `WorktreeInfo` in `WorktreeIsolation`) preserved the in-place `branch` mutation that `WorktreeManager.cleanup` relies on — the top planning risk never materialized because it was designed around up front.
62
- - Pre-completion reviewer returned a clean PASS on first dispatch with no findings.
63
-
64
- #### What caused friction (agent side)
65
-
66
- - `instruction-violation` (self-identified) — the `tdd-plan` "Verify green baseline" step says "stop and report" on any failed check, but the baseline `pnpm run lint` failed on 5 pre-existing orphaned issue-link definitions in `architecture.md` (from an earlier Phase 15 archive commit).
67
- I fixed them as a separate `docs:` cleanup commit and proceeded rather than stopping.
68
- This was the pragmatic call and matches the end-of-session rule ("Fix all failures — including pre-existing ones"), but the two prompt sections give opposite guidance for pre-existing failures.
69
- Impact: no rework; one momentary judgment call against a contradictory prompt.
70
- - `missing-context` (user-caught) — in planning I posed the fold-vs-wrap choice to the user via `ask_user`, and the user responded by asking whether the architecture doc had already decided it.
71
- The Phase 16 target table I had read already lists `WorktreeIsolation` as absorbing `worktreeState`, so the answer was partly in the doc.
72
- Impact: one extra round-trip, no rework; confirming was still defensible since the issue body only mentioned losing 2 fields.
73
-
74
- #### What caused friction (user side)
75
-
76
- - None notable.
77
- User involvement was a single low-cost confirmation; the rest was strategic delegation.
78
-
79
- ### Diagnostic details
80
-
81
- - **Model-performance correlation** — the only subagent dispatch was the `pre-completion-reviewer`, running on `claude-sonnet-4-6-20260526` (declared in `.pi/agents/pre-completion-reviewer.md`).
82
- Appropriate: judgment-heavy review work on a capable model, read-only tools.
83
- - **Escalation-delay tracking** — no `rabbit-hole` friction; the baseline lint was diagnosed and fixed in 3 tool calls (investigate refs → edit → re-lint).
84
- - **Feedback-loop gap analysis** — verification ran incrementally: `pnpm vitest run <file>` after each red and green phase, `pnpm run check` after the interface change, full suite + `fallow dead-code` from repo root before shipping.
85
- No end-loaded verification gap.
86
-
87
- ### Changes made
88
-
89
- 1. `.pi/prompts/tdd-plan.md` — reconciled the "Verify green baseline" section with the end-of-session "fix pre-existing failures" rule: trivial pre-existing failures on untouched files may be fixed as a separate cleanup commit to establish a green baseline; non-trivial or unexplained failures still stop and report.
@@ -1,33 +0,0 @@
1
- ---
2
- issue: 257
3
- issue_title: "Extract ChildSessionFactory from runner"
4
- ---
5
-
6
- # Retro: #257 — Extract ChildSessionFactory from runner
7
-
8
- > Superseded — #257 closed `not_planned`; the work was reframed as Phase 16 "invert dependencies" ([ADR-0002], issues #261–#265).
9
-
10
- ## Stage: Planning (2026-05-29T00:32:12Z)
11
-
12
- ### Session summary
13
-
14
- Produced the implementation plan for Phase 16, Step 2 — extracting session *creation* out of `runAgent()` into a `ChildSessionFactory` collaborator while leaving session *interaction* in the runner.
15
- The plan is a lift-and-shift: `runAgent()` keeps its `(snapshot, type, prompt, options, deps)` signature and delegates creation to a new `ConcreteChildSessionFactory`, so the existing 313-line runner test suite keeps passing through delegation.
16
- `#256` (`WorktreeIsolation`) is already merged; this step is independent of it and gates Steps 3-4.
17
-
18
- ### Observations
19
-
20
- - Two deliberate refinements of the issue's interface sketch, both forced by the lift-and-shift and documented in the plan:
21
- - `ChildSessionResult` adds `agentMaxTurns?: number` — the turn-limit resolution lives in the interaction half but `cfg.agentMaxTurns` is only known after `assembleSessionConfig`, which moves into the factory.
22
- Carrying one field across the seam (not the whole `SessionConfig`) is the ISP-narrow choice.
23
- - `ChildSessionConfig` is kept narrow (six creation inputs); the issue's target also lists `prompt`/`maxTurns`/`getRunConfig`, but those are interaction concerns that would violate ISP for a creation-only factory.
24
- - Deferred `ConcreteAgentRunner.createFactory()` to Step 3 (#258) even though the issue lists it as a Step 2 outcome.
25
- Adding it now yields an unused class member (fallow flags it): `runAgent` builds the factory directly, and `AgentManager` — the eventual `createFactory` caller — is not wired until Step 3.
26
- The factory still has a production consumer this step (`runAgent`), so it is not dead.
27
- - The permission-bridge `vi.mock()` is path-based, so moving the `registerChildSession`/`unregisterChildSession` import from `agent-runner.ts` into the factory does not break the existing mock — it intercepts the factory's import unchanged.
28
- - Type-only import of `RunnerDeps` (factory → runner) plus value import of the factory class (runner → factory) is a one-way runtime arrow; `import type` erasure means no real cycle.
29
- - `RunResult.sessionFile` shifts from a late `sessionManager.getSessionFile()` to the factory's `outputFile` — same value (stable after `newSession()`); the existing `/sessions/child.jsonl` assertion is the guard.
30
- - Did not invoke `ask_user`: the issue's "Proposed change" is prescriptive, and the two deviations are forced/justified rather than open-ended.
31
- - IO interfaces (`RunnerIO`, `RunnerDeps`, etc.) intentionally stay in `agent-runner.ts` for this step to minimize churn; their relocation to the factory module is flagged as an Open Question for Step 4 when the runner dissolves.
32
-
33
- [ADR-0002]: ../decisions/0002-extensions-on-a-minimal-core.md
@@ -1,89 +0,0 @@
1
- ---
2
- issue: 262
3
- issue_title: "Add WorkspaceProvider extension seam"
4
- ---
5
-
6
- # Retro: #262 — Add WorkspaceProvider extension seam
7
-
8
- ## Stage: Planning (2026-05-29T14:51:15Z)
9
-
10
- ### Session summary
11
-
12
- Produced a numbered implementation plan for the Phase 16, Step 2 `WorkspaceProvider` seam ([ADR-0002]).
13
- The plan adds the seam additively — `WorkspaceProvider` / `Workspace` interfaces, `SubagentsService.registerWorkspaceProvider`, run-start consultation, and `dispose` with a verbatim `resultAddendum` — while leaving the existing `isolation: "worktree"` path untouched for #263 to evict.
14
- Three TDD steps (two `feat`, one `docs`).
15
-
16
- ### Observations
17
-
18
- - Two ambiguous choices were surfaced via `ask_user` and resolved: **scope = additive seam only** (Option A — leave the legacy worktree path; #263 evicts it), and **duplicate registration = throw** (loud misconfiguration surface, disposer clears only the active provider).
19
- - The package's public surface is `./src/service.ts` (per `package.json` `exports`), so the seam types are defined in a new core `src/lifecycle/workspace.ts` and re-exported from `service.ts` — avoiding a `service ↔ lifecycle` import cycle while still exposing them to the worktrees consumer.
20
- - Diverged from the issue's literal `Disposable` return type: the repo convention for unsubscribe/unregister is a plain `() => void` (matching `SubscribableSession.subscribe` and `pi.events.on`); no `Symbol.dispose` usage exists anywhere in the codebase.
21
- - Provider-first precedence was chosen so the new seam and the legacy worktree collaborator never silently conflict during the transient dual-path window (#263 collapses the branch).
22
- - Headline risk is the ADR "no vacant hooks" rule: within #262 the seam is exercised only by test fakes, so it must land **alongside** #263 (`@gotgenes/pi-subagents-worktrees`) and not ship in a release on its own.
23
- - Step 1 bundles the entire registration surface (types, `SubagentsService` method, adapter impl, `AgentManagerLike`, required `baseCwd`) into one commit because the interface method forces the adapter and the required field forces both construction sites — splitting would not type-check.
24
- - Verified `test/service/service.test.ts` casts its mock `as unknown as SubagentsService`, so adding an interface method does not break it; flagged the `createManager` and `AgentManagerLike` mock updates for the `baseCwd` and registration additions.
25
-
26
- ## Stage: Implementation — TDD (2026-05-29T15:09:49Z)
27
-
28
- ### Session summary
29
-
30
- Implemented the `WorkspaceProvider` seam across three TDD cycles (two `feat`, one `docs`): the registration surface (`AgentManager.registerWorkspaceProvider` + service/adapter delegation + `workspace.ts` types), run-start consumption in `Agent.run()` with provider-first precedence and `dispose`/`resultAddendum`, and an architecture-doc update.
31
- Test count went from 1049 to 1061 (+12 new tests; +6 in `agent.test.ts`, +4 registration in `agent-manager.test.ts`, +1 adapter delegation, plus existing-helper additions).
32
- All deterministic gates green: `check`, `lint`, `test`, and `fallow dead-code` (run from repo root).
33
-
34
- ### Observations
35
-
36
- - Deviation from plan (Module-Level Changes): the plan said `service.ts` would re-export "the five seam types and `AgentStatus`", but `fallow dead-code` flagged those five re-exports as unused (no consumer until #263), and AGENTS.md forbids speculative re-exports.
37
- Resolved by re-exporting only `WorkspaceProvider` — a consumer assigning to it gets `Workspace` and the context types via inference; #263 adds named re-exports when it imports them.
38
- This is the concrete manifestation of the plan's headline "vacant hook" risk surfacing in the dead-code gate.
39
- - Lint surprise: `WorkspaceDisposeResult | void` tripped eslint `no-invalid-void-type`.
40
- Changed the `dispose` return type to `WorkspaceDisposeResult | undefined` (equivalent — a side-effecting `dispose` that falls off the end returns `undefined`); minor divergence from the issue's literal `| void`.
41
- - Three test mock factories implement `AgentManagerLike` in `service-adapter.test.ts` (`createMockManager`, `defaultManager`, `createTestManager`) — all three needed the new `registerWorkspaceProvider` stub; `tsc` caught the third after the first two were updated.
42
- - Used `git commit --fixup` + `--autosquash` rebase twice (unpushed history) to fold the fallow trim into the Step 1 `feat` commit and the reviewer's doc-wording fix into the Step 3 `docs` commit, keeping each commit self-consistent.
43
- - Pre-completion reviewer: WARN — all blocking checks pass; one non-blocking doc finding (architecture.md overstated that `Workspace` is re-exported).
44
- Addressed before finishing.
45
-
46
- ## Stage: Final Retrospective (2026-05-29T15:40:54Z)
47
-
48
- ### Session summary
49
-
50
- Shipped #262: pushed, CI green, closed the issue, and merged release-please PR #269 → `pi-subagents-v11.5.0`.
51
- Mid-session the user asked what `model: claude-sonnet-4-6-20260526` in `.pi/agents/pre-completion-reviewer.md` resolved to; investigation found it had no entry in Pi's model registry and was silently falling back to the parent session model, and the fix (`anthropic/claude-sonnet-4-6`) landed in `1e46c5f4`.
52
- Across all stages the plan's risk predictions held and TDD verification was incremental.
53
-
54
- ### Observations
55
-
56
- #### What went well
57
-
58
- - The planning-stage "vacant hook" risk prediction manifested exactly as predicted at the `fallow dead-code` gate: the plan named the failure (speculative re-exports flagged dead) before it happened, and the fix (re-export only `WorkspaceProvider`) was already reasoned out — a clean closed loop from planning risk to implementation gate.
59
- - Incremental verification during TDD: `check` / `test` / `lint` ran after each step plus per-file vitest red→green, not just at the end.
60
- - The model-spec question surfaced and fixed a latent silent bug — the reviewer's configured `model:` had no registry entry and was inheriting the parent model, so the misconfiguration produced no error.
61
- - Cost discipline: the session model was switched to `opencode-go/deepseek-v4-flash` for the mechanical shipping stage — appropriate model-to-task matching.
62
-
63
- #### What caused friction (agent side)
64
-
65
- - `rabbit-hole` — the model-resolution investigation (≈30 tool calls, turns 119–160) grepped the Pi core monorepo (`~/development/pi/pi/packages/coding-agent`) for `.pi/agents/` frontmatter handling that does not live there, before landing on `pi-prompt-template-model/model-selection.ts` (a `pi-packages` dependency) plus the `models.generated.ts` registry.
66
- Impact: long detour on a user tangent; no rework, but the answer was reachable far sooner.
67
- - `other` (minor, recurring) — the pre-commit `trim trailing whitespace` hook reformatted files on the first `git commit`, failing it; the immediate retry succeeded (turns 55→56 and 95→96).
68
- Impact: one wasted commit attempt per occurrence, no rework.
69
-
70
- #### What caused friction (user side)
71
-
72
- - The broken model spec was pre-existing config; because the failure mode is a silent fallback, such typos never surface on their own.
73
- Opportunity (not criticism): a short convention note so future `.pi/agents/*.md` authoring uses the registry-resolvable `provider/id` form.
74
-
75
- ### Diagnostic details
76
-
77
- - **Model-performance correlation** — the `pre-completion-reviewer` subagent was dispatched (turn 90) while the parent model was `anthropic/claude-opus-4-8`; because its `model:` frontmatter did not resolve, it ran on opus-4-8 (strong reasoning, appropriate for judgment-heavy review) rather than the configured Sonnet.
78
- No quality mismatch in outcome, but the risk was latent: a weaker parent model would have silently degraded the reviewer.
79
- The shipping stage ran on `deepseek-v4-flash` (mechanical git/CI/release ops) — appropriate.
80
- - **Escalation-delay tracking** — the model-resolution `rabbit-hole` ran ≈30 consecutive search calls on the same goal, far past the 5-call threshold; consulting the `prompt-template-authoring` skill or reading `model-selection.ts` first would have shortcut it.
81
- - **Unused-tool detection** — for that investigation the `prompt-template-authoring` skill (documents template/agent `model:` format) and `code_search` were available but not used; grep over two monorepos was used instead.
82
- - **Feedback-loop gap analysis** — none; verification ran incrementally after each TDD step, not only at the end.
83
-
84
- ### Changes made
85
-
86
- 1. `AGENTS.md` (Pre-completion reviewer subsection) — added a one-line guardrail: agent `model:` frontmatter must use the `provider/id` alias form the Pi CLI/UI accepts, because an ID absent from the model registry silently falls back to the parent session model.
87
- 2. `packages/pi-subagents/docs/retro/0262-add-workspace-provider-seam.md` — this Final Retrospective stage entry.
88
-
89
- [ADR-0002]: ../decisions/0002-extensions-on-a-minimal-core.md
@@ -1,91 +0,0 @@
1
- ---
2
- issue: 264
3
- issue_title: "Remove isolated / extensions:false / noSkills from core"
4
- ---
5
-
6
- # Retro: #264 — Remove isolated / extensions:false / noSkills from core
7
-
8
- ## Stage: Planning (2026-05-30T00:09:21Z)
9
-
10
- ### Session summary
11
-
12
- Planned Phase 16, Step 4: removing the extension-lifecycle-control axis (`isolated`, `extensions: false`, `noSkills`) from the pi-subagents core per [ADR-0002].
13
- Confirmed all three prerequisite Phase 16 steps (#261, #262, #263) are closed, so the explicit "deny-at-use" dependency is satisfied.
14
- Produced a four-cycle TDD plan (`isolated` → `extensions` → `skills`/`noSkills`/preload → docs) and committed it.
15
-
16
- ### Observations
17
-
18
- - Scope expansion decided with the user: the issue names only `isolated` / `extensions: false` / `noSkills`, but `noSkills` is the single mechanism behind **both** skill-restriction modes (`skills: false` and `skills: string[]` preload).
19
- Removing `noSkills` without also removing `AgentConfig.skills` would leave a field that silently stops restricting.
20
- Chose the **collapse-skills-fully** option (symmetric with `extensions`): retire `AgentConfig.skills`, `skill-loader.ts`, `safe-fs.ts` (sole consumer was the skill loader), `preloadSkills`, `PromptExtras`, and `extras.skillBlocks`.
21
- Children always inherit Pi's full skill system — the `skills: true` path.
22
- - The recursion guard's `if (cfg.extensions)` gate is removed in the `extensions` cycle (cycle 2), since `SessionConfig.extensions` disappears there.
23
- A guard-always-runs assertion replaces the deleted "extensions: false skips the filter entirely" test.
24
- - This is a **breaking** change (`feat!:`): public `SpawnOptions.isolated` and the `isolated:` / `extensions:` / `skills:` custom-agent frontmatter keys are removed.
25
- Custom agents with legacy frontmatter will silently ignore those keys (matches the Phase 14 precedent for `disallowed_tools`).
26
- - Sequencing note surfaced to the user: some `isolated`-threading removed here (`RunOptions.isolated`, `Agent.run()` plumbing) is structure that Step 5 (#265, dissolve the runner) will delete anyway — small, unavoidable, and #265 depends on this step, so no reordering benefit.
27
- - Helper-file churn accepted: `test/helpers/runner-io.ts` is touched in all three removal cycles (one field per cycle); ordering is fixed (`isolated` → `extensions` → `skills`) so no cycle leaves a dangling reference.
28
- - Doc updates identified: `docs/architecture/architecture.md` (Mermaid session subgraph, directory tree, `SpawnOptions`/`RunOptions` field lists, roadmap status) and the `package-pi-subagents` SKILL.md session-domain row (8 → 6 modules).
29
-
30
- ## Stage: Implementation — TDD (2026-05-30T00:38:00Z)
31
-
32
- ### Session summary
33
-
34
- Executed all four plan cycles (`isolated` → `extensions` + unconditional guard → `skills`/`noSkills`/preload → docs) as three `feat!:` commits plus one `docs:` commit.
35
- The extension-lifecycle-control axis and the `skills` curation axis are gone; children always inherit the parent's extensions and full skill system, and the recursion guard is unconditional.
36
- Test count went 1016 → 951 (−65): deleted `skill-loader.test.ts` and `safe-fs.test.ts`, plus removed isolated/extensions/skills/preload-specific cases; `check`, `lint`, `fallow dead-code`, and `verify:public-types` all green.
37
-
38
- ### Observations
39
-
40
- - The plan's cycle split held up cleanly.
41
- The only interleaving friction was `test/config/custom-agents.test.ts`, where `extensions` and `skills` assertions shared the same `it` blocks.
42
- Handled it by retitling the shared tests to skills-only in cycle 2 (keeping skills compiling/passing), then deleting them in cycle 3 — no dangling references between commits.
43
- - BSD `sed` (macOS) does not support `\|` alternation in basic regex; the standalone-fixture-line deletions needed `sed -E`.
44
- Worth remembering for future bulk fixture removals.
45
- - Two in-scope judgment calls beyond the literal plan: (1) kept the generic tag-rendering test in `result-renderer.test.ts` by swapping the example tag `"isolated"` → `"inherit context"` rather than deleting coverage; (2) removed the now-unused `vi` import from `custom-agents.test.ts` after dropping the extensions-deprecation-warning test.
46
- - The `spawn-config.test.ts` `agentInvocation` snapshot carried a stale `isolation: undefined` leftover (from the #263 worktree eviction) that `toEqual` had been silently ignoring; removed it alongside `isolated: false` for a clean exact-match assertion.
47
- - `verify:public-types` confirmed the breaking `SpawnOptions.isolated` removal type-checks against an external consumer; no lockfile changes; `dist/` correctly gitignored after the type-bundle build.
48
- - Pre-completion reviewer: **PASS** — both acceptance criteria code-verified, all deterministic checks green, 6 Mermaid diagrams render, docs accurate, zero dead code.
49
-
50
- ## Stage: Final Retrospective (2026-05-30T01:13:26Z)
51
-
52
- ### Session summary
53
-
54
- Shipped #264 end-to-end across three stages (Planning → TDD → Ship) in one conversation: planned the four-cycle removal, implemented it as three `feat!:` commits plus docs, and released `pi-subagents-v13.0.0` via the release-please PR (#276).
55
- The run had zero rework and a PASS pre-completion review; test count moved 1016 → 951.
56
-
57
- ### Observations
58
-
59
- #### What went well
60
-
61
- - The planning-stage `ask-user` gate caught a real scope trap before any code was written.
62
- The issue named three fields (`isolated`, `extensions: false`, `noSkills`), but `noSkills` turned out to be the single mechanism behind **two** skill-restriction modes (skill-disable and `skills: string[]` preload).
63
- Removing it while keeping `AgentConfig.skills` would have left a field that silently stops restricting — a mid-cycle-3 wall.
64
- Catching it at planning time expanded the clean scope to four collapsing fields and produced a symmetric, reviewable plan.
65
- - The four-cycle split (`isolated` → `extensions` + unconditional guard → `skills`/`noSkills`/preload → docs) held with no cross-cycle dangling references, validating the lift-and-shift discipline for shared-interface removal.
66
- - Verification ran incrementally (`pnpm run check` + `pnpm run test` after every cycle), so each commit landed green; the only end-of-run surprise was a pre-commit `end-of-file-fixer` hook touching `custom-agents.ts` (handled with a re-add, no rework).
67
-
68
- #### What caused friction (agent side)
69
-
70
- - `other` (tooling) — BSD `sed` on macOS does not support `\|` alternation in basic regex; the first bulk fixture-deletion attempt silently matched nothing.
71
- Impact: one wasted tool call, no rework; resolved by switching to `sed -E`.
72
-
73
- #### What caused friction (user side)
74
-
75
- - The opening sequencing question ("is there work that should precede this") was first read literally as a prerequisite check (#261/#262/#263), and the user had to rephrase to get at the within-issue sequencing point that surfaced the `noSkills`/`skills` coupling.
76
- Opportunity, not criticism: offering both readings of an ambiguous "what comes first" question up front would have reached the valuable discovery one turn sooner.
77
-
78
- #### Diagnostic details
79
-
80
- - **Model-performance correlation** — one subagent dispatch (`pre-completion-reviewer`, 325s, 43 tool uses) on a judgment-heavy review task; appropriate assignment.
81
- No Explore/Plan subagents were needed — planning-stage exploration was direct file reads and targeted greps, efficient for this removal's scope.
82
- - **Escalation-delay tracking** — no rabbit-holes; the `sed` issue resolved in one retry.
83
- - **Feedback-loop gap analysis** — no gap; `check`/`test`/`lint` ran after each cycle, with `fallow dead-code` and `verify:public-types` at the end.
84
-
85
- ### Changes made
86
-
87
- 1. Appended this Final Retrospective stage entry to `packages/pi-subagents/docs/retro/0264-remove-extension-lifecycle-control.md`.
88
- 2. Considered but **declined** (user: "too narrow") a removal-coupling detection rule for `.pi/prompts/plan-issue.md` — the heuristic that a field named for removal may be the mechanism behind a separate surviving feature.
89
- No prompt or `AGENTS.md` changes were made this retro.
90
-
91
- [ADR-0002]: ../decisions/0002-extensions-on-a-minimal-core.md