@gotgenes/pi-subagents 13.2.1 → 14.0.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 +18 -0
- package/README.md +3 -1
- package/dist/public.d.ts +34 -35
- package/docs/architecture/architecture.md +50 -49
- package/docs/architecture/history/phase-16-invert-dependencies.md +2 -1
- package/docs/decisions/0003-publish-bundled-type-declarations.md +3 -1
- package/docs/plans/0051-update-adr-0001-hard-fork.md +8 -6
- package/docs/plans/0257-extract-child-session-factory.md +3 -1
- package/docs/plans/0262-add-workspace-provider-seam.md +41 -39
- package/docs/plans/0264-remove-extension-lifecycle-control.md +100 -98
- package/docs/plans/0265-born-complete-subagent-session.md +5 -2
- package/docs/plans/0270-type-consumable-public-surface.md +3 -1
- package/docs/plans/0280-rename-agent-to-subagent.md +197 -0
- package/docs/retro/0051-update-adr-0001-hard-fork.md +4 -2
- package/docs/retro/0257-extract-child-session-factory.md +3 -1
- package/docs/retro/0262-add-workspace-provider-seam.md +3 -1
- package/docs/retro/0264-remove-extension-lifecycle-control.md +3 -1
- package/docs/retro/0270-type-consumable-public-surface.md +4 -2
- package/docs/retro/0280-rename-agent-to-subagent.md +96 -0
- package/package.json +1 -1
- package/src/index.ts +9 -9
- package/src/lifecycle/child-lifecycle.ts +9 -8
- package/src/lifecycle/create-subagent-session.ts +5 -2
- package/src/lifecycle/{agent-manager.ts → subagent-manager.ts} +27 -27
- package/src/lifecycle/subagent-session.ts +6 -4
- package/src/lifecycle/{agent.ts → subagent.ts} +28 -28
- package/src/lifecycle/turn-limits.ts +1 -1
- package/src/lifecycle/workspace.ts +2 -2
- package/src/observation/notification.ts +9 -9
- package/src/observation/record-observer.ts +9 -9
- package/src/runtime.ts +1 -1
- package/src/service/service-adapter.ts +10 -10
- package/src/service/service.ts +5 -9
- package/src/tools/agent-tool.ts +5 -5
- package/src/tools/background-spawner.ts +3 -3
- package/src/tools/foreground-runner.ts +5 -5
- package/src/tools/get-result-tool.ts +2 -2
- package/src/tools/steer-tool.ts +2 -2
- package/src/types.ts +1 -1
- package/src/ui/agent-creation-wizard.ts +2 -2
- package/src/ui/agent-menu.ts +5 -5
- package/src/ui/agent-widget.ts +2 -2
- package/src/ui/conversation-viewer.ts +3 -3
|
@@ -7,50 +7,50 @@ issue_title: "Add WorkspaceProvider extension seam"
|
|
|
7
7
|
|
|
8
8
|
## Problem Statement
|
|
9
9
|
|
|
10
|
-
Phase 16, Step 2 of ADR
|
|
11
|
-
The core needs only a working directory and a disposal hook for a child run; the default
|
|
10
|
+
Phase 16, Step 2 of [ADR-0002].
|
|
11
|
+
The core needs only a working directory and a disposal hook for a child run; the default - the parent's cwd, with no setup or teardown - is always correct.
|
|
12
12
|
"Where does a child run, and what brackets the run?"
|
|
13
13
|
is a *strategy* (git worktree, container, tmpdir, remote sandbox), not core behavior.
|
|
14
|
-
ADR
|
|
15
|
-
This issue adds that seam
|
|
14
|
+
[ADR-0002] classifies this as the single *generative* extension surface: a concern that must return a value the core consumes synchronously attaches through a rationed provider seam, not an observational event.
|
|
15
|
+
This issue adds that seam -`WorkspaceProvider` / `Workspace` plus `SubagentsService.registerWorkspaceProvider` - without the core gaining any knowledge of what an "isolation strategy" is.
|
|
16
16
|
|
|
17
17
|
## Goals
|
|
18
18
|
|
|
19
19
|
- Define the `WorkspaceProvider` and `Workspace` interfaces in the core, with zero git or worktree knowledge.
|
|
20
|
-
- Add `SubagentsService.registerWorkspaceProvider(provider): () => void`
|
|
21
|
-
- At run-start, consult the registered provider for the child's cwd and a disposal handle; with no provider, the child runs in `baseCwd` (parent cwd
|
|
20
|
+
- Add `SubagentsService.registerWorkspaceProvider(provider): () => void` - a single-provider seam (chaining is out of scope) that throws if a provider is already registered and returns an unregister disposer.
|
|
21
|
+
- At run-start, consult the registered provider for the child's cwd and a disposal handle; with no provider, the child runs in `baseCwd` (parent cwd - default behavior unchanged).
|
|
22
22
|
- Call `dispose()` after the run and append the returned `resultAddendum` to the child's result.
|
|
23
|
-
- This change is **additive and non-breaking**
|
|
23
|
+
- This change is **additive and non-breaking** - the existing `isolation: "worktree"` path is left intact (its eviction is #263).
|
|
24
24
|
|
|
25
25
|
## Non-Goals
|
|
26
26
|
|
|
27
|
-
- Removing `worktree.ts`, `worktree-isolation.ts`, `GitWorktreeManager`, or the `isolation: "worktree"` spawn mode
|
|
28
|
-
- Removing `isolated` / `extensions: false` / `noSkills`
|
|
29
|
-
- Born-complete child execution / dissolving the runner
|
|
30
|
-
- Multiple/chained providers
|
|
31
|
-
- Shipping a concrete provider implementation
|
|
27
|
+
- Removing `worktree.ts`, `worktree-isolation.ts`, `GitWorktreeManager`, or the `isolation: "worktree"` spawn mode - deferred to #263.
|
|
28
|
+
- Removing `isolated` / `extensions: false` / `noSkills` - deferred to #264.
|
|
29
|
+
- Born-complete child execution / dissolving the runner - deferred to #265.
|
|
30
|
+
- Multiple/chained providers - out of scope per the issue; one provider only.
|
|
31
|
+
- Shipping a concrete provider implementation - the worktrees package (#263) is the seam's first real consumer.
|
|
32
32
|
Within this issue the seam is exercised only by test fakes; see Risks for the "no vacant hooks" release-coordination constraint.
|
|
33
33
|
|
|
34
34
|
## Background
|
|
35
35
|
|
|
36
36
|
Relevant existing modules:
|
|
37
37
|
|
|
38
|
-
- `src/lifecycle/agent.ts`
|
|
38
|
+
- `src/lifecycle/agent.ts` - `Agent.run()` calls `this.worktree?.setup()` at run-start to obtain a cwd, threads it into `runner.run({ context: { cwd } })`, and on completion calls `this.worktree?.cleanup(description)`, appending a "Changes saved to branch ..." addendum.
|
|
39
39
|
This is exactly the prepare/dispose shape the seam generalizes.
|
|
40
|
-
- `src/lifecycle/worktree-isolation.ts`
|
|
40
|
+
- `src/lifecycle/worktree-isolation.ts` - `WorktreeIsolation` is the current run-scoped collaborator: `setup()` returns a path, `cleanup(description)` returns a `WorktreeCleanupResult`.
|
|
41
41
|
The seam is its abstraction; #263 will reimplement it as a `WorkspaceProvider` in a separate package.
|
|
42
|
-
- `src/lifecycle/agent-manager.ts`
|
|
42
|
+
- `src/lifecycle/agent-manager.ts` - constructs each `Agent`, owns the injected `WorktreeManager`, and threads `getRunConfig` as a getter.
|
|
43
43
|
The same getter pattern is reused for the workspace provider.
|
|
44
|
-
- `src/service/service.ts`
|
|
44
|
+
- `src/service/service.ts` - the package's public API surface (`package.json` `exports` points at `./src/service.ts`).
|
|
45
45
|
`SubagentsService`, `SpawnOptions`, and `SubagentRecord` all live here; the seam types are re-exported here so the worktrees package can implement them.
|
|
46
|
-
- `src/service/service-adapter.ts`
|
|
47
|
-
- `src/lifecycle/child-lifecycle.ts`
|
|
46
|
+
- `src/service/service-adapter.ts` - `SubagentsServiceAdapter implements SubagentsService`, wrapping the `AgentManagerLike` narrow interface.
|
|
47
|
+
- `src/lifecycle/child-lifecycle.ts` - the *observational* lifecycle events from #261 (`spawning`, `session-created`, `completed`, `disposed`).
|
|
48
48
|
The provider seam is orthogonal: events tell consumers what happened; the provider returns a value the core consumes.
|
|
49
49
|
|
|
50
50
|
AGENTS.md constraints that apply:
|
|
51
51
|
|
|
52
|
-
- Pi SDK imports stay out of library modules
|
|
53
|
-
- Do not read `process.cwd()` inside library functions
|
|
52
|
+
- Pi SDK imports stay out of library modules - the seam interfaces and `AgentManager` accept the provider as a parameter; `index.ts` (the SDK edge) supplies `baseCwd: process.cwd()`.
|
|
53
|
+
- Do not read `process.cwd()` inside library functions - `baseCwd` is injected into `AgentManager` from `index.ts`.
|
|
54
54
|
- When adding a public API pattern, follow the established convention: the repo's registration/subscription convention is an unsubscribe **function** (`() => void`, as in `SubscribableSession.subscribe` and `pi.events.on`), not a `Symbol.dispose` `Disposable`.
|
|
55
55
|
The seam therefore returns `() => void`; this is a deliberate divergence from the issue's literal `Disposable` to match the codebase convention.
|
|
56
56
|
|
|
@@ -97,10 +97,10 @@ export interface WorkspaceProvider {
|
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
Note the addendum-formatting boundary: the core appends `resultAddendum` *verbatim*.
|
|
100
|
-
The provider owns its own separator and wording (the worktrees package owns the "Changes saved to branch
|
|
100
|
+
The provider owns its own separator and wording (the worktrees package owns the "Changes saved to branch ..." string in #263).
|
|
101
101
|
The core never formats branch text.
|
|
102
102
|
|
|
103
|
-
### Registration
|
|
103
|
+
### Registration - single provider, throw on duplicate
|
|
104
104
|
|
|
105
105
|
`AgentManager` holds an optional provider and exposes registration:
|
|
106
106
|
|
|
@@ -130,7 +130,7 @@ The disposer clears the slot only if the same provider is still active, so a sta
|
|
|
130
130
|
Provider-first precedence: when a provider supplies a workspace, the core routes cwd and dispose through it and skips the legacy worktree collaborator; with no provider it falls back to the existing worktree path; with neither it runs in `baseCwd` (cwd undefined → SDK uses the parent cwd).
|
|
131
131
|
|
|
132
132
|
```typescript
|
|
133
|
-
// run()
|
|
133
|
+
// run() - replacing the worktree?.setup() block
|
|
134
134
|
let cwd: string | undefined;
|
|
135
135
|
try {
|
|
136
136
|
const provider = this._getWorkspaceProvider?.();
|
|
@@ -152,7 +152,7 @@ try {
|
|
|
152
152
|
this.observer?.onRunFinished?.(this);
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
|
-
//
|
|
155
|
+
// ... runner.run({ context: { cwd, parentSession }, ... })
|
|
156
156
|
```
|
|
157
157
|
|
|
158
158
|
On completion (`completeRun`) the core computes the final status, then disposes:
|
|
@@ -165,7 +165,7 @@ if (this._workspace) {
|
|
|
165
165
|
if (out?.resultAddendum) finalResult += out.resultAddendum;
|
|
166
166
|
} else {
|
|
167
167
|
const wt = this.worktree?.cleanup(this.description);
|
|
168
|
-
if (wt?.hasChanges && wt.branch) finalResult += `\n\n---\nChanges saved to branch \`${wt.branch}
|
|
168
|
+
if (wt?.hasChanges && wt.branch) finalResult += `\n\n---\nChanges saved to branch \`${wt.branch}\`...`;
|
|
169
169
|
}
|
|
170
170
|
```
|
|
171
171
|
|
|
@@ -197,7 +197,7 @@ Provider-first precedence means the two never silently conflict, and #263 collap
|
|
|
197
197
|
| `src/lifecycle/agent-manager.ts` | `AgentManagerOptions` gains required `baseCwd: string`. New `workspaceProvider` field, `registerWorkspaceProvider()` (throw on dup, unregister disposer). `spawn()` passes `baseCwd` and the `getWorkspaceProvider` getter into each `Agent`. |
|
|
198
198
|
| `src/service/service.ts` | Re-export the five seam types and `AgentStatus`. Add `registerWorkspaceProvider(provider: WorkspaceProvider): () => void` to the `SubagentsService` interface. |
|
|
199
199
|
| `src/service/service-adapter.ts` | `AgentManagerLike` gains `registerWorkspaceProvider(provider): () => void`. `SubagentsServiceAdapter` implements the method, delegating to the manager. |
|
|
200
|
-
| `src/index.ts` | Pass `baseCwd: process.cwd()` to the `new AgentManager({
|
|
200
|
+
| `src/index.ts` | Pass `baseCwd: process.cwd()` to the `new AgentManager({...})` construction (alongside the existing `GitWorktreeManager(process.cwd())`). |
|
|
201
201
|
| `docs/architecture/architecture.md` | Mark Phase 16 Step 2 (#262) as landed in the roadmap; note the seam exists and `workspace.ts` is added to the lifecycle domain listing. |
|
|
202
202
|
|
|
203
203
|
No exports are removed or renamed, so no `src/`/`test/` removed-symbol grep is required.
|
|
@@ -206,8 +206,8 @@ No file in Module-Level Changes is also claimed as unchanged in Non-Goals (the w
|
|
|
206
206
|
### Grep checklist before finalizing
|
|
207
207
|
|
|
208
208
|
- Objects typed as `SubagentsService` in tests: `test/service/service.test.ts` casts `{ spawn: () => "id" } as unknown as SubagentsService`, so adding an interface method does **not** break it (verified).
|
|
209
|
-
- `new AgentManager(` call sites: `src/index.ts` (one) and `test/lifecycle/agent-manager.test.ts` `createManager` (one)
|
|
210
|
-
- `AgentManagerLike` mocks in `test/service/service-adapter.test.ts` (`defaultManager`, inline `spawn:` stubs)
|
|
209
|
+
- `new AgentManager(` call sites: `src/index.ts` (one) and `test/lifecycle/agent-manager.test.ts` `createManager` (one) - both updated for required `baseCwd` in the same step.
|
|
210
|
+
- `AgentManagerLike` mocks in `test/service/service-adapter.test.ts` (`defaultManager`, inline `spawn:` stubs) - add `registerWorkspaceProvider` stub in the same step.
|
|
211
211
|
|
|
212
212
|
## Test Impact Analysis
|
|
213
213
|
|
|
@@ -216,36 +216,36 @@ This is an additive seam, so the work is dominated by *new* tests; little existi
|
|
|
216
216
|
1. New unit tests the seam enables: provider registration (throw-on-duplicate, disposer-unregisters), run-start consultation (cwd from `prepare`, `resultAddendum` appended on dispose), `prepare` returns undefined → `baseCwd`, `prepare` rejects → `markError`, and adapter delegation.
|
|
217
217
|
These were impossible before because there was no provider abstraction to substitute.
|
|
218
218
|
2. Redundant existing tests: none.
|
|
219
|
-
The seam does not subsume worktree tests
|
|
220
|
-
3. Existing tests that must stay as-is: all `worktree.test.ts`, `worktree-isolation.test.ts`, and the AgentManager worktree-isolation tests (`calls worktrees.create` / `cleanup`)
|
|
219
|
+
The seam does not subsume worktree tests - they exercise the legacy path, which is preserved.
|
|
220
|
+
3. Existing tests that must stay as-is: all `worktree.test.ts`, `worktree-isolation.test.ts`, and the AgentManager worktree-isolation tests (`calls worktrees.create` / `cleanup`) - they genuinely exercise the fallback path that remains in #262.
|
|
221
221
|
The Agent no-provider tests assert unchanged worktree behavior.
|
|
222
222
|
|
|
223
223
|
## TDD Order
|
|
224
224
|
|
|
225
|
-
1. **Seam types + registration surface**
|
|
225
|
+
1. **Seam types + registration surface** - `feat`.
|
|
226
226
|
New `src/lifecycle/workspace.ts`; re-export seam types + `AgentStatus` from `service.ts`; add `registerWorkspaceProvider` to `SubagentsService`, `AgentManagerLike`, and `SubagentsServiceAdapter` (delegating); add required `baseCwd` + provider field + `registerWorkspaceProvider` (throw on dup, disposer) to `AgentManager`; update `index.ts` and the `createManager` test factory for `baseCwd`.
|
|
227
227
|
Tests: `agent-manager.test.ts` registration (throws on second register; disposer clears only the active provider; getter returns the registered provider) and `service-adapter.test.ts` delegation.
|
|
228
|
-
This whole surface lands in one commit because the `SubagentsService` interface method forces the adapter to implement it and the required `baseCwd` forces both construction sites
|
|
228
|
+
This whole surface lands in one commit because the `SubagentsService` interface method forces the adapter to implement it and the required `baseCwd` forces both construction sites - splitting would not type-check.
|
|
229
229
|
Suggested message: `feat: add WorkspaceProvider registration seam to subagents service`.
|
|
230
230
|
Run `pnpm run check` immediately after (shared-interface change).
|
|
231
231
|
|
|
232
|
-
2. **Run-start consumption + dispose**
|
|
232
|
+
2. **Run-start consumption + dispose** - `feat`.
|
|
233
233
|
`Agent`: `AgentInit` gains `baseCwd`/`getWorkspaceProvider`; new private fields; `run()` provider-first prepare; `completeRun`/`failRun` dispose + verbatim `resultAddendum`.
|
|
234
234
|
`AgentManager.spawn` passes `baseCwd` and the `getWorkspaceProvider` getter (sole extra construction site, folded in).
|
|
235
|
-
Tests: `agent.test.ts`
|
|
235
|
+
Tests: `agent.test.ts` - provider `prepare` supplies cwd to the runner; `dispose` `resultAddendum` appended to the result; `prepare` undefined → cwd falls back to `baseCwd`; `prepare` rejects → `markError` + `onRunFinished`; no-provider path still uses the worktree collaborator (regression guard).
|
|
236
236
|
Suggested message: `feat: consult workspace provider for child cwd and disposal`.
|
|
237
237
|
Run `pnpm run check` after (AgentInit change).
|
|
238
238
|
|
|
239
|
-
3. **Architecture doc update**
|
|
239
|
+
3. **Architecture doc update** - `docs`.
|
|
240
240
|
Mark Phase 16 Step 2 (#262) landed in the roadmap; add `workspace.ts` to the lifecycle domain listing; cross-link the seam.
|
|
241
241
|
Suggested message: `docs: record WorkspaceProvider seam in phase 16 roadmap`.
|
|
242
242
|
|
|
243
243
|
## Risks and Mitigations
|
|
244
244
|
|
|
245
245
|
- **Vacant hook (the headline risk).**
|
|
246
|
-
ADR
|
|
246
|
+
[ADR-0002]’s “no vacant hooks” rule says a provider seam with no consumer is a speculative abstraction that `fallow` flags as dead.
|
|
247
247
|
Within #262 the seam is exercised only by test fakes.
|
|
248
|
-
Mitigation: land #262 **alongside** #263 (its first real consumer, `@gotgenes/pi-subagents-worktrees`)
|
|
248
|
+
Mitigation: land #262 **alongside** #263 (its first real consumer, `@gotgenes/pi-subagents-worktrees`) - do not cut a release that contains the seam without the worktrees package.
|
|
249
249
|
Track this as a release-coordination constraint; the architecture roadmap already pairs Steps 2 and 3.
|
|
250
250
|
- **Dual cwd path confusion.**
|
|
251
251
|
Provider-first precedence keeps worktree and provider from silently conflicting; the branch is documented and removed in #263.
|
|
@@ -257,6 +257,8 @@ This is an additive seam, so the work is dominated by *new* tests; little existi
|
|
|
257
257
|
## Open Questions
|
|
258
258
|
|
|
259
259
|
- Should `baseCwd` eventually come from the parent `SessionContext.cwd` rather than `process.cwd()`?
|
|
260
|
-
Deferred
|
|
260
|
+
Deferred -`process.cwd()` preserves current worktree behavior; revisit during the born-complete work (#265).
|
|
261
261
|
- Should the `disposed` lifecycle event (#261) and `Workspace.dispose` be reconciled into one teardown notion?
|
|
262
|
-
Deferred
|
|
262
|
+
Deferred - they serve different surfaces (observational vs generative); revisit if #265 dissolves the runner.
|
|
263
|
+
|
|
264
|
+
[ADR-0002]: ../decisions/0002-extensions-on-a-minimal-core.md
|
|
@@ -7,13 +7,13 @@ issue_title: "Remove isolated / extensions:false / noSkills from core"
|
|
|
7
7
|
|
|
8
8
|
## Problem Statement
|
|
9
9
|
|
|
10
|
-
The core still carries an extension-lifecycle-control axis
|
|
11
|
-
Per ADR
|
|
10
|
+
The core still carries an extension-lifecycle-control axis - `isolated`, `extensions: false`, and `noSkills` - that lets a spawn blanket-disable a child's extensions and skills.
|
|
11
|
+
Per [ADR-0002], this is policy that does not belong in a minimal orchestrator.
|
|
12
12
|
Deny-at-use (the in-child permission layer, shipped in Step 1 / #261) already covers what `isolated` pretended to do for tools.
|
|
13
|
-
Prevent-load (refusing to bind an extension for true sandboxing) is genuinely generative and is deliberately left as a *latent, un-built* provider seam
|
|
13
|
+
Prevent-load (refusing to bind an extension for true sandboxing) is genuinely generative and is deliberately left as a *latent, un-built* provider seam - we do not ship a vacant hook.
|
|
14
14
|
|
|
15
15
|
This is Phase 16, Step 4.
|
|
16
|
-
With the axis gone, children always load the parent's extensions and skills, and the recursion guard
|
|
16
|
+
With the axis gone, children always load the parent's extensions and skills, and the recursion guard - which currently gates on `cfg.extensions` - becomes unconditional.
|
|
17
17
|
|
|
18
18
|
## Goals
|
|
19
19
|
|
|
@@ -22,47 +22,47 @@ With the axis gone, children always load the parent's extensions and skills, and
|
|
|
22
22
|
- Remove `noSkills` from the assembler and the resource-loader options.
|
|
23
23
|
- Collapse the skill-curation axis symmetrically: remove `AgentConfig.skills` and the skill-**preload** path (`skill-loader.ts`, `safe-fs.ts`, `preloadSkills`, `PromptExtras`, `extras.skillBlocks`).
|
|
24
24
|
Children always load Pi's full skill system, exactly as `skills: true` does today.
|
|
25
|
-
- Make the recursion guard unconditional
|
|
25
|
+
- Make the recursion guard unconditional - it always strips `subagent` / `get_subagent_result` / `steer_subagent` from children, keyed off the core's own tool names.
|
|
26
26
|
- This is a **breaking** change: the public `SpawnOptions.isolated` field and the `isolated:` / `extensions:` / `skills:` custom-agent frontmatter keys are removed.
|
|
27
27
|
Suggested commits use `feat!:`.
|
|
28
28
|
|
|
29
29
|
## Non-Goals
|
|
30
30
|
|
|
31
|
-
- Born-complete child execution / dissolving the runner
|
|
31
|
+
- Born-complete child execution / dissolving the runner - that is Step 5 (#265) and depends on this step.
|
|
32
32
|
`RunOptions`, `runAgent`, `ConcreteAgentRunner`, and `Agent.run()` survive this issue (with `isolated` removed from them).
|
|
33
|
-
- Shipping a prevent-load provider seam — ADR
|
|
34
|
-
- Changing `builtinToolNames` (the `tools:` frontmatter allowlist)
|
|
35
|
-
- Changing deny-at-use behavior in `@gotgenes/pi-permission-system`
|
|
33
|
+
- Shipping a prevent-load provider seam — [ADR-0002] leaves it latent until a real consumer needs it.
|
|
34
|
+
- Changing `builtinToolNames` (the `tools:` frontmatter allowlist) - that is a separate, surviving concern.
|
|
35
|
+
- Changing deny-at-use behavior in `@gotgenes/pi-permission-system` - already in place from #261.
|
|
36
36
|
|
|
37
37
|
## Background
|
|
38
38
|
|
|
39
39
|
Relevant modules and how they relate:
|
|
40
40
|
|
|
41
|
-
- `src/types.ts`
|
|
42
|
-
- `src/config/default-agents.ts`
|
|
43
|
-
- `src/config/custom-agents.ts`
|
|
44
|
-
- `src/config/invocation-config.ts`
|
|
45
|
-
- `src/config/agent-types.ts`
|
|
46
|
-
- `src/session/session-config.ts`
|
|
41
|
+
- `src/types.ts` - declares `AgentConfig` (`extensions`, `skills`, `isolated`) and `AgentInvocation` (`isolated`).
|
|
42
|
+
- `src/config/default-agents.ts` - the three embedded agents set `extensions: true`, `skills: true`.
|
|
43
|
+
- `src/config/custom-agents.ts` - parses `extensions` / `skills` / `isolated` from `.md` frontmatter via `resolveBoolExtensions` and `inheritField`.
|
|
44
|
+
- `src/config/invocation-config.ts` - merges `isolated` from agent config + tool params.
|
|
45
|
+
- `src/config/agent-types.ts` - an absolute-fallback `AgentConfig` literal sets `extensions: true`, `skills: true`.
|
|
46
|
+
- `src/session/session-config.ts` - `assembleSessionConfig` derives `extensions`/`skills` from `options.isolated`, calls `io.preloadSkills` when `skills` is `string[]`, and computes `noSkills`.
|
|
47
47
|
Returns `SessionConfig.{ extensions, noSkills, extras }`.
|
|
48
|
-
- `src/session/prompts.ts`
|
|
49
|
-
- `src/session/skill-loader.ts`
|
|
50
|
-
- `src/session/safe-fs.ts`
|
|
51
|
-
- `src/lifecycle/agent-runner.ts`
|
|
48
|
+
- `src/session/prompts.ts` - `buildAgentPrompt` injects `extras.skillBlocks` as `# Preloaded Skill:` sections; `PromptExtras` carries only `skillBlocks` (memory was removed in #185).
|
|
49
|
+
- `src/session/skill-loader.ts` - `preloadSkills` reads named skill files from disk; consumes `safe-fs.ts`.
|
|
50
|
+
- `src/session/safe-fs.ts` - symlink/path-traversal guards; **only consumer is `skill-loader.ts`**.
|
|
51
|
+
- `src/lifecycle/agent-runner.ts` - `RunOptions.isolated` flows into the assembler; `createResourceLoader` is called with `noExtensions: !cfg.extensions` and `noSkills: cfg.noSkills`; the recursion guard runs only `if (cfg.extensions)`.
|
|
52
52
|
`ResourceLoaderOptions` (a local narrow interface, not the SDK type) declares `noExtensions?` / `noSkills?`.
|
|
53
|
-
- `src/lifecycle/agent.ts`
|
|
54
|
-
- `src/lifecycle/agent-manager.ts`
|
|
55
|
-
- `src/tools/{agent-tool,spawn-config,foreground-runner,background-spawner}.ts`
|
|
56
|
-
- `src/service/{service,service-adapter}.ts`
|
|
57
|
-
- `src/ui/{display,agent-config-editor,agent-creation-wizard}.ts`
|
|
58
|
-
- `src/index.ts`
|
|
53
|
+
- `src/lifecycle/agent.ts` - `AgentInit.isolated`, the `_isolated` field, and `isolated:` in the `runner.run(...)` call.
|
|
54
|
+
- `src/lifecycle/agent-manager.ts` - `AgentSpawnConfig.isolated` and its pass-through to `new Agent(...)`.
|
|
55
|
+
- `src/tools/{agent-tool,spawn-config,foreground-runner,background-spawner}.ts` - tool schema `isolated`, `SpawnExecution.isolated`, and pass-through.
|
|
56
|
+
- `src/service/{service,service-adapter}.ts` - public `SpawnOptions.isolated` and its pass-through to the manager.
|
|
57
|
+
- `src/ui/{display,agent-config-editor,agent-creation-wizard}.ts` - `isolated` tag, eject-content emission, and generation-prompt template text.
|
|
58
|
+
- `src/index.ts` - wires `preloadSkills` and `buildAgentPrompt` into `assemblerIO`.
|
|
59
59
|
|
|
60
60
|
AGENTS.md constraints that apply:
|
|
61
61
|
|
|
62
62
|
- Conventional Commits; breaking changes use `feat!:`.
|
|
63
63
|
- Do not edit `CHANGELOG.md` (release-please owns it).
|
|
64
64
|
- When removing an export, grep all `src/` and `test/` for the symbol before finalizing (done below).
|
|
65
|
-
- When adding/removing a module, check `docs/architecture/` for layout listings and complexity tables that reference it (done below
|
|
65
|
+
- When adding/removing a module, check `docs/architecture/` for layout listings and complexity tables that reference it (done below - Mermaid + tree + field tables).
|
|
66
66
|
- One-sentence-per-line markdown; sequential numbering restarting per heading.
|
|
67
67
|
|
|
68
68
|
## Design Overview
|
|
@@ -76,8 +76,8 @@ Two parallel axes leave the core together:
|
|
|
76
76
|
| Skills | `skills: true \| string[] \| false`; `isolated` forces `false` | always inherit full skill system (field gone) |
|
|
77
77
|
|
|
78
78
|
The `skills` field collapses for the same reason `extensions` does: `noSkills` is the single mechanism behind **both** restriction modes (`skills: false` → no skills; `skills: string[]` → only those, preloaded into the prompt with the SDK loader suppressed).
|
|
79
|
-
Removing `noSkills` without removing `AgentConfig.skills` would leave a field that silently stops restricting
|
|
80
|
-
ADR
|
|
79
|
+
Removing `noSkills` without removing `AgentConfig.skills` would leave a field that silently stops restricting - a `string[]` agent would get its baked-in skills *plus* the full system.
|
|
80
|
+
[ADR-0002] says children always load the parent’s skills, which is exactly the `skills: true` path; the other two values are skill curation/policy and leave the core.
|
|
81
81
|
|
|
82
82
|
### Assembler after collapse
|
|
83
83
|
|
|
@@ -121,16 +121,16 @@ const loader = deps.io.createResourceLoader({
|
|
|
121
121
|
});
|
|
122
122
|
// ...
|
|
123
123
|
await session.bindExtensions({});
|
|
124
|
-
// Recursion guard
|
|
124
|
+
// Recursion guard - now unconditional (children always load extensions).
|
|
125
125
|
const filtered = filterActiveTools(session.getActiveToolNames());
|
|
126
126
|
session.setActiveToolsByName(filtered);
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
`ResourceLoaderOptions` drops `noExtensions?` / `noSkills?` (a local narrow interface
|
|
129
|
+
`ResourceLoaderOptions` drops `noExtensions?` / `noSkills?` (a local narrow interface - removing the latent fields keeps us honest per [ADR-0002]’s “no vacant hooks”).
|
|
130
130
|
|
|
131
|
-
### Call-site sketch
|
|
131
|
+
### Call-site sketch - recursion guard (Tell-Don't-Ask check)
|
|
132
132
|
|
|
133
|
-
The guard already asks the session for its active tools and tells it the filtered set
|
|
133
|
+
The guard already asks the session for its active tools and tells it the filtered set - unchanged except for removing the `if`.
|
|
134
134
|
No new collaborator, no reach-through; the only structural change is that `cfg.extensions` is no longer consulted, so `SessionConfig` no longer needs to expose it.
|
|
135
135
|
This is a narrowing of the assembler's output contract, which is the desired direction.
|
|
136
136
|
|
|
@@ -143,91 +143,91 @@ This is a narrowing of the assembler's output contract, which is the desired dir
|
|
|
143
143
|
|
|
144
144
|
## Module-Level Changes
|
|
145
145
|
|
|
146
|
-
### Source
|
|
147
|
-
|
|
148
|
-
- `src/types.ts`
|
|
149
|
-
- `src/config/invocation-config.ts`
|
|
150
|
-
- `src/config/custom-agents.ts`
|
|
151
|
-
- `src/session/session-config.ts`
|
|
152
|
-
- `src/lifecycle/agent-runner.ts`
|
|
153
|
-
- `src/lifecycle/agent.ts`
|
|
154
|
-
- `src/lifecycle/agent-manager.ts`
|
|
155
|
-
- `src/tools/agent-tool.ts`
|
|
156
|
-
- `src/tools/spawn-config.ts`
|
|
157
|
-
- `src/tools/foreground-runner.ts` / `src/tools/background-spawner.ts`
|
|
158
|
-
- `src/service/service.ts`
|
|
159
|
-
- `src/service/service-adapter.ts`
|
|
160
|
-
- `src/ui/display.ts`
|
|
161
|
-
- `src/ui/agent-config-editor.ts`
|
|
162
|
-
- `src/ui/agent-creation-wizard.ts`
|
|
163
|
-
|
|
164
|
-
### Source
|
|
165
|
-
|
|
166
|
-
- `src/types.ts`
|
|
167
|
-
- `src/config/default-agents.ts`
|
|
168
|
-
- `src/config/agent-types.ts`
|
|
169
|
-
- `src/config/custom-agents.ts`
|
|
170
|
-
- `src/session/session-config.ts`
|
|
171
|
-
- `src/lifecycle/agent-runner.ts`
|
|
172
|
-
- `src/ui/agent-config-editor.ts`
|
|
173
|
-
- `src/ui/agent-creation-wizard.ts`
|
|
174
|
-
|
|
175
|
-
### Source
|
|
176
|
-
|
|
177
|
-
- `src/types.ts`
|
|
178
|
-
- `src/config/default-agents.ts`
|
|
179
|
-
- `src/config/agent-types.ts`
|
|
180
|
-
- `src/config/custom-agents.ts`
|
|
181
|
-
- `src/session/session-config.ts`
|
|
182
|
-
- `src/session/prompts.ts`
|
|
183
|
-
- `src/session/skill-loader.ts`
|
|
184
|
-
- `src/session/safe-fs.ts`
|
|
185
|
-
- `src/lifecycle/agent-runner.ts`
|
|
186
|
-
- `src/index.ts`
|
|
187
|
-
- `src/ui/agent-config-editor.ts`
|
|
188
|
-
- `src/ui/agent-creation-wizard.ts`
|
|
146
|
+
### Source - `isolated` axis
|
|
147
|
+
|
|
148
|
+
- `src/types.ts` - remove `AgentConfig.isolated`, `AgentInvocation.isolated`.
|
|
149
|
+
- `src/config/invocation-config.ts` - remove `isolated` from `AgentInvocationParams` and the return object.
|
|
150
|
+
- `src/config/custom-agents.ts` - remove the `isolated:` frontmatter parse.
|
|
151
|
+
- `src/session/session-config.ts` - remove `AssemblerOptions.isolated` and the `options.isolated ? false : ...` derivation (read `agentConfig.extensions`/`agentConfig.skills` directly, for now).
|
|
152
|
+
- `src/lifecycle/agent-runner.ts` - remove `RunOptions.isolated` and the `isolated:` argument passed to `assembleSessionConfig`.
|
|
153
|
+
- `src/lifecycle/agent.ts` - remove `AgentInit.isolated`, the `_isolated` field + constructor assignment, and `isolated:` in the `runner.run(...)` call.
|
|
154
|
+
- `src/lifecycle/agent-manager.ts` - remove `AgentSpawnConfig.isolated` and its pass-through to `new Agent(...)`.
|
|
155
|
+
- `src/tools/agent-tool.ts` - remove the `isolated` schema property.
|
|
156
|
+
- `src/tools/spawn-config.ts` - remove `SpawnExecution.isolated`, the `const isolated = resolvedConfig.isolated`, `isolated` in `agentInvocation`, and `isolated` in the `execution` return.
|
|
157
|
+
- `src/tools/foreground-runner.ts` / `src/tools/background-spawner.ts` - remove `isolated: execution.isolated`.
|
|
158
|
+
- `src/service/service.ts` - remove `SpawnOptions.isolated`.
|
|
159
|
+
- `src/service/service-adapter.ts` - remove `isolated: options?.isolated` from the `manager.spawn(...)` call.
|
|
160
|
+
- `src/ui/display.ts` - remove `if (invocation.isolated) tags.push("isolated")` and the `isolated` mention in the JSDoc example.
|
|
161
|
+
- `src/ui/agent-config-editor.ts` - remove the `isolated: true` line from `buildEjectContent`.
|
|
162
|
+
- `src/ui/agent-creation-wizard.ts` - remove the `isolated:` template line and the "Set isolated: true ..." guideline.
|
|
163
|
+
|
|
164
|
+
### Source - `extensions` axis + unconditional guard
|
|
165
|
+
|
|
166
|
+
- `src/types.ts` - remove `AgentConfig.extensions`.
|
|
167
|
+
- `src/config/default-agents.ts` - remove `extensions: true` from all three agents.
|
|
168
|
+
- `src/config/agent-types.ts` - remove `extensions: true` from the absolute-fallback literal.
|
|
169
|
+
- `src/config/custom-agents.ts` - remove the `extensions:` frontmatter parse and delete `resolveBoolExtensions`.
|
|
170
|
+
- `src/session/session-config.ts` - remove `SessionConfig.extensions` and stop assigning it.
|
|
171
|
+
- `src/lifecycle/agent-runner.ts` - remove `ResourceLoaderOptions.noExtensions`, drop `noExtensions` from the `createResourceLoader` call, and make the recursion guard unconditional (delete `if (cfg.extensions)`); update the explanatory comment.
|
|
172
|
+
- `src/ui/agent-config-editor.ts` - remove the `extensions: false` line from `buildEjectContent`.
|
|
173
|
+
- `src/ui/agent-creation-wizard.ts` - remove the `extensions:` template line.
|
|
174
|
+
|
|
175
|
+
### Source - `skills` axis + preload path
|
|
176
|
+
|
|
177
|
+
- `src/types.ts` - remove `AgentConfig.skills`.
|
|
178
|
+
- `src/config/default-agents.ts` - remove `skills: true` from all three agents.
|
|
179
|
+
- `src/config/agent-types.ts` - remove `skills: true` from the absolute-fallback literal.
|
|
180
|
+
- `src/config/custom-agents.ts` - remove the `skills:` frontmatter parse and delete `inheritField` (its only remaining callers are `skills`/`extensions`; `csvList`, `parseCsvField`, `str`, `nonNegativeInt` stay - `csvList` still serves `tools:`).
|
|
181
|
+
- `src/session/session-config.ts` - remove `AssemblerIO.preloadSkills`, `SessionConfig.noSkills`, `SessionConfig.extras`, the `extras`/`preloadSkills` block, and the `extras` argument to `buildAgentPrompt`.
|
|
182
|
+
- `src/session/prompts.ts` - remove `PromptExtras`, the `extras` parameter, and the `extrasSuffix` logic.
|
|
183
|
+
- `src/session/skill-loader.ts` - **delete** (export `preloadSkills`, `PreloadedSkill`).
|
|
184
|
+
- `src/session/safe-fs.ts` - **delete** (sole consumer was `skill-loader.ts`).
|
|
185
|
+
- `src/lifecycle/agent-runner.ts` - remove `ResourceLoaderOptions.noSkills` and drop `noSkills` from the `createResourceLoader` call.
|
|
186
|
+
- `src/index.ts` - remove the `preloadSkills` import and its `assemblerIO.preloadSkills` wiring.
|
|
187
|
+
- `src/ui/agent-config-editor.ts` - remove the `skills: false` / `skills: <list>` lines from `buildEjectContent`.
|
|
188
|
+
- `src/ui/agent-creation-wizard.ts` - remove the `skills:` template line.
|
|
189
189
|
|
|
190
190
|
### Tests
|
|
191
191
|
|
|
192
|
-
- `test/session/skill-loader.test.ts`
|
|
193
|
-
- `test/session/safe-fs.test.ts`
|
|
194
|
-
- `test/session/session-config.test.ts`
|
|
195
|
-
- `test/session/prompts.test.ts`
|
|
196
|
-
- `test/config/invocation-config.test.ts`
|
|
197
|
-
- `test/config/custom-agents.test.ts`
|
|
198
|
-
- `test/config/agent-types.test.ts`
|
|
199
|
-
- `test/lifecycle/agent-runner-extension-tools.test.ts`
|
|
200
|
-
- `test/tools/spawn-config.test.ts`
|
|
201
|
-
- `test/tools/background-spawner.test.ts` / `test/tools/foreground-runner.test.ts`
|
|
202
|
-
- `test/tools/result-renderer.test.ts`
|
|
203
|
-
- `test/ui/agent-config-editor.test.ts`
|
|
204
|
-
- `test/display.test.ts`
|
|
205
|
-
- `test/helpers/runner-io.ts`
|
|
206
|
-
- `test/helpers/runner-io.test.ts`
|
|
207
|
-
- `test/helpers/ui-stubs.ts`
|
|
192
|
+
- `test/session/skill-loader.test.ts` - **delete**.
|
|
193
|
+
- `test/session/safe-fs.test.ts` - **delete**.
|
|
194
|
+
- `test/session/session-config.test.ts` - remove the `isolated`-mode `describe`, the `noSkills` assertions, and the preload tests; keep model-resolution and prompt-assembly assertions.
|
|
195
|
+
- `test/session/prompts.test.ts` - remove `isolated`/`extensions`/`skills` from `AgentConfig` fixtures and any `skillBlocks`/`extras` cases.
|
|
196
|
+
- `test/config/invocation-config.test.ts` - remove `isolated` cases and fixture fields.
|
|
197
|
+
- `test/config/custom-agents.test.ts` - remove `extensions` / `skills` / `isolated` frontmatter-parsing tests.
|
|
198
|
+
- `test/config/agent-types.test.ts` - remove `extensions` / `skills` / `isolated` from fixtures.
|
|
199
|
+
- `test/lifecycle/agent-runner-extension-tools.test.ts` - remove `extensions`/`skills`/`isolated` from the mock config; delete the "extensions: false skips the filter entirely" test; keep/adjust the post-bind guard tests to assert the guard runs unconditionally.
|
|
200
|
+
- `test/tools/spawn-config.test.ts` - remove the "sets isolated from params" test and `isolated` fixture fields.
|
|
201
|
+
- `test/tools/background-spawner.test.ts` / `test/tools/foreground-runner.test.ts` - remove `isolated` from fixtures and `agentInvocation` assertions.
|
|
202
|
+
- `test/tools/result-renderer.test.ts` - remove the `"isolated"` tag case.
|
|
203
|
+
- `test/ui/agent-config-editor.test.ts` - remove the `isolated` / `extensions: false` eject-emission tests.
|
|
204
|
+
- `test/display.test.ts` - remove `extensions`/`skills` from `AgentConfig` fixtures.
|
|
205
|
+
- `test/helpers/runner-io.ts` - remove `extensions`/`skills`/`isolated` from `DEFAULT_AGENT_CONFIG`.
|
|
206
|
+
- `test/helpers/runner-io.test.ts` - remove the `config.extensions`/`config.skills` assertions and the `extensions: true` override case.
|
|
207
|
+
- `test/helpers/ui-stubs.ts` - remove `extensions: true` / `skills: true` from the stub `AgentConfig`.
|
|
208
208
|
|
|
209
209
|
### Docs
|
|
210
210
|
|
|
211
|
-
- `docs/architecture/architecture.md`
|
|
211
|
+
- `docs/architecture/architecture.md` -
|
|
212
212
|
remove the `SafeFs` and `SkillLoader` nodes from the session-domain Mermaid subgraph;
|
|
213
213
|
remove `safe-fs.ts` and `skill-loader.ts` from the directory-tree listing;
|
|
214
214
|
drop `isolated` from the `SpawnOptions` field list (≈ line 418) and the `RunOptions` field list (≈ line 651);
|
|
215
215
|
mark Phase 16 Step 4 (#264) done in the roadmap and update the "Children always load the parent's extensions and skills" note;
|
|
216
216
|
reflect the smaller session domain (8 → 6 modules).
|
|
217
|
-
- `.pi/skills/package-pi-subagents/SKILL.md`
|
|
217
|
+
- `.pi/skills/package-pi-subagents/SKILL.md` - update the Session domain row (module count 8 → 6, drop `safe-fs.ts` / `skill-loader.ts` from the file list).
|
|
218
218
|
|
|
219
219
|
## Test Impact Analysis
|
|
220
220
|
|
|
221
|
-
1. New coverage enabled
|
|
221
|
+
1. New coverage enabled - minimal (this is a removal).
|
|
222
222
|
The one behavioral assertion worth strengthening: the post-bind recursion guard now runs **unconditionally**.
|
|
223
223
|
Update `agent-runner-extension-tools.test.ts` so a case that previously relied on `extensions: true` instead asserts the guard always calls `setActiveToolsByName` and always excludes `EXCLUDED_TOOL_NAMES`, with no config dependence.
|
|
224
|
-
2. Tests that become redundant and are removed
|
|
224
|
+
2. Tests that become redundant and are removed -
|
|
225
225
|
`skill-loader.test.ts` and `safe-fs.test.ts` (modules deleted);
|
|
226
226
|
the `isolated`-mode `describe` in `session-config.test.ts`;
|
|
227
227
|
the "extensions: false skips the filter entirely" case;
|
|
228
228
|
`isolated` parameter tests in `spawn-config.test.ts` / `invocation-config.test.ts`;
|
|
229
229
|
`extensions` / `skills` frontmatter-parsing tests in `custom-agents.test.ts`.
|
|
230
|
-
3. Tests that must stay (genuinely exercise surviving layers)
|
|
230
|
+
3. Tests that must stay (genuinely exercise surviving layers) -
|
|
231
231
|
prompt assembly (`prompts.test.ts`, minus `extras`);
|
|
232
232
|
model resolution in `session-config.test.ts`;
|
|
233
233
|
the post-bind guard ordering tests (adjusted, not removed);
|
|
@@ -260,7 +260,7 @@ The three axes are split so each commit stays reviewable and leaves the repo com
|
|
|
260
260
|
- Risk: deleting `safe-fs.ts` orphans an import.
|
|
261
261
|
Mitigation: grep confirms `skill-loader.ts` is its sole consumer; `safe-fs.test.ts` is deleted in the same cycle.
|
|
262
262
|
- Risk: removing `SpawnOptions.isolated` breaks a published consumer of the service.
|
|
263
|
-
Mitigation: this is an intentional breaking change (ADR
|
|
263
|
+
Mitigation: this is an intentional breaking change ([ADR-0002]); `feat!:` triggers a major bump via release-please.
|
|
264
264
|
The public type surface is verified by `pnpm run verify:public-types` after Step 3.
|
|
265
265
|
- Risk: skill behavior silently changes for agents that relied on `skills: string[]` curation.
|
|
266
266
|
Mitigation: documented in Goals as breaking; children now inherit the full skill system, which is strictly more capable, and deny-at-use governs what they may act on.
|
|
@@ -272,4 +272,6 @@ The three axes are split so each commit stays reviewable and leaves the repo com
|
|
|
272
272
|
- Should custom-agent `.md` files with now-defunct `extensions:` / `skills:` / `isolated:` frontmatter emit a one-time deprecation warning, or be silently ignored?
|
|
273
273
|
Deferred: silent-ignore matches the Phase 14 precedent for the removed `disallowed_tools` field; revisit only if users report confusion.
|
|
274
274
|
- Does `verify:public-types` need a new negative assertion that `isolated` is absent from `SpawnOptions`?
|
|
275
|
-
Deferred to Step 3 implementation
|
|
275
|
+
Deferred to Step 3 implementation - the existing consumer type-check will fail if a stale field lingers.
|
|
276
|
+
|
|
277
|
+
[ADR-0002]: ../decisions/0002-extensions-on-a-minimal-core.md
|
|
@@ -7,7 +7,7 @@ issue_title: "Born-complete child execution; dissolve the runner"
|
|
|
7
7
|
|
|
8
8
|
## Problem Statement
|
|
9
9
|
|
|
10
|
-
Phase 16, Step 5 of ADR
|
|
10
|
+
Phase 16, Step 5 of [ADR-0002].
|
|
11
11
|
Today a subagent run is assembled by a monolithic `runAgent()` (the "runner") in `src/lifecycle/agent-runner.ts`: it creates the child session, binds extensions, drives the turn loop, collects the result, and emits the child-execution lifecycle events.
|
|
12
12
|
`Agent` then sequences workspace teardown and status transitions around it through an injected `AgentRunner` interface.
|
|
13
13
|
With the cwd now resolved through the `WorkspaceProvider` seam (Step 2) and worktrees evicted to a sibling package (Step 3), there is nothing left for a separate runner layer to assemble.
|
|
@@ -72,7 +72,7 @@ The workspace therefore stays a separate `Agent`-sequenced resource (prepare at
|
|
|
72
72
|
|
|
73
73
|
AGENTS.md constraints that apply:
|
|
74
74
|
|
|
75
|
-
- Ship-source package with a public type bundle (ADR
|
|
75
|
+
- Ship-source package with a public type bundle ([ADR-0003]): none of the dissolved types (`RunOptions`, `RunResult`, `AgentRunner`) are part of `service.ts`, so `public.d.ts` is unaffected.
|
|
76
76
|
Run `pnpm run verify:public-types` is **not** required (no public-surface change), but `pnpm run check` is.
|
|
77
77
|
- fallow dead-code: new exports (`SubagentSession`, `createSubagentSession`) must have a production consumer by the end of the work; transient intermediate commits where they are consumed only by tests are acceptable because fallow runs at pre-completion, against the final state.
|
|
78
78
|
- `#src/` path-alias imports only; ES2024 target.
|
|
@@ -328,3 +328,6 @@ Each step compiles and the suite passes; run `pnpm run check` after every step t
|
|
|
328
328
|
This needs `WorkspaceProvider` support for resume and is out of scope; capture as a follow-up if it becomes a real need.
|
|
329
329
|
- Whether `completed` should also fire on resume (it does not today).
|
|
330
330
|
Deferred — preserve current behavior; revisit only with a concrete consumer.
|
|
331
|
+
|
|
332
|
+
[ADR-0002]: ../decisions/0002-extensions-on-a-minimal-core.md
|
|
333
|
+
[ADR-0003]: ../decisions/0003-publish-bundled-type-declarations.md
|
|
@@ -57,7 +57,7 @@ Relevant modules and facts:
|
|
|
57
57
|
Constraints from `AGENTS.md` and the package skill:
|
|
58
58
|
|
|
59
59
|
- Ship-source model: every package ships raw `.ts` executed directly by Pi; there is no build step today.
|
|
60
|
-
ADR
|
|
60
|
+
[ADR-0002] frames pi-subagents as a minimal core.
|
|
61
61
|
Introducing the repo's **first build step** is a deliberate decision and warrants an ADR.
|
|
62
62
|
- `eslint`'s `no-parent-relative-imports` rule forbids `../` imports inside `packages/*/src`; same-directory `./` is allowed.
|
|
63
63
|
This (plus the deep type entanglement above) is why the alias-free-entry alternative was rejected.
|
|
@@ -200,3 +200,5 @@ This is a tooling/config change with a verification harness (not red→green→r
|
|
|
200
200
|
- Whether to add a fast vitest self-containment assertion in addition to the shell harness, or keep the guard inside the script only — defer to the build stage.
|
|
201
201
|
- Whether the ADR should add a short "build process" subsection to `docs/architecture/architecture.md` — defer; the ADR is sufficient.
|
|
202
202
|
- Exact `files` allowlist entries — finalize against `pnpm pack --dry-run` in Step 2.
|
|
203
|
+
|
|
204
|
+
[ADR-0002]: ../decisions/0002-extensions-on-a-minimal-core.md
|