From 5bcc79486184fd1d2a8f96d15b2b630308b06f51 Mon Sep 17 00:00:00 2001 From: Sawyer Cutler Date: Fri, 11 Sep 2026 22:49:38 -0700 Subject: [PATCH 1/2] Restore Greybeard review checklist in Corbits idiom --- src/agent/directors/greybeard/package.test.ts | 29 +++++++++++++++++-- src/agent/directors/greybeard/package.ts | 14 +++++++-- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/agent/directors/greybeard/package.test.ts b/src/agent/directors/greybeard/package.test.ts index 0077dd38b..720d4bfa1 100644 --- a/src/agent/directors/greybeard/package.test.ts +++ b/src/agent/directors/greybeard/package.test.ts @@ -22,14 +22,37 @@ describe("greybeardPackage", () => { expect(p).not.toMatch(/architecture director/i); }); - test("systemPrompt teaches judgment for architecture approach", () => { + test("systemPrompt frames value as analysis via Corbits read tools", () => { const p = greybeardPackage.systemPrompt; - expect(p).toContain("Judge the approach"); + expect(p).toMatch(/value is analysis/i); + expect(p).toContain("read_file"); + expect(p).toContain("grep"); + expect(p).toContain("ask_director"); + }); + + test("systemPrompt carries an ordered review checklist", () => { + const p = greybeardPackage.systemPrompt; + expect(p).toMatch(/Review checklist/); + expect(p).toMatch(/architectural claim/); expect(p).toMatch(/constraint ownership|owns constraints/i); - expect(p).toMatch(/hold \/ revise \/ block|verdict/i); + expect(p).toMatch(/anti-patterns/); + expect(p).toMatch(/Rank risks/); + }); + + test("systemPrompt ends the checklist with the hold/revise/block verdict triad", () => { + const p = greybeardPackage.systemPrompt; + expect(p).toMatch(/hold \/ revise \/ block/); expect(p).toMatch(/backward-compatibility|backward compatibility/i); }); + test("systemPrompt has no self-spawn language", () => { + const p = greybeardPackage.systemPrompt; + expect(p).not.toMatch(/spawn.*greybeard/i); + expect(p).not.toContain('agent="greybeard"'); + expect(p).not.toMatch(/spawn yourself/i); + expect(p).not.toMatch(/spawn a (greybeard|reviewer)/i); + }); + test("systemPrompt allows limited spawn without fake caps or scheduler language", () => { const p = greybeardPackage.systemPrompt; expect(p).toMatch(/intern/); diff --git a/src/agent/directors/greybeard/package.ts b/src/agent/directors/greybeard/package.ts index 15ef7b724..f9f0ee3bf 100644 --- a/src/agent/directors/greybeard/package.ts +++ b/src/agent/directors/greybeard/package.ts @@ -3,7 +3,11 @@ import { ORCHESTRATOR_TOOLS } from "../tool-sets.js"; /** * Greybeard nested orchestrator (CL-7019). - * Architecture judgment with limited spawn — never ships product code. + * Review checklist ported from the GaaS greybeard original (CL-7662) — the + * GaaS source was unavailable locally, so this is a Corbits-idiom restoration + * rather than a 1:1 copy. Self-read deviation: the GaaS delegate-for-review + * shape becomes read_file/grep/ask_director first, spawn only on a concrete + * unknown. Architecture judgment with limited spawn — never ships product code. */ export const greybeardPackage: DirectorPackage = { id: "greybeard", @@ -26,12 +30,16 @@ You are Greybeard — not a second Skywalker, not Critic (code defects with evid Follow style and philosophy conventions (baked into this prompt) when reviewing plans or approaches — skills are active constraints, not background docs. -Judge the approach: +Your value is analysis, not delegation: reach the judgment yourself with +targeted reads (read_file, grep) and pointed questions (ask_director) +before considering a spawn. + +Review checklist — work the list in order: 1. Name the architectural claim under review (boundary, ownership, invariant, or BC surface). 2. Decide whether the proposed approach owns constraints at the right layer — or only chases symptoms. 3. Call out holes, anti-patterns, missing invariants, product/architecture/implementation misalignment, and duplication that should be refactor or API expansion instead. 4. Rank risks for long-term maintainability and backward compatibility. -5. Report a clear verdict: hold / revise / block — with the why, not a checklist theater. +5. Report a clear verdict: hold / revise / block — with the why, not checklist theater. Spawn only when a concrete unknown blocks that judgment. Package spawn rules allow intern (mechanical shell), explorer (map/read), and critic (code evidence). When spawning critic, pass non-empty success_criteria (runtime fail-closes without it). intern and explorer remain optional. 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. Nested orchestrators collect with wait_agents — mailbox mail is the primary parent path. From 0b35db27ea619670a8421666eec0b70309a1f7d1 Mon Sep 17 00:00:00 2001 From: Sawyer Cutler Date: Fri, 11 Sep 2026 22:51:54 -0700 Subject: [PATCH 2/2] Assert Greybeard checklist order and verdict-scoped triad in tests --- src/agent/directors/greybeard/package.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/agent/directors/greybeard/package.test.ts b/src/agent/directors/greybeard/package.test.ts index 720d4bfa1..3201e7c39 100644 --- a/src/agent/directors/greybeard/package.test.ts +++ b/src/agent/directors/greybeard/package.test.ts @@ -37,12 +37,29 @@ describe("greybeardPackage", () => { expect(p).toMatch(/constraint ownership|owns constraints/i); expect(p).toMatch(/anti-patterns/); expect(p).toMatch(/Rank risks/); + const checklistIdx = p.search(/Review checklist/); + expect(checklistIdx).toBeGreaterThan(-1); + const checklist = p.slice(checklistIdx); + const claimIdx = checklist.search(/architectural claim/); + const ownershipIdx = checklist.search(/constraint ownership|owns constraints/i); + const holesIdx = checklist.search(/anti-patterns/); + const risksIdx = checklist.search(/Rank risks/); + const verdictIdx = checklist.search(/hold \/ revise \/ block/); + expect(claimIdx).toBeGreaterThan(-1); + expect(ownershipIdx).toBeGreaterThan(claimIdx); + expect(holesIdx).toBeGreaterThan(ownershipIdx); + expect(risksIdx).toBeGreaterThan(holesIdx); + expect(verdictIdx).toBeGreaterThan(risksIdx); }); test("systemPrompt ends the checklist with the hold/revise/block verdict triad", () => { const p = greybeardPackage.systemPrompt; expect(p).toMatch(/hold \/ revise \/ block/); expect(p).toMatch(/backward-compatibility|backward compatibility/i); + const risksIdx = p.search(/Rank risks/); + const triadIdx = p.search(/hold \/ revise \/ block/); + expect(risksIdx).toBeGreaterThan(-1); + expect(triadIdx).toBeGreaterThan(risksIdx); }); test("systemPrompt has no self-spawn language", () => {