oc-pilot 0.102.0 → 0.104.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 +14 -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 +25 -0
- package/dist/cli.test.js.map +1 -1
- package/dist/commands/intent.js +213 -0
- package/dist/commands/intent.js.map +1 -0
- package/dist/commands/scalpel.js +215 -0
- package/dist/commands/scalpel.js.map +1 -0
- package/dist/core/intent.js +190 -0
- package/dist/core/intent.js.map +1 -0
- package/dist/core/intent.test.js +86 -0
- package/dist/core/intent.test.js.map +1 -0
- package/dist/core/scalpel.js +161 -0
- package/dist/core/scalpel.js.map +1 -0
- package/dist/core/scalpel.test.js +132 -0
- package/dist/core/scalpel.test.js.map +1 -0
- package/dist/mcp-prompts.test.js +3 -0
- package/dist/mcp-prompts.test.js.map +1 -1
- package/dist/mcp.js +189 -0
- package/dist/mcp.js.map +1 -1
- package/dist/mcp.test.js +12 -0
- package/dist/mcp.test.js.map +1 -1
- package/dist/skills.test.js +7 -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 +6 -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
|
@@ -1323,6 +1323,57 @@ const TOOLS = [
|
|
|
1323
1323
|
},
|
|
1324
1324
|
},
|
|
1325
1325
|
},
|
|
1326
|
+
{
|
|
1327
|
+
name: "intent",
|
|
1328
|
+
description: "Check acceptance criteria against the diff (met, partial, unmet, unverifiable) or interrogate a request before code (questions, assumptions, testable criteria). Model-backed, read-only and limited to what the diff can show.",
|
|
1329
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
1330
|
+
inputSchema: {
|
|
1331
|
+
type: "object",
|
|
1332
|
+
additionalProperties: false,
|
|
1333
|
+
required: ["action"],
|
|
1334
|
+
properties: {
|
|
1335
|
+
action: { type: "string", enum: ["check", "sphinx"] },
|
|
1336
|
+
criteria: { type: "array", description: "Acceptance criteria as strings", items: { type: "string" } },
|
|
1337
|
+
criteria_text: { type: "string", description: "Criteria as Markdown checklist or plain lines" },
|
|
1338
|
+
criteria_file: { type: "string", description: "Repository-relative criteria file" },
|
|
1339
|
+
request: { type: "string", description: "Feature request for sphinx" },
|
|
1340
|
+
request_file: { type: "string", description: "Repository-relative request file" },
|
|
1341
|
+
context: { type: "string", description: "Extra context for the model" },
|
|
1342
|
+
strict: { type: "boolean", description: "Fail on partial and unverifiable criteria" },
|
|
1343
|
+
diff: { type: "string", description: "Unified diff text; omit to use the project's git diff" },
|
|
1344
|
+
base: { type: "string" },
|
|
1345
|
+
staged: { type: "boolean" },
|
|
1346
|
+
unstaged: { type: "boolean" },
|
|
1347
|
+
include_untracked: { type: "boolean" },
|
|
1348
|
+
...RESULT_PROPERTIES,
|
|
1349
|
+
},
|
|
1350
|
+
},
|
|
1351
|
+
},
|
|
1352
|
+
{
|
|
1353
|
+
name: "scalpel",
|
|
1354
|
+
description: "Given a failing test log and the current diff, ask the model for the smallest patch, apply the current diff plus the patch in a shadow worktree, run tests and report the blast radius. Model-backed; apply writes to the worktree and needs --allow-write.",
|
|
1355
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
|
|
1356
|
+
inputSchema: {
|
|
1357
|
+
type: "object",
|
|
1358
|
+
additionalProperties: false,
|
|
1359
|
+
properties: {
|
|
1360
|
+
log: { type: "string", description: "Captured failing test output" },
|
|
1361
|
+
error: { type: "string", description: "Error text instead of a log" },
|
|
1362
|
+
command: { type: "string", description: "Command that reproduces the failure" },
|
|
1363
|
+
context: { type: "string", description: "What the code is supposed to do" },
|
|
1364
|
+
apply: { type: "boolean", description: "Apply a verified patch to the worktree" },
|
|
1365
|
+
test_command: { type: "string", description: "Test command; defaults to detection" },
|
|
1366
|
+
test_timeout_ms: { type: "integer", minimum: 1000, maximum: 900000 },
|
|
1367
|
+
no_test: { type: "boolean", description: "Skip tests; result becomes unverified" },
|
|
1368
|
+
diff: { type: "string", description: "Unified diff text; omit to use the project's git diff" },
|
|
1369
|
+
base: { type: "string" },
|
|
1370
|
+
staged: { type: "boolean" },
|
|
1371
|
+
unstaged: { type: "boolean" },
|
|
1372
|
+
include_untracked: { type: "boolean" },
|
|
1373
|
+
...RESULT_PROPERTIES,
|
|
1374
|
+
},
|
|
1375
|
+
},
|
|
1376
|
+
},
|
|
1326
1377
|
{
|
|
1327
1378
|
name: "apoptosis",
|
|
1328
1379
|
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.",
|
|
@@ -1551,6 +1602,30 @@ const PROMPTS = [
|
|
|
1551
1602
|
{ name: "context", description: "Why the change is being split", required: false },
|
|
1552
1603
|
],
|
|
1553
1604
|
},
|
|
1605
|
+
{
|
|
1606
|
+
name: "check-the-criteria",
|
|
1607
|
+
title: "Check acceptance criteria against the diff",
|
|
1608
|
+
description: "Evaluate every acceptance criterion as met, partial, unmet or unverifiable against the real diff and stop on an unmet criterion.",
|
|
1609
|
+
arguments: [
|
|
1610
|
+
{ name: "context", description: "What the change is supposed to do", required: false },
|
|
1611
|
+
],
|
|
1612
|
+
},
|
|
1613
|
+
{
|
|
1614
|
+
name: "interrogate-the-intent",
|
|
1615
|
+
title: "Interrogate the request before code",
|
|
1616
|
+
description: "Extract missing decisions, hidden assumptions and testable acceptance criteria before implementation starts.",
|
|
1617
|
+
arguments: [
|
|
1618
|
+
{ name: "context", description: "What is already known", required: false },
|
|
1619
|
+
],
|
|
1620
|
+
},
|
|
1621
|
+
{
|
|
1622
|
+
name: "operate-with-a-scalpel",
|
|
1623
|
+
title: "Fix a failure with the smallest patch",
|
|
1624
|
+
description: "Propose a minimal patch for a failing test, prove it in a shadow worktree and show the blast radius before applying anything.",
|
|
1625
|
+
arguments: [
|
|
1626
|
+
{ name: "context", description: "What the code is supposed to do", required: false },
|
|
1627
|
+
],
|
|
1628
|
+
},
|
|
1554
1629
|
{
|
|
1555
1630
|
name: "prune-senescent-code",
|
|
1556
1631
|
title: "Prune senescent AI code",
|
|
@@ -3610,6 +3685,94 @@ async function callMitosis(input, cwd) {
|
|
|
3610
3685
|
temp.cleanup();
|
|
3611
3686
|
}
|
|
3612
3687
|
}
|
|
3688
|
+
async function callIntent(input, cwd) {
|
|
3689
|
+
const temp = new TempFiles();
|
|
3690
|
+
try {
|
|
3691
|
+
const action = stringArg(input, "action", true);
|
|
3692
|
+
const args = ["intent", action, "--json"];
|
|
3693
|
+
if (Array.isArray(input.criteria)) {
|
|
3694
|
+
const lines = input.criteria.filter((item) => typeof item === "string");
|
|
3695
|
+
args.push("--criteria", temp.write("intent-criteria.md", lines.map((line) => "- [ ] " + line).join("\n")));
|
|
3696
|
+
}
|
|
3697
|
+
const criteriaFile = stringArg(input, "criteria_file");
|
|
3698
|
+
if (criteriaFile)
|
|
3699
|
+
args.push("--criteria", criteriaFile);
|
|
3700
|
+
const criteriaText = stringArg(input, "criteria_text");
|
|
3701
|
+
if (criteriaText)
|
|
3702
|
+
args.push("--criteria-text", criteriaText);
|
|
3703
|
+
const request = stringArg(input, "request");
|
|
3704
|
+
if (request)
|
|
3705
|
+
args.push("--request", request);
|
|
3706
|
+
const requestFile = stringArg(input, "request_file");
|
|
3707
|
+
if (requestFile)
|
|
3708
|
+
args.push("--request-file", requestFile);
|
|
3709
|
+
const context = stringArg(input, "context");
|
|
3710
|
+
if (context)
|
|
3711
|
+
args.push("--context", context);
|
|
3712
|
+
if (booleanArg(input, "strict"))
|
|
3713
|
+
args.push("--strict");
|
|
3714
|
+
const diff = stringArg(input, "diff");
|
|
3715
|
+
if (diff)
|
|
3716
|
+
args.push("--diff", temp.write("intent.diff", diff));
|
|
3717
|
+
const base = baseArg(input);
|
|
3718
|
+
if (base)
|
|
3719
|
+
args.push("--base", base);
|
|
3720
|
+
if (booleanArg(input, "staged"))
|
|
3721
|
+
args.push("--staged");
|
|
3722
|
+
if (booleanArg(input, "unstaged"))
|
|
3723
|
+
args.push("--unstaged");
|
|
3724
|
+
if (booleanArg(input, "include_untracked"))
|
|
3725
|
+
args.push("--include-untracked");
|
|
3726
|
+
return toToolResult(await runCli(args, cwd));
|
|
3727
|
+
}
|
|
3728
|
+
finally {
|
|
3729
|
+
temp.cleanup();
|
|
3730
|
+
}
|
|
3731
|
+
}
|
|
3732
|
+
async function callScalpel(input, cwd) {
|
|
3733
|
+
const temp = new TempFiles();
|
|
3734
|
+
try {
|
|
3735
|
+
const args = ["scalpel", "--json"];
|
|
3736
|
+
const log = stringArg(input, "log");
|
|
3737
|
+
if (log)
|
|
3738
|
+
args.push("--log", log);
|
|
3739
|
+
const error = stringArg(input, "error");
|
|
3740
|
+
if (error)
|
|
3741
|
+
args.push("--error", error);
|
|
3742
|
+
const command = stringArg(input, "command");
|
|
3743
|
+
if (command)
|
|
3744
|
+
args.push("--command", command);
|
|
3745
|
+
const context = stringArg(input, "context");
|
|
3746
|
+
if (context)
|
|
3747
|
+
args.push("--context", context);
|
|
3748
|
+
if (booleanArg(input, "apply"))
|
|
3749
|
+
args.push("--apply");
|
|
3750
|
+
const testCommand = stringArg(input, "test_command");
|
|
3751
|
+
if (testCommand)
|
|
3752
|
+
args.push("--test-command", testCommand);
|
|
3753
|
+
const timeout = integerArg(input, "test_timeout_ms");
|
|
3754
|
+
if (timeout !== undefined)
|
|
3755
|
+
args.push("--test-timeout", String(Math.max(1, Math.round(timeout / 1000))) + "s");
|
|
3756
|
+
if (booleanArg(input, "no_test"))
|
|
3757
|
+
args.push("--no-test");
|
|
3758
|
+
const diff = stringArg(input, "diff");
|
|
3759
|
+
if (diff)
|
|
3760
|
+
args.push("--diff", temp.write("scalpel.diff", diff));
|
|
3761
|
+
const base = baseArg(input);
|
|
3762
|
+
if (base)
|
|
3763
|
+
args.push("--base", base);
|
|
3764
|
+
if (booleanArg(input, "staged"))
|
|
3765
|
+
args.push("--staged");
|
|
3766
|
+
if (booleanArg(input, "unstaged"))
|
|
3767
|
+
args.push("--unstaged");
|
|
3768
|
+
if (booleanArg(input, "include_untracked"))
|
|
3769
|
+
args.push("--include-untracked");
|
|
3770
|
+
return toToolResult(await runCli(args, cwd));
|
|
3771
|
+
}
|
|
3772
|
+
finally {
|
|
3773
|
+
temp.cleanup();
|
|
3774
|
+
}
|
|
3775
|
+
}
|
|
3613
3776
|
async function callApoptosis(input, cwd) {
|
|
3614
3777
|
const action = stringArg(input, "action") ?? "scan";
|
|
3615
3778
|
const args = ["apoptosis", action, "--json"];
|
|
@@ -3834,6 +3997,9 @@ async function dispatchTool(name, input, cwd, readOnly) {
|
|
|
3834
3997
|
if (name === "mitosis" && stringArg(input, "action") === "apply") {
|
|
3835
3998
|
throw new ToolInputError("mitosis apply creates commits and a branch and is disabled in read-only mode; start the MCP server with --allow-write");
|
|
3836
3999
|
}
|
|
4000
|
+
if (name === "scalpel" && booleanArg(input, "apply")) {
|
|
4001
|
+
throw new ToolInputError("scalpel apply writes to the worktree and is disabled in read-only mode; start the MCP server with --allow-write");
|
|
4002
|
+
}
|
|
3837
4003
|
if (name === "honeypot" && (stringArg(input, "action") === "deploy" || stringArg(input, "action") === "remove")) {
|
|
3838
4004
|
throw new ToolInputError("honeypot deploy/remove writes files and is disabled in read-only mode; start the MCP server with --allow-write");
|
|
3839
4005
|
}
|
|
@@ -3957,6 +4123,10 @@ async function dispatchTool(name, input, cwd, readOnly) {
|
|
|
3957
4123
|
return callVaccine(input, cwd);
|
|
3958
4124
|
case "mitosis":
|
|
3959
4125
|
return callMitosis(input, cwd);
|
|
4126
|
+
case "intent":
|
|
4127
|
+
return callIntent(input, cwd);
|
|
4128
|
+
case "scalpel":
|
|
4129
|
+
return callScalpel(input, cwd);
|
|
3960
4130
|
case "apoptosis":
|
|
3961
4131
|
return callApoptosis(input, cwd);
|
|
3962
4132
|
case "scan_injection":
|
|
@@ -4036,6 +4206,19 @@ function summarizeResult(value) {
|
|
|
4036
4206
|
if (typeof value.status === "string" && Array.isArray(value.removed) && typeof value.summary === "string") {
|
|
4037
4207
|
return `oc-pilot: apoptosis ${value.status}, ${String(value.removed.length)} removed`;
|
|
4038
4208
|
}
|
|
4209
|
+
if (typeof value.status === "string" &&
|
|
4210
|
+
["fixed", "rejected", "unverified", "error"].includes(value.status) &&
|
|
4211
|
+
Array.isArray(value.files) &&
|
|
4212
|
+
typeof value.tests === "string") {
|
|
4213
|
+
return `oc-pilot: scalpel ${value.status}, ${String(value.files.length)} file(s), tests ${value.tests}`;
|
|
4214
|
+
}
|
|
4215
|
+
if (typeof value.status === "string" && Array.isArray(value.results) && value.counts && typeof value.counts === "object") {
|
|
4216
|
+
const counts = value.counts;
|
|
4217
|
+
return `oc-pilot: intent ${value.status}, ${String(counts.unmet ?? 0)} unmet`;
|
|
4218
|
+
}
|
|
4219
|
+
if (typeof value.status === "string" && Array.isArray(value.questions) && Array.isArray(value.assumptions)) {
|
|
4220
|
+
return `oc-pilot: sphinx ${value.status}, ${String(value.questions.length)} question(s)`;
|
|
4221
|
+
}
|
|
4039
4222
|
if (typeof value.status === "string" && typeof value.branch === "string" && Array.isArray(value.commits)) {
|
|
4040
4223
|
return `oc-pilot: mitosis ${value.status}, ${String(value.commits.length)} commit(s) on ${value.branch}`;
|
|
4041
4224
|
}
|
|
@@ -4341,6 +4524,12 @@ function promptBody(name, args) {
|
|
|
4341
4524
|
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}`;
|
|
4342
4525
|
case "stamp-the-passport":
|
|
4343
4526
|
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}`;
|
|
4527
|
+
case "operate-with-a-scalpel":
|
|
4528
|
+
return `Call the oc-pilot "scalpel" tool with the failing log, or a command that reproduces it, and the proposed diff. Read the patch and the blast radius. If it returns [SCALPEL FIXED], review the patch and apply it only with explicit approval. If it returns [SCALPEL REJECTED], do not apply it and do not weaken the test. If it returns [SCALPEL UNVERIFIED], run the tests yourself before claiming a fix. Never delete a failing test, never skip it, and never let the patch touch unrelated files. apply needs --allow-write.${suffix}`;
|
|
4529
|
+
case "check-the-criteria":
|
|
4530
|
+
return `Call the oc-pilot "intent" tool with action=check and the acceptance criteria for this change. Read every criterion as met, partial, unmet or unverifiable. If any is unmet, stop and quote the criterion and the evidence: the diff does not do what was promised. Fix the code or the criterion, never mark it met without evidence. Partial is not done, and unverifiable means the diff cannot prove it. Model-backed and read-only.${suffix}`;
|
|
4531
|
+
case "interrogate-the-intent":
|
|
4532
|
+
return `Call the oc-pilot "intent" tool with action=sphinx on the request before writing code. Read the questions and assumptions. Ask the user to resolve each question; do not invent answers. Turn the criteria into tests. If it returns [REQUIREMENTS AMBIGUOUS], do not start implementation yet. Model-backed and read-only.${suffix}`;
|
|
4344
4533
|
case "split-the-diff":
|
|
4345
4534
|
return `Call the oc-pilot "mitosis" tool with action=plan on the proposed diff and read the commit sequence. Check that every commit is independently applicable and that config changes come before the code that needs them. Then call action=apply with confirm=true, a branch name and the project test command; read the test status after each commit. If a commit fails tests, stop: the split is wrong or the change is incomplete; fix the split and rerun. Do not delete failing commits, do not squash everything into one commit to hide the failure, and do not claim the branch is safe when tests were skipped. apply writes a branch and patch files and needs --allow-write.${suffix}`;
|
|
4346
4535
|
case "inoculate-the-fix":
|