Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/agent/codex-tool-proxies.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,8 @@ describe("update_plan proxy", () => {
});

describe("allowDeleteFromCapabilities", () => {
test("docs allowlist (no delete_file) → false; build → true", () => {
expect(allowDeleteFromCapabilities({ mode: "allow", tools: DOCS_TOOLS })).toBe(false);
test("docs allowlist (includes delete_file) → true; build → true", () => {
expect(allowDeleteFromCapabilities({ mode: "allow", tools: DOCS_TOOLS })).toBe(true);
expect(allowDeleteFromCapabilities({ mode: "allow", tools: BUILD_TOOLS })).toBe(true);
expect(allowDeleteFromCapabilities(undefined)).toBe(true);
expect(allowDeleteFromCapabilities({ mode: "exclude", tools: ["run_shell"] })).toBe(true);
Expand Down
4 changes: 2 additions & 2 deletions src/agent/codex-tool-proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export interface CreateCodexToolProxiesOpts {
runManageTasks: CodexRunManageTasks;
/**
* When false, Delete File and Update+Move refuse without calling `delete_file`.
* Defaults to true (implement / unconstrained). Docs leaves pass false because
* DOCS_TOOLS includes apply_patch but not delete_file.
* Defaults to true (implement / unconstrained). Pass false when the
* director allowlist omits delete_file (docs leaves mount it today).
*/
allowDelete?: boolean;
/**
Expand Down
1 change: 1 addition & 0 deletions src/agent/directors/brand-reviewer/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ describe("brandReviewerPackage", () => {
const allow = brandReviewerPackage.tools?.allow ?? [];
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
});

test("systemPrompt mentions DESIGN.md", () => {
Expand Down
1 change: 1 addition & 0 deletions src/agent/directors/bruckheimer/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe("bruckheimerPackage", () => {
const allow = bruckheimerPackage.tools?.allow ?? [];
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
});

test("modelRole is docs", () => {
Expand Down
8 changes: 4 additions & 4 deletions src/agent/directors/critique/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ describe("critiquePackage", () => {
expect(critiquePackage.spawn.maySpawn).toBe(false);
});

test("tools.allow is review surface without product writes", () => {
test("tools.allow is review surface with product writes", () => {
const allow = critiquePackage.tools?.allow ?? [];
expect(allow).toContain("read_file");
expect(allow).toContain("read_file");
expect(allow).not.toContain("use_skill");
expect(allow).not.toContain("write_file");
expect(allow).not.toContain("edit_file");
expect(allow).not.toContain("delete_file");
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
});

test("modelRole is review", () => {
Expand Down
8 changes: 4 additions & 4 deletions src/agent/directors/draper/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ describe("draperPackage", () => {
expect(draperPackage.spawn.maySpawn).toBe(false);
});

test("tools.allow is review surface without product writes", () => {
test("tools.allow is review surface with product writes", () => {
const allow = draperPackage.tools?.allow ?? [];
expect(allow).toContain("read_file");
expect(allow).not.toContain("use_skill");
expect(allow).not.toContain("write_file");
expect(allow).not.toContain("edit_file");
expect(allow).not.toContain("delete_file");
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
});

test("modelRole is review", () => {
Expand Down
8 changes: 4 additions & 4 deletions src/agent/directors/emil/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ describe("emilPackage", () => {
expect(emilPackage.spawn.maySpawn).toBe(false);
});

test("tools.allow is review surface without product writes", () => {
test("tools.allow is review surface with product writes", () => {
const allow = emilPackage.tools?.allow ?? [];
expect(allow).toContain("read_file");
expect(allow).not.toContain("use_skill");
expect(allow).not.toContain("write_file");
expect(allow).not.toContain("edit_file");
expect(allow).not.toContain("delete_file");
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
});

test("modelRole is review", () => {
Expand Down
8 changes: 4 additions & 4 deletions src/agent/directors/explore/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ describe("explorePackage", () => {
expect(explorePackage.spawn.maySpawn).toBe(false);
});

test("tools.allow is read-only (no product writes)", () => {
test("tools.allow mounts product writes (lane: no product edits)", () => {
const allow = explorePackage.tools?.allow ?? [];
expect(allow).toContain("read_file");
expect(allow).toContain("grep");
expect(allow).not.toContain("write_file");
expect(allow).not.toContain("edit_file");
expect(allow).not.toContain("delete_file");
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
});

test("modelRole is explore", () => {
Expand Down
4 changes: 2 additions & 2 deletions src/agent/directors/explore/package.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DirectorPackage } from "../types.js";
import { READ_TOOLS } from "../tool-sets.js";
import { REVIEW_TOOLS } from "../tool-sets.js";

/**
* Explorer leaf (CL-7020).
Expand Down Expand Up @@ -33,7 +33,7 @@ FINDINGS SHAPE: Findings must be a scannable map — key paths, symbols, call fl
FINISH BIAS: Prefer one thorough pass then report. Expand Findings, change approach, or write the final report — do not keep re-reading the same paths.

OUT OF LANE: product writes, drive-by fixes, shipping features, review severity theater, orchestration, spawning specialists, fleet discovery, becoming Builder/Critic/orchestrator as primary.`,
tools: { allow: READ_TOOLS },
tools: { allow: REVIEW_TOOLS },
spawn: { maySpawn: false },
tier: "leaf",
modelRole: "explore",
Expand Down
8 changes: 4 additions & 4 deletions src/agent/directors/gaasbot/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ describe("gaasbotPackage", () => {
expect(gaasbotPackage.spawn.maySpawn).toBe(false);
});

test("denies product write tools (advice only)", () => {
test("mounts product write tools (lane discipline in prompts)", () => {
const allow = gaasbotPackage.tools?.allow ?? [];
expect(allow).toContain("read_file");
expect(allow).not.toContain("write_file");
expect(allow).not.toContain("edit_file");
expect(allow).not.toContain("delete_file");
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
});

test("modelRole is plan", () => {
Expand Down
8 changes: 4 additions & 4 deletions src/agent/directors/greybeard/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ describe("greybeardPackage", () => {
expect(allow).not.toContain("plan");
});

test("tools.allow is orchestrator surface without product writes", () => {
test("tools.allow is orchestrator surface with product writes", () => {
const allow = greybeardPackage.tools?.allow ?? [];
expect(allow).toContain("task");
expect(allow).toContain("search_agents");
expect(allow).not.toContain("write_file");
expect(allow).not.toContain("edit_file");
expect(allow).not.toContain("delete_file");
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
});

test("modelRole is review", () => {
Expand Down
7 changes: 5 additions & 2 deletions src/agent/directors/intern/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ describe("internPackage", () => {
expect(internPackage.spawn.maySpawn).toBe(false);
});

test("tools.allow is shell-first minimal surface", () => {
test("tools.allow is shell-first with path writes", () => {
const allow = internPackage.tools?.allow ?? [];
expect(allow).toContain("run_shell");
expect(allow).toContain("read_file");
expect(allow).toContain("list_dir");
for (const name of ["write_file", "edit_file", "delete_file", "grep", "search_files", "task"]) {
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
for (const name of ["grep", "search_files", "task", "apply_patch"]) {
expect(allow).not.toContain(name);
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/agent/directors/intern/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { INTERN_TOOLS } from "../tool-sets.js";

/**
* Mechanical intern leaf (CL-5822).
* Shell/commands only — no judgment, no exploration, no product writes.
* Shell/commands first — no judgment, no exploration; path writes only when the brief requires them.
*/
export const internPackage: DirectorPackage = {
id: "intern",
Expand Down
8 changes: 4 additions & 4 deletions src/agent/directors/neckbeard/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ describe("neckbeardPackage", () => {
expect(neckbeardPackage.spawn.maySpawn).toBe(false);
});

test("denies product write tools", () => {
test("mounts product write tools", () => {
const allow = neckbeardPackage.tools?.allow ?? [];
expect(allow).toContain("read_file");
expect(allow).not.toContain("write_file");
expect(allow).not.toContain("edit_file");
expect(allow).not.toContain("delete_file");
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
});

test("modelRole is review", () => {
Expand Down
8 changes: 4 additions & 4 deletions src/agent/directors/plan/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ describe("planPackage", () => {
expect(planPackage.spawn.maySpawn).toBe(false);
});

test("tools.allow is review surface without product writes", () => {
test("tools.allow is review surface with product writes", () => {
const allow = planPackage.tools?.allow ?? [];
expect(allow).toContain("read_file");
expect(allow).not.toContain("write_file");
expect(allow).not.toContain("edit_file");
expect(allow).not.toContain("delete_file");
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
});

test("modelRole is plan", () => {
Expand Down
26 changes: 18 additions & 8 deletions src/agent/directors/registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ describe("director registry", () => {
expect(explore.description).toContain("agent id: explore");
expect(explore.capabilities?.mode).toBe("allow");
expect(explore.capabilities?.tools).toContain("read_file");
expect(explore.capabilities?.tools).not.toContain("write_file");
expect(explore.capabilities?.tools).toContain("write_file");
expect(explore.capabilities?.tools).toContain("edit_file");
expect(explore.capabilities?.tools).toContain("delete_file");
expect(explore.orchestrator).toBe(false);

const grey = packageToProfile(DIRECTOR_REGISTRY.greybeard);
Expand All @@ -123,7 +125,7 @@ describe("director registry", () => {
expect(packageToProfile(g).orchestrator).toBe(true);
});

test("review and design leaves deny product write tools", () => {
test("closed directors mount product write tools", () => {
for (const id of [
"critique",
"greybeard",
Expand All @@ -135,22 +137,30 @@ describe("director registry", () => {
"testsmith",
"tester",
"gaasbot",
"intern",
"build",
"shakespeare",
"bruckheimer",
"brand-reviewer",
"skywalker",
] as const) {
const allow = DIRECTOR_REGISTRY[id].tools?.allow ?? [];
expect(allow).not.toContain("write_file");
expect(allow).not.toContain("edit_file");
expect(allow).not.toContain("delete_file");
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
}
});

test("build mounts product writes; intern is shell-only; other leaves do not spawn", () => {
test("build mounts product writes + apply_patch; intern mounts writes without apply_patch; other leaves do not spawn", () => {
expect(DIRECTOR_REGISTRY.build.tools?.allow).toEqual(
expect.arrayContaining(["write_file", "edit_file", "delete_file", "apply_patch"]),
);
const internAllow = DIRECTOR_REGISTRY.intern.tools?.allow ?? [];
expect(internAllow).toContain("run_shell");
expect(internAllow).not.toContain("write_file");
expect(internAllow).not.toContain("edit_file");
expect(internAllow).toContain("write_file");
expect(internAllow).toContain("edit_file");
expect(internAllow).toContain("delete_file");
expect(internAllow).not.toContain("apply_patch");
for (const id of DIRECTOR_IDS) {
if (id === "skywalker" || id === "greybeard") continue;
expect(DIRECTOR_REGISTRY[id].spawn.maySpawn).toBe(false);
Expand Down
1 change: 1 addition & 0 deletions src/agent/directors/shakespeare/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ describe("shakespearePackage", () => {
const allow = shakespearePackage.tools?.allow ?? [];
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
});

test("modelRole is docs", () => {
Expand Down
8 changes: 4 additions & 4 deletions src/agent/directors/tester/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ describe("testerPackage", () => {
expect(testerPackage.spawn.maySpawn).toBe(false);
});

test("tools.allow is read-only (no product writes)", () => {
test("tools.allow mounts product writes (lane: never fix)", () => {
const allow = testerPackage.tools?.allow ?? [];
expect(allow).toContain("run_shell");
expect(allow).toContain("read_file");
expect(allow).not.toContain("write_file");
expect(allow).not.toContain("edit_file");
expect(allow).not.toContain("delete_file");
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
});

test("modelRole is test", () => {
Expand Down
4 changes: 2 additions & 2 deletions src/agent/directors/tester/package.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DirectorPackage } from "../types.js";
import { READ_TOOLS } from "../tool-sets.js";
import { REVIEW_TOOLS } from "../tool-sets.js";

/**
* Tester leaf (CL-7026).
Expand Down Expand Up @@ -34,7 +34,7 @@ DONE GATE: Stop when the brief's verify ask is answered with evidence OR explici
REPORT MAP: Findings must map each requested check → pass | fail | blocked, with commands run and key failure excerpts. Paths list suites/files exercised.

OUT OF LANE: fixing product code, "just quickly" fixing, redesigning the suite as Testsmith's primary job, fleet orchestration, architecture essays, exploration maps as primary.`,
tools: { allow: READ_TOOLS },
tools: { allow: REVIEW_TOOLS },
spawn: { maySpawn: false },
tier: "leaf",
modelRole: "test",
Expand Down
8 changes: 4 additions & 4 deletions src/agent/directors/testsmith/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ describe("testsmithPackage", () => {
expect(testsmithPackage.spawn.maySpawn).toBe(false);
});

test("tools.allow is read-only (no product writes)", () => {
test("tools.allow mounts product writes (lane: design only)", () => {
const allow = testsmithPackage.tools?.allow ?? [];
expect(allow).toContain("read_file");
expect(allow).not.toContain("write_file");
expect(allow).not.toContain("edit_file");
expect(allow).not.toContain("delete_file");
expect(allow).toContain("write_file");
expect(allow).toContain("edit_file");
expect(allow).toContain("delete_file");
});

test("modelRole is test", () => {
Expand Down
6 changes: 3 additions & 3 deletions src/agent/directors/testsmith/package.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DirectorPackage } from "../types.js";
import { READ_TOOLS } from "../tool-sets.js";
import { REVIEW_TOOLS } from "../tool-sets.js";

/**
* Testsmith: test design specialist — strategy and cases only; never implements product
Expand Down Expand Up @@ -29,8 +29,8 @@ Design in the report. Prefer:

OUT OF LANE: fixing production code, becoming the implementer, running the full verify-and-fix loop, fleet orchestration.

Read and search the codebase to ground the design; you have no product-mutation tools.`,
tools: { allow: READ_TOOLS },
Read and search the codebase to ground the design; do not mutate product code.`,
tools: { allow: REVIEW_TOOLS },
spawn: { maySpawn: false },
tier: "leaf",
modelRole: "test",
Expand Down
Loading
Loading