oc-pilot 0.103.0 → 0.104.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/CHANGELOG.md +7 -0
- package/README.md +7 -5
- package/README.ru.md +6 -4
- package/dist/cli.js +5 -1
- package/dist/cli.js.map +1 -1
- package/dist/cli.test.js +12 -0
- package/dist/cli.test.js.map +1 -1
- package/dist/commands/scalpel.js +215 -0
- package/dist/commands/scalpel.js.map +1 -0
- package/dist/core/scalpel.js +161 -0
- package/dist/core/scalpel.js.map +1 -0
- package/dist/core/scalpel.test.js +132 -0
- package/dist/core/scalpel.test.js.map +1 -0
- package/dist/mcp-prompts.test.js +1 -0
- package/dist/mcp-prompts.test.js.map +1 -1
- package/dist/mcp.js +90 -0
- package/dist/mcp.js.map +1 -1
- package/dist/mcp.test.js +6 -0
- package/dist/mcp.test.js.map +1 -1
- package/dist/skills.test.js +2 -0
- package/dist/skills.test.js.map +1 -1
- package/dist/version.js +1 -1
- package/docs/integrations.md +5 -5
- package/package.json +1 -1
- package/skills/agent-self-review/SKILL.md +1 -1
- package/skills/commit-discipline/SKILL.md +1 -1
- package/skills/oc-pilot/SKILL.md +3 -0
- package/skills/secure-diff-gate/SKILL.md +1 -1
- package/skills/stack-review-packs/SKILL.md +1 -1
- package/skills/test-failure-triage/SKILL.md +1 -1
package/dist/mcp.js
CHANGED
|
@@ -1349,6 +1349,31 @@ const TOOLS = [
|
|
|
1349
1349
|
},
|
|
1350
1350
|
},
|
|
1351
1351
|
},
|
|
1352
|
+
{
|
|
1353
|
+
name: "scalpel",
|
|
1354
|
+
description: "Given a failing test log and the current diff, ask the model for the smallest patch, apply the current diff plus the patch in a shadow worktree, run tests and report the blast radius. Model-backed; apply writes to the worktree and needs --allow-write.",
|
|
1355
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
|
|
1356
|
+
inputSchema: {
|
|
1357
|
+
type: "object",
|
|
1358
|
+
additionalProperties: false,
|
|
1359
|
+
properties: {
|
|
1360
|
+
log: { type: "string", description: "Captured failing test output" },
|
|
1361
|
+
error: { type: "string", description: "Error text instead of a log" },
|
|
1362
|
+
command: { type: "string", description: "Command that reproduces the failure" },
|
|
1363
|
+
context: { type: "string", description: "What the code is supposed to do" },
|
|
1364
|
+
apply: { type: "boolean", description: "Apply a verified patch to the worktree" },
|
|
1365
|
+
test_command: { type: "string", description: "Test command; defaults to detection" },
|
|
1366
|
+
test_timeout_ms: { type: "integer", minimum: 1000, maximum: 900000 },
|
|
1367
|
+
no_test: { type: "boolean", description: "Skip tests; result becomes unverified" },
|
|
1368
|
+
diff: { type: "string", description: "Unified diff text; omit to use the project's git diff" },
|
|
1369
|
+
base: { type: "string" },
|
|
1370
|
+
staged: { type: "boolean" },
|
|
1371
|
+
unstaged: { type: "boolean" },
|
|
1372
|
+
include_untracked: { type: "boolean" },
|
|
1373
|
+
...RESULT_PROPERTIES,
|
|
1374
|
+
},
|
|
1375
|
+
},
|
|
1376
|
+
},
|
|
1352
1377
|
{
|
|
1353
1378
|
name: "apoptosis",
|
|
1354
1379
|
description: "Scan functions marked /* @lifespan: 30d */ and report [Senescent] when the marker is older than the lifespan and the symbol has no references. With action=apply and confirm=true, comment the senescent functions out in a shadow git worktree, run tests and land the diff only if the suite is green. Apply writes files and needs --allow-write.",
|
|
@@ -1593,6 +1618,14 @@ const PROMPTS = [
|
|
|
1593
1618
|
{ name: "context", description: "What is already known", required: false },
|
|
1594
1619
|
],
|
|
1595
1620
|
},
|
|
1621
|
+
{
|
|
1622
|
+
name: "operate-with-a-scalpel",
|
|
1623
|
+
title: "Fix a failure with the smallest patch",
|
|
1624
|
+
description: "Propose a minimal patch for a failing test, prove it in a shadow worktree and show the blast radius before applying anything.",
|
|
1625
|
+
arguments: [
|
|
1626
|
+
{ name: "context", description: "What the code is supposed to do", required: false },
|
|
1627
|
+
],
|
|
1628
|
+
},
|
|
1596
1629
|
{
|
|
1597
1630
|
name: "prune-senescent-code",
|
|
1598
1631
|
title: "Prune senescent AI code",
|
|
@@ -3696,6 +3729,50 @@ async function callIntent(input, cwd) {
|
|
|
3696
3729
|
temp.cleanup();
|
|
3697
3730
|
}
|
|
3698
3731
|
}
|
|
3732
|
+
async function callScalpel(input, cwd) {
|
|
3733
|
+
const temp = new TempFiles();
|
|
3734
|
+
try {
|
|
3735
|
+
const args = ["scalpel", "--json"];
|
|
3736
|
+
const log = stringArg(input, "log");
|
|
3737
|
+
if (log)
|
|
3738
|
+
args.push("--log", log);
|
|
3739
|
+
const error = stringArg(input, "error");
|
|
3740
|
+
if (error)
|
|
3741
|
+
args.push("--error", error);
|
|
3742
|
+
const command = stringArg(input, "command");
|
|
3743
|
+
if (command)
|
|
3744
|
+
args.push("--command", command);
|
|
3745
|
+
const context = stringArg(input, "context");
|
|
3746
|
+
if (context)
|
|
3747
|
+
args.push("--context", context);
|
|
3748
|
+
if (booleanArg(input, "apply"))
|
|
3749
|
+
args.push("--apply");
|
|
3750
|
+
const testCommand = stringArg(input, "test_command");
|
|
3751
|
+
if (testCommand)
|
|
3752
|
+
args.push("--test-command", testCommand);
|
|
3753
|
+
const timeout = integerArg(input, "test_timeout_ms");
|
|
3754
|
+
if (timeout !== undefined)
|
|
3755
|
+
args.push("--test-timeout", String(Math.max(1, Math.round(timeout / 1000))) + "s");
|
|
3756
|
+
if (booleanArg(input, "no_test"))
|
|
3757
|
+
args.push("--no-test");
|
|
3758
|
+
const diff = stringArg(input, "diff");
|
|
3759
|
+
if (diff)
|
|
3760
|
+
args.push("--diff", temp.write("scalpel.diff", diff));
|
|
3761
|
+
const base = baseArg(input);
|
|
3762
|
+
if (base)
|
|
3763
|
+
args.push("--base", base);
|
|
3764
|
+
if (booleanArg(input, "staged"))
|
|
3765
|
+
args.push("--staged");
|
|
3766
|
+
if (booleanArg(input, "unstaged"))
|
|
3767
|
+
args.push("--unstaged");
|
|
3768
|
+
if (booleanArg(input, "include_untracked"))
|
|
3769
|
+
args.push("--include-untracked");
|
|
3770
|
+
return toToolResult(await runCli(args, cwd));
|
|
3771
|
+
}
|
|
3772
|
+
finally {
|
|
3773
|
+
temp.cleanup();
|
|
3774
|
+
}
|
|
3775
|
+
}
|
|
3699
3776
|
async function callApoptosis(input, cwd) {
|
|
3700
3777
|
const action = stringArg(input, "action") ?? "scan";
|
|
3701
3778
|
const args = ["apoptosis", action, "--json"];
|
|
@@ -3920,6 +3997,9 @@ async function dispatchTool(name, input, cwd, readOnly) {
|
|
|
3920
3997
|
if (name === "mitosis" && stringArg(input, "action") === "apply") {
|
|
3921
3998
|
throw new ToolInputError("mitosis apply creates commits and a branch and is disabled in read-only mode; start the MCP server with --allow-write");
|
|
3922
3999
|
}
|
|
4000
|
+
if (name === "scalpel" && booleanArg(input, "apply")) {
|
|
4001
|
+
throw new ToolInputError("scalpel apply writes to the worktree and is disabled in read-only mode; start the MCP server with --allow-write");
|
|
4002
|
+
}
|
|
3923
4003
|
if (name === "honeypot" && (stringArg(input, "action") === "deploy" || stringArg(input, "action") === "remove")) {
|
|
3924
4004
|
throw new ToolInputError("honeypot deploy/remove writes files and is disabled in read-only mode; start the MCP server with --allow-write");
|
|
3925
4005
|
}
|
|
@@ -4045,6 +4125,8 @@ async function dispatchTool(name, input, cwd, readOnly) {
|
|
|
4045
4125
|
return callMitosis(input, cwd);
|
|
4046
4126
|
case "intent":
|
|
4047
4127
|
return callIntent(input, cwd);
|
|
4128
|
+
case "scalpel":
|
|
4129
|
+
return callScalpel(input, cwd);
|
|
4048
4130
|
case "apoptosis":
|
|
4049
4131
|
return callApoptosis(input, cwd);
|
|
4050
4132
|
case "scan_injection":
|
|
@@ -4124,6 +4206,12 @@ function summarizeResult(value) {
|
|
|
4124
4206
|
if (typeof value.status === "string" && Array.isArray(value.removed) && typeof value.summary === "string") {
|
|
4125
4207
|
return `oc-pilot: apoptosis ${value.status}, ${String(value.removed.length)} removed`;
|
|
4126
4208
|
}
|
|
4209
|
+
if (typeof value.status === "string" &&
|
|
4210
|
+
["fixed", "rejected", "unverified", "error"].includes(value.status) &&
|
|
4211
|
+
Array.isArray(value.files) &&
|
|
4212
|
+
typeof value.tests === "string") {
|
|
4213
|
+
return `oc-pilot: scalpel ${value.status}, ${String(value.files.length)} file(s), tests ${value.tests}`;
|
|
4214
|
+
}
|
|
4127
4215
|
if (typeof value.status === "string" && Array.isArray(value.results) && value.counts && typeof value.counts === "object") {
|
|
4128
4216
|
const counts = value.counts;
|
|
4129
4217
|
return `oc-pilot: intent ${value.status}, ${String(counts.unmet ?? 0)} unmet`;
|
|
@@ -4436,6 +4524,8 @@ function promptBody(name, args) {
|
|
|
4436
4524
|
return `Call the oc-pilot "skeptic" tool on the proposed diff. Read the hypothesis reason and the exact status. If it returns bug, stop and quote the failing test output: the generated test fails on the diff and passes on HEAD, so the change is falsified. Fix the code or the test expectation, then rerun; do not delete the test, do not weaken the assertion and do not claim a bug from a test that also fails on HEAD. If it returns clean, say that the hypothesis was rejected, not that the code is proven correct. If it returns unfalsifiable, explain that the test did not distinguish the diff from HEAD. If it returns error, report the infrastructure failure instead of guessing.${suffix}`;
|
|
4437
4525
|
case "stamp-the-passport":
|
|
4438
4526
|
return `Call the oc-pilot "passport" tool with action=write after the checks you actually ran, then action=verify. Record only real checks as name=pass|warn|fail|skip, the real agent/model and the commit. If verify returns [PASSPORT STALE] or [PASSPORT TAMPERED], stop: the manifest no longer matches the tree; rewrite it from the current state or investigate the change. Never mark a check as pass without running it, never edit the manifest by hand to hide a mismatch, and never claim that a passport proves correctness: it proves what was recorded and that the files still match. write/clear need --allow-write.${suffix}`;
|
|
4527
|
+
case "operate-with-a-scalpel":
|
|
4528
|
+
return `Call the oc-pilot "scalpel" tool with the failing log, or a command that reproduces it, and the proposed diff. Read the patch and the blast radius. If it returns [SCALPEL FIXED], review the patch and apply it only with explicit approval. If it returns [SCALPEL REJECTED], do not apply it and do not weaken the test. If it returns [SCALPEL UNVERIFIED], run the tests yourself before claiming a fix. Never delete a failing test, never skip it, and never let the patch touch unrelated files. apply needs --allow-write.${suffix}`;
|
|
4439
4529
|
case "check-the-criteria":
|
|
4440
4530
|
return `Call the oc-pilot "intent" tool with action=check and the acceptance criteria for this change. Read every criterion as met, partial, unmet or unverifiable. If any is unmet, stop and quote the criterion and the evidence: the diff does not do what was promised. Fix the code or the criterion, never mark it met without evidence. Partial is not done, and unverifiable means the diff cannot prove it. Model-backed and read-only.${suffix}`;
|
|
4441
4531
|
case "interrogate-the-intent":
|