@gotgenes/pi-subagents 6.17.1 → 6.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/docs/architecture/architecture.md +8 -9
- package/docs/plans/0164-reorganize-into-domain-directories.md +409 -0
- package/docs/retro/0164-reorganize-into-domain-directories.md +82 -0
- package/package.json +7 -2
- package/src/{agent-types.ts → config/agent-types.ts} +2 -2
- package/src/{custom-agents.ts → config/custom-agents.ts} +5 -4
- package/src/{default-agents.ts → config/default-agents.ts} +1 -1
- package/src/{invocation-config.ts → config/invocation-config.ts} +1 -1
- package/src/handlers/index.ts +2 -2
- package/src/handlers/lifecycle.ts +2 -1
- package/src/index.ts +27 -26
- package/src/{agent-manager.ts → lifecycle/agent-manager.ts} +17 -14
- package/src/{agent-record.ts → lifecycle/agent-record.ts} +6 -6
- package/src/{agent-runner.ts → lifecycle/agent-runner.ts} +9 -9
- package/src/{parent-snapshot.ts → lifecycle/parent-snapshot.ts} +2 -1
- package/src/{worktree-state.ts → lifecycle/worktree-state.ts} +1 -1
- package/src/{worktree.ts → lifecycle/worktree.ts} +1 -1
- package/src/{notification.ts → observation/notification.ts} +4 -4
- package/src/{record-observer.ts → observation/record-observer.ts} +3 -2
- package/src/{renderer.ts → observation/renderer.ts} +2 -2
- package/src/runtime.ts +2 -2
- package/src/{service-adapter.ts → service/service-adapter.ts} +7 -7
- package/src/{service.ts → service/service.ts} +2 -1
- package/src/{context.ts → session/context.ts} +2 -0
- package/src/{env.ts → session/env.ts} +2 -2
- package/src/{memory.ts → session/memory.ts} +2 -2
- package/src/{model-resolver.ts → session/model-resolver.ts} +2 -1
- package/src/{prompts.ts → session/prompts.ts} +4 -4
- package/src/{session-config.ts → session/session-config.ts} +5 -5
- package/src/{skill-loader.ts → session/skill-loader.ts} +3 -3
- package/src/tools/agent-tool.ts +14 -14
- package/src/tools/background-spawner.ts +8 -8
- package/src/tools/foreground-runner.ts +16 -15
- package/src/tools/get-result-tool.ts +6 -6
- package/src/tools/helpers.ts +4 -4
- package/src/tools/spawn-config.ts +7 -6
- package/src/tools/steer-tool.ts +3 -3
- package/src/types.ts +1 -1
- package/src/ui/agent-activity-tracker.ts +1 -1
- package/src/ui/agent-config-editor.ts +6 -5
- package/src/ui/agent-creation-wizard.ts +5 -5
- package/src/ui/agent-menu.ts +10 -9
- package/src/ui/agent-widget.ts +7 -8
- package/src/ui/conversation-viewer.ts +7 -7
- package/src/ui/display.ts +2 -2
- package/src/ui/ui-observer.ts +2 -1
- package/src/ui/widget-renderer.ts +5 -5
- /package/src/{execution-state.ts → lifecycle/execution-state.ts} +0 -0
- /package/src/{usage.ts → lifecycle/usage.ts} +0 -0
- /package/src/{notification-state.ts → observation/notification-state.ts} +0 -0
- /package/src/{session-dir.ts → session/session-dir.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,38 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [6.18.0](https://github.com/gotgenes/pi-packages/compare/pi-subagents-v6.17.2...pi-subagents-v6.18.0) (2026-05-24)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* add eslint config with type-aware rules and import enforcement ([4fb3cc6](https://github.com/gotgenes/pi-packages/commit/4fb3cc678da10d350b85c464318476ba9ae99dca))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* **pi-subagents:** add missing "type": "module" to package.json ([8cfd07d](https://github.com/gotgenes/pi-packages/commit/8cfd07dfbfd44f52dc43ac7ae67d5824304825ae))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Documentation
|
|
22
|
+
|
|
23
|
+
* **retro:** add retro notes for issue [#164](https://github.com/gotgenes/pi-packages/issues/164) ([d8e2861](https://github.com/gotgenes/pi-packages/commit/d8e28615d6adabc86415f4d41ffd1bd90184fd0f))
|
|
24
|
+
|
|
25
|
+
## [6.17.2](https://github.com/gotgenes/pi-packages/compare/pi-subagents-v6.17.1...pi-subagents-v6.17.2) (2026-05-23)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* add package.json imports field for #src/#test path aliases ([#157](https://github.com/gotgenes/pi-packages/issues/157)) ([75b4598](https://github.com/gotgenes/pi-packages/commit/75b45980810583452f7741678359c004900c8bd0))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Documentation
|
|
34
|
+
|
|
35
|
+
* plan reorganize pi-subagents source into domain directories ([#164](https://github.com/gotgenes/pi-packages/issues/164)) ([40d1214](https://github.com/gotgenes/pi-packages/commit/40d1214ea806215a5a5cda092bf24de3ebb0a195))
|
|
36
|
+
* **retro:** add planning stage notes for issue [#164](https://github.com/gotgenes/pi-packages/issues/164) ([947ec91](https://github.com/gotgenes/pi-packages/commit/947ec91f86de214a637e9d76348c32cb8a743dc4))
|
|
37
|
+
* **retro:** add TDD stage notes for issue [#164](https://github.com/gotgenes/pi-packages/issues/164) ([3f075cd](https://github.com/gotgenes/pi-packages/commit/3f075cd01c8517e6322a98bf7c51831fce861ce2))
|
|
38
|
+
* update architecture doc to reflect domain directory restructuring ([#164](https://github.com/gotgenes/pi-packages/issues/164)) ([a8c912d](https://github.com/gotgenes/pi-packages/commit/a8c912d065e6b3627ea617fadbaa95a470dfe1d5))
|
|
39
|
+
|
|
8
40
|
## [6.17.1](https://github.com/gotgenes/pi-packages/compare/pi-subagents-v6.17.0...pi-subagents-v6.17.1) (2026-05-23)
|
|
9
41
|
|
|
10
42
|
|
|
@@ -221,8 +221,8 @@ sequenceDiagram
|
|
|
221
221
|
## Module organization
|
|
222
222
|
|
|
223
223
|
The extension has 53 source files (7,288 LOC) organized into six domains plus entry-point wiring.
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
All eight domains now have directories: `config/`, `session/`, `lifecycle/`, `observation/`, `service/`, `tools/`, `ui/`, and `handlers/`.
|
|
225
|
+
Issue #164 moved the 26 previously flat root-level files into the five new domain directories.
|
|
226
226
|
|
|
227
227
|
### Current layout
|
|
228
228
|
|
|
@@ -661,15 +661,14 @@ The runner would accept `EnvironmentIO & SessionFactoryIO` (keeping backward com
|
|
|
661
661
|
|
|
662
662
|
Phase 10 addresses the structural gaps identified in this analysis: flat code organization, oversized dependency bags, and complexity hotspots.
|
|
663
663
|
|
|
664
|
-
### Step 1: Reorganize source into domain directories ([#164][164])
|
|
664
|
+
### Step 1: Reorganize source into domain directories ([#164][164]) ✓ Done
|
|
665
665
|
|
|
666
|
-
|
|
666
|
+
Moved files into `config/`, `session/`, `lifecycle/`, `observation/`, and `service/` subdirectories.
|
|
667
|
+
All `src/` internal imports now use `#src/` path aliases (same style as `test/` files), eliminating relative depth arithmetic for future moves.
|
|
667
668
|
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
-
|
|
671
|
-
- Reduces cognitive load when navigating the codebase (5 root files + 8 directories vs. 31 root files + 3 directories).
|
|
672
|
-
- Co-locates related files, making subsequent refactoring easier.
|
|
669
|
+
- Domain model is now visible in the filesystem.
|
|
670
|
+
- Root reduced to 5 files + 8 directories (was 31 files + 3 directories).
|
|
671
|
+
- All subsequent steps can move or extract files without `../` import churn.
|
|
673
672
|
|
|
674
673
|
### Step 2: Decompose ResolvedSpawnConfig ([#165][165])
|
|
675
674
|
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
---
|
|
2
|
+
issue: 164
|
|
3
|
+
issue_title: "refactor(pi-subagents): reorganize source into domain directories"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Reorganize `pi-subagents` source into domain directories
|
|
7
|
+
|
|
8
|
+
## Problem Statement
|
|
9
|
+
|
|
10
|
+
The `src/` directory has 26 files at the root level spanning four ungrouped domains (`config`, `session`, `lifecycle`, `observation`) plus two more (`service`, kept-root files).
|
|
11
|
+
The domain model is documented in `docs/architecture/architecture.md`, but only three domains (`tools/`, `ui/`, `handlers/`) have directories.
|
|
12
|
+
The flat layout makes it hard to reason about domain boundaries and navigate to related files.
|
|
13
|
+
|
|
14
|
+
## Goals
|
|
15
|
+
|
|
16
|
+
- Move the 26 flat `src/` domain files into five new subdirectories (`config/`, `session/`,
|
|
17
|
+
`lifecycle/`, `observation/`, `service/`).
|
|
18
|
+
- Mirror the new structure in `test/` by moving the 25 corresponding test files.
|
|
19
|
+
- Update every import path (relative imports in `src/`; `#src/` aliases in `test/`).
|
|
20
|
+
- Leave `index.ts`, `runtime.ts`, `types.ts`, `settings.ts`, `debug.ts` at the `src/` root.
|
|
21
|
+
- Preserve all existing behavior — no logic changes, no interface changes, no test logic changes.
|
|
22
|
+
|
|
23
|
+
## Non-Goals
|
|
24
|
+
|
|
25
|
+
- Moving `handlers/`, `tools/`, or `ui/` — these directories already exist.
|
|
26
|
+
- Consolidating the three UI test files (`conversation-viewer.test.ts`, `display.test.ts`,
|
|
27
|
+
`widget-renderer.test.ts`) that are misplaced at `test/` root — pre-existing inconsistency,
|
|
28
|
+
out of scope.
|
|
29
|
+
- Any refactoring of module interfaces or logic — this is a pure filesystem reorganization.
|
|
30
|
+
|
|
31
|
+
## Background
|
|
32
|
+
|
|
33
|
+
Issue #157 (completed) removed all `.js` suffixes from relative imports and introduced `#src/*` path aliases in `tsconfig.json` and `vitest.config.ts`.
|
|
34
|
+
This cleanup makes the current reorganization straightforward:
|
|
35
|
+
|
|
36
|
+
- `src/` files use short relative imports (`"./X"`, `"../X"`) with no suffix noise.
|
|
37
|
+
- `test/` files use `#src/X` alias imports; after the move they become `#src/domain/X`.
|
|
38
|
+
No `../../src/` depth changes are needed in test files.
|
|
39
|
+
|
|
40
|
+
`vitest.config.ts` uses `include: ["test/**/*.test.ts"]` so moved test files are automatically discovered in subdirectories without config changes.
|
|
41
|
+
|
|
42
|
+
## Design Overview
|
|
43
|
+
|
|
44
|
+
### Target layout
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
src/
|
|
48
|
+
config/ agent-types, default-agents, custom-agents, invocation-config
|
|
49
|
+
session/ session-config, prompts, context, memory, skill-loader, env, model-resolver, session-dir
|
|
50
|
+
lifecycle/ agent-manager, agent-runner, agent-record, parent-snapshot,
|
|
51
|
+
execution-state, worktree, worktree-state, usage
|
|
52
|
+
observation/ record-observer, notification, notification-state, renderer
|
|
53
|
+
service/ service, service-adapter
|
|
54
|
+
handlers/ (unchanged)
|
|
55
|
+
tools/ (unchanged)
|
|
56
|
+
ui/ (unchanged)
|
|
57
|
+
index.ts (unchanged)
|
|
58
|
+
runtime.ts (unchanged)
|
|
59
|
+
types.ts (unchanged)
|
|
60
|
+
settings.ts (unchanged)
|
|
61
|
+
debug.ts (unchanged)
|
|
62
|
+
|
|
63
|
+
test/
|
|
64
|
+
config/ agent-types.test.ts, custom-agents.test.ts, invocation-config.test.ts
|
|
65
|
+
session/ env.test.ts, memory.test.ts, model-resolver.test.ts, prompts.test.ts,
|
|
66
|
+
session-config.test.ts, session-dir.test.ts, skill-loader.test.ts
|
|
67
|
+
lifecycle/ agent-manager.test.ts, agent-record.test.ts, agent-runner.test.ts,
|
|
68
|
+
agent-runner-extension-tools.test.ts, agent-runner-settings.test.ts,
|
|
69
|
+
parent-snapshot.test.ts, usage.test.ts, worktree.test.ts, worktree-state.test.ts
|
|
70
|
+
observation/ notification.test.ts, notification-state.test.ts, record-observer.test.ts,
|
|
71
|
+
renderer.test.ts
|
|
72
|
+
service/ service.test.ts, service-adapter.test.ts
|
|
73
|
+
handlers/ (unchanged)
|
|
74
|
+
helpers/ (unchanged)
|
|
75
|
+
tools/ (unchanged)
|
|
76
|
+
ui/ (unchanged)
|
|
77
|
+
(root) debug.test.ts, display.test.ts, conversation-viewer.test.ts,
|
|
78
|
+
widget-renderer.test.ts, print-mode.test.ts, runtime.test.ts, settings.test.ts
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Import-path update rules
|
|
82
|
+
|
|
83
|
+
When a file at `src/X.ts` moves to `src/domain/X.ts`, three sets of paths change:
|
|
84
|
+
|
|
85
|
+
1. **Moved file's own imports** — previously `"./Y"` becomes:
|
|
86
|
+
- `"./Y"` if `Y` is in the same domain directory
|
|
87
|
+
- `"../Y"` if `Y` stays at the `src/` root (`debug`, `types`, `runtime`)
|
|
88
|
+
- `"../other-domain/Y"` if `Y` moves to a different domain
|
|
89
|
+
|
|
90
|
+
2. **`src/` consumers** — files in `tools/`, `ui/`, or at the root that previously imported
|
|
91
|
+
`"../X"` or `"./X"` update to `"../domain/X"` or `"./domain/X"` respectively.
|
|
92
|
+
|
|
93
|
+
3. **`test/` consumers** — `#src/X` aliases become `#src/domain/X`; relative
|
|
94
|
+
test-helper imports like `"./helpers/mock-session"` become `"../helpers/mock-session"` for
|
|
95
|
+
files that move one level deeper.
|
|
96
|
+
|
|
97
|
+
### Circular dependency between `lifecycle` and `observation`
|
|
98
|
+
|
|
99
|
+
`lifecycle/agent-manager.ts` imports `observation/notification-state` and `observation/record-observer`; `observation/record-observer.ts` imports `lifecycle/agent-manager` and `lifecycle/agent-record`.
|
|
100
|
+
These two domains must be moved in the same commit to avoid a broken intermediate state.
|
|
101
|
+
|
|
102
|
+
### Commit ordering
|
|
103
|
+
|
|
104
|
+
To keep each commit green, the commits follow dependency order:
|
|
105
|
+
|
|
106
|
+
1. `config/` — no cross-domain `src/` deps (imports only `debug`, `types`)
|
|
107
|
+
2. `session/` — no cross-domain `src/` deps (imports only `debug`, `types`, siblings)
|
|
108
|
+
3. `lifecycle/` + `observation/` together — circular cross-dependency
|
|
109
|
+
4. `service/` — depends on `lifecycle/` and `session/`, both already moved
|
|
110
|
+
|
|
111
|
+
## Module-Level Changes
|
|
112
|
+
|
|
113
|
+
### Step 1 — `config/`
|
|
114
|
+
|
|
115
|
+
New directory `src/config/`, `test/config/`.
|
|
116
|
+
|
|
117
|
+
**Files moved (src):** `agent-types.ts`, `custom-agents.ts`, `default-agents.ts`, `invocation-config.ts`.
|
|
118
|
+
|
|
119
|
+
**Files moved (test):** `agent-types.test.ts`, `custom-agents.test.ts`, `invocation-config.test.ts`.
|
|
120
|
+
|
|
121
|
+
**Imports updated inside moved `src/` files:**
|
|
122
|
+
|
|
123
|
+
| File | Old import | New import |
|
|
124
|
+
| ----------------------------- | -------------------- | ----------------------------------------- |
|
|
125
|
+
| `config/agent-types.ts` | `"./default-agents"` | `"./default-agents"` (sibling, unchanged) |
|
|
126
|
+
| `config/agent-types.ts` | `"./types"` | `"../types"` |
|
|
127
|
+
| `config/custom-agents.ts` | `"./agent-types"` | `"./agent-types"` (sibling, unchanged) |
|
|
128
|
+
| `config/custom-agents.ts` | `"./debug"` | `"../debug"` |
|
|
129
|
+
| `config/custom-agents.ts` | `"./types"` | `"../types"` |
|
|
130
|
+
| `config/default-agents.ts` | `"./types"` | `"../types"` |
|
|
131
|
+
| `config/invocation-config.ts` | `"./types"` | `"../types"` |
|
|
132
|
+
|
|
133
|
+
**Consumers updated (src):**
|
|
134
|
+
|
|
135
|
+
| Consumer | Old import | New import |
|
|
136
|
+
| --------------------------------- | ------------------------ | ------------------------------------------- |
|
|
137
|
+
| `src/agent-manager.ts` | `"./agent-types"` | `"./config/agent-types"` |
|
|
138
|
+
| `src/agent-runner.ts` | `"./agent-types"` | `"./config/agent-types"` |
|
|
139
|
+
| `src/index.ts` | `"./agent-types"` | `"./config/agent-types"` |
|
|
140
|
+
| `src/index.ts` | `"./custom-agents"` | `"./config/custom-agents"` |
|
|
141
|
+
| `src/index.ts` | `"./invocation-config"` | (now via `spawn-config` — no direct import) |
|
|
142
|
+
| `src/tools/agent-tool.ts` | `"../agent-types"` | `"../config/agent-types"` |
|
|
143
|
+
| `src/tools/get-result-tool.ts` | `"../agent-types"` | `"../config/agent-types"` |
|
|
144
|
+
| `src/tools/helpers.ts` | `"../agent-types"` | `"../config/agent-types"` |
|
|
145
|
+
| `src/tools/spawn-config.ts` | `"../agent-types"` | `"../config/agent-types"` |
|
|
146
|
+
| `src/tools/spawn-config.ts` | `"../invocation-config"` | `"../config/invocation-config"` |
|
|
147
|
+
| `src/ui/agent-config-editor.ts` | `"../agent-types"` | `"../config/agent-types"` |
|
|
148
|
+
| `src/ui/agent-creation-wizard.ts` | `"../agent-types"` | `"../config/agent-types"` |
|
|
149
|
+
| `src/ui/agent-menu.ts` | `"../agent-types"` | `"../config/agent-types"` |
|
|
150
|
+
| `src/ui/agent-widget.ts` | `"../agent-types"` | `"../config/agent-types"` |
|
|
151
|
+
| `src/ui/conversation-viewer.ts` | `"../agent-types"` | `"../config/agent-types"` |
|
|
152
|
+
| `src/ui/display.ts` | `"../agent-types"` | `"../config/agent-types"` |
|
|
153
|
+
|
|
154
|
+
**Consumers updated (test):** All `#src/agent-types` → `#src/config/agent-types`; `#src/custom-agents` → `#src/config/custom-agents`; `#src/invocation-config` → `#src/config/invocation-config`.
|
|
155
|
+
|
|
156
|
+
**Test file relative-import fix:** Test files moving from `test/` root to `test/config/` must update `"./helpers/..."` → `"../helpers/..."` (none of the three config test files use helpers, so no update needed here).
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
### Step 2 — `session/`
|
|
161
|
+
|
|
162
|
+
New directory `src/session/`, `test/session/`.
|
|
163
|
+
|
|
164
|
+
**Files moved (src):** `context.ts`, `env.ts`, `memory.ts`, `model-resolver.ts`, `prompts.ts`, `session-config.ts`, `session-dir.ts`, `skill-loader.ts`.
|
|
165
|
+
|
|
166
|
+
**Files moved (test):** `env.test.ts`, `memory.test.ts`, `model-resolver.test.ts`, `prompts.test.ts`, `session-config.test.ts`, `session-dir.test.ts`, `skill-loader.test.ts`.
|
|
167
|
+
|
|
168
|
+
**Imports updated inside moved `src/` files:**
|
|
169
|
+
|
|
170
|
+
| File | Old | New |
|
|
171
|
+
| --------------------------- | ------------------ | ---------------------------- |
|
|
172
|
+
| `session/env.ts` | `"./debug"` | `"../debug"` |
|
|
173
|
+
| `session/env.ts` | `"./types"` | `"../types"` |
|
|
174
|
+
| `session/memory.ts` | `"./debug"` | `"../debug"` |
|
|
175
|
+
| `session/memory.ts` | `"./types"` | `"../types"` |
|
|
176
|
+
| `session/prompts.ts` | `"./env"` | `"./env"` (sibling) |
|
|
177
|
+
| `session/prompts.ts` | `"./types"` | `"../types"` |
|
|
178
|
+
| `session/session-config.ts` | `"./env"` | `"./env"` (sibling) |
|
|
179
|
+
| `session/session-config.ts` | `"./prompts"` | `"./prompts"` (sibling) |
|
|
180
|
+
| `session/session-config.ts` | `"./skill-loader"` | `"./skill-loader"` (sibling) |
|
|
181
|
+
| `session/session-config.ts` | `"./types"` | `"../types"` |
|
|
182
|
+
| `session/skill-loader.ts` | `"./debug"` | `"../debug"` |
|
|
183
|
+
| `session/skill-loader.ts` | `"./memory"` | `"./memory"` (sibling) |
|
|
184
|
+
|
|
185
|
+
`context.ts`, `model-resolver.ts`, `session-dir.ts` have no internal relative imports.
|
|
186
|
+
|
|
187
|
+
**Consumers updated (src):**
|
|
188
|
+
|
|
189
|
+
| Consumer | Old import | New import |
|
|
190
|
+
| ------------------------------- | --------------------- | ------------------------------------------------ |
|
|
191
|
+
| `src/agent-runner.ts` | `"./context"` | `"./session/context"` |
|
|
192
|
+
| `src/agent-runner.ts` | `"./env"` | `"./session/env"` |
|
|
193
|
+
| `src/agent-runner.ts` | `"./session-config"` | `"./session/session-config"` |
|
|
194
|
+
| `src/index.ts` | `"./env"` | `"./session/env"` |
|
|
195
|
+
| `src/index.ts` | `"./memory"` | `"./session/memory"` |
|
|
196
|
+
| `src/index.ts` | `"./model-resolver"` | `"./session/model-resolver"` |
|
|
197
|
+
| `src/index.ts` | `"./prompts"` | `"./session/prompts"` |
|
|
198
|
+
| `src/index.ts` | `"./session-config"` | (no direct import in index.ts — used via runner) |
|
|
199
|
+
| `src/index.ts` | `"./session-dir"` | `"./session/session-dir"` |
|
|
200
|
+
| `src/index.ts` | `"./skill-loader"` | `"./session/skill-loader"` |
|
|
201
|
+
| `src/parent-snapshot.ts` | `"./context"` | `"./session/context"` |
|
|
202
|
+
| `src/tools/spawn-config.ts` | `"../model-resolver"` | `"../session/model-resolver"` |
|
|
203
|
+
| `src/ui/agent-menu.ts` | `"../model-resolver"` | `"../session/model-resolver"` |
|
|
204
|
+
| `src/ui/conversation-viewer.ts` | `"../context"` | `"../session/context"` |
|
|
205
|
+
|
|
206
|
+
**Consumers updated (test):** `#src/env` → `#src/session/env`; `#src/memory` → `#src/session/memory`; `#src/model-resolver` → `#src/session/model-resolver`; `#src/prompts` → `#src/session/prompts`; `#src/session-config` → `#src/session/session-config`; `#src/session-dir` → `#src/session/session-dir`; `#src/skill-loader` → `#src/session/skill-loader`.
|
|
207
|
+
|
|
208
|
+
**Test file relative-import fix:** Moved test files update `"./helpers/..."` → `"../helpers/..."`.
|
|
209
|
+
Check: none of the seven session test files import test helpers, so no update needed.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
### Step 3 — `lifecycle/` + `observation/` (single commit)
|
|
214
|
+
|
|
215
|
+
New directories `src/lifecycle/`, `src/observation/`, `test/lifecycle/`, `test/observation/`.
|
|
216
|
+
|
|
217
|
+
**Files moved (src/lifecycle):** `agent-manager.ts`, `agent-record.ts`, `agent-runner.ts`, `execution-state.ts`, `parent-snapshot.ts`, `usage.ts`, `worktree-state.ts`, `worktree.ts`.
|
|
218
|
+
|
|
219
|
+
**Files moved (src/observation):** `notification.ts`, `notification-state.ts`, `record-observer.ts`, `renderer.ts`.
|
|
220
|
+
|
|
221
|
+
**Files moved (test/lifecycle):** `agent-manager.test.ts`, `agent-record.test.ts`, `agent-runner.test.ts`, `agent-runner-extension-tools.test.ts`, `agent-runner-settings.test.ts`, `parent-snapshot.test.ts`, `usage.test.ts`, `worktree.test.ts`, `worktree-state.test.ts`.
|
|
222
|
+
|
|
223
|
+
**Files moved (test/observation):** `notification.test.ts`, `notification-state.test.ts`, `record-observer.test.ts`, `renderer.test.ts`.
|
|
224
|
+
|
|
225
|
+
**Imports updated inside moved `src/lifecycle/` files:**
|
|
226
|
+
|
|
227
|
+
| File | Old | New |
|
|
228
|
+
| ------------------------------ | ------------------------ | ------------------------------------- |
|
|
229
|
+
| `lifecycle/agent-manager.ts` | `"./agent-record"` | `"./agent-record"` (sibling) |
|
|
230
|
+
| `lifecycle/agent-manager.ts` | `"./agent-runner"` | `"./agent-runner"` (sibling) |
|
|
231
|
+
| `lifecycle/agent-manager.ts` | `"./agent-types"` | `"../config/agent-types"` |
|
|
232
|
+
| `lifecycle/agent-manager.ts` | `"./debug"` | `"../debug"` |
|
|
233
|
+
| `lifecycle/agent-manager.ts` | `"./notification-state"` | `"../observation/notification-state"` |
|
|
234
|
+
| `lifecycle/agent-manager.ts` | `"./parent-snapshot"` | `"./parent-snapshot"` (sibling) |
|
|
235
|
+
| `lifecycle/agent-manager.ts` | `"./record-observer"` | `"../observation/record-observer"` |
|
|
236
|
+
| `lifecycle/agent-manager.ts` | `"./runtime"` | `"../runtime"` |
|
|
237
|
+
| `lifecycle/agent-manager.ts` | `"./types"` | `"../types"` |
|
|
238
|
+
| `lifecycle/agent-manager.ts` | `"./worktree"` | `"./worktree"` (sibling) |
|
|
239
|
+
| `lifecycle/agent-manager.ts` | `"./worktree-state"` | `"./worktree-state"` (sibling) |
|
|
240
|
+
| `lifecycle/agent-record.ts` | `"./execution-state"` | `"./execution-state"` (sibling) |
|
|
241
|
+
| `lifecycle/agent-record.ts` | `"./notification-state"` | `"../observation/notification-state"` |
|
|
242
|
+
| `lifecycle/agent-record.ts` | `"./types"` | `"../types"` |
|
|
243
|
+
| `lifecycle/agent-record.ts` | `"./usage"` | `"./usage"` (sibling) |
|
|
244
|
+
| `lifecycle/agent-record.ts` | `"./worktree-state"` | `"./worktree-state"` (sibling) |
|
|
245
|
+
| `lifecycle/agent-runner.ts` | `"./agent-types"` | `"../config/agent-types"` |
|
|
246
|
+
| `lifecycle/agent-runner.ts` | `"./context"` | `"../session/context"` |
|
|
247
|
+
| `lifecycle/agent-runner.ts` | `"./env"` | `"../session/env"` |
|
|
248
|
+
| `lifecycle/agent-runner.ts` | `"./parent-snapshot"` | `"./parent-snapshot"` (sibling) |
|
|
249
|
+
| `lifecycle/agent-runner.ts` | `"./session-config"` | `"../session/session-config"` |
|
|
250
|
+
| `lifecycle/agent-runner.ts` | `"./types"` | `"../types"` |
|
|
251
|
+
| `lifecycle/parent-snapshot.ts` | `"./context"` | `"../session/context"` |
|
|
252
|
+
| `lifecycle/worktree.ts` | `"./debug"` | `"../debug"` |
|
|
253
|
+
| `lifecycle/worktree-state.ts` | `"./worktree"` | `"./worktree"` (sibling) |
|
|
254
|
+
|
|
255
|
+
`execution-state.ts`, `usage.ts` have no internal relative imports.
|
|
256
|
+
|
|
257
|
+
**Imports updated inside moved `src/observation/` files:**
|
|
258
|
+
|
|
259
|
+
| File | Old | New |
|
|
260
|
+
| -------------------------------- | ------------------------------- | -------------------------------- |
|
|
261
|
+
| `observation/notification.ts` | `"./debug"` | `"../debug"` |
|
|
262
|
+
| `observation/notification.ts` | `"./types"` | `"../types"` |
|
|
263
|
+
| `observation/notification.ts` | `"./ui/agent-activity-tracker"` | `"../ui/agent-activity-tracker"` |
|
|
264
|
+
| `observation/notification.ts` | `"./usage"` | `"../lifecycle/usage"` |
|
|
265
|
+
| `observation/record-observer.ts` | `"./agent-manager"` | `"../lifecycle/agent-manager"` |
|
|
266
|
+
| `observation/record-observer.ts` | `"./agent-record"` | `"../lifecycle/agent-record"` |
|
|
267
|
+
| `observation/renderer.ts` | `"./notification"` | `"./notification"` (sibling) |
|
|
268
|
+
| `observation/renderer.ts` | `"./ui/display"` | `"../ui/display"` |
|
|
269
|
+
|
|
270
|
+
`notification-state.ts` has no internal relative imports.
|
|
271
|
+
|
|
272
|
+
**Consumers updated (src):**
|
|
273
|
+
|
|
274
|
+
| Consumer | Old import | New import |
|
|
275
|
+
| ---------------------------------- | -------------------------------------- | ---------------------------------- |
|
|
276
|
+
| `src/index.ts` | `"./agent-manager"` | `"./lifecycle/agent-manager"` |
|
|
277
|
+
| `src/index.ts` | `"./agent-runner"` | `"./lifecycle/agent-runner"` |
|
|
278
|
+
| `src/index.ts` | `"./parent-snapshot"` | `"./lifecycle/parent-snapshot"` |
|
|
279
|
+
| `src/index.ts` | `"./worktree"` | `"./lifecycle/worktree"` |
|
|
280
|
+
| `src/index.ts` | `"./notification"` | `"./observation/notification"` |
|
|
281
|
+
| `src/index.ts` | `"./record-observer"` | (not imported directly from index) |
|
|
282
|
+
| `src/index.ts` | `"./renderer"` | `"./observation/renderer"` |
|
|
283
|
+
| `src/runtime.ts` | (no changes — only imports from `ui/`) | — |
|
|
284
|
+
| `src/types.ts` | `"./agent-record"` | `"./lifecycle/agent-record"` |
|
|
285
|
+
| `src/tools/agent-tool.ts` | `"../agent-manager"` | `"../lifecycle/agent-manager"` |
|
|
286
|
+
| `src/tools/agent-tool.ts` | `"../parent-snapshot"` | `"../lifecycle/parent-snapshot"` |
|
|
287
|
+
| `src/tools/background-spawner.ts` | `"../agent-manager"` | `"../lifecycle/agent-manager"` |
|
|
288
|
+
| `src/tools/background-spawner.ts` | `"../parent-snapshot"` | `"../lifecycle/parent-snapshot"` |
|
|
289
|
+
| `src/tools/foreground-runner.ts` | `"../agent-manager"` | `"../lifecycle/agent-manager"` |
|
|
290
|
+
| `src/tools/foreground-runner.ts` | `"../parent-snapshot"` | `"../lifecycle/parent-snapshot"` |
|
|
291
|
+
| `src/tools/get-result-tool.ts` | `"../usage"` | `"../lifecycle/usage"` |
|
|
292
|
+
| `src/tools/helpers.ts` | `"../usage"` | `"../lifecycle/usage"` |
|
|
293
|
+
| `src/tools/spawn-config.ts` | `"../agent-runner"` | `"../lifecycle/agent-runner"` |
|
|
294
|
+
| `src/tools/steer-tool.ts` | `"../usage"` | `"../lifecycle/usage"` |
|
|
295
|
+
| `src/ui/agent-activity-tracker.ts` | `"../usage"` | `"../lifecycle/usage"` |
|
|
296
|
+
| `src/ui/agent-creation-wizard.ts` | `"../parent-snapshot"` | `"../lifecycle/parent-snapshot"` |
|
|
297
|
+
| `src/ui/agent-menu.ts` | `"../parent-snapshot"` | `"../lifecycle/parent-snapshot"` |
|
|
298
|
+
| `src/ui/agent-widget.ts` | `"../agent-manager"` | `"../lifecycle/agent-manager"` |
|
|
299
|
+
| `src/ui/conversation-viewer.ts` | `"../usage"` | `"../lifecycle/usage"` |
|
|
300
|
+
| `src/ui/widget-renderer.ts` | `"../usage"` | `"../lifecycle/usage"` |
|
|
301
|
+
|
|
302
|
+
**Consumers updated (test):** `#src/agent-manager` → `#src/lifecycle/agent-manager`; `#src/agent-record` → `#src/lifecycle/agent-record`; `#src/agent-runner` → `#src/lifecycle/agent-runner`; `#src/parent-snapshot` → `#src/lifecycle/parent-snapshot`; `#src/usage` → `#src/lifecycle/usage`; `#src/worktree` → `#src/lifecycle/worktree`; `#src/worktree-state` → `#src/lifecycle/worktree-state`; `#src/notification` → `#src/observation/notification`; `#src/notification-state` → `#src/observation/notification-state`; `#src/record-observer` → `#src/observation/record-observer`; `#src/renderer` → `#src/observation/renderer`.
|
|
303
|
+
|
|
304
|
+
**Test file relative-import fix:** Moved test files update `"./helpers/..."` → `"../helpers/..."` where used.
|
|
305
|
+
Check: `agent-manager.test.ts`, `agent-record.test.ts`, `agent-runner.test.ts`, `agent-runner-extension-tools.test.ts`, `agent-runner-settings.test.ts`, `record-observer.test.ts` all import test helpers via `"./helpers/..."` — these must change to `"../helpers/..."` after the move.
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
### Step 4 — `service/`
|
|
310
|
+
|
|
311
|
+
New directory `src/service/`, `test/service/`.
|
|
312
|
+
|
|
313
|
+
**Files moved (src):** `service.ts`, `service-adapter.ts`.
|
|
314
|
+
|
|
315
|
+
**Files moved (test):** `service.test.ts`, `service-adapter.test.ts`.
|
|
316
|
+
|
|
317
|
+
**Imports updated inside moved `src/` files:**
|
|
318
|
+
|
|
319
|
+
| File | Old | New |
|
|
320
|
+
| ---------------------------- | --------------------- | -------------------------------- |
|
|
321
|
+
| `service/service.ts` | `"./usage"` | `"../lifecycle/usage"` |
|
|
322
|
+
| `service/service-adapter.ts` | `"./model-resolver"` | `"../session/model-resolver"` |
|
|
323
|
+
| `service/service-adapter.ts` | `"./parent-snapshot"` | `"../lifecycle/parent-snapshot"` |
|
|
324
|
+
| `service/service-adapter.ts` | `"./service"` | `"./service"` (sibling) |
|
|
325
|
+
| `service/service-adapter.ts` | `"./types"` | `"../types"` |
|
|
326
|
+
|
|
327
|
+
**Consumers updated (src):**
|
|
328
|
+
|
|
329
|
+
| Consumer | Old import | New import |
|
|
330
|
+
| -------------- | --------------------- | ----------------------------- |
|
|
331
|
+
| `src/index.ts` | `"./service"` | `"./service/service"` |
|
|
332
|
+
| `src/index.ts` | `"./service-adapter"` | `"./service/service-adapter"` |
|
|
333
|
+
|
|
334
|
+
**Consumers updated (test):** `#src/service` → `#src/service/service`; `#src/service-adapter` → `#src/service/service-adapter`.
|
|
335
|
+
|
|
336
|
+
**Test file relative-import fix:** `service-adapter.test.ts` uses `"./helpers/make-record"` and `"./helpers/mock-session"` — update to `"../helpers/make-record"` and `"../helpers/mock-session"`.
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
### Unchanged files
|
|
341
|
+
|
|
342
|
+
Root `src/` files `index.ts`, `runtime.ts`, `types.ts`, `settings.ts`, `debug.ts` stay in place.
|
|
343
|
+
`src/handlers/`, `src/tools/`, `src/ui/` stay in place (their imports update as consumers above).
|
|
344
|
+
`test/helpers/`, `test/handlers/`, `test/tools/`, `test/ui/` stay in place.
|
|
345
|
+
|
|
346
|
+
## Test Impact Analysis
|
|
347
|
+
|
|
348
|
+
This is a pure filesystem reorganization.
|
|
349
|
+
No new unit tests are enabled or required.
|
|
350
|
+
No existing tests become redundant.
|
|
351
|
+
No test logic changes — only file locations and import specifiers change.
|
|
352
|
+
|
|
353
|
+
The test suite passes before and after; the green-on-each-commit discipline verifies that every import path update is correct before the next domain is moved.
|
|
354
|
+
|
|
355
|
+
## TDD Order
|
|
356
|
+
|
|
357
|
+
There is no red/green cycle for new behavior.
|
|
358
|
+
Each step follows: move files → fix imports → verify green → commit.
|
|
359
|
+
|
|
360
|
+
### Step 1 — Move `config/` domain
|
|
361
|
+
|
|
362
|
+
- Create `src/config/`, `test/config/`
|
|
363
|
+
- `git mv` 4 `src/` files into `src/config/`
|
|
364
|
+
- `git mv` 3 `test/` files into `test/config/`
|
|
365
|
+
- Update imports per the Module-Level Changes table for `config/`
|
|
366
|
+
- Run `pnpm run check && pnpm run test` — must be green
|
|
367
|
+
- Commit: `refactor: move config domain modules into src/config/ (#164)`
|
|
368
|
+
|
|
369
|
+
### Step 2 — Move `session/` domain
|
|
370
|
+
|
|
371
|
+
- Create `src/session/`, `test/session/`
|
|
372
|
+
- `git mv` 8 `src/` files into `src/session/`
|
|
373
|
+
- `git mv` 7 `test/` files into `test/session/`
|
|
374
|
+
- Update imports per the Module-Level Changes table for `session/`
|
|
375
|
+
- Run `pnpm run check && pnpm run test` — must be green
|
|
376
|
+
- Commit: `refactor: move session domain modules into src/session/ (#164)`
|
|
377
|
+
|
|
378
|
+
### Step 3 — Move `lifecycle/` + `observation/` domains (single commit)
|
|
379
|
+
|
|
380
|
+
- Create `src/lifecycle/`, `src/observation/`, `test/lifecycle/`, `test/observation/`
|
|
381
|
+
- `git mv` 8 `src/lifecycle/` files, 4 `src/observation/` files
|
|
382
|
+
- `git mv` 9 `test/lifecycle/` files, 4 `test/observation/` files
|
|
383
|
+
- Update imports per both tables in the Module-Level Changes section
|
|
384
|
+
- Update `src/types.ts` re-export path
|
|
385
|
+
- Run `pnpm run check && pnpm run test` — must be green
|
|
386
|
+
- Commit: `refactor: move lifecycle and observation domain modules (#164)`
|
|
387
|
+
|
|
388
|
+
### Step 4 — Move `service/` domain
|
|
389
|
+
|
|
390
|
+
- Create `src/service/`, `test/service/`
|
|
391
|
+
- `git mv` 2 `src/` files into `src/service/`
|
|
392
|
+
- `git mv` 2 `test/` files into `test/service/`
|
|
393
|
+
- Update imports per the Module-Level Changes table for `service/`
|
|
394
|
+
- Run `pnpm run check && pnpm run test` — must be green
|
|
395
|
+
- Commit: `refactor: move service domain modules into src/service/ (#164)`
|
|
396
|
+
|
|
397
|
+
## Risks and Mitigations
|
|
398
|
+
|
|
399
|
+
| Risk | Mitigation |
|
|
400
|
+
| --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
401
|
+
| Missed import path breaks the build | `pnpm run check` (`tsc --noEmit`) catches all unresolved paths before tests run |
|
|
402
|
+
| Test file not auto-discovered after move | `vitest.config.ts` uses `"test/**/*.test.ts"` glob — subdirectory files are included automatically |
|
|
403
|
+
| `git mv` history not preserved for renamed + edited files | Use `git mv` for the move, then edit the file; git tracks the rename even with content edits |
|
|
404
|
+
| Step 3 is large (25 file moves) | All changes are mechanical with no logic edits; import tables above enumerate every update |
|
|
405
|
+
| Forgotten consumer in `tools/`, `ui/`, or `index.ts` | TypeScript's `noEmit` check will fail on any un-updated import; the check step is mandatory before each commit |
|
|
406
|
+
|
|
407
|
+
## Open Questions
|
|
408
|
+
|
|
409
|
+
None — the issue scope is fully specified and #157 resolved the prerequisite import cleanup.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
issue: 164
|
|
3
|
+
issue_title: "refactor(pi-subagents): reorganize source into domain directories"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Retro: #164 — refactor(pi-subagents): reorganize source into domain directories
|
|
7
|
+
|
|
8
|
+
## Stage: Planning (2026-05-23T00:00:00Z)
|
|
9
|
+
|
|
10
|
+
### Session summary
|
|
11
|
+
|
|
12
|
+
Read issue #164, confirmed #157 (import normalization) was a prerequisite and had been completed.
|
|
13
|
+
Explored the full `src/` and `test/` structure, mapped every relative import in the 26 files to be moved, and produced a four-commit plan that moves files domain-by-domain in dependency order.
|
|
14
|
+
|
|
15
|
+
### Observations
|
|
16
|
+
|
|
17
|
+
- Issue #157 removed `.js` suffixes and introduced `#src/*` aliases in `test/` files.
|
|
18
|
+
This makes the reorganization cleaner: test imports are flat `#src/agent-manager` → `#src/lifecycle/agent-manager` with no depth variation.
|
|
19
|
+
- `lifecycle/` and `observation/` have a circular dependency (`agent-manager` ↔ `record-observer`), so they must be moved in a single commit (Step 3).
|
|
20
|
+
All other domains can be committed independently.
|
|
21
|
+
- `vitest.config.ts` uses `"test/**/*.test.ts"` — test files in new subdirectories are
|
|
22
|
+
auto-discovered without config changes.
|
|
23
|
+
- Three UI test files (`conversation-viewer.test.ts`, `display.test.ts`,
|
|
24
|
+
`widget-renderer.test.ts`) are misplaced at `test/` root; left out of scope for this issue.
|
|
25
|
+
- No `default-agents.test.ts`, `context.test.ts`, or `execution-state.test.ts` exist —
|
|
26
|
+
those src modules have no dedicated test files.
|
|
27
|
+
- The import tables in the plan enumerate every path change; `pnpm run check` will catch
|
|
28
|
+
any missed update before each commit.
|
|
29
|
+
|
|
30
|
+
## Stage: Implementation — TDD (2026-05-23T16:55:00Z)
|
|
31
|
+
|
|
32
|
+
### Session summary
|
|
33
|
+
|
|
34
|
+
Executed all four plan steps (config, session, lifecycle+observation, service) plus a fifth unplanned step converting all `src/` internal imports to `#src/` aliases.
|
|
35
|
+
All 50 test files and 805 tests pass throughout.
|
|
36
|
+
Updated `docs/architecture/architecture.md` to reflect the completed restructuring.
|
|
37
|
+
|
|
38
|
+
### Observations
|
|
39
|
+
|
|
40
|
+
- The plan's consumer tables were mostly complete but missed a few files: `src/ui/widget-renderer.ts` and `src/session-config.ts` (still at root during step 1) both imported `agent-types`; `src/service-adapter.ts` imported `model-resolver`; `test/parent-snapshot.test.ts` had a `vi.mock("#src/context")` path.
|
|
41
|
+
All caught immediately by `pnpm run check` or a failing test.
|
|
42
|
+
- `src/service-adapter.ts` and `src/service.ts` (still at root during step 3) imported `parent-snapshot` and `usage` which moved in that step, so they had to be fixed as part of step 3's commit rather than step 4's.
|
|
43
|
+
- The `#src/` alias conversion (fifth commit) was added after the user correctly observed that `src/` files should use the same alias style as `test/` files.
|
|
44
|
+
This eliminates all `../` relative cross-directory imports from `src/`.
|
|
45
|
+
Future file moves in `src/` now only require updating the `#src/domain/name` string — no relative depth arithmetic.
|
|
46
|
+
- Biome auto-fixed 14 files (import sorting / trailing whitespace) during the `#src/` conversion step; committed via `git add -A` after the pre-commit hook run.
|
|
47
|
+
|
|
48
|
+
## Stage: Final Retrospective (2026-05-23T17:10:00Z)
|
|
49
|
+
|
|
50
|
+
### Session summary
|
|
51
|
+
|
|
52
|
+
Shipped #164 (6 commits, `pi-subagents-v6.17.2`), filed #174 (ESLint for type-aware rules + import path enforcement), and reviewed the full issue lifecycle across planning, implementation, and shipping sessions.
|
|
53
|
+
|
|
54
|
+
### Observations
|
|
55
|
+
|
|
56
|
+
#### What went well
|
|
57
|
+
|
|
58
|
+
- The user's mid-implementation redirect to use `#src/` aliases in `src/` files was the highest-impact intervention across the entire issue.
|
|
59
|
+
It eliminated the `../` depth-arithmetic problem, simplified the final commit to a one-liner `sed` command across 40 files, and directly motivated #174.
|
|
60
|
+
- `pnpm run check` (`tsc --noEmit`) caught every missed consumer immediately — no broken commit ever landed.
|
|
61
|
+
- The four-step dependency ordering (config → session → lifecycle+observation → service) kept every commit green despite the circular dependency between `lifecycle` and `observation`.
|
|
62
|
+
|
|
63
|
+
#### What caused friction (agent side)
|
|
64
|
+
|
|
65
|
+
- `wrong-abstraction` — Used ~60 individual `Edit` tool calls across steps 1–4 for what was a mechanical find-and-replace.
|
|
66
|
+
The fifth commit proved `sed` handles bulk import rewrites across 40 files in a single command.
|
|
67
|
+
Impact: hundreds of unnecessary tool calls and significant token waste across four commits.
|
|
68
|
+
- `missing-context` — The plan's consumer tables missed 4 files (`src/ui/widget-renderer.ts`, `src/session-config.ts`, `src/service-adapter.ts`, `test/parent-snapshot.test.ts` `vi.mock` path).
|
|
69
|
+
The plan manually traced imports instead of using `grep` to enumerate all consumers of each moving module.
|
|
70
|
+
Impact: mid-step rework in steps 1, 2, and 3 to fix un-updated imports caught by `tsc`.
|
|
71
|
+
- `missing-context` — Did not recognize that `src/` files should use `#src/` aliases (same as `test/` files) even though #157 set up the aliases for exactly this purpose.
|
|
72
|
+
Impact: all four domain-move commits used relative `../` imports, requiring a fifth unplanned commit to convert them.
|
|
73
|
+
User-caught.
|
|
74
|
+
- `wrong-abstraction` — The agent lacks access to LSP-level refactoring tools ("Move to file", "Rename symbol") that a human developer would use for this kind of reorganization.
|
|
75
|
+
A human with an LSP would have completed the entire issue in minutes with zero missed consumers.
|
|
76
|
+
This is a fundamental capability gap — the agent compensated with low-level text manipulation, which is error-prone and token-expensive.
|
|
77
|
+
|
|
78
|
+
#### What caused friction (user side)
|
|
79
|
+
|
|
80
|
+
- The `#src/` alias convention was established in #157 but the user didn't flag it during the planning session.
|
|
81
|
+
Had this been raised during planning, all four domain-move commits would have used `#src/` from the start.
|
|
82
|
+
The user did catch it during implementation, which was still early enough to save the final result.
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gotgenes/pi-subagents",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.18.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"exports": {
|
|
5
6
|
".": "./src/service.ts"
|
|
6
7
|
},
|
|
8
|
+
"imports": {
|
|
9
|
+
"#src/*": "./src/*",
|
|
10
|
+
"#test/*": "./test/*"
|
|
11
|
+
},
|
|
7
12
|
"description": "A pi extension that brings Claude Code-style autonomous sub-agents to pi. Friendly fork of @tintinweb/pi-subagents.",
|
|
8
13
|
"author": {
|
|
9
14
|
"name": "Chris Lasher"
|
|
@@ -62,6 +67,6 @@
|
|
|
62
67
|
"test": "vitest run",
|
|
63
68
|
"test:watch": "vitest",
|
|
64
69
|
"lint:md": "rumdl check *.md docs/**/*.md",
|
|
65
|
-
"lint": "biome check . && pnpm run lint:md"
|
|
70
|
+
"lint": "biome check . && eslint . && pnpm run lint:md"
|
|
66
71
|
}
|
|
67
72
|
}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* User agents override defaults with the same name. Disabled agents are kept but excluded from spawning.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { DEFAULT_AGENTS } from "
|
|
9
|
-
import type { AgentConfig } from "
|
|
8
|
+
import { DEFAULT_AGENTS } from "#src/config/default-agents";
|
|
9
|
+
import type { AgentConfig } from "#src/types";
|
|
10
10
|
|
|
11
11
|
// ── AgentConfigLookup interface ──────────────────────────────────────────────
|
|
12
12
|
|