Skip to content

Commit 8a879e5

Browse files
committed
Overhaul Greybeard prompt
Teach Greybeard named-identity architecture judgment, limited spawn without fake caps, and search_agents blinders instead of review-theater scheduler language. Closes CL-7019
1 parent 02a3f85 commit 8a879e5

2 files changed

Lines changed: 72 additions & 32 deletions

File tree

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

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,61 @@ describe("greybeardPackage", () => {
66
expect(greybeardPackage.id).toBe("greybeard");
77
});
88

9-
test("systemPrompt is real (not Placeholder)", () => {
9+
test("systemPrompt is non-empty and not a Placeholder", () => {
1010
expect(greybeardPackage.systemPrompt.length).toBeGreaterThan(0);
1111
expect(greybeardPackage.systemPrompt.startsWith("Placeholder")).toBe(false);
1212
});
1313

14-
test("systemPrompt states PRIMARY INTENT and GreybeardDirector", () => {
15-
expect(greybeardPackage.systemPrompt).toMatch(/PRIMARY INTENT/i);
16-
expect(greybeardPackage.systemPrompt).toContain("GreybeardDirector");
14+
test("systemPrompt mentions PRIMARY INTENT", () => {
15+
expect(greybeardPackage.systemPrompt).toContain("PRIMARY INTENT");
16+
});
17+
18+
test("systemPrompt identity is Greybeard / GreybeardDirector (not job-title language)", () => {
19+
const p = greybeardPackage.systemPrompt;
20+
expect(p).toMatch(/GreybeardDirector \(Greybeard\)/);
21+
expect(p).toMatch(/architecture judgment/i);
22+
expect(p).not.toMatch(/architecture director/i);
23+
});
24+
25+
test("systemPrompt teaches judgment for architecture approach", () => {
26+
const p = greybeardPackage.systemPrompt;
27+
expect(p).toContain("Judge the approach");
28+
expect(p).toMatch(/constraint ownership|owns constraints/i);
29+
expect(p).toMatch(/hold \/ revise \/ block|verdict/i);
30+
expect(p).toMatch(/backward-compatibility|backward compatibility/i);
31+
});
32+
33+
test("systemPrompt allows limited spawn without fake caps or scheduler language", () => {
34+
const p = greybeardPackage.systemPrompt;
35+
expect(p).toMatch(/intern/);
36+
expect(p).toMatch(/explore/);
37+
expect(p).toMatch(/critique/);
38+
expect(p).toMatch(/Prefer doing the review yourself/i);
39+
expect(p).toMatch(/Do not invent numeric spawn caps|not a soft ladder/i);
40+
expect(p).not.toMatch(/at most \d+/i);
41+
expect(p).not.toMatch(/spawn at most one/i);
42+
expect(p).not.toMatch(/parallel diagnostic fleet/i);
43+
expect(p).not.toMatch(/turn budget/i);
44+
expect(p).not.toMatch(/parameters?:/i);
45+
expect(p).not.toMatch(/fan-out/i);
46+
});
47+
48+
test("systemPrompt has Blinders against search_agents fleet discovery", () => {
49+
const p = greybeardPackage.systemPrompt;
50+
expect(p).toMatch(/Blinders/i);
51+
expect(p).toMatch(/do not call search_agents/i);
52+
expect(p).toMatch(/even when nested/i);
53+
});
54+
55+
test("systemPrompt guides quality without enforcement theater", () => {
56+
const p = greybeardPackage.systemPrompt;
57+
expect(p).toMatch(/Guide quality/i);
58+
expect(p).toMatch(/enforcement theater/i);
59+
});
60+
61+
test("systemPrompt forbids spawning build and names off-list directors", () => {
62+
expect(greybeardPackage.systemPrompt).toContain("Do not spawn build");
63+
expect(greybeardPackage.systemPrompt).not.toMatch(/\bspawn implement\b/);
1764
});
1865

1966
test("spawn.maySpawn is true with limited allowlist", () => {
@@ -33,17 +80,6 @@ describe("greybeardPackage", () => {
3380
expect(allow).not.toContain("plan");
3481
});
3582

36-
test("systemPrompt forbids spawning implement and names build as off-list", () => {
37-
expect(greybeardPackage.systemPrompt).not.toMatch(/\bspawn implement\b/);
38-
expect(greybeardPackage.systemPrompt).toContain("Do not spawn build");
39-
});
40-
41-
test("systemPrompt forbids parallel diagnostic fleets", () => {
42-
expect(greybeardPackage.systemPrompt).toMatch(/do the review yourself/i);
43-
expect(greybeardPackage.systemPrompt).toMatch(/spawn at most one intern/i);
44-
expect(greybeardPackage.systemPrompt).toMatch(/never spawn a parallel diagnostic fleet/i);
45-
});
46-
4783
test("tools.allow is orchestrator surface without product writes", () => {
4884
const allow = greybeardPackage.tools?.allow ?? [];
4985
expect(allow).toContain("task");
@@ -62,7 +98,7 @@ describe("greybeardPackage", () => {
6298
});
6399

64100
test("primaryIntent and outOfLane match greybeard lane", () => {
65-
expect(greybeardPackage.primaryIntent).toBe("Architecture review; limited spawn");
101+
expect(greybeardPackage.primaryIntent).toBe("Architecture judgment; limited spawn");
66102
expect(greybeardPackage.outOfLane).toContain("shipping product code");
67103
expect(greybeardPackage.outOfLane).toContain("pedantic style-only nitpicking");
68104
});

src/agent/directors/greybeard/package.ts

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import type { DirectorPackage } from "../types.js";
22
import { ORCHESTRATOR_TOOLS } from "../tool-sets.js";
33

44
/**
5-
* Architecture review leaf with limited spawn (CL-5821).
6-
* Evidence via intern/explore/critique only — never ships product code.
5+
* Greybeard nested orchestrator (CL-7019).
6+
* Architecture judgment with limited spawn — never ships product code.
77
*/
88
export const greybeardPackage: DirectorPackage = {
99
id: "greybeard",
10-
primaryIntent: "Architecture review; limited spawn",
10+
primaryIntent: "Architecture judgment; limited spawn",
1111
outOfLane: ["shipping product code", "pedantic style-only nitpicking"],
12-
description: "Architecture review leaf",
12+
description: "Architecture judgment leaf",
1313
optionalSkills: ["style", "philosophy"],
1414
tools: { allow: ORCHESTRATOR_TOOLS },
1515
spawn: {
@@ -18,22 +18,26 @@ export const greybeardPackage: DirectorPackage = {
1818
},
1919
modelRole: "review",
2020
tier: "nested-orchestrator",
21-
systemPrompt: `You are GreybeardDirector, a specialist in Corbits Code.
21+
systemPrompt: `You are GreybeardDirector (Greybeard), a specialist in Corbits Code.
2222
23-
PRIMARY INTENT: architecture review. Judge soundness, constraint ownership, and backward-compatibility implications. Do not fix or ship product code.
23+
PRIMARY INTENT: architecture judgment. Judge approach soundness, constraint ownership, and backward-compatibility implications. Teach what holds and what does not. Do not fix or ship product code.
2424
25-
Load style and philosophy when reviewing plans or approaches — skills are active constraints, not background docs.
25+
You are Greybeard — not a second Skywalker, not Critique (code defects with evidence), not Build. Your value is architectural judgment, not legwork or implementation.
2626
27-
You may spawn only intern, explore, and critique for evidence gathering. Do not spawn build, plan, skywalker, or other directors. Your value is analysis, not legwork or implementation.
27+
Judge the approach:
28+
1. Name the architectural claim under review (boundary, ownership, invariant, or BC surface).
29+
2. Decide whether the proposed approach owns constraints at the right layer — or only chases symptoms.
30+
3. Call out holes, anti-patterns, missing invariants, product/architecture/implementation misalignment, and duplication that should be refactor or API expansion instead.
31+
4. Rank risks for long-term maintainability and backward compatibility.
32+
5. Report a clear verdict: hold / revise / block — with the why, not a checklist theater.
2833
29-
Do the review yourself. Spawn at most one intern, explore, or critique evidence leaf when a single unknown path blocks you. Never spawn a parallel diagnostic fleet.
34+
Spawn only when a concrete unknown blocks that judgment. Package spawn rules allow intern (mechanical shell), explore (map/read), and critique (code evidence). Prefer doing the review yourself with mounted read/search tools. Do not invent numeric spawn caps or act as a scheduler — width follows the unknown, not a soft ladder.
3035
31-
Focus on:
32-
- Architectural holes, anti-patterns, missing invariants
33-
- Constraint ownership (fixed at the right layer, not symptom-chasing)
34-
- BC implications and long-term maintainability
35-
- Misalignment between product, architecture, and implementation
36-
- Duplication that should be refactor/API expansion instead
36+
Blinders: do not call search_agents to discover the fleet (even when nested). You already know the limited spawn set; stay inside it. Do not spawn build, plan, skywalker, or other directors outside the allowlist.
3737
38-
OUT OF LANE: shipping product code, pedantic style-only nitpicking, being a second primary orchestrator.`,
38+
Guide quality — advise what good architecture looks like for this change. Do not assert enforcement theater (fake caps, pretend runtime gates, or "must spawn N" rules the harness does not enforce).
39+
40+
Before substantial review work: follow style and philosophy conventions (baked; use_skill is not mounted on workers).
41+
42+
OUT OF LANE: shipping product code, pedantic style-only nitpicking, being a second primary orchestrator, discovering or dispatching the full fleet.`,
3943
};

0 commit comments

Comments
 (0)