oc-pilot 0.110.0 → 0.112.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,98 @@
1
+ import assert from "node:assert/strict";
2
+ import { mkdtempSync, rmSync } from "node:fs";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+ import test from "node:test";
6
+ import { addQuarantine, checkQuarantine, clearQuarantine, listQuarantine, removeQuarantine, } from "./quarantine.js";
7
+ function makeDir() {
8
+ return mkdtempSync(join(tmpdir(), "oc-pilot-quarantine-"));
9
+ }
10
+ const NOW = new Date("2026-01-01T00:00:00.000Z");
11
+ const LATER = new Date("2026-01-16T00:00:00.000Z");
12
+ test("addQuarantine stores an entry and rejects duplicates and bad durations", () => {
13
+ const dir = makeDir();
14
+ try {
15
+ const entry = addQuarantine(dir, {
16
+ test: "src/flaky.test.ts",
17
+ owner: "alice",
18
+ reason: "timing race",
19
+ days: 14,
20
+ issue: "https://example.com/issues/1",
21
+ now: NOW,
22
+ });
23
+ assert.equal(entry.test, "src/flaky.test.ts");
24
+ assert.equal(entry.owner, "alice");
25
+ assert.equal(entry.expiresAt, "2026-01-15T00:00:00.000Z");
26
+ assert.throws(() => addQuarantine(dir, {
27
+ test: "src/flaky.test.ts",
28
+ owner: "bob",
29
+ reason: "again",
30
+ days: 7,
31
+ now: NOW,
32
+ }), /уже на карантине/);
33
+ assert.throws(() => addQuarantine(dir, {
34
+ test: "other.test.ts",
35
+ owner: "bob",
36
+ reason: "x",
37
+ days: 0,
38
+ now: NOW,
39
+ }), /от 1 до 365/);
40
+ }
41
+ finally {
42
+ rmSync(dir, { recursive: true, force: true });
43
+ }
44
+ });
45
+ test("listQuarantine separates active and expired entries", () => {
46
+ const dir = makeDir();
47
+ try {
48
+ addQuarantine(dir, { test: "a.test.ts", owner: "alice", reason: "race", days: 14, now: NOW });
49
+ addQuarantine(dir, { test: "b.test.ts", owner: "bob", reason: "timeout", days: 30, now: NOW });
50
+ const active = listQuarantine(dir, NOW);
51
+ assert.equal(active.active.length, 2);
52
+ assert.equal(active.expired.length, 0);
53
+ assert.match(active.content, /\[ACTIVE\] a\.test\.ts/);
54
+ const later = listQuarantine(dir, LATER);
55
+ assert.equal(later.expired.length, 1);
56
+ assert.equal(later.expired[0]?.test, "a.test.ts");
57
+ assert.match(later.content, /\[EXPIRED\] a\.test\.ts/);
58
+ }
59
+ finally {
60
+ rmSync(dir, { recursive: true, force: true });
61
+ }
62
+ });
63
+ test("checkQuarantine reports active, expired and empty states", () => {
64
+ const dir = makeDir();
65
+ try {
66
+ const empty = checkQuarantine(dir, NOW);
67
+ assert.equal(empty.status, "empty");
68
+ assert.match(empty.summary, /\[QUARANTINE EMPTY\]/);
69
+ addQuarantine(dir, { test: "a.test.ts", owner: "alice", reason: "race", days: 14, now: NOW });
70
+ const active = checkQuarantine(dir, NOW);
71
+ assert.equal(active.status, "clean");
72
+ assert.match(active.summary, /\[QUARANTINE ACTIVE\]/);
73
+ const expired = checkQuarantine(dir, LATER);
74
+ assert.equal(expired.status, "expired");
75
+ assert.equal(expired.expired.length, 1);
76
+ assert.match(expired.summary, /\[QUARANTINE EXPIRED\]/);
77
+ }
78
+ finally {
79
+ rmSync(dir, { recursive: true, force: true });
80
+ }
81
+ });
82
+ test("removeQuarantine and clearQuarantine manage the store", () => {
83
+ const dir = makeDir();
84
+ try {
85
+ addQuarantine(dir, { test: "a.test.ts", owner: "alice", reason: "race", days: 14, now: NOW });
86
+ addQuarantine(dir, { test: "b.test.ts", owner: "bob", reason: "timeout", days: 30, now: NOW });
87
+ const removed = removeQuarantine(dir, "a.test.ts");
88
+ assert.equal(removed.removed, true);
89
+ assert.equal(removed.remaining, 1);
90
+ assert.equal(removeQuarantine(dir, "a.test.ts").removed, false);
91
+ assert.equal(clearQuarantine(dir).removed, 1);
92
+ assert.deepEqual(listQuarantine(dir, NOW).entries, []);
93
+ }
94
+ finally {
95
+ rmSync(dir, { recursive: true, force: true });
96
+ }
97
+ });
98
+ //# sourceMappingURL=quarantine.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quarantine.test.js","sourceRoot":"","sources":["../../src/core/quarantine.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,MAAM,WAAW,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,cAAc,EACd,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAEzB,SAAS,OAAO;IACd,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,sBAAsB,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,0BAA0B,CAAC,CAAC;AACjD,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,0BAA0B,CAAC,CAAC;AAEnD,IAAI,CAAC,wEAAwE,EAAE,GAAG,EAAE;IAClF,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;IACtB,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,EAAE;YAC/B,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,OAAO;YACd,MAAM,EAAE,aAAa;YACrB,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,8BAA8B;YACrC,GAAG,EAAE,GAAG;SACT,CAAC,CAAC;QACH,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;QAC9C,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACnC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,0BAA0B,CAAC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AAC,GAAG,EAAE,WAAW,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAEhE,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAC9C,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACzD,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"}
@@ -66,6 +66,8 @@ test("MCP advertises prompts and renders them with arguments", () => {
66
66
  "audit-the-cuckoo",
67
67
  "read-the-chronicle",
68
68
  "stamp-the-beacon",
69
+ "quarantine-the-flake",
70
+ "freeze-the-network",
69
71
  "prune-senescent-code",
70
72
  "scan-for-injection",
71
73
  "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,CAA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501,44 @@ const TOOLS = [
1501
1501
  },
1502
1502
  },
