gentle-pi 0.4.1 → 0.4.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.
@@ -13,6 +13,19 @@ Use your assigned executor/phase skill for this SDD phase. For project/user skil
13
13
  If skill paths are missing, explicit fallback loading is allowed only as degraded self-healing. Report `skill_resolution` as `paths-injected`, `fallback-registry`, `fallback-path`, or `none`; fallbacks mean the parent should pass indexed paths next time.
14
14
 
15
15
  - Read exploration and project standards before writing.
16
+ - In interactive SDD mode, do not make the agent decide silently whether the proposal is "clear enough". Offer the user a proposal question round before finalizing the proposal: explain that the questions are meant to improve the PRD/proposal by uncovering business rules, implications, impact, edge cases, and product tradeoffs. Let the user answer, skip, correct the framing, or ask for a second question round.
17
+ - Proposal-shaping questions should uncover business/product/PRD understanding, not harness mechanics. Cover the smallest useful subset of:
18
+ 1. business problem: what pain, opportunity, user confusion, or operational cost makes this change worth doing now;
19
+ 2. target users and situations: who is affected, in which workflow, at what moment, and with what level of urgency;
20
+ 3. business rules: policies, permissions, thresholds, lifecycle rules, compliance/security expectations, or domain invariants the proposal must respect;
21
+ 4. product outcome: what should feel, work, or become possible after the change;
22
+ 5. current-state gap: what is wrong, inconsistent, missing, ad hoc, or hard to explain today;
23
+ 6. implications and impact: which teams, workflows, data, UX expectations, support burden, or operational processes may be affected;
24
+ 7. edge cases: empty states, partial data, failures, permissions, slow paths, unusual customers, migration states, or conflicting user needs;
25
+ 8. decision gaps: which product unknowns would make the proposal ambiguous, risky, or easy to overbuild;
26
+ 9. scope boundaries and non-goals: what belongs in the first product slice, what is later refinement, and what must stay unchanged even if related;
27
+ 10. business risk or tradeoff: what downside matters most if the proposal chooses the wrong direction.
28
+ - Prefer 3–5 concrete product questions per round. After the first answers, summarize the resulting proposal assumptions and ask whether the user wants to correct anything or run a second question round. Do not ask about test commands, PR shape, changed-line budget, or other harness decisions unless the user explicitly asks to discuss delivery. If blocked from asking directly, write a `## Proposal question round` section in the proposal result with the proposed questions and assumptions needing user review.
16
29
  - Write `openspec/changes/{change}/proposal.md`.
17
30
  - Include intent, scope, affected areas, risks, rollback, and success criteria.
18
31
  - Do NOT launch child subagents. Parent/orchestrator owns delegation.
@@ -1,8 +1,12 @@
1
1
  ---
2
2
  name: sdd-full
3
- description: Run the full SDD lifecycle for a change when explicitly approved.
3
+ description: Run the full SDD lifecycle for a change in auto mode or explicit full-lifecycle approval.
4
4
  ---
5
5
 
6
+ ## Interactive mode guard
7
+
8
+ This chain is a continuous lifecycle pipeline. Use it only in auto mode or explicit full-lifecycle approval. In interactive mode the parent/orchestrator must stop at each phase boundary, present the current artifact, and ask the user before continuing. Approval to start SDD is not approval of the generated proposal, specs, design, tasks, apply, verify, sync, or archive phases.
9
+
6
10
  ## sdd-init
7
11
 
8
12
  output: init.md
@@ -27,7 +31,7 @@ output: proposal.md
27
31
  outputMode: file-only
28
32
  progress: true
29
33
 
30
- Create or update the OpenSpec proposal for {task} using the exploration notes and the previous step output.
34
+ Create or update the OpenSpec proposal for {task} using the exploration notes and the previous step output. If this is an interactive SDD run and the parent has not already supplied proposal-shaping answers, surface the missing questions in the result so the parent can ask before treating the proposal as approved.
31
35
 
32
36
  ## sdd-spec
33
37
 
@@ -36,7 +40,7 @@ output: spec.md
36
40
  outputMode: file-only
37
41
  progress: true
38
42
 
39
- Write delta specs for {task} from the approved proposal. Preserve RFC 2119 requirements and Given/When/Then scenarios.
43
+ Write delta specs for {task} from the parent-approved proposal. Preserve RFC 2119 requirements and Given/When/Then scenarios. In interactive mode, do not treat chain execution alone as proposal approval.
40
44
 
41
45
  ## sdd-design
42
46
 
@@ -1,8 +1,12 @@
1
1
  ---
2
2
  name: sdd-plan
3
- description: Plan an SDD change through proposal, spec, design, and tasks.
3
+ description: Plan an SDD change through proposal, spec, design, and tasks; safe for auto mode or explicit all-planning approval.
4
4
  ---
5
5
 
6
+ ## Interactive mode guard
7
+
8
+ This chain is a continuous planning pipeline. Use it only in auto mode or explicit all-planning approval. In interactive mode the parent/orchestrator must stop after sdd-proposal, present the proposal, and ask the user before continuing to sdd-spec, sdd-design, and sdd-tasks.
9
+
6
10
  ## sdd-init
7
11
 
8
12
  output: init.md
@@ -18,7 +22,7 @@ output: proposal.md
18
22
  outputMode: file-only
19
23
  progress: true
20
24
 
21
- Create or update the OpenSpec proposal for {task}. Use prior exploration if it is available in the project artifacts.
25
+ Create or update the OpenSpec proposal for {task}. Use prior exploration if it is available in the project artifacts. If this is an interactive SDD run and the parent has not already supplied proposal-shaping answers, surface the missing questions in the result so the parent can ask before treating the proposal as approved.
22
26
 
