gentle-pi 3.7.0 → 4.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 +37 -6
- package/assets/agents/gentle-ai-explore.md +4 -4
- package/assets/agents/gentle-ai-verify.md +6 -4
- package/assets/agents/gentle-ai-worker.md +7 -9
- package/assets/orchestrator-delegation.md +40 -41
- package/assets/orchestrator-memory.md +1 -22
- package/assets/orchestrator-skills.md +1 -1
- package/assets/orchestrator.md +12 -24
- package/assets/support/strict-tdd-verify.md +4 -266
- package/assets/support/strict-tdd.md +8 -360
- package/bin/gentle-shell.mjs +254 -29
- package/docs/delegated-verification.md +26 -1
- package/docs/gentle-agents-activity.md +24 -0
- package/docs/gentle-shell.md +92 -28
- package/docs/native-authority-architecture.md +2 -2
- package/docs/prompt-history.md +280 -0
- package/docs/readme-reference.md +112 -206
- package/docs/telemetry.md +1 -1
- package/docs/yolo-mode.md +86 -0
- package/extensions/child-context.ts +26 -0
- package/extensions/child-safety.ts +23 -0
- package/extensions/gentle-agents.ts +429 -262
- package/extensions/gentle-ai.ts +781 -683
- package/extensions/gentle-shell.ts +1375 -88
- package/extensions/gentle-stats.ts +101 -0
- package/extensions/gentle-todo.ts +18 -7
- package/extensions/history/atomic-write.ts +38 -0
- package/extensions/history/hide-prompts.ts +183 -0
- package/extensions/history/index.ts +1419 -0
- package/extensions/history/load-shared-history.ts +39 -0
- package/extensions/history/selector-helpers.ts +538 -0
- package/extensions/history/session-scan.ts +233 -0
- package/extensions/history/store.ts +1119 -0
- package/extensions/nan-provider.ts +6 -0
- package/extensions/quiet-tools.ts +179 -87
- package/extensions/resume-hint.ts +60 -0
- package/extensions/skill-registry.ts +16 -12
- package/extensions/startup-banner.ts +60 -31
- package/lib/agent-assets.ts +604 -0
- package/lib/agent-profile-pin.ts +12 -0
- package/lib/agents-message-delivery.ts +181 -0
- package/lib/agents-protocol.ts +60 -0
- package/lib/agents-runner.ts +96 -98
- package/lib/agents-view.ts +26 -3
- package/lib/agents-widget.ts +16 -9
- package/lib/append-system-prompt.ts +21 -0
- package/lib/bounded-writer-admission.ts +147 -0
- package/lib/card-style-policy.ts +60 -0
- package/lib/child-context-files.ts +166 -0
- package/lib/codemode-renderer.ts +185 -0
- package/lib/command-palette-catalog.ts +3 -9
- package/lib/command-palette.ts +25 -14
- package/lib/destructive-command-guard.ts +144 -0
- package/lib/gentle-ai-elapsed-store.ts +87 -0
- package/lib/gentle-ai-renderer.ts +196 -39
- package/lib/gentle-shell-launcher.ts +24 -13
- package/lib/gentle-shell-resume-hint.ts +176 -0
- package/lib/history-capture-policy.ts +95 -0
- package/lib/model-routing-authority.ts +5 -1
- package/lib/nan-provider.ts +227 -0
- package/lib/native-review-cli.ts +49 -108
- package/lib/odd-phase-inference.ts +231 -0
- package/lib/odd-phase.ts +141 -0
- package/lib/overlay-repaint.ts +26 -0
- package/lib/pi-tui-keys.ts +53 -0
- package/lib/review-candidate-view-owner.ts +67 -17
- package/lib/review-candidate-view.ts +112 -25
- package/lib/review-reminder-receipt.ts +48 -8
- package/lib/review-risk-assessment.ts +156 -11
- package/lib/review-sidebar-state.ts +223 -0
- package/lib/selection-engine.ts +515 -0
- package/lib/session-messaging-grants.ts +135 -0
- package/lib/session-worktree-registry.ts +14 -2
- package/lib/shell-bar.ts +179 -24
- package/lib/shell-card.ts +287 -18
- package/lib/shell-changes-view.ts +2 -1
- package/lib/shell-prompt.ts +102 -6
- package/lib/shell-sidebar-layout.ts +78 -14
- package/lib/shell-sidebar.ts +15 -1
- package/lib/shell-todo.ts +23 -13
- package/lib/shell-usage-view.ts +9 -4
- package/lib/shell-usage.ts +66 -10
- package/lib/stats-collector.ts +381 -0
- package/lib/stats-view.ts +431 -0
- package/lib/theme-customization.ts +52 -0
- package/lib/vim-editor-adapter.ts +379 -0
- package/lib/vim-normal-engine.ts +154 -0
- package/lib/vim-operator-engine.ts +416 -0
- package/lib/vim-policy.ts +49 -0
- package/lib/vim-visual-engine.ts +107 -0
- package/lib/visual-customization-policy.ts +108 -0
- package/lib/visual-customize-view.ts +330 -0
- package/lib/visual-profiles.ts +228 -0
- package/lib/yolo-session-policy.ts +240 -0
- package/package.json +20 -8
- package/runtime/gentle-shell-launcher.mjs +23 -12
- package/runtime/gentle-shell-resume-hint.mjs +177 -0
- package/runtime/native-review-cli.mjs +49 -108
- package/runtime/review-risk-assessment.mjs +154 -9
- package/scripts/build-runtime-modules.mjs +1 -0
- package/scripts/gentle-ai-installer.mjs +14 -13
- package/scripts/mirror-odd-routing.mjs +2 -2
- package/scripts/run-test-suite.mjs +76 -0
- package/scripts/test-packed-runner.mjs +31 -14
- package/scripts/verify-package-files.mjs +11 -22
- package/skills/branch-pr/SKILL.md +24 -52
- package/skills/chained-pr/SKILL.md +31 -15
- package/skills/chained-pr/references/chaining-details.md +31 -20
- package/skills/gentle-ai/SKILL.md +9 -15
- package/skills/issue-creation/SKILL.md +8 -2
- package/skills/issue-creation/references/delegated-workflow-actions.md +19 -0
- package/skills/work-unit-commits/SKILL.md +4 -3
- package/tests/agent-profiles.test.ts +18 -0
- package/tests/agents-fake-child.ts +2 -2
- package/tests/agents-message-delivery.test.ts +106 -0
- package/tests/agents-protocol.test.ts +40 -0
- package/tests/agents-runner.test.ts +378 -89
- package/tests/agents-view-thread-identity.test.ts +169 -0
- package/tests/agents-view.test.ts +8 -2
- package/tests/agents-widget.test.ts +154 -15
- package/tests/append-system-prompt-route.test.ts +160 -0
- package/tests/append-system-prompt.test.ts +46 -0
- package/tests/artifact-language.test.ts +19 -213
- package/tests/ask-user-question.test.ts +44 -1
- package/tests/asset-installation-runtime.test.ts +5 -16
- package/tests/autonomous-guard.test.ts +69 -1
- package/tests/bounded-writer-admission.test.ts +95 -0
- package/tests/branch-pr-skill.test.ts +43 -0
- package/tests/card-style-policy.test.ts +55 -0
- package/tests/chained-pr-skill.test.ts +124 -0
- package/tests/child-context-files.test.ts +255 -0
- package/tests/child-safety.test.ts +82 -0
- package/tests/codemode-rendering.test.ts +491 -0
- package/tests/command-palette.test.ts +39 -3
- package/tests/delegated-key-learnings-contract.test.ts +0 -76
- package/tests/destructive-command-guard.test.ts +84 -0
- package/tests/devbinary/native-review-parity.devtest.ts +170 -2
- package/tests/devbinary/non-git-subagent-bootstrap.devtest.ts +193 -0
- package/tests/fixtures/stats/sessions/--work-alpha--/2026-09-28T10-00-00-000Z_aaa.jsonl +7 -0
- package/tests/fixtures/stats/sessions/--work-alpha--/2026-09-29T23-00-00-000Z_bbb.jsonl +3 -0
- package/tests/fixtures/stats/sessions/--work-alpha--/2026-09-30T08-00-00-000Z_ddd.jsonl +2 -0
- package/tests/fixtures/stats/sessions/--work-alpha--/2026-09-30T09-00-00-000Z_eee.jsonl +3 -0
- package/tests/fixtures/stats/sessions/--work-alpha--/run-1/session.jsonl +2 -0
- package/tests/fixtures/stats/sessions/--work-beta--/2026-09-01T12-00-00-000Z_ccc.jsonl +2 -0
- package/tests/fixtures/stats/user-pi/sessions/--work-alpha--/2026-09-28T10-00-00-000Z_aaa.jsonl +2 -0
- package/tests/fixtures/stats/user-pi/sessions/--work-alpha--/2026-09-29T23-00-00-000Z_bbb.jsonl +4 -0
- package/tests/fixtures/stats/user-pi/sessions/--work-gamma--/2026-09-20T09-00-00-000Z_fff.jsonl +3 -0
- package/tests/generic-agent-tools.test.ts +54 -0
- package/tests/gentle-agents.test.ts +1047 -252
- package/tests/gentle-ai-binary.test.ts +3 -3
- package/tests/gentle-ai-elapsed-store.test.ts +68 -0
- package/tests/gentle-ai-installer.test.ts +68 -54
- package/tests/gentle-ai-renderer.test.ts +487 -8
- package/tests/gentle-ai.test.ts +288 -65
- package/tests/gentle-card-text.ts +2 -1
- package/tests/gentle-shell-bin.test.ts +651 -114
- package/tests/gentle-shell-launcher.test.ts +99 -52
- package/tests/gentle-shell-resume-hint.test.ts +270 -0
- package/tests/gentle-shell.test.ts +3839 -187
- package/tests/gentle-stats.test.ts +152 -0
- package/tests/gentle-theme.test.ts +4 -1
- package/tests/gentle-todo.test.ts +80 -8
- package/tests/history-atomic-write.test.ts +57 -0
- package/tests/history-capture-policy.test.ts +102 -0
- package/tests/history-command-registration.test.ts +164 -0
- package/tests/history-dedupe-entries.test.ts +123 -0
- package/tests/history-delete-backfill.test.ts +190 -0
- package/tests/history-delete-confirm.test.ts +460 -0
- package/tests/history-dispatch.test.ts +180 -0
- package/tests/history-drain-hidden.test.ts +110 -0
- package/tests/history-drain-order.test.ts +98 -0
- package/tests/history-expanded-globals.test.ts +62 -0
- package/tests/history-gc.test.ts +832 -0
- package/tests/history-header-layout.test.ts +265 -0
- package/tests/history-hide-prompts.test.ts +275 -0
- package/tests/history-lazy-windowing.test.ts +508 -0
- package/tests/history-legacy-migrate-v2.test.ts +297 -0
- package/tests/history-load-shared-history.test.ts +53 -0
- package/tests/history-max-results-cap.test.ts +76 -0
- package/tests/history-multi-reader.test.ts +203 -0
- package/tests/history-off-path.test.ts +170 -0
- package/tests/history-openflow-integration.test.ts +173 -0
- package/tests/history-overlay-margin.test.ts +326 -0
- package/tests/history-preview-layout.test.ts +93 -0
- package/tests/history-registry.test.ts +143 -0
- package/tests/history-scope-delete.test.ts +411 -0
- package/tests/history-search-caret-keys.test.ts +142 -0
- package/tests/history-seed-bootstrap.test.ts +170 -0
- package/tests/history-seed-regen.test.ts +129 -0
- package/tests/history-selector-windowing.test.ts +94 -0
- package/tests/history-session-scan-directory.test.ts +87 -0
- package/tests/history-session-scan-extract.test.ts +583 -0
- package/tests/history-session-writer.test.ts +351 -0
- package/tests/history-store-paths.test.ts +79 -0
- package/tests/history-tombstone-exact.test.ts +139 -0
- package/tests/history-wheel-mouse.test.ts +242 -0
- package/tests/inprocess-reviewer.test.ts +29 -19
- package/tests/issue-creation-skill.test.ts +61 -0
- package/tests/model-routing-authority.test.ts +16 -0
- package/tests/nan-provider.test.ts +471 -0
- package/tests/native-review-capability-contract.test.ts +7 -1
- package/tests/native-review-cli.test.ts +6 -120
- package/tests/native-review-parity-runtime.test.ts +100 -3
- package/tests/odd-integration.test.ts +67 -0
- package/tests/odd-phase-inference.test.ts +213 -0
- package/tests/odd-phase-loader.test.ts +253 -0
- package/tests/odd-phase.test.ts +307 -0
- package/tests/odd-routing-canonical-ratchet.test.ts +11 -6
- package/tests/odd-routing-contract.test.ts +86 -35
- package/tests/orchestrator-budget.test.ts +14 -39
- package/tests/orchestrator-rdd-ownership.test.ts +3 -3
- package/tests/overlay-repaint.test.ts +74 -0
- package/tests/package-manifest.test.ts +252 -115
- package/tests/packed-runner-owned-path.test.ts +46 -0
- package/tests/persona-single-channel.test.ts +6 -6
- package/tests/provider-defect-handoff.test.ts +3 -11
- package/tests/quiet-bash-runtime.test.ts +76 -0
- package/tests/quiet-tool-rendering.test.ts +409 -184
- package/tests/rdd-aware-verification-contract.test.ts +76 -1
- package/tests/rdd-status-line.test.ts +9 -4
- package/tests/resume-hint-extension.test.ts +122 -0
- package/tests/review-agent-end-preflight.test.ts +176 -12
- package/tests/review-candidate-owner-retry.test.ts +22 -1
- package/tests/review-candidate-view.test.ts +298 -0
- package/tests/review-contract-prompt.test.ts +108 -43
- package/tests/review-controller-lock-status.test.ts +0 -1
- package/tests/review-controller-native-routing.test.ts +611 -5
- package/tests/review-controller-workspace-root.test.ts +163 -4
- package/tests/review-host-relay-routing.test.ts +338 -2
- package/tests/review-integration-v2-forward.test.ts +200 -0
- package/tests/review-ledger-contract.test.ts +10 -34
- package/tests/review-reminder-receipt.test.ts +47 -1
- package/tests/review-risk-assessment.test.ts +498 -6
- package/tests/review-sidebar-state.test.ts +402 -0
- package/tests/run-test-suite.test.ts +124 -0
- package/tests/runtime-harness.mjs +145 -786
- package/tests/runtime-metrics-children.test.ts +16 -23
- package/tests/selection-engine.test.ts +421 -0
- package/tests/session-messaging-grants.test.ts +255 -0
- package/tests/session-worktree-registry.test.ts +77 -0
- package/tests/shell-bar.test.ts +382 -1
- package/tests/shell-card.test.ts +353 -1
- package/tests/shell-changes-view.test.ts +52 -0
- package/tests/shell-prompt.test.ts +94 -2
- package/tests/shell-sidebar-layout.test.ts +325 -21
- package/tests/shell-sidebar-scroll-benchmark.test.ts +255 -0
- package/tests/shell-todo.test.ts +87 -1
- package/tests/shell-usage-view.test.ts +27 -0
- package/tests/shell-usage.test.ts +73 -0
- package/tests/skill-registry.test.ts +50 -1
- package/tests/startup-banner.test.ts +130 -2
- package/tests/stats-collector.test.ts +195 -0
- package/tests/stats-view.test.ts +202 -0
- package/tests/telemetry-trigger.test.ts +81 -20
- package/tests/theme-customization.test.ts +72 -0
- package/tests/vim-editor-adapter-host-resolution.test.ts +37 -0
- package/tests/vim-editor-adapter.test.ts +804 -0
- package/tests/vim-normal-engine.test.ts +101 -0
- package/tests/vim-operator-engine.test.ts +215 -0
- package/tests/vim-policy.test.ts +19 -0
- package/tests/vim-visual-engine.test.ts +52 -0
- package/tests/visual-customization-policy.test.ts +110 -0
- package/tests/visual-customize-view.test.ts +418 -0
- package/tests/visual-profiles.test.ts +87 -0
- package/tests/yolo-customize.test.ts +256 -0
- package/tests/yolo-mode-runtime.test.ts +161 -0
- package/tests/yolo-mode.test.ts +261 -0
- package/tests/yolo-session-policy.test.ts +59 -0
- package/themes/Gentle.json +2 -1
- package/themes/Gentleman-Cute.json +2 -1
- package/themes/Gentleman-Sexy.json +2 -1
- package/assets/agents/sdd-apply.md +0 -159
- package/assets/agents/sdd-archive.md +0 -228
- package/assets/agents/sdd-design.md +0 -49
- package/assets/agents/sdd-explore.md +0 -48
- package/assets/agents/sdd-init.md +0 -56
- package/assets/agents/sdd-onboard.md +0 -52
- package/assets/agents/sdd-proposal.md +0 -64
- package/assets/agents/sdd-remediate.md +0 -37
- package/assets/agents/sdd-research.md +0 -49
- package/assets/agents/sdd-spec.md +0 -192
- package/assets/agents/sdd-status.md +0 -54
- package/assets/agents/sdd-tasks.md +0 -108
- package/assets/agents/sdd-verify.md +0 -124
- package/assets/chains/sdd-full.chain.md +0 -83
- package/assets/chains/sdd-plan.chain.md +0 -56
- package/assets/chains/sdd-verify.chain.md +0 -43
- package/assets/sdd-orchestrator-workflow.md +0 -319
- package/assets/support/sdd-status-contract.md +0 -77
- package/docs/assets/diagrams/sdd-cycle.svg +0 -14
- package/extensions/sdd-init.ts +0 -816
- package/lib/openspec-deltas.ts +0 -156
- package/lib/sdd-preflight.ts +0 -1066
- package/lib/sdd-research-capabilities.ts +0 -94
- package/lib/sdd-status.ts +0 -26
- package/tests/fixtures/legacy/sdd-research-v2.5.0.md +0 -54
- package/tests/fixtures/native-review-cli/v2.1.3/bind-sdd.json +0 -25
- package/tests/fixtures/v0.10.7/assets/agents/sdd-apply.md +0 -132
- package/tests/openspec-deltas.test.ts +0 -209
- package/tests/sdd-agent-tools.test.ts +0 -156
- package/tests/sdd-archive-replay.test.ts +0 -82
- package/tests/sdd-classical-continuation.test.ts +0 -74
- package/tests/sdd-execution-routing-contract.test.ts +0 -44
- package/tests/sdd-managed-runtime-settlement.test.ts +0 -155
- package/tests/sdd-native-managed-uptake.test.ts +0 -243
- package/tests/sdd-no-attempts-contract.test.ts +0 -15
- package/tests/sdd-odd-integration.test.ts +0 -33
- package/tests/sdd-optional-research.test.ts +0 -124
- package/tests/sdd-planning-routing-contract.test.ts +0 -45
- package/tests/sdd-preflight-rpc-input.test.ts +0 -125
- package/tests/sdd-preflight.test.ts +0 -541
- package/tests/sdd-research-capabilities.test.ts +0 -114
- package/tests/sdd-research-live.test.ts +0 -241
- package/tests/sdd-selection-transport.test.ts +0 -653
- package/tests/sdd-status.test.ts +0 -9
- package/tests/sdd-task-truth.test.ts +0 -43
|
@@ -1,319 +0,0 @@
|
|
|
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/archive work, or SDD/Judgment-Day phase delegation.
|
|
4
|
-
|
|
5
|
-
## SDD Workflow
|
|
6
|
-
|
|
7
|
-
SDD phases:
|
|
8
|
-
|
|
9
|
-
```text
|
|
10
|
-
init → explore → research (optional) → proposal → spec → design → tasks → apply → archive (verification optional)
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Dependency graph:
|
|
14
|
-
|
|
15
|
-
```text
|
|
16
|
-
explore → research (optional) → proposal
|
|
17
|
-
proposal → spec ─┬→ tasks → apply → archive (verification optional)
|
|
18
|
-
proposal → design ┘
|
|
19
|
-
```
|
|
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/archive.
|
|
22
|
-
|
|
23
|
-
## Native SDD Dispatcher
|
|
24
|
-
|
|
25
|
-
`gentle-ai sdd-status --contract gentle-ai.sdd-status/v2` is the sole, read-only status authority for every store. The orchestrator carries its projection unchanged; it never reconstructs readiness, selects a replacement action, uses an Engram bypass, or launches a recommendation merely because status displayed it.
|
|
26
|
-
|
|
27
|
-
`/gentle-sdd-status` only inspects and renders that projection. Only explicitly authorized `/gentle-sdd-continue` may call native `sdd-continue` to prepare a missing change-instance marker; this is not a status fallback and grants no source roots. If native status is unavailable, malformed, or mismatched, stop and report the failure.
|
|
28
|
-
|
|
29
|
-
## Bounded Planning Routing
|
|
30
|
-
|
|
31
|
-
For authoritative native status, route only by the bounded `nextRecommended` token and dependency states; never infer a route from prose. Keep genuine blockers in `blockedReasons` and non-blocking diagnostics in `notes`, never in `nextRecommended`, and report them without discarding them to enable a route.
|
|
32
|
-
|
|
33
|
-
| `nextRecommended` | Planning route |
|
|
34
|
-
| --- | --- |
|
|
35
|
-
| `propose` | `sdd-proposal` |
|
|
36
|
-
| `spec` | `sdd-spec` |
|
|
37
|
-
| `design` | `sdd-design` |
|
|
38
|
-
| `tasks` | `sdd-tasks` |
|
|
39
|
-
|
|
40
|
-
Native unprefixed tokens are the only automatic planning routes. Prefixed or locally derived status tokens never authorize a phase.
|
|
41
|
-
|
|
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
|
-
|
|
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
|
-
|
|
46
|
-
## Bounded Execution Routing
|
|
47
|
-
|
|
48
|
-
| Native `nextRecommended` | Pi executor |
|
|
49
|
-
| --- | --- |
|
|
50
|
-
| `apply` | `sdd-apply` |
|
|
51
|
-
| `verify` | `sdd-verify` |
|
|
52
|
-
| `remediate` | `sdd-remediate` |
|
|
53
|
-
| `archive` | `sdd-archive` |
|
|
54
|
-
|
|
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
|
-
|
|
57
|
-
## SDD Status Contract
|
|
58
|
-
|
|
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
|
-
|
|
61
|
-
Status must include:
|
|
62
|
-
|
|
63
|
-
- active change selection and how it was resolved;
|
|
64
|
-
- artifact store and paths/topics for proposal, specs, design, tasks, apply-progress and optional verify-report;
|
|
65
|
-
- task progress with exact unchecked `- [ ]` implementation task lines;
|
|
66
|
-
- dependency states for apply, verify, and archive;
|
|
67
|
-
- `actionContext` with mode, workspace root, allowed edit roots, and warnings;
|
|
68
|
-
- next recommended action.
|
|
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/archive and ask for an explicit implementation/edit scope.
|
|
71
|
-
|
|
72
|
-
## Lazy SDD Preflight
|
|
73
|
-
|
|
74
|
-
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 input detection is intentionally syntax-only: slash SDD flows and `/gentle-sdd-init` run preflight automatically; ordinary natural-language text never triggers preflight by itself. For natural-language requests, the parent/orchestrator decides semantically whether the user explicitly selected SDD. Only after that selection, when the parent is about to dispatch the first SDD operation or agent, the execution gate runs or reuses `/gentle:sdd-preflight` before allowing SDD work to start. Merely mentioning, asking about, explaining, comparing, auditing, or referencing SDD — including questions ("what is SDD?"), negatives ("don't use SDD for this"), conditionals ("could we use SDD?"), bug reports about SDD itself, and passing references — stays in the normal read-only flow without preflight, the init guard, or any SDD phase. When a message is ambiguous between discussing SDD and requesting it, ask one clarification and remain read-only until answered.
|
|
75
|
-
|
|
76
|
-
**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 an injected `## SDD Session Preflight` block or an equivalent resolution from the canonical authority order below.
|
|
77
|
-
|
|
78
|
-
On the first SDD invocation of EACH new interactive session, confirm the preflight choices even when valid preferences are saved. Persisted preferences and canonical defaults are preselected suggestions, not current-session consent. Offer confirmation of the grouped suggestions or changes; cancellation leaves preflight unresolved. Explicit current-session choices take precedence and, once resolved, are reused throughout that session. If `/gentle:sdd-preflight` is unavailable, perform the same confirmation inline. The parent `subagent_run` dispatch boundary resolves this gate for every shipped SDD agent, prepends the exact rendered `## SDD Session Preflight` block to the existing child `context`, and blocks launch on cancellation or failure. An RPC child consumes that transport but never originates or persists defaults; missing or malformed transport fails closed before process spawn. Only a safely distinguishable standalone headless parent may retain canonical/persisted defaults without UI. Missing Engram constrains the artifact store to `openspec` unless an incompatible explicit request needs a human decision.
|
|
79
|
-
|
|
80
|
-
Preflight canonical defaults are execution `auto`, artifact store `openspec`, delivery strategy `ask-on-risk`, and review budget `400`; capability and already-selected constraints may narrow them.
|
|
81
|
-
|
|
82
|
-
The grouped session confirmation includes defaulted and capability-constrained suggestions. If changes are requested, preselect saved values and omit redundant one-option selectors. Never reinitialize project context merely because a new session needs confirmation. `chain_strategy` remains deferred, and `exception-ok` requires explicit `size:exception` acceptance and is never inferred.
|
|
83
|
-
|
|
84
|
-
The exact `delivery_strategy` domain accepted by `sdd-tasks` and `sdd-apply` is `ask-on-risk`, `auto-chain`, `single-pr`, or `exception-ok`; above the review threshold, `auto-chain` resolves without asking again.
|
|
85
|
-
|
|
86
|
-
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:
|
|
87
|
-
|
|
88
|
-
```text
|
|
89
|
-
~/.pi/agent/agents/sdd-*.md
|
|
90
|
-
~/.pi/agent/chains/sdd-*.chain.md
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
Manual install commands are recovery/debug paths, not the happy path. `/gentle:sdd-preflight` is the explicit preflight command for agent/orchestrator use. If the user explicitly changes SDD preferences later in the same session, follow the new instruction.
|
|
94
|
-
|
|
95
|
-
## Init Guard
|
|
96
|
-
|
|
97
|
-
Before any SDD flow, make sure project context exists. Where that context lives depends on the session's artifact store, so qualify the check by store before acting on it.
|
|
98
|
-
|
|
99
|
-
When the store is `openspec` or `both`, the local artifact is:
|
|
100
|
-
|
|
101
|
-
```text
|
|
102
|
-
openspec/config.yaml
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
If it is missing, ask the user for the minimal information needed or run `/gentle-sdd-init` if available.
|
|
106
|
-
|
|
107
|
-
When the store is `engram` or `none`, `/gentle-sdd-init` never writes that file, so its absence is expected and is not a missing init. Never re-trigger `/gentle-sdd-init` over it. Resolve project context from the Engram `sdd-init/{project}` topic for `engram`, or inline from the session for `none`, and ask the user only when that context is genuinely absent.
|
|
108
|
-
|
|
109
|
-
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.
|
|
110
|
-
|
|
111
|
-
## Artifact Store Policy
|
|
112
|
-
|
|
113
|
-
This package does not provide persistent memory by itself.
|
|
114
|
-
|
|
115
|
-
- Default: `openspec` artifacts in the repo.
|
|
116
|
-
- If a separate memory package is installed and callable, memory/hybrid flows may be used.
|
|
117
|
-
- Never claim memory exists because Gentle AI is installed.
|
|
118
|
-
|
|
119
|
-
## Execution Mode
|
|
120
|
-
|
|
121
|
-
Use the session's SDD preflight choice:
|
|
122
|
-
|
|
123
|
-
- `auto`: phases run back-to-back without pausing, but the orchestrator gatekeeper validates after each phase before launching the next.
|
|
124
|
-
- `interactive`: after each phase, show a concise summary and ask whether to adjust or continue.
|
|
125
|
-
|
|
126
|
-
If the user doesn't specify, default to `auto`. After scope approval, expect zero further prompts on the happy path and at most one actionable prompt per recoverable failure; the gatekeeper summarizes phase progress instead of interrupting except on a second consecutive gate failure or a genuine scope/product decision.
|
|
127
|
-
|
|
128
|
-
In interactive mode, between phases:
|
|
129
|
-
|
|
130
|
-
1. show concise phase result;
|
|
131
|
-
2. state next phase;
|
|
132
|
-
3. ask whether to continue or adjust.
|
|
133
|
-
|
|
134
|
-
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.
|
|
135
|
-
|
|
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
|
-
|
|
138
|
-
## Optional Research
|
|
139
|
-
|
|
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
|
-
|
|
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.
|
|
143
|
-
|
|
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.
|
|
145
|
-
|
|
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.
|
|
147
|
-
|
|
148
|
-
## Delivery Strategy
|
|
149
|
-
|
|
150
|
-
On the first SDD chain request in a session, resolve the delivery strategy from preflight (or ask once) and cache it:
|
|
151
|
-
|
|
152
|
-
- `ask-on-risk` — default; ask only when the tasks forecast detects review-budget risk.
|
|
153
|
-
- `auto-chain` — automatically split into chained/stacked PR slices when needed.
|
|
154
|
-
- `single-pr` — proceed as one PR only if the size is within budget.
|
|
155
|
-
- `exception-ok` — user accepts `size:exception` when over budget. The preflight menu cannot select this; it is reached only when the user explicitly accepts `size:exception`, either up front or when `ask-on-risk` stops to ask.
|
|
156
|
-
|
|
157
|
-
These four are the whole domain. Pass `delivery_strategy` to `sdd-tasks` and `sdd-apply`.
|
|
158
|
-
|
|
159
|
-
## Chain Strategy
|
|
160
|
-
|
|
161
|
-
When delivery planning yields chained PRs, ask once for chain strategy and cache it:
|
|
162
|
-
|
|
163
|
-
- `stacked-to-main` — each PR targets the previous PR branch or main in sequence.
|
|
164
|
-
- `feature-branch-chain` — PR #1 targets the tracker branch; child PRs target the immediate previous PR branch; only the tracker merges to main.
|
|
165
|
-
|
|
166
|
-
When chained PRs are selected, treat the registry skill `gentle-ai-chained-pr` as a required skill match. Resolve and forward it by registry path to `sdd-tasks` and `sdd-apply`; do not hardcode its path.
|
|
167
|
-
|
|
168
|
-
Pass it as `chain_strategy` to `sdd-tasks` and `sdd-apply` prompts alongside `delivery_strategy`.
|
|
169
|
-
|
|
170
|
-
## Result Contract
|
|
171
|
-
|
|
172
|
-
Every phase result should include:
|
|
173
|
-
|
|
174
|
-
```text
|
|
175
|
-
status
|
|
176
|
-
executive_summary
|
|
177
|
-
artifacts
|
|
178
|
-
next_recommended
|
|
179
|
-
risks
|
|
180
|
-
skill_resolution
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
The parent should synthesize these envelopes, not paste long raw reports unless needed.
|
|
184
|
-
|
|
185
|
-
### Key Learnings closing block (routing)
|
|
186
|
-
|
|
187
|
-
Every installed SDD phase executor agent (`assets/agents/sdd-*.md`) carries the effective `## Key Learnings Closing` contract in its own loaded prompt; this workflow file documents routing only and is not the executor authority. Each phase executor closes its final report text with a `## Key Learnings` block that the Engram memory provider passively extracts. Generic delegated workers receive the same closing instruction via `assets/orchestrator-delegation.md`.
|
|
188
|
-
|
|
189
|
-
## Automatic Mode Gatekeeper
|
|
190
|
-
|
|
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.
|
|
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
|
-
|
|
195
|
-
Check every phase result against the Result Contract:
|
|
196
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
201
|
-
- **Routing coherence:** `next_recommended` must follow the SDD dependency graph, and no unaddressed critical risk may be carried silently into the next phase.
|
|
202
|
-
|
|
203
|
-
Use cost-aware validation:
|
|
204
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
208
|
-
|
|
209
|
-
On gate pass, continue automatically to the next phase. On gate fail, rerun the same phase exactly once with corrective feedback naming the specific failures. Validate the rerun. If it fails again, stop the automatic chain and report the phase, failures from both attempts, and the recommended fix. Never advance to dependent phases on a failed gate.
|
|
210
|
-
|
|
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.
|
|
212
|
-
|
|
213
|
-
## SDD Phase Delegation Mode
|
|
214
|
-
|
|
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.
|
|
216
|
-
|
|
217
|
-
## Model Assignments
|
|
218
|
-
|
|
219
|
-
Read this table before the first SDD/Judgment-Day phase delegation in a session, cache it, and use it only for SDD/Judgment-Day phase agents. If a phase is missing, use the `default` row. If the assigned tier is unavailable, use the runtime's default model and continue.
|
|
220
|
-
|
|
221
|
-
On Pi, phase model routing is user-owned and persisted, not prompt-passed: `/gentle:models` writes `.pi/gentle-ai/models.json`, and the package applies each saved assignment to the installed phase agent definitions (frontmatter `model:`/`thinking:`) or `.pi/settings.json` overrides. The table below is the default capability tier per phase when the user has saved no assignment.
|
|
222
|
-
|
|
223
|
-
**Mandatory phase model gate:** before launching an SDD/Judgment-Day phase agent, confirm the phase resolves through the saved model config or these defaults. Never pass an ad-hoc `model` parameter for SDD/Judgment-Day phases, and never apply this table to generic Pi delegation — generic subagents resolve model/thinking through `pi-subagents` config, and `model` is passed there only on an explicit user override.
|
|
224
|
-
|
|
225
|
-
| Phase | Default tier | Reason |
|
|
226
|
-
| ------------ | -------------- | ------------------------------------------ |
|
|
227
|
-
| sdd-explore | balanced | Reads code, structural - not architectural |
|
|
228
|
-
| sdd-research | balanced | Optional source-backed investigation |
|
|
229
|
-
| sdd-proposal | deep-reasoning | Architectural decisions |
|
|
230
|
-
| sdd-spec | balanced | Structured writing |
|
|
231
|
-
| sdd-design | deep-reasoning | Architecture decisions |
|
|
232
|
-
| sdd-tasks | balanced | Mechanical breakdown |
|
|
233
|
-
| sdd-apply | balanced | Implementation |
|
|
234
|
-
| sdd-verify | balanced | Validation against spec |
|
|
235
|
-
| sdd-archive | fast | Copy and close |
|
|
236
|
-
| jd-judge-a | deep-reasoning | Adversarial review |
|
|
237
|
-
| jd-judge-b | deep-reasoning | Adversarial review |
|
|
238
|
-
| jd-fix-agent | balanced | Surgical confirmed fixes |
|
|
239
|
-
| default | balanced | SDD phase fallback; never a Judgment Day role |
|
|
240
|
-
|
|
241
|
-
## Judgment Day fix routing
|
|
242
|
-
|
|
243
|
-
Judgment Day phase roles are never generic fallbacks. If the generic writer chain is unavailable, use the documented native generic fallback or stop. Judgment Day is independent: it neither enables nor replaces ordinary review; a separately requested ordinary review remains independent. A standalone Judgment Day fix requires no graph-v1 or native review lineage. Launch `jd-fix-agent` only for an explicit Judgment Day fix batch with this exact runtime-accepted Markdown shape: `## Judgment Day activation` contains only `User explicitly requested Judgment Day.`. Replace the example ID, frozen ledger hash, row data, and surface with controller-authorized values. The correction batch contains only one round (`1 of 2` or `2 of 2`) and one lowercase SHA-256. The exact frozen finding rows are one JSON object per line, use only the canonical row fields, and exactly match the authorized IDs.
|
|
244
|
-
|
|
245
|
-
```markdown
|
|
246
|
-
## Judgment Day activation
|
|
247
|
-
User explicitly requested Judgment Day.
|
|
248
|
-
## Exact authorized severe IDs
|
|
249
|
-
- `JD-A-001`
|
|
250
|
-
## Judgment Day correction batch
|
|
251
|
-
Round: 1 of 2.
|
|
252
|
-
Frozen ledger SHA-256: `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`
|
|
253
|
-
## Exact frozen finding rows
|
|
254
|
-
{"id":"JD-A-001","lens":"judgment-day","location":"path/to/authorized-file.ts:1","severity":"CRITICAL","status_at_freeze":"open","evidence_class":"deterministic","evidence_claim":"Concrete user-impact claim supported by the frozen location."}
|
|
255
|
-
## Allowed edit surfaces
|
|
256
|
-
path/to/authorized-file.ts
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
## Sub-Agent Launch Deduplication
|
|
260
|
-
|
|
261
|
-
Maintain a session-scoped launch log of `(phase, task-fingerprint)` pairs. If the same pair already exists, do NOT launch again. Emit exactly one launch per distinct task and append the pair after launch.
|
|
262
|
-
|
|
263
|
-
## Sub-Agent Launch Protocol
|
|
264
|
-
|
|
265
|
-
Pre-flight before every SDD/Judgment-Day phase launch:
|
|
266
|
-
|
|
267
|
-
1. Identify the phase key (`sdd-apply`, `sdd-verify`, `jd-judge-a`, etc.).
|
|
268
|
-
2. Confirm its model routing per the Model Assignments gate above.
|
|
269
|
-
3. Resolve matching skill paths once per session from the registry and pass exact `SKILL.md` paths under `## Skills to load before work`.
|
|
270
|
-
4. If a delegated result reports `skill_resolution` as `fallback-registry`, `fallback-path`, or `none`, re-read the registry before subsequent delegations.
|
|
271
|
-
|
|
272
|
-
**Key Learnings closing (generic delegations):** when delegating to generic agents (`gentle-ai-explore`, `gentle-ai-worker`, `gentle-ai-verify`, scout/worker roles, or the native `Agent` fallback), apply the rule exactly as stated under "Key Learnings closing block" in `assets/orchestrator-delegation.md`. That file is the single statement of the rule; do not restate or paraphrase it here. SDD phase launch prompts need no such injection: every installed SDD phase executor already carries the effective contract in its own prompt (see "Key Learnings closing block (routing)" above).
|
|
273
|
-
|
|
274
|
-
## Strict TDD Forwarding
|
|
275
|
-
|
|
276
|
-
For `sdd-apply` and `sdd-verify`, read `openspec/config.yaml` when present.
|
|
277
|
-
|
|
278
|
-
If it declares strict TDD and a test command, include a non-negotiable instruction in the phase prompt:
|
|
279
|
-
|
|
280
|
-
```text
|
|
281
|
-
STRICT TDD MODE IS ACTIVE. Test runner: <command>. Follow RED, GREEN, TRIANGULATE, REFACTOR. Record evidence.
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
Do not rely on the child agent to discover this independently.
|
|
285
|
-
|
|
286
|
-
## Archive Final-State Handoff
|
|
287
|
-
|
|
288
|
-
When launching `sdd-archive`, forward explicit final-state facts for any work completed after `apply-progress`, `verify-report`, or `sync-report` were persisted — verify warnings fixed in later commits, blockers resolved, tasks finished, updated test or issue counts — with commit or evidence references where available. Those artifacts are intermediate snapshots, valid at the time they were written; the archive report records the state at close, and explicit final-state facts in the `sdd-archive` launch prompt outrank stale snapshot claims.
|
|
289
|
-
|
|
290
|
-
## Review Workload Guard
|
|
291
|
-
|
|
292
|
-
After `sdd-tasks` completes and before launching `sdd-apply`, inspect the task output's `Review Workload Forecast`.
|
|
293
|
-
|
|
294
|
-
If it says `Chained PRs recommended: Yes`, `400-line budget risk: High`, estimated changed lines exceed 400, or `Decision needed before apply: Yes`, apply the cached `delivery_strategy`:
|
|
295
|
-
|
|
296
|
-
- `ask-on-risk`: stop and ask whether to split or proceed with `size:exception`.
|
|
297
|
-
- `auto-chain`: split automatically; ask for `chain_strategy` only if missing.
|
|
298
|
-
- `single-pr`: stop and require/record `size:exception` before apply.
|
|
299
|
-
- `exception-ok`: continue and tell `sdd-apply` this run uses `size:exception`.
|
|
300
|
-
|
|
301
|
-
Any other `delivery_strategy` value is invalid. Do NOT pick the nearest branch and do NOT proceed: STOP, report the unrecognised value, and re-collect the delivery strategy before launching `sdd-apply`.
|
|
302
|
-
|
|
303
|
-
Always pass the resolved `delivery_strategy`, `chain_strategy`, and any chosen PR boundary/exception to `sdd-apply` in the launch prompt.
|
|
304
|
-
|
|
305
|
-
Any review transaction explicitly started outside SDD persists through its own artifact-store branch and budget. SDD completion itself launches no review actors and mints no review authority.
|
|
306
|
-
|
|
307
|
-
Automatic mode does not override reviewer burnout protection.
|
|
308
|
-
|
|
309
|
-
## Recovery
|
|
310
|
-
|
|
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.
|
|
312
|
-
|
|
313
|
-
## Provider Defect Handoff
|
|
314
|
-
|
|
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.
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# SDD Status and Action Context Contract
|
|
2
|
-
|
|
3
|
-
Shared OpenSpec-style contract for Gentle Pi SDD phases. Use this before acting on a change so orchestration and executors do not guess state, paths, or edit scope.
|
|
4
|
-
|
|
5
|
-
## Purpose
|
|
6
|
-
|
|
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
|
-
|
|
9
|
-
## Change Selection
|
|
10
|
-
|
|
11
|
-
- If a change name is provided, use that exact change after confirming it exists in the selected artifact store.
|
|
12
|
-
- If no change name is provided, infer only when the active change is unambiguous from session state or there is exactly one active change.
|
|
13
|
-
- If multiple active changes match or the active change is unclear, ask the user to choose. Do not guess.
|
|
14
|
-
- If no active changes exist, report that no SDD change is active and suggest starting one.
|
|
15
|
-
|
|
16
|
-
## Native Engine
|
|
17
|
-
|
|
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
|
-
- 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
|
-
- `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
|
-
- 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.
|
|
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`.
|
|
24
|
-
|
|
25
|
-
## Bounded Planning Routing
|
|
26
|
-
|
|
27
|
-
For authoritative native status, route only by the bounded `nextRecommended` token and dependency states; never infer a route from prose. Keep genuine blockers in `blockedReasons` and non-blocking diagnostics in `notes`, never in `nextRecommended`, and report them without discarding them to enable a route.
|
|
28
|
-
|
|
29
|
-
| `nextRecommended` | Planning route |
|
|
30
|
-
| --- | --- |
|
|
31
|
-
| `propose` | `sdd-proposal` |
|
|
32
|
-
| `spec` | `sdd-spec` |
|
|
33
|
-
| `design` | `sdd-design` |
|
|
34
|
-
| `tasks` | `sdd-tasks` |
|
|
35
|
-
|
|
36
|
-
Native unprefixed tokens are the only automatic planning routes. Prefixed or locally derived status tokens never authorize a phase.
|
|
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.
|
|
39
|
-
|
|
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.
|
|
41
|
-
|
|
42
|
-
## Bounded Execution Routing
|
|
43
|
-
|
|
44
|
-
| Native `nextRecommended` | Pi executor |
|
|
45
|
-
| --- | --- |
|
|
46
|
-
| `apply` | `sdd-apply` |
|
|
47
|
-
| `verify` | `sdd-verify` |
|
|
48
|
-
| `remediate` | `sdd-remediate` |
|
|
49
|
-
| `archive` | `sdd-archive` |
|
|
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.
|
|
52
|
-
|
|
53
|
-
## Status Schema
|
|
54
|
-
|
|
55
|
-
Consume the native v2 projection (`schemaName: gentle-ai.sdd-status`, `schemaVersion: 2`) losslessly. Its producer-defined selection, artifact locators, task progress, seven dependencies, `actionContext`, `blockedReasons`, optional execution instructions, remediation state, and `nextRecommended` are status facts, not a Pi schema to recreate.
|
|
56
|
-
|
|
57
|
-
## Action Context Guard
|
|
58
|
-
|
|
59
|
-
The orchestrator MUST carry `actionContext` into any phase launch.
|
|
60
|
-
|
|
61
|
-
- If `mode: workspace-planning` and `allowedEditRoots` is empty, stop before editing, verifying implementation ownership, syncing specs, or archiving. Treat linked repos and folders as read-only planning context.
|
|
62
|
-
- If `allowedEditRoots` is present, only edit or move files within those roots.
|
|
63
|
-
- If a phase cannot prove a file is inside the authoritative workspace or allowed edit roots, stop and ask for clarification.
|
|
64
|
-
|
|
65
|
-
## Status Output
|
|
66
|
-
|
|
67
|
-
Every command or agent that acts on a change MUST show or consume status before doing phase work:
|
|
68
|
-
|
|
69
|
-
- active change selection and how it was resolved;
|
|
70
|
-
- artifact statuses and paths/topics used as context;
|
|
71
|
-
- task progress and unchecked task list when tasks exist;
|
|
72
|
-
- next recommended action;
|
|
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.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="1230" viewBox="0 0 960 1230" role="img" aria-labelledby="sdd-title sdd-desc">
|
|
2
|
-
<title id="sdd-title">Optional specification-driven development path</title>
|
|
3
|
-
<desc id="sdd-desc">An optional sequence from exploration through research, proposal, specification, design, tasks, apply, verify, sync, and archive. Research can be bypassed and TDD applies under implementation when enabled.</desc>
|
|
4
|
-
<defs>
|
|
5
|
-
<linearGradient id="sdd-bg" x1="0" y1="0" x2="1" y2="1"><stop stop-color="#100c15"/><stop offset="1" stop-color="#241020"/></linearGradient>
|
|
6
|
-
<marker id="sdd-arrow" markerUnits="userSpaceOnUse" markerWidth="10" markerHeight="10" viewBox="0 0 10 10" refX="10" refY="5" orient="auto"><path d="M0 0 10 5 0 10z" fill="#f095c8"/></marker>
|
|
7
|
-
</defs>
|
|
8
|
-
<rect width="960" height="1230" rx="20" fill="url(#sdd-bg)"/>
|
|
9
|
-
<text x="60" y="65" fill="#fff7f1" font-family="Arial, Helvetica, sans-serif" font-size="44" font-weight="700">Optional SDD path.</text>
|
|
10
|
-
<g fill="#1b1420" stroke="#d7a0b8" stroke-width="2"><rect x="60" y="170" width="360" height="132" rx="16"/><rect x="540" y="170" width="360" height="132" rx="16"/><rect x="540" y="390" width="360" height="132" rx="16"/><rect x="60" y="390" width="360" height="132" rx="16"/><rect x="60" y="610" width="360" height="132" rx="16"/><rect x="540" y="610" width="360" height="132" rx="16"/><rect x="540" y="830" width="360" height="132" rx="16"/><rect x="60" y="830" width="360" height="132" rx="16"/><rect x="60" y="1050" width="360" height="132" rx="16"/><rect x="540" y="1050" width="360" height="132" rx="16"/></g>
|
|
11
|
-
<g fill="none" stroke="#f095c8" stroke-width="3" stroke-linecap="round" marker-end="url(#sdd-arrow)"><path d="M420 236H540"/><path d="M720 302V390"/><path d="M540 456H420"/><path d="M240 522V610"/><path d="M420 676H540"/><path d="M720 742V830"/><path d="M540 896H420"/><path d="M240 962V1050"/><path d="M420 1116H540"/><path d="M240 302V365H480V426H540"/></g>
|
|
12
|
-
<g fill="#fff7f1" font-family="Arial, Helvetica, sans-serif" font-size="36" font-weight="700" text-anchor="middle"><text x="240" y="248">Explore</text><text x="720" y="228">Research</text><text x="720" y="468">Proposal</text><text x="240" y="468">Spec</text><text x="240" y="688">Design</text><text x="720" y="688">Tasks</text><text x="720" y="908">Apply</text><text x="240" y="908">Verify</text><text x="240" y="1128">Sync</text><text x="720" y="1128">Archive</text></g>
|
|
13
|
-
<g fill="#d7a0b8" font-family="Arial, Helvetica, sans-serif" font-size="32" text-anchor="middle"><text x="720" y="274">Optional</text><text x="480" y="345">Skip research</text><text x="720" y="948">TDD if enabled</text></g>
|
|
14
|
-
</svg>
|