oc-pilot 0.92.0 → 0.94.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 +15 -0
- package/README.md +10 -6
- package/README.ru.md +9 -5
- package/dist/cli.js +9 -1
- package/dist/cli.js.map +1 -1
- package/dist/cli.test.js +44 -0
- package/dist/cli.test.js.map +1 -1
- package/dist/commands/apoptosis.js +107 -0
- package/dist/commands/apoptosis.js.map +1 -0
- package/dist/commands/blindfold.js +196 -0
- package/dist/commands/blindfold.js.map +1 -0
- package/dist/core/apoptosis.js +210 -0
- package/dist/core/apoptosis.js.map +1 -0
- package/dist/core/apoptosis.test.js +104 -0
- package/dist/core/apoptosis.test.js.map +1 -0
- package/dist/core/blindfold.js +451 -0
- package/dist/core/blindfold.js.map +1 -0
- package/dist/core/blindfold.test.js +77 -0
- package/dist/core/blindfold.test.js.map +1 -0
- package/dist/mcp-prompts.test.js +2 -0
- package/dist/mcp-prompts.test.js.map +1 -1
- package/dist/mcp.js +124 -0
- package/dist/mcp.js.map +1 -1
- package/dist/mcp.test.js +11 -0
- package/dist/mcp.test.js.map +1 -1
- package/dist/skills.test.js +4 -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 +4 -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
|
@@ -1127,6 +1127,44 @@ const TOOLS = [
|
|
|
1127
1127
|
},
|
|
1128
1128
|
},
|
|
1129
1129
|
},
|
|
1130
|
+
{
|
|
1131
|
+
name: "blindfold",
|
|
1132
|
+
description: "Obfuscate identifiers in a file or the added diff lines, then ask the model what the code does and whether it contains a concrete vulnerability. Returns a strict JSON verdict and rejects the code when the model cannot reconstruct the logic, finds a defect or stays below min_confidence. Model-backed, read-only and not a mathematical proof.",
|
|
1133
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
1134
|
+
inputSchema: {
|
|
1135
|
+
type: "object",
|
|
1136
|
+
additionalProperties: false,
|
|
1137
|
+
properties: {
|
|
1138
|
+
file: { type: "string", description: "Repository-relative source file; omit to use the added diff lines" },
|
|
1139
|
+
diff: { type: "string", description: "Unified diff text; omit to use the project's git diff" },
|
|
1140
|
+
base: { type: "string" },
|
|
1141
|
+
staged: { type: "boolean" },
|
|
1142
|
+
unstaged: { type: "boolean" },
|
|
1143
|
+
include_untracked: { type: "boolean" },
|
|
1144
|
+
context: { type: "string", description: "Extra context for the model; names stay hidden" },
|
|
1145
|
+
min_confidence: { type: "number", minimum: 0, maximum: 1, description: "Minimum confidence (default 0.6)" },
|
|
1146
|
+
dry_run: { type: "boolean", description: "Return the obfuscated code and mapping without a model call" },
|
|
1147
|
+
...RESULT_PROPERTIES,
|
|
1148
|
+
},
|
|
1149
|
+
},
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
name: "apoptosis",
|
|
1153
|
+
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.",
|
|
1154
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
1155
|
+
inputSchema: {
|
|
1156
|
+
type: "object",
|
|
1157
|
+
additionalProperties: false,
|
|
1158
|
+
properties: {
|
|
1159
|
+
action: { type: "string", enum: ["scan", "apply"], description: "scan (default) or apply" },
|
|
1160
|
+
command: { type: "string", description: "Test command for apply; auto-detected when omitted" },
|
|
1161
|
+
timeout_ms: { type: "integer", minimum: 100, maximum: 1800000, description: "Test timeout for apply (default 120000)" },
|
|
1162
|
+
confirm: { type: "boolean", description: "Required for apply: confirm deletion of senescent functions" },
|
|
1163
|
+
fail_on_senescent: { type: "boolean", description: "Return exit code 1 when scan finds senescent functions" },
|
|
1164
|
+
...RESULT_PROPERTIES,
|
|
1165
|
+
},
|
|
1166
|
+
},
|
|
1167
|
+
},
|
|
1130
1168
|
{
|
|
1131
1169
|
name: "ready",
|
|
1132
1170
|
description: "Agent readiness score 0-100 for the repository: tests, lockfile, git hooks, Slop Index, a fresh receipt, agent instructions, CI, config and security. Uses git and local files only and never calls a model, so it is free and safe in read-only mode. A score below fail_under returns exit code 1 with the full report, not a tool error.",
|
|
@@ -1257,6 +1295,22 @@ const PROMPTS = [
|
|
|
1257
1295
|
{ name: "context", description: "What the change is supposed to do", required: false },
|
|
1258
1296
|
],
|
|
1259
1297
|
},
|
|
1298
|
+
{
|
|
1299
|
+
name: "interrogate-the-blindfold",
|
|
1300
|
+
title: "Interrogate obfuscated code",
|
|
1301
|
+
description: "Strip identifiers from the change, make the model explain the logic without names and reject the code if it cannot prove understanding or finds a vulnerability.",
|
|
1302
|
+
arguments: [
|
|
1303
|
+
{ name: "context", description: "What the change is supposed to do", required: false },
|
|
1304
|
+
],
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
name: "prune-senescent-code",
|
|
1308
|
+
title: "Prune senescent AI code",
|
|
1309
|
+
description: "Find functions whose @lifespan marker expired and that no longer have references, then remove them in a shadow worktree only if the test suite stays green.",
|
|
1310
|
+
arguments: [
|
|
1311
|
+
{ name: "context", description: "Why the code is being pruned", required: false },
|
|
1312
|
+
],
|
|
1313
|
+
},
|
|
1260
1314
|
{
|
|
1261
1315
|
name: "compile-hologram",
|
|
1262
1316
|
title: "Compile a context hologram",
|
|
@@ -3023,6 +3077,56 @@ async function callHyperChamber(input, cwd) {
|
|
|
3023
3077
|
args.push("--memory-limit", `${String(memory)}MB`);
|
|
3024
3078
|
return toToolResult(await runCli(args, cwd));
|
|
3025
3079
|
}
|
|
3080
|
+
async function callBlindfold(input, cwd) {
|
|
3081
|
+
const args = ["blindfold", "--json"];
|
|
3082
|
+
const file = stringArg(input, "file");
|
|
3083
|
+
if (file)
|
|
3084
|
+
args.push("--file", file);
|
|
3085
|
+
const diff = stringArg(input, "diff");
|
|
3086
|
+
if (diff) {
|
|
3087
|
+
const temp = new TempFiles();
|
|
3088
|
+
try {
|
|
3089
|
+
args.push("--diff", temp.write("blindfold.diff", diff));
|
|
3090
|
+
return toToolResult(await runCli(args, cwd));
|
|
3091
|
+
}
|
|
3092
|
+
finally {
|
|
3093
|
+
temp.cleanup();
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3096
|
+
const base = baseArg(input);
|
|
3097
|
+
if (base)
|
|
3098
|
+
args.push("--base", base);
|
|
3099
|
+
if (booleanArg(input, "staged"))
|
|
3100
|
+
args.push("--staged");
|
|
3101
|
+
if (booleanArg(input, "unstaged"))
|
|
3102
|
+
args.push("--unstaged");
|
|
3103
|
+
if (booleanArg(input, "include_untracked"))
|
|
3104
|
+
args.push("--include-untracked");
|
|
3105
|
+
const context = stringArg(input, "context");
|
|
3106
|
+
if (context)
|
|
3107
|
+
args.push("--context", context);
|
|
3108
|
+
const minConfidence = numberArg(input, "min_confidence");
|
|
3109
|
+
if (minConfidence !== undefined)
|
|
3110
|
+
args.push("--min-confidence", String(minConfidence));
|
|
3111
|
+
if (booleanArg(input, "dry_run"))
|
|
3112
|
+
args.push("--dry-run");
|
|
3113
|
+
return toToolResult(await runCli(args, cwd));
|
|
3114
|
+
}
|
|
3115
|
+
async function callApoptosis(input, cwd) {
|
|
3116
|
+
const action = stringArg(input, "action") ?? "scan";
|
|
3117
|
+
const args = ["apoptosis", action, "--json"];
|
|
3118
|
+
if (action === "apply" && booleanArg(input, "confirm"))
|
|
3119
|
+
args.push("--confirm");
|
|
3120
|
+
const command = stringArg(input, "command");
|
|
3121
|
+
if (command)
|
|
3122
|
+
args.push("--command", command);
|
|
3123
|
+
const timeout = integerArg(input, "timeout_ms");
|
|
3124
|
+
if (timeout !== undefined)
|
|
3125
|
+
args.push("--timeout", `${String(timeout)}ms`);
|
|
3126
|
+
if (booleanArg(input, "fail_on_senescent"))
|
|
3127
|
+
args.push("--fail-on-senescent");
|
|
3128
|
+
return toToolResult(await runCli(args, cwd));
|
|
3129
|
+
}
|
|
3026
3130
|
async function callButterfly(input, cwd) {
|
|
3027
3131
|
const command = stringArg(input, "command", true);
|
|
3028
3132
|
const args = ["butterfly", "--command", command, "--json"];
|
|
@@ -3205,6 +3309,9 @@ async function dispatchTool(name, input, cwd, readOnly) {
|
|
|
3205
3309
|
if (name === "honeypot" && (stringArg(input, "action") === "deploy" || stringArg(input, "action") === "remove")) {
|
|
3206
3310
|
throw new ToolInputError("honeypot deploy/remove writes files and is disabled in read-only mode; start the MCP server with --allow-write");
|
|
3207
3311
|
}
|
|
3312
|
+
if (name === "apoptosis" && stringArg(input, "action") === "apply") {
|
|
3313
|
+
throw new ToolInputError("apoptosis apply rewrites source files and is disabled in read-only mode; start the MCP server with --allow-write");
|
|
3314
|
+
}
|
|
3208
3315
|
}
|
|
3209
3316
|
switch (name) {
|
|
3210
3317
|
case "review":
|
|
@@ -3303,6 +3410,10 @@ async function dispatchTool(name, input, cwd, readOnly) {
|
|
|
3303
3410
|
return callHyperChamber(input, cwd);
|
|
3304
3411
|
case "butterfly":
|
|
3305
3412
|
return callButterfly(input, cwd);
|
|
3413
|
+
case "blindfold":
|
|
3414
|
+
return callBlindfold(input, cwd);
|
|
3415
|
+
case "apoptosis":
|
|
3416
|
+
return callApoptosis(input, cwd);
|
|
3306
3417
|
case "sast":
|
|
3307
3418
|
return callSast(input, cwd);
|
|
3308
3419
|
case "authz":
|
|
@@ -3368,6 +3479,15 @@ function summarizeResult(value) {
|
|
|
3368
3479
|
const fingerprint = identity && typeof identity.fingerprint === "string" ? identity.fingerprint : "no identity";
|
|
3369
3480
|
return `oc-pilot: hivemind ${fingerprint}, ${String(value.peers.length)} peer(s)`;
|
|
3370
3481
|
}
|
|
3482
|
+
if (Array.isArray(value.entries) && typeof value.senescent === "number" && typeof value.summary === "string") {
|
|
3483
|
+
return `oc-pilot: apoptosis ${String(value.senescent)} senescent of ${String(value.entries.length)} marker(s)`;
|
|
3484
|
+
}
|
|
3485
|
+
if (typeof value.status === "string" && Array.isArray(value.removed) && typeof value.summary === "string") {
|
|
3486
|
+
return `oc-pilot: apoptosis ${value.status}, ${String(value.removed.length)} removed`;
|
|
3487
|
+
}
|
|
3488
|
+
if (typeof value.status === "string" && Array.isArray(value.mapping) && typeof value.summary === "string") {
|
|
3489
|
+
return `oc-pilot: blindfold ${value.status}, ${String(value.mapping.length)} hidden identifier(s)`;
|
|
3490
|
+
}
|
|
3371
3491
|
if (typeof value.status === "string" && typeof value.totalFaults === "number" && typeof value.exitCode === "number") {
|
|
3372
3492
|
return `oc-pilot: butterfly ${value.status}, ${String(value.totalFaults)} fault(s), exit ${String(value.exitCode)}`;
|
|
3373
3493
|
}
|
|
@@ -3622,6 +3742,10 @@ function promptBody(name, args) {
|
|
|
3622
3742
|
return `Call the oc-pilot "hyper_chamber" tool with file set to the generated JS/ESM file, days=365, budget_ms=2000 and memory_mb=128. Report the exact status (ok, leak, timeout or error), the simulated days, the iteration count and the heap first-to-last. If it reports [MEMORY LEAK DETECTED], stop, quote the crash day and explain which retained allocation grows; do not commit, do not raise the heap limit and do not hide the leak by clearing a cache just to pass. If it is ok, say that this is a heuristic, not a proof of bounded memory. Never run native code through this tool.${suffix}`;
|
|
3623
3743
|
case "release-the-butterfly":
|
|
3624
3744
|
return `Call the oc-pilot "butterfly" tool with the project test command, seed=42, fail_rate=0.1, latency_rate=0.05, latency_ms=3000, broken_json_rate=0.02 and fs_fail_rate=0.05. Read the injected fault counts and the exit code. If the tests fail, find the code path that did not handle the injected 500, timeout, broken JSON or EIO and add the missing try/catch, timeout or fallback; do not lower the rates, widen the scope to hide the fault or delete the test. If the tests pass, say that this is one deterministic chaos run, not proof that every path is safe. Never claim the tool patches native or arbitrary database drivers reliably.${suffix}`;
|
|
3745
|
+
case "interrogate-the-blindfold":
|
|
3746
|
+
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}`;
|
|
3747
|
+
case "prune-senescent-code":
|
|
3748
|
+
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}`;
|
|
3625
3749
|
case "compile-hologram":
|
|
3626
3750
|
return `Call the oc-pilot "pack_hologram" tool with max_tokens=30000 and the current diff. The result is layered: LOD 0 files are complete, LOD 1 bodies are hidden behind markers, LOD 2 lists export names. Never invent a hidden body: if the implementation matters, call "zoom_symbol" with the file and symbol from the Zoom section and read the returned body before reasoning about it. Treat [Hologram: parse bailout] as a warning that the file is complete. Do not dump the whole repository or raise max_tokens just to avoid zooming; the hologram exists to save context. Report which files were LOD 0/1/2, any redacted secrets and every symbol you zoomed.${suffix}`;
|
|
3627
3751
|
case "check-invariants":
|