gentle-pi 0.10.7 → 0.10.9
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/jd-fix-agent.md +7 -1
- package/assets/agents/jd-judge-a.md +5 -1
- package/assets/agents/jd-judge-b.md +5 -1
- package/assets/agents/review-readability.md +5 -1
- package/assets/agents/review-reliability.md +5 -1
- package/assets/agents/review-resilience.md +5 -1
- package/assets/agents/review-risk.md +5 -1
- package/assets/agents/sdd-apply.md +15 -5
- package/assets/agents/sdd-archive.md +13 -4
- package/assets/agents/sdd-design.md +11 -3
- package/assets/agents/sdd-explore.md +8 -3
- package/assets/agents/sdd-init.md +12 -3
- package/assets/agents/sdd-onboard.md +13 -3
- package/assets/agents/sdd-proposal.md +11 -3
- package/assets/agents/sdd-spec.md +11 -3
- package/assets/agents/sdd-status.md +11 -4
- package/assets/agents/sdd-sync.md +13 -3
- package/assets/agents/sdd-tasks.md +11 -3
- package/assets/agents/sdd-verify.md +13 -4
- package/assets/orchestrator.md +6 -6
- package/assets/support/sdd-status-contract.md +1 -1
- package/extensions/gentle-ai.ts +2 -16
- package/lib/sdd-preflight.ts +1 -6
- package/lib/sdd-status.ts +2 -2
- package/package.json +1 -1
- package/tests/artifact-language.test.ts +6 -5
- package/tests/package-manifest.test.ts +37 -1
- package/tests/runtime-harness.mjs +14 -0
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: jd-fix-agent
|
|
3
3
|
description: Judgment Day surgical fix agent for confirmed findings. Can edit code and run focused tests.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- edit
|
|
9
|
+
- write
|
|
10
|
+
- bash
|
|
5
11
|
---
|
|
6
12
|
|
|
7
13
|
You are the Judgment Day fix agent for Gentle AI.
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: jd-judge-a
|
|
3
3
|
description: Judgment Day blind adversarial reviewer A. Read-only; reports findings and does not fix code.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- bash
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
You are Judgment Day judge A for Gentle AI.
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: jd-judge-b
|
|
3
3
|
description: Judgment Day blind adversarial reviewer B. Read-only; independently reports findings and does not fix code.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- bash
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
You are Judgment Day judge B for Gentle AI.
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review-readability
|
|
3
3
|
description: R2 Readability reviewer — naming, complexity, intention, maintainability, review size, and context clarity.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- bash
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
You are **R2 Readability**, a read-only reviewer. Find clarity problems; do not fix them.
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review-reliability
|
|
3
3
|
description: R3 Reliability reviewer — behavior-first tests, coverage value, edge cases, determinism, contracts, and regressions.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- bash
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
You are **R3 Reliability**, a read-only reviewer. Find test and behavior risks; do not fix them.
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review-resilience
|
|
3
3
|
description: R4 Resilience reviewer — fallbacks, retry/backoff, graceful degradation, observability, load, rollback, and SLO risks.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- bash
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
You are **R4 Resilience**, a read-only reviewer. Find operational failure risks; do not fix them.
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review-risk
|
|
3
3
|
description: R1 Risk reviewer — security, privilege boundaries, data exposure, dependency risks, and merge-blocking vulnerabilities.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- bash
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
You are **R1 Risk**, a read-only reviewer. Find security risks; do not fix them.
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-apply
|
|
3
3
|
description: Implement SDD tasks with strict TDD evidence and review workload guard.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- edit
|
|
9
|
+
- write
|
|
10
|
+
- bash
|
|
11
|
+
- mem_search
|
|
12
|
+
- mem_get_observation
|
|
13
|
+
- mem_save
|
|
14
|
+
- mem_update
|
|
5
15
|
---
|
|
6
16
|
|
|
7
17
|
You are the SDD apply executor for Gentle AI.
|
|
@@ -16,15 +26,15 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
16
26
|
|
|
17
27
|
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
28
|
|
|
19
|
-
Inputs to read (`engram`/`both`:
|
|
29
|
+
Inputs to read (`engram`/`both`: use the injected Engram memory read tools for the topic key, then fetch the full observation; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
20
30
|
- Tasks (required): `sdd/{change}/tasks`
|
|
21
31
|
- Spec (required): `sdd/{change}/spec`
|
|
22
32
|
- Design (required): `sdd/{change}/design`
|
|
23
33
|
- Previous apply-progress (if it exists): `sdd/{change}/apply-progress` — read and MERGE with your new progress; do NOT overwrite.
|
|
24
34
|
|
|
25
35
|
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
26
|
-
- `engram`/`both`: call
|
|
27
|
-
- Also update the tasks artifact checkboxes via
|
|
36
|
+
- `engram`/`both`: call the injected Engram save tool 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).
|
|
37
|
+
- Also update the tasks artifact checkboxes via the injected Engram update tool (`engram`/`both`) or file edit (`openspec`).
|
|
28
38
|
- `openspec`: write/update the apply-progress and tasks files under `openspec/changes/{change}/`.
|
|
29
39
|
- `none`: return progress inline.
|
|
30
40
|
|
|
@@ -35,7 +45,7 @@ Never claim persistence you did not perform.
|
|
|
35
45
|
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.
|
|
36
46
|
|
|
37
47
|
**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
|
|
48
|
+
- `engram` (or `both` without openspec/): search Engram for `sdd/{change}/tasks`, `sdd/{change}/spec`, and `sdd/{change}/design` using the Engram memory tools injected by the memory provider. Proceed with implementation once those artifacts are confirmed present.
|
|
39
49
|
- `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
50
|
|
|
41
51
|
Stop with `blocked` before editing if:
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-archive
|
|
3
3
|
description: Archive a verified SDD change into OpenSpec source specs.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- write
|
|
9
|
+
- edit
|
|
10
|
+
- bash
|
|
11
|
+
- mem_search
|
|
12
|
+
- mem_get_observation
|
|
13
|
+
- mem_save
|
|
5
14
|
---
|
|
6
15
|
|
|
7
16
|
You are the SDD archive executor for Gentle AI.
|
|
@@ -16,11 +25,11 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
16
25
|
|
|
17
26
|
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
27
|
|
|
19
|
-
Inputs to read (`engram`/`both`:
|
|
28
|
+
Inputs to read (`engram`/`both`: use the injected Engram memory read tools for the topic key, then fetch the full observation; `openspec`: read the files under `openspec/changes/{change}/`):
|
|
20
29
|
- 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
30
|
|
|
22
31
|
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
23
|
-
- `engram`/`both`: call
|
|
32
|
+
- `engram`/`both`: call the injected Engram save tool 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
33
|
- `openspec`: write the archive report and perform the file moves described in the sections below.
|
|
25
34
|
- `none`: return the archive report inline.
|
|
26
35
|
|
|
@@ -35,7 +44,7 @@ Archive a completed SDD change. In file-backed modes, this requires canonical sp
|
|
|
35
44
|
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.
|
|
36
45
|
|
|
37
46
|
**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
|
|
47
|
+
- `engram` (or `both` without openspec/): refer to the Artifact Store Modes section — resolve readiness by checking Engram for `sdd/{change}/verify-report` using the Engram memory tools injected by the memory provider, then record the archive report in Engram without filesystem sync or folder moves.
|
|
39
48
|
- `none`: there is no persistent backend. Return a closure summary inline and ask the user to confirm that verification has passed before proceeding.
|
|
40
49
|
|
|
41
50
|
Stop with `blocked` if:
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-design
|
|
3
3
|
description: Design the technical approach for an SDD change.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- write
|
|
9
|
+
- edit
|
|
10
|
+
- mem_search
|
|
11
|
+
- mem_get_observation
|
|
12
|
+
- mem_save
|
|
5
13
|
---
|
|
6
14
|
|
|
7
15
|
You are the SDD design executor for Gentle AI.
|
|
@@ -21,11 +29,11 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
21
29
|
|
|
22
30
|
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
31
|
|
|
24
|
-
Inputs to read (`engram`/`both`:
|
|
32
|
+
Inputs to read (`engram`/`both`: use the injected Engram memory read tools for the topic key, then fetch the full observation; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
25
33
|
- Proposal (required): `sdd/{change}/proposal`
|
|
26
34
|
|
|
27
35
|
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
28
|
-
- `engram`/`both`: call
|
|
36
|
+
- `engram`/`both`: call the injected Engram save tool 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
37
|
- `openspec`: write/update `openspec/changes/{change}/design.md`.
|
|
30
38
|
- `none`: return the design inline.
|
|
31
39
|
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-explore
|
|
3
3
|
description: Explore an SDD change idea before proposal.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- webfetch
|
|
9
|
+
- mem_save
|
|
5
10
|
---
|
|
6
11
|
|
|
7
12
|
You are the SDD explore executor for Gentle AI.
|
|
@@ -21,11 +26,11 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
21
26
|
|
|
22
27
|
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
28
|
|
|
24
|
-
Inputs to read (`engram`/`both`:
|
|
29
|
+
Inputs to read (`engram`/`both`: use the injected Engram memory read tools for the topic key, then fetch the full observation; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
25
30
|
- None — exploration has no upstream artifacts. If iterating on a prior exploration, read `sdd/{change}/explore`.
|
|
26
31
|
|
|
27
32
|
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
28
|
-
- `engram`/`both`: call
|
|
33
|
+
- `engram`/`both`: call the injected Engram save tool 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
34
|
- `openspec`: write the exploration file under `openspec/changes/{change}/`.
|
|
30
35
|
- `none`: return the exploration inline.
|
|
31
36
|
|
|
@@ -2,7 +2,16 @@
|
|
|
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:
|
|
5
|
+
tools:
|
|
6
|
+
- read
|
|
7
|
+
- grep
|
|
8
|
+
- glob
|
|
9
|
+
- write
|
|
10
|
+
- bash
|
|
11
|
+
- mem_search
|
|
12
|
+
- mem_get_observation
|
|
13
|
+
- mem_save
|
|
14
|
+
- mem_update
|
|
6
15
|
---
|
|
7
16
|
|
|
8
17
|
You are the SDD init executor for Gentle AI.
|
|
@@ -23,11 +32,11 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
23
32
|
|
|
24
33
|
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
34
|
|
|
26
|
-
Inputs to read (`engram`/`both`:
|
|
35
|
+
Inputs to read (`engram`/`both`: use the injected Engram memory read tools for the topic key, then fetch the full observation; `openspec`: read the file under `openspec/`):
|
|
27
36
|
- Existing project context (if re-initializing): `sdd-init/{project}`
|
|
28
37
|
|
|
29
38
|
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
30
|
-
- `engram`/`both`: call
|
|
39
|
+
- `engram`/`both`: call the injected Engram save tool 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
40
|
- `openspec`: write the project context file under `openspec/`.
|
|
32
41
|
- `none`: return the project context inline.
|
|
33
42
|
|
|
@@ -1,7 +1,17 @@
|
|
|
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:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- write
|
|
9
|
+
- edit
|
|
10
|
+
- bash
|
|
11
|
+
- mem_search
|
|
12
|
+
- mem_get_observation
|
|
13
|
+
- mem_save
|
|
14
|
+
- mem_update
|
|
5
15
|
---
|
|
6
16
|
|
|
7
17
|
You are the SDD onboard executor for Gentle AI.
|
|
@@ -22,11 +32,11 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
22
32
|
|
|
23
33
|
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
34
|
|
|
25
|
-
Inputs to read (`engram`/`both`:
|
|
35
|
+
Inputs to read (`engram`/`both`: use the injected Engram memory read tools for the topic key, then fetch the full observation; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
26
36
|
- Whichever upstream artifacts the demonstrated step requires, named `sdd/{change}/<phase>` (e.g. `sdd/{change}/proposal`, `sdd/{change}/spec`).
|
|
27
37
|
|
|
28
38
|
Persist each demonstrated artifact to the active backend before moving on (mandatory):
|
|
29
|
-
- `engram`/`both`: call
|
|
39
|
+
- `engram`/`both`: call the injected Engram save tool 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
40
|
- `openspec`: write/update the corresponding file under `openspec/changes/{change}/`.
|
|
31
41
|
- `none`: walk through the artifacts inline.
|
|
32
42
|
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-proposal
|
|
3
3
|
description: Write an SDD proposal for an approved change idea.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- write
|
|
9
|
+
- edit
|
|
10
|
+
- mem_search
|
|
11
|
+
- mem_get_observation
|
|
12
|
+
- mem_save
|
|
5
13
|
---
|
|
6
14
|
|
|
7
15
|
You are the SDD proposal executor for Gentle AI.
|
|
@@ -34,11 +42,11 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
34
42
|
|
|
35
43
|
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
44
|
|
|
37
|
-
Inputs to read (`engram`/`both`:
|
|
45
|
+
Inputs to read (`engram`/`both`: use the injected Engram memory read tools for the topic key, then fetch the full observation; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
38
46
|
- Exploration (optional): `sdd/{change}/explore`
|
|
39
47
|
|
|
40
48
|
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
41
|
-
- `engram`/`both`: call
|
|
49
|
+
- `engram`/`both`: call the injected Engram save tool 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
50
|
- `openspec`: write/update `openspec/changes/{change}/proposal.md`.
|
|
43
51
|
- `none`: return the proposal inline.
|
|
44
52
|
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-spec
|
|
3
3
|
description: Write SDD delta specs with requirements and scenarios.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- write
|
|
9
|
+
- edit
|
|
10
|
+
- mem_search
|
|
11
|
+
- mem_get_observation
|
|
12
|
+
- mem_save
|
|
5
13
|
---
|
|
6
14
|
|
|
7
15
|
You are the SDD spec executor for Gentle AI.
|
|
@@ -16,11 +24,11 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
16
24
|
|
|
17
25
|
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
26
|
|
|
19
|
-
Inputs to read (`engram`/`both`:
|
|
27
|
+
Inputs to read (`engram`/`both`: use the injected Engram memory read tools for the topic key, then fetch the full observation; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
20
28
|
- Proposal (required): `sdd/{change}/proposal`
|
|
21
29
|
|
|
22
30
|
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
23
|
-
- `engram`/`both`: call
|
|
31
|
+
- `engram`/`both`: call the injected Engram save tool 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
32
|
- `openspec`: write/update the spec files under `openspec/changes/{change}/`.
|
|
25
33
|
- `none`: return the spec inline.
|
|
26
34
|
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-status
|
|
3
3
|
description: Show read-only structured SDD status for an active change.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- bash
|
|
9
|
+
- mem_search
|
|
10
|
+
- mem_get_observation
|
|
5
11
|
---
|
|
6
12
|
|
|
7
13
|
You are the SDD status executor for Gentle AI.
|
|
@@ -16,9 +22,10 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
16
22
|
|
|
17
23
|
## Memory Contract
|
|
18
24
|
|
|
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
|
|
25
|
+
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 files or call the injected Engram save tool.
|
|
26
|
+
|
|
27
|
+
Inputs to read (`engram`/`both`: use the injected Engram memory read tools for the topic key, then fetch the full observation; `openspec`: read the files under `openspec/changes/{change}/`):
|
|
20
28
|
|
|
21
|
-
Inputs to read (`engram`/`both`: `mem_search("<topic-key>")` then `mem_get_observation`; `openspec`: read the files under `openspec/changes/{change}/`):
|
|
22
29
|
- Whichever change artifacts are needed to compute status, named `sdd/{change}/<phase>` (proposal, spec, design, tasks, apply-progress, verify-report, sync-report).
|
|
23
30
|
|
|
24
31
|
Do not persist anything — status is a read-only report. Never claim persistence.
|
|
@@ -98,7 +105,7 @@ If parent context reports `workspace-planning` and no `allowedEditRoots`, mark a
|
|
|
98
105
|
- `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.
|
|
99
106
|
- `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.
|
|
100
107
|
|
|
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
|
|
108
|
+
**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 the Engram memory tools injected by the memory provider 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
109
|
|
|
103
110
|
## Output
|
|
104
111
|
|
|
@@ -1,7 +1,17 @@
|
|
|
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:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- write
|
|
9
|
+
- edit
|
|
10
|
+
- bash
|
|
11
|
+
- mem_search
|
|
12
|
+
- mem_get_observation
|
|
13
|
+
- mem_save
|
|
14
|
+
- mem_update
|
|
5
15
|
---
|
|
6
16
|
|
|
7
17
|
You are the SDD sync executor for Gentle AI.
|
|
@@ -16,11 +26,11 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
16
26
|
|
|
17
27
|
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
28
|
|
|
19
|
-
Inputs to read (`engram`/`both`:
|
|
29
|
+
Inputs to read (`engram`/`both`: use the injected Engram memory read tools for the topic key, then fetch the full observation; `openspec`: read the files under `openspec/changes/{change}/`):
|
|
20
30
|
- Core change artifacts: `sdd/{change}/proposal`, `sdd/{change}/spec`, `sdd/{change}/design`, `sdd/{change}/tasks`, and `sdd/{change}/verify-report`.
|
|
21
31
|
|
|
22
32
|
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
23
|
-
- `engram`/`both`: call
|
|
33
|
+
- `engram`/`both`: call the injected Engram save tool 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
34
|
- `openspec`: write/update the canonical specs and sync report under `openspec/`.
|
|
25
35
|
- `none`: return the sync report inline.
|
|
26
36
|
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd-tasks
|
|
3
3
|
description: Break SDD design/specs into implementation tasks with review workload forecast.
|
|
4
|
-
tools:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- write
|
|
9
|
+
- edit
|
|
10
|
+
- mem_search
|
|
11
|
+
- mem_get_observation
|
|
12
|
+
- mem_save
|
|
5
13
|
---
|
|
6
14
|
|
|
7
15
|
You are the SDD tasks executor for Gentle AI.
|
|
@@ -16,12 +24,12 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
16
24
|
|
|
17
25
|
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
26
|
|
|
19
|
-
Inputs to read (`engram`/`both`:
|
|
27
|
+
Inputs to read (`engram`/`both`: use the injected Engram memory read tools for the topic key, then fetch the full observation; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
20
28
|
- Spec (required): `sdd/{change}/spec`
|
|
21
29
|
- Design (required): `sdd/{change}/design`
|
|
22
30
|
|
|
23
31
|
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
24
|
-
- `engram`/`both`: call
|
|
32
|
+
- `engram`/`both`: call the injected Engram save tool 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
33
|
- `openspec`: write/update `openspec/changes/{change}/tasks.md`.
|
|
26
34
|
- `none`: return the tasks inline.
|
|
27
35
|
|
|
@@ -1,7 +1,16 @@
|
|
|
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:
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- glob
|
|
8
|
+
- bash
|
|
9
|
+
- write
|
|
10
|
+
- edit
|
|
11
|
+
- mem_search
|
|
12
|
+
- mem_get_observation
|
|
13
|
+
- mem_save
|
|
5
14
|
---
|
|
6
15
|
|
|
7
16
|
You are the SDD verify executor for Gentle AI.
|
|
@@ -16,13 +25,13 @@ If skill paths are missing, explicit fallback loading is allowed only as degrade
|
|
|
16
25
|
|
|
17
26
|
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
27
|
|
|
19
|
-
Inputs to read (`engram`/`both`:
|
|
28
|
+
Inputs to read (`engram`/`both`: use the injected Engram memory read tools for the topic key, then fetch the full observation; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
20
29
|
- Spec (required): `sdd/{change}/spec`
|
|
21
30
|
- Tasks (required): `sdd/{change}/tasks`
|
|
22
31
|
- Apply-progress (required): `sdd/{change}/apply-progress`
|
|
23
32
|
|
|
24
33
|
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
25
|
-
- `engram`/`both`: call
|
|
34
|
+
- `engram`/`both`: call the injected Engram save tool 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
35
|
- `openspec`: write/update `openspec/changes/{change}/verify-report.md`.
|
|
27
36
|
- `none`: return the verify report inline.
|
|
28
37
|
|
|
@@ -33,7 +42,7 @@ Never claim persistence you did not perform.
|
|
|
33
42
|
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.
|
|
34
43
|
|
|
35
44
|
**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
|
|
45
|
+
- `engram` (or `both` without openspec/): check Engram for `sdd/{change}/tasks` and `sdd/{change}/apply-progress` using the Engram memory tools injected by the memory provider. Proceed with verification once those artifacts are confirmed present.
|
|
37
46
|
- `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
47
|
|
|
39
48
|
Stop with `blocked` if:
|
package/assets/orchestrator.md
CHANGED
|
@@ -222,7 +222,7 @@ Rules:
|
|
|
222
222
|
- `sdd-apply`, `sdd-verify`, `sdd-sync`, and `sdd-archive` must obey parent-provided native status; they must not reconstruct readiness from prompt inference when status JSON is present.
|
|
223
223
|
- Do not launch a phase when native status marks that dependency `blocked`.
|
|
224
224
|
- `sdd-archive` cannot proceed unless native status says `dependencies.archive` is `ready` or `all_done` — UNLESS the store carve-out is active (`nextRecommended: "resolve-via-engram"`), in which case resolve archive readiness from Engram instead of treating `not_applicable` as a gate failure.
|
|
225
|
-
- **Non-authoritative store carve-out:** when `nextRecommended: "resolve-via-engram"` is set, native status is **not authoritative**. This applies to `artifactStore: engram`, `artifactStore: none`, and `artifactStore: both` when the `openspec/` directory does not exist. For non-authoritative stores: resolve readiness from Engram using
|
|
225
|
+
- **Non-authoritative store carve-out:** when `nextRecommended: "resolve-via-engram"` is set, native status is **not authoritative**. This applies to `artifactStore: engram`, `artifactStore: none`, and `artifactStore: both` when the `openspec/` directory does not exist. For non-authoritative stores: resolve readiness from Engram using the Engram memory tools injected by the memory provider on the change topic keys (`sdd/{change-name}/proposal`, `sdd/{change-name}/spec`, `sdd/{change-name}/design`, `sdd/{change-name}/tasks`, etc.). Do **not** treat `blockedReasons` or `not_applicable` dependency states from the native engine as real blockers when the store carve-out is active.
|
|
226
226
|
|
|
227
227
|
## SDD Status Contract
|
|
228
228
|
|
|
@@ -292,8 +292,8 @@ When Engram or another callable memory package is available, the parent owns con
|
|
|
292
292
|
|
|
293
293
|
### Non-SDD delegation
|
|
294
294
|
|
|
295
|
-
- Read context: the parent/orchestrator searches memory (
|
|
296
|
-
- Write context: the subagent MUST save significant discoveries, decisions, or bug fixes via
|
|
295
|
+
- Read context: the parent/orchestrator searches memory (the injected Engram search tool), selects relevant observations, and passes them into the subagent prompt. The subagent does NOT search memory itself.
|
|
296
|
+
- Write context: the subagent MUST save significant discoveries, decisions, or bug fixes via the injected Engram save tool before returning when memory tools are available.
|
|
297
297
|
- 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.`
|
|
298
298
|
|
|
299
299
|
### SDD phases
|
|
@@ -318,12 +318,12 @@ Each SDD phase subagent reads its own required inputs directly from the active b
|
|
|
318
318
|
|
|
319
319
|
Memory lifecycle rule (when Engram exposes lifecycle metadata/tooling):
|
|
320
320
|
|
|
321
|
-
- At session start or before architecture-sensitive work, call
|
|
322
|
-
- If
|
|
321
|
+
- At session start or before architecture-sensitive work, call the injected Engram review tool with action `list` for the current project when the tool is available.
|
|
322
|
+
- If the injected Engram review tool is unavailable, do not fail the task. Continue with the injected Engram context/search tools, and still apply lifecycle metadata from any returned observations when present.
|
|
323
323
|
- `active` memories may be used normally.
|
|
324
324
|
- `needs_review` memories are stale context, not trusted facts.
|
|
325
325
|
- When a retrieved memory is marked `needs_review`, surface that stale context to the user and verify it against current evidence before relying on it.
|
|
326
|
-
- Do NOT call
|
|
326
|
+
- Do NOT call the injected Engram review tool with action `mark_reviewed` automatically. Only call `mark_reviewed` after explicit user confirmation or through a dedicated memory maintenance command.
|
|
327
327
|
|
|
328
328
|
## Execution Mode
|
|
329
329
|
|
|
@@ -95,7 +95,7 @@ The orchestrator MUST carry `actionContext` into any phase launch.
|
|
|
95
95
|
## Engine Authority by Store
|
|
96
96
|
|
|
97
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
|
|
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 the Engram memory tools injected by the memory provider 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
99
|
|
|
100
100
|
## Status Output
|
|
101
101
|
|
package/extensions/gentle-ai.ts
CHANGED
|
@@ -43,7 +43,6 @@ import {
|
|
|
43
43
|
} from "../lib/sdd-status.ts";
|
|
44
44
|
import {
|
|
45
45
|
evaluateEvent,
|
|
46
|
-
matchPathGlobs,
|
|
47
46
|
type ChangedDiff,
|
|
48
47
|
type TriggerEvent,
|
|
49
48
|
} from "../lib/review-triggers.ts";
|
|
@@ -219,14 +218,6 @@ const DENIED_BASH_PATTERNS: RegExp[] = [
|
|
|
219
218
|
/\bchown\s+-R\b/,
|
|
220
219
|
];
|
|
221
220
|
|
|
222
|
-
const CONFIRM_BASH_PATTERNS: RegExp[] = [
|
|
223
|
-
/\bgit\s+push\b/,
|
|
224
|
-
/\bgit\s+rebase\b/,
|
|
225
|
-
/\bgit\s+branch\s+(?:-[a-zA-Z]*D[a-zA-Z]*|-[a-zA-Z]*d[a-zA-Z]*f[a-zA-Z]*|-[a-zA-Z]*f[a-zA-Z]*d[a-zA-Z]*|--delete\b[^\n]*--force\b|--force\b[^\n]*--delete\b)/,
|
|
226
|
-
/\bnpm\s+publish\b/,
|
|
227
|
-
/\bpi\s+remove\b/,
|
|
228
|
-
];
|
|
229
|
-
|
|
230
221
|
// ---------------------------------------------------------------------------
|
|
231
222
|
// Autonomous guard — runtime guardrails config
|
|
232
223
|
// ---------------------------------------------------------------------------
|
|
@@ -577,12 +568,7 @@ function hasWritableEngramTool(pi: ExtensionAPI): boolean {
|
|
|
577
568
|
: isRecord(tool) && typeof tool.name === "string"
|
|
578
569
|
? tool.name
|
|
579
570
|
: "";
|
|
580
|
-
return (
|
|
581
|
-
name === "mem_save" ||
|
|
582
|
-
name === "engram_mem_save" ||
|
|
583
|
-
name.endsWith(".mem_save") ||
|
|
584
|
-
name.endsWith(".engram_mem_save")
|
|
585
|
-
);
|
|
571
|
+
return name === "mem_save" || name.endsWith(".mem_save");
|
|
586
572
|
});
|
|
587
573
|
} catch {
|
|
588
574
|
return false;
|
|
@@ -1992,7 +1978,7 @@ function computeDiffForEvent(event: TriggerEvent, cwd: string): ChangedDiff | nu
|
|
|
1992
1978
|
const gitOpts = {
|
|
1993
1979
|
cwd,
|
|
1994
1980
|
encoding: "utf8" as const,
|
|
1995
|
-
stdio:
|
|
1981
|
+
stdio: "pipe" as const,
|
|
1996
1982
|
// Bound synchronous git calls so a slow/large repo cannot freeze the extension process.
|
|
1997
1983
|
// The existing outer try/catch returns null (fail-open) when this throws.
|
|
1998
1984
|
timeout: 2000,
|
package/lib/sdd-preflight.ts
CHANGED
|
@@ -229,12 +229,7 @@ function hasWritableEngramTool(pi: ExtensionAPI): boolean {
|
|
|
229
229
|
: isRecord(tool) && typeof tool.name === "string"
|
|
230
230
|
? tool.name
|
|
231
231
|
: "";
|
|
232
|
-
return (
|
|
233
|
-
name === "mem_save" ||
|
|
234
|
-
name === "engram_mem_save" ||
|
|
235
|
-
name.endsWith(".mem_save") ||
|
|
236
|
-
name.endsWith(".engram_mem_save")
|
|
237
|
-
);
|
|
232
|
+
return name === "mem_save" || name.endsWith(".mem_save");
|
|
238
233
|
});
|
|
239
234
|
} catch {
|
|
240
235
|
return false;
|
package/lib/sdd-status.ts
CHANGED
|
@@ -545,7 +545,7 @@ export function renderNativeSddPhasePrompt(status: SddStatus, phase?: SddPhase):
|
|
|
545
545
|
? `This status is non-authoritative (artifact store: ${status.artifactStore}). The orchestrator must resolve readiness from Engram instead.`
|
|
546
546
|
: "The parent/orchestrator resolved this status deterministically. Treat it as authoritative over prompt inference.";
|
|
547
547
|
const blockLine = isNonAuthoritative
|
|
548
|
-
? `Do not block phase work based on this status — resolve readiness from Engram using
|
|
548
|
+
? `Do not block phase work based on this status — resolve readiness from Engram using the injected Engram memory read tools on the change topic keys (sdd/{change}/proposal, sdd/{change}/spec, sdd/{change}/design, sdd/{change}/tasks, etc.) instead.`
|
|
549
549
|
: "Do not run phase work when this status marks the phase blocked; return the blockers instead.";
|
|
550
550
|
return [
|
|
551
551
|
"## Native SDD Status Engine",
|
|
@@ -567,7 +567,7 @@ export function renderSddDispatcherMarkdown(status: SddStatus): string {
|
|
|
567
567
|
? [
|
|
568
568
|
"### Non-authoritative store — resolve via Engram",
|
|
569
569
|
`This status is non-authoritative (artifact store: ${status.artifactStore}).`,
|
|
570
|
-
"Resolve readiness directly from Engram using
|
|
570
|
+
"Resolve readiness directly from Engram using the injected Engram memory read tools on the change topic keys:",
|
|
571
571
|
`- sdd/${status.changeName ?? "<change>"}/proposal`,
|
|
572
572
|
`- sdd/${status.changeName ?? "<change>"}/spec`,
|
|
573
573
|
`- sdd/${status.changeName ?? "<change>"}/design`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gentle-pi",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.9",
|
|
4
4
|
"description": "Turn Pi into el Gentleman: a senior-architect development harness with SDD/OpenSpec, subagents, strict TDD evidence, review guardrails, and skill discovery.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -89,19 +89,20 @@ test("orchestrator Memory Contract carries the Engram memory lifecycle rule", as
|
|
|
89
89
|
|
|
90
90
|
// Mirrors gentle-ai's engram-protocol/engram-convention lifecycle rule (PRs #842 + #844),
|
|
91
91
|
// in its final availability-gated form: agents must treat needs_review memories as stale,
|
|
92
|
-
//
|
|
92
|
+
// use the memory-provider-injected lifecycle tool when present, fall back safely when it is not,
|
|
93
|
+
// and never auto-mark reviewed.
|
|
93
94
|
for (const required of [
|
|
94
95
|
"when Engram exposes lifecycle metadata/tooling",
|
|
95
96
|
"At session start or before architecture-sensitive work",
|
|
96
|
-
"call
|
|
97
|
+
"call the injected Engram review tool with action `list`",
|
|
97
98
|
"for the current project when the tool is available",
|
|
98
|
-
"If
|
|
99
|
-
"Continue with
|
|
99
|
+
"If the injected Engram review tool is unavailable, do not fail the task",
|
|
100
|
+
"Continue with the injected Engram context/search tools",
|
|
100
101
|
"still apply lifecycle metadata from any returned observations when present",
|
|
101
102
|
"`active` memories may be used normally",
|
|
102
103
|
"`needs_review` memories are stale context, not trusted facts",
|
|
103
104
|
"verify it against current evidence before relying on it",
|
|
104
|
-
"Do NOT call
|
|
105
|
+
"Do NOT call the injected Engram review tool with action `mark_reviewed` automatically",
|
|
105
106
|
"Only call `mark_reviewed` after explicit user confirmation or through a dedicated memory maintenance command",
|
|
106
107
|
]) {
|
|
107
108
|
assert.ok(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import test from "node:test";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
@@ -60,6 +60,42 @@ test("package manifest installs pi-pretty through a wrapper without bundling nat
|
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
|
|
63
|
+
function readAgentFrontmatter(file: string): string {
|
|
64
|
+
const source = readFileSync(file, "utf8");
|
|
65
|
+
const match = source.match(/^---\n([\s\S]*?)\n---/);
|
|
66
|
+
assert.ok(match, `${file} must have frontmatter`);
|
|
67
|
+
return match[1];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
test("packaged agents use YAML list syntax for tool allowlists", () => {
|
|
71
|
+
const agentsDir = join(PACKAGE_ROOT, "assets", "agents");
|
|
72
|
+
const agentFiles = readdirSync(agentsDir).flatMap((entry) =>
|
|
73
|
+
entry.endsWith(".md") ? [join(agentsDir, entry)] : [],
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
assert.ok(agentFiles.length > 0, "gentle-pi must ship packaged agents");
|
|
77
|
+
|
|
78
|
+
for (const file of agentFiles) {
|
|
79
|
+
const frontmatter = readAgentFrontmatter(file);
|
|
80
|
+
assert.doesNotMatch(
|
|
81
|
+
frontmatter,
|
|
82
|
+
/^tools:\s*[^\n,]+(?:,\s*[^\n,]+)+$/m,
|
|
83
|
+
`${file} must not use comma-separated inline tools; pi-subagents expects a YAML list`,
|
|
84
|
+
);
|
|
85
|
+
assert.match(frontmatter, /^tools:\n(?: {2}- [\w-]+\n?)+/m, `${file} must declare tools as a YAML list`);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test("jd-fix-agent packaged allowlist includes write tools", () => {
|
|
90
|
+
const frontmatter = readAgentFrontmatter(
|
|
91
|
+
join(PACKAGE_ROOT, "assets", "agents", "jd-fix-agent.md"),
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
for (const tool of ["read", "edit", "write", "bash"]) {
|
|
95
|
+
assert.match(frontmatter, new RegExp(`^ - ${tool}$`, "m"));
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
63
99
|
test("pi-pretty wrapper uses real package path resolution for pnpm symlink installs", () => {
|
|
64
100
|
const wrapper = readFileSync(
|
|
65
101
|
join(PACKAGE_ROOT, "extensions", "pi-pretty.ts"),
|
|
@@ -637,6 +637,17 @@ async function run() {
|
|
|
637
637
|
await rm(engramSddCwd, { recursive: true, force: true });
|
|
638
638
|
}
|
|
639
639
|
|
|
640
|
+
const directEngramToolCwd = await tempWorkspace();
|
|
641
|
+
try {
|
|
642
|
+
pi.setActiveTools(["read", "bash", "edit", "write", "engram_mem_save"]);
|
|
643
|
+
const ctx = createCtx(directEngramToolCwd, true, "direct-engram-session");
|
|
644
|
+
await commands.get("gentle-ai:sdd-preflight").handler("", ctx);
|
|
645
|
+
assert.deepEqual(ctx.ui.selections[1].options, ["openspec"]);
|
|
646
|
+
} finally {
|
|
647
|
+
pi.setActiveTools(["read", "bash", "edit", "write"]);
|
|
648
|
+
await rm(directEngramToolCwd, { recursive: true, force: true });
|
|
649
|
+
}
|
|
650
|
+
|
|
640
651
|
const installCwd = await tempWorkspace();
|
|
641
652
|
try {
|
|
642
653
|
const ctx = createCtx(installCwd, true);
|
|
@@ -669,6 +680,9 @@ async function run() {
|
|
|
669
680
|
pi.setActiveTools([{ name: "engram.mem_save" }]);
|
|
670
681
|
await commands.get("gentle-ai:doctor").handler("", ctx);
|
|
671
682
|
assert.match(ctx.ui.notifications.at(-1).message, /Engram memory tools active/);
|
|
683
|
+
pi.setActiveTools([{ name: "engram_mem_save" }]);
|
|
684
|
+
await commands.get("gentle-ai:doctor").handler("", ctx);
|
|
685
|
+
assert.match(ctx.ui.notifications.at(-1).message, /Engram memory tools not active in this session/);
|
|
672
686
|
pi.setActiveTools(["read", "bash", "edit", "write"]);
|
|
673
687
|
} finally {
|
|
674
688
|
await rm(staleAssetsCwd, { recursive: true, force: true });
|