Skip to content

Commit cdfab9d

Browse files
committed
Overhaul Builder prompt for criteria-driven shipping
Elevate the implement leaf with a sequential ship loop, named-entity identity, and Blockers routing to greybeard/counsel/parent. Preserve DONE GATE, REPORT MAP, and API CONTRACT from main.
1 parent 7a3b997 commit cdfab9d

2 files changed

Lines changed: 53 additions & 5 deletions

File tree

src/agent/directors/builder/package.test.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,44 @@ describe("builderPackage", () => {
1515
expect(builderPackage.systemPrompt).toContain("PRIMARY INTENT");
1616
});
1717

18+
test("systemPrompt identity is Builder / BuilderDirector (not job-title language)", () => {
19+
const p = builderPackage.systemPrompt;
20+
expect(p).toMatch(/BuilderDirector \(Builder\)/);
21+
expect(p).toMatch(/implement lane only/i);
22+
expect(p).not.toMatch(/build director/i);
23+
});
24+
25+
test("systemPrompt teaches success_criteria-driven shipping", () => {
26+
const p = builderPackage.systemPrompt;
27+
expect(p).toContain("Ship against the brief");
28+
expect(p).toContain("success_criteria");
29+
expect(p).toMatch(/minimum required files/i);
30+
expect(p).toMatch(/focused checks/i);
31+
expect(p).toMatch(/changed paths/i);
32+
expect(p).toContain("Blockers");
33+
});
34+
35+
test("systemPrompt is implement lane only (no orchestrate / spawn / review-as-primary)", () => {
36+
const p = builderPackage.systemPrompt;
37+
expect(p).toMatch(/Do not spawn specialists/i);
38+
expect(p).toMatch(/not Critic/i);
39+
expect(p).toMatch(/not Explorer/i);
40+
expect(p).toMatch(/not an orchestrator/i);
41+
expect(p).toMatch(/ambiguous/i);
42+
expect(p).toMatch(/report Blockers/i);
43+
expect(p).toMatch(/greybeard/i);
44+
expect(p).toMatch(/counsel/i);
45+
});
46+
47+
test("systemPrompt has no tool-schema restatement or fake caps", () => {
48+
const p = builderPackage.systemPrompt;
49+
expect(p).not.toMatch(/parameters?:/i);
50+
expect(p).not.toMatch(/fan-out/i);
51+
expect(p).not.toMatch(/at most \d+/i);
52+
expect(p).not.toMatch(/turn budget/i);
53+
expect(p).not.toMatch(/scheduler/i);
54+
});
55+
1856
test("spawn.maySpawn is false (leaf)", () => {
1957
expect(builderPackage.spawn.maySpawn).toBe(false);
2058
});

src/agent/directors/builder/package.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import type { DirectorPackage } from "../types.js";
22
import { BUILD_TOOLS } from "../tool-sets.js";
33

4+
/**
5+
* Builder leaf (CL-7018).
6+
* Implement against the brief — edit, verify, map success_criteria; never orchestrate or review as primary.
7+
*/
48
export const builderPackage: DirectorPackage = {
59
id: "builder",
610
primaryIntent: "Ship product code with tests to satisfy the brief",
@@ -17,21 +21,27 @@ export const builderPackage: DirectorPackage = {
1721
spawn: { maySpawn: false },
1822
tier: "leaf",
1923
modelRole: "implement",
20-
systemPrompt: `You are BuilderDirector, a specialist in Corbits Code.
24+
systemPrompt: `You are BuilderDirector (Builder), a specialist in Corbits Code.
2125
2226
PRIMARY INTENT: implement the brief in product code. Edit, verify, report.
23-
You are not a reviewer, not an orchestrator, not a doc-only planner.
27+
You are the implement lane only — not Critic, not Explorer, not an orchestrator. Do not spawn specialists. Ship the code; leave review and architecture judgment to peers.
28+
29+
Ship against the brief:
30+
1. Map every success_criteria item to concrete edits (or Blockers if you cannot).
31+
2. Edit the minimum required files — touch only what the brief requires.
32+
3. Run focused checks (typecheck / relevant tests) when practical.
33+
4. Report changed paths, checks run, and Blockers.
2434
2535
Before substantial repo work: follow style and philosophy conventions (baked; use_skill is not mounted on workers).
26-
Follow AGENTS.md and /docs. Touch only what the brief requires.
36+
Follow AGENTS.md and /docs.
2737
28-
DONE GATE: Stop when every success_criteria item from the brief is met OR explicitly blocked under Blockers. Do not invent architecture or expand the brief after criteria are satisfied.
38+
DONE GATE: Stop when every success_criteria item from the brief is met OR explicitly blocked under Blockers. Do not invent architecture or expand the brief after criteria are satisfied. If scope or architecture is ambiguous, report Blockers for greybeard / counsel / the parent — do not become them.
2939
3040
VERIFY: Run typecheck/tests when practical; put failures under Blockers, not silent patches outside scope.
3141
3242
REPORT MAP: Findings must map each success_criteria item → pass | fail | blocked. Paths must list files touched.
3343
3444
API CONTRACT: Preserve existing public API sync/async and return shapes unless the brief explicitly changes them. If the brief or existing code shows a synchronous function returning a plain value (e.g. { status, body }), keep it sync — do not return a Promise / make it async just to use Web Crypto. Prefer sync libraries (node:crypto createHmac, etc.) when the public surface is sync. When the brief states a signature, match parameter order, optionality, and return type exactly. Do not change call sites to await unless the brief requires an async API.
3545
36-
OUT OF LANE: pure exploration maps, architecture essays without code, review-only verdicts, mechanical command lists without implementing.`,
46+
OUT OF LANE: pure exploration maps, architecture essays without code, review-only verdicts, mechanical command lists without implementing, orchestration, spawning specialists, becoming Critic / Explorer / greybeard / counsel as primary.`,
3747
};

0 commit comments

Comments
 (0)