Skip to content

Commit bf189f2

Browse files
committed
feat(reviewer): ship reviewer as a workspace agent package
Extract @corbits/agent-reviewer 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-9799
1 parent e2a5e6b commit bf189f2

7 files changed

Lines changed: 94 additions & 9 deletions

File tree

‎agents/reviewer/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-reviewer",
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,12 +1,49 @@
1-
import type { DirectorPackage } from "../types.js";
2-
import { BUILD_TOOLS } from "../tool-sets.js";
3-
41
/**
52
* Reviewer worker: code defect review + verify-by-temporary-test workflow.
63
* Finds defects with reproducible evidence, validates hypotheses with temp tests,
74
* and checks API contracts and hygiene without modifying product code.
5+
*
6+
* Ships as the @corbits/agent-reviewer workspace package: the tool allowlist
7+
* lives here so the package stays importable without the app. Drift against
8+
* the app build surface fails src/agent/directors/reviewer/package.test.ts.
89
*/
9-
export const reviewerPackage: DirectorPackage = {
10+
export type AgentPackage = {
11+
readonly id: "reviewer";
12+
readonly primaryIntent: string;
13+
readonly outOfLane: readonly string[];
14+
readonly description: string;
15+
readonly systemPrompt: string;
16+
/** Unset — reviewer never attaches skill bodies at spawn. */
17+
readonly attachedSkills?: readonly string[];
18+
/** Unset — reviewer declares no skill scope. */
19+
readonly optionalSkills?: readonly string[];
20+
readonly tools: {
21+
readonly allow: readonly string[];
22+
};
23+
readonly spawn: {
24+
readonly maySpawn: false;
25+
};
26+
readonly modelRole: "review";
27+
readonly tier: "leaf";
28+
};
29+
30+
const REVIEWER_TOOLS = [
31+
"read_file",
32+
"grep",
33+
"search_files",
34+
"list_dir",
35+
"lsp",
36+
"run_shell",
37+
"web_fetch",
38+
"web_search",
39+
"skill_search",
40+
"use_skill",
41+
"write_file",
42+
"edit_file",
43+
"delete_file",
44+
] as const;
45+
46+
export const reviewerPackage: AgentPackage = {
1047
id: "reviewer",
1148
primaryIntent:
1249
"Evidence-based code defect review and verification via temporary reproduction tests; never fix product code",
@@ -19,10 +56,6 @@ export const reviewerPackage: DirectorPackage = {
1956
],
2057
description:
2158
"Code quality and defect reviewer — evidence-based findings with temp test verification",
22-
tools: { allow: BUILD_TOOLS },
23-
spawn: { maySpawn: false },
24-
tier: "leaf",
25-
modelRole: "review",
2659
systemPrompt: `You are ReviewerDirector (Reviewer), a specialist in Corbits Code.
2760
2861
PRIMARY INTENT: evidence-based code review and defect verification. Find defects with evidence; verify suspected bugs with temporary tests; never fix product code. Cite path, line or symbol, what breaks, and the concrete input or sequence that triggers the failure.
@@ -52,4 +85,8 @@ Report envelope:
5285
- Report "This diff is genuinely clean" when no actionable defects exist.
5386
5487
OUT OF LANE: implementing product fixes (route to coder), visual styling / DESIGN.md (route to designer), fleet orchestration or spawning.`,
88+
tools: { allow: [...REVIEWER_TOOLS] },
89+
spawn: { maySpawn: false },
90+
tier: "leaf",
91+
modelRole: "review",
5592
};

‎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
@@ -87,6 +87,7 @@
8787
},
8888
"dependencies": {
8989
"@corbits/agent-explorer": "workspace:*",
90+
"@corbits/agent-reviewer": "workspace:*",
9091
"@corbits/codex-provider": "0.1.1",
9192
"@corbits/oauth-core": "0.2.0",
9293
"@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,4 +1,5 @@
11
import { explorerPackage } from "@corbits/agent-explorer";
2+
import { reviewerPackage } from "@corbits/agent-reviewer";
23
import type { AgentProfile, CapabilityFilter } from "../profile-types.js";
34
import { artistPackage } from "./artist/package.js";
45
import { coderPackage } from "./coder/package.js";
@@ -7,7 +8,6 @@ import { dispatchPackage } from "./dispatch/package.js";
78
import { plannerPackage } from "./planner/package.js";
89
import { proberPackage } from "./prober/package.js";
910
import { qaLeadPackage } from "./qa-lead/package.js";
10-
import { reviewerPackage } from "./reviewer/package.js";
1111
import { shakespearePackage } from "./shakespeare/package.js";
1212
import { wardenPackage } from "./warden/package.js";
1313
import { formatDirectorSystemPrompt } from "./identity.js";
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { describe, expect, test } from "bun:test";
2+
3+
import { reviewerPackage } from "@corbits/agent-reviewer";
4+
import { BUILD_TOOLS } from "../tool-sets.js";
5+
import { DIRECTOR_REGISTRY } from "../registry.js";
6+
import type { DirectorPackage } from "../types.js";
7+
8+
describe("reviewerPackage", () => {
9+
test("workspace package satisfies the director contract and feeds the registry", () => {
10+
const asDirector: DirectorPackage = reviewerPackage;
11+
expect(asDirector.id).toBe("reviewer");
12+
expect(DIRECTOR_REGISTRY.reviewer).toBe(reviewerPackage);
13+
expect([...reviewerPackage.tools.allow]).toEqual([...BUILD_TOOLS]);
14+
});
15+
16+
test("extracted copy stays review-scoped and non-spawning", () => {
17+
expect(reviewerPackage.tools.allow).toContain("write_file");
18+
expect(reviewerPackage.tools.allow).toContain("edit_file");
19+
expect(reviewerPackage.tools.allow).toContain("delete_file");
20+
expect(reviewerPackage.tools.allow).not.toContain("spawn_agent");
21+
expect(reviewerPackage.tools.allow).not.toContain("ask_operator");
22+
expect(reviewerPackage.spawn.maySpawn).toBe(false);
23+
expect(reviewerPackage.tier).toBe("leaf");
24+
expect(reviewerPackage.modelRole).toBe("review");
25+
});
26+
});

‎tsconfig.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"baseUrl": ".",
77
"paths": {
88
"@corbits/agent-explorer": ["./agents/explorer/src/index.ts"],
9+
"@corbits/agent-reviewer": ["./agents/reviewer/src/index.ts"],
910
"@corbits/provider-opencode-go": ["./packages/opencode-go/src/index.ts"],
1011
"@corbits/first-class-providers": [
1112
"./packages/first-class-providers/src/index.ts"

0 commit comments

Comments
 (0)