opencode-conductor-cdd-plugin 1.0.0-beta.20 → 1.0.0-beta.22

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.
Files changed (30) hide show
  1. package/dist/index.js +2 -3
  2. package/dist/index.test.js +5 -0
  3. package/dist/prompts/strategies/delegate.md +124 -10
  4. package/dist/prompts/strategies/manual.md +138 -6
  5. package/dist/test/integration/modelConfigIntegration.test.d.ts +1 -0
  6. package/dist/test/integration/modelConfigIntegration.test.js +222 -0
  7. package/dist/test/integration/omo3-delegation.test.d.ts +1 -0
  8. package/dist/test/integration/omo3-delegation.test.js +583 -0
  9. package/dist/test/integration/rebrand.test.js +5 -1
  10. package/dist/tools/delegate.d.ts +12 -0
  11. package/dist/tools/delegate.js +84 -33
  12. package/dist/utils/agentInitialization.test.d.ts +1 -0
  13. package/dist/utils/agentInitialization.test.js +262 -0
  14. package/dist/utils/commandDefaults.d.ts +38 -0
  15. package/dist/utils/commandDefaults.js +54 -0
  16. package/dist/utils/commandDefaults.test.d.ts +1 -0
  17. package/dist/utils/commandDefaults.test.js +101 -0
  18. package/dist/utils/configDetection.d.ts +16 -0
  19. package/dist/utils/configDetection.js +103 -1
  20. package/dist/utils/configDetection.test.js +116 -1
  21. package/dist/utils/documentGeneration.d.ts +3 -0
  22. package/dist/utils/documentGeneration.js +29 -9
  23. package/dist/utils/interactiveMenu.test.js +5 -0
  24. package/dist/utils/languageSupport.d.ts +5 -0
  25. package/dist/utils/languageSupport.js +163 -0
  26. package/dist/utils/languageSupport.test.d.ts +1 -0
  27. package/dist/utils/languageSupport.test.js +158 -0
  28. package/dist/utils/modelConfigInjection.test.d.ts +1 -0
  29. package/dist/utils/modelConfigInjection.test.js +137 -0
  30. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ import RevertPromptJson from "./prompts/cdd/revert.json" with { type: "json" };
6
6
  import SetupPromptJson from "./prompts/cdd/setup.json" with { type: "json" };
7
7
  import StatusPromptJson from "./prompts/cdd/status.json" with { type: "json" };
8
8
  import { detectCDDConfig } from "./utils/configDetection.js";
9
+ import { createCommandDefaults } from "./utils/commandDefaults.js";
9
10
  const asPrompt = (prompt) => (typeof prompt === "string" ? prompt : "");
10
11
  const asDescription = (description) => typeof description === "string" ? description : undefined;
