Skip to content

Commit 80560d4

Browse files
committed
Ship keepstyle guideline split and dedupe worker report envelopes
1 parent bf79cc0 commit 80560d4

15 files changed

Lines changed: 256 additions & 118 deletions

File tree

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,13 @@ describe("bruckheimerPackage", () => {
8080
expect(p).not.toMatch(/maySpawn:\s*true/);
8181
});
8282

83-
test("systemPrompt teaches worker report shape Summary/Findings/Blockers/Paths", () => {
83+
test("systemPrompt points at the scaffold-owned worker report envelope (no re-spec)", () => {
8484
const p = bruckheimerPackage.systemPrompt;
85-
expect(p).toContain("## Summary");
86-
expect(p).toContain("## Findings");
87-
expect(p).toContain("## Blockers");
88-
expect(p).toContain("## Paths");
85+
expect(p).toMatch(/Corbits report envelope/);
86+
expect(p).not.toContain("## Summary");
87+
expect(p).not.toContain("## Findings");
88+
expect(p).not.toContain("## Blockers");
89+
expect(p).not.toContain("## Paths");
8990
expect(p).toMatch(/brief file you wrote/i);
9091
expect(p).toContain("DONE GATE");
9192
});

src/agent/directors/bruckheimer/package.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,7 @@ Use \`read_file\`, \`write_file\`, and \`edit_file\` to manage the brief. Use \`
129129
130130
# Report (when dispatched as a worker)
131131
132-
When you finish a discovery brief for a parent session, stop tooling and reply with ONLY:
133-
134-
## Summary
135-
One or two sentences: what you accomplished or concluded.
136-
137-
## Findings
138-
Audience, hook, win, scope cuts, glossary highlights, and anything the parent needs from the brief.
139-
140-
## Blockers
141-
Open questions, assumptions, or blockers. Write "None." if clear. Name Builder / Counsel / Greybeard / Shakespeare when the ask belongs to them.
142-
143-
## Paths
144-
The brief file you wrote (one path). Write "None." if you refused a brief because the bar was not met.
132+
When you finish a discovery brief for a parent session, stop tooling and reply with ONLY the Corbits report envelope — the shared scaffold owns its shape (Summary / Findings / Blockers / Paths, in that order), so this package does not re-specify it. Findings for this lane: audience, hook, win, scope cuts, glossary highlights, and anything the parent needs from the brief. Blockers: name Builder / Counsel / Greybeard / Shakespeare when the ask belongs to them. Paths: the brief file you wrote (one path); "None." if you refused a brief because the bar was not met.
145133
146134
DONE GATE: Stop when audience, hook, and win are nailed and the brief is written (or you refused because the idea is not real), OR when Blockers need the parent. Do not invent architecture, ship code, author eng step-plans, or expand past discovery.
147135

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ describe("internPackage", () => {
1818
expect(p).toMatch(/execute clear (mechanical )?instructions/i);
1919
expect(p).toMatch(/STOP/i);
2020
expect(p).toMatch(/Blockers/i);
21-
expect(p).toMatch(/## Summary/);
22-
expect(p).toMatch(/## Findings/);
23-
expect(p).toMatch(/## Paths/);
21+
// Envelope shape is scaffold-owned: point at it, do not re-specify it.
22+
expect(p).toMatch(/Corbits report envelope/);
23+
expect(p).not.toMatch(/## Summary/);
24+
expect(p).not.toMatch(/## Findings/);
25+
expect(p).not.toMatch(/## Paths/);
2426
expect(p).toMatch(/run_shell/);
2527
// Role forbids debugging; body states the ban explicitly
2628
expect(p).toMatch(/You do NOT:[\s\S]*Debug failures/);

src/agent/directors/intern/package.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,5 @@ STOP. You are outside your role. Report Blockers for the parent (Skywalker) inst
119119
120120
# Report Contract
121121
122-
When done (or blocked), stop calling tools and reply with ONLY this markdown envelope:
123-
124-
## Summary
125-
One or two sentences: what you ran or why you stopped.
126-
127-
## Findings
128-
Commands run and their outputs (verbatim where useful). Observable facts only.
129-
130-
## Blockers
131-
Ambiguity, failures, missing inputs, or decisions needed. Write "None." if clear. Do not invent fixes.
132-
133-
## Paths
134-
Key file paths you read or changed (one per line). Write "None." if none.`,
122+
When done (or blocked), stop calling tools and reply with ONLY the Corbits report envelope (Summary / Findings / Blockers / Paths) — the shared scaffold owns its shape, so this package does not re-specify it. See How to Report Back for what goes under Findings / Blockers.`,
135123
};

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,16 @@ describe("neckbeardPackage", () => {
4848
expect(p).toMatch(/code \(when the brief asks\)|code review/i);
4949
});
5050

51-
test("systemPrompt bakes style/philosophy and reports to parent", () => {
51+
test("systemPrompt bakes style/philosophy and points at the shared envelope", () => {
5252
const p = neckbeardPackage.systemPrompt;
5353
expect(p).toMatch(/use_skill.*not mounted|not mounted.*use_skill/i);
5454
expect(p).toMatch(/violently disagree/);
5555
expect(p).toMatch(/report to the parent/i);
56-
expect(p).toMatch(/## Summary/);
57-
expect(p).toMatch(/## Findings/);
58-
expect(p).toMatch(/## Blockers/);
59-
expect(p).toMatch(/## Paths/);
56+
expect(p).toMatch(/Corbits report envelope/);
57+
expect(p).not.toMatch(/## Summary/);
58+
expect(p).not.toMatch(/## Findings/);
59+
expect(p).not.toMatch(/## Blockers/);
60+
expect(p).not.toMatch(/## Paths/);
6061
expect(p).toMatch(/ranked nits with evidence|evidence paths/i);
6162
});
6263

src/agent/directors/neckbeard/package.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -569,17 +569,5 @@ Do not apply fixes. Do not become Builder, Critic, or Greybeard as your primary
569569
570570
# Reporting back
571571
572-
When done, stop calling tools and reply with ONLY this markdown envelope:
573-
574-
## Summary
575-
One or two sentences: condescending overall take (Rust optional but encouraged).
576-
577-
## Findings
578-
Ranked nits with evidence paths — Peak Neckbeard / Unbearable / Maddening / Insufferable. Each item cites a path (and line/symbol when available). Comic voice allowed ("Actually,", "Well technically,"); no emoji glyphs.
579-
580-
## Blockers
581-
Open questions, missing docs/code, or out-of-lane routing. Write "None." if clear. If blocked, ask_director; after the cap, report remaining questions here.
582-
583-
## Paths
584-
Key file paths you read (one per line). Write "None." if none.`,
572+
When done, stop calling tools and reply with ONLY the Corbits report envelope — the shared scaffold owns its shape (Summary / Findings / Blockers / Paths, in that order), so this package does not re-specify it. Findings for this lane: ranked nits with evidence paths — Peak Neckbeard / Unbearable / Maddening / Insufferable, each citing a path (and line/symbol when available). Comic voice allowed ("Actually,", "Well technically,"); no emoji glyphs. Blockers: ... ask_director; after the cap, report remaining questions here. Paths: key file paths you read (one per line).`,
585573
};

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@ describe("testsmithPackage", () => {
4848
expect(p).toMatch(/Hand off/i);
4949
});
5050

51-
test("systemPrompt states Corbits report shape", () => {
51+
test("systemPrompt points at the scaffold-owned report envelope (no re-spec)", () => {
5252
const p = testsmithPackage.systemPrompt;
53-
expect(p).toContain("## Summary");
54-
expect(p).toContain("## Findings");
55-
expect(p).toContain("## Blockers");
56-
expect(p).toContain("## Paths");
5753
expect(p).toMatch(/Corbits report shape/i);
54+
expect(p).toMatch(/Corbits report envelope/);
55+
expect(p).toMatch(/coverage map/);
56+
expect(p).not.toContain("## Summary");
57+
expect(p).not.toContain("## Findings");
58+
expect(p).not.toContain("## Blockers");
59+
expect(p).not.toContain("## Paths");
5860
});
5961

6062
test("systemPrompt has no tool-schema restatement or fake caps", () => {

src/agent/directors/testsmith/package.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,7 @@ Defer or omit:
6161
6262
# Corbits report shape
6363
64-
When done, stop tooling and reply with ONLY this envelope:
65-
66-
## Summary
67-
One or two sentences: strategy and coverage scope designed.
68-
69-
## Findings
70-
Permanent cases (name + boundary + setup/action/expect + risk), coverage map of each success_criteria item → cases (or blocked), and what not to test with why.
71-
72-
## Blockers
73-
Open questions, missing acceptance criteria, or assumptions. Write "None." if clear.
74-
75-
## Paths
76-
Files/suites you read to ground the design (one per line). Write "None." if none.
64+
When done, stop tooling and reply with ONLY the Corbits report envelope — the shared scaffold owns its shape (Summary / Findings / Blockers / Paths, in that order), so this package does not re-specify it. Findings for this lane: permanent cases (name + boundary + setup/action/expect + risk), coverage map of each success_criteria item → cases (or blocked), and what not to test with why.
7765
7866
DONE GATE: Stop when every success_criteria item has permanent cases (or Blockers). Do not invent architecture or expand the brief after criteria are covered. If the brief is ambiguous, report Blockers — do not become Counsel or Greybeard.
7967

src/agent/prompts.test.ts

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ import { describe, expect, it } from "bun:test";
22
import {
33
buildChatSystemPrompt,
44
buildGrokLeafAntiThrashNote,
5+
buildGuidelines,
56
buildPromptDisciplineBlock,
67
buildSubAgentSystemPrompt,
8+
GUIDELINE_SUB_BLOCK_IDS,
9+
KEEPSTYLE_PROMPT_SECTION_OMIT,
710
} from "./prompts.js";
811
import { CORE_TOOL_NAMES, CATALOG_TOOL_NAMES } from "./tool-search.js";
912

@@ -138,6 +141,91 @@ describe("sub-agent report contract", () => {
138141
expect(prompt).toMatch(/emit all four headings/);
139142
expect(prompt).toContain('"None."');
140143
});
144+
145+
it("emits the four-heading envelope exactly once (scaffold owns the shape)", () => {
146+
const prompt = buildSubAgentSystemPrompt(undefined, undefined, undefined, {
147+
orchestrator: false,
148+
grokAntiThrash: false,
149+
});
150+
for (const heading of [
151+
"## Summary",
152+
"## Findings",
153+
"## Blockers",
154+
"## Paths",
155+
]) {
156+
expect(countOccurrences(prompt, heading)).toBe(1);
157+
}
158+
});
159+
});
160+
161+
describe("guideline sub-block omit policy (CL-7654)", () => {
162+
it("exposes the keepstyle set as ids", () => {
163+
expect([...GUIDELINE_SUB_BLOCK_IDS]).toEqual([
164+
"responseStyle",
165+
"toolChoice",
166+
"askVsProceed",
167+
"scopeConventions",
168+
"orchestration",
169+
]);
170+
});
171+
172+
it("keeps the full guidelines by default", () => {
173+
const guidelines = buildGuidelines({});
174+
for (const marker of [
175+
"Response style:",
176+
"Tool choice:",
177+
"Ask vs proceed:",
178+
"Scope and conventions:",
179+
"Orchestration:",
180+
]) {
181+
expect(guidelines).toContain(marker);
182+
}
183+
});
184+
185+
it("keepstyle omit keeps response style, drops tool-choice / ask-vs-proceed / orchestration", () => {
186+
expect([...KEEPSTYLE_PROMPT_SECTION_OMIT].sort()).toEqual([
187+
"askVsProceed",
188+
"orchestration",
189+
"toolChoice",
190+
]);
191+
const guidelines = buildGuidelines({ omit: KEEPSTYLE_PROMPT_SECTION_OMIT });
192+
expect(guidelines).toContain("Response style:");
193+
expect(guidelines).toContain("Scope and conventions:");
194+
expect(guidelines).not.toContain("Tool choice:");
195+
expect(guidelines).not.toContain("Ask vs proceed:");
196+
expect(guidelines).not.toContain("Orchestration:");
197+
});
198+
199+
it("ignores unknown omit ids", () => {
200+
const guidelines = buildGuidelines({ omit: ["no-such-block"] });
201+
expect(guidelines).toContain("Response style:");
202+
expect(guidelines).toContain("Tool choice:");
203+
expect(guidelines).toContain("Orchestration:");
204+
});
205+
206+
it("threads guidelineConfig through the chat system prompt", () => {
207+
const full = buildChatSystemPrompt(
208+
undefined,
209+
undefined,
210+
undefined,
211+
[],
212+
"orchestrator",
213+
);
214+
expect(full).toContain("Tool choice:");
215+
expect(full).toContain("Orchestration:");
216+
const keepstyle = buildChatSystemPrompt(
217+
undefined,
218+
undefined,
219+
undefined,
220+
[],
221+
"orchestrator",
222+
undefined,
223+
{ omit: KEEPSTYLE_PROMPT_SECTION_OMIT },
224+
);
225+
expect(keepstyle).toContain("Response style:");
226+
expect(keepstyle).not.toContain("Tool choice:");
227+
expect(keepstyle).not.toContain("Orchestration:");
228+
});
141229
});
142230

143231
describe("wait_agents mount-gated prompt copy (CL-7678)", () => {

0 commit comments

Comments
 (0)