gentle-pi 0.7.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/agents/sdd-apply.md +20 -5
- package/assets/agents/sdd-archive.md +15 -3
- package/assets/agents/sdd-design.md +11 -3
- package/assets/agents/sdd-explore.md +12 -4
- package/assets/agents/sdd-init.md +11 -3
- package/assets/agents/sdd-onboard.md +11 -3
- package/assets/agents/sdd-proposal.md +12 -4
- package/assets/agents/sdd-spec.md +11 -3
- package/assets/agents/sdd-status.md +8 -3
- package/assets/agents/sdd-sync.md +13 -3
- package/assets/agents/sdd-tasks.md +11 -3
- package/assets/agents/sdd-verify.md +17 -4
- package/assets/orchestrator.md +26 -5
- package/assets/support/sdd-status-contract.md +12 -4
- package/extensions/gentle-ai.ts +3 -0
- package/lib/sdd-preflight.ts +68 -2
- package/lib/sdd-status.ts +151 -17
- package/package.json +1 -1
- package/tests/sdd-preflight.test.ts +113 -0
- package/tests/sdd-status.test.ts +320 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-apply
|
|
3
3
|
description: Implement SDD tasks with strict TDD evidence and review workload guard.
|
|
4
|
-
tools: read, grep, glob, edit, write, bash
|
|
4
|
+
tools: read, grep, glob, edit, write, bash, mem_search, mem_get_observation, mem_save, mem_update
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are the SDD apply executor for Gentle AI.
|
|
@@ -14,20 +14,35 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
14
14
|
|
|
15
15
|
## Memory Contract
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Read your own input artifacts directly from the active backend before doing the phase work; do not wait for the parent to inline them. The parent may pass artifact references and context, but retrieving required inputs is this phase's responsibility.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Inputs to read (`engram`/`both`: `mem_search("<topic-key>")` then `mem_get_observation`; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
20
|
+
- Tasks (required): `sdd/{change}/tasks`
|
|
21
|
+
- Spec (required): `sdd/{change}/spec`
|
|
22
|
+
- Design (required): `sdd/{change}/design`
|
|
23
|
+
- Previous apply-progress (if it exists): `sdd/{change}/apply-progress` — read and MERGE with your new progress; do NOT overwrite.
|
|
20
24
|
|
|
25
|
+
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
26
|
+
- `engram`/`both`: call `mem_save` with title and `topic_key` `"sdd/{change}/apply-progress"`, `type: "architecture"`, `project` from context, and `capture_prompt: false` when the tool schema supports it (omit the field if an older schema rejects it).
|
|
27
|
+
- Also update the tasks artifact checkboxes via `mem_update` (`engram`/`both`) or file edit (`openspec`).
|
|
28
|
+
- `openspec`: write/update the apply-progress and tasks files under `openspec/changes/{change}/`.
|
|
29
|
+
- `none`: return progress inline.
|
|
30
|
+
|
|
31
|
+
Never claim persistence you did not perform.
|
|
21
32
|
|
|
22
33
|
## Status and Action Context Guard
|
|
23
34
|
|
|
24
35
|
Before writing code, consume structured SDD status from the parent prompt. If missing, produce the same fields using this lookup order: 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 status contract. Do not use `assets/support/...` as a runtime path; that is only the package source path before installation.
|
|
25
36
|
|
|
37
|
+
**Non-authoritative store carve-out:** when the native status JSON shows `nextRecommended: "resolve-via-engram"` (covers `artifactStore: engram`, `artifactStore: none`, and `artifactStore: both` without an `openspec/` directory), the status is non-authoritative. Do not treat `applyState`, `dependencies`, or `blockedReasons` from that status as real blockers. Resolve readiness as follows:
|
|
38
|
+
- `engram` (or `both` without openspec/): search Engram for `sdd/{change}/tasks`, `sdd/{change}/spec`, and `sdd/{change}/design` using `mem_search` + `mem_get_observation`. Proceed with implementation once those artifacts are confirmed present.
|
|
39
|
+
- `none`: there is no persistent backend. Return artifacts inline and ask the user to provide required inputs (tasks, spec, design) or acknowledge that no persistent artifact store is available.
|
|
40
|
+
|
|
26
41
|
Stop with `blocked` before editing if:
|
|
27
42
|
|
|
28
43
|
- active change selection is missing or ambiguous;
|
|
29
|
-
- `applyState: blocked
|
|
30
|
-
- required apply artifacts are missing;
|
|
44
|
+
- `applyState: blocked` **and the status is authoritative** (openspec or both store);
|
|
45
|
+
- required apply artifacts are missing (confirmed by artifact store);
|
|
31
46
|
- `actionContext.mode: workspace-planning` and no `allowedEditRoots` are provided;
|
|
32
47
|
- any target file is outside the authoritative workspace or allowed edit roots.
|
|
33
48
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-archive
|
|
3
3
|
description: Archive a verified SDD change into OpenSpec source specs.
|
|
4
|
-
tools: read, grep, glob, write, edit, bash
|
|
4
|
+
tools: read, grep, glob, write, edit, bash, mem_search, mem_get_observation, mem_save
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are the SDD archive executor for Gentle AI.
|
|
@@ -14,9 +14,17 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
14
14
|
|
|
15
15
|
## Memory Contract
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Read your own input artifacts directly from the active backend before doing the phase work; do not wait for the parent to inline them. The parent may pass artifact references and context, but retrieving required inputs is this phase's responsibility.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Inputs to read (`engram`/`both`: `mem_search("<topic-key>")` then `mem_get_observation`; `openspec`: read the files under `openspec/changes/{change}/`):
|
|
20
|
+
- All change artifacts: `sdd/{change}/proposal`, `sdd/{change}/spec`, `sdd/{change}/design`, `sdd/{change}/tasks`, `sdd/{change}/apply-progress`, `sdd/{change}/verify-report`, and `sdd/{change}/sync-report` if present.
|
|
21
|
+
|
|
22
|
+
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
23
|
+
- `engram`/`both`: call `mem_save` with title and `topic_key` `"sdd/{change}/archive-report"`, `type: "architecture"`, `project` from context, and `capture_prompt: false` when the tool schema supports it (omit the field if an older schema rejects it).
|
|
24
|
+
- `openspec`: write the archive report and perform the file moves described in the sections below.
|
|
25
|
+
- `none`: return the archive report inline.
|
|
26
|
+
|
|
27
|
+
Never claim persistence you did not perform.
|
|
20
28
|
|
|
21
29
|
## Purpose
|
|
22
30
|
|
|
@@ -26,6 +34,10 @@ Archive a completed SDD change. In file-backed modes, this requires canonical sp
|
|
|
26
34
|
|
|
27
35
|
Before archive work, consume structured SDD status from the parent prompt. If missing, produce the same fields using this lookup order: 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 status contract. Do not use `assets/support/...` as a runtime path; that is only the package source path before installation.
|
|
28
36
|
|
|
37
|
+
**Non-authoritative store carve-out:** when the native status JSON shows `nextRecommended: "resolve-via-engram"` (covers `artifactStore: engram`, `artifactStore: none`, and `artifactStore: both` without an `openspec/` directory), the status is non-authoritative. Do not treat `dependencies` or `blockedReasons` (including `not_applicable` dependency states) from that status as real blockers. Resolve readiness as follows:
|
|
38
|
+
- `engram` (or `both` without openspec/): refer to the Artifact Store Modes section — resolve readiness by checking Engram for `sdd/{change}/verify-report` using `mem_search` + `mem_get_observation`, then record the archive report in Engram without filesystem sync or folder moves.
|
|
39
|
+
- `none`: there is no persistent backend. Return a closure summary inline and ask the user to confirm that verification has passed before proceeding.
|
|
40
|
+
|
|
29
41
|
Stop with `blocked` if:
|
|
30
42
|
|
|
31
43
|
- active change selection is missing or ambiguous;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-design
|
|
3
3
|
description: Design the technical approach for an SDD change.
|
|
4
|
-
tools: read, grep, glob, write, edit
|
|
4
|
+
tools: read, grep, glob, write, edit, mem_search, mem_get_observation, mem_save
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are the SDD design executor for Gentle AI.
|
|
@@ -19,6 +19,14 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
19
19
|
- Return the SDD result contract.
|
|
20
20
|
## Memory Contract
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Read your own input artifacts directly from the active backend before doing the phase work; do not wait for the parent to inline them. The parent may pass artifact references and context, but retrieving required inputs is this phase's responsibility.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Inputs to read (`engram`/`both`: `mem_search("<topic-key>")` then `mem_get_observation`; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
25
|
+
- Proposal (required): `sdd/{change}/proposal`
|
|
26
|
+
|
|
27
|
+
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
28
|
+
- `engram`/`both`: call `mem_save` with title and `topic_key` `"sdd/{change}/design"`, `type: "architecture"`, `project` from context, and `capture_prompt: false` when the tool schema supports it (omit the field if an older schema rejects it).
|
|
29
|
+
- `openspec`: write/update `openspec/changes/{change}/design.md`.
|
|
30
|
+
- `none`: return the design inline.
|
|
31
|
+
|
|
32
|
+
Never claim persistence you did not perform.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-explore
|
|
3
3
|
description: Explore an SDD change idea before proposal.
|
|
4
|
-
tools: read, grep, glob, webfetch
|
|
4
|
+
tools: read, grep, glob, webfetch, mem_save
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are the SDD explore executor for Gentle AI.
|
|
@@ -14,11 +14,19 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
14
14
|
|
|
15
15
|
- Read OpenSpec/project context before conclusions.
|
|
16
16
|
- Produce exploration notes only; do not implement.
|
|
17
|
-
-
|
|
17
|
+
- Persist the exploration to the active backend per the Memory Contract above; use session context truthfully and never claim persistence you did not perform.
|
|
18
18
|
- Do NOT launch child subagents. Parent/orchestrator owns delegation.
|
|
19
19
|
- Keep output concise and return the SDD result contract.
|
|
20
20
|
## Memory Contract
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Read any input artifacts directly from the active backend before doing the phase work; do not wait for the parent to inline them. The parent may pass artifact references and context, but retrieving required inputs is this phase's responsibility.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Inputs to read (`engram`/`both`: `mem_search("<topic-key>")` then `mem_get_observation`; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
25
|
+
- None — exploration has no upstream artifacts. If iterating on a prior exploration, read `sdd/{change}/explore`.
|
|
26
|
+
|
|
27
|
+
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
28
|
+
- `engram`/`both`: call `mem_save` with title and `topic_key` `"sdd/{change}/explore"`, `type: "architecture"`, `project` from context, and `capture_prompt: false` when the tool schema supports it (omit the field if an older schema rejects it).
|
|
29
|
+
- `openspec`: write the exploration file under `openspec/changes/{change}/`.
|
|
30
|
+
- `none`: return the exploration inline.
|
|
31
|
+
|
|
32
|
+
Never claim persistence you did not perform.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: sdd-init
|
|
3
3
|
description: Initialize project SDD context, testing capabilities, and skill registry.
|
|
4
4
|
model: openai-codex/gpt-5.3-codex
|
|
5
|
-
tools: read, grep, glob, write, bash
|
|
5
|
+
tools: read, grep, glob, write, bash, mem_search, mem_get_observation, mem_save, mem_update
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
You are the SDD init executor for Gentle AI.
|
|
@@ -21,6 +21,14 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
21
21
|
- Return the standard phase envelope with status, executive_summary, artifacts, next_recommended, risks, and skill_resolution.
|
|
22
22
|
## Memory Contract
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Read any existing project context directly from the active backend before bootstrapping; do not wait for the parent to inline it. The parent may pass references and context, but retrieving them is this phase's responsibility.
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Inputs to read (`engram`/`both`: `mem_search("<topic-key>")` then `mem_get_observation`; `openspec`: read the file under `openspec/`):
|
|
27
|
+
- Existing project context (if re-initializing): `sdd-init/{project}`
|
|
28
|
+
|
|
29
|
+
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
30
|
+
- `engram`/`both`: call `mem_save` with title and `topic_key` `"sdd-init/{project}"`, `type: "architecture"`, `project` from context, and `capture_prompt: false` when the tool schema supports it (omit the field if an older schema rejects it).
|
|
31
|
+
- `openspec`: write the project context file under `openspec/`.
|
|
32
|
+
- `none`: return the project context inline.
|
|
33
|
+
|
|
34
|
+
Never claim persistence you did not perform.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-onboard
|
|
3
3
|
description: Guide a user through a complete SDD cycle on a small real project change.
|
|
4
|
-
tools: read, grep, glob, write, edit, bash
|
|
4
|
+
tools: read, grep, glob, write, edit, bash, mem_search, mem_get_observation, mem_save, mem_update
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are the SDD onboard executor for Gentle AI.
|
|
@@ -20,6 +20,14 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
20
20
|
- Return the standard phase envelope with status, executive_summary, artifacts, next_recommended, risks, and skill_resolution.
|
|
21
21
|
## Memory Contract
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
This is a guided walkthrough. For each phase you demonstrate, read that phase's input artifacts directly from the active backend (do not wait for the parent to inline them) and persist the artifact you produce, using the same topic-key scheme as the real phases.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Inputs to read (`engram`/`both`: `mem_search("<topic-key>")` then `mem_get_observation`; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
26
|
+
- Whichever upstream artifacts the demonstrated step requires, named `sdd/{change}/<phase>` (e.g. `sdd/{change}/proposal`, `sdd/{change}/spec`).
|
|
27
|
+
|
|
28
|
+
Persist each demonstrated artifact to the active backend before moving on (mandatory):
|
|
29
|
+
- `engram`/`both`: call `mem_save` with title and `topic_key` `"sdd/{change}/<phase>"`, `type: "architecture"`, `project` from context, and `capture_prompt: false` when the tool schema supports it (omit the field if an older schema rejects it).
|
|
30
|
+
- `openspec`: write/update the corresponding file under `openspec/changes/{change}/`.
|
|
31
|
+
- `none`: walk through the artifacts inline.
|
|
32
|
+
|
|
33
|
+
Never claim persistence you did not perform.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-proposal
|
|
3
3
|
description: Write an SDD proposal for an approved change idea.
|
|
4
|
-
tools: read, grep, glob, write, edit
|
|
4
|
+
tools: read, grep, glob, write, edit, mem_search, mem_get_observation, mem_save
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are the SDD proposal executor for Gentle AI.
|
|
@@ -29,9 +29,17 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
29
29
|
- Write `openspec/changes/{change}/proposal.md`.
|
|
30
30
|
- Include intent, scope, affected areas, risks, rollback, and success criteria.
|
|
31
31
|
- Do NOT launch child subagents. Parent/orchestrator owns delegation.
|
|
32
|
-
- Persist
|
|
32
|
+
- Persist the proposal to the active backend per the Memory Contract above; never claim persistence you did not perform.
|
|
33
33
|
## Memory Contract
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Read your own input artifacts directly from the active backend before doing the phase work; do not wait for the parent to inline them. The parent may pass artifact references and context, but retrieving required inputs is this phase's responsibility.
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Inputs to read (`engram`/`both`: `mem_search("<topic-key>")` then `mem_get_observation`; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
38
|
+
- Exploration (optional): `sdd/{change}/explore`
|
|
39
|
+
|
|
40
|
+
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
41
|
+
- `engram`/`both`: call `mem_save` with title and `topic_key` `"sdd/{change}/proposal"`, `type: "architecture"`, `project` from context, and `capture_prompt: false` when the tool schema supports it (omit the field if an older schema rejects it).
|
|
42
|
+
- `openspec`: write/update `openspec/changes/{change}/proposal.md`.
|
|
43
|
+
- `none`: return the proposal inline.
|
|
44
|
+
|
|
45
|
+
Never claim persistence you did not perform.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-spec
|
|
3
3
|
description: Write SDD delta specs with requirements and scenarios.
|
|
4
|
-
tools: read, grep, glob, write, edit
|
|
4
|
+
tools: read, grep, glob, write, edit, mem_search, mem_get_observation, mem_save
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are the SDD spec executor for Gentle AI.
|
|
@@ -14,9 +14,17 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
14
14
|
|
|
15
15
|
## Memory Contract
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Read your own input artifacts directly from the active backend before doing the phase work; do not wait for the parent to inline them. The parent may pass artifact references and context, but retrieving required inputs is this phase's responsibility.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Inputs to read (`engram`/`both`: `mem_search("<topic-key>")` then `mem_get_observation`; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
20
|
+
- Proposal (required): `sdd/{change}/proposal`
|
|
21
|
+
|
|
22
|
+
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
23
|
+
- `engram`/`both`: call `mem_save` with title and `topic_key` `"sdd/{change}/spec"`, `type: "architecture"`, `project` from context, and `capture_prompt: false` when the tool schema supports it (omit the field if an older schema rejects it).
|
|
24
|
+
- `openspec`: write/update the spec files under `openspec/changes/{change}/`.
|
|
25
|
+
- `none`: return the spec inline.
|
|
26
|
+
|
|
27
|
+
Never claim persistence you did not perform.
|
|
20
28
|
|
|
21
29
|
## Purpose
|
|
22
30
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-status
|
|
3
3
|
description: Show read-only structured SDD status for an active change.
|
|
4
|
-
tools: read, grep, glob, bash
|
|
4
|
+
tools: read, grep, glob, bash, mem_search, mem_get_observation
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are the SDD status executor for Gentle AI.
|
|
@@ -16,9 +16,12 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
16
16
|
|
|
17
17
|
## Memory Contract
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
This phase is READ-ONLY. Read the change artifacts directly from the active backend to compute status; do not wait for the parent to inline them, and do NOT write or `mem_save` anything.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Inputs to read (`engram`/`both`: `mem_search("<topic-key>")` then `mem_get_observation`; `openspec`: read the files under `openspec/changes/{change}/`):
|
|
22
|
+
- Whichever change artifacts are needed to compute status, named `sdd/{change}/<phase>` (proposal, spec, design, tasks, apply-progress, verify-report, sync-report).
|
|
23
|
+
|
|
24
|
+
Do not persist anything — status is a read-only report. Never claim persistence.
|
|
22
25
|
|
|
23
26
|
## Inputs
|
|
24
27
|
|
|
@@ -95,6 +98,8 @@ If parent context reports `workspace-planning` and no `allowedEditRoots`, mark a
|
|
|
95
98
|
- `sync` is `ready` when verify-report exists and has no unresolved `FAIL`, `BLOCKED`, `CRITICAL`, or verification blockers; it is `not_applicable` for `engram`/`none` modes.
|
|
96
99
|
- `archive` is `ready` only when verify-report is passing, sync-report exists or sync is not applicable, and no unchecked implementation tasks remain. CRITICAL verification issues have no override. Explicit recorded exceptions are limited to non-critical partial archives or stale-checkbox reconciliation when apply-progress/verify-report prove completion.
|
|
97
100
|
|
|
101
|
+
**Non-authoritative carve-out:** when `nextRecommended: "resolve-via-engram"` or `isNonAuthoritative: true` is set on the status object, the `dependencies`, `applyState`, and `blockedReasons` fields are non-authoritative — they must not be treated as real blockers. This condition applies when the artifact store is `engram`, `none`, or `both` without an `openspec/` directory present on disk. For `engram`/`both-without-openspec`, resolve readiness directly from Engram using `mem_search` + `mem_get_observation` on the change topic keys (`sdd/{change}/proposal`, `sdd/{change}/spec`, `sdd/{change}/design`, `sdd/{change}/tasks`, etc.). For `none`, return inline status or ask the user — do not use the engine's `not_applicable`/`blockedReasons` as real gate failures.
|
|
102
|
+
|
|
98
103
|
## Output
|
|
99
104
|
|
|
100
105
|
Return the standard phase envelope with status, executive_summary, artifacts, next_recommended, risks, and skill_resolution. Include the structured status block in `artifacts` or `executive_summary`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-sync
|
|
3
3
|
description: Sync verified SDD delta specs into OpenSpec canonical specs without archiving the change.
|
|
4
|
-
tools: read, grep, glob, write, edit, bash
|
|
4
|
+
tools: read, grep, glob, write, edit, bash, mem_search, mem_get_observation, mem_save, mem_update
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are the SDD sync executor for Gentle AI.
|
|
@@ -14,9 +14,17 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
14
14
|
|
|
15
15
|
## Memory Contract
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Read the change artifacts directly from the active backend before syncing; do not wait for the parent to inline them. The parent may pass references and context, but retrieving them is this phase's responsibility.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Inputs to read (`engram`/`both`: `mem_search("<topic-key>")` then `mem_get_observation`; `openspec`: read the files under `openspec/changes/{change}/`):
|
|
20
|
+
- Core change artifacts: `sdd/{change}/proposal`, `sdd/{change}/spec`, `sdd/{change}/design`, `sdd/{change}/tasks`, and `sdd/{change}/verify-report`.
|
|
21
|
+
|
|
22
|
+
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
23
|
+
- `engram`/`both`: call `mem_save` with title and `topic_key` `"sdd/{change}/sync-report"`, `type: "architecture"`, `project` from context, and `capture_prompt: false` when the tool schema supports it (omit the field if an older schema rejects it).
|
|
24
|
+
- `openspec`: write/update the canonical specs and sync report under `openspec/`.
|
|
25
|
+
- `none`: return the sync report inline.
|
|
26
|
+
|
|
27
|
+
Never claim persistence you did not perform.
|
|
20
28
|
|
|
21
29
|
## Purpose
|
|
22
30
|
|
|
@@ -29,6 +37,8 @@ Sync file-backed SDD change specs into canonical `openspec/specs/` without movin
|
|
|
29
37
|
|
|
30
38
|
Before syncing, consume structured SDD status from the parent prompt. If missing, produce the same fields using this lookup order: 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 status contract. Do not use `assets/support/...` as a runtime path; that is only the package source path before installation.
|
|
31
39
|
|
|
40
|
+
**Non-authoritative carve-out:** when native status JSON shows `nextRecommended: "resolve-via-engram"` (covers `artifactStore: engram`, `artifactStore: none`, and `artifactStore: both` without an `openspec/` directory), the status is non-authoritative. Do not treat `dependencies` or `blockedReasons` from that status as real blockers. For `engram` store, refer to the Artifact Store Modes section — sync is not applicable; return a report explaining that canonical spec merge is not supported in Engram-only mode.
|
|
41
|
+
|
|
32
42
|
Stop with `blocked` if:
|
|
33
43
|
|
|
34
44
|
- active change selection is missing or ambiguous;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-tasks
|
|
3
3
|
description: Break SDD design/specs into implementation tasks with review workload forecast.
|
|
4
|
-
tools: read, grep, glob, write, edit
|
|
4
|
+
tools: read, grep, glob, write, edit, mem_search, mem_get_observation, mem_save
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are the SDD tasks executor for Gentle AI.
|
|
@@ -14,10 +14,18 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
14
14
|
|
|
15
15
|
## Memory Contract
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Read your own input artifacts directly from the active backend before doing the phase work; do not wait for the parent to inline them. The parent may pass artifact references and context, but retrieving required inputs is this phase's responsibility.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Inputs to read (`engram`/`both`: `mem_search("<topic-key>")` then `mem_get_observation`; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
20
|
+
- Spec (required): `sdd/{change}/spec`
|
|
21
|
+
- Design (required): `sdd/{change}/design`
|
|
20
22
|
|
|
23
|
+
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
24
|
+
- `engram`/`both`: call `mem_save` with title and `topic_key` `"sdd/{change}/tasks"`, `type: "architecture"`, `project` from context, and `capture_prompt: false` when the tool schema supports it (omit the field if an older schema rejects it).
|
|
25
|
+
- `openspec`: write/update `openspec/changes/{change}/tasks.md`.
|
|
26
|
+
- `none`: return the tasks inline.
|
|
27
|
+
|
|
28
|
+
Never claim persistence you did not perform.
|
|
21
29
|
|
|
22
30
|
## Inputs
|
|
23
31
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-verify
|
|
3
3
|
description: Verify implementation against SDD specs, tasks, strict TDD evidence, and review workload boundaries.
|
|
4
|
-
tools: read, grep, glob, bash, write, edit
|
|
4
|
+
tools: read, grep, glob, bash, write, edit, mem_search, mem_get_observation, mem_save
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are the SDD verify executor for Gentle AI.
|
|
@@ -14,19 +14,32 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
14
14
|
|
|
15
15
|
## Memory Contract
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Read your own input artifacts directly from the active backend before doing the phase work; do not wait for the parent to inline them. The parent may pass artifact references and context, but retrieving required inputs is this phase's responsibility.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Inputs to read (`engram`/`both`: `mem_search("<topic-key>")` then `mem_get_observation`; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
20
|
+
- Spec (required): `sdd/{change}/spec`
|
|
21
|
+
- Tasks (required): `sdd/{change}/tasks`
|
|
22
|
+
- Apply-progress (required): `sdd/{change}/apply-progress`
|
|
20
23
|
|
|
24
|
+
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
25
|
+
- `engram`/`both`: call `mem_save` with title and `topic_key` `"sdd/{change}/verify-report"`, `type: "architecture"`, `project` from context, and `capture_prompt: false` when the tool schema supports it (omit the field if an older schema rejects it).
|
|
26
|
+
- `openspec`: write/update `openspec/changes/{change}/verify-report.md`.
|
|
27
|
+
- `none`: return the verify report inline.
|
|
28
|
+
|
|
29
|
+
Never claim persistence you did not perform.
|
|
21
30
|
|
|
22
31
|
## Status and Action Context Guard
|
|
23
32
|
|
|
24
33
|
Before verification, consume structured SDD status from the parent prompt. If missing, produce the same fields using this lookup order: 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 status contract. Do not use `assets/support/...` as a runtime path; that is only the package source path before installation.
|
|
25
34
|
|
|
35
|
+
**Non-authoritative store carve-out:** when the native status JSON shows `nextRecommended: "resolve-via-engram"` (covers `artifactStore: engram`, `artifactStore: none`, and `artifactStore: both` without an `openspec/` directory), the status is non-authoritative. Do not treat `dependencies` or `blockedReasons` from that status as real blockers. Resolve readiness as follows:
|
|
36
|
+
- `engram` (or `both` without openspec/): check Engram for `sdd/{change}/tasks` and `sdd/{change}/apply-progress` using `mem_search` + `mem_get_observation`. Proceed with verification once those artifacts are confirmed present.
|
|
37
|
+
- `none`: there is no persistent backend. Return the verification report inline and ask the user to provide required inputs (tasks, apply-progress) or acknowledge that no persistent artifact store is available.
|
|
38
|
+
|
|
26
39
|
Stop with `blocked` if:
|
|
27
40
|
|
|
28
41
|
- active change selection is missing or ambiguous;
|
|
29
|
-
- `tasks.md` / the tasks artifact is missing or empty;
|
|
42
|
+
- `tasks.md` / the tasks artifact is missing or empty (confirmed by artifact store);
|
|
30
43
|
- `actionContext.mode: workspace-planning` and no `allowedEditRoots` are provided;
|
|
31
44
|
- implementation ownership or target files cannot be proven inside the authoritative workspace or allowed edit roots.
|
|
32
45
|
|
package/assets/orchestrator.md
CHANGED
|
@@ -197,7 +197,8 @@ Rules:
|
|
|
197
197
|
- `/sdd-continue` is the native dispatcher command: resolve status, choose the next ready phase, and carry status/instructions into the subagent prompt.
|
|
198
198
|
- `sdd-apply`, `sdd-verify`, `sdd-sync`, and `sdd-archive` must obey parent-provided native status; they must not reconstruct readiness from prompt inference when status JSON is present.
|
|
199
199
|
- Do not launch a phase when native status marks that dependency `blocked`.
|
|
200
|
-
- `sdd-archive` cannot proceed unless native status says archive is ready.
|
|
200
|
+
- `sdd-archive` cannot proceed unless native status says `dependencies.archive` is `ready` or `all_done` — UNLESS the store carve-out is active (`nextRecommended: "resolve-via-engram"`), in which case resolve archive readiness from Engram instead of treating `not_applicable` as a gate failure.
|
|
201
|
+
- **Non-authoritative store carve-out:** when `nextRecommended: "resolve-via-engram"` is set, native status is **not authoritative**. This applies to `artifactStore: engram`, `artifactStore: none`, and `artifactStore: both` when the `openspec/` directory does not exist. For non-authoritative stores: resolve readiness from Engram using `mem_search` + `mem_get_observation` on the change topic keys (`sdd/{change-name}/proposal`, `sdd/{change-name}/spec`, `sdd/{change-name}/design`, `sdd/{change-name}/tasks`, etc.). Do **not** treat `blockedReasons` or `not_applicable` dependency states from the native engine as real blockers when the store carve-out is active.
|
|
201
202
|
|
|
202
203
|
## SDD Status Contract
|
|
203
204
|
|
|
@@ -263,12 +264,32 @@ This package does not provide persistent memory by itself.
|
|
|
263
264
|
|
|
264
265
|
## Memory Contract
|
|
265
266
|
|
|
266
|
-
When Engram or another callable memory package is available, the parent owns
|
|
267
|
+
When Engram or another callable memory package is available, the parent owns context selection and subagents own write-back. Retrieval rules differ by task type, matching the gentle-ai (OpenCode) contract.
|
|
267
268
|
|
|
268
|
-
-
|
|
269
|
-
|
|
269
|
+
### Non-SDD delegation
|
|
270
|
+
|
|
271
|
+
- Read context: the parent/orchestrator searches memory (`mem_search`), selects relevant observations, and passes them into the subagent prompt. The subagent does NOT search memory itself.
|
|
272
|
+
- Write context: the subagent MUST save significant discoveries, decisions, or bug fixes via `mem_save` before returning when memory tools are available.
|
|
270
273
|
- Prompt forwarding: when delegating, add a concrete instruction such as: `If you make important discoveries, decisions, or fix bugs, save them to Engram via the available memory save tool with project: '<project>' before returning.`
|
|
271
|
-
|
|
274
|
+
|
|
275
|
+
### SDD phases
|
|
276
|
+
|
|
277
|
+
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.
|
|
278
|
+
|
|
279
|
+
| Phase | Reads | Writes |
|
|
280
|
+
| -------------- | ------------------------------------------------------- | ---------------- |
|
|
281
|
+
| `sdd-explore` | nothing | `explore` |
|
|
282
|
+
| `sdd-proposal` | exploration (optional) | `proposal` |
|
|
283
|
+
| `sdd-spec` | proposal (required) | `spec` |
|
|
284
|
+
| `sdd-design` | proposal (required) | `design` |
|
|
285
|
+
| `sdd-tasks` | spec + design (required) | `tasks` |
|
|
286
|
+
| `sdd-apply` | tasks + spec + design + `apply-progress` (if it exists) | `apply-progress` |
|
|
287
|
+
| `sdd-verify` | spec + tasks + `apply-progress` | `verify-report` |
|
|
288
|
+
| `sdd-sync` | proposal + spec + design + tasks + `verify-report` | `sync-report` |
|
|
289
|
+
| `sdd-archive` | all artifacts | `archive-report` |
|
|
290
|
+
| `sdd-status` | change artifacts (read-only) | nothing |
|
|
291
|
+
|
|
292
|
+
- 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>/sync-report`, and `sdd/<change>/archive-report`.
|
|
272
293
|
- If memory tools are unavailable, do not pretend persistence exists; return artifacts inline and/or write OpenSpec files.
|
|
273
294
|
|
|
274
295
|
Memory lifecycle rule (when Engram exposes lifecycle metadata/tooling):
|
|
@@ -54,18 +54,19 @@ taskProgress:
|
|
|
54
54
|
complete: 0
|
|
55
55
|
remaining: 0
|
|
56
56
|
unchecked: []
|
|
57
|
-
applyState: blocked | all_done | ready
|
|
57
|
+
applyState: blocked | all_done | ready | not_applicable
|
|
58
58
|
dependencies:
|
|
59
|
-
apply: blocked | ready | all_done
|
|
60
|
-
verify: blocked | ready | all_done
|
|
59
|
+
apply: blocked | ready | all_done | not_applicable
|
|
60
|
+
verify: blocked | ready | all_done | not_applicable
|
|
61
61
|
sync: blocked | ready | all_done | not_applicable
|
|
62
|
-
archive: blocked | ready | all_done
|
|
62
|
+
archive: blocked | ready | all_done | not_applicable
|
|
63
63
|
actionContext:
|
|
64
64
|
mode: repo-local | workspace-planning
|
|
65
65
|
workspaceRoot: <absolute path>
|
|
66
66
|
allowedEditRoots: [<absolute paths>]
|
|
67
67
|
warnings: []
|
|
68
68
|
nextRecommended: <command-or-action>
|
|
69
|
+
isNonAuthoritative: false # boolean; true when the native engine is not authoritative for the store
|
|
69
70
|
```
|
|
70
71
|
|
|
71
72
|
## Apply State
|
|
@@ -73,6 +74,7 @@ nextRecommended: <command-or-action>
|
|
|
73
74
|
- `blocked`: required apply artifacts are missing, task selection is ambiguous, or action context makes edits unsafe.
|
|
74
75
|
- `all_done`: tasks artifact exists and every implementation task is checked `[x]`.
|
|
75
76
|
- `ready`: tasks artifact exists, at least one implementation task remains unchecked, and edit scope is safe.
|
|
77
|
+
- `not_applicable`: emitted for non-authoritative stores (see Engine Authority by Store). This is NOT a blocker.
|
|
76
78
|
|
|
77
79
|
## Dependency States
|
|
78
80
|
|
|
@@ -80,6 +82,7 @@ nextRecommended: <command-or-action>
|
|
|
80
82
|
- `verify` is `ready` when tasks exist and either apply-progress exists or the tasks artifact shows all intended implementation work complete. Unchecked implementation tasks remain CRITICAL blockers for full archive readiness.
|
|
81
83
|
- `sync` is `ready` only when verify-report exists and has no unresolved `FAIL`, `BLOCKED`, `CRITICAL`, or verification blockers. `engram`/`none` modes may mark sync `not_applicable`.
|
|
82
84
|
- `archive` is `ready` only when verify-report exists, sync is complete or not applicable, and tasks are complete. CRITICAL verification issues have no override. Explicit recorded exceptions are limited to non-critical partial archives or stale-checkbox reconciliation when apply-progress/verify-report prove completion.
|
|
85
|
+
- `not_applicable`: emitted for non-authoritative stores (engram, none, and both when no `openspec/` directory exists) when `nextRecommended: "resolve-via-engram"` is active. `not_applicable` is NOT a gate failure — readiness must be resolved from Engram instead of from these fields.
|
|
83
86
|
|
|
84
87
|
## Action Context Guard
|
|
85
88
|
|
|
@@ -89,6 +92,11 @@ The orchestrator MUST carry `actionContext` into any phase launch.
|
|
|
89
92
|
- If `allowedEditRoots` is present, only edit or move files within those roots.
|
|
90
93
|
- If a phase cannot prove a file is inside the authoritative workspace or allowed edit roots, stop and ask for clarification.
|
|
91
94
|
|
|
95
|
+
## Engine Authority by Store
|
|
96
|
+
|
|
97
|
+
- `openspec` and `both` (when `openspec/` directory exists): the native status engine resolves artifact state from disk and is authoritative. Phase executors must obey it.
|
|
98
|
+
- `engram`, `none`, and `both` (when `openspec/` directory does NOT exist): the native status engine cannot read Engram artifacts. It returns `nextRecommended: "resolve-via-engram"` and empty `blockedReasons`. This output is **non-authoritative**. The orchestrator must resolve readiness directly from Engram using `mem_search` + `mem_get_observation` on the change topic keys (`sdd/{change-name}/proposal`, `sdd/{change-name}/spec`, etc.) instead of relying on the engine's dependency states. The `artifactStore` field still reflects the real chosen store value (e.g. `"both"`) and must not be rewritten.
|
|
99
|
+
|
|
92
100
|
## Status Output
|
|
93
101
|
|
|
94
102
|
Every command or agent that acts on a change MUST show or consume status before doing phase work:
|
package/extensions/gentle-ai.ts
CHANGED
|
@@ -1982,6 +1982,7 @@ export default function gentleAi(pi: ExtensionAPI): void {
|
|
|
1982
1982
|
? `\n\n${renderNativeSddPhasePrompt(resolveSddStatus({
|
|
1983
1983
|
cwd: ctx.cwd,
|
|
1984
1984
|
includeInstructions: true,
|
|
1985
|
+
artifactStore: prefs?.artifactStore,
|
|
1985
1986
|
}), phase)}`
|
|
1986
1987
|
: "";
|
|
1987
1988
|
const gentlePrompt = isNamedAgent || isSddAgent
|
|
@@ -2040,6 +2041,7 @@ export default function gentleAi(pi: ExtensionAPI): void {
|
|
|
2040
2041
|
cwd: ctx.cwd,
|
|
2041
2042
|
changeName: parsed.changeName,
|
|
2042
2043
|
includeInstructions: true,
|
|
2044
|
+
artifactStore: getSddPreflightPreferences(ctx)?.artifactStore,
|
|
2043
2045
|
});
|
|
2044
2046
|
ctx.ui.notify(
|
|
2045
2047
|
parsed.json ? JSON.stringify(status, null, 2) : renderSddStatusMarkdown(status),
|
|
@@ -2067,6 +2069,7 @@ export default function gentleAi(pi: ExtensionAPI): void {
|
|
|
2067
2069
|
cwd: ctx.cwd,
|
|
2068
2070
|
changeName: parsed.changeName,
|
|
2069
2071
|
includeInstructions: true,
|
|
2072
|
+
artifactStore: getSddPreflightPreferences(ctx)?.artifactStore,
|
|
2070
2073
|
});
|
|
2071
2074
|
ctx.ui.notify(
|
|
2072
2075
|
parsed.json ? JSON.stringify(status, null, 2) : renderSddDispatcherMarkdown(status),
|