23
27
  ## sdd-spec
24
28
 
@@ -249,6 +249,10 @@ In interactive mode, between phases:
249
249
  2. state next phase;
250
250
  3. ask whether to continue or adjust.
251
251
 
252
+ 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.
253
+
254
+ 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.
255
+
252
256
  ## Result Contract
253
257
 
254
258
  Every phase result should include:
@@ -235,6 +235,16 @@ export function renderSddPreflightPrompt(prefs: SddPreflightPreferences): string
235
235
  const sourceLine = prefs.prompted
236
236
  ? "The user already chose these SDD preferences for this Pi session. Reuse them unless the user explicitly changes them."
237
237
  : "No interactive UI was available for SDD preflight, so these default preferences were applied for this Pi session. Ask the user before making delivery decisions that depend on them.";
238
+ const interactiveRules =
239
+ prefs.executionMode === "interactive"
240
+ ? [
241
+ "- Interactive phase gate: complete only the current SDD phase. Do not start the next SDD phase unless the current user turn explicitly approves that next phase.",
242
+ "- In interactive mode, words like `continue`, `dale`, or `go on` approve only the immediate next phase, not all remaining phases.",
243
+ "- Before writing an SDD proposal in interactive mode, offer the user a proposal question round to improve the PRD/proposal by uncovering business rules, implications, impact, edge cases, product tradeoffs, and decision gaps. Prefer 3–5 concrete product questions per round, then summarize assumptions and ask whether the user wants corrections or a second question round. 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.",
244
+ ]
245
+ : [
246
+ "- Auto mode: phases may run back-to-back only because the user chose speed and trusts the flow.",
247
+ ];
238
248
  return [
239
249
  "## SDD Session Preflight",
240
250
  sourceLine,
@@ -242,6 +252,7 @@ export function renderSddPreflightPrompt(prefs: SddPreflightPreferences): string
242
252
  `- Artifact store: ${prefs.artifactStore}${prefs.engramAvailable ? "" : " (Engram unavailable in this session)"}`,
243
253
  `- Chained PR strategy: ${prefs.chainedPrStrategy}`,
244
254
  `- Review budget: ${prefs.reviewBudgetLines} changed lines`,
255
+ ...interactiveRules,
245
256
  "- If task/workload forecasts conflict with these preferences, pause before sdd-apply and ask the user for a delivery decision.",
246
257
  ].join("\n");
247
258
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gentle-pi",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
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",
@@ -73,11 +73,51 @@ test("rendered SDD preflight prompt is English artifact copy", () => {
73
73
 
74
74
  assert.match(prompt, /The user already chose these SDD preferences/);
75
75
  assert.match(prompt, /Review budget: 400 changed lines/);
76
+ assert.match(prompt, /complete only the current SDD phase/i);
77
+ assert.match(prompt, /Do not start the next SDD phase/i);
78
+ assert.match(prompt, /approve only the immediate next phase/i);
79
+ assert.match(prompt, /offer the user a proposal question round/i);
80
+ assert.match(prompt, /business rules, implications, impact, edge cases/i);
81
+ assert.match(prompt, /second question round/i);
76
82
  for (const pattern of SPANISH_PREFLIGHT_COPY) {
77
83
  assert.doesNotMatch(prompt, pattern);
78
84
  }
79
85
  });
80
86
 
87
+ test("SDD proposal questions focus on business and PRD gaps", async () => {
88
+ const proposalAgent = await readFile(join(ROOT, "assets/agents/sdd-proposal.md"), "utf8");
89
+
90
+ assert.match(proposalAgent, /offer the user a proposal question round/i);
91
+ assert.match(proposalAgent, /second question round/i);
92
+ assert.match(proposalAgent, /business problem/i);
93
+ assert.match(proposalAgent, /business rules/i);
94
+ assert.match(proposalAgent, /implications and impact/i);
95
+ assert.match(proposalAgent, /edge cases/i);
96
+ assert.match(proposalAgent, /target users/i);
97
+ assert.match(proposalAgent, /product outcome/i);
98
+ assert.match(proposalAgent, /decision gaps/i);
99
+ // Proposal-shaping questions must stay on business/product ground: the agent is
100
+ // explicitly told to keep harness mechanics out of the proposal question round
101
+ // unless the user opts into discussing delivery. Removing this guard is the most
102
+ // likely way harness mechanics would leak back into proposal questions.
103
+ assert.match(
104
+ proposalAgent,
105
+ /Do not ask about test commands, PR shape, changed-line budget, or other harness decisions unless the user explicitly asks to discuss delivery/i,
106
+ );
107
+ });
108
+
109
+ test("SDD chain assets distinguish interactive gates from auto execution", async () => {
110
+ const planChain = await readFile(join(ROOT, "assets/chains/sdd-plan.chain.md"), "utf8");
111
+ const fullChain = await readFile(join(ROOT, "assets/chains/sdd-full.chain.md"), "utf8");
112
+
113
+ assert.match(planChain, /auto mode or explicit all-planning approval/i);
114
+ assert.match(planChain, /interactive mode/i);
115
+ assert.match(planChain, /must stop after sdd-proposal/i);
116
+ assert.match(fullChain, /auto mode or explicit full-lifecycle approval/i);
117
+ assert.match(fullChain, /interactive mode/i);
118
+ assert.match(fullChain, /must stop at each phase boundary/i);
119
+ });
120
+
81
121
  test("persistent harness prompt assets do not hardcode Spanish SDD artifact copy", async () => {
82
122
  const files = [
83
123
  ...(await collectTextFiles(join(ROOT, "assets"))),