gsdd-cli 0.19.2 → 0.19.3

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.
@@ -54,7 +54,7 @@ Evidence map from each of the 10 canonical GSDD roles to their GSD sources, with
54
54
  - Explicit "Scope" table showing scope × trigger × focus × output location
55
55
  - Clear statement: "Same algorithm, different scope. The scope is a context input, not a different role."
56
56
 
57
- **Rationale:** The GSD original had two roles (project and phase researcher) that followed the identical algorithm but with a scope parameter. GSDD merged them into one canonical role taking scope as input, reducing the role count from 11 to 9 (later 10 with approach-explorer in D29) while preserving all leverage. This is the clean merger mentioned in D2.
57
+ **Rationale:** The GSD original had two roles (project and phase researcher) that followed the identical algorithm but with a scope parameter. GSDD merged them into one canonical role taking scope as input, reducing duplicate role contracts while preserving the current 10-role catalog. This is the clean merger mentioned in D2.
58
58
 
59
59
  ---
60
60
 
@@ -362,11 +362,23 @@ Cross-source best practices applied to GSDD role contracts, audited against 6 ex
362
362
 
363
363
  | Principle | What It Means | Source | GSDD Implementation |
364
364
  |-----------|--------------|--------|---------------------|
365
- | **Context isolation** | Research and heavy reads go in subagents; only compressed summaries enter the main context | Anthropic "Building effective agents" (Dec 2024): orchestrator-worker pattern — sub-agents do deep technical work and return condensed summaries | Approach explorer research subagents return ~1000-token summaries; plan-checker runs in fresh context |
365
+ | **Context isolation** | Research and heavy reads go in subagents; only compressed summaries enter the main context | Anthropic "Building effective agents" (Dec 2024): orchestrator-worker pattern — sub-agents do deep technical work and return condensed summaries | Approach explorer research subagents return 500-800 token agent-mediated summaries; plan-checker runs in fresh context |
366
366
  | **JIT context loading** | Never say "read everything." Specify what to extract from each file | LangChain "Context Engineering for Agents" (2025): Select step of Write/Select/Compress/Isolate — load only the specific content needed, not full files | `<input_contract>` with extraction guidance: "From SPEC.md read ONLY locked decisions" |
367
367
  | **Intermediate persistence** | For long interactions, write confirmed state to disk incrementally | Anthropic BEA: agent memory outside context window. LangChain CE: Write pattern — confirmed state persisted to disk | Approach explorer writes decisions to disk as they're confirmed during conversation |
368
368
  | **Progressive disclosure** | Don't front-load all context; let agents discover incrementally | LangChain CE: Compress/Isolate patterns — agents assemble understanding incrementally rather than loading everything upfront | Gray areas presented individually; research loaded per area on demand |
369
369
 
370
+ ### Subagent Return Tiers
371
+
372
+ Use the smallest return that preserves the downstream decision. Full documents stay on disk unless a role explicitly owns a durable artifact update.
373
+
374
+ | Tier | Use When | Return Size |
375
+ |------|----------|-------------|
376
+ | Routing summary | The orchestrator only needs a signal, category, or next-step recommendation | 100-200 tokens |
377
+ | Human-read summary | The user will read the summary directly to understand options or findings | 300-500 tokens |
378
+ | Agent-mediated discussion | The orchestrator must discuss findings with the user and answer follow-up questions without re-querying the subagent | 500-800 tokens |
379
+
380
+ This replaces the prior mixed guidance around sentence-count summaries, single-tier token budgets, and larger undifferentiated summaries. The deliberate boundary is conservative: subagents are useful for read-heavy or artifact-backed isolation, not for hidden implementation orchestration or overlapping writes without explicit write-set ownership.
381
+
370
382
  ### Prompt Structure (medium leverage)
371
383
 
372
384
  | Principle | What It Means | Source | GSDD Implementation |
@@ -381,7 +393,7 @@ Cross-source best practices applied to GSDD role contracts, audited against 6 ex
381
393
 
382
394
  | Principle | What It Means | Source | GSDD Implementation |
383
395
  |-----------|--------------|--------|---------------------|
384
- | **Authority language: intentional leverage** | Anthropic Claude warns "CRITICAL:" can overtrigger on newer models. GSDD decision: **keep CRITICAL: for mandatory initial-read** — a genuine compliance-critical instruction where skipping causes cascading failures. Emphasis markers work when rare and specific (signal-to-noise principle: one CRITICAL: in a role contract is a load-bearing gate; ten would be noise). Use normal language for algorithm steps, scope guidance, and quality rules. | Anthropic Claude prompting docs (overtriggering caution) + technical writing signal-to-noise principle. GSDD applies the caution selectively: only compliance-critical context gates use CRITICAL: | `CRITICAL: Mandatory initial read` kept in all 7 roles. `NEVER` kept for security (mapper secret protection). Normal language used for algorithm steps, scope guidance, and quality rules |
396
+ | **Authority language: intentional leverage** | Anthropic Claude warns "CRITICAL:" can overtrigger on newer models. GSDD decision: keep `CRITICAL:` only for compliance-critical context gates where skipping causes cascading failures. Emphasis markers work when rare and specific (signal-to-noise principle: one CRITICAL: in a role contract is a load-bearing gate; ten would be noise). Use normal language for algorithm steps, scope guidance, and quality rules. | Anthropic Claude prompting docs (overtriggering caution) + technical writing signal-to-noise principle. GSDD applies the caution selectively: only compliance-critical context gates use CRITICAL: | Most roles keep `CRITICAL: Mandatory initial read`; executor now uses `CRITICAL: Tiered context intake` so mandatory-now, task-scoped, reference-only, and conditional reads replace blanket preload. `NEVER` kept for security (mapper secret protection). Normal language used for algorithm steps, scope guidance, and quality rules |
385
397
  | **Tell what to do, not just what not to do** | Anti-patterns alone are insufficient; pair with positive instructions | Anthropic Claude: "Tell Claude what to do instead of what not to do" | Every role has both `<anti_patterns>` AND positive algorithm/process sections |
386
398
  | **Context for instructions** | Explain WHY a rule exists so the agent can generalize | Anthropic Claude: "Providing context or motivation behind your instructions helps Claude better understand your goals" | Research quality rules explain WHY: "Training data is a hypothesis. Verify before asserting." |