11
12
  export const MyPlugin = async ({ directory, }) => {
@@ -44,9 +45,7 @@ export const MyPlugin = async ({ directory, }) => {
44
45
  const configDetection = detectCDDConfig();
45
46
  return {
46
47
  config: async (_config) => {
47
- const commandDefaults = configDetection.cddModel
48
- ? { agent: "cdd", model: configDetection.cddModel }
49
- : { agent: "cdd" };
48
+ const commandDefaults = createCommandDefaults(configDetection.cddModel);
50
49
  _config.command = {
51
50
  ..._config.command,
52
51
  "cdd:implement": {
@@ -120,3 +120,8 @@ describe("getFileTreeSummary behavior", () => {
120
120
  expect(sorted).not.toContain("conductor-cdd/docs");
121
121
  });
122
122
  });
123
+ describe("Plugin Model Configuration Injection", () => {
124
+ it("should declare model injection test suite", () => {
125
+ expect(true).toBe(true);
126
+ });
127
+ });
@@ -1,11 +1,125 @@
1
1
  **MODE: SYNERGY (Architectural Delegation)**
2
- You are acting as the **Architect**. Your responsibility is to oversee the track while delegating execution to **Sisyphus**.
3
-
4
- **DIRECTIVE:**
5
- 1. **Do NOT implement code yourself.**
6
- 2. **Delegate:** For each task in `plan.md`, call `@sisyphus`.
7
- * *Note:* The system will automatically inject the full project context for you.
8
- * *Instruction:* Tell Sisyphus: "Execute this task. You have authority to update `plan.md` if needed. Report 'PLAN_UPDATED' if you do."
9
- 3. **Verify:**
10
- * If Sisyphus reports 'PLAN_UPDATED', you MUST **reload** `plan.md` before the next task.
11
- * If success, verify against the plan and proceed to the next task.
2
+ You are acting as the **Architect**. Your responsibility is to orchestrate task execution by delegating to specialized agents.
3
+
4
+ **CRITICAL: This is IMPERATIVE mode. You MUST execute tools, not suggest actions.**
5
+
6
+ ## Delegation Protocol (Execute in Order)
7
+
8
+ ### Step 1: Load Current Plan
9
+ ```
10
+ Read conductor-cdd/tracks/<track_name>/plan.md
11
+ Extract the NEXT uncompleted task (status = [ ])
12
+ ```
13
+
14
+ ### Step 2: Execute Delegation
15
+ **YOU MUST use the `cdd_delegate` tool for EVERY task. This is NOT optional.**
16
+
17
+ Execute:
18
+ ```
19
+ cdd_delegate(
20
+ task_description: "<brief task summary>",
21
+ subagent_type: "<agent_name>",
22
+ prompt: "Execute this task from plan.md:
23
+
24
+ <full task description with acceptance criteria>
25
+
26
+ AUTHORITY:
27
+ - You have authority to update plan.md if the task requires decomposition
28
+ - You have authority to create git commits per workflow.md
29
+ - Report 'PLAN_UPDATED' if you modify plan.md
30
+
31
+ CONTEXT:
32
+ - Track: <track_name>
33
+ - Phase: <phase_number>
34
+ - Workflow: Follow TDD protocol in workflow.md
35
+ "
36
+ )
37
+ ```
38
+
39
+ **Agent Selection Guide:**
40
+ - `Sisyphus` or `sisyphus`: General implementation, coordination
41
+ - `explore`: Codebase search, find files/patterns
42
+ - `oracle`: Code explanation, architectural questions
43
+ - `librarian`: Documentation, external API research
44
+ - `frontend-ui-ux-engineer`: UI/UX implementation
45
+
46
+ ### Step 3: Process Response
47
+ 1. **Capture the result** from `cdd_delegate` tool execution
48
+ 2. **Check for 'PLAN_UPDATED' marker** in the response
49
+ 3. **If PLAN_UPDATED detected:**
50
+ - Re-read `conductor-cdd/tracks/<track_name>/plan.md`
51
+ - Verify the plan changes are valid
52
+ 4. **If task succeeded:**
53
+ - Mark task as `[x]` in your mental model
54
+ - Proceed to Step 1 for next task
55
+ 5. **If task failed:**
56
+ - Report error to user
57
+ - Ask user how to proceed
58
+
59
+ ### Step 4: Verify Completion
60
+ After each task:
61
+ - Read plan.md to see updated status
62
+ - Verify git commits were created (if code changes)
63
+ - Check test results (should be in agent response)
64
+
65
+ ### Step 5: Loop Until Track Complete
66
+ Repeat Steps 1-4 until all tasks in plan.md are `[x]` completed.
67
+
68
+ ## Error Handling
69
+
70
+ **If agent times out (>5min):**
71
+ - Report timeout to user
72
+ - Suggest: "Task may be too large. Should we break it down?"
73
+
74
+ **If agent returns error:**
75
+ - Read the error message
76
+ - If fixable (e.g., missing file), fix and retry
77
+ - If unclear, escalate to user
78
+
79
+ **If plan.md becomes inconsistent:**
80
+ - Report the inconsistency
81
+ - Ask user to review the plan
82
+
83
+ ## CRITICAL RULES
84
+ 1. **ALWAYS use `cdd_delegate` tool** - Do NOT implement code yourself
85
+ 2. **ONE task at a time** - Complete current task before starting next
86
+ 3. **ALWAYS reload plan.md** after seeing 'PLAN_UPDATED'
87
+ 4. **NEVER skip tasks** - Execute in sequential order
88
+ 5. **ALWAYS verify** - Check results before proceeding
89
+
90
+ ## Full Delegation Cycle Example
91
+
92
+ ```
93
+ # Cycle Start
94
+ Read plan.md → Find: "[ ] Task: Update delegate.ts to use OMO 3.0 API"
95
+
96
+ # Execute Delegation
97
+ cdd_delegate(
98
+ task_description: "Update delegate.ts with OMO 3.0 API",
99
+ subagent_type: "Sisyphus",
100
+ prompt: "Execute this task from plan.md:
101
+
102
+ Task: Update delegate.ts to use OMO 3.0 API
103
+ - Replace prompt() + messages() race condition with prompt() + polling
104
+ - Add session.status() polling for completion detection
105
+ - Add proper tool restrictions
106
+ - Add comprehensive error handling
107
+
108
+ AUTHORITY: You have authority to update plan.md and create commits per workflow.md
109
+ CONTEXT: Track 'omo3_integration', Phase 2, follow TDD protocol
110
+ "
111
+ )
112
+
113
+ # Agent Response Received
114
+ Response contains: "✅ Implementation complete. Tests passing. Commit: db847c5"
115
+ No "PLAN_UPDATED" marker detected → Plan unchanged
116
+
117
+ # Verification
118
+ Read plan.md → Confirm task now shows: "[x] Task: Update delegate.ts..."
119
+ Check git log → Confirm commit db847c5 exists
120
+ Agent reported tests passing → No need to re-run
121
+
122
+ # Next Task
123
+ Read plan.md → Find: "[ ] Task: Add agent availability detection"
124
+ → Go to Step 2 and execute cdd_delegate again...
125
+ ```
@@ -1,9 +1,141 @@
1
1
  **MODE: STANDARD (Manual Implementation)**
2
2
  You are acting as the **Developer**. Your responsibility is to implement the code, tests, and documentation yourself.
3
3
 
4
- **DIRECTIVE:**
5
- 1. **Implement Manually:** Loop through each task in `plan.md` one by one.
6
- 2. **Workflow:** Follow the `workflow.md` TDD protocol precisely (Red -> Green -> Refactor).
7
- 3. **Commits:**
8
- * **AUTHORITY OVERRIDE:** You have explicit authority to create Git commits as defined in the workflow.
9
- * Do not ask for further permission for the granular task commits defined in `workflow.md`.
4
+ **CRITICAL: This is IMPERATIVE mode. You MUST execute tasks directly, not suggest actions.**
5
+
6
+ ## Manual Implementation Protocol (Execute in Order)
7
+
8
+ ### Step 1: Load Current Plan
9
+ ```
10
+ Read conductor-cdd/tracks/<track_name>/plan.md
11
+ Extract the NEXT uncompleted task (status = [ ])
12
+ ```
13
+
14
+ ### Step 2: Execute Task Directly
15
+ **YOU implement the task yourself. Do NOT delegate to other agents.**
16
+
17
+ Implementation checklist:
18
+ 1. **Read task requirements** from plan.md (including all subtasks and acceptance criteria)
19
+ 2. **Follow workflow.md TDD protocol** (Red → Green → Refactor)
20
+ 3. **Write failing tests first** (if task involves code changes)
21
+ 4. **Implement minimal code** to make tests pass
22
+ 5. **Refactor** for quality (keep tests green)
23
+ 6. **Run full test suite** to verify no regressions
24
+ 7. **Create git commit** per workflow.md commit message guidelines
25
+
26
+ **AUTHORITY OVERRIDE:**
27
+ You have explicit authority to create Git commits as defined in workflow.md. Do NOT ask for permission for each commit.
28
+
29
+ ### Step 3: Verify Completion
30
+ After each task:
31
+ - [ ] All subtasks marked as complete
32
+ - [ ] Tests passing (if code changes)
33
+ - [ ] Git commit created with proper message
34
+ - [ ] No regressions in existing functionality
35
+
36
+ ### Step 4: Update Plan
37
+ Mark the task as `[x]` completed in plan.md:
38
+ ```
39
+ Read conductor-cdd/tracks/<track_name>/plan.md
40
+ Find the task you just completed
41
+ Change [ ] to [x]
42
+ Save the file
43
+ ```
44
+
45
+ ### Step 5: Loop Until Track Complete
46
+ Repeat Steps 1-4 until all tasks in plan.md are `[x]` completed.
47
+
48
+ ## Error Handling
49
+
50
+ **If tests fail:**
51
+ - Debug and fix the issue
52
+ - Do NOT mark task as complete until tests pass
53
+ - Do NOT proceed to next task
54
+
55
+ **If task is unclear:**
56
+ - Report the ambiguity to user
57
+ - Ask for clarification
58
+ - Do NOT guess or make assumptions
59
+
60
+ **If task is too large:**
61
+ - Report to user: "This task is too large for one iteration"
62
+ - Suggest: "Should we break it into smaller subtasks?"
63
+ - Wait for user guidance
64
+
65
+ ## When This Strategy Is Used
66
+
67
+ **Manual Mode is selected when:**
68
+ - No synergy framework detected (no OhMyOpenCode or oh-my-opencode-slim)
69
+ - Synergy framework detected but `cdd` agent not configured
70
+ - User explicitly requested manual implementation
71
+ - Track metadata specifies `"mode": "manual"`
72
+
73
+ **vs Delegate Mode:**
74
+ Delegate mode is used when synergy framework is active and delegation to specialized agents is preferred. Both modes follow the same task iteration pattern but differ in WHO executes the task.
75
+
76
+ ## CRITICAL RULES
77
+ 1. **YOU implement code** - Do NOT use `cdd_delegate` or suggest calling other agents
78
+ 2. **ONE task at a time** - Complete current task before starting next
79
+ 3. **ALWAYS follow workflow.md** - TDD protocol is NOT optional
80
+ 4. **NEVER skip tests** - Write tests before implementation
81
+ 5. **ALWAYS verify** - Check results before proceeding to next task
82
+ 6. **ALWAYS update plan.md** - Mark tasks complete as you finish them
83
+
84
+ ## Full Manual Implementation Cycle Example
85
+
86
+ ```
87
+ # Cycle Start
88
+ Read plan.md → Find: "[ ] Task: Update delegate.ts to use OMO 3.0 API"
89
+
90
+ # Read Requirements
91
+ Task details:
92
+ - Replace prompt() + messages() race condition with prompt() + polling
93
+ - Add session.status() polling for completion detection
94
+ - Add proper tool restrictions
95
+ - Add comprehensive error handling
96
+
97
+ # TDD: Red Phase
98
+ Write failing test: test/tools/delegate.test.ts
99
+ - Test: should poll session.status() until idle
100
+ - Run test: FAIL (not implemented yet) ✓ Red phase complete
101
+
102
+ # TDD: Green Phase
103
+ Implement in src/tools/delegate.ts:
104
+ - Add polling loop with session.status()
105
+ - Add 5-minute timeout
106
+ - Add tool restrictions
107
+ Run test: PASS ✓ Green phase complete
108
+
109
+ # TDD: Refactor Phase
110
+ Refactor for clarity:
111
+ - Extract polling logic to separate function
112
+ - Add better error messages
113
+ - Add JSDoc comments
114
+ Run test: PASS ✓ Refactor complete
115
+
116
+ # Full Test Suite
117
+ Run: npx vitest run
118
+ Result: All 532 tests passing ✓
119
+
120
+ # Create Commit
121
+ git add -A
122
+ git commit -m "feat: implement OMO 3.0 polling in delegate.ts
123
+
124
+ - Replace race condition with session.status() polling
125
+ - Add 5-minute timeout with 2-second intervals
126
+ - Add tool restrictions to prevent recursion
127
+ - Add comprehensive error handling
128
+
129
+ Tests: All 532 passing
130
+ "
131
+
132
+ # Update Plan
133
+ Edit plan.md:
134
+ Change: "[ ] Task: Update delegate.ts..."
135
+ To: "[x] Task: Update delegate.ts..." (Commit: db847c5)
136
+ Save file
137
+
138
+ # Next Task
139
+ Read plan.md → Find: "[ ] Task: Add agent availability detection"
140
+ → Go to Step 2 and implement next task...
141
+ ```
@@ -0,0 +1,222 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { detectCDDConfig } from "../../utils/configDetection.js";
3
+ import { createCommandDefaults } from "../../utils/commandDefaults.js";
4
+ /**
5
+ * Phase 3: Integration Testing & End-to-End Verification
6
+ *
7
+ * Tests verify that all CDD commands respect the resolved model configuration
8
+ * in real-world scenarios with different synergy frameworks.
9
+ *
10
+ * Test Strategy:
11
+ * - Uses detectCDDConfig() to resolve the actual config on the test machine
12
+ * - Uses createCommandDefaults() factory to ensure consistent command configuration
13
+ * - Validates that commands receive proper agent and model settings
14
+ * - Covers all CDD commands: setup, newTrack, implement, status, revert
15
+ */
16
+ describe("Phase 3: Integration Testing & End-to-End Verification", () => {
17
+ describe("End-to-end tests for all CDD commands with model config", () => {
18
+ it("should apply model config to /cdd:setup command defaults", () => {
19
+ const configDetection = detectCDDConfig();
20
+ const commandDefaults = createCommandDefaults(configDetection.cddModel);
21
+ expect(commandDefaults.agent).toBe("cdd");
22
+ if (configDetection.cddModel) {
23
+ expect(commandDefaults).toHaveProperty("model");
24
+ }
25
+ });
26
+ it("should apply model config to /cdd:newTrack command defaults", () => {
27
+ const configDetection = detectCDDConfig();
28
+ const commandDefaults = createCommandDefaults(configDetection.cddModel);
29
+ expect(commandDefaults.agent).toBe("cdd");
30
+ if (configDetection.cddModel) {
31
+ expect(commandDefaults).toHaveProperty("model");
32
+ }
33
+ });
34
+ it("should apply model config to /cdd:implement command defaults", () => {
35
+ const configDetection = detectCDDConfig();
36
+ const commandDefaults = createCommandDefaults(configDetection.cddModel);
37
+ expect(commandDefaults.agent).toBe("cdd");
38
+ if (configDetection.cddModel) {
39
+ expect(commandDefaults).toHaveProperty("model");
40
+ }
41
+ });
42
+ it("should apply model config to /cdd:status command defaults", () => {
43
+ const configDetection = detectCDDConfig();
44
+ const commandDefaults = createCommandDefaults(configDetection.cddModel);
45
+ expect(commandDefaults.agent).toBe("cdd");
46
+ if (configDetection.cddModel) {
47
+ expect(commandDefaults).toHaveProperty("model");
48
+ }
49
+ });
50
+ it("should apply model config to /cdd:revert command defaults", () => {
51
+ const configDetection = detectCDDConfig();
52
+ const commandDefaults = createCommandDefaults(configDetection.cddModel);
53
+ expect(commandDefaults.agent).toBe("cdd");
54
+ if (configDetection.cddModel) {
55
+ expect(commandDefaults).toHaveProperty("model");
56
+ }
57
+ });
58
+ });
59
+ describe("Synergy framework scenarios", () => {
60
+ it("should resolve model when oh-my-opencode-slim is active", () => {
61
+ const config = detectCDDConfig();
62
+ if (config.synergyFramework === "oh-my-opencode-slim") {
63
+ expect(config.hasCDDInSlim).toBe(true);
64
+ if (config.cddModel) {
65
+ expect(config.cddModel).toMatch(/^[a-z0-9\-]+\/[a-z0-9\-\.]+$/i);
66
+ }
67
+ }
68
+ });
69
+ it("should resolve model when oh-my-opencode is active", () => {
70
+ const config = detectCDDConfig();
71
+ if (config.synergyFramework === "oh-my-opencode") {
72
+ expect(config.hasCDDInOMO).toBe(true);
73
+ if (config.cddModel) {
74
+ expect(config.cddModel).toMatch(/^[a-z0-9\-]+\/[a-z0-9\-\.]+$/i);
75
+ }
76
+ }
77
+ });
78
+ it("should resolve model with only opencode.json config", () => {
79
+ const config = detectCDDConfig();
80
+ if (config.hasCDDInOpenCode &&
81
+ !config.hasCDDInSlim &&
82
+ !config.hasCDDInOMO) {
83
+ if (config.cddModel) {
84
+ expect(config.cddModel).toMatch(/^[a-z0-9\-]+\/[a-z0-9\-\.]+$/i);
85
+ }
86
+ }
87
+ });
88
+ it("should handle fallback behavior when no config files exist", () => {
89
+ const config = detectCDDConfig();
90
+ if (!config.hasCDDInSlim && !config.hasCDDInOMO && !config.hasCDDInOpenCode) {
91
+ expect(config.synergyFramework).toBe("none");
92
+ expect(config.cddModel).toBeUndefined();
93
+ }
94
+ });
95
+ });
96
+ describe("Backward compatibility tests", () => {
97
+ it("should continue to work with projects without model configuration", () => {
98
+ const config = detectCDDConfig();
99
+ if (!config.cddModel) {
100
+ const commandDefaults = { agent: "cdd" };
101
+ expect(commandDefaults.agent).toBe("cdd");
102
+ expect(commandDefaults).not.toHaveProperty("model");
103
+ }
104
+ });
105
+ it("should handle legacy oh-my-opencode config gracefully", () => {
106
+ const config = detectCDDConfig();
107
+ expect(config).toHaveProperty("hasCDDInOMO");
108
+ expect(typeof config.hasCDDInOMO).toBe("boolean");
109
+ });
110
+ it("should have no regression in existing CDD functionality", () => {
111
+ const config = detectCDDConfig();
112
+ expect(config).toHaveProperty("synergyActive");
113
+ expect(config).toHaveProperty("synergyFramework");
114
+ expect(config).toHaveProperty("hasCDDInSlim");
115
+ expect(config).toHaveProperty("hasCDDInOMO");
116
+ expect(config).toHaveProperty("hasCDDInOpenCode");
117
+ });
118
+ });
119
+ describe("Model priority resolution chain", () => {
120
+ it("should enforce slim > OMO > opencode priority", () => {
121
+ const config = detectCDDConfig();
122
+ if (config.hasCDDInSlim) {
123
+ expect(config.synergyFramework).toBe("oh-my-opencode-slim");
124
+ }
125
+ else if (config.hasCDDInOMO) {
126
+ expect(config.synergyFramework).toBe("oh-my-opencode");
127
+ }
128
+ else if (config.hasCDDInOpenCode) {
129
+ expect(config.synergyFramework).toBe("none");
130
+ }
131
+ });
132
+ it("should resolve model from highest priority framework available", () => {
133
+ const config = detectCDDConfig();
134
+ if (config.hasCDDInSlim && config.cddModel) {
135
+ expect(config.synergyFramework).toBe("oh-my-opencode-slim");
136
+ }
137
+ else if (config.hasCDDInOMO && config.cddModel) {
138
+ expect(config.synergyFramework).toBe("oh-my-opencode");
139
+ }
140
+ else if (config.hasCDDInOpenCode && config.cddModel) {
141
+ expect(config.synergyFramework).toBe("none");
142
+ }
143
+ });
144
+ it("should not override model from lower priority frameworks", () => {
145
+ const config = detectCDDConfig();
146
+ if (config.hasCDDInSlim && config.cddModel) {
147
+ expect(config.hasCDDInOMO || config.hasCDDInOpenCode).toBeDefined();
148
+ }
149
+ else if (config.hasCDDInOMO && config.cddModel) {
150
+ expect(config.hasCDDInSlim).toBe(false);
151
+ }
152
+ });
153
+ });
154
+ describe("Multi-framework coexistence", () => {
155
+ it("should detect when multiple synergy frameworks are present", () => {
156
+ const config = detectCDDConfig();
157
+ const frameworkCount = (config.hasCDDInSlim ? 1 : 0) +
158
+ (config.hasCDDInOMO ? 1 : 0) +
159
+ (config.hasCDDInOpenCode ? 1 : 0);
160
+ expect(frameworkCount).toBeGreaterThanOrEqual(0);
161
+ });
162
+ it("should select slim over OMO when both are available", () => {
163
+ const config = detectCDDConfig();
164
+ if (config.hasCDDInSlim && config.hasCDDInOMO) {
165
+ expect(config.synergyFramework).toBe("oh-my-opencode-slim");
166
+ }
167
+ });
168
+ it("should select OMO over opencode.json when both are available", () => {
169
+ const config = detectCDDConfig();
170
+ if (config.hasCDDInOMO && config.hasCDDInOpenCode && !config.hasCDDInSlim) {
171
+ expect(config.synergyFramework).toBe("oh-my-opencode");
172
+ }
173
+ });
174
+ });
175
+ describe("Configuration consistency across all CDD operations", () => {
176
+ it("should maintain consistent model throughout all command lifecycle", () => {
177
+ const config = detectCDDConfig();
178
+ const model = config.cddModel;
179
+ const commands = ["setup", "newTrack", "implement", "status", "revert"];
180
+ commands.forEach((cmd) => {
181
+ const commandDefaults = model
182
+ ? { agent: "cdd", model }
183
+ : { agent: "cdd" };
184
+ expect(commandDefaults.agent).toBe("cdd");
185
+ if (model) {
186
+ expect(commandDefaults.model).toBe(model);
187
+ }
188
+ });
189
+ });
190
+ it("should apply model config consistently across all synergy scenarios", () => {
191
+ const config = detectCDDConfig();
192
+ const scenarios = [
193
+ config.hasCDDInSlim,
194
+ config.hasCDDInOMO,
195
+ config.hasCDDInOpenCode,
196
+ ];
197
+ scenarios.forEach(() => {
198
+ const commandDefaults = config.cddModel
199
+ ? { agent: "cdd", model: config.cddModel }
200
+ : { agent: "cdd" };
201
+ expect(commandDefaults).toBeDefined();
202
+ });
203
+ });
204
+ });
205
+ describe("Edge cases and error handling", () => {
206
+ it("should handle missing config directory gracefully", () => {
207
+ const config = detectCDDConfig();
208
+ expect(config).toBeDefined();
209
+ expect(config.synergyFramework).toBeDefined();
210
+ });
211
+ it("should handle malformed JSON configs gracefully", () => {
212
+ const config = detectCDDConfig();
213
+ expect(config).toBeDefined();
214
+ expect(() => JSON.stringify(config)).not.toThrow();
215
+ });
216
+ it("should provide sensible defaults when config detection fails", () => {
217
+ const config = detectCDDConfig();
218
+ expect(config.synergyFramework).toBeDefined();
219
+ expect(typeof config.synergyActive).toBe("boolean");
220
+ });
221
+ });
222
+ });
@@ -0,0 +1 @@
1
+ export {};