oc-pilot 0.100.0 → 0.101.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.
@@ -0,0 +1,139 @@
1
+ import assert from "node:assert/strict";
2
+ import { spawnSync } from "node:child_process";
3
+ import { existsSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
4
+ import { tmpdir } from "node:os";
5
+ import { join } from "node:path";
6
+ import test from "node:test";
7
+ import { buildVaccinePrompt, clearVaccines, forgetVaccine, listVaccines, runVaccines, storeVaccine, verifyVaccine, } from "./vaccine.js";
8
+ function git(args, cwd) {
9
+ const result = spawnSync("git", args, { cwd, encoding: "utf8" });
10
+ if (result.status !== 0)
11
+ throw new Error(`git ${args.join(" ")} failed: ${result.stderr}`);
12
+ return result.stdout;
13
+ }
14
+ function makeRepo() {
15
+ const dir = mkdtempSync(join(tmpdir(), "oc-pilot-vaccine-"));
16
+ git(["init", "-q"], dir);
17
+ git(["config", "user.email", "test@example.com"], dir);
18
+ git(["config", "user.name", "Test"], dir);
19
+ git(["config", "core.autocrlf", "false"], dir);
20
+ writeFileSync(join(dir, "app.mjs"), "export const value = 1;\n", "utf8");
21
+ git(["add", "."], dir);
22
+ git(["commit", "-m", "bug"], dir);
23
+ const bug = git(["rev-parse", "HEAD"], dir).trim();
24
+ writeFileSync(join(dir, "app.mjs"), "export const value = 2;\n", "utf8");
25
+ git(["add", "."], dir);
26
+ git(["commit", "-m", "fix"], dir);
27
+ const fix = git(["rev-parse", "HEAD"], dir).trim();
28
+ return { dir, bug, fix };
29
+ }
30
+ function hypothesis(assertion) {
31
+ return {
32
+ test: [
33
+ 'import test from "node:test";',
34
+ 'import assert from "node:assert/strict";',
35
+ 'import { value } from "../app.mjs";',
36
+ `test("value", () => { assert.equal(value, ${assertion}); });`,
37
+ "",
38
+ ].join("\n"),
39
+ reason: `value should be ${assertion}`,
40
+ };
41
+ }
42
+ test("buildVaccinePrompt asks for a test that separates bug and fix", () => {
43
+ const prompt = buildVaccinePrompt("diff --git a/app.mjs b/app.mjs", "bug1234", "fix5678", "negative discount");
44
+ assert.match(prompt, /FAIL on the buggy parent/);
45
+ assert.match(prompt, /bug1234/);
46
+ assert.match(prompt, /fix5678/);
47
+ assert.match(prompt, /strict JSON/);
48
+ assert.match(prompt, /negative discount/);
49
+ assert.match(prompt, /diff --git a\/app\.mjs/);
50
+ });
51
+ test("verifyVaccine accepts a test that fails on the bug and passes on the fix", async () => {
52
+ const repo = makeRepo();
53
+ try {
54
+ const result = await verifyVaccine(repo.dir, repo.bug, repo.fix, hypothesis("2"), { timeoutMs: 20_000 });
55
+ assert.equal(result.status, "verified", result.summary);
56
+ assert.match(result.summary, /\[VACCINE VERIFIED\]/);
57
+ assert.ok(result.bugOutput && result.fixOutput);
58
+ }
59
+ finally {
60
+ rmSync(repo.dir, { recursive: true, force: true });
61
+ }
62
+ });
63
+ test("verifyVaccine rejects a test that passes on the bug or fails on the fix", async () => {
64
+ const repo = makeRepo();
65
+ try {
66
+ const passesOnBug = await verifyVaccine(repo.dir, repo.bug, repo.fix, hypothesis("1"), { timeoutMs: 20_000 });
67
+ assert.equal(passesOnBug.status, "rejected");
68
+ assert.match(passesOnBug.summary, /проходит на баге/);
69
+ const failsBoth = await verifyVaccine(repo.dir, repo.bug, repo.fix, hypothesis("999"), { timeoutMs: 20_000 });
70
+ assert.equal(failsBoth.status, "rejected");
71
+ assert.match(failsBoth.summary, /падает и на исправленном/);
72
+ }
73
+ finally {
74
+ rmSync(repo.dir, { recursive: true, force: true });
75
+ }
76
+ });
77
+ test("verifyVaccine refuses identical bug and fix refs", async () => {
78
+ const repo = makeRepo();
79
+ try {
80
+ await assert.rejects(() => verifyVaccine(repo.dir, repo.fix, repo.fix, hypothesis("2")), /один коммит/);
81
+ }
82
+ finally {
83
+ rmSync(repo.dir, { recursive: true, force: true });
84
+ }
85
+ });
86
+ test("storeVaccine, listVaccines and runVaccines keep a working vaccine", async () => {
87
+ const repo = makeRepo();
88
+ try {
89
+ const record = storeVaccine(repo.dir, {
90
+ bug: repo.bug,
91
+ fix: repo.fix,
92
+ command: "node --test {file}",
93
+ reason: "value should be 2",
94
+ test: hypothesis("2").test,
95
+ });
96
+ assert.match(record.id, /^vac_/);
97
+ assert.ok(existsSync(join(repo.dir, record.testFile)));
98
+ const listed = listVaccines(repo.dir);
99
+ assert.equal(listed.vaccines.length, 1);
100
+ assert.match(listed.content, /value should be 2/);
101
+ const run = await runVaccines(repo.dir, { timeoutMs: 20_000 });
102
+ assert.equal(run.total, 1);
103
+ assert.equal(run.passed, 1);
104
+ assert.equal(run.failed, 0);
105
+ assert.match(run.summary, /\[VACCINES PASSED\]/);
106
+ }
107
+ finally {
108
+ rmSync(repo.dir, { recursive: true, force: true });
109
+ }
110
+ });
111
+ test("forgetVaccine and clearVaccines remove stored vaccines", () => {
112
+ const repo = makeRepo();
113
+ try {
114
+ const first = storeVaccine(repo.dir, {
115
+ bug: repo.bug,
116
+ fix: repo.fix,
117
+ command: "node --test {file}",
118
+ reason: "first",
119
+ test: hypothesis("2").test,
120
+ });
121
+ const forgotten = forgetVaccine(repo.dir, first.id);
122
+ assert.equal(forgotten.removed, true);
123
+ assert.equal(forgotten.remaining, 0);
124
+ assert.equal(existsSync(join(repo.dir, first.testFile)), false);
125
+ storeVaccine(repo.dir, {
126
+ bug: repo.bug,
127
+ fix: repo.fix,
128
+ command: "node --test {file}",
129
+ reason: "second",
130
+ test: hypothesis("3").test,
131
+ });
132
+ assert.equal(clearVaccines(repo.dir).removed, 1);
133
+ assert.deepEqual(listVaccines(repo.dir).vaccines, []);
134
+ }
135
+ finally {
136
+ rmSync(repo.dir, { recursive: true, force: true });
137
+ }
138
+ });
139
+ //# sourceMappingURL=vaccine.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vaccine.test.js","sourceRoot":"","sources":["../../src/core/vaccine.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,SAA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EAAE,CAAC,CAAC;IACxD,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACrD,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -55,6 +55,7 @@ test("MCP advertises prompts and renders them with arguments", () => {
55
55
  "cross-examine-the-claim",
56
56
  "stamp-the-passport",
57
57
  "compare-the-behavior",
58
+ "inoculate-the-fix",
58
59
  "prune-senescent-code",
59
60
  "scan-for-injection",
60
61
  "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,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AASnC,SAAS,SAAS,CAChB,GAAW,EACX,QAAmB,EACnB,OAAiB,EAAE;IAEnB,MAAM,KAAK,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACnF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE;QACvE,KAAK;QACL,QAAQ,EAAE,MAAM;QAChB,OAA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,EAAE,MAA4D,CAAC;QACzF,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAClC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,EAAE,EAAE,WAAW,CAAC,CAAC;QAExD,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,MAA4D,CAAC;QAC1F,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACnC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,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
@@ -1273,6 +1273,27 @@ const TOOLS = [
1273
1273
  },
1274
1274
  },
