Skip to content

Commit 5587e82

Browse files
committed
feat(warden): ship warden as a workspace agent package
Extract @corbits/agent-warden following the agents/explorer precedent (PR #1339): byte-identical prompt, order-identical tools, registry imports the workspace dep, in-tree package.ts deleted with no shim, co-located drift test, tsconfig paths + workspaces dep + bun.lock. Fixes CL-9803
1 parent 081c161 commit 5587e82

7 files changed

Lines changed: 93 additions & 9 deletions

File tree

‎agents/warden/package.json‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "@corbits/agent-warden",
3+
"version": "0.1.0",
4+
"private": true,
5+
"type": "module",
6+
"license": "SEE LICENSE IN LICENSE.md",
7+
"exports": {
8+
".": {
9+
"types": "./src/index.ts",
10+
"default": "./src/index.ts"
11+
}
12+
}
13+
}
Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,48 @@
1-
import type { DirectorPackage } from "../types.js";
2-
import { REVIEW_TOOLS } from "../tool-sets.js";
3-
41
/**
52
* Warden trust-review worker (CL-7657).
63
* Permission / provider-auth / plugin-loader diffs only; findings, never fixes.
4+
*
5+
* Ships as the @corbits/agent-warden workspace package: the tool allowlist
6+
* lives here so the package stays importable without the app. Drift against
7+
* the app build surface fails src/agent/directors/warden/package.test.ts.
78
*/
8-
export const wardenPackage: DirectorPackage = {
9+
export type AgentPackage = {
10+
readonly id: "warden";
11+
readonly primaryIntent: string;
12+
readonly outOfLane: readonly string[];
13+
readonly description: string;
14+
readonly systemPrompt: string;
15+
/** Unset — warden never attaches skill bodies at spawn. */
16+
readonly attachedSkills?: readonly string[];
17+
/** Unset — warden declares no skill scope. */
18+
readonly optionalSkills?: readonly string[];
19+
readonly tools: {
20+
readonly allow: readonly string[];
21+
};
22+
readonly spawn: {
23+
readonly maySpawn: false;
24+
};
25+
readonly modelRole: "review";
26+
readonly tier: "leaf";
27+
};
28+
29+
const WARDEN_TOOLS = [
30+
"read_file",
31+
"grep",
32+
"search_files",
33+
"list_dir",
34+
"lsp",
35+
"run_shell",
36+
"web_fetch",
37+
"web_search",
38+
"skill_search",
39+
"use_skill",
40+
"write_file",
41+
"edit_file",
42+
"delete_file",
43+
] as const;
44+
45+
export const wardenPackage: AgentPackage = {
946
id: "warden",
1047
primaryIntent:
1148
"Trust review of permission, provider-auth, and plugin-loader diffs; never fix product code",
@@ -16,10 +53,6 @@ export const wardenPackage: DirectorPackage = {
1653
"feature design",
1754
],
1855
description: "Permission and trust review worker",
19-
tools: { allow: REVIEW_TOOLS },
20-
spawn: { maySpawn: false },
21-
tier: "leaf",
22-
modelRole: "review",
2356
systemPrompt: `You are WardenDirector (Warden), a specialist in Corbits Code.
2457
2558
PRIMARY INTENT: trust review of permission, provider-auth, and plugin-loader diffs. Find trust defects with evidence; never fix product code. Cite path, line or symbol, what breaks, and the concrete input or sequence that triggers it.
@@ -45,4 +78,8 @@ OUT OF LANE → refuse or reclassify under Blockers:
4578
- implementing fixes (route to coder)
4679
- general code review outside trust paths (route to reviewer)
4780
- feature requirements or planning (route to planner)`,
81+
tools: { allow: [...WARDEN_TOOLS] },
82+
spawn: { maySpawn: false },
83+
tier: "leaf",
84+
modelRole: "review",
4885
};

‎bun.lock‎

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"tar": "^7.5.1"
8787
},
8888
"dependencies": {
89+
"@corbits/agent-warden": "workspace:*",
8990
"@corbits/codex-provider": "0.1.1",
9091
"@corbits/oauth-core": "0.2.0",
9192
"@corbits/openai-responses": "0.2.1",

‎src/agent/directors/registry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { wardenPackage } from "@corbits/agent-warden";
12
import type { AgentProfile, CapabilityFilter } from "../profile-types.js";
23
import { artistPackage } from "./artist/package.js";
34
import { coderPackage } from "./coder/package.js";
@@ -9,7 +10,6 @@ import { proberPackage } from "./prober/package.js";
910
import { qaLeadPackage } from "./qa-lead/package.js";
1011
import { reviewerPackage } from "./reviewer/package.js";
1112
import { shakespearePackage } from "./shakespeare/package.js";
12-
import { wardenPackage } from "./warden/package.js";
1313
import { formatDirectorSystemPrompt } from "./identity.js";
1414
import {
1515
DIRECTOR_IDS,
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { describe, expect, test } from "bun:test";
2+
3+
import { wardenPackage } from "@corbits/agent-warden";
4+
import { REVIEW_TOOLS } from "../tool-sets.js";
5+
import { DIRECTOR_REGISTRY } from "../registry.js";
6+
import type { DirectorPackage } from "../types.js";
7+
8+
describe("wardenPackage", () => {
9+
test("workspace package satisfies the director contract and feeds the registry", () => {
10+
const asDirector: DirectorPackage = wardenPackage;
11+
expect(asDirector.id).toBe("warden");
12+
expect(DIRECTOR_REGISTRY.warden).toBe(wardenPackage);
13+
expect([...wardenPackage.tools.allow]).toEqual([...REVIEW_TOOLS]);
14+
});
15+
16+
test("extracted copy stays trust-review-scoped and non-spawning", () => {
17+
expect(wardenPackage.tools.allow).toContain("read_file");
18+
expect(wardenPackage.tools.allow).toContain("grep");
19+
expect(wardenPackage.tools.allow).not.toContain("spawn_agent");
20+
expect(wardenPackage.tools.allow).not.toContain("ask_operator");
21+
expect(wardenPackage.spawn.maySpawn).toBe(false);
22+
expect(wardenPackage.tier).toBe("leaf");
23+
expect(wardenPackage.modelRole).toBe("review");
24+
});
25+
});

‎tsconfig.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"composite": false,
66
"baseUrl": ".",
77
"paths": {
8+
"@corbits/agent-warden": ["./agents/warden/src/index.ts"],
89
"@corbits/provider-opencode-go": ["./packages/opencode-go/src/index.ts"],
910
"@corbits/first-class-providers": [
1011
"./packages/first-class-providers/src/index.ts"

0 commit comments

Comments
 (0)