387
399
 
@@ -417,5 +429,5 @@ When sources conflict, these resolutions apply:
417
429
  |----------|------------|-----|
418
430
  | Authority language ("YOU MUST" vs. normal) | Keep CRITICAL: for mandatory initial-read (compliance-critical). Use normal language elsewhere | Emphasis markers work when rare and specific (signal-to-noise). Anthropic's overtriggering concern applies to general guidance; a single CRITICAL: for a mandatory context gate is a load-bearing instruction, not noise |
419
431
  | Example count (2 vs. 3-5) | Target 3+ for conversational agents; inline format examples are sufficient for structured output agents | Anthropic's 3-5 recommendation is general; interactive roles benefit more than output-only roles |
420
- | Subagent return size (200 vs. 1000-2000 tokens) | Use 300-500 tokens | Anthropic's 1000-2000 is upper bound; 200 was too tight for structured approach summaries with trade-offs |
432
+ | Subagent return size (200 vs. 1000-2000 tokens) | Use the three-tier return model: 100-200 for routing, 300-500 for human-read summaries, and 500-800 for agent-mediated discussion | Anthropic's 1000-2000 is an upper bound; 200 is too tight for structured approach summaries with trade-offs, while returning full raw research defeats context isolation |
421
433
  | "Don't invent alternatives" vs. "try fallback strategies" | Keep "don't invent" for approach research; use fallbacks for information retrieval | These solve different problems: manufacturing fake options is worse than acknowledging one viable path |
package/agents/README.md CHANGED
@@ -11,8 +11,20 @@ Vendor-agnostic role contracts for Workspine's agent architecture.
11
11
 
12
12
  Roles define what an agent is. Delegates define what an agent does in a specific workflow context.
13
13
 
14
+ ## Deliberate Subagent Boundary
15
+
16
+ Workspine uses subagents when isolation earns its cost: research, review, mapping, synthesis, and integration checks may run as read-only or artifact-backed delegation, with summaries returned to the orchestrator and full detail written to disk when detail is needed later.
17
+
18
+ Subagents must not become hidden implementation orchestration. Implementation remains plan-scoped and write-set constrained; overlapping implementation writes require explicit write-set ownership in the approved plan before any parallelism is safe.
19
+
20
+ Roadmapper is intentionally role-only/direct invocation in the current catalog. There is no roadmapper delegate because roadmap creation is sequential, coverage-sensitive, and writes `.planning/ROADMAP.md`; a future delegate would need a proven thin-wrapper use case before it is added.
21
+
22
+ Leverage record: lost flexibility to add delegates by symmetry; kept the two-layer role/delegate architecture and summaries-up/documents-to-disk model; gained a conservative boundary that prevents subagents from implying agent teams, parallel PR orchestration, or runtime parity claims.
23
+
14
24
  ## Lifecycle Roles
15
25
 
26
+ The catalog contains 10 canonical roles across lifecycle, audit, and utility responsibilities.
27
+
16
28
  | Role | File | Absorbs From (GSD) |
17
29
  |------|------|---------------------|
18
30
  | Mapper | `mapper.md` | `gsd-codebase-mapper.md` |
@@ -90,7 +90,7 @@ Generate 3-4 **phase-specific** gray areas. Not generic categories — concrete
90
90
 
91
91
  ## Step 3: Research Approaches (Technical and Hybrid Only)
92
92
 
93
- For each technical or hybrid gray area, research 2-3 viable approaches.
93
+ For each technical or hybrid gray area, use a read-only research subagent when isolation earns its cost, then research 2-3 viable approaches.
94
94
 
95
95
  **Source hierarchy:**
96
96
  1. Existing codebase — what patterns are already established?
@@ -311,7 +311,7 @@ Ready for assumptions?"
311
311
 
312
312
  <research_subagent_prompt>
313
313
 
314
- When the orchestrator spawns a read-only research subagent for a technical or hybrid gray area, use this prompt template. Substitute the bracketed values. One subagent is spawned per gray area.
314
+ When the orchestrator spawns a read-only research subagent for a technical or hybrid gray area, use this prompt template. Substitute the bracketed values. One subagent is spawned per gray area and returns an agent-mediated discussion summary, not raw notes.
315
315
 
