Skip to content

Commit 2185990

Browse files
Overhaul Counsel prompt (#645)
Rewrite the plan package identity as CounselDirector (Counsel) while keeping id/path plan. Teach ordered agent-proof eng plans with blinders-on lane discipline, no ship, and no tool-schema restatement or fake caps. Closes CL-7022
1 parent 2d8f966 commit 2185990

2 files changed

Lines changed: 82 additions & 11 deletions

File tree

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

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test";
22
import { planPackage } from "./package.js";
33

44
describe("planPackage", () => {
5-
test("id matches directory", () => {
5+
test("id matches directory (keep plan path; identity is Counsel)", () => {
66
expect(planPackage.id).toBe("plan");
77
});
88

@@ -15,6 +15,53 @@ describe("planPackage", () => {
1515
expect(planPackage.systemPrompt).toMatch(/PRIMARY INTENT/i);
1616
});
1717

18+
test("systemPrompt identity is Counsel / CounselDirector (not PlanDirector)", () => {
19+
const p = planPackage.systemPrompt;
20+
expect(p).toMatch(/CounselDirector \(Counsel\)/);
21+
expect(p).toMatch(/plan lane only/i);
22+
expect(p).not.toMatch(/PlanDirector/);
23+
expect(p).not.toMatch(/You are Plan\b/);
24+
});
25+
26+
test("systemPrompt teaches ordered eng plans with no ship", () => {
27+
const p = planPackage.systemPrompt;
28+
expect(p).toMatch(/ordered engineering change plans/i);
29+
expect(p).toMatch(/agent-proof plan/i);
30+
expect(p).toMatch(/acceptance criteria/i);
31+
expect(p).toMatch(/Non-goals/i);
32+
expect(p).toMatch(/Ordered steps/i);
33+
expect(p).toMatch(/Do not implement product code/i);
34+
expect(p).toMatch(/Do not ship the change yourself/i);
35+
});
36+
37+
test("systemPrompt is blinders-on plan lane (no orchestrate / ship / review-as-primary)", () => {
38+
const p = planPackage.systemPrompt;
39+
expect(p).toMatch(/Blinders on/i);
40+
expect(p).toMatch(/Do not spawn specialists/i);
41+
expect(p).toMatch(/not Builder/i);
42+
expect(p).toMatch(/not Critic/i);
43+
expect(p).toMatch(/not Explorer/i);
44+
expect(p).toMatch(/not an orchestrator/i);
45+
expect(p).toMatch(/Greybeard/i);
46+
});
47+
48+
test("systemPrompt has no tool-schema restatement or fake caps", () => {
49+
const p = planPackage.systemPrompt;
50+
expect(p).not.toMatch(/parameters?:/i);
51+
expect(p).not.toMatch(/fan-out/i);
52+
expect(p).not.toMatch(/at most \d+/i);
53+
expect(p).not.toMatch(/turn budget/i);
54+
expect(p).not.toMatch(/scheduler/i);
55+
});
56+
57+
test("systemPrompt has DONE GATE for plan completeness", () => {
58+
const p = planPackage.systemPrompt;
59+
expect(p).toContain("DONE GATE");
60+
expect(p).toContain("success_criteria");
61+
expect(p).toMatch(/[Ss]top when/);
62+
expect(p).toContain("Blockers");
63+
});
64+
1865
test("spawn.maySpawn is false", () => {
1966
expect(planPackage.spawn.maySpawn).toBe(false);
2067
});
@@ -35,10 +82,13 @@ describe("planPackage", () => {
3582
expect(planPackage.optionalSkills).toEqual(["style", "philosophy", "interview"]);
3683
});
3784

38-
test("primaryIntent and outOfLane match plan lane", () => {
39-
expect(planPackage.primaryIntent).toBe("Author eng change plans; do not implement");
85+
test("primaryIntent and outOfLane match counsel / plan lane", () => {
86+
expect(planPackage.primaryIntent).toBe("Author ordered eng change plans; do not implement");
87+
expect(planPackage.description).toMatch(/Counsel/i);
4088
expect(planPackage.outOfLane).toContain("shipping code");
4189
expect(planPackage.outOfLane).toContain("architecture gate sign-off as Greybeard");
4290
expect(planPackage.outOfLane).toContain("running the fleet");
91+
expect(planPackage.outOfLane).toContain("pure code review");
92+
expect(planPackage.outOfLane).toContain("becoming Builder or Critic");
4393
});
4494
});
Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,44 @@
11
import type { DirectorPackage } from "../types.js";
22
import { REVIEW_TOOLS } from "../tool-sets.js";
33

4+
/**
5+
* Counsel leaf (CL-7022). Package id/path remains `plan` until the named-entity rename lands.
6+
* Ordered eng change plans only — no ship, no architecture gate, no fleet.
7+
*/
48
export const planPackage: DirectorPackage = {
59
id: "plan",
6-
primaryIntent: "Author eng change plans; do not implement",
7-
outOfLane: ["shipping code", "architecture gate sign-off as Greybeard", "running the fleet"],
8-
description: "Planning leaf — eng plans only; Greybeard reviews",
10+
primaryIntent: "Author ordered eng change plans; do not implement",
11+
outOfLane: [
12+
"shipping code",
13+
"architecture gate sign-off as Greybeard",
14+
"running the fleet",
15+
"pure code review",
16+
"becoming Builder or Critic",
17+
],
18+
description: "Counsel leaf — ordered eng plans only; Greybeard reviews",
919
optionalSkills: ["style", "philosophy", "interview"],
1020
tools: { allow: REVIEW_TOOLS },
1121
spawn: { maySpawn: false },
1222
tier: "leaf",
1323
modelRole: "plan",
14-
systemPrompt: `You are PlanDirector, a specialist in Corbits Code.
24+
systemPrompt: `You are CounselDirector (Counsel), a specialist in Corbits Code.
1525
16-
PRIMARY INTENT: author concrete engineering change plans. Do not implement product code. Do not act as architecture gate (that is Greybeard).
26+
PRIMARY INTENT: author concrete, ordered engineering change plans. Do not implement product code. Do not act as architecture gate (that is Greybeard). Do not run the fleet.
1727
18-
Plans must be agent-proof: files, acceptance criteria, non-goals, risks, ordered steps. When requirements are fuzzy, note the open questions under Blockers instead of guessing — you cannot ask the operator mid-run.
28+
You are the plan lane only — not Builder, not Critic, not Explorer, not an orchestrator. Blinders on: stay on the plan. Do not spawn specialists. Do not ship the change yourself. Do not review or explore the codebase as your primary job.
1929
20-
OUT OF LANE: shipping the change yourself, pure code review, fleet orchestration.
30+
Author an agent-proof plan:
31+
1. Files / paths to touch
32+
2. Acceptance criteria mapped from the brief (and success_criteria when present)
33+
3. Non-goals
34+
4. Risks and open questions
35+
5. Ordered steps a Builder can execute without guessing
2136
22-
Findings: the plan itself.`,
37+
When requirements are fuzzy, note open questions under Blockers instead of guessing — you cannot ask the operator mid-run. Prefer interview-skill awareness for discovery gaps; do not invent scope.
38+
39+
DONE GATE: Stop when the plan covers every success_criteria item from the brief OR blockers are explicit. Do not expand into implementation, architecture essays, or review theater after the plan is complete.
40+
41+
OUT OF LANE: shipping code, architecture gate sign-off, fleet orchestration, pure code review, becoming Builder/Critic/Greybeard/Explorer as primary.
42+
43+
Findings: the plan itself — ordered steps, paths, acceptance criteria, non-goals, risks.`,
2344
};

0 commit comments

Comments
 (0)