opencastle 0.31.0 → 0.31.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.
Files changed (45) hide show
  1. package/README.md +3 -3
  2. package/bin/cli.mjs +4 -2
  3. package/dist/cli/convoy/spec-builder.d.ts +68 -0
  4. package/dist/cli/convoy/spec-builder.d.ts.map +1 -0
  5. package/dist/cli/convoy/spec-builder.js +179 -0
  6. package/dist/cli/convoy/spec-builder.js.map +1 -0
  7. package/dist/cli/convoy/spec-builder.test.d.ts +2 -0
  8. package/dist/cli/convoy/spec-builder.test.d.ts.map +1 -0
  9. package/dist/cli/convoy/spec-builder.test.js +453 -0
  10. package/dist/cli/convoy/spec-builder.test.js.map +1 -0
  11. package/dist/cli/pipeline.d.ts +1 -0
  12. package/dist/cli/pipeline.d.ts.map +1 -1
  13. package/dist/cli/pipeline.js +254 -185
  14. package/dist/cli/pipeline.js.map +1 -1
  15. package/dist/cli/pipeline.test.js +15 -1
  16. package/dist/cli/pipeline.test.js.map +1 -1
  17. package/dist/cli/plan.d.ts +1 -1
  18. package/dist/cli/plan.d.ts.map +1 -1
  19. package/dist/cli/plan.js +4 -4
  20. package/dist/cli/plan.js.map +1 -1
  21. package/dist/cli/prompt.js +2 -1
  22. package/dist/cli/prompt.js.map +1 -1
  23. package/dist/cli/run/adapters/claude.js +2 -2
  24. package/dist/cli/run/adapters/claude.js.map +1 -1
  25. package/dist/cli/run/adapters/copilot.js +2 -2
  26. package/dist/cli/run/adapters/copilot.js.map +1 -1
  27. package/dist/cli/run/adapters/cursor.js +1 -1
  28. package/dist/cli/run/adapters/cursor.js.map +1 -1
  29. package/dist/cli/run/adapters/opencode.js +1 -1
  30. package/dist/cli/run/adapters/opencode.js.map +1 -1
  31. package/package.json +1 -1
  32. package/src/cli/convoy/spec-builder.test.ts +523 -0
  33. package/src/cli/convoy/spec-builder.ts +221 -0
  34. package/src/cli/pipeline.test.ts +21 -1
  35. package/src/cli/pipeline.ts +274 -224
  36. package/src/cli/plan.ts +5 -4
  37. package/src/cli/prompt.ts +1 -1
  38. package/src/cli/run/adapters/claude.ts +2 -2
  39. package/src/cli/run/adapters/copilot.ts +2 -2
  40. package/src/cli/run/adapters/cursor.ts +1 -1
  41. package/src/cli/run/adapters/opencode.ts +1 -1
  42. package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
  43. package/src/orchestrator/prompts/fix-convoy.prompt.md +47 -56
  44. package/src/orchestrator/prompts/generate-convoy.prompt.md +85 -295
  45. package/src/orchestrator/prompts/validate-convoy.prompt.md +31 -42
@@ -138,7 +138,7 @@ async function executeViaSdk(task: Task, options: ExecuteOptions = {}): Promise<
138
138
  : undefined
139
139
  return {
140
140
  success: true,
141
- output: output.slice(0, 10_000),
141
+ output: output.slice(0, 500_000),
142
142
  exitCode: 0,
143
143
  usage: usageResult,
144
144
  }
@@ -233,7 +233,7 @@ export async function executeViaCli(task: Task, options: ExecuteOptions = {}): P
233
233
  } catch { /* not JSON or no usage — graceful degradation */ }
234
234
  resolve({
235
235
  success: code === 0,
236
- output: output.slice(0, 10000),
236
+ output: output.slice(0, 500_000),
237
237
  exitCode: code ?? -1,
238
238
  usage,
239
239
  })
@@ -108,7 +108,7 @@ async function executeViaSdk(task: Task, options: ExecuteOptions = {}): Promise<
108
108
  } : undefined
109
109
  return {
110
110
  success: true,
111
- output: output.slice(0, 100_000),
111
+ output: output.slice(0, 500_000),
112
112
  exitCode: 0,
113
113
  usage: usageResult,
114
114
  }
