opencastle 0.18.0 → 0.19.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencastle",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "description": "Multi-agent orchestration framework for AI coding assistants",
6
6
  "bin": {
@@ -1,25 +1,25 @@
1
1
  {
2
- "hash": "2da8e910",
2
+ "hash": "37afd6de",
3
3
  "configHash": "30f8ea04",
4
- "lockfileHash": "d05fc548",
5
- "browserHash": "f317e71b",
4
+ "lockfileHash": "fc91404e",
5
+ "browserHash": "4ed40789",
6
6
  "optimized": {
7
7
  "astro > cssesc": {
8
8
  "src": "../../../../../node_modules/cssesc/cssesc.js",
9
9
  "file": "astro___cssesc.js",
10
- "fileHash": "28561a14",
10
+ "fileHash": "797719d6",
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": "8f623d19",
16
+ "fileHash": "92b9b174",
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": "31fe5731",
22
+ "fileHash": "b81bf886",
23
23
  "needsInterop": true
24
24
  }
25
25
  },
@@ -72,6 +72,20 @@ If the session summary mentions fast reviews or panel reviews, verify matching r
72
72
 
73
73
  Only flag if the session produced code changes that should have been committed. Research-only or analysis sessions may not produce commits.
74
74
 
75
+ ### 7. Convoy Observability (if convoy was executed)
76
+
77
+ If the session involved running a convoy (check for `.opencastle/convoy.db` or references to convoy execution in the session summary):
78
+
79
+ **Verify convoy NDJSON export:**
80
+ - `cat .opencastle/logs/convoys.ndjson | tail -1` should show the latest convoy record
81
+ - Record should have `status: done` or `status: failed` (not `running`)
82
+
83
+ **Verify convoy tasks logged:**
84
+ - Each completed convoy task should have a corresponding event in the NDJSON log
85
+ - Check: `grep '"type":"session"' .github/customizations/logs/events.ndjson | tail -10`
86
+
87
+ **Fix:** If convoy export is missing, the engine should have auto-exported. Manual export: run `opencastle run --status` to verify the convoy completed.
88
+
75
89
  ## Output
76
90
 
77
91
  Return a structured report:
@@ -17,9 +17,12 @@ handoffs:
17
17
  - label: Quick Refinement
18
18
  agent: 'Team Lead (OpenCastle)'
19
19
  prompt: 'Use the quick-refinement prompt to handle these follow-up refinements (UI tweaks, polish, adjustments):'
20
- - label: Generate Convoy Spec
20
+ - label: Generate Convoy
21
21
  agent: 'Team Lead (OpenCastle)'
22
- prompt: 'Use the generate-task-spec prompt to create a .convoy.yml spec for autonomous convoy runs based on:'
22
+ prompt: 'Use the generate-convoy prompt to create a .convoy.yml spec for autonomous convoy execution based on:'
23
+ - label: Run Convoy
24
+ agent: 'Team Lead (OpenCastle)'
25
+ prompt: 'Run an existing .convoy.yml spec file. Parse the spec, validate the DAG, and execute via the convoy engine:'
23
26
  - label: Resolve PR Comments
24
27
  agent: 'Team Lead (OpenCastle)'
25
28
  prompt: 'Use the resolve-pr-comments prompt to resolve the GitHub PR review comments on this PR:'
@@ -135,6 +138,46 @@ See the **team-lead-reference** skill for model tiers, token estimates, duration
135
138
 
136
139
  Before EVERY delegation verify: (1) Tracker issue exists, (2) File partition is clean, (3) Dependencies verified Done, (4) Prompt includes file paths + acceptance criteria, (5) Self-improvement reminder included.
137
140
 
141
+ ## Convoy Integration
142
+
143
+ The convoy engine is the preferred execution mechanism for multi-task work. Use it when a request decomposes into 3 or more subtasks.
144
+
145
+ ### When to use convoy vs. direct delegation
146
+
147
+ | Task count | Approach |
148
+ |------------|----------|
149
+ | 1–2 subtasks | **Direct delegation** — sub-agents inline, standard workflow |
150
+ | 3+ subtasks | **Convoy execution** — generate spec, hand to user to run |
151
+
152
+ ### How to generate a convoy spec
153
+
154
+ 1. Decompose the request into tasks as normal (Steps 1–2)
155
+ 2. Use the `generate-convoy` prompt with the decomposed task list as context
156
+ 3. The `generate-convoy` prompt produces a valid `.convoy.yml` spec with DAG, agents, file scopes, and gates
157
+
158
+ ### How to execute a convoy
159
+
160
+ Tell the user to run:
161
+ ```
162
+ npx opencastle run -f <name>.convoy.yml
163
+ ```
164
+ This gives the user control over when execution starts (preferred — supports overnight/unattended runs and manual review of the spec before execution).
165
+
166
+ ### After convoy completes
167
+
168
+ 1. Run all validation gates (lint, test, build) on the convoy's output branch
169
+ 2. Open a PR from the convoy's configured `branch` — do NOT merge
170
+ 3. Link the PR in the tracker issue
171
+ 4. Log the session record as usual
172
+
173
+ ### What the convoy engine handles automatically
174
+
175
+ - **Isolated git worktrees** per task — parallel agents never touch the same files
176
+ - **Parallel execution** with configurable concurrency
177
+ - **Merge queue ordering** — respects `depends_on` DAG when merging worktrees
178
+ - **Crash recovery** — `opencastle run --resume` continues from last checkpoint
179
+ - **Progress monitoring** — `opencastle run --status` shows live task state
180
+
138
181
  ## Workflow
139
182
 
140
183
  ### Step 1: Understand
@@ -270,7 +270,7 @@ Now that your project is configured, here's what you can do:
270
270
  3. **Implement a feature** — Use the **"Implement Feature"** prompt to have the Team Lead orchestrate a full feature build with task tracking, delegation, and verification
271
271
  4. **Fix a bug** — Use the **"Bug Fix"** prompt for structured triage, root cause analysis, and fix with tracker tracking
272
272
  5. **Brainstorm first** — Not sure how to approach something? Use the **"Brainstorm"** prompt to explore requirements and trade-offs before committing to a plan
273
- 6. **Create a task spec** — Use the **"Generate Task Spec"** prompt to create `opencastle.tasks.yml` for autonomous overnight runs with `npx opencastle run` CLI command.
273
+ 6. **Generate a convoy spec** — Use the **"Generate Convoy"** prompt to create a `.convoy.yml` spec for autonomous convoy execution with `npx opencastle run` CLI command.
274
274
 
275
275
  ## Guidelines
276
276
 
@@ -107,11 +107,12 @@ Not every task needs a brainstorm. Skip this prompt and go directly to `implemen
107
107
  - The task is a simple config change or docs update
108
108
  - The technical approach is obvious and unambiguous
109
109
  - The scope is a single file or component with no design decisions
110
+ - The task is well-understood and can be expressed as a convoy spec directly → use `generate-convoy` instead
110
111
 
111
112
  ## After Brainstorming
112
113
 
113
114
  Once the brainstorm is complete and the user confirms (or you're confident in the approach):
114
115
 
115
- 1. **Transition to planning** — use the brainstorm report as input for `implement-feature` or the appropriate workflow
116
+ 1. **Transition to planning** — use the brainstorm report as input for `implement-feature` (which will choose between direct delegation and convoy execution based on task count)
116
117
  2. **Preserve context** — include the brainstorm report in delegation prompts so agents understand *why* an approach was chosen
117
118
  3. **Reference in tracker** — link the brainstorm findings in the tracker issue description
@@ -1,13 +1,13 @@
1
1
  ---
2
- description: 'Generate a valid .convoy.yml spec file for autonomous convoy runs based on a high-level description of what needs to be done.'
2
+ description: 'Generate a .convoy.yml spec file for autonomous convoy execution based on a high-level goal.'
3
3
  agent: 'Team Lead (OpenCastle)'
4
4
  ---
5
5
 
6
6
  <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .github/customizations/ directory instead. -->
7
7
 
8
- # Generate Task Spec for Autonomous Run
8
+ # Generate Convoy Spec
9
9
 
10
- You are the Team Lead. The user wants to run `opencastle run` to execute a batch of tasks autonomously (e.g., overnight). Your job is to produce a valid `.convoy.yml` file they can feed to the CLI. Derive a short, descriptive, kebab-case filename from the user's goal (2–4 words max) and use it as the filename — for example `auth-refactor.convoy.yml` or `add-search.convoy.yml`. Always use the `.convoy.yml` extension.
10
+ You are the Team Lead. The user wants to run `opencastle run` to execute a batch of tasks autonomously via the convoy engine. Your job is to produce a valid `.convoy.yml` file they can feed to the CLI. Derive a short, descriptive, kebab-case filename from the user's goal (2–4 words max) and use it as the filename — for example `auth-refactor.convoy.yml` or `add-search.convoy.yml`. Always use the `.convoy.yml` extension.
11
11
 
12
12
  ## User Goal
13
13
 
@@ -174,4 +174,4 @@ Also provide:
174
174
  2. An **estimated total duration** (sum of timeouts on the critical path).
175
175
  3. A `--dry-run` command they can use to validate: `npx opencastle run --file <feature-name>.convoy.yml --dry-run`
176
176
 
177
- > **Backward compatibility:** `.tasks.yml` files without `version` still work with the legacy executor. Only spec files with `version: 1` are routed to the convoy engine.
177
+
@@ -45,10 +45,34 @@ Every subtask must be tracked. **No issue = no implementation.** This step produ
45
45
  - **Acceptance criteria:** Verifiable checklist
46
46
  - **Dependencies:** Links to prerequisite issues
47
47
  5. **Link to roadmap** — Reference the roadmap section in the issue description so context is never lost
48
- 6. **Verify issues exist** — List all created issue IDs. If count is 0, do NOT proceed to Step 3
48
+ 6. **Verify issues exist** — List all created issue IDs. If count is 0, do NOT proceed to Step 2.5
49
+
50
+ ### 2.5 Choose Execution Path (BLOCKING — decides how Step 3 proceeds)
51
+
52
+ With the full task list in hand, decide the execution mechanism:
53
+
54
+ | Condition | Execution path |
55
+ |-----------|----------------|
56
+ | 1–2 subtasks | **Direct delegation** — delegate to sub-agents as today (proceed to Step 3 as-is) |
57
+ | 3+ subtasks | **Convoy execution** — generate a `.convoy.yml` spec using the `generate-convoy` prompt, then hand it to the user |
58
+
59
+ #### Direct delegation (1–2 subtasks)
60
+
61
+ Proceed with the normal Step 3 delegation workflow. Sub-agents handle each task inline.
62
+
63
+ #### Convoy execution (3+ subtasks)
64
+
65
+ 1. **Generate the spec** — use the `generate-convoy` prompt with the decomposed task list as context. The spec IS the implementation plan — no manual per-task delegation is needed.
66
+ 2. **Hand the spec to the user** — tell them to run: `npx opencastle run -f <name>.convoy.yml`
67
+ 3. **The convoy engine handles** isolated git worktrees, parallel execution, merge queue ordering, and crash recovery automatically.
68
+ 4. **After convoy completes** — proceed to Step 4 (validation) and Step 5 (delivery/PR). The convoy engine will have created its own commits on the configured branch.
69
+
70
+ > **Why convoy for 3+ tasks?** Parallel worktree isolation prevents file conflicts. The merge queue ensures safe ordering. Crash recovery means a failing task doesn't block others. Manual delegation of 3+ parallel tasks risks conflicts and is harder to monitor.
49
71
 
50
72
  ### 3. Implementation Rules
51
73
 
74
+ > **For convoy execution (3+ subtasks):** The convoy spec file IS the implementation plan — skip the manual delegation workflow below and jump to Step 4 after the user runs the convoy. The convoy engine delegates tasks internally using the agents and prompts defined in the spec.
75
+
52
76
  #### Issue Traceability
53
77
 
54
78
  - **Pass issue ID to every agent** — When delegating a subtask (sub-agent or background), include the tracker issue ID and title in the prompt so the agent knows which tracked task it is completing
@@ -93,6 +117,8 @@ Every subtask must pass ALL gates before being marked Done:
93
117
 
94
118
  Follow the **Delivery Outcome** defined in the **git-workflow** skill — commit, push, open PR (not merged), and link to the tracker.
95
119
 
120
+ > **For convoy execution:** The convoy engine creates commits on the configured `branch` directly. After validation passes, open the PR from that branch. No additional commits from the Team Lead are needed unless gates failed and required manual fixes.
121
+
96
122
  ### 6. Documentation & Traceability
97
123
 
98
124
  Keep documentation current so future sessions have full context:
@@ -127,6 +127,8 @@ Stop the follow-up workflow and switch to a full roadmap task if:
127
127
 
128
128
  When escalating, explain to the user what you found and why it needs proper tracking.
129
129
 
130
+ - **Multi-task escalation** — If the refinement decomposes into 3+ subtasks, switch to `implement-feature` (which will use convoy execution for multi-task work)
131
+
130
132
  ### 8. Completion
131
133
 
132
134
  The follow-up is complete when: