oc-pilot 0.102.0 → 0.103.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 +7 -0
- package/README.md +7 -5
- package/README.ru.md +6 -4
- package/dist/cli.js +5 -1
- package/dist/cli.js.map +1 -1
- package/dist/cli.test.js +13 -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/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/mcp-prompts.test.js +2 -0
- package/dist/mcp-prompts.test.js.map +1 -1
- package/dist/mcp.js +99 -0
- package/dist/mcp.js.map +1 -1
- package/dist/mcp.test.js +6 -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 +3 -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,32 @@ 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
|
+
},
|
|
1326
1352
|
{
|
|
1327
1353
|
name: "apoptosis",
|
|
1328
1354
|
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 +1577,22 @@ const PROMPTS = [
|
|
|
1551
1577
|
{ name: "context", description: "Why the change is being split", required: false },
|
|
1552
1578
|
],
|
|
1553
1579
|
},
|
|
1580
|
+
{
|
|
1581
|
+
name: "check-the-criteria",
|
|
1582
|
+
title: "Check acceptance criteria against the diff",
|
|
1583
|
+
description: "Evaluate every acceptance criterion as met, partial, unmet or unverifiable against the real diff and stop on an unmet criterion.",
|
|
1584
|
+
arguments: [
|
|
1585
|
+
{ name: "context", description: "What the change is supposed to do", required: false },
|
|
1586
|
+
],
|
|
1587
|
+
},
|
|
1588
|
+
{
|
|
1589
|
+
name: "interrogate-the-intent",
|
|
1590
|
+
title: "Interrogate the request before code",
|
|
1591
|
+
description: "Extract missing decisions, hidden assumptions and testable acceptance criteria before implementation starts.",
|
|
1592
|
+
arguments: [
|
|
1593
|
+
{ name: "context", description: "What is already known", required: false },
|
|
1594
|
+
],
|
|
1595
|
+
},
|
|
1554
1596
|
{
|
|
1555
1597
|
name: "prune-senescent-code",
|
|
1556
1598
|
title: "Prune senescent AI code",
|
|
@@ -3610,6 +3652,50 @@ async function callMitosis(input, cwd) {
|
|
|
3610
3652
|
temp.cleanup();
|
|
3611
3653
|
}
|
|
3612
3654
|
}
|
|
3655
|
+
async function callIntent(input, cwd) {
|
|
3656
|
+
const temp = new TempFiles();
|
|
3657
|
+
try {
|
|
3658
|
+
const action = stringArg(input, "action", true);
|
|
3659
|
+
const args = ["intent", action, "--json"];
|
|
3660
|
+
if (Array.isArray(input.criteria)) {
|
|
3661
|
+
const lines = input.criteria.filter((item) => typeof item === "string");
|
|
3662
|
+
args.push("--criteria", temp.write("intent-criteria.md", lines.map((line) => "- [ ] " + line).join("\n")));
|
|
3663
|
+
}
|
|
3664
|
+
const criteriaFile = stringArg(input, "criteria_file");
|
|
3665
|
+
if (criteriaFile)
|
|
3666
|
+
args.push("--criteria", criteriaFile);
|
|
3667
|
+
const criteriaText = stringArg(input, "criteria_text");
|
|
3668
|
+
if (criteriaText)
|
|
3669
|
+
args.push("--criteria-text", criteriaText);
|
|
3670
|
+
const request = stringArg(input, "request");
|
|
3671
|
+
if (request)
|
|
3672
|
+
args.push("--request", request);
|
|
3673
|
+
const requestFile = stringArg(input, "request_file");
|
|
3674
|
+
if (requestFile)
|
|
3675
|
+
args.push("--request-file", requestFile);
|
|
3676
|
+
const context = stringArg(input, "context");
|
|
3677
|
+
if (context)
|
|
3678
|
+
args.push("--context", context);
|
|
3679
|
+
if (booleanArg(input, "strict"))
|
|
3680
|
+
args.push("--strict");
|
|
3681
|
+
const diff = stringArg(input, "diff");
|
|
3682
|
+
if (diff)
|
|
3683
|
+
args.push("--diff", temp.write("intent.diff", diff));
|
|
3684
|
+
const base = baseArg(input);
|
|
3685
|
+
if (base)
|
|
3686
|
+
args.push("--base", base);
|
|
3687
|
+
if (booleanArg(input, "staged"))
|
|
3688
|
+
args.push("--staged");
|
|
3689
|
+
if (booleanArg(input, "unstaged"))
|
|
3690
|
+
args.push("--unstaged");
|
|
3691
|
+
if (booleanArg(input, "include_untracked"))
|
|
3692
|
+
args.push("--include-untracked");
|
|
3693
|
+
return toToolResult(await runCli(args, cwd));
|
|
3694
|
+
}
|
|
3695
|
+
finally {
|
|
3696
|
+
temp.cleanup();
|
|
3697
|
+
}
|
|
3698
|
+
}
|
|
3613
3699
|
async function callApoptosis(input, cwd) {
|
|
3614
3700
|
const action = stringArg(input, "action") ?? "scan";
|
|
3615
3701
|
const args = ["apoptosis", action, "--json"];
|
|
@@ -3957,6 +4043,8 @@ async function dispatchTool(name, input, cwd, readOnly) {
|
|
|
3957
4043
|
return callVaccine(input, cwd);
|
|
3958
4044
|
case "mitosis":
|
|
3959
4045
|
return callMitosis(input, cwd);
|
|
4046
|
+
case "intent":
|
|
4047
|
+
return callIntent(input, cwd);
|
|
3960
4048
|
case "apoptosis":
|
|
3961
4049
|
return callApoptosis(input, cwd);
|
|
3962
4050
|
case "scan_injection":
|
|
@@ -4036,6 +4124,13 @@ function summarizeResult(value) {
|
|
|
4036
4124
|
if (typeof value.status === "string" && Array.isArray(value.removed) && typeof value.summary === "string") {
|
|
4037
4125
|
return `oc-pilot: apoptosis ${value.status}, ${String(value.removed.length)} removed`;
|
|
4038
4126
|
}
|
|
4127
|
+
if (typeof value.status === "string" && Array.isArray(value.results) && value.counts && typeof value.counts === "object") {
|
|
4128
|
+
const counts = value.counts;
|
|
4129
|
+
return `oc-pilot: intent ${value.status}, ${String(counts.unmet ?? 0)} unmet`;
|
|
4130
|
+
}
|
|
4131
|
+
if (typeof value.status === "string" && Array.isArray(value.questions) && Array.isArray(value.assumptions)) {
|
|
4132
|
+
return `oc-pilot: sphinx ${value.status}, ${String(value.questions.length)} question(s)`;
|
|
4133
|
+
}
|
|
4039
4134
|
if (typeof value.status === "string" && typeof value.branch === "string" && Array.isArray(value.commits)) {
|
|
4040
4135
|
return `oc-pilot: mitosis ${value.status}, ${String(value.commits.length)} commit(s) on ${value.branch}`;
|
|
4041
4136
|
}
|
|
@@ -4341,6 +4436,10 @@ function promptBody(name, args) {
|
|
|
4341
4436
|
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
4437
|
case "stamp-the-passport":
|
|
4343
4438
|
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}`;
|
|
4439
|
+
case "check-the-criteria":
|
|
4440
|
+
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}`;
|
|
4441
|
+
case "interrogate-the-intent":
|
|
4442
|
+
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
4443
|
case "split-the-diff":
|
|
4345
4444
|
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
4445
|
case "inoculate-the-fix":
|