@judge-java/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/dashboard.d.ts +2 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +29 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +212 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +68 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/templates/code-review-override.yml +47 -0
- package/dist/templates/code-review.yml +47 -0
- package/dist/templates/config.yml +26 -0
- package/dist/templates/memory.md +73 -0
- package/package.json +20 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/commands/dashboard.ts"],"names":[],"mappings":"AAEA,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBhE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as path from "path";
|
|
2
|
+
export async function runDashboard(args) {
|
|
3
|
+
const repoRoot = parseRepoArg(args) ?? process.cwd();
|
|
4
|
+
const outputArg = parseOutputArg(args);
|
|
5
|
+
console.log(`\n◈ judge-java dashboard\n`);
|
|
6
|
+
console.log(` Repository: ${repoRoot}`);
|
|
7
|
+
// Dynamically import to avoid bundling dashboard into CLI unnecessarily
|
|
8
|
+
const { generateDashboard } = await import("@judge-java/dashboard");
|
|
9
|
+
const outputPath = await generateDashboard(repoRoot, outputArg);
|
|
10
|
+
console.log(` Output: ${outputPath}`);
|
|
11
|
+
console.log(`\n✓ Dashboard generated.\n`);
|
|
12
|
+
console.log(` Open in browser: file://${outputPath}`);
|
|
13
|
+
console.log(` Or host on GitHub Pages by pointing Pages source to .codeagent/\n`);
|
|
14
|
+
}
|
|
15
|
+
function parseRepoArg(args) {
|
|
16
|
+
const idx = args.indexOf("--repo");
|
|
17
|
+
if (idx !== -1 && args[idx + 1]) {
|
|
18
|
+
return path.resolve(args[idx + 1]);
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
function parseOutputArg(args) {
|
|
23
|
+
const idx = args.indexOf("--output");
|
|
24
|
+
if (idx !== -1 && args[idx + 1]) {
|
|
25
|
+
return path.resolve(args[idx + 1]);
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/commands/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAc;IAC7C,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACrD,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAEvC,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CAAC,iBAAiB,QAAQ,EAAE,CAAC,CAAC;IAEzC,wEAAwE;IACxE,MAAM,EAAC,iBAAiB,EAAC,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAClE,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAEhE,OAAO,CAAC,GAAG,CAAC,iBAAiB,UAAU,EAAE,CAAC,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CACP,6BAA6B,UAAU,EAAE,CAC5C,CAAC;IACF,OAAO,CAAC,GAAG,CACP,qEAAqE,CACxE,CAAC;AACN,CAAC;AAED,SAAS,YAAY,CAAC,IAAc;IAChC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC;QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAAA,CAAC;IACtE,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,SAAS,cAAc,CAAC,IAAc;IAClC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC;QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAAA,CAAC;IACtE,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AASA,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA+B3D"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import * as fs from "fs/promises";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import * as readline from "readline";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
// ─── Entry point ─────────────────────────────────────────────────────────────
|
|
7
|
+
export async function runInit(args) {
|
|
8
|
+
const repoRoot = parseRepoArg(args) ?? process.cwd();
|
|
9
|
+
console.log(`\n◈ judge-java init\n`);
|
|
10
|
+
console.log(` Repository: ${repoRoot}\n`);
|
|
11
|
+
// Verify it looks like a git repo
|
|
12
|
+
await assertGitRepo(repoRoot);
|
|
13
|
+
// Check what already exists
|
|
14
|
+
const existing = await checkExisting(repoRoot);
|
|
15
|
+
if (existing.allPresent) {
|
|
16
|
+
console.log(" judge-java is already initialised in this repository.\n");
|
|
17
|
+
console.log(" To re-initialise, remove the existing files and run again:");
|
|
18
|
+
console.log(" .github/workflows/code-review.yml");
|
|
19
|
+
console.log(" .github/workflows/code-review-override.yml");
|
|
20
|
+
console.log(" .codeagent/config.yml");
|
|
21
|
+
console.log(" .codeagent/memory.md\n");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
// Prompt for configuration
|
|
25
|
+
const config = await promptConfig();
|
|
26
|
+
// Scaffold files
|
|
27
|
+
await scaffoldWorkflows(repoRoot, existing);
|
|
28
|
+
await scaffoldCodeagent(repoRoot, config, existing);
|
|
29
|
+
// Print next steps
|
|
30
|
+
printNextSteps(repoRoot, config);
|
|
31
|
+
}
|
|
32
|
+
// ─── Scaffolding ──────────────────────────────────────────────────────────────
|
|
33
|
+
async function scaffoldWorkflows(repoRoot, existing) {
|
|
34
|
+
const workflowDir = path.join(repoRoot, ".github", "workflows");
|
|
35
|
+
await fs.mkdir(workflowDir, { recursive: true });
|
|
36
|
+
const files = [
|
|
37
|
+
{ template: "code-review.yml", dest: "code-review.yml" },
|
|
38
|
+
{ template: "code-review-override.yml", dest: "code-review-override.yml" },
|
|
39
|
+
];
|
|
40
|
+
for (const { template, dest } of files) {
|
|
41
|
+
const destPath = path.join(workflowDir, dest);
|
|
42
|
+
const alreadyExists = existing.workflows.includes(dest);
|
|
43
|
+
if (alreadyExists) {
|
|
44
|
+
console.log(` ⚠ Skipped .github/workflows/${dest} (already exists)`);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
await copyTemplate(template, destPath);
|
|
48
|
+
console.log(` ✓ Created .github/workflows/${dest}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async function scaffoldCodeagent(repoRoot, config, existing) {
|
|
52
|
+
const codeagentDir = path.join(repoRoot, ".codeagent");
|
|
53
|
+
await fs.mkdir(codeagentDir, { recursive: true });
|
|
54
|
+
// config.yml — inject user choices
|
|
55
|
+
if (existing.hasConfig) {
|
|
56
|
+
console.log(` ⚠ Skipped .codeagent/config.yml (already exists)`);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
let configContent = await readTemplate("config.yml");
|
|
60
|
+
configContent = configContent
|
|
61
|
+
.replace("provider: anthropic", `provider: ${config.provider}`)
|
|
62
|
+
.replace("model_id: claude-opus-4-5", `model_id: ${config.modelId}`)
|
|
63
|
+
.replace("api_key_env: CODEAGENT_API_KEY", `api_key_env: ${config.apiKeyEnv}`);
|
|
64
|
+
await fs.writeFile(path.join(codeagentDir, "config.yml"), configContent, "utf-8");
|
|
65
|
+
console.log(` ✓ Created .codeagent/config.yml`);
|
|
66
|
+
}
|
|
67
|
+
// memory.md — always scaffold if missing, it's the team's to fill in
|
|
68
|
+
if (existing.hasMemory) {
|
|
69
|
+
console.log(` ⚠ Skipped .codeagent/memory.md (already exists)`);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
await copyTemplate("memory.md", path.join(codeagentDir, "memory.md"));
|
|
73
|
+
console.log(` ✓ Created .codeagent/memory.md`);
|
|
74
|
+
}
|
|
75
|
+
// Seed empty decisions.json and issues.json so the agent doesn't have to create them
|
|
76
|
+
const decisionsPath = path.join(codeagentDir, "decisions.json");
|
|
77
|
+
if (!existing.hasDecisions) {
|
|
78
|
+
await fs.writeFile(decisionsPath, "[]", "utf-8");
|
|
79
|
+
console.log(` ✓ Created .codeagent/decisions.json`);
|
|
80
|
+
}
|
|
81
|
+
const issuesPath = path.join(codeagentDir, "issues.json");
|
|
82
|
+
if (!existing.hasIssues) {
|
|
83
|
+
await fs.writeFile(issuesPath, "[]", "utf-8");
|
|
84
|
+
console.log(` ✓ Created .codeagent/issues.json`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async function promptConfig() {
|
|
88
|
+
const rl = readline.createInterface({
|
|
89
|
+
input: process.stdin,
|
|
90
|
+
output: process.stdout,
|
|
91
|
+
});
|
|
92
|
+
const ask = (question, defaultVal) => new Promise((resolve) => {
|
|
93
|
+
rl.question(` ${question} (${defaultVal}): `, (answer) => {
|
|
94
|
+
resolve(answer.trim() || defaultVal);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
console.log(" Configure your LLM (press Enter to accept defaults):\n");
|
|
98
|
+
const providerInput = await ask("Provider — anthropic / openai / openai-compatible", "anthropic");
|
|
99
|
+
const defaultModel = providerInput === "anthropic"
|
|
100
|
+
? "claude-opus-4-5"
|
|
101
|
+
: providerInput === "openai"
|
|
102
|
+
? "gpt-4o"
|
|
103
|
+
: "your-model-id";
|
|
104
|
+
const modelId = await ask("Model ID", defaultModel);
|
|
105
|
+
const defaultKeyEnv = providerInput === "anthropic"
|
|
106
|
+
? "CODEAGENT_API_KEY"
|
|
107
|
+
: providerInput === "openai"
|
|
108
|
+
? "OPENAI_API_KEY"
|
|
109
|
+
: "CODEAGENT_API_KEY";
|
|
110
|
+
const apiKeyEnv = await ask("GitHub Actions secret name for your API key", defaultKeyEnv);
|
|
111
|
+
rl.close();
|
|
112
|
+
console.log("");
|
|
113
|
+
return {
|
|
114
|
+
provider: providerInput,
|
|
115
|
+
modelId,
|
|
116
|
+
apiKeyEnv,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
// ─── Post-init Instructions ───────────────────────────────────────────────────
|
|
120
|
+
function printNextSteps(repoRoot, config) {
|
|
121
|
+
const isCurrentDir = repoRoot === process.cwd();
|
|
122
|
+
const repoNote = isCurrentDir ? "this repository" : repoRoot;
|
|
123
|
+
console.log(`\n✓ judge-java initialised in ${repoNote}\n`);
|
|
124
|
+
console.log("─".repeat(60));
|
|
125
|
+
console.log("\n Next steps:\n");
|
|
126
|
+
console.log(` 1. Add your API key as a GitHub Actions secret named ${config.apiKeyEnv}:`);
|
|
127
|
+
console.log(` Repository → Settings → Secrets and variables → Actions`);
|
|
128
|
+
console.log(` Name: ${config.apiKeyEnv}`);
|
|
129
|
+
console.log(` Value: <your ${config.provider} API key>\n`);
|
|
130
|
+
console.log(` 2. Fill in .codeagent/memory.md with your domain context:`);
|
|
131
|
+
console.log(` - Your domain language and ubiquitous terms`);
|
|
132
|
+
console.log(` - Naming conventions for methods, tests, classes`);
|
|
133
|
+
console.log(` - Architectural rules and known anti-patterns\n`);
|
|
134
|
+
console.log(` 3. Commit everything:`);
|
|
135
|
+
console.log(` git add .github/ .codeagent/`);
|
|
136
|
+
console.log(` git commit -m "chore: add judge-java"`);
|
|
137
|
+
console.log(` git push\n`);
|
|
138
|
+
console.log(` 4. Open a pull request — judge-java will run automatically.\n`);
|
|
139
|
+
console.log(` To override a blocked PR, comment on it:`);
|
|
140
|
+
console.log(` /override-review <your reason>\n`);
|
|
141
|
+
console.log("─".repeat(60));
|
|
142
|
+
}
|
|
143
|
+
async function checkExisting(repoRoot) {
|
|
144
|
+
const workflowDir = path.join(repoRoot, ".github", "workflows");
|
|
145
|
+
const codeagentDir = path.join(repoRoot, ".codeagent");
|
|
146
|
+
const existingWorkflows = [];
|
|
147
|
+
for (const wf of ["code-review.yml", "code-review-override.yml"]) {
|
|
148
|
+
if (await fileExists(path.join(workflowDir, wf))) {
|
|
149
|
+
existingWorkflows.push(wf);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
const hasConfig = await fileExists(path.join(codeagentDir, "config.yml"));
|
|
153
|
+
const hasMemory = await fileExists(path.join(codeagentDir, "memory.md"));
|
|
154
|
+
const hasDecisions = await fileExists(path.join(codeagentDir, "decisions.json"));
|
|
155
|
+
const hasIssues = await fileExists(path.join(codeagentDir, "issues.json"));
|
|
156
|
+
const allPresent = existingWorkflows.length === 2 && hasConfig && hasMemory;
|
|
157
|
+
return {
|
|
158
|
+
allPresent,
|
|
159
|
+
workflows: existingWorkflows,
|
|
160
|
+
hasConfig,
|
|
161
|
+
hasMemory,
|
|
162
|
+
hasDecisions,
|
|
163
|
+
hasIssues,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
// ─── Git Repo Check ───────────────────────────────────────────────────────────
|
|
167
|
+
async function assertGitRepo(repoRoot) {
|
|
168
|
+
const gitDir = path.join(repoRoot, ".git");
|
|
169
|
+
const exists = await fileExists(gitDir);
|
|
170
|
+
if (!exists) {
|
|
171
|
+
throw new Error(`${repoRoot} does not appear to be a git repository.\n` +
|
|
172
|
+
`Run "git init" first, or specify the correct path with --repo.`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
176
|
+
async function copyTemplate(templateName, destPath) {
|
|
177
|
+
const content = await readTemplate(templateName);
|
|
178
|
+
await fs.writeFile(destPath, content, "utf-8");
|
|
179
|
+
}
|
|
180
|
+
async function readTemplate(templateName) {
|
|
181
|
+
// Templates are copied into dist/templates/ during build
|
|
182
|
+
const candidates = [
|
|
183
|
+
path.join(__dirname, "../../templates", templateName), // dist/templates/
|
|
184
|
+
path.join(__dirname, "../templates", templateName), // fallback for dev
|
|
185
|
+
];
|
|
186
|
+
for (const candidate of candidates) {
|
|
187
|
+
try {
|
|
188
|
+
return await fs.readFile(candidate, "utf-8");
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
// try next
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
throw new Error(`Template not found: ${templateName}`);
|
|
195
|
+
}
|
|
196
|
+
async function fileExists(filePath) {
|
|
197
|
+
try {
|
|
198
|
+
await fs.access(filePath);
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function parseRepoArg(args) {
|
|
206
|
+
const idx = args.indexOf("--repo");
|
|
207
|
+
if (idx !== -1 && args[idx + 1]) {
|
|
208
|
+
return path.resolve(args[idx + 1]);
|
|
209
|
+
}
|
|
210
|
+
return undefined;
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,KAAK,CAAC;AAElC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE/D,gFAAgF;AAEhF,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAc;IACxC,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAErD,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,iBAAiB,QAAQ,IAAI,CAAC,CAAC;IAE3C,kCAAkC;IAClC,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;IAE9B,4BAA4B;IAC5B,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;IAE/C,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAC;QACzE,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;QAC5E,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;QAC9D,OAAO,CA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E,YAAY,CAAC,EAAG,kBAAkB;QAC1E,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE,YAAY,CAAC,EAAM,mBAAmB;KAC9E,CAAC;IAEF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC;YACD,OAAO,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;QAAC,MAAM,CAAC;YACL,WAAW;QACf,CAAC;IACL,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,uBAAuB,YAAY,EAAE,CAAC,CAAC;AAC3D,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,QAAgB;IACtC,IAAI,CAAC;QACD,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC;AAED,SAAS,YAAY,CAAC,IAAc;IAChC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAIA,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0E7D"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as path from "path";
|
|
2
|
+
import { loadConfig, loadMemory } from "@judge-java/core";
|
|
3
|
+
export async function runStatus(args) {
|
|
4
|
+
const repoRoot = parseRepoArg(args) ?? process.cwd();
|
|
5
|
+
console.log(`\n◈ judge-java status\n`);
|
|
6
|
+
console.log(` Repository: ${repoRoot}\n`);
|
|
7
|
+
const [memory, config] = await Promise.all([
|
|
8
|
+
loadMemory(repoRoot),
|
|
9
|
+
loadConfig(repoRoot),
|
|
10
|
+
]);
|
|
11
|
+
// ── LLM config ─────────────────────────────────────────────────────────────
|
|
12
|
+
console.log(` LLM`);
|
|
13
|
+
console.log(` Provider: ${config.llm.provider}`);
|
|
14
|
+
console.log(` Model: ${config.llm.modelId}`);
|
|
15
|
+
console.log(` Key env: ${config.llm.apiKeyEnv}`);
|
|
16
|
+
console.log(``);
|
|
17
|
+
// ── Review levels ───────────────────────────────────────────────────────────
|
|
18
|
+
console.log(` Review Levels`);
|
|
19
|
+
const levels = Object.entries(config.reviewLevels);
|
|
20
|
+
const enabled = levels.filter(([, v]) => v.enabled);
|
|
21
|
+
const disabled = levels.filter(([, v]) => !v.enabled);
|
|
22
|
+
for (const [level, cfg] of enabled) {
|
|
23
|
+
const blocker = cfg.blocker ? " (blocker)" : " (warning)";
|
|
24
|
+
console.log(` ✓ ${level}${blocker}`);
|
|
25
|
+
}
|
|
26
|
+
for (const [level] of disabled) {
|
|
27
|
+
console.log(` - ${level} (disabled)`);
|
|
28
|
+
}
|
|
29
|
+
console.log(``);
|
|
30
|
+
// ── Memory ──────────────────────────────────────────────────────────────────
|
|
31
|
+
console.log(` Memory`);
|
|
32
|
+
const narrativeLines = memory.narrative.trim().split("\n").filter(Boolean).length;
|
|
33
|
+
console.log(` Conventions: ${narrativeLines} lines in memory.md`);
|
|
34
|
+
console.log(` Decisions: ${memory.decisions.length} recorded`);
|
|
35
|
+
const openIssues = memory.trackedIssues.filter((i) => i.status === "open");
|
|
36
|
+
const closedIssues = memory.trackedIssues.filter((i) => i.status === "closed");
|
|
37
|
+
console.log(` Tracked issues: ${openIssues.length} open, ${closedIssues.length} resolved`);
|
|
38
|
+
console.log(``);
|
|
39
|
+
// ── Decisions detail ────────────────────────────────────────────────────────
|
|
40
|
+
if (memory.decisions.length > 0) {
|
|
41
|
+
console.log(` Decisions`);
|
|
42
|
+
for (const d of memory.decisions) {
|
|
43
|
+
console.log(` • ${d.title}`);
|
|
44
|
+
console.log(` ${d.reason} (${d.date})`);
|
|
45
|
+
}
|
|
46
|
+
console.log(``);
|
|
47
|
+
}
|
|
48
|
+
// ── Open issues detail ──────────────────────────────────────────────────────
|
|
49
|
+
if (openIssues.length > 0) {
|
|
50
|
+
console.log(` Open Tracked Issues`);
|
|
51
|
+
for (const issue of openIssues) {
|
|
52
|
+
console.log(` #${issue.githubIssueNumber} ${issue.title} [${issue.reviewLevel}]`);
|
|
53
|
+
}
|
|
54
|
+
console.log(``);
|
|
55
|
+
}
|
|
56
|
+
// ── Overrides ───────────────────────────────────────────────────────────────
|
|
57
|
+
console.log(` Overrides`);
|
|
58
|
+
console.log(` Allowed: ${config.overrides.allowed ? "yes" : "no"}`);
|
|
59
|
+
console.log(` Audit log: ${config.overrides.auditLog ? "yes" : "no"}\n`);
|
|
60
|
+
}
|
|
61
|
+
function parseRepoArg(args) {
|
|
62
|
+
const idx = args.indexOf("--repo");
|
|
63
|
+
if (idx !== -1 && args[idx + 1]) {
|
|
64
|
+
return path.resolve(args[idx + 1]);
|
|
65
|
+
}
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAExD,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAc;IAC1C,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,GAAG,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C;IACtE,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* judge-java CLI
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* npx @judge-java/cli init — scaffold into current repository
|
|
7
|
+
* npx @judge-java/cli dashboard — generate static HTML dashboard
|
|
8
|
+
* npx @judge-java/cli status — show current .codeagent/ state
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* judge-java CLI
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* npx @judge-java/cli init — scaffold into current repository
|
|
7
|
+
* npx @judge-java/cli dashboard — generate static HTML dashboard
|
|
8
|
+
* npx @judge-java/cli status — show current .codeagent/ state
|
|
9
|
+
*/
|
|
10
|
+
import { runInit } from "./commands/init.js";
|
|
11
|
+
import { runDashboard } from "./commands/dashboard.js";
|
|
12
|
+
import { runStatus } from "./commands/status.js";
|
|
13
|
+
const args = process.argv.slice(2);
|
|
14
|
+
const command = args[0];
|
|
15
|
+
const HELP = `
|
|
16
|
+
judge-java — domain-aware code review for teams
|
|
17
|
+
|
|
18
|
+
Usage:
|
|
19
|
+
judge-java init Scaffold judge-java into this repository
|
|
20
|
+
judge-java dashboard Generate the static HTML dashboard
|
|
21
|
+
judge-java status Show current memory, decisions, and tracked issues
|
|
22
|
+
judge-java help Show this help
|
|
23
|
+
|
|
24
|
+
Options:
|
|
25
|
+
--repo <path> Target repository root (default: current directory)
|
|
26
|
+
|
|
27
|
+
Examples:
|
|
28
|
+
npx @judge-java/cli init
|
|
29
|
+
npx @judge-java/cli init --repo /path/to/my-repo
|
|
30
|
+
npx @judge-java/cli dashboard
|
|
31
|
+
npx @judge-java/cli status
|
|
32
|
+
`;
|
|
33
|
+
async function main() {
|
|
34
|
+
switch (command) {
|
|
35
|
+
case "init":
|
|
36
|
+
await runInit(args.slice(1));
|
|
37
|
+
break;
|
|
38
|
+
case "dashboard":
|
|
39
|
+
await runDashboard(args.slice(1));
|
|
40
|
+
break;
|
|
41
|
+
case "status":
|
|
42
|
+
await runStatus(args.slice(1));
|
|
43
|
+
break;
|
|
44
|
+
case "help":
|
|
45
|
+
case "--help":
|
|
46
|
+
case "-h":
|
|
47
|
+
case undefined:
|
|
48
|
+
console.log(HELP);
|
|
49
|
+
break;
|
|
50
|
+
default:
|
|
51
|
+
console.error(`\nUnknown command: ${command}\n`);
|
|
52
|
+
console.log(HELP);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
main().catch((err) => {
|
|
57
|
+
console.error(`\n✗ ${String(err)}\n`);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAE/C,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAExB,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;CAiBZ,CAAC;AAEF,KAAK,UAAU,IAAI;IACf,QAAQ,OAAO,EAAE,CAAC;QACd,KAAK,MAAM;YACP,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7B,MAAM;QACV,KAAK,WAAW;YACZ,MAAM,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAClC,MAAM;QACV,KAAK,QAAQ;YACT,MAAM,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/B,MAAM;QACV,KAAK,MAAM,CAAC;QACZ,KAAK,QAAQ,CAAC;QACd,KAAK,IAAI,CAAC;QACV,KAAK,SAAS;YACV,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,MAAM;QACV;YACI,OAAO,CAAC,KAAK,CAAC,sBAAsB,OAAO,IAAI,CAAC,CAAC;YACjD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Override Code Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issue_comment:
|
|
5
|
+
types: [ created ]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
pull-requests: write
|
|
10
|
+
statuses: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
override:
|
|
14
|
+
name: Process Override Command
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
if: |
|
|
17
|
+
github.event.issue.pull_request &&
|
|
18
|
+
startsWith(github.event.comment.body, '/override-review')
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout repository
|
|
22
|
+
uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Setup Node.js
|
|
25
|
+
uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: "20"
|
|
28
|
+
cache: "npm"
|
|
29
|
+
|
|
30
|
+
- name: Install judge-java
|
|
31
|
+
run: npm install --save-dev @judge-java/core @judge-java/github
|
|
32
|
+
|
|
33
|
+
- name: Process override
|
|
34
|
+
env:
|
|
35
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
36
|
+
PR_NUMBER: ${{ github.event.issue.number }}
|
|
37
|
+
ACTOR: ${{ github.event.comment.user.login }}
|
|
38
|
+
COMMENT_BODY: ${{ github.event.comment.body }}
|
|
39
|
+
run: node node_modules/@judge-java/github/dist/override.js
|
|
40
|
+
|
|
41
|
+
- name: Commit audit log
|
|
42
|
+
run: |
|
|
43
|
+
git config user.name "judge-java[bot]"
|
|
44
|
+
git config user.email "judge-java[bot]@users.noreply.github.com"
|
|
45
|
+
git add .codeagent/audit.log
|
|
46
|
+
git diff --staged --quiet || git commit -m "chore: log judge-java override [skip ci]"
|
|
47
|
+
git push
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Code Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize, reopened]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
pull-requests: write
|
|
10
|
+
issues: write
|
|
11
|
+
statuses: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
review:
|
|
15
|
+
name: Run Code Review
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout repository
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
|
|
24
|
+
- name: Setup Node.js
|
|
25
|
+
uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: "20"
|
|
28
|
+
cache: "npm"
|
|
29
|
+
|
|
30
|
+
- name: Install judge-java
|
|
31
|
+
run: npm install --save-dev @judge-java/core @judge-java/github
|
|
32
|
+
|
|
33
|
+
- name: Run code review
|
|
34
|
+
env:
|
|
35
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
36
|
+
CODEAGENT_API_KEY: ${{ secrets.CODEAGENT_API_KEY }}
|
|
37
|
+
REVIEW_LEVELS: ${{ vars.CODEAGENT_REVIEW_LEVELS }}
|
|
38
|
+
run: node node_modules/@judge-java/github/dist/action.js
|
|
39
|
+
|
|
40
|
+
- name: Commit memory updates
|
|
41
|
+
if: always()
|
|
42
|
+
run: |
|
|
43
|
+
git config user.name "judge-java[bot]"
|
|
44
|
+
git config user.email "judge-java[bot]@users.noreply.github.com"
|
|
45
|
+
git add .codeagent/
|
|
46
|
+
git diff --staged --quiet || git commit -m "chore: update judge-java memory [skip ci]"
|
|
47
|
+
git push
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# judge-java configuration
|
|
2
|
+
|
|
3
|
+
llm:
|
|
4
|
+
provider: anthropic # anthropic | openai | openai-compatible
|
|
5
|
+
api_key_env: CODEAGENT_API_KEY # name of the GitHub Actions secret
|
|
6
|
+
model_id: claude-opus-4-5
|
|
7
|
+
max_tokens: 8096
|
|
8
|
+
|
|
9
|
+
review_levels:
|
|
10
|
+
scope_check: { enabled: true, blocker: true }
|
|
11
|
+
domain_language: { enabled: true, blocker: true }
|
|
12
|
+
test_quality: { enabled: true, blocker: true }
|
|
13
|
+
obvious_bugs: { enabled: true, blocker: true }
|
|
14
|
+
pr_hygiene: { enabled: true, blocker: false }
|
|
15
|
+
security: { enabled: false, blocker: true }
|
|
16
|
+
performance: { enabled: false, blocker: false }
|
|
17
|
+
architecture: { enabled: false, blocker: false }
|
|
18
|
+
accessibility: { enabled: false, blocker: false }
|
|
19
|
+
refactoring_opportunities: { enabled: false, blocker: false }
|
|
20
|
+
|
|
21
|
+
github:
|
|
22
|
+
label_prefix: judge-java
|
|
23
|
+
|
|
24
|
+
overrides:
|
|
25
|
+
allowed: true
|
|
26
|
+
audit_log: true
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Team Context, Conventions & Domain Knowledge
|
|
2
|
+
|
|
3
|
+
Edit this file to teach judge-java about your domain, naming conventions,
|
|
4
|
+
and architectural patterns. The more context you provide, the more accurate
|
|
5
|
+
and domain-aware your reviews will be.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Domain & Ubiquitous Language
|
|
10
|
+
|
|
11
|
+
<!--
|
|
12
|
+
Describe your business domain and the specific language your team uses.
|
|
13
|
+
|
|
14
|
+
Example:
|
|
15
|
+
- We are building a payments platform.
|
|
16
|
+
- Use "authorise" not "approve". Use "merchant" not "vendor".
|
|
17
|
+
- A "Transaction" is the completed ledger entry. A "Payment" is the intent.
|
|
18
|
+
-->
|
|
19
|
+
|
|
20
|
+
*Add your domain language here.*
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Naming Conventions
|
|
25
|
+
|
|
26
|
+
<!--
|
|
27
|
+
Example:
|
|
28
|
+
- Service methods: verb-noun — authorisePayment(), refundTransaction()
|
|
29
|
+
- Test names: test_[scenario]_[expectedOutcome]
|
|
30
|
+
- Events are past tense: PaymentAuthorised, OrderPlaced
|
|
31
|
+
- Booleans: isActive, hasExpired, wasRefunded
|
|
32
|
+
-->
|
|
33
|
+
|
|
34
|
+
*Add your naming conventions here.*
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Architecture & Patterns
|
|
39
|
+
|
|
40
|
+
<!--
|
|
41
|
+
Example:
|
|
42
|
+
- Layered architecture: Controllers → Services → Repositories
|
|
43
|
+
- Services must not call other Services — use domain events
|
|
44
|
+
- No business logic in Controllers
|
|
45
|
+
-->
|
|
46
|
+
|
|
47
|
+
*Add your architectural patterns here.*
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Test Conventions
|
|
52
|
+
|
|
53
|
+
<!--
|
|
54
|
+
Example:
|
|
55
|
+
- Unit tests live alongside source files
|
|
56
|
+
- Use Arrange-Act-Assert structure
|
|
57
|
+
- Mock only external dependencies, never domain services
|
|
58
|
+
-->
|
|
59
|
+
|
|
60
|
+
*Add your test conventions here.*
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Known Anti-Patterns
|
|
65
|
+
|
|
66
|
+
<!--
|
|
67
|
+
Example:
|
|
68
|
+
- Do not use raw SQL strings — use the QueryBuilder
|
|
69
|
+
- Do not catch and swallow exceptions
|
|
70
|
+
- Do not pass userId as a plain string — use a UserId value object
|
|
71
|
+
-->
|
|
72
|
+
|
|
73
|
+
*Add patterns you always want flagged here.*
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@judge-java/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI for judge-java \u2014 init, dashboard, and management commands",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": ["dist"],
|
|
7
|
+
"bin": {
|
|
8
|
+
"judge-java": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc -p tsconfig.json && npm run copy-templates",
|
|
12
|
+
"copy-templates": "cp -r src/templates dist/templates",
|
|
13
|
+
"test": "vitest run"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@judge-java/core": "*",
|
|
17
|
+
"@judge-java/dashboard": "*"
|
|
18
|
+
},
|
|
19
|
+
"main": "./dist/index.js"
|
|
20
|
+
}
|