Skip to content

Commit 2f78021

Browse files
Merge pull request #1317 from corbitsdev/cl-9900-dispatch-card-smaller-tasks-more-parallel-agents
feat(dispatch): spawn first with no parallelization cap
2 parents fa15f46 + 1d18c34 commit 2f78021

4 files changed

Lines changed: 34 additions & 6 deletions

File tree

‎src/agent/directors/dispatch/package.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ You are Dispatch, the coordinator for Corbits Code. Specialists own substantive
1919
2020
# Delegation boundary
2121
- Delegate by default. File count does not determine complexity: a single-file bug fix or behavior change still belongs to coder.
22-
- Answer directly when existing context or one or two targeted reads suffice. Delegate broader investigation to explorer.
22+
- Answer directly only for trivia already in context. One or two targeted reads are trivia, not a repo walk. Do not DIY-map explorer work.
2323
- Before editing, classify the change. DIY is only for obvious mechanical corrections requiring no diagnosis, design, new behavior, or new tests. If uncertain, delegate.
24-
- Read only enough to route and write a useful brief. Existing exploration is not permission to implement; do not solve the task yourself before spawning.
24+
- Read only enough to route and write a useful brief. Spawn on the first assistant turn for investigation, implementation, or multi-ticket work. Existing exploration is not permission to implement; do not solve the task yourself before spawning.
2525
2626
# Rules
2727
- Edit files with file tools only, never shell redirection or sed.
@@ -31,7 +31,10 @@ You are Dispatch, the coordinator for Corbits Code. Specialists own substantive
3131
3232
# Spawn
3333
- Brief: description, prompt, relevant context, success_criteria, do_not, report_focus. The worker starts blank.
34-
- Spawn independent lanes together. Do not duplicate a live worker's work. On mailbox surfaces, yield and process incoming reports; where wait_agents is mounted, collect with it instead.
34+
- Latest operator turn is law. Do not re-litigate or ask how they want it solved when they named the outcome.
35+
- Spawn independent lanes in the same turn. There is no parallelization cap. Duplicate = the same live job, not the same repo.
36+
- Split by path, ownership, or lens. One worker = one outcome. Independent tickets/files/reviews go out together. Do not serialize explorer-then-coder unless the coder brief needs the map.
37+
- After spawn, yield. Mailbox (TUI/nested) or wait_agents (exec) delivers. Spawn the next independent wave before the first finishes. Do not poll.
3538
- Use reports as the working record. Resolve gaps with the same worker instead of repeating its investigation. Route unfinished implementation back to coder, not yourself.
3639
- After coder finishes non-trivial or risky code changes, including single-file changes, run reviewer on the diff. Skip review only for mechanical or docs-only diffs and say so.
3740
@@ -49,10 +52,9 @@ export const dispatchPackage: DirectorPackage = {
4952
outOfLane: [
5053
"substantive product work without spawning, including single-file behavior changes",
5154
"docs/design authorship (PRODUCT.md, ARCHITECTURE.md, DESIGN.md) except one-line fixes",
52-
"deep multi-path repo walks when a single explorer worker or mounted tools suffice",
55+
"walking the repo yourself; spawn explorers (as many as the question needs)",
5356
"being the reviewer, planner, or coder by default",
5457
"catch-all worker",
55-
"diagnostic fleets for why/how/stall questions",
5658
"searching the repo yourself after a worker stops without finishing",
5759
],
5860
description:

‎src/agent/directors/registry.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,20 @@ describe("director registry", () => {
182182
expect(tierForDirectorId("prober")).toBe("leaf");
183183
});
184184

185+
test("dispatch card has no parallelization cap; duplicate is the same live job", () => {
186+
const card = DIRECTOR_REGISTRY.dispatch.systemPrompt;
187+
expect(card).toContain("no parallelization cap");
188+
expect(card).toMatch(/same live job/i);
189+
expect(card).not.toMatch(/Do not duplicate a live worker/i);
190+
});
191+
192+
test("dispatch outOfLane spawns explorers instead of walking the repo", () => {
193+
const lanes = DIRECTOR_REGISTRY.dispatch.outOfLane.join("\n");
194+
expect(lanes).not.toMatch(/diagnostic fleet/i);
195+
expect(lanes).not.toMatch(/single explorer worker/i);
196+
expect(lanes).toMatch(/spawn explorer/i);
197+
});
198+
185199
test("every director profile declares matching agent id in system prompt", () => {
186200
for (const id of DIRECTOR_IDS) {
187201
const profile = packageToProfile(DIRECTOR_REGISTRY[id]);

‎src/agent/prompt-sizes.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const PROMPT_SIZE_BASELINE: Record<
3434
DirectorId,
3535
{ chars: number; bytes: number }
3636
> = {
37-
dispatch: { chars: 3551, bytes: 3555 },
37+
dispatch: { chars: 5277, bytes: 5281 },
3838
explorer: { chars: 4041, bytes: 4059 },
3939
planner: { chars: 4439, bytes: 4447 },
4040
coder: { chars: 4705, bytes: 4715 },

‎src/prompts.test.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ test("chat system prompt keeps the routing, spawn-brief, and rules sections", ()
1919
expect(prompt).toContain("manage_tasks");
2020
});
2121

22+
test("dispatch card is spawn-first with no parallelization cap", () => {
23+
const prompt = buildChatSystemPrompt();
24+
expect(prompt).toContain("# Spawn");
25+
expect(prompt).toContain("no parallelization cap");
26+
expect(prompt).toMatch(/first assistant turn/i);
27+
expect(prompt).toMatch(/same turn/i);
28+
expect(prompt).toMatch(/same live job/i);
29+
expect(prompt).not.toMatch(/Do not duplicate a live worker/i);
30+
expect(prompt).not.toMatch(/diagnostic fleet/i);
31+
expect(prompt).not.toMatch(/single explorer worker/i);
32+
});
33+
2234
const envBase: EnvironmentInfo = {
2335
cwd: "/tmp/proj",
2436
platform: "test",

0 commit comments

Comments
 (0)