gentle-pi 2.7.0 → 3.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/README.md +24 -6
- package/assets/agents/gentle-ai-worker.md +5 -1
- package/assets/agents/sdd-apply.md +9 -7
- package/assets/agents/sdd-archive.md +42 -23
- package/assets/agents/sdd-proposal.md +2 -2
- package/assets/agents/sdd-remediate.md +4 -4
- package/assets/agents/sdd-research.md +20 -48
- package/assets/agents/sdd-tasks.md +5 -5
- package/assets/agents/sdd-verify.md +6 -28
- package/assets/chains/sdd-full.chain.md +4 -22
- package/assets/chains/sdd-verify.chain.md +3 -12
- package/assets/orchestrator-delegation.md +33 -3
- package/assets/orchestrator-memory.md +20 -7
- package/assets/orchestrator.md +5 -3
- package/assets/sdd-orchestrator-workflow.md +25 -58
- package/assets/support/sdd-status-contract.md +9 -12
- package/docs/gentle-shell.md +14 -4
- package/docs/readme-reference.md +171 -32
- package/extensions/codegraph-tools.ts +2 -0
- package/extensions/gentle-agents.ts +281 -361
- package/extensions/gentle-ai.ts +588 -117
- package/extensions/gentle-shell.ts +74 -30
- package/extensions/pi-pretty.ts +63 -14
- package/extensions/quiet-tools.ts +1 -2
- package/extensions/startup-banner.ts +10 -9
- package/lib/agent-home.ts +8 -0
- package/lib/agent-profile-pin.ts +336 -0
- package/lib/agent-profiles.ts +28 -8
- package/lib/agents-config.ts +24 -2
- package/lib/agents-history.ts +3 -97
- package/lib/agents-keys.ts +27 -0
- package/lib/agents-protocol.ts +2 -15
- package/lib/agents-runner.ts +67 -111
- package/lib/agents-session-transport.ts +691 -0
- package/lib/command-palette-catalog.ts +87 -0
- package/lib/command-palette.ts +346 -0
- package/lib/native-choice-list.ts +5 -0
- package/lib/native-review-cli.ts +10 -97
- package/lib/review-publication-gate.ts +11 -1
- package/lib/review-repository.ts +1 -1
- package/lib/review-snapshot.ts +1 -0
- package/lib/review-transaction.ts +4 -2
- package/lib/sdd-preflight.ts +2 -1
- package/lib/sdd-research-capabilities.ts +18 -152
- package/lib/sdd-status.ts +7 -779
- package/lib/session-change-capture.ts +2 -1
- package/lib/session-changes.ts +8 -1
- package/lib/shell-bar.ts +21 -12
- package/lib/shell-card.ts +8 -12
- package/lib/shell-changes.ts +3 -2
- package/lib/shell-prompt.ts +25 -8
- package/lib/shell-sidebar-banner.ts +2 -2
- package/lib/shell-sidebar-layout.ts +5 -2
- package/lib/windows-session-transport.ts +877 -0
- package/package.json +3 -3
- package/runtime/native-review-cli.mjs +9 -96
- package/runtime/windows-session-transport.ps1 +791 -0
- package/scripts/test-packed-runner.mjs +1668 -20
- package/scripts/verify-package-files.mjs +0 -1
- package/tests/agent-home.test.ts +52 -0
- package/tests/agent-profiles.test.ts +30 -1
- package/tests/agents-config.test.ts +44 -0
- package/tests/agents-history.test.ts +12 -24
- package/tests/agents-runner.test.ts +307 -58
- package/tests/agents-session-transport-process.test.ts +249 -0
- package/tests/agents-session-transport.test.ts +823 -0
- package/tests/artifact-language.test.ts +10 -7
- package/tests/command-palette.test.ts +378 -0
- package/tests/delegated-key-learnings-contract.test.ts +2 -2
- package/tests/fixtures/agents-session-transport-process.mjs +108 -0
- package/tests/fixtures/legacy/sdd-research-v2.5.0.md +54 -0
- package/tests/fixtures/windows-session-bootstrap.ps1 +129 -0
- package/tests/fixtures/windows-session-compile.ps1 +110 -0
- package/tests/gentle-agents.test.ts +849 -356
- package/tests/gentle-ai.test.ts +472 -4
- package/tests/gentle-shell.test.ts +201 -8
- package/tests/native-choice-list.test.ts +13 -0
- package/tests/native-review-cli.test.ts +0 -33
- package/tests/odd-routing-contract.test.ts +208 -0
- package/tests/orchestrator-budget.test.ts +17 -2
- package/tests/package-manifest.test.ts +115 -27
- package/tests/persona-single-channel.test.ts +3 -3
- package/tests/pi-pretty.test.ts +45 -0
- package/tests/profile-pin.test.ts +370 -0
- package/tests/quiet-tool-rendering.test.ts +32 -5
- package/tests/review-contract-prompt.test.ts +9 -0
- package/tests/review-controller.test.ts +0 -44
- package/tests/review-session-standing-permission-ipc.test.ts +427 -13
- package/tests/runtime-harness.mjs +4 -4
- package/tests/sdd-agent-tools.test.ts +15 -36
- package/tests/sdd-archive-replay.test.ts +82 -0
- package/tests/sdd-classical-continuation.test.ts +74 -0
- package/tests/sdd-execution-routing-contract.test.ts +18 -2
- package/tests/sdd-managed-runtime-settlement.test.ts +42 -330
- package/tests/sdd-native-managed-uptake.test.ts +11 -21
- package/tests/sdd-no-attempts-contract.test.ts +15 -0
- package/tests/sdd-odd-integration.test.ts +33 -0
- package/tests/sdd-optional-research.test.ts +124 -0
- package/tests/sdd-planning-routing-contract.test.ts +1 -1
- package/tests/sdd-preflight-rpc-input.test.ts +125 -0
- package/tests/sdd-preflight.test.ts +1 -1
- package/tests/sdd-research-capabilities.test.ts +20 -162
- package/tests/sdd-selection-transport.test.ts +180 -88
- package/tests/sdd-status.test.ts +5 -778
- package/tests/sdd-task-truth.test.ts +43 -0
- package/tests/session-change-capture.test.ts +20 -2
- package/tests/session-changes.test.ts +11 -0
- package/tests/shell-bar.test.ts +21 -0
- package/tests/shell-card.test.ts +8 -6
- package/tests/shell-changes.test.ts +8 -0
- package/tests/shell-prompt.test.ts +41 -7
- package/tests/shell-sidebar-banner.test.ts +4 -4
- package/tests/shell-sidebar-layout.test.ts +97 -13
- package/tests/startup-banner.test.ts +55 -2
- package/tests/windows-hidden-processes.test.ts +303 -0
- package/tests/windows-session-bootstrap.test.ts +1772 -0
- package/tests/windows-session-compile.test.ts +170 -0
- package/tests/windows-session-transport.test.ts +754 -0
- package/assets/agents/sdd-sync.md +0 -146
- package/lib/openspec-guardrails.ts +0 -99
- package/tests/native-sdd-attempt-authority.test.ts +0 -240
- package/tests/openspec-guardrails.test.ts +0 -71
|
@@ -9,7 +9,7 @@ Run only after the interactive parent has resolved SDD preflight and injected it
|
|
|
9
9
|
|
|
10
10
|
## Interactive mode guard
|
|
11
11
|
|
|
12
|
-
This chain is a continuous lifecycle pipeline. Use it only in auto mode or explicit full-lifecycle approval. In interactive mode the parent/orchestrator must stop at each phase boundary, present the current artifact, and ask the user before continuing. Approval to start SDD is not approval of the generated proposal, specs, design, tasks, apply
|
|
12
|
+
This chain is a continuous lifecycle pipeline. Use it only in auto mode or explicit full-lifecycle approval. In interactive mode the parent/orchestrator must stop at each phase boundary, present the current artifact, and ask the user before continuing. Approval to start SDD is not approval of the generated proposal, specs, design, tasks, apply or archive phases.
|
|
13
13
|
|
|
14
14
|
## sdd-init
|
|
15
15
|
|
|
@@ -71,31 +71,13 @@ output: apply-progress.md
|
|
|
71
71
|
outputMode: file-only
|
|
72
72
|
progress: true
|
|
73
73
|
|
|
74
|
-
Implement only approved implementation-owned tasks for {task}; enforce strict TDD when active and stop before writing if workload decisions are unresolved. Update OpenSpec tasks and apply-progress with evidence. When implementation completes,
|
|
75
|
-
|
|
76
|
-
## sdd-verify
|
|
77
|
-
|
|
78
|
-
reads: proposal.md+spec.md+design.md+tasks.md+apply-progress.md
|
|
79
|
-
output: verify-report.md
|
|
80
|
-
outputMode: file-only
|
|
81
|
-
progress: true
|
|
82
|
-
|
|
83
|
-
Verify {task} against specs, design, tasks, implementation, apply-progress, strict TDD evidence, assertion quality, and review workload boundaries.
|
|
84
|
-
|
|
85
|
-
## sdd-sync
|
|
86
|
-
|
|
87
|
-
reads: proposal.md+spec.md+design.md+tasks.md+apply-progress.md+verify-report.md
|
|
88
|
-
output: sync-report.md
|
|
89
|
-
outputMode: file-only
|
|
90
|
-
progress: true
|
|
91
|
-
|
|
92
|
-
Sync verified file-backed delta specs for {task} into `openspec/specs/` without archiving. In Engram-only mode, report that canonical sync is not applicable.
|
|
74
|
+
Implement only approved implementation-owned tasks for {task}; enforce strict TDD when active and stop before writing if workload decisions are unresolved. Update OpenSpec tasks and apply-progress with evidence. When implementation completes, request fresh native status. The classical route is apply -> archive; verification remains explicitly optional, and archive composes applicable delta specs. If the installed provider still requires verify, return that native prerequisite to the parent without skipping or inventing it. No post-SDD RDD authority, receipt, or delivery gate is required.
|
|
93
75
|
|
|
94
76
|
## sdd-archive
|
|
95
77
|
|
|
96
|
-
reads:
|
|
78
|
+
reads: proposal.md+spec.md+design.md+tasks.md+apply-progress.md
|
|
97
79
|
output: archive-report.md
|
|
98
80
|
outputMode: file-only
|
|
99
81
|
progress: true
|
|
100
82
|
|
|
101
|
-
Archive {task} only when
|
|
83
|
+
Archive {task} only when fresh native status admits archive and persisted implementation tasks are complete. Compose applicable file-backed delta specs, preserve collision/destructive-write consent and archive history, then persist the closure report. Read optional verification evidence when present; do not require it or a separate sync report. If native selects another action, return it to the parent and preserve active artifacts.
|
|
@@ -31,22 +31,13 @@ output: verify-report.md
|
|
|
31
31
|
outputMode: file-only
|
|
32
32
|
progress: true
|
|
33
33
|
|
|
34
|
-
Run focused and full verification for {task} using the apply-progress and project artifacts. Include review/judgment blockers.
|
|
35
|
-
|
|
36
|
-
## sdd-sync
|
|
37
|
-
|
|
38
|
-
reads: init.md+apply-progress.md+verify-report.md
|
|
39
|
-
output: sync-report.md
|
|
40
|
-
outputMode: file-only
|
|
41
|
-
progress: true
|
|
42
|
-
|
|
43
|
-
Sync verified file-backed delta specs for {task} into `openspec/specs/` without archiving. In Engram-only mode, report that canonical sync is not applicable.
|
|
34
|
+
Run focused and full verification for {task} using the apply-progress and project artifacts. Include review/judgment blockers. Persist a practical verification report with actual commands, outcomes, coverage and remaining blockers; do not require a retired verification-attestation command for classical providers. If the installed legacy provider still emits additional requirements, return and follow its exact instructions without overriding readiness or inventing a compatibility procedure.
|
|
44
35
|
|
|
45
36
|
## sdd-archive
|
|
46
37
|
|
|
47
|
-
reads:
|
|
38
|
+
reads: init.md+apply-progress.md+verify-report.md
|
|
48
39
|
output: archive-report.md
|
|
49
40
|
outputMode: file-only
|
|
50
41
|
progress: true
|
|
51
42
|
|
|
52
|
-
|
|
43
|
+
When native status admits archive and verification has no unresolved blockers, compose applicable delta specs inside archive and close {task}. Preserve task completion, collision, destructive-change consent and archive-history guards. This explicitly selected verification chain does not make verification mandatory in the full lifecycle.
|
|
@@ -69,6 +69,36 @@ Exceptions:
|
|
|
69
69
|
- Ask a subagent to produce Spanish only when its output is intended to be pasted directly to the user, a PR/comment/reply in Spanish, or Spanish-language product/documentation text.
|
|
70
70
|
- SDD/OpenSpec artifact content may follow the project's established language, but phase task instructions to subagents should still be English.
|
|
71
71
|
|
|
72
|
+
### Organic Driven Development (ODD)
|
|
73
|
+
|
|
74
|
+
These instructions apply to organic work, not explicitly selected SDD. Preserve the existing direct/delegated topology and one parent owner; do not introduce an ODD CLI, specialized agent, or execution harness.
|
|
75
|
+
|
|
76
|
+
#### Authorization and progress
|
|
77
|
+
|
|
78
|
+
Investigation, explanation, review, comparison, and proposal-only requests remain read-only: no writer, apply, or implementation artifacts. Ambiguous or conditional change intent requires one clarification; stop and wait. Explore existing code and requirements proportionately first. Research findings and automatic execution pace never authorize mutations.
|
|
79
|
+
|
|
80
|
+
Small, understood work creates no durable task artifacts. Substantial means coordinated steps or progress worth recovering, not a line threshold. For substantial authorized implementation, automatically create the feature document after exploration, without a task or storage permission prompt. Follow `orchestrator-memory.md` for the file and full Engram recovery copy, automatic updates, truthful checkoffs, and resume. Keep the parent responsible for reconciliation; bounded workers receive the document locator, relevant intent, task IDs, authorized scope and checks, not authority over unrelated tasks; they read the document before edits.
|
|
81
|
+
|
|
82
|
+
Use about 400 authored changed lines per ODD task only as a planning heuristic, counting additions plus deletions. Keep the smallest coherent behavior with its tests and docs. This is not a task acceptance criterion, hard cap, counter-trigger, automatic stop, forced split, or RDD trigger. If the correct clear solution naturally exceeds it, briefly explain why and continue without size-only rework loops. Never delete spaces, blank lines, or comments for cosmetic line savings; never omit tests, minify, add gratuitous abstractions, or split artificially to fit the heuristic. Forward this same advisory-only instruction when delegating tasks to subagents. Existing PR size gates remain unchanged; follow repository policy.
|
|
83
|
+
|
|
84
|
+
#### Research depth without a new phase
|
|
85
|
+
|
|
86
|
+
Recommend optional research only for a named uncertainty. Establish the problem, intended outcome, constraints, and current evidence; inspect relevant code. Adapt depth to uncertainty and consequence: no fixed questionnaire or mandatory rounds. The parent owns product decisions: ask one focused user question only for a real unresolved product decision, then stop and wait; workers return gaps to the parent rather than assuming choices.
|
|
87
|
+
|
|
88
|
+
When the question needs external evidence, use available authorized documentation/web tools and prefer primary sources. Attribute material claims to URLs or code locations; distinguish verified facts, assumptions, contradictions, freshness, and gaps. If tools are unavailable, disclose limitations without inventing access or evidence. If research is declined, continue within authorized scope only where safe without the missing evidence; pause only unsafe decisions dependent on it.
|
|
89
|
+
|
|
90
|
+
Return concise findings, recommendation, tradeoffs, open questions, and implementation implications. Offer a concise proposal only when a real scope or product decision needs it. Neither research nor a proposal is mandatory. Forward these research instructions to an existing fresh general exploration/research worker through the existing delegation mechanism; do not create a specialized agent or invoke `sdd-research`. Research remains read-only and requires no new persistence or readiness machinery.
|
|
91
|
+
|
|
92
|
+
Use at most one scoped independent read-only assumption challenge for a high-consequence unproven premise, even in a small security-critical change. Name the premise, evidence, and consequence; do not start a debate loop. Deterministic failures need fixes, not model debate. The native RDD refuter owns native review claims; never duplicate or bypass it with this challenge.
|
|
93
|
+
|
|
94
|
+
#### Checks and candidate consent
|
|
95
|
+
|
|
96
|
+
Resolve effective TDD on/off from existing project/session configuration or explicit user choice; retain its source and exact test runner. Record resolved mode, source, and runner in the feature document when present. Tests or frameworks being present does not enable TDD. Forward mode, source, and runner on every implementation delegation; refresh on resume. When enabled, require observed RED before implementation, GREEN, then REFACTOR; never invent evidence. When disabled, run ordinary functional checks, not no checks. If mode is unknown/conflicting or the runner is missing, disclose and resolve only the ambiguity affecting the next action; never invent precedence or a command, and never invoke sdd-init to determine ODD TDD.
|
|
97
|
+
|
|
98
|
+
Run applicable functional checks per task, not an RDD cycle per TODO checkbox. Preserve the RDD-aware Verification rule below and coordinate native review at the applicable deliverable candidate boundary, not every task update. Checklists grant no approval or receipt and never skip an existing delivery gate.
|
|
99
|
+
|
|
100
|
+
When RDD is enabled, first use native candidate risk assessment through `gentle_review` with `{"operation":"assess"}`. Passive/low uses silent structural checks with no reviewer or consent ceremony. Medium/high relays existing candidate consent and follows the native plan: native review runs only on grant; a decline continues under ordinary policy. Do not substitute model judgment, task size, or defect severity for prospective candidate risk; never infer low risk from a failed assessment. Follow the mirrored provider contract and native continuations; this paragraph introduces no lifecycle route. When RDD is disabled, do not start or prompt for RDD; ordinary checks remain. A checklist or assumption challenge never enables RDD, replaces its refuter, or answers consent.
|
|
101
|
+
|
|
72
102
|
### Delegation Rules
|
|
73
103
|
|
|
74
104
|
These rules select execution topology, not the implementation method. Crossing a threshold selects **delegated direct** work; it never selects SDD, creates SDD state, or invokes an `sdd-*` phase. Implementation runs as **direct inline**, **delegated direct**, or **optional SDD**; size, file count, or risk alone never selects SDD. SDD phase workers are reserved for an explicit SDD request or a proposal the user accepted.
|
|
@@ -98,7 +128,7 @@ These are parent-orchestrator routing boundaries. Use the smallest useful topolo
|
|
|
98
128
|
3. **Write rule**: keep one mechanical, already-understood file inline only when it needs no research or unresolved design work; delegate one writer for 2+ non-trivial files.
|
|
99
129
|
4. **Context rule**: delegate reading that prepares a write and broad research/context compression.
|
|
100
130
|
5. **Per-action rule**: tests, builds, and installs may use fresh workers without changing the implementation route or creating SDD state.
|
|
101
|
-
6. **Optional SDD rule**:
|
|
131
|
+
6. **Optional SDD rule**: retain SDD only after an explicit request or accepted proposal. Resolve organic uncertainty with optional research and a concise proposal only for a real decision; risk alone never forces SDD.
|
|
102
132
|
|
|
103
133
|
For bounded multi-file writes, prefer the installed package-owned `gentle-ai-worker`, then a user-configured `worker`. If neither worker definition exists, fall back to the native `Agent` even when `subagent_*` tools are available. If no delegation mechanism is available, stop and explain the blocker. Judgment Day phase roles are never generic fallbacks. If the generic writer chain is unavailable, use the documented native generic fallback or stop.
|
|
104
134
|
|
|
@@ -130,7 +160,7 @@ The bounded multi-file writer precedence in rule 3 overrides that general runtim
|
|
|
130
160
|
2. **Multi-file write rule**: for bounded multi-file writes, prefer the installed package-owned `gentle-ai-worker`, then a user-configured `worker`. If neither worker definition exists, fall back to the native `Agent` even when `subagent_*` tools are available. If no delegation mechanism is available, stop and explain the blocker.
|
|
131
161
|
3. **Incident rule**: after wrong `cwd`, accidental repository/worktree mutation, failed merge recovery, confusing test command, or environment workaround, stop and diagnose the incident separately before resuming.
|
|
132
162
|
4. **Long-session rule**: if accumulating work is no longer clearly local — roughly 20 tool calls, 5 exploratory file reads, or 2 non-mechanical edits without delegation — pause and delegate the remaining work instead of silently continuing monolithically.
|
|
133
|
-
5. **Verification rule** (gentle-pi#661/#662, RDD-aware; normative -- referenced, not restated, elsewhere in this file): read the rendered `Receipt-driven development:` line next to `Background subagent policy`. The bounded writer always runs the exact parent-authorized commands under the delegated task's `## Verification` heading, synchronously and in the foreground, and reports each as `<command>: <observed result>` -- see `gentle-ai-worker`'s Verification contract for the exact rules, including how `## Known environmental failures` (exact pre-existing base failures) differs from any other failing required command, which still forces `status: partial`. When the line reads `on`, that writer report is the verification of record, and the native review is the independent check the writer cannot influence: `gentle-ai-verify` (or the native `Agent` fallback, with the same read-only verification task and exact parent-authorized commands) becomes on-demand -- reach for it only when the writer reports `partial`/`blocked`, the check is expensive or external (E2E runs, installs) and the parent wants a cheaper profile, or the parent wants an independent spot check. That `on` branch holds only while the native review actually reaches a terminal outcome for this candidate (gentle-pi#668): a human decline of the consent envelope for this candidate (candidate-scoped, never the RDD kill switch), a clone-local RDD disable discovered mid-flow, or a refused START/STATUS all fall back to the risk-gated path exactly as `off` -- call `gentle_review` with `{"operation":"assess"}` (pass `nativeReviewOutcome` when the parent already knows it; the tool derives it from what it itself observed for the candidate otherwise, failing closed to `unknown` when it cannot) and follow the returned plan. When the line reads `off` or `unknown`, after the writer returns, call `gentle_review` with `{"operation":"assess"}` over the writer's diff and follow the returned plan instead of judging non-triviality from the task description: the operation resolves the native risk tier and states exactly who verifies next. The tier table (stated once, here):
|
|
163
|
+
5. **Verification rule** (gentle-pi#661/#662, RDD-aware; normative -- referenced, not restated, elsewhere in this file): read the rendered `Receipt-driven development:` line next to `Background subagent policy`. The bounded writer always runs the exact parent-authorized commands under the delegated task's `## Verification` heading, synchronously and in the foreground, and reports each as `<command>: <observed result>` -- see `gentle-ai-worker`'s Verification contract for the exact rules, including how `## Known environmental failures` (exact pre-existing base failures) differs from any other failing required command, which still forces `status: partial`. Those foreground commands are live work, not silence: while a tool call is in flight the runner's stall watchdog uses `tool_stall_timeout_ms` (default 30 minutes) instead of the `stall_timeout_ms` idle budget. When the line reads `on`, that writer report is the verification of record, and the native review is the independent check the writer cannot influence: `gentle-ai-verify` (or the native `Agent` fallback, with the same read-only verification task and exact parent-authorized commands) becomes on-demand -- reach for it only when the writer reports `partial`/`blocked`, the check is expensive or external (E2E runs, installs) and the parent wants a cheaper profile, or the parent wants an independent spot check. That `on` branch holds only while the native review actually reaches a terminal outcome for this candidate (gentle-pi#668): a human decline of the consent envelope for this candidate (candidate-scoped, never the RDD kill switch), a clone-local RDD disable discovered mid-flow, or a refused START/STATUS all fall back to the risk-gated path exactly as `off` -- call `gentle_review` with `{"operation":"assess"}` (pass `nativeReviewOutcome` when the parent already knows it; the tool derives it from what it itself observed for the candidate otherwise, failing closed to `unknown` when it cannot) and follow the returned plan. When the line reads `off` or `unknown`, after the writer returns, call `gentle_review` with `{"operation":"assess"}` over the writer's diff and follow the returned plan instead of judging non-triviality from the task description: the operation resolves the native risk tier and states exactly who verifies next. The tier table (stated once, here):
|
|
134
164
|
|
|
135
165
|
| Native risk tier | Verification when RDD is `off`/`unknown` |
|
|
136
166
|
|---|---|
|
|
@@ -219,7 +249,7 @@ Do not make every task SDD. Do make non-trivial tasks multi-agent at the narrowe
|
|
|
219
249
|
|
|
220
250
|
#### 3. SDD (optional)
|
|
221
251
|
|
|
222
|
-
SDD is never selected by size, file count, or risk alone.
|
|
252
|
+
SDD is never selected by size, file count, or risk alone. Do not recommend SDD merely to resolve ambiguity. Use the organic research guidance above; retain SDD when the user explicitly requests it or accepts a proposal to use it.
|
|
223
253
|
|
|
224
254
|
Select SDD only when the user explicitly asks to use SDD, invokes `/gentle-sdd-new`, `/gentle-sdd-ff`, or `/gentle-sdd-continue`, or accepts an SDD proposal. Once selected, do not jump directly to implementation. Calibrate context, create artifacts, and ask for approval at the appropriate gates.
|
|
225
255
|
|
|
@@ -1,28 +1,41 @@
|
|
|
1
1
|
# Orchestrator — Memory Detail (lazy-loaded)
|
|
2
2
|
|
|
3
|
-
Bind this to the parent Pi session only, on SDD phase memory reads/writes. Not always-on; loaded on demand from `assets/orchestrator.md`'s `## Memory Contract` pointer.
|
|
3
|
+
Bind this to the parent Pi session only, on organic progress/recovery or SDD phase memory reads/writes. Not always-on; loaded on demand from `assets/orchestrator.md`'s `## Memory Contract` pointer.
|
|
4
|
+
|
|
5
|
+
### Organic feature continuity
|
|
6
|
+
|
|
7
|
+
For substantial authorized organic implementation, the parent maintains `odd/tasks/<feature-name>.md` and an Engram recovery copy under topic `odd/<feature-name>/tasks`, scoped to the current project. Use a descriptive filename-safe feature name, reuse the same identity, and never overwrite another feature. Keep one feature document, not a separate plan file or topic: objective, problem, why, scope, constraints, actionable checklist with stable task IDs, acceptance criteria and checks, progress, verification evidence, and next step. Include concise rationale for meaningful accepted changes. Routine corrections stay with their tasks; no exhaustive decision journal. Mirror the full current document and repository-relative file locator, not only a summary or completion notice.
|
|
8
|
+
|
|
9
|
+
Accepted user, review, or verification changes automatically update affected intent and TODOs: preserve valid completed and unrelated work; add genuinely new tasks or reopen invalidated items with a reason, and revise their checks. Findings alone never authorize scope expansion or automatic acceptance. New business scope still requires user authorization. Check off only observed outcomes with applicable proof; record failed, unavailable, skipped, or pending checks honestly. The parent merges bounded worker results rather than replacing the entire feature with one worker's partial view.
|
|
10
|
+
|
|
11
|
+
Persist local progress first, then mirror through the existing injected Engram save tool. Read back both writes; they are not atomic. If Engram is unavailable, preserve local progress and explicitly mark the mirror pending; do not claim persistence succeeded or block unrelated safe work. Resynchronize when available. If a file write is unsafe or unavailable, preserve existing state and report the limitation. Preserve both versions on irreconcilable edits and ask only about the real conflict; never silently prefer a newer timestamp.
|
|
12
|
+
|
|
13
|
+
On resume, use `mem_context`, then project/feature-scoped `mem_search`, and `mem_get_observation` for the full saved document; read the actual task file. Do not infer active work from the newest global memory. Reconcile current requirements, code, and proof before continuing the next unfinished task. Preserve pending mirrors and conflicting edits; a missing copy is not permission to overwrite surviving progress. Use the injected equivalents of these existing memory tools, never invent availability.
|
|
14
|
+
|
|
15
|
+
Before implementation or resume, the parent reads both the actual file and full observation, reconciles them, and passes the locator and relevant context; workers read the document before edits. Small work without a document still receives its authorized scope and checks.
|
|
16
|
+
|
|
17
|
+
The existing `todo` tool is an optional session/UI projection, not a third authority. Rebuild it from reconciled feature progress when useful; its replay or completed-list clearing must not delete or replace the durable file or Engram copy. Small/read-only work does not acquire an ODD artifact merely because the UI displays tasks.
|
|
4
18
|
|
|
5
19
|
### SDD phases
|
|
6
20
|
|
|
7
|
-
|
|
21
|
+
Except for output-only `sdd-research`, each SDD phase subagent reads its own required inputs directly from the active backend; the parent passes artifact references (topic keys or file paths), NOT the content itself. Phase subagents persist their artifact before returning.
|
|
8
22
|
|
|
9
23
|
| Phase | Reads | Writes |
|
|
10
24
|
| -------------- | ------------------------------------------------------- | ---------------- |
|
|
11
25
|
| `sdd-explore` | nothing | `explore` |
|
|
12
|
-
| `sdd-research` |
|
|
26
|
+
| `sdd-research` | parent-supplied context (when available) | inline findings; parent may persist |
|
|
13
27
|
| `sdd-proposal` | exploration (optional) | `proposal` |
|
|
14
28
|
| `sdd-spec` | proposal (required) | `spec` |
|
|
15
29
|
| `sdd-design` | proposal (required) | `design` |
|
|
16
30
|
| `sdd-tasks` | spec + design (required) | `tasks` |
|
|
17
31
|
| `sdd-apply` | tasks + spec + design + `apply-progress` (if it exists) | `apply-progress` |
|
|
18
32
|
| `sdd-verify` | spec + tasks + `apply-progress` | `verify-report` |
|
|
19
|
-
| `sdd-sync` | proposal + spec + design + tasks + `verify-report` | `sync-report` |
|
|
20
33
|
| `sdd-archive` | all artifacts | `archive-report` |
|
|
21
34
|
| `sdd-status` | change artifacts (read-only) | nothing |
|
|
22
35
|
|
|
23
|
-
- SDD artifact keys: in memory/hybrid mode, phase artifacts use stable topic keys such as `sdd/<change>/proposal`, `sdd/<change>/spec`, `sdd/<change>/design`, `sdd/<change>/tasks`, `sdd/<change>/apply-progress`, `sdd/<change>/verify-report`, `sdd/<change>/
|
|
24
|
-
-
|
|
25
|
-
- If memory tools are unavailable, do not pretend persistence exists
|
|
36
|
+
- SDD artifact keys: in memory/hybrid mode, phase artifacts use stable topic keys such as `sdd/<change>/proposal`, `sdd/<change>/spec`, `sdd/<change>/design`, `sdd/<change>/tasks`, `sdd/<change>/apply-progress`, `sdd/<change>/verify-report`, `sdd/<change>/archive-report`.
|
|
37
|
+
- Research is output-only. The parent may persist useful findings at `sdd/<change>/research` or `openspec/changes/<change>/research.md` through actual authorized tools and read back claimed output. Historical pre-proposal records remain readable but are not prerequisites or readiness authority.
|
|
38
|
+
- If memory tools are unavailable, do not pretend persistence exists and do not switch the selected store. Return useful artifacts inline with the persistence limitation; write OpenSpec files only when that backend was already selected and authorized. In hybrid mode, report each backend's actual outcome rather than presenting a one-sided write as complete persistence.
|
|
26
39
|
|
|
27
40
|
Memory lifecycle rule (when Engram exposes lifecycle metadata/tooling):
|
|
28
41
|
|
package/assets/orchestrator.md
CHANGED
|
@@ -29,7 +29,7 @@ Subagent-facing English delegation and the quote/UI/SDD-artifact exceptions: `or
|
|
|
29
29
|
el Gentleman is an ecosystem configurator and harness layer. After installation, the user should not memorize workflows or manually wire agents. The package should get out of the way:
|
|
30
30
|
|
|
31
31
|
- Small request: do it directly.
|
|
32
|
-
- Substantial
|
|
32
|
+
- Substantial authorized work: use ODD; track feature progress automatically.
|
|
33
33
|
- User explicitly asks to use SDD: run the SDD flow.
|
|
34
34
|
- Parent session orchestrates; phase agents execute.
|
|
35
35
|
|
|
@@ -41,7 +41,9 @@ Route work through the smallest harness that is safe. Three tiers:
|
|
|
41
41
|
|
|
42
42
|
1. **Inline Direct** — small, mechanical, parent has context (typo, one-file edit, read-only check of 1-3 known files, bash for state). No SDD ceremony; stop when it is no longer small.
|
|
43
43
|
2. **Simple Delegation** — generic non-SDD exploration → `gentle-ai-explore`; bounded implementation → `gentle-ai-worker`; command-running generic non-SDD verification → `gentle-ai-verify`. Try its package role; if missing/unusable, use native `Agent` under the same read-only mapping/verification constraints and report fallback. SDD roles stay inside SDD.
|
|
44
|
-
3. **SDD (optional)** —
|
|
44
|
+
3. **SDD (optional)** — only by explicit request or accepted proposal, never size, file count, or risk. Resolve organic ambiguity with optional research, not SDD. Selected SDD commands and approval gates: `sdd-orchestrator-workflow.md`.
|
|
45
|
+
|
|
46
|
+
ODD (Default Workflow, harness section above) is mandatory on every request; detail: `orchestrator-delegation.md`, `orchestrator-memory.md`.
|
|
45
47
|
|
|
46
48
|
## Delegation Rules
|
|
47
49
|
|
|
@@ -63,7 +65,7 @@ Per-action table, Work Routing Ladder examples, Cost and Context Balance, Canoni
|
|
|
63
65
|
|
|
64
66
|
## SDD Workflow (lazy-loaded)
|
|
65
67
|
|
|
66
|
-
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/
|
|
68
|
+
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/archive work, or SDD/Judgment-Day phase delegation, read this package asset first:
|
|
67
69
|
|
|
68
70
|
`sdd-orchestrator-workflow.md`
|
|
69
71
|
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
# SDD Orchestrator Workflow
|
|
2
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/
|
|
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/archive work, or SDD/Judgment-Day phase delegation.
|
|
4
4
|
|
|
5
5
|
## SDD Workflow
|
|
6
6
|
|
|
7
7
|
SDD phases:
|
|
8
8
|
|
|
9
9
|
```text
|
|
10
|
-
init → explore → research (optional) → proposal → spec → design → tasks → apply →
|
|
10
|
+
init → explore → research (optional) → proposal → spec → design → tasks → apply → archive (verification optional)
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Dependency graph:
|
|
14
14
|
|
|
15
15
|
```text
|
|
16
16
|
explore → research (optional) → proposal
|
|
17
|
-
proposal → spec ─┬→ tasks → apply →
|
|
17
|
+
proposal → spec ─┬→ tasks → apply → archive (verification optional)
|
|
18
18
|
proposal → design ┘
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
`/gentle-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/
|
|
21
|
+
`/gentle-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/archive.
|
|
22
22
|
|
|
23
23
|
## Native SDD Dispatcher
|
|
24
24
|
|
|
@@ -41,7 +41,7 @@ Native unprefixed tokens are the only automatic planning routes. Prefixed or loc
|
|
|
41
41
|
|
|
42
42
|
These planning routes remain runnable when missing planning artifacts leave `dependencies.apply: blocked`; do not require apply readiness to produce those artifacts. This is a planning-only exception, not permission to run apply or another blocked non-planning phase.
|
|
43
43
|
|
|
44
|
-
Before any planning launch, stop for ambiguous change selection, unresolved session preflight, or unsafe action context. Carry `actionContext` and prove planned writes are within the authoritative workspace or allowed edit roots; workspace-planning without allowed edit roots remains read-only. Planning does not bypass the init guard,
|
|
44
|
+
Before any planning launch, stop for ambiguous change selection, unresolved session preflight, or unsafe action context. Carry `actionContext` and prove planned writes are within the authoritative workspace or allowed edit roots; workspace-planning without allowed edit roots remains read-only. Planning does not bypass the init guard, optional research guidance, or phase approval requirements.
|
|
45
45
|
|
|
46
46
|
## Bounded Execution Routing
|
|
47
47
|
|
|
@@ -52,22 +52,22 @@ Before any planning launch, stop for ambiguous change selection, unresolved sess
|
|
|
52
52
|
| `remediate` | `sdd-remediate` |
|
|
53
53
|
| `archive` | `sdd-archive` |
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
For automatic continuation, execute only the selected native action when its dependency and `actionContext` permit it. Unknown, malformed, blocked, or unsupported values stop before work; prose and local routing cannot replace them. `notes` is separate from `blockedReasons` and never gates: report a non-empty `notes` value as informational and proceed when the dependency and `blockedReasons` gates allow.
|
|
56
56
|
|
|
57
57
|
## SDD Status Contract
|
|
58
58
|
|
|
59
|
-
Before `/gentle-sdd-continue`, `sdd-apply`, `sdd-verify`,
|
|
59
|
+
Before `/gentle-sdd-continue`, `sdd-apply`, `sdd-verify`, 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.
|
|
60
60
|
|
|
61
61
|
Status must include:
|
|
62
62
|
|
|
63
63
|
- active change selection and how it was resolved;
|
|
64
|
-
- artifact store and paths/topics for proposal, specs, design, tasks, apply-progress
|
|
64
|
+
- artifact store and paths/topics for proposal, specs, design, tasks, apply-progress and optional verify-report;
|
|
65
65
|
- task progress with exact unchecked `- [ ]` implementation task lines;
|
|
66
|
-
- dependency states for apply, verify,
|
|
66
|
+
- dependency states for apply, verify, and archive;
|
|
67
67
|
- `actionContext` with mode, workspace root, allowed edit roots, and warnings;
|
|
68
68
|
- next recommended action.
|
|
69
69
|
|
|
70
|
-
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/
|
|
70
|
+
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/archive and ask for an explicit implementation/edit scope.
|
|
71
71
|
|
|
72
72
|
## Lazy SDD Preflight
|
|
73
73
|
|
|
@@ -135,19 +135,15 @@ Interactive approval is phase-scoped. A user response such as "continue", "dale"
|
|
|
135
135
|
|
|
136
136
|
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.
|
|
137
137
|
|
|
138
|
-
## Research
|
|
138
|
+
## Optional Research
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
Recommend research when complexity, consequential uncertainty, or external facts warrant it, before or after exploration as useful. Research is not a prerequisite for questions, proposal, spec, design, or tasks; selection does not turn it into a completion gate. Supply concrete questions, requested depth, relevant local context and skill instructions, and source restrictions to the output-only `sdd-research` child; do not pass local paths as child read obligations.
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
- Before every proposal, invoke `sdd-proposal` only when selected research is `done` or research is unselected, product decisions are `confirmed`, evidence references are valid, and the selected artifact-store state is ready.
|
|
144
|
-
- The orchestrator owns product discovery. In automatic mode, unresolved product choices require one lossless grouped prompt with all context, options, consequences, allowed answers, and exact tokens; the orchestrator MUST persist the pending pre-proposal state before prompting, then STOP without invoking `sdd-proposal`.
|
|
145
|
-
- The proposer receives a confirmed pre-proposal handoff and MUST NOT interview the user or infer consent.
|
|
146
|
-
- Pi's native `gentle-pi.sdd-status` contract remains the sole status contract. Research and pre-proposal state are orchestrator-owned prose and artifacts (`sdd/{change}/research`, `sdd/{change}/preproposal`, `openspec/changes/{change}/research.md`) layered on top — never a native status field.
|
|
142
|
+
The parent owns local reads, product choices, and any authorized persistence/readback. Do not make the research child fetch local artifacts or write files/Engram. Use the existing parent tools and selected store when findings merit persistence: exact change-local paths or project/topic keys, with actual readback before claiming success. First artifacts and in-memory sessions require no prior identity or checkpoint. For hybrid storage, report each actual write/readback result and resolve genuine divergence before overwriting; do not create another authority or claim a failed save succeeded. Preserve historical artifacts without requiring them for new research.
|
|
147
143
|
|
|
148
|
-
|
|
144
|
+
Use individually authorized tools from the injected `## SDD Research Capabilities`. Documentation uses `fetch_content`; open-web uses any authorized available subset of `web_search`, `source_check`, `fetch_content`, and `get_search_content`. Forward exact observed class-specific tools and existing extension provenance in `research_selection`; never broaden source restrictions, invent online access, or treat generic MCP gateways as narrow grants. The child rechecks actual availability and provenance. Inventory is not evidence: require source-backed claims, original sources, publisher/version/date, and honest limits.
|
|
149
145
|
|
|
150
|
-
|
|
146
|
+
Useful partial findings, unavailable sources, or an unpersisted inline result do not automatically block proposal or trigger a retry. Retain unanswered questions and explain their implications. Only a genuine unresolved product choice, unsafe dependent action, or actual permission denial blocks the work that depends on it. The parent relays product choices without inferring consent; no persisted pre-proposal readiness certificate is required. Native `gentle-ai.sdd-status` remains the sole SDD status authority; research adds no native phase or state.
|
|
151
147
|
|
|
152
148
|
## Delivery Strategy
|
|
153
149
|
|
|
@@ -194,17 +190,19 @@ Every installed SDD phase executor agent (`assets/agents/sdd-*.md`) carries the
|
|
|
194
190
|
|
|
195
191
|
In `auto` execution mode, the parent/orchestrator is the quality gate between SDD phases. After a delegated phase returns and before launching the next phase, validate that the phase actually reached its objective. This validation is autonomous: do not ask the user on the happy path, but stop and report if the gate catches a real problem.
|
|
196
192
|
|
|
193
|
+
**Optional research takes precedence over the success-only checks below:** accept honest partial, unavailable, or inline findings without requiring an artifact or retry. Check only claimed persistence through parent-owned readback; never force a research/pre-proposal certificate. Genuine product decisions, unsafe dependencies, and actual permission denials still constrain their dependent actions.
|
|
194
|
+
|
|
197
195
|
Check every phase result against the Result Contract:
|
|
198
196
|
|
|
199
197
|
- **Contract conformance:** the phase returned `status`, `executive_summary`, `artifacts`, `next_recommended`, `risks`, and `skill_resolution`, and `status` indicates success rather than partial, failed, or blocked.
|
|
200
198
|
- **Artifact existence:** every declared artifact exists and is readable in the active backend. For memory-backed flows, retrieve the topic with the available memory tools; for OpenSpec/file-backed flows, read the declared path. A successful phase with no retrievable artifact fails the gate.
|
|
201
199
|
- **No hallucinated references:** spot-check concrete file paths, symbols, commands, and artifacts the phase claims it created or used. Referenced paths or artifacts that do not resolve fail the gate.
|
|
202
|
-
- **No scope drift:** the output must stay consistent with its inputs and the dependency graph: spec stays within proposal scope, design answers the proposal, tasks cover spec and design, apply implements the tasks, verify checks the implementation against the spec, and
|
|
200
|
+
- **No scope drift:** the output must stay consistent with its inputs and the dependency graph: spec stays within proposal scope, design answers the proposal, tasks cover spec and design, apply implements the tasks, verify checks the implementation against the spec, and archive composes applicable specs while preserving task truth and safety.
|
|
203
201
|
- **Routing coherence:** `next_recommended` must follow the SDD dependency graph, and no unaddressed critical risk may be carried silently into the next phase.
|
|
204
202
|
|
|
205
203
|
Use cost-aware validation:
|
|
206
204
|
|
|
207
|
-
- For lower-risk phases (`sdd-explore`, `sdd-research`, `sdd-spec`, `sdd-tasks`, `sdd-
|
|
205
|
+
- For lower-risk phases (`sdd-explore`, `sdd-research`, `sdd-spec`, `sdd-tasks`, `sdd-archive`), the parent may validate inline by reading artifacts back and checking claims.
|
|
208
206
|
- For higher-risk phases (`sdd-design`, `sdd-apply`), validate the artifact, declared paths, task state, and focused test evidence directly before continuing because errors there compound downstream.
|
|
209
207
|
- If a gate finds any smell — missing artifact, status mismatch, unresolved path, likely drift, or critical risk — rerun the same SDD phase once with corrective feedback. SDD phase validation does not start ordinary review or Judgment Day.
|
|
210
208
|
|
|
@@ -212,40 +210,6 @@ On gate pass, continue automatically to the next phase. On gate fail, rerun the
|
|
|
212
210
|
|
|
213
211
|
The gatekeeper is additive: it does not relax the Review Workload Guard, Strict TDD Forwarding, native status dependency checks, or mandatory delegation rules. It never creates a post-SDD review pass.
|
|
214
212
|
|
|
215
|
-
## Native Runtime Attempt Authority
|
|
216
|
-
|
|
217
|
-
The package-local Gentle AI runtime owns the Git-common-dir compact SDD attempt ledger. It is the sole attempt and changed-line budget authority for both OpenSpec and Engram flows on Pi. Pi must not implement a local attempt mirror, counter, token store, state machine, or extension interception layer; such code would duplicate provider authority and could not truthfully settle all runs.
|
|
218
|
-
|
|
219
|
-
Before every runtime-bearing `sdd-apply`, `sdd-verify`, or remediation actor/harness launch, the orchestrator MUST call the compact acquire:
|
|
220
|
-
|
|
221
|
-
```text
|
|
222
|
-
gentle-ai sdd-attempt acquire --cwd <repo> --change <change> --request-id <id> --work-unit <label> --evidence-goal <goal> --max-attempts <count> --max-changed-lines <count>
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
Pass `--token` only to continue an active attempt; pass `--remediates-evidence-revision` only for an unmanaged remediation. Do not invent continuation or remediation state the provider has not returned.
|
|
226
|
-
|
|
227
|
-
The provider returns exactly one routing state from `proceed|blocked|complete`:
|
|
228
|
-
|
|
229
|
-
- `proceed`: launch only on `proceed`; retain the opaque token for settle.
|
|
230
|
-
- `blocked`: do not launch; stop and report.
|
|
231
|
-
- `complete`: do not launch; the objective is settled.
|
|
232
|
-
|
|
233
|
-
Never persist caller-authored attempt counters, tokens, or state in OpenSpec artifacts, Engram memory, prompts, or any Pi-owned state.
|
|
234
|
-
|
|
235
|
-
After the external run completes, call the compact settle with a request ID distinct from acquire, reusing an operation's own ID only for idempotent replay of that exact operation:
|
|
236
|
-
|
|
237
|
-
```text
|
|
238
|
-
gentle-ai sdd-attempt settle --cwd <repo> --change <change> --token <token> --request-id <id> --outcome <failed|interrupted|passed> [--evidence-revision <sha256:...>] --diagnosis <text> --harness-disposition <reused|invalidated> --cleanup-evidence <text> --process-evidence <text>
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
Every settle field except `evidence-revision` is required: `cwd`, `change`, `token`, `request-id`, `outcome`, `diagnosis`, `harness-disposition`, `cleanup-evidence`, and `process-evidence`. For `failed` or `passed`, include `--evidence-revision` with the `sha256:...` evidence hash. For `interrupted`, omit the entire `--evidence-revision` flag. Pass `--successor-lineage` only for a distinct approved successor; the current/bound lineage remains itself otherwise. Pass `--remediates-evidence-revision` only when repairing a specific failed evidence revision. Settle derives binding and remediation inputs; the orchestrator never invents them.
|
|
242
|
-
|
|
243
|
-
`status`, `begin`, `finish`, and `reset` are diagnostic/compatibility surfaces, not the normal runtime route. Route continuation only from the provider-returned `proceed|blocked|complete`. `reset` is never automatic and requires an explicit maintainer scope decision.
|
|
244
|
-
|
|
245
|
-
### Gatekeeper Reconciliation
|
|
246
|
-
|
|
247
|
-
The Automatic Mode Gatekeeper one-rerun rule above is a quality gate, not a launch authorization. A rerun never bypasses native attempt authority: every rerun still requires a fresh compact acquire, and the rerun must stop immediately if the provider returns `blocked` or `complete`. The gatekeeper quality rule is preserved and remains subordinate to this authority.
|
|
248
|
-
|
|
249
213
|
## SDD Phase Delegation Mode
|
|
250
214
|
|
|
251
215
|
Launch SDD phase subagents with `subagent_run` `mode: "task"` when the parent needs the phase result to route the next step. SDD phases, writers, dependent verify evidence, and archive are foreground-mandatory under the background subagent policy block in the delegation contract; background completion is a notification/history mechanism, not an orchestration resume guarantee.
|
|
@@ -261,14 +225,13 @@ On Pi, phase model routing is user-owned and persisted, not prompt-passed: `/gen
|
|
|
261
225
|
| Phase | Default tier | Reason |
|
|
262
226
|
| ------------ | -------------- | ------------------------------------------ |
|
|
263
227
|
| sdd-explore | balanced | Reads code, structural - not architectural |
|
|
264
|
-
| sdd-research | balanced |
|
|
228
|
+
| sdd-research | balanced | Optional source-backed investigation |
|
|
265
229
|
| sdd-proposal | deep-reasoning | Architectural decisions |
|
|
266
230
|
| sdd-spec | balanced | Structured writing |
|
|
267
231
|
| sdd-design | deep-reasoning | Architecture decisions |
|
|
268
232
|
| sdd-tasks | balanced | Mechanical breakdown |
|
|
269
233
|
| sdd-apply | balanced | Implementation |
|
|
270
234
|
| sdd-verify | balanced | Validation against spec |
|
|
271
|
-
| sdd-sync | fast | Reflect verified state |
|
|
272
235
|
| sdd-archive | fast | Copy and close |
|
|
273
236
|
| jd-judge-a | deep-reasoning | Adversarial review |
|
|
274
237
|
| jd-judge-b | deep-reasoning | Adversarial review |
|
|
@@ -345,8 +308,12 @@ Automatic mode does not override reviewer burnout protection.
|
|
|
345
308
|
|
|
346
309
|
## Recovery
|
|
347
310
|
|
|
348
|
-
For every store, request a fresh native v2 status projection. Artifact reads may supply phase inputs only after native selection; they never re-derive readiness, replace status, or bypass native refusal.
|
|
311
|
+
For every store, request a fresh native v2 status projection. Artifact reads may supply phase inputs only after native selection; they never re-derive readiness, replace status, or bypass native refusal.
|
|
349
312
|
|
|
350
313
|
## Provider Defect Handoff
|
|
351
314
|
|
|
352
315
|
When an SDD task encounters a possible Gentle AI provider defect, the full contract lives in `assets/orchestrator-delegation.md` under `#### Gentle AI Provider Defect Handoff (MANDATORY)`. This workflow intentionally provides no summary, alternate report route, or RDD lifecycle instruction.
|
|
316
|
+
|
|
317
|
+
## Classical completion
|
|
318
|
+
|
|
319
|
+
After completed apply, follow fresh native status to archive; verification is optional and explicitly invokable when its native dependency is ready and the provider recommends apply or archive. Never rewrite a pinned provider that still selects verify. Archive owns applicable delta-spec composition and retains task truth, dependsOn, real edit authority, confinement, collision/destructive-change consent, archive history and recovery. There is no standalone sync phase or post-SDD RDD prerequisite.
|
|
@@ -4,7 +4,7 @@ Shared OpenSpec-style contract for Gentle Pi SDD phases. Use this before acting
|
|
|
4
4
|
|
|
5
5
|
## Purpose
|
|
6
6
|
|
|
7
|
-
Any phase that selects, continues, applies, verifies,
|
|
7
|
+
Any phase that selects, continues, applies, verifies, or archives an SDD change MUST first produce or consume structured status. The status is the handoff between the parent orchestrator and phase executor.
|
|
8
8
|
|
|
9
9
|
## Change Selection
|
|
10
10
|
|
|
@@ -18,7 +18,8 @@ Any phase that selects, continues, applies, verifies, syncs, or archives an SDD
|
|
|
18
18
|
- `gentle-ai sdd-status --contract gentle-ai.sdd-status/v2` is the sole status authority for every store. It is read-only: inspect its native projection unchanged and never launch a phase, prepare consent, or grant roots while reading it.
|
|
19
19
|
- If native status is unavailable, malformed, or does not select the requested change/workspace, stop and report that failure. Do not construct a local status, infer readiness from artifacts, substitute continuation, or bypass it through Engram.
|
|
20
20
|
- `nextRecommended`, `dependencies`, `blockedReasons`, `actionContext`, and optional `phaseInstructions` are producer facts. Route only by their typed values, never by prose or a local lifecycle graph. A genuine blocker's human-readable explanation belongs in `blockedReasons`; a non-blocking diagnostic belongs in `notes`; neither belongs in `nextRecommended`.
|
|
21
|
-
-
|
|
21
|
+
- Ordinary SDD actors follow native selection and real edit grants; no attempt acquire/settle budget is required.
|
|
22
|
+
- Within one Pi runner, only one managed remediation actor may be queued or live in a canonical worktree. Wait for confirmed cleanup (or cancel and wait), then request fresh human authorization. This launch-local exclusion is not a cross-process lock; historical tasks are not admission authority. Other worktrees and ordinary tasks retain their existing concurrency.
|
|
22
23
|
- Only an explicitly authorized `gentle-ai sdd-continue` may prepare a missing change-instance marker. `ensureChangeInstanceMarker` has no status caller; its sole production path is `PrepareChangeInstanceConsent` through `sdd-continue`.
|
|
23
24
|
|
|
24
25
|
## Bounded Planning Routing
|
|
@@ -36,7 +37,7 @@ Native unprefixed tokens are the only automatic planning routes. Prefixed or loc
|
|
|
36
37
|
|
|
37
38
|
These planning routes remain runnable when missing planning artifacts leave `dependencies.apply: blocked`; do not require apply readiness to produce those artifacts. This is a planning-only exception, not permission to run apply or another blocked non-planning phase.
|
|
38
39
|
|
|
39
|
-
Before any planning launch, stop for ambiguous change selection, unresolved session preflight, or unsafe action context. Carry `actionContext` and prove planned writes are within the authoritative workspace or allowed edit roots; workspace-planning without allowed edit roots remains read-only. Planning does not bypass the init guard,
|
|
40
|
+
Before any planning launch, stop for ambiguous change selection, unresolved session preflight, or unsafe action context. Carry `actionContext` and prove planned writes are within the authoritative workspace or allowed edit roots; workspace-planning without allowed edit roots remains read-only. Planning does not bypass the init guard, optional research guidance, or phase approval requirements.
|
|
40
41
|
|
|
41
42
|
## Bounded Execution Routing
|
|
42
43
|
|
|
@@ -47,7 +48,7 @@ Before any planning launch, stop for ambiguous change selection, unresolved sess
|
|
|
47
48
|
| `remediate` | `sdd-remediate` |
|
|
48
49
|
| `archive` | `sdd-archive` |
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
For automatic continuation, execute only a native selected action whose dependency and `actionContext` permit it. Unknown, malformed, blocked, or unsupported actions stop before work; no local route, prefixed token, or prose can replace them. `notes` is separate from `blockedReasons` and never gates: report a non-empty `notes` value as informational and proceed when the dependency and `blockedReasons` gates allow.
|
|
51
52
|
|
|
52
53
|
## Status Schema
|
|
53
54
|
|
|
@@ -61,14 +62,6 @@ The orchestrator MUST carry `actionContext` into any phase launch.
|
|
|
61
62
|
- If `allowedEditRoots` is present, only edit or move files within those roots.
|
|
62
63
|
- If a phase cannot prove a file is inside the authoritative workspace or allowed edit roots, stop and ask for clarification.
|
|
63
64
|
|
|
64
|
-
## Native Runtime Attempt Authority
|
|
65
|
-
|
|
66
|
-
The compact SDD runtime attempt authority is separate from artifact dispatch and status. It is artifact-store agnostic: the same acquire/settle discipline applies to `openspec`, `engram`, `both`, and `none` stores. Its payload MUST NOT be embedded in the SDD v1 status schema above; status reports artifact state only, never attempt tokens or attempt counters. No OpenSpec or Engram attempt ledger may be created or mirrored by Pi.
|
|
67
|
-
|
|
68
|
-
Before every runtime-bearing `sdd-apply`, `sdd-verify`, or remediation launch, the orchestrator MUST acquire a bounded attempt from the provider compact CLI; after the external run completes it MUST settle. The acquire and settle request IDs are distinct; an operation's own request ID is reused only for idempotent replay of that exact operation. Continuation routes only from the provider-returned `proceed|blocked|complete` — launch only on `proceed`, stop on `blocked` or `complete`. `reset` is never automatic and requires an explicit maintainer scope decision.
|
|
69
|
-
|
|
70
|
-
For the exact compact acquire/settle shapes and the full field semantics, see the `Native Runtime Attempt Authority` section of the lazy-loaded `SDD Orchestrator Workflow` contract. Do not look up `assets/...` paths at runtime; those are package source paths before installation.
|
|
71
|
-
|
|
72
65
|
## Status Output
|
|
73
66
|
|
|
74
67
|
Every command or agent that acts on a change MUST show or consume status before doing phase work:
|
|
@@ -78,3 +71,7 @@ Every command or agent that acts on a change MUST show or consume status before
|
|
|
78
71
|
- task progress and unchecked task list when tasks exist;
|
|
79
72
|
- next recommended action;
|
|
80
73
|
- any `actionContext` or edit-root warnings.
|
|
74
|
+
|
|
75
|
+
## Classical completion
|
|
76
|
+
|
|
77
|
+
After completed apply, follow fresh native status to archive; verification is optional and explicitly invokable when its native dependency is ready and the provider recommends apply or archive. Never rewrite a pinned provider that still selects verify. Archive owns applicable delta-spec composition and retains task truth, dependsOn, real edit authority, confinement, collision/destructive-change consent, archive history and recovery. There is no standalone sync phase or post-SDD RDD prerequisite.
|
package/docs/gentle-shell.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Gentle Shell is the `gentle-shell` coding-agent workspace built for Pi, not a theme. The `gentle-pi` package integrates the shell bar, workspace changes, provider usage where Pi exposes it, and native agent orchestration views into a Pi session. Start with the [README](../README.md#features) for the product overview.
|
|
4
4
|
|
|
5
|
+
For everyday development, use [ODD and feature recovery](readme-reference.md#organic-driven-development). Choose SDD explicitly when you want its formal phase artifacts; the workspace supports both. TDD follows configured mode, and native review remains a separate user-owned choice.
|
|
6
|
+
|
|
5
7
|
Source map: [shell extension](../extensions/gentle-shell.ts), [shell bar](../lib/shell-bar.ts), [changes model](../lib/shell-changes.ts), [changes view](../lib/shell-changes-view.ts), [usage model](../lib/shell-usage.ts), [usage view](../lib/shell-usage-view.ts), [agents extension](../extensions/gentle-agents.ts), and [agent runner](../lib/agents-runner.ts).
|
|
6
8
|
|
|
7
9
|
## v2.6.0 workspace updates
|
|
@@ -13,7 +15,7 @@ The [v2.6.0 release](https://github.com/Gentleman-Programming/gentle-pi/releases
|
|
|
13
15
|
- The Agents List and Details views preserve the orchestrator/session hierarchy and completion, abort, and lost-exit history. Parent-child queries and notifications have an explicit handoff path, while model, effort, and usage stay observable per task.
|
|
14
16
|
- Named `/gentle:profiles` atomically route the orchestrator separately from packaged and review roles; see the [technical reference](readme-reference.md#agent-model-profiles) for the profile model.
|
|
15
17
|
|
|
16
|
-
The source checkout currently prepares `gentle-pi` `
|
|
18
|
+
The source checkout currently prepares `gentle-pi` `3.0.0` with a package-local Gentle AI `v2.9.1` pin; this is not a claim that `3.0.0` is published.
|
|
17
19
|
|
|
18
20
|
## Shell interactions and runtime behavior
|
|
19
21
|
|
|
@@ -82,6 +84,12 @@ The separate `session_worktree_register` tool still registers canonical same-clo
|
|
|
82
84
|
- `GENTLE_PI_SHELL_CHANGES_KEY` rebinds the shortcut; `off` disables it. `GENTLE_PI_SHELL_CHANGES_POLL_MS` controls only the open overlay's in-memory refresh. `GENTLE_PI_SHELL_CHANGES_WATCH_MS` no longer enables filesystem polling.
|
|
83
85
|
- No captured changes means no widget and an informational notice; it does not assert that the working tree is clean.
|
|
84
86
|
|
|
87
|
+
### Command palette
|
|
88
|
+
|
|
89
|
+
`/gentle:commands` or `alt+k` opens a curated, grouped command menu, OpenCode-style — not a raw listing of every registered extension command. Entries are grouped under Configuration, Session, Diagnostics, SDD, and Skills, each shown by a human label with its shortcut hint where it has one; a command only appears when it is both in the curated set and actually registered. The Search row filters by label, by the underlying command name, and by description; arrows or `ctrl+j`/`ctrl+k` move, enter runs the highlighted entry exactly as if its command had been typed, escape closes. `GENTLE_PI_COMMANDS_KEY` rebinds the shortcut; `off` disables it. Built-in Pi commands are not listed. The default is `alt+k`, not `ctrl+k`, because Pi reserves `ctrl+k` for the editor's delete-to-line-end action.
|
|
90
|
+
|
|
91
|
+
To use `ctrl+p` like OpenCode, rebind Pi's `app.model.cycleForward` in `~/.pi/agent/keybindings.json` (Pi reserves that action, so an extension cannot take `ctrl+p` while it holds it) and set `GENTLE_PI_COMMANDS_KEY=ctrl+p`.
|
|
92
|
+
|
|
85
93
|
Subscription usage shows in the bar after the cost, and `/gentle:usage` opens a panel with every window per provider:
|
|
86
94
|
|
|
87
95
|
```text
|
|
@@ -111,7 +119,7 @@ Gentle notices are drawn as cards: the same rounded frame as the prompt, with th
|
|
|
111
119
|
|
|
112
120
|
The current package requires Pi 0.85.1 or newer (development tests pin 0.85.1). Use the latest Pi release; gentle-pi does not update your installed Pi automatically. Children, including any `GENTLE_PI_AGENTS_PI` override, must emit `agent_settled`: `agent_end` records a run's output but is not completion because retries or queued continuations may follow.
|
|
113
121
|
|
|
114
|
-
The `subagent_*` tools and the agents card replace the third-party subagents package (remove `npm:pi-subagents-j0k3r` from your pi packages; while it is still installed the tools stay unregistered and a warning says so at startup). Agent definitions and settings are the ones you already have: markdown agents in `~/.pi/agent/agents/`, `~/.pi/agent/subagents/`, `<cwd>/.pi/agents/`, `<cwd>/.pi/subagents/` (project beats global, `subagents/` beats `agents/`), and `subagents.json` at the global and project level (`default_model`, `default_effort`, `default_mode`, `model_profiles`, `stall_timeout_ms`, `max_concurrency`, `history_max_tasks`).
|
|
122
|
+
The `subagent_*` tools and the agents card replace the third-party subagents package (remove `npm:pi-subagents-j0k3r` from your pi packages; while it is still installed the tools stay unregistered and a warning says so at startup). Agent definitions and settings are the ones you already have: markdown agents in `~/.pi/agent/agents/`, `~/.pi/agent/subagents/`, `<cwd>/.pi/agents/`, `<cwd>/.pi/subagents/` (project beats global, `subagents/` beats `agents/`), and `subagents.json` at the global and project level (`default_model`, `default_effort`, `default_mode`, `model_profiles`, `stall_timeout_ms`, `tool_stall_timeout_ms`, `max_concurrency`, `history_max_tasks`).
|
|
115
123
|
|
|
116
124
|
Agent paths follow `GENTLE_PI_AGENT_HOME`, then `PI_CODING_AGENT_DIR`, then `~/.pi/agent` for definitions, config, history, child sessions, and transcripts. These overrides select the agent profile; they do not sandbox project or shared global resources.
|
|
117
125
|
|
|
@@ -122,10 +130,12 @@ Agent paths follow `GENTLE_PI_AGENT_HOME`, then `PI_CODING_AGENT_DIR`, then `~/.
|
|
|
122
130
|
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
123
131
|
```
|
|
124
132
|
|
|
125
|
-
Every subagent is its own `pi --mode rpc` child process, so the terminal never runs subagent work: the host reads JSON lines, applies each one as a small delta to a bounded per-task thread, and notifies only the listeners of that task. A task-mode child's question (`ctx.ui.select`, `confirm`, `input`, `editor`) reaches you as an ordinary pi dialog; a background child's question is dismissed. Subagents have no automatic total execution timeout: a long-running child remains live while it continues emitting RPC events. A silent child still times out through the configurable `stall_timeout_ms` watchdog (default four minutes). Closing pi stops the children that are still running.
|
|
133
|
+
Every subagent is its own `pi --mode rpc` child process, so the terminal never runs subagent work: the host reads JSON lines, applies each one as a small delta to a bounded per-task thread, and notifies only the listeners of that task. A task-mode child's question (`ctx.ui.select`, `confirm`, `input`, `editor`) reaches you as an ordinary pi dialog; a background child's question is dismissed. Subagents have no automatic total execution timeout: a long-running child remains live while it continues emitting RPC events. A silent child still times out through the configurable `stall_timeout_ms` watchdog (default four minutes). An announced tool call that is still running is live work, not silence, so it is bounded by `tool_stall_timeout_ms` instead (default 30 minutes, never below `stall_timeout_ms`). Closing pi stops the children that are still running.
|
|
126
134
|
|
|
127
135
|
- `subagent_list_agents`, `subagent_run` (`agent`, `task`, `label?`, `context?`, `workspace_root?`, `mode?` task or background), `subagent_status`, `subagent_result`, `subagent_list_tasks`, `subagent_reply` (one current-session reply to a live child query), `subagent_cancel`, `subagent_send_message` (steer a running child), `subagent_continue` (resume a finished task in its own session).
|
|
128
|
-
- `
|
|
136
|
+
- `orchestrator_session_id`, `orchestrator_list`, and `orchestrator_send_message` provide local-profile session notifications. List results advertise IDs only and reachability remains unknown. Sending selects the sole advertised peer or asks the user to choose; a successful ACK means the peer accepted the notification for delivery, not that it read or completed work. This is notification-and-ACK transport only: it has no cross-session queries, offline queue, retries, broadcasts, or read/completion guarantees. On Unix, presence records remain in the profile's private transport directory while socket endpoints use a private, profile-hashed directory below the canonical system temporary directory, keeping endpoint length independent of the profile path and at most 100 encoded bytes. The shared system temporary parent is only validated (current-user-owned without group/other write, or root/current-user-owned, world-writable, and sticky); it is never claimed, permissioned, or cleaned up by gentle-pi. On POSIX, the transport uses private Unix-domain sockets; on Windows, it uses private named pipes scoped by the current account SID. Notification and ACK limits remain bounded across platforms.
|
|
137
|
+
- `subagent_run.workspace_root` selects an existing worktree in the session's Git clone. Validation happens before queueing; the child runs at that canonical root. Successful OS spawn registers the root in the originating parent session, including delayed queued launches, even without an active shell listener. Failed spawns do not register. `subagent_continue` retains the previous task's cwd; status and task details expose it.
|
|
138
|
+
- Background work requires a live interactive/RPC parent. Both `subagent_run` and `subagent_continue` reject background mode in `pi -p` before creating or spawning a task: the parent exits before it can receive a later result. Use task mode for bounded print-mode work.
|
|
129
139
|
- A background task's result comes back to the model as a `gentle-agents.result` message, drawn as a rose card, and starts a new turn when the agent is idle; the model never polls.
|
|
130
140
|
- A configured child can call `subagent_parent_message` with bounded, well-formed Unicode text. Notifications retain their existing admission semantics. A `kind: "query"` waits for one strictly correlated `subagent_reply` for at most 30 seconds; each child has at most four pending queries, and disconnect, timeout, stop, and send failure settle each request once. The current parent session alone can reply. The first admitted task-mode query ends the original tool response while its child keeps running; its eventual non-cancelled completion returns once as a follow-up only if that same session is still active. Channel closure prevents later sends and automatic retry is not provided. Peer transport, offline delivery, retries, and broadcasts are unsupported.
|
|
131
141
|
- The card shows the active session's tasks only: after `/new` or `/resume` the earlier session's tasks leave it and come back with their session. Finished rows stay for one minute (three at most), and the card spends at most a quarter of the terminal (three to eight rows) on tasks; beyond that the rest fold into one `… N more · alt+a to view` line so the editor never leaves the screen. Questions and running work keep their rows first.
|