Skip to content

Commit 02fa883

Browse files
committed
Director prompt hygiene: fix impossible tool refs, dedupe report contract, drop dead no-ship branch, structured evidence gate
- Removed hand-written "Report: Summary, Findings, Blockers, Paths" duplicates from worker system prompts (build, bruckheimer, explore, gaasbot, plan, neckbeard, greybeard, intern, shakespeare, tester, testsmith, critique, emil) — the shared sub-agent report contract and each package's report.requiredSections already state it. - Removed "Do not spawn agents"/"Never spawn" duplicates from prompts whose packages already declare spawn.maySpawn: false (build, neckbeard, brand-reviewer, draper) — spawn is enforced structurally by not mounting the task tool. - Removed impossible tool references: tester/testsmith telling the model not to use write_file/edit_file or write notes under tmp/ when those tools are never mounted (READ_TOOLS); critique's "if shell is allowed" hedge when run_shell is always in its tool set; emil's and draper's write-tool denial explanations; gaasbot's write-tool disclaimer; plan's ask_operator mention (never mounted on workers). - Removed the dead no-ship branch: evaluateSubAgentStop never returned "no-ship" (only evaluateThrashStop and the never-edited/never-acted paths fire), so the nudge director's stop === "no-ship" branch was unreachable. Dropped it from SubAgentStopReason and the nudge director's switch. ForcedStopReason (a separate type used by forcedStopReport/brief-dispatch salvage classification) is untouched. - Replaced persona-string coupling: shouldRequireEvidence keyed off systemPromptRole.includes("CritiqueDirector"); now keys off a structured directorId threaded from task-tool's already-resolved director id. - Added a registry test that cross-checks every director's prompt text against its mounted tool set for the known tool names, so a future prompt can't reference a tool it cannot call.
1 parent 6ea4085 commit 02fa883

22 files changed

Lines changed: 93 additions & 81 deletions

File tree

src/agent/directors/brand-reviewer/package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ Missing brand sources, ambiguous scope, product-code asks.
6565
## Paths
6666
DESIGN.md path and UI files reviewed.
6767
68-
Never spawn. Never commit. Stay on the DESIGN.md lane.`,
68+
Never commit. Stay on the DESIGN.md lane.`,
6969
};

src/agent/directors/bruckheimer/package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ Read the product as a person using it: can a new user get through the first nine
3030
3131
OUT OF LANE: implementing features, architecture sign-off, code review severity theater, fleet orchestration. Route those via Blockers to build, greybeard, critique, or skywalker.
3232
33-
Report: Summary, Findings (product shape + discovery), Blockers, Paths.`,
33+
Findings: product shape and discovery, not implementation notes.`,
3434
};

src/agent/directors/build/package.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ You are not a reviewer, not an orchestrator, not a doc-only planner.
2525
2626
Before substantial repo work: follow style and philosophy conventions (baked; use_skill is not mounted on workers).
2727
Follow AGENTS.md and /docs. Touch only what the brief requires.
28-
Do not spawn sub-agents.
2928
3029
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.
3130
@@ -35,7 +34,5 @@ REPORT MAP: Findings must map each success_criteria item → pass | fail | block
3534
3635
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.
3736
38-
OUT OF LANE: pure exploration maps, architecture essays without code, review-only verdicts, mechanical command lists without implementing.
39-
40-
Report: Summary, Findings, Blockers, Paths.`,
37+
OUT OF LANE: pure exploration maps, architecture essays without code, review-only verdicts, mechanical command lists without implementing.`,
4138
};

src/agent/directors/critique/package.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ API contract check (blocking when brief specifies signatures):
4444
- Compare public exports against the brief and existing call sites/tests.
4545
- Sync → async (returning Promise when callers expect a plain value) is a blocking correctness defect.
4646
- Signature parameter order/optionality/return-type drift vs brief is blocking.
47-
- Prefer reading tests/callers; if shell is allowed, a tiny sync call that would hang on a Promise is evidence.
47+
- Prefer reading tests/callers; a tiny sync call via run_shell that would hang on a Promise is evidence.
4848
- Rank these as blocking, not style nits.
4949
5050
Write tools are not mounted. Repro via read/shell only; recommend permanent tests for testsmith/build.
@@ -53,9 +53,5 @@ OUT OF LANE → refuse or reclassify under Blockers:
5353
- implementing fixes (route to build)
5454
- architecture portfolio without code evidence (route to greybeard)
5555
- visual brand / DESIGN.md (route to brand-reviewer / draper)
56-
- pedantic fun without evidence (route to neckbeard only if hygiene is the brief)
57-
58-
Do not spawn. Do not apply patches. Report only.
59-
60-
Report: Summary, Findings, Blockers, Paths.`,
56+
- pedantic fun without evidence (route to neckbeard only if hygiene is the brief)`,
6157
};

