oc-pilot 0.107.0 → 0.109.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 +9 -5
- package/README.ru.md +8 -4
- package/dist/cli.js +9 -1
- package/dist/cli.js.map +1 -1
- package/dist/cli.test.js +24 -0
- package/dist/cli.test.js.map +1 -1
- package/dist/commands/chronos.js +81 -0
- package/dist/commands/chronos.js.map +1 -0
- package/dist/commands/cuckoo.js +96 -0
- package/dist/commands/cuckoo.js.map +1 -0
- package/dist/core/chronos.js +126 -0
- package/dist/core/chronos.js.map +1 -0
- package/dist/core/chronos.test.js +116 -0
- package/dist/core/chronos.test.js.map +1 -0
- package/dist/core/cuckoo.js +251 -0
- package/dist/core/cuckoo.js.map +1 -0
- package/dist/core/cuckoo.test.js +98 -0
- package/dist/core/cuckoo.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 +89 -0
- package/dist/mcp.js.map +1 -1
- package/dist/mcp.test.js +10 -0
- package/dist/mcp.test.js.map +1 -1
- package/dist/skills.test.js +5 -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
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import test from "node:test";
|
|
6
|
+
import { renderCuckoo, runCuckoo } from "./cuckoo.js";
|
|
7
|
+
function makeDir(files) {
|
|
8
|
+
const dir = mkdtempSync(join(tmpdir(), "oc-pilot-cuckoo-"));
|
|
9
|
+
for (const [path, content] of Object.entries(files)) {
|
|
10
|
+
writeFileSync(join(dir, path), content, "utf8");
|
|
11
|
+
}
|
|
12
|
+
return dir;
|
|
13
|
+
}
|
|
14
|
+
test("runCuckoo reports a clean file with no capabilities", () => {
|
|
15
|
+
const dir = makeDir({ "safe.mjs": 'console.log("hello");\n' });
|
|
16
|
+
try {
|
|
17
|
+
const report = runCuckoo(dir, "safe.mjs");
|
|
18
|
+
assert.equal(report.status, "clean", report.summary);
|
|
19
|
+
assert.deepEqual(report.capabilities, []);
|
|
20
|
+
assert.deepEqual(report.output, ["hello"]);
|
|
21
|
+
assert.match(report.summary, /\[CAPABILITY CLEAN\]/);
|
|
22
|
+
}
|
|
23
|
+
finally {
|
|
24
|
+
rmSync(dir, { recursive: true, force: true });
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
test("runCuckoo records fs, net and env capabilities", () => {
|
|
28
|
+
const dir = makeDir({
|
|
29
|
+
"fs.mjs": 'const fs = require("fs"); fs.readFileSync("/etc/passwd");\n',
|
|
30
|
+
"net.mjs": 'fetch("https://example.com/data");\n',
|
|
31
|
+
"env.mjs": "process.env.SECRET;\n",
|
|
32
|
+
});
|
|
33
|
+
try {
|
|
34
|
+
const fsReport = runCuckoo(dir, "fs.mjs");
|
|
35
|
+
assert.equal(fsReport.status, "capabilities");
|
|
36
|
+
assert.ok(fsReport.capabilities.some((item) => item.kind === "fs"));
|
|
37
|
+
assert.match(fsReport.summary, /\[CAPABILITY DENIED\]/);
|
|
38
|
+
const netReport = runCuckoo(dir, "net.mjs");
|
|
39
|
+
assert.ok(netReport.capabilities.some((item) => item.kind === "net"));
|
|
40
|
+
const envReport = runCuckoo(dir, "env.mjs");
|
|
41
|
+
assert.ok(envReport.capabilities.some((item) => item.kind === "env"));
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
rmSync(dir, { recursive: true, force: true });
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
test("runCuckoo blocks process.exit and static imports", () => {
|
|
48
|
+
const dir = makeDir({
|
|
49
|
+
"exit.mjs": "process.exit(1);\n",
|
|
50
|
+
"import.mjs": 'import fs from "fs";\nconsole.log(fs);\n',
|
|
51
|
+
});
|
|
52
|
+
try {
|
|
53
|
+
const exitReport = runCuckoo(dir, "exit.mjs");
|
|
54
|
+
assert.equal(exitReport.status, "blocked");
|
|
55
|
+
assert.ok(exitReport.capabilities.some((item) => item.kind === "exit"));
|
|
56
|
+
const importReport = runCuckoo(dir, "import.mjs");
|
|
57
|
+
assert.equal(importReport.status, "blocked");
|
|
58
|
+
assert.ok(importReport.capabilities.some((item) => item.kind === "import"));
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
rmSync(dir, { recursive: true, force: true });
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
test("runCuckoo reports timeouts and ordinary errors", () => {
|
|
65
|
+
const dir = makeDir({
|
|
66
|
+
"loop.mjs": "while (true) {}\n",
|
|
67
|
+
"throw.mjs": 'throw new Error("boom");\n',
|
|
68
|
+
});
|
|
69
|
+
try {
|
|
70
|
+
const timeout = runCuckoo(dir, "loop.mjs", { timeoutMs: 200 });
|
|
71
|
+
assert.equal(timeout.status, "timeout", timeout.summary);
|
|
72
|
+
assert.match(timeout.summary, /\[CUCKOO TIMEOUT\]/);
|
|
73
|
+
const error = runCuckoo(dir, "throw.mjs");
|
|
74
|
+
assert.equal(error.status, "error");
|
|
75
|
+
assert.match(error.summary, /\[CUCKOO ERROR\]/);
|
|
76
|
+
assert.match(error.error ?? "", /boom/);
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
rmSync(dir, { recursive: true, force: true });
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
test("runCuckoo rejects a missing file and renderCuckoo shows capabilities", () => {
|
|
83
|
+
const dir = makeDir({
|
|
84
|
+
"fs.mjs": 'const fs = require("fs"); fs.writeFileSync("/tmp/x", "y");\n',
|
|
85
|
+
});
|
|
86
|
+
try {
|
|
87
|
+
assert.throws(() => runCuckoo(dir, "missing.mjs"), /Файл не найден/);
|
|
88
|
+
const report = runCuckoo(dir, "fs.mjs");
|
|
89
|
+
const text = renderCuckoo(report);
|
|
90
|
+
assert.match(text, /Cuckoo: capabilities/);
|
|
91
|
+
assert.match(text, /fs: write:/);
|
|
92
|
+
assert.match(text, /CAPABILITY DENIED/);
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
rmSync(dir, { recursive: true, force: true });
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=cuckoo.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cuckoo.test.js","sourceRoot":"","sources":["../../src/core/cuckoo.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtD,SAAS,OAAO,CAAC,KAA6B;IAC5C,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAC5D,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACpD,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAA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AG,OAAO,CAAC;QAClB,QAAQ,EAAE,8DAA8D;KACzE,CAAC,CAAC;IACH,IAAI,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,aAAa,CAAC,EAAE,gBAAgB,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;QAC3C,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACjC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAC1C,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/dist/mcp-prompts.test.js
CHANGED
|
@@ -63,6 +63,8 @@ test("MCP advertises prompts and renders them with arguments", () => {
|
|
|
63
63
|
"declare-mayday",
|
|
64
64
|
"predict-the-ci-scope",
|
|
65
65
|
"stop-the-bleeding",
|
|
66
|
+
"audit-the-cuckoo",
|
|
67
|
+
"read-the-chronicle",
|
|
66
68
|
"prune-senescent-code",
|
|
67
69
|
"scan-for-injection",
|
|
68
70
|
"compile-hologram",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-prompts.test.js","sourceRoot":"","sources":["../src/mcp-prompts.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,OAAO,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O,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,EAAE,EAAE,WAAW,CAAC,CAAC;IAC3D,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/dist/mcp.js
CHANGED
|
@@ -1442,6 +1442,39 @@ const TOOLS = [
|
|
|
1442
1442
|
},
|
|
1443
1443
|
},
|
|
1444
1444
|
},
|
|
1445
|
+
{
|
|
1446
|
+
name: "cuckoo",
|
|
1447
|
+
description: "Run a JS/ESM file in an instrumented vm sandbox and report every fs, net, child_process, env, exit, require and import attempt without granting real access. Offline and read-only.",
|
|
1448
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
1449
|
+
inputSchema: {
|
|
1450
|
+
type: "object",
|
|
1451
|
+
additionalProperties: false,
|
|
1452
|
+
required: ["file"],
|
|
1453
|
+
properties: {
|
|
1454
|
+
file: { type: "string", description: "Repository-relative JS/ESM file to audit" },
|
|
1455
|
+
script_timeout_ms: { type: "integer", minimum: 100, maximum: 60000 },
|
|
1456
|
+
allow: { type: "array", description: "Allowed capability kinds", items: { type: "string" } },
|
|
1457
|
+
...RESULT_PROPERTIES,
|
|
1458
|
+
},
|
|
1459
|
+
},
|
|
1460
|
+
},
|
|
1461
|
+
{
|
|
1462
|
+
name: "chronos",
|
|
1463
|
+
description: "Read a file's commit chronicle: fixes, reverts, incidents, security markers, churn, antibodies and vaccines, then score it as [HOTSPOT]. Offline and read-only.",
|
|
1464
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
1465
|
+
inputSchema: {
|
|
1466
|
+
type: "object",
|
|
1467
|
+
additionalProperties: false,
|
|
1468
|
+
required: ["file"],
|
|
1469
|
+
properties: {
|
|
1470
|
+
file: { type: "string", description: "Repository-relative file to inspect" },
|
|
1471
|
+
limit: { type: "integer", minimum: 1, maximum: 200 },
|
|
1472
|
+
since: { type: "string", description: "Git date limit, e.g. 2025-01-01" },
|
|
1473
|
+
fail_on_hotspot: { type: "boolean" },
|
|
1474
|
+
...RESULT_PROPERTIES,
|
|
1475
|
+
},
|
|
1476
|
+
},
|
|
1477
|
+
},
|
|
1445
1478
|
{
|
|
1446
1479
|
name: "apoptosis",
|
|
1447
1480
|
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.",
|
|
@@ -1718,6 +1751,22 @@ const PROMPTS = [
|
|
|
1718
1751
|
{ name: "context", description: "What the change is supposed to do", required: false },
|
|
1719
1752
|
],
|
|
1720
1753
|
},
|
|
1754
|
+
{
|
|
1755
|
+
name: "audit-the-cuckoo",
|
|
1756
|
+
title: "Audit capabilities of untrusted code",
|
|
1757
|
+
description: "Run generated or untrusted JS/ESM in an instrumented sandbox and list every fs, net, child_process, env and exit attempt before trusting it.",
|
|
1758
|
+
arguments: [
|
|
1759
|
+
{ name: "context", description: "Where the code came from", required: false },
|
|
1760
|
+
],
|
|
1761
|
+
},
|
|
1762
|
+
{
|
|
1763
|
+
name: "read-the-chronicle",
|
|
1764
|
+
title: "Read the file chronicle",
|
|
1765
|
+
description: "Inspect the fix, revert and incident history of a file, count its antibodies and vaccines and decide whether it is a hotspot.",
|
|
1766
|
+
arguments: [
|
|
1767
|
+
{ name: "context", description: "Why the file is under review", required: false },
|
|
1768
|
+
],
|
|
1769
|
+
},
|
|
1721
1770
|
{
|
|
1722
1771
|
name: "prune-senescent-code",
|
|
1723
1772
|
title: "Prune senescent AI code",
|
|
@@ -3968,6 +4017,32 @@ async function callHemorrhage(input, cwd) {
|
|
|
3968
4017
|
temp.cleanup();
|
|
3969
4018
|
}
|
|
3970
4019
|
}
|
|
4020
|
+
async function callCuckoo(input, cwd) {
|
|
4021
|
+
const file = stringArg(input, "file", true);
|
|
4022
|
+
const args = ["cuckoo", file, "--json"];
|
|
4023
|
+
const timeout = integerArg(input, "script_timeout_ms");
|
|
4024
|
+
if (timeout !== undefined)
|
|
4025
|
+
args.push("--script-timeout", String(Math.max(1, Math.round(timeout / 1000))) + "s");
|
|
4026
|
+
if (Array.isArray(input.allow)) {
|
|
4027
|
+
const allow = input.allow.filter((item) => typeof item === "string");
|
|
4028
|
+
if (allow.length > 0)
|
|
4029
|
+
args.push("--allow", allow.join(","));
|
|
4030
|
+
}
|
|
4031
|
+
return toToolResult(await runCli(args, cwd));
|
|
4032
|
+
}
|
|
4033
|
+
async function callChronos(input, cwd) {
|
|
4034
|
+
const file = stringArg(input, "file", true);
|
|
4035
|
+
const args = ["chronos", file, "--json"];
|
|
4036
|
+
const limit = integerArg(input, "limit");
|
|
4037
|
+
if (limit !== undefined)
|
|
4038
|
+
args.push("--limit", String(limit));
|
|
4039
|
+
const since = stringArg(input, "since");
|
|
4040
|
+
if (since)
|
|
4041
|
+
args.push("--since", since);
|
|
4042
|
+
if (booleanArg(input, "fail_on_hotspot"))
|
|
4043
|
+
args.push("--fail-on-hotspot");
|
|
4044
|
+
return toToolResult(await runCli(args, cwd));
|
|
4045
|
+
}
|
|
3971
4046
|
async function callApoptosis(input, cwd) {
|
|
3972
4047
|
const action = stringArg(input, "action") ?? "scan";
|
|
3973
4048
|
const args = ["apoptosis", action, "--json"];
|
|
@@ -4331,6 +4406,10 @@ async function dispatchTool(name, input, cwd, readOnly) {
|
|
|
4331
4406
|
return callClairvoyant(input, cwd);
|
|
4332
4407
|
case "hemorrhage":
|
|
4333
4408
|
return callHemorrhage(input, cwd);
|
|
4409
|
+
case "cuckoo":
|
|
4410
|
+
return callCuckoo(input, cwd);
|
|
4411
|
+
case "chronos":
|
|
4412
|
+
return callChronos(input, cwd);
|
|
4334
4413
|
case "apoptosis":
|
|
4335
4414
|
return callApoptosis(input, cwd);
|
|
4336
4415
|
case "scan_injection":
|
|
@@ -4410,6 +4489,12 @@ function summarizeResult(value) {
|
|
|
4410
4489
|
if (typeof value.status === "string" && Array.isArray(value.removed) && typeof value.summary === "string") {
|
|
4411
4490
|
return `oc-pilot: apoptosis ${value.status}, ${String(value.removed.length)} removed`;
|
|
4412
4491
|
}
|
|
4492
|
+
if (typeof value.score === "number" && typeof value.hotspot === "boolean" && value.totals && typeof value.totals === "object") {
|
|
4493
|
+
return `oc-pilot: chronos ${String(value.score)}, ${value.hotspot ? "hotspot" : "stable"}`;
|
|
4494
|
+
}
|
|
4495
|
+
if (typeof value.status === "string" && Array.isArray(value.capabilities) && typeof value.file === "string") {
|
|
4496
|
+
return `oc-pilot: cuckoo ${value.status}, ${String(value.capabilities.length)} capability(ies)`;
|
|
4497
|
+
}
|
|
4413
4498
|
if (typeof value.status === "string" &&
|
|
4414
4499
|
["regression", "improvement", "same", "error"].includes(value.status) &&
|
|
4415
4500
|
typeof value.changePct === "number" &&
|
|
@@ -4746,6 +4831,10 @@ function promptBody(name, args) {
|
|
|
4746
4831
|
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}`;
|
|
4747
4832
|
case "stamp-the-passport":
|
|
4748
4833
|
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}`;
|
|
4834
|
+
case "read-the-chronicle":
|
|
4835
|
+
return `Call the oc-pilot "chronos" tool on the file. Read the fix, revert, incident and security counts, the antibodies and vaccines, and the hotspot score. If it returns [HOTSPOT], treat the file as high-risk: inspect the recent fixes and reverts before changing it, add or run a vaccine, and do not refactor it without tests. A low score is not proof that the file is safe. Offline and read-only.${suffix}`;
|
|
4836
|
+
case "audit-the-cuckoo":
|
|
4837
|
+
return `Call the oc-pilot "cuckoo" tool on the generated or untrusted JS/ESM file. Read every capability: fs, net, child_process, env, exit, require, import. If it returns [CAPABILITY DENIED], do not trust or run the file with real privileges; remove the capability or isolate it behind an explicit allowlist. A clean result covers only this file and this sandbox, not transitive native code or dynamic imports. Offline and read-only.${suffix}`;
|
|
4749
4838
|
case "stop-the-bleeding":
|
|
4750
4839
|
return `Call the oc-pilot "hemorrhage" tool with the benchmark command, 10 runs and a 5% threshold. Read medians, p95, MAD, noise and the p-value. If it returns [PERFORMANCE REGRESSION], stop: the diff is slower beyond noise; find the hot path and fix it or justify the tradeoff. Do not lower the number of runs, raise the threshold, delete the benchmark or cherry-pick faster samples to force a pass. If it returns [PERFORMANCE SAME], say the benchmark did not prove a regression, not that performance is fine everywhere. Offline and read-only.${suffix}`;
|
|
4751
4840
|
case "predict-the-ci-scope":
|