1503
1503
  },
1504
+ {
1505
+ name: "quarantine",
1506
+ description: "Track flaky tests with an owner and expiry in .oc-pilot/quarantine.json. check fails with [QUARANTINE EXPIRED] so suppression cannot become permanent. Actions: add, list, check, remove, clear. add/remove/clear write and need --allow-write.",
1507
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
1508
+ inputSchema: {
1509
+ type: "object",
1510
+ additionalProperties: false,
1511
+ required: ["action"],
1512
+ properties: {
1513
+ action: { type: "string", enum: ["add", "list", "check", "remove", "clear"] },
1514
+ test: { type: "string", description: "Test name for add/remove" },
1515
+ owner: { type: "string", description: "Who owns the quarantine" },
1516
+ reason: { type: "string", description: "Why the test is quarantined" },
1517
+ days: { type: "integer", minimum: 1, maximum: 365 },
1518
+ issue: { type: "string", description: "Issue URL" },
1519
+ force: { type: "boolean", description: "Confirm clear" },
1520
+ ...RESULT_PROPERTIES,
1521
+ },
1522
+ },
1523
+ },
1524
+ {
1525
+ name: "mirage",
1526
+ description: "Record fetch responses and Date.now into a cassette, then replay them without the network; replay fails with [MIRAGE MISS] on an unrecorded URL. Actions: record, replay, list, show, clear. record/clear write and need --allow-write; replay executes the command.",
1527
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
1528
+ inputSchema: {
1529
+ type: "object",
1530
+ additionalProperties: false,
1531
+ required: ["action"],
1532
+ properties: {
1533
+ action: { type: "string", enum: ["record", "replay", "list", "show", "clear"] },
1534
+ command: { type: "string", description: "Command to run under the preload" },
1535
+ cassette: { type: "string", description: "Repository-relative cassette JSON" },
1536
+ timeout_ms: { type: "integer", minimum: 1000, maximum: 900000 },
1537
+ force: { type: "boolean", description: "Confirm clear" },
1538
+ ...RESULT_PROPERTIES,
1539
+ },
1540
+ },
1541
+ },
1504
1542
  {
1505
1543
  name: "apoptosis",
1506
1544
  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.",
@@ -1801,6 +1839,22 @@ const PROMPTS = [
1801
1839
  { name: "context", description: "What the verification covers", required: false },
1802
1840
  ],
1803
1841
  },
