oc-pilot 0.92.0 → 0.93.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/mcp.js CHANGED
@@ -1127,6 +1127,27 @@ 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
+ },
1130
1151
  {
1131
1152
  name: "ready",
1132
1153
  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 +1278,14 @@ const PROMPTS = [
1257
1278
  { name: "context", description: "What the change is supposed to do", required: false },
1258
1279
  ],
1259
1280
  },
1281
+ {
1282
+ name: "interrogate-the-blindfold",
1283
+ title: "Interrogate obfuscated code",
1284
+ 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.",
1285
+ arguments: [
1286
+ { name: "context", description: "What the change is supposed to do", required: false },
1287
+ ],
1288
+ },
1260
1289
  {
1261
1290
  name: "compile-hologram",
1262
1291
  title: "Compile a context hologram",
@@ -3023,6 +3052,41 @@ async function callHyperChamber(input, cwd) {
3023
3052
  args.push("--memory-limit", `${String(memory)}MB`);
3024
3053
  return toToolResult(await runCli(args, cwd));
3025
3054
  }
3055
+ async function callBlindfold(input, cwd) {
3056
+ const args = ["blindfold", "--json"];
3057
+ const file = stringArg(input, "file");
3058
+ if (file)
3059
+ args.push("--file", file);
3060
+ const diff = stringArg(input, "diff");
3061
+ if (diff) {
3062
+ const temp = new TempFiles();
3063
+ try {
3064
+ args.push("--diff", temp.write("blindfold.diff", diff));
3065
+ return toToolResult(await runCli(args, cwd));
3066
+ }
3067
+ finally {
3068
+ temp.cleanup();
3069
+ }
3070
+ }
3071
+ const base = baseArg(input);
3072
+ if (base)
3073
+ args.push("--base", base);
3074
+ if (booleanArg(input, "staged"))
3075
+ args.push("--staged");
3076
+ if (booleanArg(input, "unstaged"))
3077
+ args.push("--unstaged");
3078
+ if (booleanArg(input, "include_untracked"))
3079
+ args.push("--include-untracked");
3080
+ const context = stringArg(input, "context");
3081
+ if (context)
3082
+ args.push("--context", context);
3083
+ const minConfidence = numberArg(input, "min_confidence");
3084
+ if (minConfidence !== undefined)
3085
+ args.push("--min-confidence", String(minConfidence));
3086
+ if (booleanArg(input, "dry_run"))
3087
+ args.push("--dry-run");
3088
+ return toToolResult(await runCli(args, cwd));
3089
+ }
3026
3090
  async function callButterfly(input, cwd) {
3027
3091
  const command = stringArg(input, "command", true);
3028
3092
  const args = ["butterfly", "--command", command, "--json"];
@@ -3303,6 +3367,8 @@ async function dispatchTool(name, input, cwd, readOnly) {
3303
3367
  return callHyperChamber(input, cwd);
3304
3368
  case "butterfly":
3305
3369
  return callButterfly(input, cwd);
3370
+ case "blindfold":
3371
+ return callBlindfold(input, cwd);
3306
3372
  case "sast":
3307
3373
  return callSast(input, cwd);
3308
3374
  case "authz":
@@ -3368,6 +3434,9 @@ function summarizeResult(value) {
3368
3434
  const fingerprint = identity && typeof identity.fingerprint === "string" ? identity.fingerprint : "no identity";
3369
3435
  return `oc-pilot: hivemind ${fingerprint}, ${String(value.peers.length)} peer(s)`;
3370
3436
  }
3437
+ if (typeof value.status === "string" && Array.isArray(value.mapping) && typeof value.summary === "string") {
3438
+ return `oc-pilot: blindfold ${value.status}, ${String(value.mapping.length)} hidden identifier(s)`;
3439
+ }
3371
3440
  if (typeof value.status === "string" && typeof value.totalFaults === "number" && typeof value.exitCode === "number") {
3372
3441
  return `oc-pilot: butterfly ${value.status}, ${String(value.totalFaults)} fault(s), exit ${String(value.exitCode)}`;
3373
3442
  }
@@ -3622,6 +3691,8 @@ function promptBody(name, args) {
3622
3691
  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
3692
  case "release-the-butterfly":
3624
3693
  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}`;
3694
+ case "interrogate-the-blindfold":
3695
+ 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}`;
3625
3696
  case "compile-hologram":
3626
3697
  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
3698
  case "check-invariants":