316
316
  ```
317
317
  You are a research subagent for approach exploration. Your job: investigate viable approaches for ONE gray area and return a compressed structured summary. You do NOT interact with the user — read, search, and return findings only.
@@ -341,9 +341,9 @@ Training data is a hypothesis. Verify before asserting. Do NOT recommend a libra
341
341
  - Do NOT recommend deprecated or unmaintained libraries
342
342
  - Do NOT present "roll your own" as an approach unless existing libraries genuinely fail to solve the problem
343
343
  - Do NOT include approaches you cannot source
344
- - Do NOT exceed 1000 tokens in your response
344
+ - Do NOT exceed 800 tokens in your response
345
345
 
346
- ## Output Format (under 1000 tokens)
346
+ ## Output Format (500-800 tokens)
347
347
 
348
348
  For each of 2-3 viable approaches:
349
349
  - **Name**
@@ -5,7 +5,7 @@
5
5
  <role>
6
6
  You are an integration checker. You verify that phases work together as a system, not just individually.
7
7
 
8
- Your job: check cross-phase wiring, API coverage, auth protection, and end-to-end user flows. Return a structured report to the milestone auditor.
8
+ Your job: check cross-phase wiring, API coverage, auth protection, and end-to-end user flows. This is read-only verification: inspect artifacts and code, return a structured report to the milestone auditor, and do not write implementation changes.
9
9
 
10
10
  CRITICAL: Mandatory initial read
11
11
 
@@ -283,7 +283,7 @@ The integration checker is milestone-scoped:
283
283
  - maps each milestone requirement to its integration path
284
284
  - does NOT verify single-phase goal completion; that is the verifier's job
285
285
  - does NOT run the application or execute tests; this is static analysis
286
- - does NOT write output to disk; it returns a structured report to the milestone auditor
286
+ - does NOT write output to disk or mutate source files; it is a read-only subagent-style check that returns a structured report to the milestone auditor
287
287
  </scope_boundary>
288
288
 
289
289
  <anti_patterns>
package/agents/mapper.md CHANGED
@@ -19,7 +19,7 @@ Accountable for producing accurate, file-path-rich analysis of an existing codeb
19
19
  - `arch` -> ARCHITECTURE.md
20
20
  - `quality` -> CONVENTIONS.md
21
21
  - `concerns` -> CONCERNS.md
22
- - **Return:** Brief confirmation (document names + line counts). NOT document contents -- the point is reducing context transfer to the orchestrator.
22
+ - **Return:** Routing summary only (100-200 tokens: document names, line counts, and the highest-signal flags). NOT document contents -- the point is reducing context transfer to the orchestrator while the full artifacts stay on disk.
23
23
 
24
24
  ## Downstream Consumers
25
25
 
@@ -39,7 +39,7 @@ This means: file paths are critical (planner needs to navigate directly), patter
39
39
  2. **Explore the codebase** thoroughly for the assigned focus area. Use file listing, content search, and targeted file reads. Read actual code -- do not guess.
40
40
  3. **Fill the document template** with findings. Replace all placeholders with real data. Use "Not detected" for genuinely absent items.
41
41
  4. **Write document(s)** to the designated output directory.
42
- 5. **Return confirmation only** -- document names and line counts. Do not echo contents back.
42
+ 5. **Return summary only** -- document names, line counts, and highest-signal flags. Do not echo contents back.
43
43
 
44
44
  ## Focus Area Guidance
45
45
 
package/agents/planner.md CHANGED
@@ -10,6 +10,7 @@ Your job:
10
10
  - decompose the phase into dependency-aware plans and waves
11
11
  - derive must-haves from the phase goal
12
12
  - return structured planning output instead of prose-only recommendations
13
+ - use research or checker subagents only for read-only or fresh-context review; do not plan hidden implementation orchestration
13
14
 
14
15
  CRITICAL: Mandatory initial read — if the prompt contains a `<files_to_read>` block, read every file listed there before doing any other work. That is your primary context.
15
16
  </role>
@@ -176,6 +177,7 @@ Wave 3: C
176
177
  Wave rule:
177
178
  - if a task's verify step depends on a test file or artifact, an earlier wave must create it
178
179
  - if two tasks touch the same critical file or one task's output is another task's input, they are not parallel
180
+ - parallel implementation is allowed only when the approved plan names explicit, disjoint write-set ownership
179
181
  </dependency_graph_example>
180
182
 
181
183
  <output>
@@ -26,7 +26,7 @@ Same algorithm, different scope. The scope is a context input, not a different r
26
26
 
27
27
  - **Artifacts (project scope):** STACK.md, FEATURES.md, ARCHITECTURE.md, PITFALLS.md (+ COMPARISON.md or FEASIBILITY.md if applicable mode)
28
28
  - **Artifacts (phase scope):** Single RESEARCH.md with sections: Standard Stack, Architecture Patterns, Don't Hand-Roll, Common Pitfalls, Code Examples
29
- - **Return:** Structured summary with key findings, confidence assessment, and open questions
29
+ - **Return:** Human-read structured summary (300-500 tokens) with key findings, confidence assessment, and open questions. Do not return raw research; full detail belongs in the written artifact.
30
30
 
31
31
  ## Core Algorithm
32
32
 
@@ -43,7 +43,7 @@ Same algorithm, different scope. The scope is a context input, not a different r
43
43
  - Single unverified source -> LOW confidence, flag for validation
44
44
  5. **Run quality checklist:** All domains investigated? Negative claims verified with official docs? Multiple sources for critical claims? Confidence levels assigned honestly?
45
45
  6. **Write output files** to the designated directory.
46
- 7. **Return structured result** to orchestrator. Do not commit -- orchestrator handles git.
46
+ 7. **Return structured summary** to orchestrator. Do not return raw research and do not commit -- orchestrator handles git.
47
47
 
48
48
  ## Quality Guarantees
49
49
 
@@ -5,6 +5,8 @@
5
5
  <role>
6
6
  You are a roadmapper. You turn requirements into a phased delivery plan that downstream planners can execute without guessing.
7
7
 
8
+ Roadmapper is role-only/direct invocation in the current Workspine contract, not a delegate. Roadmap creation is sequential, coverage-sensitive, and owns `.planning/ROADMAP.md`; do not route it through a hidden subagent wrapper unless a future plan explicitly adds that delegate.
9
+
8
10
  Your job:
9
11
  - derive phases from requirements instead of imposing a template
10
12
  - map every in-scope requirement to exactly one phase
@@ -292,5 +294,5 @@ If a section does not improve requirement coverage, dependency order, or observa
292
294
  ## Vendor Hints
293
295
 
294
296
  - **Tools required:** file read, file write, content search
295
- - **Parallelizable:** No - roadmapping is sequential and coverage-sensitive
297
+ - **Parallelizable:** No - roadmapping is sequential, coverage-sensitive, and writes `.planning/ROADMAP.md` directly
296
298
  - **Context budget:** Moderate - the reasoning work is heavier than the I/O
@@ -9,7 +9,7 @@ Your job:
9
9
  - read the full research outputs
10
10
  - extract the most decision-relevant findings
11
11
  - cross-reference them into roadmap implications
12
- - return a structured handoff the roadmapper can use directly
12
+ - return an agent-mediated structured summary the roadmapper can use directly
13
13
 
14
14
  CRITICAL: Mandatory initial read
15
15
 
@@ -75,7 +75,7 @@ Assign confidence by area based on source quality and identify any unresolved ga
75
75
 
76
76
  ## Step 6: Write the summary and return a structured handoff
77
77
 
78
- Write `.planning/research/SUMMARY.md`. Return a short structured summary to the orchestrator.
78
+ Write `.planning/research/SUMMARY.md`. Return a 500-800 token structured summary to the orchestrator so downstream discussion can preserve recommendation reasoning without returning the full document.
79
79
  </execution_flow>
80
80
 
81
81
  <cross_reference_dimensions>
@@ -274,7 +274,7 @@ export function readBrownfieldChangeState(planningDir) {
274
274
  handoffPath,
275
275
  title: extractMarkdownHeading(changeArtifact.body),
276
276
  changeId: changeArtifact.frontmatter.change || null,
277
- currentStatus: changeArtifact.frontmatter.status || extractBulletLabel(currentStatusSection, 'Current posture'),
277
+ currentStatus: extractBulletLabel(currentStatusSection, 'Current posture') || changeArtifact.frontmatter.status || null,
278
278
  currentIntegrationSurface: extractBulletLabel(currentStatusSection, 'Current branch / integration surface'),
279
279
  currentOwnerRuntime: extractBulletLabel(currentStatusSection, 'Current owner / runtime'),
280
280
  nextAction: collapseMarkdownSection(nextActionSection),
@@ -71,6 +71,7 @@
71
71
  58. [Local Workflow Helper Launcher](#d58---local-workflow-helper-launcher)
72
72
  59. [Continuity Authority And Planning-State Drift](#d59---continuity-authority-and-planning-state-drift)
73
73
  60. [Release Closeout Contract](#d60---release-closeout-contract)
74
+ 61. [Deliberate Subagent Contract](#d61---deliberate-subagent-contract)
74
75
 
75
76
  ---
76
77
 
@@ -285,11 +286,11 @@ This hardening pass also clarified a reusable architectural rule: strict portabl
285
286
 
286
287
  | researchDepth | Synthesizer behavior |
287
288
  | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
288
- | `fast` | Orchestrator writes SUMMARY.md inline from the 4 x 3-5 sentence summaries it holds in context. No delegate spawned. |
289
+ | `fast` | Orchestrator writes SUMMARY.md inline from the 4 human-read structured summaries it holds in context. No delegate spawned. |
289
290
  | `balanced` | ResearchSynthesizer delegate spawned. Reads 4 full research files. Cross-references build order constraints, pitfall-to-phase mappings, feature-architecture conflicts that short summaries omit. |
290
291
  | `deep` | Same as balanced but researchers produce longer output (more material for synthesizer to cross-reference). |
291
292
 
292
- **Why conditional:** The synthesizer's value is in cross-referencing specific data across research dimensions. When `researchDepth=fast`, researchers produce 3-5 sentence summaries only -- there's nothing substantive to cross-reference. Spawning a synthesizer to reformat 4 short paragraphs wastes a context window and an agent hop.
293
+ **Why conditional:** The synthesizer's value is in cross-referencing specific data across research dimensions. When `researchDepth=fast`, researchers return compact summaries and the full research files remain available on disk; spawning a synthesizer to reformat shallow inputs wastes a context window and an agent hop.
293
294
 
294
295
  **Evidence:**
295
296
 
@@ -442,7 +443,7 @@ Codex CLI is skills-first because the terminal CLI supports repository skills di
442
443
 
443
444
  **GSDD:** Makes this explicit as a design rule.
444
445
 
445
- **The rule:** Delegates write full documents to disk. They return 3-5 sentence summaries to the orchestrator. The orchestrator never receives document contents in its conversation context.
446
+ **The rule:** Delegates write full documents to disk. They return bounded summaries to the orchestrator: routing summaries use 100-200 tokens, human-read summaries use 300-500 tokens, and agent-mediated discussion summaries use 500-800 tokens. The orchestrator never receives document contents in its conversation context.
446
447
 
447
448
  **Why this matters:**
448
449
 
@@ -452,7 +453,7 @@ Codex CLI is skills-first because the terminal CLI supports repository skills di
452
453
 
453
454
  **Implementation:**
454
455
 
455
- - Each delegate's instructions end with: "Return a 3-5 sentence summary of key findings. Do NOT return the full document contents."
456
+ - Each delegate's instructions identify the correct summary tier and keep full document contents on disk instead of echoing them into orchestrator context.
456
457
  - Output templates in `.planning/templates/research/` and `.planning/templates/codebase/` define the on-disk format.
457
458
  - The synthesizer reads all 4 research files from disk -- it is the only agent that sees full research content.
458
459
 
@@ -1356,7 +1357,7 @@ Combined, these three workflows provided genuine leverage: the planner could not
1356
1357
 
1357
1358
  **GSDD decision:** Recover the discuss-phase leverage as a single role (`agents/approach-explorer.md`) embedded in the plan workflow, with a hybrid interaction architecture:
1358
1359
 
1359
- 1. **Primary path (inline + research subagents):** Conversation runs in the plan workflow's main context (required for user interactivity). For each technical gray area, a read-only research subagent spawns, reads codebase/docs, and returns a compressed ~1000-token structured summary. Only summaries enter the conversation context, not raw file reads.
1360
+ 1. **Primary path (inline + research subagents):** Conversation runs in the plan workflow's main context (required for user interactivity). For each technical gray area, a read-only research subagent spawns, reads codebase/docs, and returns a compressed 500-800 token structured summary. Only summaries enter the conversation context, not raw file reads.
1360
1361
 
1361
1362
  2. **Native agent optimization:** Runtimes with interactive subagent support (Claude Code with `AskUserQuestion`, Codex interactive agents, OpenCode `mode: agent`) can run the full exploration as a native agent. Falls back to the inline primary path if unavailable.
1362
1363
 
@@ -1389,7 +1390,7 @@ The approach explorer needs two capabilities with opposite context requirements:
1389
1390
  - **Conversation** needs the main context (for user interaction)
1390
1391
  - **Research** generates thousands of tokens of raw content the conversation doesn't need
1391
1392
 
1392
- Isolating research in subagents and returning compressed summaries follows the Compress and Isolate patterns from context engineering literature. The research subagent prompt template lives in the role contract (`<research_subagent_prompt>` section of `agents/approach-explorer.md`) — co-located with the algorithm it serves, and referenced by the portable workflow rather than inlined. The main context budget stays manageable: ~1000 tokens orchestration + ~4000 tokens research summaries (4 areas × ~1000) + ~4000 tokens conversation + ~500 tokens APPROACH.md = ~9500 tokens. The 1000-token budget (matching Anthropic CE's recommended floor) gives research subagents room for the structured format (Name/Pro/Con/Source) plus recommendation reasoning, source verification, and enough project-specific context that the main agent can handle follow-up questions without re-querying the subagent.
1393
+ Isolating research in subagents and returning compressed summaries follows the Compress and Isolate patterns from context engineering literature. The research subagent prompt template lives in the role contract (`<research_subagent_prompt>` section of `agents/approach-explorer.md`) — co-located with the algorithm it serves, and referenced by the portable workflow rather than inlined. The main context budget stays manageable: about 1000 tokens orchestration, up to 3200 tokens research summaries (4 areas x 800), about 4000 tokens conversation, and about 500 tokens APPROACH.md. The 500-800 token agent-mediated discussion tier gives research subagents room for the structured format (Name/Pro/Con/Source) plus recommendation reasoning, source verification, and enough project-specific context that the main agent can handle follow-up questions without re-querying the subagent.
1393
1394
 
1394
1395
  **Evidence:**
1395
1396
 
@@ -2776,6 +2777,42 @@ Posture compatibility is part of that closeout contract: `repo_closeout` and `ru
2776
2777
  - `complete-milestone` now fails closed before archive writes when the passed audit omits or contradicts the release claim contract.