1842
+ {
1843
+ name: "quarantine-the-flake",
1844
+ title: "Quarantine a flaky test with an expiry",
1845
+ description: "Put a flaky test under an owner and a deadline, then fail the gate when the deadline passes instead of suppressing it forever.",
1846
+ arguments: [
1847
+ { name: "context", description: "Why the test is flaky", required: false },
1848
+ ],
1849
+ },
1850
+ {
1851
+ name: "freeze-the-network",
1852
+ title: "Freeze the network and clock",
1853
+ description: "Record real fetch responses and Date.now into a cassette, then replay them offline and fail on any unrecorded request.",
1854
+ arguments: [
1855
+ { name: "context", description: "What the test is exercising", required: false },
1856
+ ],
1857
+ },
1804
1858
  {
1805
1859
  name: "prune-senescent-code",
1806
1860
  title: "Prune senescent AI code",
@@ -4121,6 +4175,44 @@ async function callBeacon(input, cwd) {
4121
4175
  args.push("--force");
4122
4176
  return toToolResult(await runCli(args, cwd));
4123
4177
  }
4178
+ async function callQuarantine(input, cwd) {
4179
+ const action = stringArg(input, "action", true);
4180
+ const args = ["quarantine", action, "--json"];
4181
+ const test = stringArg(input, "test");
4182
+ if (test)
4183
+ args.push("--test", test);
4184
+ const owner = stringArg(input, "owner");
4185
+ if (owner)
4186
+ args.push("--owner", owner);
4187
+ const reason = stringArg(input, "reason");
4188
+ if (reason)
4189
+ args.push("--reason", reason);
4190
+ const days = integerArg(input, "days");
4191
+ if (days !== undefined)
4192
+ args.push("--days", String(days));
4193
+ const issue = stringArg(input, "issue");
4194
+ if (issue)
4195
+ args.push("--issue", issue);
4196
+ if (booleanArg(input, "force"))
4197
+ args.push("--force");
4198
+ return toToolResult(await runCli(args, cwd));
4199
+ }
4200
+ async function callMirage(input, cwd) {
4201
+ const action = stringArg(input, "action", true);
4202
+ const args = ["mirage", action, "--json"];
4203
+ const command = stringArg(input, "command");
4204
+ if (command)
4205
+ args.push("--command", command);
4206
+ const cassette = stringArg(input, "cassette");
4207
+ if (cassette)
4208
+ args.push("--cassette", cassette);
4209
+ const timeout = integerArg(input, "timeout_ms");
4210
+ if (timeout !== undefined)
4211
+ args.push("--timeout", String(Math.max(1, Math.round(timeout / 1000))) + "s");
4212
+ if (booleanArg(input, "force"))
4213
+ args.push("--force");
4214
+ return toToolResult(await runCli(args, cwd));
4215
+ }
4124
4216
  async function callApoptosis(input, cwd) {
4125
4217
  const action = stringArg(input, "action") ?? "scan";
4126
4218
  const args = ["apoptosis", action, "--json"];
@@ -4354,6 +4446,12 @@ async function dispatchTool(name, input, cwd, readOnly) {
4354
4446
  if (name === "beacon" && ["stamp", "clear"].includes(stringArg(input, "action") ?? "")) {
4355
4447
  throw new ToolInputError("beacon stamp/clear write .oc-pilot/beacon.json and are disabled in read-only mode; start the MCP server with --allow-write");
4356
4448
  }
4449
+ if (name === "quarantine" && ["add", "remove", "clear"].includes(stringArg(input, "action") ?? "")) {
4450
+ throw new ToolInputError("quarantine add/remove/clear write .oc-pilot/quarantine.json and are disabled in read-only mode; start the MCP server with --allow-write");
4451
+ }
4452
+ if (name === "mirage" && ["record", "clear"].includes(stringArg(input, "action") ?? "")) {
4453
+ throw new ToolInputError("mirage record/clear write cassettes and are disabled in read-only mode; start the MCP server with --allow-write");
4454
+ }
4357
4455
  if (name === "honeypot" && (stringArg(input, "action") === "deploy" || stringArg(input, "action") === "remove")) {
4358
4456
  throw new ToolInputError("honeypot deploy/remove writes files and is disabled in read-only mode; start the MCP server with --allow-write");
4359
4457
  }
@@ -4493,6 +4591,10 @@ async function dispatchTool(name, input, cwd, readOnly) {
4493
4591
  return callChronos(input, cwd);
4494
4592
  case "beacon":
4495
4593
  return callBeacon(input, cwd);
4594
+ case "quarantine":
4595
+ return callQuarantine(input, cwd);
4596
+ case "mirage":
4597
+ return callMirage(input, cwd);
4496
4598
  case "apoptosis":
4497
4599
  return callApoptosis(input, cwd);
4498
4600
  case "scan_injection":
@@ -4572,6 +4674,18 @@ function summarizeResult(value) {
4572
4674
  if (typeof value.status === "string" && Array.isArray(value.removed) && typeof value.summary === "string") {
4573
4675
  return `oc-pilot: apoptosis ${value.status}, ${String(value.removed.length)} removed`;
4574
4676
  }
4677
+ if (typeof value.mode === "string" && typeof value.cassette === "string" && typeof value.status === "string" && typeof value.entries === "number") {
4678
+ return `oc-pilot: mirage ${value.mode} ${value.status}, ${String(value.entries)} fetch`;
4679
+ }
4680
+ if (typeof value.status === "string" && Array.isArray(value.expired) && typeof value.summary === "string") {
4681
+ return `oc-pilot: quarantine ${value.status}, ${String(value.expired.length)} expired`;
4682
+ }
4683
+ if (Array.isArray(value.entries) && Array.isArray(value.expired) && Array.isArray(value.active)) {
4684
+ return `oc-pilot: quarantine ${String(value.entries.length)} test(s), ${String(value.expired.length)} expired`;
4685
+ }
4686
+ if (typeof value.test === "string" && typeof value.owner === "string" && typeof value.expiresAt === "string") {
4687
+ return `oc-pilot: quarantine ${value.test} until ${value.expiresAt}`;
4688
+ }
4575
4689
  if (typeof value.status === "string" &&
4576
4690
  ["valid", "unsigned", "tampered", "unattributed", "missing", "error"].includes(value.status) &&
4577
4691
  typeof value.summary === "string") {
@@ -4922,6 +5036,10 @@ function promptBody(name, args) {
4922
5036
  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}`;
4923
5037
  case "stamp-the-passport":
4924
5038
  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}`;
5039
+ case "freeze-the-network":
5040
+ return `Call the oc-pilot "mirage" tool with action=record, the test command and a cassette path. Then stop the network or run in an environment without it and call action=replay with the same command. Read the recorded entries and clock values. If replay returns [MIRAGE MISS], stop: the test depends on an unrecorded request; record it explicitly instead of widening the matcher or deleting the assertion. Do not hand-edit the cassette to fake a response. record/clear need --allow-write.${suffix}`;
5041
+ case "quarantine-the-flake":
5042
+ return `Call the oc-pilot "quarantine" tool with action=add and a real test name, owner, reason and a short expiry (14 days or less). Read the expiry and tell the user who owns the fix and when the gate will fail. Use action=check in CI; if it returns [QUARANTINE EXPIRED], fix or delete the test instead of extending the deadline silently. Never quarantine a test without an owner and never make the expiry permanent. add/remove/clear need --allow-write.${suffix}`;
4925
5043
  case "stamp-the-beacon":
4926
5044
  return `Call the oc-pilot "beacon" tool with action=stamp after the checks you actually ran, then action=verify with the same key or allowed_signers. Record only real checks, the real agent/model and the commands. If verify returns [BEACON TAMPERED] or [UNATTRIBUTED], stop: do not share or merge the beacon; re-stamp from the current state or investigate the signature. Never mark an unrun check as pass, never edit the manifest by hand and never claim that a beacon proves correctness: it proves what was recorded and who signed it. stamp/clear need --allow-write.${suffix}`;
4927
5045
  case "read-the-chronicle":