feat(sdd): add JD agent definitions and model assignment foundation#475
feat(sdd): add JD agent definitions and model assignment foundation#475danielgap wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR lays the groundwork for adding configurable “judgment-day” (JD) sub-agents alongside the existing SDD orchestration stack in OpenCode, including new agent definitions and initial model-assignment plumbing.
Changes:
- Added JD agent name discovery helpers (
JDPhases,ConfigurableAgentPhases) in the OpenCode models package. - Extended Claude model presets to include JD agents and introduced a diversity-oriented preset.
- Updated SDD injection logic and OpenCode multi overlay to define JD agents, add delegation permissions, and adjust model-injection behavior for JD agents.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| internal/opencode/models.go | Adds JD agent name lists and a combined “configurable agents” list helper. |
| internal/model/claude_model.go | Adds JD keys to existing presets and introduces a diversity preset for JD reviews. |
| internal/components/sdd/inject.go | Adds JD rows/reasons to the model assignment section and excludes JD agents from root-model propagation in multi-mode injection. |
| internal/assets/opencode/sdd-overlay-multi.json | Defines JD sub-agents and allows the orchestrator to delegate to them. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "sdd-archive": "allow", | ||
| "sdd-onboard": "allow" | ||
| "sdd-onboard": "allow", | ||
| "jd-judge-a": "allow", | ||
| "jd-judge-b": "allow", | ||
| "jd-fix-agent": "allow" |
There was a problem hiding this comment.
Fixed in PR #477 — tests updated for the expanded agent count and permission map.
| // 3. Fresh install or new agent: use root model as default to break inheritance. | ||
| // Exception: JD agents are excluded from root model propagation to support | ||
| // independent model configuration and diversity of perspective between judges. | ||
| if !isJDAgent(phase) { | ||
| agentMap["model"] = rootModelID | ||
| } |
There was a problem hiding this comment.
By design — JD agents are excluded from root model propagation to support independent model configuration and diversity. Test added in PR #477.
| // ConfigurableAgentPhases returns all agent names that support per-agent | ||
| // model configuration. This includes SDD phases + JD agents. | ||
| // Used by the TUI model picker and ReadCurrentModelAssignments. | ||
| func ConfigurableAgentPhases() []string { | ||
| phases := SDDPhases() | ||
| phases = append(phases, JDPhases()...) | ||
| return phases |
There was a problem hiding this comment.
Docstring updated — callers use SDDPhases() and JDPhases() separately based on context.
Alan-TheGentleman
left a comment
There was a problem hiding this comment.
This slice only shows the OpenCode foundation, while the chain needs to land with both OpenCode and Claude Code support clearly covered.
Before this can move forward, please add the missing type:feature label and update the chain notes to make the cross-agent contract explicit: what this PR enables for OpenCode, what the Claude Code counterpart is, and which PR in the chain completes it.
|
@Alan-TheGentleman Could you add the |
|
Added the type:feature label. Thanks for flagging the permission issue. |
671b24c to
fbff04d
Compare
| // model configuration. This includes SDD phases + JD agents. | ||
| // Used by the inject model assignment table builder and the configurable agent set | ||
| // in ReadCurrentModelAssignments. The TUI model picker uses SDDPhases() and | ||
| // JDPhases() separately for row layout control. |
There was a problem hiding this comment.
Docstring already updated in prior commit. ConfigurableAgentPhases returns the combined list for the configurable agent set.
| // 3. Fresh install or new agent: use root model as default to break inheritance. | ||
| // Exception: JD agents are excluded from root model propagation to support | ||
| // independent model configuration and diversity of perspective between judges. | ||
| if !isJDAgent(phase) { | ||
| agentMap["model"] = rootModelID | ||
| } |
There was a problem hiding this comment.
By design — JD agents excluded from root model propagation. Test added in PR #477 verifying this behavior.
| "sdd-apply": ClaudeModelSonnet, | ||
| "sdd-verify": ClaudeModelSonnet, | ||
| "sdd-archive": ClaudeModelHaiku, | ||
| "jd-judge-a": ClaudeModelHaiku, | ||
| "jd-judge-b": ClaudeModelHaiku, | ||
| "jd-fix-agent": ClaudeModelHaiku, |
There was a problem hiding this comment.
Fixed — docstring updated to reflect JD agent assignments in Economy preset.
| // Used by the inject model assignment table builder and the configurable agent set | ||
| // in ReadCurrentModelAssignments. The TUI model picker uses SDDPhases() and | ||
| // JDPhases() separately for row layout control. |
| "tools": { "read": true, "glob": true, "grep": true, "bash": true } | ||
| }, | ||
| "jd-judge-b": { | ||
| "mode": "subagent", | ||
| "hidden": true, | ||
| "description": "Adversarial code reviewer — blind judge B for judgment-day protocol", | ||
| "prompt": "You are a judgment-day adversarial reviewer. Execute the review instructions provided in the delegate prompt exactly. Do NOT delegate further. Do NOT modify any code — your job is ONLY to find problems.", | ||
| "tools": { "read": true, "glob": true, "grep": true, "bash": true } |
There was a problem hiding this comment.
Good catch — fixed in 70f167e. Replaced glob/grep with the standard {read, bash} tool set used by all other OpenCode overlay agents.
| "tools": { "read": true, "glob": true, "grep": true, "bash": true } | ||
| }, | ||
| "jd-judge-b": { | ||
| "mode": "subagent", | ||
| "hidden": true, | ||
| "description": "Adversarial code reviewer — blind judge B for judgment-day protocol", | ||
| "prompt": "You are a judgment-day adversarial reviewer. Execute the review instructions provided in the delegate prompt exactly. Do NOT delegate further. Do NOT modify any code — your job is ONLY to find problems.", | ||
| "tools": { "read": true, "glob": true, "grep": true, "bash": true } |
| // 3. Fresh install or new agent: use root model as default to break inheritance. | ||
| // Exception: JD agents are excluded from root model propagation to support | ||
| // independent model configuration and diversity of perspective between judges. | ||
| if !isJDAgent(phase) { | ||
| agentMap["model"] = rootModelID | ||
| } |
|
Thanks, this slice has the right issue link, one type label, and a clear chain role. The blocker now is mergeability: GitHub reports this PR as conflicting with |
Add jd-judge-a, jd-judge-b, and jd-fix-agent as hidden sub-agents in the multi-mode overlay. Update orchestrator permissions to allow delegation to these agents. Refs: Gentleman-Programming#208
JDPhases returns the judgment-day sub-agent names (jd-judge-a, jd-judge-b, jd-fix-agent). ConfigurableAgentPhases combines SDD phases and JD agents for the TUI model picker. Refs: Gentleman-Programming#208
Add jd-judge-a, jd-judge-b, jd-fix-agent to claudeModelAssignmentRowOrder and claudeModelAssignmentReasons in inject.go. Add JD entries to all three existing presets (balanced, performance, economy) in claude_model.go. Add new ClaudeModelPresetDiversity() preset for perspective diversity between judges (opus/haiku/sonnet split). Refs: Gentleman-Programming#208
Add isJDAgent helper and modify injectModelAssignments case 3 to skip root model fallback for judgment-day agents. This preserves independent model configuration for diversity of perspective between judges. Refs: Gentleman-Programming#208
…DPhases separately
- ClaudeModelPresetDiversity now clones the base map before mutating, preventing corruption if ClaudeModelPresetBalanced is ever cached. - isJDAgent uses a package-level set instead of linear scan, consistent with sddPhaseSet pattern in read_assignments.go.
OpenCode overlays only use {read, write, edit, bash} as tool keys.
glob and grep are not referenced anywhere in the codebase and may cause
config rejection. Judges only need read and bash for code review.
70f167e to
6dd2553
Compare
| "sdd-onboard": "allow", | ||
| "jd-judge-a": "allow", | ||
| "jd-judge-b": "allow", | ||
| "jd-fix-agent": "allow" |
There was a problem hiding this comment.
Already addressed — the test is updated in PR #477 (part of this chain). expectedTaskPermissions() in profiles_test.go iterates opencode.JDPhases() to include JD agent permissions, and TestDefaultOverlayTaskPermissions_ExplicitAllowlist uses includeJD bool to handle multi vs single overlay correctly.
🔗 Linked Issue
Closes #208
🏷️ PR Type
type:feature— New feature (non-breaking change that adds functionality)📝 Summary
Adds the foundational layer for configurable judgment-day agents: 3 JD agent definitions in the OpenCode overlay, phase discovery functions, model assignment table entries, and root model exclusion.
This is PR 1 of 3 in a chained approach to keep each PR under 400 lines.
Cross-Agent Contract
This PR enables the OpenCode foundation. Claude Code and Kiro counterparts come in #476 (agent prompt files). End-to-end validation for all agents is in #477.
📂 Changes
internal/assets/opencode/sdd-overlay-multi.jsoninternal/opencode/models.goJDPhases()andConfigurableAgentPhases()for dynamic phase discoveryinternal/components/sdd/inject.goisJDAgent()helperinternal/model/claude_model.goClaudeModelPresetDiversity()🧪 Test Plan
go test ./...)✅ Contributor Checklist
status:approvedtype:*label to this PRgo test ./...)Co-Authored-BytrailersChain Context
mainChain Overview
Scope
Autonomy