2777
2778
  - Public claims are scoped to tracked public or repo-visible proof, while GitHub Releases, tags, package publication, and release automation remain deferred until explicitly planned.
2778
2779
 
2780
+ ## D61 - Deliberate Subagent Contract
2781
+
2782
+ **Decision (2026-04-28):** Subagents are deliberate isolation tools, not hidden implementation orchestration. Workspine should use them for research, review, mapping, synthesis, and integration checking when the work is read-only or artifact-backed, while implementation remains sequential unless an approved plan explicitly owns disjoint write sets.
2783
+
2784
+ **Context:**
2785
+ - Phase 50 found that existing subagent wording was over-strong in some planning and role surfaces while summary-size guidance had drifted across 3-5 sentence, 300-500 token, and 1000-token variants.
2786
+ - Phase 46 research supported parallel agents for breadth-first research, but warned that coding writes need stronger coordination before parallel PR or multi-worktree orchestration is safe.
2787
+ - Phase 53 approach alignment confirmed the conservative boundary: allow read-heavy and artifact-backed delegation, forbid hidden implementation orchestration, keep roadmapper role-only/direct invocation, and do not claim broad S3/S5 closure or native runtime parity.
2788
+
2789
+ **Decision:**
2790
+ - Allowed subagent use: research, review, mapping, synthesis, and integration checks when they are read-only or when the subagent writes/updates its own bounded durable artifact.
2791
+ - Return discipline: routing summaries use 100-200 tokens, human-read summaries use 300-500 tokens, agent-mediated discussion summaries use 500-800 tokens, and full details live in durable documents on disk.
2792
+ - Forbidden by default: hidden implementation orchestration, agent teams, parallel PR flows, multi-worktree coding, and overlapping implementation writes without explicit write-set ownership in the approved plan.
2793
+ - Roadmapper remains role-only/direct invocation in Phase 53. Roadmap creation is sequential and coverage-sensitive, writes `.planning/ROADMAP.md`, and does not yet have a proven thin-wrapper delegate use case.
2794
+ - S3 and S5 remain deferred. This decision narrows the practical Workspine subagent contract but does not close broad subagent orchestration parity or adapter research gaps.
2795
+
2796
+ **Leverage:**
2797
+ - Lost: less flexibility for future agents to add delegates by symmetry or treat missing delegates as accidental gaps.
2798
+ - Kept: the two-layer role/delegate architecture, summaries-up/documents-to-disk, repo-native workflow state, lifecycle preflight, and write-set constraints.
2799
+ - Gained: a durable conservative rule that tells agents when subagents earn their keep and when they create hidden orchestration risk.
2800
+
2801
+ **Evidence:**
2802
+ - `agents/README.md`
2803
+ - `agents/DISTILLATION.md`
2804
+ - `distilled/templates/delegates/`
2805
+ - `distilled/workflows/map-codebase.md`
2806
+ - `distilled/workflows/new-project.md`
2807
+ - GSD comparison source: `get-shit-done/workflows/new-project.md` and mapper/research workflows use `Task()` subagents heavily, but GSDD keeps the portable core single-agent-safe and only preserves subagent use where isolation, artifact persistence, or fresh-context review pays for the complexity.
2808
+
2809
+ **Consequences:**
2810
+ - Future role, delegate, and workflow wording must distinguish read-only/artifact-backed delegation from implementation write ownership.
2811
+ - A roadmapper delegate must not appear by symmetry; it needs a future explicit design decision and regression updates.
2812
+ - Generated runtime freshness may propagate this wording, but generated freshness is not runtime parity proof.
2813
+
2814
+ ---
2815
+
2779
2816
  ## Maintenance