@@ -203,7 +203,7 @@ async function executeViaCli(task: Task, options: ExecuteOptions = {}): Promise<
203
203
  } catch { /* not JSON or no usage — graceful degradation */ }
204
204
  resolve({
205
205
  success: code === 0,
206
- output: output.slice(0, 10000),
206
+ output: output.slice(0, 500_000),
207
207
  exitCode: code ?? -1,
208
208
  usage,
209
209
  })
@@ -98,7 +98,7 @@ export async function execute(task: Task, options: ExecuteOptions = {}): Promise
98
98
  } catch { /* not JSON or no usage — graceful degradation */ }
99
99
  resolve({
100
100
  success: code === 0,
101
- output: output.slice(0, 10000), // Cap output size
101
+ output: output.slice(0, 500_000),
102
102
  exitCode: code ?? -1,
103
103
  usage,
104
104
  })
@@ -89,7 +89,7 @@ export async function execute(task: Task, options: ExecuteOptions = {}): Promise
89
89
  } catch { /* not JSON or no usage — graceful degradation */ }
90
90
  resolve({
91
91
  success: code === 0,
92
- output: output.slice(0, 10000), // Cap output size
92
+ output: output.slice(0, 500_000),
93
93
  exitCode: code ?? -1,
94
94
  usage,
95
95
  })
