gentle-pi 0.10.9 → 0.11.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/assets/orchestrator.md +5 -145
- package/assets/sdd-orchestrator-workflow.md +153 -0
- package/extensions/gentle-ai.ts +7 -1
- package/extensions/skill-registry.ts +21 -13
- package/package.json +1 -1
- package/tests/artifact-language.test.ts +15 -0
- package/tests/runtime-harness.mjs +5 -0
- package/tests/skill-registry.test.ts +31 -1
package/assets/orchestrator.md
CHANGED
|
@@ -188,103 +188,15 @@ stop writes → parent captures git status → selected review lens audits affec
|
|
|
188
188
|
|
|
189
189
|
If multiple rows match, run the narrow set that covers the risk. Example: shell integration that mutates live state should use `review-reliability` plus `review-resilience`, not `review-readability` by default.
|
|
190
190
|
|
|
191
|
-
## SDD Workflow
|
|
191
|
+
## SDD Workflow (lazy-loaded)
|
|
192
192
|
|
|
193
|
-
SDD
|
|
193
|
+
The detailed SDD workflow is intentionally not embedded in this always-on parent prompt. Before handling any `/sdd-*` command, natural-language SDD request, SDD continuation/routing, apply/verify/sync/archive work, or SDD/Judgment-Day phase delegation, read this package asset first:
|
|
194
194
|
|
|
195
|
-
|
|
196
|
-
init → explore → proposal → spec → design → tasks → apply → verify → sync → archive
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
Dependency graph:
|
|
200
|
-
|
|
201
|
-
```text
|
|
202
|
-
proposal → spec ─┬→ tasks → apply → verify → sync → archive
|
|
203
|
-
proposal → design ┘
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
`/sdd-status [change]` is the read-only status action for resolving the active change, artifact paths, task progress, dependency readiness, and action context before apply/verify/sync/archive.
|
|
207
|
-
|
|
208
|
-
## Native SDD Dispatcher
|
|
209
|
-
|
|
210
|
-
The user expresses intent; they should not have to administer phases manually. For natural-language SDD requests and `/sdd-continue`, the parent/orchestrator must use the native status engine as the state authority, decide the next phase, and delegate only the phase that status marks ready.
|
|
211
|
-
|
|
212
|
-
Flow:
|
|
213
|
-
|
|
214
|
-
```text
|
|
215
|
-
user intent → preflight/init guard → native status engine → phase decision → subagent gets status JSON + generated instructions → artifact/progress write → status recalculation → continue or stop
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
Rules:
|
|
219
|
-
|
|
220
|
-
- `/sdd-status` is a debug/status command, not the main UX.
|
|
221
|
-
- `/sdd-continue` is the native dispatcher command: resolve status, choose the next ready phase, and carry status/instructions into the subagent prompt.
|
|
222
|
-
- `sdd-apply`, `sdd-verify`, `sdd-sync`, and `sdd-archive` must obey parent-provided native status; they must not reconstruct readiness from prompt inference when status JSON is present.
|
|
223
|
-
- Do not launch a phase when native status marks that dependency `blocked`.
|
|
224
|
-
- `sdd-archive` cannot proceed unless native status says `dependencies.archive` is `ready` or `all_done` — UNLESS the store carve-out is active (`nextRecommended: "resolve-via-engram"`), in which case resolve archive readiness from Engram instead of treating `not_applicable` as a gate failure.
|
|
225
|
-
- **Non-authoritative store carve-out:** when `nextRecommended: "resolve-via-engram"` is set, native status is **not authoritative**. This applies to `artifactStore: engram`, `artifactStore: none`, and `artifactStore: both` when the `openspec/` directory does not exist. For non-authoritative stores: resolve readiness from Engram using the Engram memory tools injected by the memory provider on the change topic keys (`sdd/{change-name}/proposal`, `sdd/{change-name}/spec`, `sdd/{change-name}/design`, `sdd/{change-name}/tasks`, etc.). Do **not** treat `blockedReasons` or `not_applicable` dependency states from the native engine as real blockers when the store carve-out is active.
|
|
226
|
-
|
|
227
|
-
## SDD Status Contract
|
|
228
|
-
|
|
229
|
-
Before `/sdd-continue`, `sdd-apply`, `sdd-verify`, `sdd-sync`, or `sdd-archive`, resolve and carry structured status. Lookup order: parent-provided status, then project override `.pi/gentle-ai/support/sdd-status-contract.md`, then globally installed `~/.pi/agent/gentle-ai/support/sdd-status-contract.md`, then the embedded `sdd-status` prompt contract. Do not use `assets/support/...` as a runtime path; that is only the package source path before installation.
|
|
230
|
-
|
|
231
|
-
Status must include:
|
|
232
|
-
|
|
233
|
-
- active change selection and how it was resolved;
|
|
234
|
-
- artifact store and paths/topics for proposal, specs, design, tasks, apply-progress, verify-report, and sync-report;
|
|
235
|
-
- task progress with exact unchecked `- [ ]` implementation task lines;
|
|
236
|
-
- dependency states for apply, verify, sync, and archive;
|
|
237
|
-
- `actionContext` with mode, workspace root, allowed edit roots, and warnings;
|
|
238
|
-
- next recommended action.
|
|
239
|
-
|
|
240
|
-
Do not guess the active change. If change selection is ambiguous, ask the user and stop. If `actionContext.mode: workspace-planning` and no allowed edit roots are provided, stop before apply/verify/sync/archive and ask for an explicit implementation/edit scope.
|
|
241
|
-
|
|
242
|
-
## Lazy SDD Preflight
|
|
243
|
-
|
|
244
|
-
Do not ask SDD setup questions on session start. The first time the user initiates an SDD process in a Pi session, run the SDD preflight once and keep those choices for the rest of that session. Runtime trigger detection is intentionally deterministic: slash SDD flows and `/sdd-init` run preflight automatically; for natural-language requests, the parent/orchestrator decides semantically whether SDD is needed and must run/reuse `/gentle-ai:sdd-preflight` before continuing.
|
|
245
|
-
|
|
246
|
-
**Hard gate:** `openspec/config.yaml`, existing SDD changes, installed `.pi`/global SDD assets, or a todo named "preflight" are not session preflight. They are project context only. Do not mark SDD preflight complete, start `sdd-init`, launch SDD subagents/chains, or move to explore/proposal/spec/design/tasks until this session has either:
|
|
247
|
-
|
|
248
|
-
1. an injected `## SDD Session Preflight` block, or
|
|
249
|
-
2. an explicit user answer in the current conversation covering all four preflight choices below.
|
|
250
|
-
|
|
251
|
-
If neither exists and `/gentle-ai:sdd-preflight` cannot be invoked from the current context, ask the four choices manually with `ask_user_question` before any SDD phase work. Treat missing Engram availability as a reason to ask/confirm artifact store, not as permission to assume defaults.
|
|
252
|
-
|
|
253
|
-
The preflight captures:
|
|
254
|
-
|
|
255
|
-
- execution mode: `interactive` or `auto`;
|
|
256
|
-
- artifact store: `openspec`, `engram`, or `both` when callable memory tools are available;
|
|
257
|
-
- chained PR strategy: `auto-forecast`, `ask-always`, `single-pr-default`, or `force-chained`;
|
|
258
|
-
- review budget in changed lines.
|
|
259
|
-
|
|
260
|
-
The package should ensure SDD assets are present as global Pi runtime assets without the user needing to remember per-project setup commands. If assets are missing, install them non-destructively into:
|
|
261
|
-
|
|
262
|
-
```text
|
|
263
|
-
~/.pi/agent/agents/sdd-*.md
|
|
264
|
-
~/.pi/agent/chains/sdd-*.chain.md
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
Manual install commands are recovery/debug paths, not the happy path. `/gentle-ai:sdd-preflight` and `/gentle:sdd-preflight` are the explicit preflight commands for agent/orchestrator use. If the user explicitly changes SDD preferences later in the same session, follow the new instruction.
|
|
195
|
+
`{{GENTLE_PI_SDD_WORKFLOW_PATH}}`
|
|
268
196
|
|
|
269
|
-
|
|
197
|
+
That lazy surface contains the SDD phases, native dispatcher rules, status contract, preflight/init guards, artifact-store policy, execution mode, Strict TDD forwarding, phase result contract, and review workload guard.
|
|
270
198
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
In this Pi package, the default local artifact is:
|
|
274
|
-
|
|
275
|
-
```text
|
|
276
|
-
openspec/config.yaml
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
If it is missing, ask the user for the minimal information needed or run `/sdd-init` if available. This init guard runs after the session preflight gate above; project config presence or absence never substitutes for session preflight choices. Do not proceed with a substantial SDD flow while pretending project context, testing capability, or session preflight choices are known.
|
|
280
|
-
|
|
281
|
-
## Artifact Store Policy
|
|
282
|
-
|
|
283
|
-
This package does not provide persistent memory by itself.
|
|
284
|
-
|
|
285
|
-
- Default: `openspec` artifacts in the repo.
|
|
286
|
-
- If a separate memory package is installed and callable, memory/hybrid flows may be used.
|
|
287
|
-
- Never claim memory exists because Gentle AI is installed.
|
|
199
|
+
Hard preflight invariant: `openspec/config.yaml`, existing SDD changes, installed `.pi`/global SDD assets, or a todo named "preflight" are not session preflight. Do not mark SDD preflight complete, start `sdd-init`, launch SDD subagents/chains, or move to explore/proposal/spec/design/tasks until this session has either an injected `## SDD Session Preflight` block or an explicit user answer covering the preflight choices.
|
|
288
200
|
|
|
289
201
|
## Memory Contract
|
|
290
202
|
|
|
@@ -325,38 +237,6 @@ Memory lifecycle rule (when Engram exposes lifecycle metadata/tooling):
|
|
|
325
237
|
- When a retrieved memory is marked `needs_review`, surface that stale context to the user and verify it against current evidence before relying on it.
|
|
326
238
|
- Do NOT call the injected Engram review tool with action `mark_reviewed` automatically. Only call `mark_reviewed` after explicit user confirmation or through a dedicated memory maintenance command.
|
|
327
239
|
|
|
328
|
-
## Execution Mode
|
|
329
|
-
|
|
330
|
-
Use the session's SDD preflight choice:
|
|
331
|
-
|
|
332
|
-
- `interactive`: default, pause between major phases and ask whether to continue.
|
|
333
|
-
- `auto`: run phases back-to-back when the user explicitly wants speed and trusts the flow.
|
|
334
|
-
|
|
335
|
-
In interactive mode, between phases:
|
|
336
|
-
|
|
337
|
-
1. show concise phase result;
|
|
338
|
-
2. state next phase;
|
|
339
|
-
3. ask whether to continue or adjust.
|
|
340
|
-
|
|
341
|
-
Interactive approval is phase-scoped. A user response such as "continue", "dale", or "go on" approves only the immediate next phase, not the rest of the SDD pipeline. Do not treat a generated artifact as approved until the user has had a chance to review or explicitly delegate that review.
|
|
342
|
-
|
|
343
|
-
Before `sdd-proposal` in interactive mode, offer the user a proposal question round instead of silently deciding whether the proposal is clear enough. Explain that the questions are meant to improve the PRD/proposal by uncovering business understanding, business rules, implications, impact, edge cases, and product tradeoffs. Prefer 3–5 concrete product questions per round, then summarize the resulting assumptions and ask whether the user wants to correct anything or run a second question round. Cover business/product/PRD decisions: business problem, target users and situations, business rules, product outcome, current-state gap, implications and impact, edge cases, decision gaps, first-slice scope boundaries, non-goals, product constraints, and business tradeoffs. Do not ask about test commands, PR shape, changed-line budget, or other harness mechanics at proposal time unless the user explicitly asks to discuss delivery.
|
|
344
|
-
|
|
345
|
-
## Result Contract
|
|
346
|
-
|
|
347
|
-
Every phase result should include:
|
|
348
|
-
|
|
349
|
-
```text
|
|
350
|
-
status
|
|
351
|
-
executive_summary
|
|
352
|
-
artifacts
|
|
353
|
-
next_recommended
|
|
354
|
-
risks
|
|
355
|
-
skill_resolution
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
The parent should synthesize these envelopes, not paste long raw reports unless needed.
|
|
359
|
-
|
|
360
240
|
## Skill Registry Protocol
|
|
361
241
|
|
|
362
242
|
The parent resolves skills once per session or before first delegation:
|
|
@@ -403,26 +283,6 @@ Common intent hints, not hard routing:
|
|
|
403
283
|
|
|
404
284
|
Keep this lightweight: loading a skill should improve the immediate task, not force extra ceremony.
|
|
405
285
|
|
|
406
|
-
## Strict TDD Forwarding
|
|
407
|
-
|
|
408
|
-
For `sdd-apply` and `sdd-verify`, read `openspec/config.yaml` when present.
|
|
409
|
-
|
|
410
|
-
If it declares strict TDD and a test command, include a non-negotiable instruction in the phase prompt:
|
|
411
|
-
|
|
412
|
-
```text
|
|
413
|
-
STRICT TDD MODE IS ACTIVE. Test runner: <command>. Follow RED, GREEN, TRIANGULATE, REFACTOR. Record evidence.
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
Do not rely on the child agent to discover this independently.
|
|
417
|
-
|
|
418
|
-
## Review Workload Guard
|
|
419
|
-
|
|
420
|
-
After `sdd-tasks` and before `sdd-apply`, inspect the task output for review workload risk.
|
|
421
|
-
|
|
422
|
-
If estimated changed lines exceed 400, chained PRs are recommended, or a decision is needed, pause and ask unless the user already approved a delivery strategy.
|
|
423
|
-
|
|
424
|
-
Automatic mode does not override reviewer burnout protection.
|
|
425
|
-
|
|
426
286
|
## Safety
|
|
427
287
|
|
|
428
288
|
- Never commit unless the user explicitly asks.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# SDD Orchestrator Workflow
|
|
2
|
+
|
|
3
|
+
This is the lazy-loaded SDD workflow surface for el Gentleman on Pi. Read this file before handling `/sdd-*`, natural-language SDD requests, SDD continuation/routing, apply/verify/sync/archive work, or SDD/Judgment-Day phase delegation.
|
|
4
|
+
|
|
5
|
+
## SDD Workflow
|
|
6
|
+
|
|
7
|
+
SDD phases:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
init → explore → proposal → spec → design → tasks → apply → verify → sync → archive
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Dependency graph:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
proposal → spec ─┬→ tasks → apply → verify → sync → archive
|
|
17
|
+
proposal → design ┘
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`/sdd-status [change]` is the read-only status action for resolving the active change, artifact paths, task progress, dependency readiness, and action context before apply/verify/sync/archive.
|
|
21
|
+
|
|
22
|
+
## Native SDD Dispatcher
|
|
23
|
+
|
|
24
|
+
The user expresses intent; they should not have to administer phases manually. For natural-language SDD requests and `/sdd-continue`, the parent/orchestrator must use the native status engine as the state authority, decide the next phase, and delegate only the phase that status marks ready.
|
|
25
|
+
|
|
26
|
+
Flow:
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
user intent → preflight/init guard → native status engine → phase decision → subagent gets status JSON + generated instructions → artifact/progress write → status recalculation → continue or stop
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Rules:
|
|
33
|
+
|
|
34
|
+
- `/sdd-status` is a debug/status command, not the main UX.
|
|
35
|
+
- `/sdd-continue` is the native dispatcher command: resolve status, choose the next ready phase, and carry status/instructions into the subagent prompt.
|
|
36
|
+
- `sdd-apply`, `sdd-verify`, `sdd-sync`, and `sdd-archive` must obey parent-provided native status; they must not reconstruct readiness from prompt inference when status JSON is present.
|
|
37
|
+
- Do not launch a phase when native status marks that dependency `blocked`.
|
|
38
|
+
- `sdd-archive` cannot proceed unless native status says `dependencies.archive` is `ready` or `all_done` — UNLESS the store carve-out is active (`nextRecommended: "resolve-via-engram"`), in which case resolve archive readiness from Engram instead of treating `not_applicable` as a gate failure.
|
|
39
|
+
- **Non-authoritative store carve-out:** when `nextRecommended: "resolve-via-engram"` is set, native status is **not authoritative**. This applies to `artifactStore: engram`, `artifactStore: none`, and `artifactStore: both` when the `openspec/` directory does not exist. For non-authoritative stores: resolve readiness from Engram using the Engram memory tools injected by the memory provider on the change topic keys (`sdd/{change-name}/proposal`, `sdd/{change-name}/spec`, `sdd/{change-name}/design`, `sdd/{change-name}/tasks`, etc.). Do **not** treat `blockedReasons` or `not_applicable` dependency states from the native engine as real blockers when the store carve-out is active.
|
|
40
|
+
|
|
41
|
+
## SDD Status Contract
|
|
42
|
+
|
|
43
|
+
Before `/sdd-continue`, `sdd-apply`, `sdd-verify`, `sdd-sync`, or `sdd-archive`, resolve and carry structured status. Lookup order: parent-provided status, then project override `.pi/gentle-ai/support/sdd-status-contract.md`, then globally installed `~/.pi/agent/gentle-ai/support/sdd-status-contract.md`, then the embedded `sdd-status` prompt contract. Do not use `assets/support/...` as a runtime path; that is only the package source path before installation.
|
|
44
|
+
|
|
45
|
+
Status must include:
|
|
46
|
+
|
|
47
|
+
- active change selection and how it was resolved;
|
|
48
|
+
- artifact store and paths/topics for proposal, specs, design, tasks, apply-progress, verify-report, and sync-report;
|
|
49
|
+
- task progress with exact unchecked `- [ ]` implementation task lines;
|
|
50
|
+
- dependency states for apply, verify, sync, and archive;
|
|
51
|
+
- `actionContext` with mode, workspace root, allowed edit roots, and warnings;
|
|
52
|
+
- next recommended action.
|
|
53
|
+
|
|
54
|
+
Do not guess the active change. If change selection is ambiguous, ask the user and stop. If `actionContext.mode: workspace-planning` and no allowed edit roots are provided, stop before apply/verify/sync/archive and ask for an explicit implementation/edit scope.
|
|
55
|
+
|
|
56
|
+
## Lazy SDD Preflight
|
|
57
|
+
|
|
58
|
+
Do not ask SDD setup questions on session start. The first time the user initiates an SDD process in a Pi session, run the SDD preflight once and keep those choices for the rest of that session. Runtime trigger detection is intentionally deterministic: slash SDD flows and `/sdd-init` run preflight automatically; for natural-language requests, the parent/orchestrator decides semantically whether SDD is needed and must run/reuse `/gentle-ai:sdd-preflight` before continuing.
|
|
59
|
+
|
|
60
|
+
**Hard gate:** `openspec/config.yaml`, existing SDD changes, installed `.pi`/global SDD assets, or a todo named "preflight" are not session preflight. They are project context only. Do not mark SDD preflight complete, start `sdd-init`, launch SDD subagents/chains, or move to explore/proposal/spec/design/tasks until this session has either:
|
|
61
|
+
|
|
62
|
+
1. an injected `## SDD Session Preflight` block, or
|
|
63
|
+
2. an explicit user answer in the current conversation covering all four preflight choices below.
|
|
64
|
+
|
|
65
|
+
If neither exists and `/gentle-ai:sdd-preflight` cannot be invoked from the current context, ask the four choices manually with `ask_user_question` before any SDD phase work. Treat missing Engram availability as a reason to ask/confirm artifact store, not as permission to assume defaults.
|
|
66
|
+
|
|
67
|
+
The preflight captures:
|
|
68
|
+
|
|
69
|
+
- execution mode: `interactive` or `auto`;
|
|
70
|
+
- artifact store: `openspec`, `engram`, or `both` when callable memory tools are available;
|
|
71
|
+
- chained PR strategy: `auto-forecast`, `ask-always`, `single-pr-default`, or `force-chained`;
|
|
72
|
+
- review budget in changed lines.
|
|
73
|
+
|
|
74
|
+
The package should ensure SDD assets are present as global Pi runtime assets without the user needing to remember per-project setup commands. If assets are missing, install them non-destructively into:
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
~/.pi/agent/agents/sdd-*.md
|
|
78
|
+
~/.pi/agent/chains/sdd-*.chain.md
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Manual install commands are recovery/debug paths, not the happy path. `/gentle-ai:sdd-preflight` and `/gentle:sdd-preflight` are the explicit preflight commands for agent/orchestrator use. If the user explicitly changes SDD preferences later in the same session, follow the new instruction.
|
|
82
|
+
|
|
83
|
+
## Init Guard
|
|
84
|
+
|
|
85
|
+
Before any SDD flow, make sure project context exists.
|
|
86
|
+
|
|
87
|
+
In this Pi package, the default local artifact is:
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
openspec/config.yaml
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
If it is missing, ask the user for the minimal information needed or run `/sdd-init` if available. This init guard runs after the session preflight gate above; project config presence or absence never substitutes for session preflight choices. Do not proceed with a substantial SDD flow while pretending project context, testing capability, or session preflight choices are known.
|
|
94
|
+
|
|
95
|
+
## Artifact Store Policy
|
|
96
|
+
|
|
97
|
+
This package does not provide persistent memory by itself.
|
|
98
|
+
|
|
99
|
+
- Default: `openspec` artifacts in the repo.
|
|
100
|
+
- If a separate memory package is installed and callable, memory/hybrid flows may be used.
|
|
101
|
+
- Never claim memory exists because Gentle AI is installed.
|
|
102
|
+
|
|
103
|
+
## Execution Mode
|
|
104
|
+
|
|
105
|
+
Use the session's SDD preflight choice:
|
|
106
|
+
|
|
107
|
+
- `interactive`: default, pause between major phases and ask whether to continue.
|
|
108
|
+
- `auto`: run phases back-to-back when the user explicitly wants speed and trusts the flow.
|
|
109
|
+
|
|
110
|
+
In interactive mode, between phases:
|
|
111
|
+
|
|
112
|
+
1. show concise phase result;
|
|
113
|
+
2. state next phase;
|
|
114
|
+
3. ask whether to continue or adjust.
|
|
115
|
+
|
|
116
|
+
Interactive approval is phase-scoped. A user response such as "continue", "dale", or "go on" approves only the immediate next phase, not the rest of the SDD pipeline. Do not treat a generated artifact as approved until the user has had a chance to review or explicitly delegate that review.
|
|
117
|
+
|
|
118
|
+
Before `sdd-proposal` in interactive mode, offer the user a proposal question round instead of silently deciding whether the proposal is clear enough. Explain that the questions are meant to improve the PRD/proposal by uncovering business understanding, business rules, implications, impact, edge cases, and product tradeoffs. Prefer 3–5 concrete product questions per round, then summarize the resulting assumptions and ask whether the user wants to correct anything or run a second question round. Cover business/product/PRD decisions: business problem, target users and situations, business rules, product outcome, current-state gap, implications and impact, edge cases, decision gaps, first-slice scope boundaries, non-goals, product constraints, and business tradeoffs. Do not ask about test commands, PR shape, changed-line budget, or other harness mechanics at proposal time unless the user explicitly asks to discuss delivery.
|
|
119
|
+
|
|
120
|
+
## Result Contract
|
|
121
|
+
|
|
122
|
+
Every phase result should include:
|
|
123
|
+
|
|
124
|
+
```text
|
|
125
|
+
status
|
|
126
|
+
executive_summary
|
|
127
|
+
artifacts
|
|
128
|
+
next_recommended
|
|
129
|
+
risks
|
|
130
|
+
skill_resolution
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
The parent should synthesize these envelopes, not paste long raw reports unless needed.
|
|
134
|
+
|
|
135
|
+
## Strict TDD Forwarding
|
|
136
|
+
|
|
137
|
+
For `sdd-apply` and `sdd-verify`, read `openspec/config.yaml` when present.
|
|
138
|
+
|
|
139
|
+
If it declares strict TDD and a test command, include a non-negotiable instruction in the phase prompt:
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
STRICT TDD MODE IS ACTIVE. Test runner: <command>. Follow RED, GREEN, TRIANGULATE, REFACTOR. Record evidence.
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Do not rely on the child agent to discover this independently.
|
|
146
|
+
|
|
147
|
+
## Review Workload Guard
|
|
148
|
+
|
|
149
|
+
After `sdd-tasks` and before `sdd-apply`, inspect the task output for review workload risk.
|
|
150
|
+
|
|
151
|
+
If estimated changed lines exceed 400, chained PRs are recommended, or a decision is needed, pause and ask unless the user already approved a delivery strategy.
|
|
152
|
+
|
|
153
|
+
Automatic mode does not override reviewer burnout protection.
|
package/extensions/gentle-ai.ts
CHANGED
|
@@ -123,12 +123,18 @@ function sddLocalOverrideDriftCount(cwd: string): number {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
let orchestratorPromptCache: string | null = null;
|
|
126
|
+
function getSddWorkflowPath(): string {
|
|
127
|
+
return join(ASSETS_DIR, "sdd-orchestrator-workflow.md");
|
|
128
|
+
}
|
|
129
|
+
|
|
126
130
|
function getOrchestratorPrompt(): string {
|
|
127
131
|
if (orchestratorPromptCache === null) {
|
|
128
132
|
orchestratorPromptCache = readFileSync(
|
|
129
133
|
join(ASSETS_DIR, "orchestrator.md"),
|
|
130
134
|
"utf8",
|
|
131
|
-
)
|
|
135
|
+
)
|
|
136
|
+
.replaceAll("{{GENTLE_PI_SDD_WORKFLOW_PATH}}", getSddWorkflowPath())
|
|
137
|
+
.trim();
|
|
132
138
|
}
|
|
133
139
|
return orchestratorPromptCache;
|
|
134
140
|
}
|
|
@@ -21,7 +21,7 @@ const EXCLUDE_NAMES = new Set(["_shared", "skill-registry"]);
|
|
|
21
21
|
const EXCLUDE_PREFIXES = ["sdd-"];
|
|
22
22
|
const ATL_IGNORE_ENTRY = ".atl/";
|
|
23
23
|
const WATCH_DEBOUNCE_MS = 500;
|
|
24
|
-
const REGISTRY_SCHEMA_VERSION =
|
|
24
|
+
const REGISTRY_SCHEMA_VERSION = 6;
|
|
25
25
|
const NO_SKILL_REGISTRY_FLAG = "no-skill-registry";
|
|
26
26
|
const NO_SKILL_REGISTRY_ENV = "GENTLE_PI_NO_SKILL_REGISTRY";
|
|
27
27
|
const LEGACY_PROJECT_REGISTRY_REL_PATH = ".pi/extensions/skill-registry.ts";
|
|
@@ -96,23 +96,30 @@ function projectSkillDirs(cwd: string): string[] {
|
|
|
96
96
|
|
|
97
97
|
async function findSkillFiles(root: string): Promise<string[]> {
|
|
98
98
|
if (!(await pathExists(root))) return [];
|
|
99
|
+
let entries;
|
|
100
|
+
try {
|
|
101
|
+
entries = await readdir(root, { withFileTypes: true });
|
|
102
|
+
} catch {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
|
|
99
106
|
const out: string[] = [];
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
let entries;
|
|
107
|
+
for (const entry of entries) {
|
|
108
|
+
const skillDir = join(root, entry.name);
|
|
109
|
+
let dirInfo;
|
|
104
110
|
try {
|
|
105
|
-
|
|
111
|
+
dirInfo = await stat(skillDir);
|
|
106
112
|
} catch {
|
|
107
113
|
continue;
|
|
108
114
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
if (!dirInfo.isDirectory()) continue;
|
|
116
|
+
|
|
117
|
+
const candidate = join(skillDir, "SKILL.md");
|
|
118
|
+
try {
|
|
119
|
+
const skillInfo = await stat(candidate);
|
|
120
|
+
if (skillInfo.isFile()) out.push(candidate);
|
|
121
|
+
} catch {
|
|
122
|
+
// Missing or unreadable skill files are ignored; the registry is best-effort.
|
|
116
123
|
}
|
|
117
124
|
}
|
|
118
125
|
return out.sort();
|
|
@@ -512,6 +519,7 @@ async function startSkillRegistryWatcher(
|
|
|
512
519
|
export const __testing = {
|
|
513
520
|
projectSkillDirs,
|
|
514
521
|
userSkillDirs,
|
|
522
|
+
findSkillFiles,
|
|
515
523
|
uniqueExistingDirs,
|
|
516
524
|
dedupeBySkillName,
|
|
517
525
|
scopeForPath,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gentle-pi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Turn Pi into el Gentleman: a senior-architect development harness with SDD/OpenSpec, subagents, strict TDD evidence, review guardrails, and skill discovery.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -146,6 +146,21 @@ test("SDD chain assets distinguish interactive gates from auto execution", async
|
|
|
146
146
|
assert.match(fullChain, /must stop at each phase boundary/i);
|
|
147
147
|
});
|
|
148
148
|
|
|
149
|
+
test("orchestrator lazy-loads detailed SDD workflow", async () => {
|
|
150
|
+
const orchestrator = await readFile(join(ROOT, "assets/orchestrator.md"), "utf8");
|
|
151
|
+
const workflow = await readFile(join(ROOT, "assets/sdd-orchestrator-workflow.md"), "utf8");
|
|
152
|
+
|
|
153
|
+
assert.match(orchestrator, /## SDD Workflow \(lazy-loaded\)/);
|
|
154
|
+
assert.match(orchestrator, /\{\{GENTLE_PI_SDD_WORKFLOW_PATH\}\}/);
|
|
155
|
+
assert.doesNotMatch(orchestrator, /## Native SDD Dispatcher/);
|
|
156
|
+
assert.match(workflow, /## Native SDD Dispatcher/);
|
|
157
|
+
assert.match(workflow, /## SDD Status Contract/);
|
|
158
|
+
assert.match(workflow, /## Execution Mode/);
|
|
159
|
+
assert.match(workflow, /## Strict TDD Forwarding/);
|
|
160
|
+
assert.match(workflow, /## Review Workload Guard/);
|
|
161
|
+
assert.match(workflow, /## Result Contract/);
|
|
162
|
+
});
|
|
163
|
+
|
|
149
164
|
test("persistent harness prompt assets do not hardcode Spanish SDD artifact copy", async () => {
|
|
150
165
|
const files = [
|
|
151
166
|
...(await collectTextFiles(join(ROOT, "assets"))),
|
|
@@ -203,6 +203,11 @@ async function run() {
|
|
|
203
203
|
assert.doesNotMatch(promptResult.systemPrompt, /default\s*\|\s*sonnet\s*\|\s*Non-SDD general delegation/);
|
|
204
204
|
assert.match(promptResult.systemPrompt, /openspec\/config\.yaml.*not session preflight/s);
|
|
205
205
|
assert.match(promptResult.systemPrompt, /Do not mark SDD preflight complete/);
|
|
206
|
+
assert.match(
|
|
207
|
+
promptResult.systemPrompt,
|
|
208
|
+
new RegExp(`${ROOT.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}.*assets.*sdd-orchestrator-workflow\\.md`),
|
|
209
|
+
);
|
|
210
|
+
assert.doesNotMatch(promptResult.systemPrompt, /\{\{GENTLE_PI_SDD_WORKFLOW_PATH\}\}/);
|
|
206
211
|
await writeFile(
|
|
207
212
|
join(globalConfigHome, "persona.json"),
|
|
208
213
|
'{"mode":"neutral"}\n',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
|
-
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { mkdirSync, readFileSync, symlinkSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
5
|
import test from "node:test";
|
|
@@ -114,6 +114,36 @@ test("uniqueExistingDirs normalizes duplicates and ignores missing roots", async
|
|
|
114
114
|
);
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
+
test("findSkillFiles scans one skill directory level only", async () => {
|
|
118
|
+
const root = join(tmpdir(), `gentle-pi-shallow-${Date.now()}`);
|
|
119
|
+
const skillPath = join(root, "docs", "SKILL.md");
|
|
120
|
+
const nestedSkillPath = join(root, "fixtures", "nested", "SKILL.md");
|
|
121
|
+
mkdirSync(dirname(skillPath), { recursive: true });
|
|
122
|
+
mkdirSync(dirname(nestedSkillPath), { recursive: true });
|
|
123
|
+
writeFileSync(skillPath, "---\nname: docs\ndescription: Docs.\n---\n");
|
|
124
|
+
writeFileSync(nestedSkillPath, "---\nname: nested\ndescription: Nested fixture.\n---\n");
|
|
125
|
+
|
|
126
|
+
assert.deepEqual(await __testing.findSkillFiles(root), [skillPath]);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
test("findSkillFiles follows symlinked skill directories", async (t) => {
|
|
130
|
+
const root = join(tmpdir(), `gentle-pi-symlink-root-${Date.now()}`);
|
|
131
|
+
const realSkillDir = join(tmpdir(), `gentle-pi-symlink-target-${Date.now()}`);
|
|
132
|
+
const linkedSkillDir = join(root, "linked");
|
|
133
|
+
const skillPath = join(linkedSkillDir, "SKILL.md");
|
|
134
|
+
mkdirSync(root, { recursive: true });
|
|
135
|
+
mkdirSync(realSkillDir, { recursive: true });
|
|
136
|
+
writeFileSync(join(realSkillDir, "SKILL.md"), "---\nname: linked\ndescription: Linked skill.\n---\n");
|
|
137
|
+
try {
|
|
138
|
+
symlinkSync(realSkillDir, linkedSkillDir, "dir");
|
|
139
|
+
} catch (error) {
|
|
140
|
+
t.skip(`symlink creation unavailable: ${error instanceof Error ? error.message : String(error)}`);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
assert.deepEqual(await __testing.findSkillFiles(root), [skillPath]);
|
|
145
|
+
});
|
|
146
|
+
|
|
117
147
|
test("skill registry watchers close on shutdown", async () => {
|
|
118
148
|
const root = join(tmpdir(), `gentle-pi-watchers-${Date.now()}`);
|
|
119
149
|
const skillPath = join(root, "skills", "docs", "SKILL.md");
|