oc-pilot 0.96.0 → 0.97.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 +13 -0
- package/README.md +7 -5
- package/README.ru.md +6 -4
- package/dist/cli.js +6 -1
- package/dist/cli.js.map +1 -1
- package/dist/cli.test.js +13 -0
- package/dist/cli.test.js.map +1 -1
- package/dist/commands/antibody.js +132 -0
- package/dist/commands/antibody.js.map +1 -0
- package/dist/core/antibody.js +240 -0
- package/dist/core/antibody.js.map +1 -0
- package/dist/core/antibody.test.js +108 -0
- package/dist/core/antibody.test.js.map +1 -0
- package/dist/core/hyper-chamber.js +4 -1
- package/dist/core/hyper-chamber.js.map +1 -1
- package/dist/core/hyper-chamber.test.js +1 -1
- package/dist/core/hyper-chamber.test.js.map +1 -1
- package/dist/core/phantom.js +4 -1
- package/dist/core/phantom.js.map +1 -1
- package/dist/mcp-prompts.test.js +1 -0
- package/dist/mcp-prompts.test.js.map +1 -1
- package/dist/mcp.js +73 -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
|
@@ -1168,6 +1168,27 @@ const TOOLS = [
|
|
|
1168
1168
|
},
|
|
1169
1169
|
},
|
|
1170
1170
|
},
|
|
1171
|
+
{
|
|
1172
|
+
name: "antibody",
|
|
1173
|
+
description: "Learn SAST findings as reusable signatures in .oc-pilot/antibodies.json, then scan added diff lines for the same vulnerability pattern. Actions: learn, scan, list, forget, clear. Offline and deterministic; learn/forget/clear write files and need --allow-write.",
|
|
1174
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
1175
|
+
inputSchema: {
|
|
1176
|
+
type: "object",
|
|
1177
|
+
additionalProperties: false,
|
|
1178
|
+
required: ["action"],
|
|
1179
|
+
properties: {
|
|
1180
|
+
action: { type: "string", enum: ["learn", "scan", "list", "forget", "clear"] },
|
|
1181
|
+
id: { type: "string", description: "Signature id for forget" },
|
|
1182
|
+
force: { type: "boolean", description: "Confirm clear" },
|
|
1183
|
+
diff: { type: "string", description: "Unified diff text; omit to use the project's git diff" },
|
|
1184
|
+
base: { type: "string" },
|
|
1185
|
+
staged: { type: "boolean" },
|
|
1186
|
+
unstaged: { type: "boolean" },
|
|
1187
|
+
include_untracked: { type: "boolean" },
|
|
1188
|
+
...RESULT_PROPERTIES,
|
|
1189
|
+
},
|
|
1190
|
+
},
|
|
1191
|
+
},
|
|
1171
1192
|
{
|
|
1172
1193
|
name: "apoptosis",
|
|
1173
1194
|
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.",
|
|
@@ -1348,6 +1369,14 @@ const PROMPTS = [
|
|
|
1348
1369
|
{ name: "context", description: "What the change is supposed to do", required: false },
|
|
1349
1370
|
],
|
|
1350
1371
|
},
|
|
1372
|
+
{
|
|
1373
|
+
name: "raise-antibodies",
|
|
1374
|
+
title: "Raise antibodies for known vulnerabilities",
|
|
1375
|
+
description: "Learn the repository's SAST findings as signatures, then scan a diff for the same vulnerability pattern and stop on [ANTIBODY MATCH].",
|
|
1376
|
+
arguments: [
|
|
1377
|
+
{ name: "context", description: "What the change is supposed to do", required: false },
|
|
1378
|
+
],
|
|
1379
|
+
},
|
|
1351
1380
|
{
|
|
1352
1381
|
name: "prune-senescent-code",
|
|
1353
1382
|
title: "Prune senescent AI code",
|
|
@@ -3196,6 +3225,34 @@ async function callSkeptic(input, cwd) {
|
|
|
3196
3225
|
temp.cleanup();
|
|
3197
3226
|
}
|
|
3198
3227
|
}
|
|
3228
|
+
async function callAntibody(input, cwd) {
|
|
3229
|
+
const temp = new TempFiles();
|
|
3230
|
+
try {
|
|
3231
|
+
const action = stringArg(input, "action", true);
|
|
3232
|
+
const args = ["antibody", action, "--json"];
|
|
3233
|
+
const diff = stringArg(input, "diff");
|
|
3234
|
+
if (diff)
|
|
3235
|
+
args.push("--diff", temp.write("antibody.diff", diff));
|
|
3236
|
+
const base = baseArg(input);
|
|
3237
|
+
if (base)
|
|
3238
|
+
args.push("--base", base);
|
|
3239
|
+
if (booleanArg(input, "staged"))
|
|
3240
|
+
args.push("--staged");
|
|
3241
|
+
if (booleanArg(input, "unstaged"))
|
|
3242
|
+
args.push("--unstaged");
|
|
3243
|
+
if (booleanArg(input, "include_untracked"))
|
|
3244
|
+
args.push("--include-untracked");
|
|
3245
|
+
const id = stringArg(input, "id");
|
|
3246
|
+
if (id)
|
|
3247
|
+
args.push("--id", id);
|
|
3248
|
+
if (booleanArg(input, "force"))
|
|
3249
|
+
args.push("--force");
|
|
3250
|
+
return toToolResult(await runCli(args, cwd));
|
|
3251
|
+
}
|
|
3252
|
+
finally {
|
|
3253
|
+
temp.cleanup();
|
|
3254
|
+
}
|
|
3255
|
+
}
|
|
3199
3256
|
async function callApoptosis(input, cwd) {
|
|
3200
3257
|
const action = stringArg(input, "action") ?? "scan";
|
|
3201
3258
|
const args = ["apoptosis", action, "--json"];
|
|
@@ -3408,6 +3465,9 @@ async function dispatchTool(name, input, cwd, readOnly) {
|
|
|
3408
3465
|
if (name === "deps" && (booleanArg(input, "fix") || stringArg(input, "sbom"))) {
|
|
3409
3466
|
throw new ToolInputError("deps fix and sbom write files and are disabled in read-only mode; start the MCP server with --allow-write");
|
|
3410
3467
|
}
|
|
3468
|
+
if (name === "antibody" && ["learn", "forget", "clear"].includes(stringArg(input, "action") ?? "")) {
|
|
3469
|
+
throw new ToolInputError("antibody learn/forget/clear write .oc-pilot/antibodies.json and are disabled in read-only mode; start the MCP server with --allow-write");
|
|
3470
|
+
}
|
|
3411
3471
|
if (name === "honeypot" && (stringArg(input, "action") === "deploy" || stringArg(input, "action") === "remove")) {
|
|
3412
3472
|
throw new ToolInputError("honeypot deploy/remove writes files and is disabled in read-only mode; start the MCP server with --allow-write");
|
|
3413
3473
|
}
|
|
@@ -3519,6 +3579,8 @@ async function dispatchTool(name, input, cwd, readOnly) {
|
|
|
3519
3579
|
return callBlindfold(input, cwd);
|
|
3520
3580
|
case "skeptic":
|
|
3521
3581
|
return callSkeptic(input, cwd);
|
|
3582
|
+
case "antibody":
|
|
3583
|
+
return callAntibody(input, cwd);
|
|
3522
3584
|
case "apoptosis":
|
|
3523
3585
|
return callApoptosis(input, cwd);
|
|
3524
3586
|
case "scan_injection":
|
|
@@ -3598,6 +3660,15 @@ function summarizeResult(value) {
|
|
|
3598
3660
|
if (typeof value.status === "string" && Array.isArray(value.removed) && typeof value.summary === "string") {
|
|
3599
3661
|
return `oc-pilot: apoptosis ${value.status}, ${String(value.removed.length)} removed`;
|
|
3600
3662
|
}
|
|
3663
|
+
if (typeof value.signatures === "number" && Array.isArray(value.matches)) {
|
|
3664
|
+
return `oc-pilot: antibody ${String(value.matches.length)} match(es), ${String(value.signatures)} signature(s)`;
|
|
3665
|
+
}
|
|
3666
|
+
if (typeof value.total === "number" && typeof value.added === "number") {
|
|
3667
|
+
return `oc-pilot: antibody learned ${String(value.added)}, total ${String(value.total)}`;
|
|
3668
|
+
}
|
|
3669
|
+
if (Array.isArray(value.signatures)) {
|
|
3670
|
+
return `oc-pilot: antibody ${String(value.signatures.length)} signature(s)`;
|
|
3671
|
+
}
|
|
3601
3672
|
if (typeof value.status === "string" && typeof value.summary === "string" && typeof value.durationMs === "number" && value.hypothesis) {
|
|
3602
3673
|
return `oc-pilot: skeptic ${value.status}`;
|
|
3603
3674
|
}
|
|
@@ -3862,6 +3933,8 @@ function promptBody(name, args) {
|
|
|
3862
3933
|
return `Call the oc-pilot "blindfold" tool on the added diff lines, or pass file when the change is one file. Read the obfuscated code and the verdict. If it reports [BLINDFOLD REJECTED], stop: the model could not reconstruct the logic, found a concrete vulnerability or stayed below min_confidence. Quote the explanation and fix the real code path; do not reveal the original names to the model, do not raise min_confidence to force a pass and do not add comments that explain the logic to the model. If it passes, say that the verdict is a blind review, not a mathematical proof of safety. Use dry_run only to inspect the mapping and never send the mapping to the model.${suffix}`;
|
|
3863
3934
|
case "falsify-the-diff":
|
|
3864
3935
|
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}`;
|
|
3936
|
+
case "raise-antibodies":
|
|
3937
|
+
return `Call the oc-pilot "antibody" tool with action=learn first, then action=scan on the proposed diff. Read the learned signature count and every [ANTIBODY MATCH] entry with rule, file:line and evidence. If a match is reported, stop: the diff reintroduced a vulnerability pattern that the repository already fixed. Fix the code path and rescan; do not delete the signature, do not suppress the line and do not clear the store to force a pass. If the scan is clean, say that no learned pattern matched, not that the code is safe. learn/forget/clear write files and need --allow-write; clear requires explicit user approval and force=true.${suffix}`;
|
|
3865
3938
|
case "prune-senescent-code":
|
|
3866
3939
|
return `Call the oc-pilot "apoptosis" tool with action=scan first. Report every [Senescent] entry with file, symbol, age and reference count, and explain that an expired marker plus zero references is the only reason it is a candidate. Do not delete anything without explicit user approval. If approved, call action=apply with confirm=true and the project test command; apply runs in a shadow worktree and lands the diff only if tests pass. If tests fail, report the failure and keep the working tree unchanged. Never remove a function that still has references, never shorten the lifespan to force a candidate, and never claim that deletion is safe without the green test run.${suffix}`;
|
|
3867
3940
|
case "scan-for-injection":
|