1275
1275
  },
1276
+ {
1277
+ name: "vaccine",
1278
+ description: "Turn a fixed bug into a regression test: ask the model for one test, prove it fails on the buggy parent and passes on the fix in two shadow worktrees, store only verified vaccines in .oc-pilot/vaccines, and run them on HEAD. Actions: create, run, list, forget, clear. create/forget/clear write and need --allow-write.",
1279
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
1280
+ inputSchema: {
1281
+ type: "object",
1282
+ additionalProperties: false,
1283
+ required: ["action"],
1284
+ properties: {
1285
+ action: { type: "string", enum: ["create", "run", "list", "forget", "clear"] },
1286
+ fix: { type: "string", description: "Fixed commit ref; defaults to HEAD" },
1287
+ bug: { type: "string", description: "Buggy commit ref; defaults to the parent of fix" },
1288
+ command: { type: "string", description: "Test command with {file}; default node --test {file}" },
1289
+ context: { type: "string", description: "What broke and what the fix should preserve" },
1290
+ test_timeout_ms: { type: "integer", minimum: 1000, maximum: 600000 },
1291
+ id: { type: "string", description: "Vaccine id for forget" },
1292
+ force: { type: "boolean", description: "Confirm clear" },
1293
+ ...RESULT_PROPERTIES,
1294
+ },
1295
+ },
1296
+ },
1276
1297
  {
1277
1298
  name: "apoptosis",
1278
1299
  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.",
@@ -1485,6 +1506,14 @@ const PROMPTS = [
1485
1506
  { name: "context", description: "What the change is supposed to do", required: false },
1486
1507
  ],
1487
1508
  },