src/agent/directors/draper/package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ Missing references, out-of-lane asks, ambiguous scope.
6262
## Paths
6363
Files and references inspected.
6464
65-
Never write/edit/delete product files. Never spawn. Never commit.`,
65+
Never commit.`,
6666
};

src/agent/directors/emil/package.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,18 @@ You are a critical eye, not the hand that solves.
5656
5757
1. Understand scope — read the relevant UI/code before judging.
5858
2. Form hypotheses — which laws apply.
59-
3. Verify — inspect code, run existing tests/linters when practical. You cannot write temp test files (write tools denied); use read/run evidence instead.
59+
3. Verify — inspect code, run existing tests/linters when practical; use read/run evidence, not temp test files.
6060
4. Confidence: VERIFIED / HIGH / MEDIUM only.
6161
5. Report with law + location + evidence + severity. No implementation prescriptions.
6262
6363
OUT OF LANE → Blockers naming: build (fixes), draper (CBS visual tokens), brand-reviewer (DESIGN.md), critique (general code review), greybeard (architecture gate).
6464
65-
# Report
65+
# Report shape
6666
67-
## Summary
68-
Design-engineering quality assessment; critical law violations; dominant patterns.
67+
Summary: design-engineering quality assessment; critical law violations; dominant patterns.
68+
Findings: for each, Law violated | Location | Evidence | Confidence | Severity (Critical / Major / Minor).
69+
Blockers: missing context, out-of-lane asks, unreadable artifacts.
70+
Paths: files inspected.
6971
70-
## Findings
71-
For each: Law violated | Location | Evidence | Confidence | Severity (Critical / Major / Minor).
72-
73-
## Blockers
74-
Missing context, out-of-lane asks, unreadable artifacts.
75-
76-
## Paths
77-
Files inspected.
78-
79-
Never write/edit/delete product files. Never spawn. Never commit. Quality over quantity — three solid findings beat fifteen speculative ones.`,
72+
Quality over quantity — three solid findings beat fifteen speculative ones.`,
8073
};

src/agent/directors/explore/package.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ FINISH BIAS: Prefer one thorough pass then report. Expand Findings, change appro
2121
2222
FINDINGS SHAPE: Findings must be a scannable map — key paths, symbols, call flow / ownership — not optional prose dump. Cite paths. No drive-by refactors, no feature work, no review severity theater.
2323
24-
OUT OF LANE → report Blockers naming the right director: build, plan, critique, greybeard, intern.
25-
26-
Report: Summary, Findings, Blockers, Paths.`,
24+
OUT OF LANE → report Blockers naming the right director: build, plan, critique, greybeard, intern.`,
2725
tools: { allow: READ_TOOLS },
2826
spawn: { maySpawn: false },
2927
nudge: { maxTurns: 35 },

src/agent/directors/gaasbot/package.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ You do not implement product code. You do not replace Greybeard (architecture re
3030
3131
Given findings from others (or the brief): what actually blocks a release? What ships with a note? What is filed? Ask what the team is most likely getting wrong that nobody raised. Prefer hearing "do not ship" early over a late surprise.
3232
33-
Load philosophy when judgment trade-offs matter. Stay advice-only — no write_file/edit_file/delete_file.
33+
Load philosophy when judgment trade-offs matter. Stay advice-only.
3434
3535
OUT OF LANE: implementing, architecture gate ownership, eng plan authorship as PlanDirector, merge-block theater without evidence.
3636
37-
Report: Summary, Findings (risk/sequencing advice), Blockers, Paths.`,
37+
Findings: risk and sequencing advice.`,
3838
};

src/agent/directors/greybeard/package.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,5 @@ Focus on:
3636
- Misalignment between product, architecture, and implementation
3737
- Duplication that should be refactor/API expansion instead
3838
39-
OUT OF LANE: shipping product code, pedantic style-only nitpicking, being a second primary orchestrator.
40-
41-
Report: Summary, Findings, Blockers, Paths.`,
39+
OUT OF LANE: shipping product code, pedantic style-only nitpicking, being a second primary orchestrator.`,
4240
};

src/agent/directors/intern/package.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ export const internPackage: DirectorPackage = {
2828
2929
PRIMARY INTENT: mechanical execution only. Run exactly what the brief says. No judgment, no debugging narratives, no codebase exploration, no implementation.
3030
31-
If anything is ambiguous, missing, or fails: STOP. Report raw command output and the blocker. Do not invent next steps. Do not spawn agents. Do not load skills unless the brief names a skill to load.
31+
If anything is ambiguous, missing, or fails: STOP. Report raw command output and the blocker. Do not invent next steps.
3232
3333
You are a cheap model package — stay short.
3434
35-
Report: Summary, Findings (commands + outputs), Blockers, Paths.`,
35+
Findings: commands run and their outputs.`,
3636
};

0 commit comments

Comments
 (0)