2780
2817
 
2781
2818
  This document is updated when:
@@ -478,6 +478,13 @@
478
478
  - `distilled/DESIGN.md` D50 and D59
479
479
  - `tests/phase.test.cjs`, `tests/gsdd.guards.test.cjs`, `tests/gsdd.scenarios.test.cjs`
480
480
 
481
+ ## D61 — Deliberate Subagent Contract
482
+ - `agents/README.md`, `agents/DISTILLATION.md`, `agents/approach-explorer.md`, `agents/planner.md`, `agents/roadmapper.md`
483
+ - `distilled/templates/delegates/approach-explorer.md`, `distilled/templates/delegates/plan-checker.md`
484
+ - `distilled/workflows/audit-milestone.md`, `distilled/workflows/map-codebase.md`, `distilled/workflows/new-project.md`, `distilled/workflows/plan.md`
485
+ - GSD comparison source: `get-shit-done/workflows/new-project.md`
486
+ - `tests/gsdd.guards.test.cjs`, `tests/gsdd.invariants.test.cjs`
487
+
481
488
  ---
482
489
 
483
490
  ## Maintenance
@@ -25,4 +25,4 @@ Classify each gray area before acting on it:
25
25
 
26
26
  Write `{padded_phase}-APPROACH.md` to the phase directory using the approach template.
27
27
 
