|
1 | | -/** |
2 | | - * Warden trust-review worker (CL-7657). |
3 | | - * Permission / provider-auth / plugin-loader diffs only; findings, never fixes. |
4 | | - * |
5 | | - * Ships as the @corbits/code-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. |
8 | | - */ |
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 = { |
46 | | - id: "warden", |
47 | | - primaryIntent: |
48 | | - "Trust review of permission, provider-auth, and plugin-loader diffs; never fix product code", |
49 | | - outOfLane: [ |
50 | | - "implementing fixes", |
51 | | - "general code review outside trust paths", |
52 | | - "architecture judgment without trust evidence", |
53 | | - "feature design", |
54 | | - ], |
55 | | - description: "Permission and trust review worker", |
56 | | - systemPrompt: `You are WardenDirector (Warden), a specialist in Corbits Code. |
57 | | -
|
58 | | -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. |
59 | | -
|
60 | | -TRIGGER — written paths only. Review only when the diff touches permission, provider-auth, or plugin-loader code. Anything else is out of lane: say so under Blockers and stop. Do not expand into general code review. |
61 | | -
|
62 | | -You are the trust lane only — not an implementer, not an explorer, not an orchestrator. Do not ship fixes. Do not become Reviewer (general defects) or Planner as your primary job. |
63 | | -
|
64 | | -Findings lens — rank each as blocking, should-fix, or file-for-later: |
65 | | -- grant-matching holes (permission grants that over- or under-match the request) |
66 | | -- secret-guard bypass (secrets or credentials reachable past the guard) |
67 | | -- arktype boundary skips (unvalidated input crossing a trust boundary) |
68 | | -- shell-policy peel gaps (shell policy peeled or bypassed by a wrapper layer) |
69 | | -- plugin trust (untrusted plugin code gaining capability it was not granted) |
70 | | -
|
71 | | -Evidence rules: |
72 | | -- Every claim needs path + line/symbol + reproduction shape (input, sequence, missing branch). |
73 | | -- "This is genuinely fine" is a valid finding when true. |
74 | | -- Call out gaps: what you did not cover so the parent does not assume closed. |
75 | | -- Recommend permanent regression tests that Coder should land. |
76 | | -
|
77 | | -OUT OF LANE → refuse or reclassify under Blockers: |
78 | | -- implementing fixes (route to coder) |
79 | | -- general code review outside trust paths (route to reviewer) |
80 | | -- feature requirements or planning (route to planner)`, |
81 | | - tools: { allow: [...WARDEN_TOOLS] }, |
82 | | - spawn: { maySpawn: false }, |
83 | | - tier: "leaf", |
84 | | - modelRole: "review", |
85 | | -}; |
| 1 | +// Public surface — re-exports only (no logic). Exports exactly |
| 2 | +// `agent, defineAgent, director, tools, systemPrompt, config`. No `workflow` |
| 3 | +// export. No Corbits shared package is re-exported; the package's `director` |
| 4 | +// structurally satisfies the app's `DirectorPackage` (app-side drift-guard). |
| 5 | +export { agent, defineAgent } from "./agent.js"; |
| 6 | +export { director } from "./director.js"; |
| 7 | +export { tools } from "./toolset.js"; |
| 8 | +export { systemPrompt } from "./prompt.js"; |
| 9 | +export { config } from "./config.js"; |
0 commit comments