@@ -1,25 +1,25 @@
1
1
  {
2
- "hash": "92391349",
2
+ "hash": "4f137c25",
3
3
  "configHash": "30f8ea04",
4
- "lockfileHash": "f32f6327",
5
- "browserHash": "a3143d98",
4
+ "lockfileHash": "82bb881c",
5
+ "browserHash": "353b1dbb",
6
6
  "optimized": {
7
7
  "astro > cssesc": {
8
8
  "src": "../../../../../node_modules/cssesc/cssesc.js",
9
9
  "file": "astro___cssesc.js",
10
- "fileHash": "4da4d2a1",
10
+ "fileHash": "0f534c8a",
11
11
  "needsInterop": true
12
12
  },
13
13
  "astro > aria-query": {
14
14
  "src": "../../../../../node_modules/aria-query/lib/index.js",
15
15
  "file": "astro___aria-query.js",
16
- "fileHash": "65e6b113",
16
+ "fileHash": "8e98e147",
17
17
  "needsInterop": true
18
18
  },
19
19
  "astro > axobject-query": {
20
20
  "src": "../../../../../node_modules/axobject-query/lib/index.js",
21
21
  "file": "astro___axobject-query.js",
22
- "fileHash": "bd7268ed",
22
+ "fileHash": "8e5189a3",
23
23
  "needsInterop": true
24
24
  }
25
25
  },
@@ -1,18 +1,18 @@
1
1
  ---
2
- description: 'Fix schema validation errors in a convoy YAML spec. Goal is the broken spec YAML; context is the error list from the validation step.'
2
+ description: 'Fix validation errors in a convoy task plan by outputting targeted JSON patches.'
3
3
  agent: 'Team Lead (OpenCastle)'
4
- output: convoy-spec
4
+ output: json
5
5
  ---
6
6
 
7
7
  <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
8
8
 
9
- # Fix Convoy Spec
9
+ # Fix Task Plan
10
10
 
11
- You are the Team Lead. The convoy spec below failed validation. Fix **every reported error** and output a complete, corrected spec.
11
+ You are the Team Lead. The task plan below has validation errors. Fix every error by outputting targeted JSON patches.
12
12
 
13
- ## Failing Spec
13
+ ## Task Plan
14
14
 
15
- ```yaml
15
+ ```json
16
16
  {{goal}}
17
17
  ```
18
18
 
@@ -22,58 +22,49 @@ You are the Team Lead. The convoy spec below failed validation. Fix **every repo
22
22
 
23
23
  ---
24
24
 
25
- ## Fix Instructions
26
-
27
- 1. Read every error before touching the YAML.
28
- 2. Fix **all** reported errors — do not partially fix.
29
- 3. Do not change the intent, agent assignments, or task scope of any task. Only fix what is broken.
30
- 4. Preserve all `id`, `prompt`, `agent`, `review`, and `files` values that are not part of the reported errors.
31
-
32
- ### Common Fix Patterns
33
-
34
- **Glob patterns in `files`**
35
- - `src/**/*.ts` → `src/` (use the directory, not a glob)
36
- - `app/api/**` → `app/api/`
37
- - `components/*.tsx` → `components/`
38
-
39
- **Missing required fields**
40
- - Add `name:` at the top level if missing
41
- - Add `version: 2` at the top level if missing
42
- - Add `id:` to any task that lacks one (use kebab-case derived from the task purpose)
43
- - Add `prompt:` to any task that lacks one — write a 2-sentence self-contained description
44
-
45
- **Dependency cycles**
46
- - If A depends on B and B depends on A: remove the weaker edge (the one that can be inferred from ordering)
47
- - If the cycle is A → B → C → A: introduce a new intermediate task or reorder so earlier tasks do not depend on later ones
48
-
49
- **Partition conflicts (two parallel tasks sharing files)**
50
- - Option 1: Add a `depends_on` edge to serialize the conflicting tasks
51
- - Option 2: Split one task's `files` list to use a more specific path that does not overlap
52
-
53
- **Invalid `agent` value**
54
- Replace with the closest valid agent from:
55
- `api-designer`, `architect`, `content-engineer`, `copywriter`, `data-expert`,
56
- `database-engineer`, `developer`, `devops-expert`, `documentation-writer`,
57
- `performance-expert`, `release-manager`, `researcher`, `security-expert`,
58
- `seo-specialist`, `team-lead`, `testing-expert`, `ui-ux-expert`
25
+ ## Instructions
26
+
27
+ 1. Read every error before writing patches.
28
+ 2. Fix ALL reported errors — do not partially fix.
29
+ 3. Preserve intent, agent assignments, and task scope. Only fix what is broken.
30
+ 4. Each patch replaces ONE field on ONE task.
31
+
32
+ ## Patch Format
33
+
34
+ Output a single `json` fenced code block with an array of patches:
35
+
36
+ ```json
37
+ [
38
+ {
39
+ "task_id": "the-task-id",
40
+ "field": "prompt",
41
+ "value": "Complete corrected prompt text..."
42
+ },
43
+ {
44
+ "task_id": "another-task",
45
+ "field": "depends_on",
46
+ "value": ["project-scaffold", "shared-ui-components"]
47
+ },
48
+ {
49
+ "task_id": "_plan",
50
+ "field": "concurrency",
51
+ "value": 2
52
+ }
53
+ ]
54
+ ```
59
55
 
60
- **Invalid `timeout` format**
61
- - `"30 minutes"` `30m`
62
- - `"1 hour"` `1h`
63
- - `"120"` `120s`
56
+ ### Patch fields
57
+ - `task_id`: Task ID to modify, or `"_plan"` for top-level plan fields (`name`, `branch`, `concurrency`, `on_failure`, `gates`, `gate_retries`)
58
+ - `field`: Field name to replace (`prompt`, `files`, `depends_on`, `agent`, `timeout`, `description`, `max_retries`, `review`, `gates`)
59
+ - `value`: Complete new value (replaces old value entirely)
64
60
 
65
- ---
61
+ ### Common fixes
62
+ - **Truncated prompt** → patch `field: "prompt"` with the complete, self-contained prompt text
63
+ - **Missing dependency** → patch `field: "depends_on"` with the corrected array
64
+ - **Partition conflict** → patch `field: "files"` to use specific paths, or patch `field: "depends_on"` to add sequencing
65
+ - **Wrong agent** → patch `field: "agent"` with correct value from roster
66
+ - **Vague prompt** → patch with detailed, file-specific prompt including acceptance criteria
66
67
 
67
68
  ## Output
68
69
 
69
- Return the **complete corrected YAML** inside a fenced code block (not just the changed lines):
70
-
71
- ```yaml
72
- # .opencastle/convoys/<same-filename-as-original>
73
- name: ...
74
- version: 2
75
- tasks:
76
- ...
77
- ```
78
-
79
- Do not add explanatory prose before or after the YAML block.
70
+ Your entire response must be a single `json` fenced code block with the patches array. No text before or after.