28
- Return structured summary: gray areas explored, decisions captured, assumptions validated/corrected, deferred ideas, path to APPROACH.md.
28
+ Return only a structured summary: gray areas explored, decisions captured, assumptions validated/corrected, deferred ideas, and path to APPROACH.md. Full decision detail belongs in the APPROACH.md artifact, not in the orchestrator context.
@@ -22,5 +22,5 @@ Include:
22
22
  </quality_gate>
23
23
 
24
24
  Write to: `.planning/codebase/ARCHITECTURE.md`
25
- Return: 3-5 sentence summary to the Orchestrator when done.
25
+ Return: Routing summary to the Orchestrator (100-200 tokens) when done.
26
26
  Guardrails: Max Agent Hops = 3. No static directory dumps.
@@ -23,5 +23,5 @@ Include:
23
23
  </quality_gate>
24
24
 
25
25
  Write to: `.planning/codebase/CONCERNS.md`
26
- Return: 3-5 sentence summary to the Orchestrator when done. If secrets found, STOP and report immediately.
26
+ Return: Routing summary to the Orchestrator (100-200 tokens) when done. If secrets found, STOP and report immediately.
27
27
  Guardrails: Max Agent Hops = 3. Hard stop on secrets.
@@ -24,5 +24,5 @@ Include:
24
24
  </quality_gate>
25
25
 
26
26
  Write to: `.planning/codebase/CONVENTIONS.md`
27
- Return: 3-5 sentence summary to the Orchestrator when done.
27
+ Return: Routing summary to the Orchestrator (100-200 tokens) when done.
28
28
  Guardrails: Max Agent Hops = 3. Rules not inventories.
@@ -21,5 +21,5 @@ Include:
21
21
  </quality_gate>
22
22
 
23
23
  Write to: `.planning/codebase/STACK.md`
24
- Return: 3-5 sentence summary to the Orchestrator when done.
24
+ Return: Routing summary to the Orchestrator (100-200 tokens) when done.
25
25
  Guardrails: Max Agent Hops = 3. No static dependency dumps.
@@ -1,6 +1,6 @@
1
1
  **Role contract:** Read `.planning/templates/roles/planner.md` before starting. Reuse its planning vocabulary and quality standards, but this wrapper overrides your objective: you are reviewing plans, not authoring them.
2
2
 
3
- You are the fresh-context plan checker for `/gsdd-plan`.
3
+ You are the fresh-context plan checker for `/gsdd-plan`. This is a read-only review delegate: return the JSON finding summary only, and do not edit plan artifacts yourself.
4
4
 
5
5
  Read only the explicit inputs provided by the orchestrator:
6
6
  - target phase goal and requirement IDs
@@ -45,7 +45,7 @@ Verify these dimensions:
45
45
  - **Deferred excluded?** Deferred ideas from APPROACH.md must not appear in plan tasks -> `blocker` if found.
46
46
  - If `workflow.discuss` is `true` in the project config and no APPROACH.md was provided, emit a `blocker` on `approach_alignment` with `description: 'workflow.discuss is true but no APPROACH.md was provided'` and `fix_hint: 'Run approach exploration before planning — workflow.discuss=true requires an approved APPROACH.md before a plan can be emitted.'` If `workflow.discuss` is `false` or the key is absent and no APPROACH.md was provided, skip this dimension entirely.
47
47
 
48
- Return JSON only as a single object with this shape:
48
+ Return JSON only as a single finding summary object with this shape:
49
49
 