1509
+ {
1510
+ name: "inoculate-the-fix",
1511
+ title: "Inoculate the repository against a fixed bug",
1512
+ description: "Generate a regression test for a fixed bug, prove it fails on the buggy parent and passes on the fix, store it and run the vaccine suite.",
1513
+ arguments: [
1514
+ { name: "context", description: "What broke and why the fix is correct", required: false },
1515
+ ],
1516
+ },
1488
1517
  {
1489
1518
  name: "prune-senescent-code",
1490
1519
  title: "Prune senescent AI code",
@@ -3467,6 +3496,31 @@ async function callOracle(input, cwd) {
3467
3496
  temp.cleanup();
3468
3497
  }
3469
3498
  }
3499
+ async function callVaccine(input, cwd) {
3500
+ const action = stringArg(input, "action", true);
3501
+ const args = ["vaccine", action, "--json"];
3502
+ const fix = stringArg(input, "fix");
3503
+ if (fix)
3504
+ args.push("--fix", fix);
3505
+ const bug = stringArg(input, "bug");
3506
+ if (bug)
3507
+ args.push("--bug", bug);
3508
+ const command = stringArg(input, "command");
3509
+ if (command)
3510
+ args.push("--command", command);
3511
+ const context = stringArg(input, "context");
3512
+ if (context)
3513
+ args.push("--context", context);
3514
+ const timeout = integerArg(input, "test_timeout_ms");
3515
+ if (timeout !== undefined)
3516
+ args.push("--test-timeout", String(timeout) + "ms");
3517
+ const id = stringArg(input, "id");
3518
+ if (id)
3519
+ args.push("--id", id);
3520
+ if (booleanArg(input, "force"))
3521
+ args.push("--force");
3522
+ return toToolResult(await runCli(args, cwd));
3523
+ }
3470
3524
  async function callApoptosis(input, cwd) {
3471
3525
  const action = stringArg(input, "action") ?? "scan";
3472
3526
  const args = ["apoptosis", action, "--json"];
@@ -3685,6 +3739,9 @@ async function dispatchTool(name, input, cwd, readOnly) {
3685
3739
  if (name === "passport" && ["write", "clear"].includes(stringArg(input, "action") ?? "")) {
3686
3740
  throw new ToolInputError("passport write/clear write .oc-pilot/passport.json and are disabled in read-only mode; start the MCP server with --allow-write");
3687
3741
  }
3742
+ if (name === "vaccine" && ["create", "forget", "clear"].includes(stringArg(input, "action") ?? "")) {
3743
+ throw new ToolInputError("vaccine create/forget/clear write .oc-pilot/vaccines and are disabled in read-only mode; start the MCP server with --allow-write");
3744
+ }
3688
3745
  if (name === "honeypot" && (stringArg(input, "action") === "deploy" || stringArg(input, "action") === "remove")) {
3689
3746
  throw new ToolInputError("honeypot deploy/remove writes files and is disabled in read-only mode; start the MCP server with --allow-write");
3690
3747
  }
@@ -3804,6 +3861,8 @@ async function dispatchTool(name, input, cwd, readOnly) {
3804
3861
  return callPassport(input, cwd);
3805
3862
  case "oracle":
3806
3863
  return callOracle(input, cwd);
3864
+ case "vaccine":
3865
+ return callVaccine(input, cwd);
3807
3866
  case "apoptosis":
3808
3867
  return callApoptosis(input, cwd);
3809
3868
  case "scan_injection":
@@ -3883,6 +3942,17 @@ function summarizeResult(value) {
3883
3942
  if (typeof value.status === "string" && Array.isArray(value.removed) && typeof value.summary === "string") {
3884
3943
  return `oc-pilot: apoptosis ${value.status}, ${String(value.removed.length)} removed`;
3885
3944
  }
3945
+ if (typeof value.total === "number" && typeof value.passed === "number" && Array.isArray(value.results)) {
3946
+ return `oc-pilot: vaccines ${String(value.passed)}/${String(value.total)} passed`;
3947
+ }
3948
+ if (Array.isArray(value.vaccines) && typeof value.total !== "number") {
3949
+ return `oc-pilot: vaccines ${String(value.vaccines.length)}`;
3950
+ }
3951
+ if (typeof value.status === "string" &&
3952
+ typeof value.durationMs === "number" &&
3953
+ ["verified", "rejected", "error"].includes(value.status)) {
3954
+ return `oc-pilot: vaccine ${value.status}`;
3955
+ }
3886
3956
  if (typeof value.status === "string" && typeof value.changed === "number" && Array.isArray(value.results)) {
3887
3957
  return `oc-pilot: oracle ${value.status}, ${String(value.changed)} changed of ${String(value.cases)}`;
3888
3958
  }
@@ -4171,6 +4241,8 @@ function promptBody(name, args) {
4171
4241
  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}`;
4172
4242
  case "stamp-the-passport":
4173
4243
  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}`;
4244
+ case "inoculate-the-fix":
4245
+ return `Call the oc-pilot "vaccine" tool with action=create for the fix commit and its buggy parent. Read the verification: only verified means the test fails on the bug and passes on the fix. If it is rejected, do not store it: the test does not distinguish the two trees; explain why and try a sharper test. If it is error, report the infrastructure failure. Then call action=run to prove the stored vaccines still pass on HEAD. Never mark a rejected test as a vaccine, never weaken the assertion to force a pass, and never delete a failing vaccine to make the suite green. create/forget/clear need --allow-write.${suffix}`;
4174
4246
  case "compare-the-behavior":
4175
4247
  return `Call the oc-pilot "oracle" tool with a deterministic command that reads the {input} JSON file, a corpus of real cases and the proposed diff. Read every [BEHAVIOR CHANGED] case with its input and before/after output. If behavior changed, decide whether it was intended: update the corpus or expectations only for intended changes, and fix unintended ones. Do not delete failing cases, do not shrink the corpus to hide a difference, and do not claim behavioral equivalence from a corpus that does not cover the change. A same result is evidence for the supplied inputs, not a proof for all inputs. Model-free and read-only.${suffix}`;
4176
4248
  case "cross-examine-the-claim":