50
50
  ```json
51
51
  {
@@ -26,5 +26,5 @@ Your output informs phase structure in ROADMAP.md. Include:
26
26
 
27
27
  Write to: `.planning/research/ARCHITECTURE.md`
28
28
  Use template: `.planning/templates/research/architecture.md` (if it exists)
29
- Return: 3-5 sentence summary of key findings to the Orchestrator when done.
29
+ Return: Human-read structured summary to the Orchestrator (300-500 tokens) when done.
30
30
  Guardrails: Max Agent Hops = 3.
@@ -26,5 +26,5 @@ Your output feeds SPEC requirements. Categorize explicitly:
26
26
 
27
27
  Write to: `.planning/research/FEATURES.md`
28
28
  Use template: `.planning/templates/research/features.md` (if it exists)
29
- Return: 3-5 sentence summary of key findings to the Orchestrator when done.
29
+ Return: Human-read structured summary to the Orchestrator (300-500 tokens) when done.
30
30
  Guardrails: Max Agent Hops = 3.
@@ -26,5 +26,5 @@ Your output prevents mistakes in roadmap and planning. For each pitfall:
26
26
 
27
27
  Write to: `.planning/research/PITFALLS.md`
28
28
  Use template: `.planning/templates/research/pitfalls.md` (if it exists)
29
- Return: 3-5 sentence summary of key findings to the Orchestrator when done.
29
+ Return: Human-read structured summary to the Orchestrator (300-500 tokens) when done.
30
30
  Guardrails: Max Agent Hops = 3.
@@ -26,5 +26,5 @@ Your output feeds the roadmapper. Be prescriptive:
26
26
 
27
27
  Write to: `.planning/research/STACK.md`
28
28
  Use template: `.planning/templates/research/stack.md` (if it exists)
29
- Return: 3-5 sentence summary of key findings to the Orchestrator when done.
29
+ Return: Human-read structured summary to the Orchestrator (300-500 tokens) when done.
30
30
  Guardrails: Max Agent Hops = 3.
@@ -11,7 +11,7 @@ Read these files (all should exist):
11
11
  Cross-reference them. Surface conflicts and dependencies between findings. Do NOT do new research — synthesize what exists.
12
12
 
13
13
  SUMMARY.md MUST include:
14
- 1. **Key Findings** — top 5-7 bullets across all 4 dimensions
14
+ 1. **Key Findings** — the highest-signal findings across all 4 dimensions
15
15
  2. **Implications for Roadmap** — suggested phase groupings derived from architecture build order + pitfall avoidance (this is the critical handoff to the roadmapper)
16
16
  3. **Research Flags** — which phases need deeper research vs standard patterns
17
17
  4. **Confidence Assessment** — per domain: stack / features / architecture / pitfalls
@@ -27,5 +27,5 @@ Use template: `.planning/templates/research/summary.md` (if it exists)
27
27
  </quality_gate>
28
28
 
29
29
  Write to: `.planning/research/SUMMARY.md`
30
- Return: 5-7 bullet key findings to the Orchestrator when done.
30
+ Return: Agent-mediated structured summary to the Orchestrator (500-800 tokens) when done.
31
31
  Guardrails: Max Agent Hops = 2. Do not do new research — synthesize only.
@@ -110,7 +110,7 @@ With phase context collected, delegate cross-phase integration checking:
110
110
 
111
111
  **Task:** Verify cross-phase wiring, API coverage, auth protection, and E2E user flows. Return structured integration report with wiring summary, API coverage, auth protection, E2E flow status, and Requirements Integration Map.
112
112
 
113
- **Return:** Structured integration report (wiring, APIs, auth protection, flows, requirements map).
113
+ **Return:** Structured integration report summary (wiring, APIs, auth protection, flows, requirements map). The checker is read-only; the auditor owns the milestone audit artifact.
114
114
  </delegate>
115
115
 
116
116
  If the runtime supports spawning a subagent: spawn the integration checker as a separate read-only context for independent verification.
@@ -102,7 +102,7 @@ Parallel: (use parallelization value from .planning/config.json)
102
102
  Context: Current working directory. DO NOT share conversation history.
103
103
  Instruction: Read `.planning/templates/delegates/mapper-tech.md` for full task instructions. Follow them exactly.
104
104
  Output: `.planning/codebase/STACK.md`
105
- Return: 3-5 sentence summary to Orchestrator.
105
+ Return: Routing summary to Orchestrator (100-200 tokens); full findings stay in the output artifact.
106
106
  Guardrails: Max Agent Hops = 3. No static dumps. Never read .env contents.
107
107
  </delegate>
108
108
 
@@ -112,7 +112,7 @@ Parallel: (use parallelization value from .planning/config.json)
112
112
  Context: Current working directory. DO NOT share conversation history.
113
113
  Instruction: Read `.planning/templates/delegates/mapper-arch.md` for full task instructions. Follow them exactly.
114
114
  Output: `.planning/codebase/ARCHITECTURE.md`
115
- Return: 3-5 sentence summary to Orchestrator.
115
+ Return: Routing summary to Orchestrator (100-200 tokens); full findings stay in the output artifact.
116
116
  Guardrails: Max Agent Hops = 3. No static directory dumps. Never read .env contents.
117
117
  </delegate>
118
118
 
@@ -122,7 +122,7 @@ Parallel: (use parallelization value from .planning/config.json)
122
122
  Context: Current working directory. DO NOT share conversation history.
123
123
  Instruction: Read `.planning/templates/delegates/mapper-quality.md` for full task instructions. Follow them exactly.
124
124
  Output: `.planning/codebase/CONVENTIONS.md`
125
- Return: 3-5 sentence summary to Orchestrator.
125
+ Return: Routing summary to Orchestrator (100-200 tokens); full findings stay in the output artifact.
126
126
  Guardrails: Max Agent Hops = 3. Rules not inventories. Never read .env contents.
127
127
  </delegate>
128
128
 
@@ -132,7 +132,7 @@ Parallel: (use parallelization value from .planning/config.json)
132
132
  Context: Current working directory. DO NOT share conversation history.
133
133
  Instruction: Read `.planning/templates/delegates/mapper-concerns.md` for full task instructions. Follow them exactly. Hard stop if secrets found -- report immediately.
134
134
  Output: `.planning/codebase/CONCERNS.md`
135
- Return: 3-5 sentence summary to Orchestrator. If secrets found, STOP and report immediately.
135
+ Return: Routing summary to Orchestrator (100-200 tokens); full findings stay in the output artifact. If secrets found, STOP and report immediately.
136
136
  Guardrails: Max Agent Hops = 3. Hard stop on secrets. Never read .env contents.
137
137
  </delegate>
138
138
  </mapping>
@@ -232,7 +232,7 @@ Parallel: (use parallelization value from .planning/config.json)
232
232
  Context: Project goal: [user's stated goal]. Milestone context: [greenfield|subsequent]. DO NOT share conversation history.
233
233
  Instruction: Read `.planning/templates/delegates/researcher-stack.md` for full task instructions. Apply the project goal and milestone context provided above.
234
234
  Output: `.planning/research/STACK.md`
235
- Return: 3-5 sentence summary to Orchestrator; full findings stay in the output artifact.
235
+ Return: Human-read structured summary to Orchestrator (300-500 tokens); full findings stay in the output artifact.
236
236
  Guardrails: Max Agent Hops = 3.
237
237
  </delegate>
238
238
 
@@ -242,7 +242,7 @@ Parallel: (use parallelization value from .planning/config.json)
242
242
  Context: Project goal: [user's stated goal]. Milestone context: [greenfield|subsequent]. DO NOT share conversation history.
243
243
  Instruction: Read `.planning/templates/delegates/researcher-features.md` for full task instructions. Apply the project goal and milestone context provided above.
244
244
  Output: `.planning/research/FEATURES.md`
245
- Return: 3-5 sentence summary to Orchestrator; full findings stay in the output artifact.
245
+ Return: Human-read structured summary to Orchestrator (300-500 tokens); full findings stay in the output artifact.
246
246
  Guardrails: Max Agent Hops = 3.
247
247
  </delegate>
248
248
 
@@ -252,7 +252,7 @@ Parallel: (use parallelization value from .planning/config.json)
252
252
  Context: Project goal: [user's stated goal]. Milestone context: [greenfield|subsequent]. DO NOT share conversation history.
253
253
  Instruction: Read `.planning/templates/delegates/researcher-architecture.md` for full task instructions. Apply the project goal and milestone context provided above.
254
254
  Output: `.planning/research/ARCHITECTURE.md`
255
- Return: 3-5 sentence summary to Orchestrator; full findings stay in the output artifact.
255
+ Return: Human-read structured summary to Orchestrator (300-500 tokens); full findings stay in the output artifact.
256
256
  Guardrails: Max Agent Hops = 3.
257
257
  </delegate>
258
258
 
@@ -262,14 +262,14 @@ Parallel: (use parallelization value from .planning/config.json)
262
262
  Context: Project goal: [user's stated goal]. Milestone context: [greenfield|subsequent]. DO NOT share conversation history.
263
263
  Instruction: Read `.planning/templates/delegates/researcher-pitfalls.md` for full task instructions. Apply the project goal and milestone context provided above.
264
264
  Output: `.planning/research/PITFALLS.md`
265
- Return: 3-5 sentence summary to Orchestrator; full findings stay in the output artifact.
265
+ Return: Human-read structured summary to Orchestrator (300-500 tokens); full findings stay in the output artifact.
266
266
  Guardrails: Max Agent Hops = 3.
267
267
  </delegate>
268
268
 
269
269
  **After all 4 researchers complete**, synthesize based on `researchDepth`:
270
270
 
271
271
  **If `researchDepth: "fast"`:** Synthesize inline.
272
- You hold 4 x 3-5 sentence summaries. Write `.planning/research/SUMMARY.md` directly using `.planning/templates/research/summary.md`. Cross-reference the summaries. Do NOT spawn another agent.
272
+ You hold 4 human-read structured summaries. Write `.planning/research/SUMMARY.md` directly using `.planning/templates/research/summary.md`. Cross-reference the summaries. Do NOT spawn another agent.
273
273
 
274
274
  **If `researchDepth: "balanced"` or `"deep"`:** Spawn synthesizer to read the full research files.
275
275
 
@@ -279,11 +279,11 @@ Parallel: false
279
279
  Context: Researcher summaries returned above. DO NOT share conversation history.
280
280
  Instruction: Read `.planning/templates/delegates/researcher-synthesizer.md` for full task instructions.
281
281
  Output: `.planning/research/SUMMARY.md`
282
- Return: 5-7 bullet key findings to Orchestrator; full synthesis stays in the output artifact.
282
+ Return: Agent-mediated structured summary to Orchestrator (500-800 tokens); full synthesis stays in the output artifact.
283
283
  Guardrails: Max Agent Hops = 2. Do not do new research — synthesize only.
284
284
  </delegate>
285
285
 
286
- *Why the split:* The synthesizer reads the 4 full research files and cross-references specific data points (build order constraints, pitfall-to-phase mappings, feature-architecture conflicts) that 3-5 sentence summaries omit. This depth matters for `balanced`/`deep` runs where the roadmapper needs rich "Implications for Roadmap." For `fast` runs, orchestrator inline synthesis is the acceptable trade-off.
286
+ *Why the split:* The synthesizer reads the 4 full research files and cross-references specific data points (build order constraints, pitfall-to-phase mappings, feature-architecture conflicts) that returned summaries omit. This depth matters for `balanced`/`deep` runs where the roadmapper needs rich "Implications for Roadmap." For `fast` runs, orchestrator inline synthesis is the acceptable trade-off.
287
287
 
288
288
  Display key findings before moving to spec creation.
289
289
 
@@ -345,7 +345,7 @@ Do NOT proceed to roadmap creation until the developer explicitly approves.
345
345
 
346
346
  <roadmap_creation>
347
347
  After `SPEC.md` is approved, you must create `ROADMAP.md`.
348
- Since you are an Orchestrator with fresh context, you DO NOT need to spawn a subagent for thiswrite it yourself directly, retaining full thoroughness.
348
+ Since you are an Orchestrator with fresh context, you DO NOT need to spawn a subagent for this; write it yourself directly, retaining full thoroughness. Research and synthesis delegation above are artifact-backed inputs; roadmap creation remains direct and sequential.
349
349
 
350
350
  Break `SPEC.md` requirements into executable phases:
351
351
 
@@ -436,14 +436,14 @@ Run the approach explorer.
436
436
 
437
437
  ### Running the Approach Explorer
438
438
  **Primary path — inline conversation with research subagents:**
439
- The conversation with the user runs inline in the main context. For each technical gray area, a read-only research subagent is spawned to isolate heavy codebase and documentation reads, returning only compressed summaries.
439
+ The conversation with the user runs inline in the main context. For each technical gray area, a read-only research subagent is spawned to isolate heavy codebase and documentation reads, returning only compressed summaries while full detail stays out of the orchestrator context.
440
440
 
441
441
  1. Load context: read ONLY locked decisions from `.planning/SPEC.md` and the target phase goal/requirements from `.planning/ROADMAP.md`.
442
442
 
443
443
  2. Identify 3-4 domain-specific gray areas. Classify each as **taste** (preference, no research needed), **technical** (trade-offs, research first), or **hybrid** (both).
444
444
 
445
445
  3. For each **technical or hybrid** gray area, spawn a read-only research subagent.
446
- Use the prompt template from `.planning/templates/roles/approach-explorer.md` (`<research_subagent_prompt>` section), substituting the gray area name, classification, phase context, and relevant codebase files. Each subagent returns a structured summary under 1000 tokens.
446
+ Use the prompt template from `.planning/templates/roles/approach-explorer.md` (`<research_subagent_prompt>` section), substituting the gray area name, classification, phase context, and relevant codebase files. Each subagent returns a structured summary and does not write implementation artifacts.
447
447
 
448
448
  4. Present each gray area to the user individually:
449
449
  - For taste areas: ask directly
@@ -488,7 +488,7 @@ The approach explorer's full role contract is at `.planning/templates/roles/appr
488
488
 
489
489
  <plan_check_orchestration>
490
490
  ### How Plan Checking Works
491
- After the planner produces a draft plan, an independent checker reviews it in fresh context. The checker does not inherit the planner's hidden reasoning; it treats the plan as an untrusted draft.
491
+ After the planner produces a draft plan, an independent checker reviews it in fresh context. The checker does not inherit the planner's hidden reasoning; it treats the plan as an untrusted draft and returns a structured summary of findings rather than editing the plan directly.
492
492
 
493
493
  ### What The Checker Verifies
494
494
  1. `requirement_coverage` - every phase requirement is covered by at least one concrete task
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gsdd-cli",
3
- "version": "0.19.2",
3
+ "version": "0.19.3",
4
4
  "description": "Workspine — a repo-native delivery spine for long-horizon AI-assisted work, with directly validated support for Claude Code, Codex CLI, and OpenCode, published as gsdd-cli.",
5
5
  "type": "module",
6
6
  "bin": {