oc-pilot 0.89.0 → 0.91.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 +16 -0
- package/README.md +10 -6
- package/README.ru.md +9 -5
- package/dist/cli.js +9 -1
- package/dist/cli.js.map +1 -1
- package/dist/cli.test.js +50 -0
- package/dist/cli.test.js.map +1 -1
- package/dist/commands/alien-dna.js +73 -0
- package/dist/commands/alien-dna.js.map +1 -0
- package/dist/commands/hyper-chamber.js +96 -0
- package/dist/commands/hyper-chamber.js.map +1 -0
- package/dist/core/alien-dna.js +310 -0
- package/dist/core/alien-dna.js.map +1 -0
- package/dist/core/alien-dna.test.js +117 -0
- package/dist/core/alien-dna.test.js.map +1 -0
- package/dist/core/hyper-chamber.js +483 -0
- package/dist/core/hyper-chamber.js.map +1 -0
- package/dist/core/hyper-chamber.test.js +105 -0
- package/dist/core/hyper-chamber.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 +100 -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 +2 -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
package/dist/mcp.js
CHANGED
|
@@ -1071,6 +1071,40 @@ const TOOLS = [
|
|
|
1071
1071
|
},
|
|
1072
1072
|
},
|
|
1073
1073
|
},
|
|
1074
|
+
{
|
|
1075
|
+
name: "alien_dna",
|
|
1076
|
+
description: "Compare added diff lines with the repository architecture DNA at HEAD and fail when the diff introduces a pattern that never appeared before (0% occurrence): Singleton, Proxy, dynamic RegExp, eval, global state, inheritance, decorators, Worker, EventEmitter, dynamic import, sync I/O or prototype mutation. Offline and deterministic; no model call.",
|
|
1077
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
1078
|
+
inputSchema: {
|
|
1079
|
+
type: "object",
|
|
1080
|
+
additionalProperties: false,
|
|
1081
|
+
properties: {
|
|
1082
|
+
diff: { type: "string", description: "Unified diff text. Omit to use the project's git diff." },
|
|
1083
|
+
base: { type: "string" },
|
|
1084
|
+
staged: { type: "boolean" },
|
|
1085
|
+
unstaged: { type: "boolean" },
|
|
1086
|
+
include_untracked: { type: "boolean" },
|
|
1087
|
+
...RESULT_PROPERTIES,
|
|
1088
|
+
},
|
|
1089
|
+
},
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
name: "hyper_chamber",
|
|
1093
|
+
description: "Age one self-contained JS/ESM file in node:vm: fake Date and timers, forced GC, a simulated year of uptime and heap samples from node:v8. Reports ok, leak, timeout or error; a sustained heap growth returns exit code 1 with [MEMORY LEAK DETECTED]. Offline and deterministic, but a heuristic rather than a proof.",
|
|
1094
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
1095
|
+
inputSchema: {
|
|
1096
|
+
type: "object",
|
|
1097
|
+
additionalProperties: false,
|
|
1098
|
+
required: ["file"],
|
|
1099
|
+
properties: {
|
|
1100
|
+
file: { type: "string", description: "Repository-relative JS/MJS file (or built dist JS)" },
|
|
1101
|
+
days: { type: "integer", minimum: 1, maximum: 3650, description: "Simulated days (default 365)" },
|
|
1102
|
+
budget_ms: { type: "integer", minimum: 100, maximum: 30000, description: "Real run budget (default 2000)" },
|
|
1103
|
+
memory_mb: { type: "integer", minimum: 16, maximum: 4096, description: "Heap cap (default 128)" },
|
|
1104
|
+
...RESULT_PROPERTIES,
|
|
1105
|
+
},
|
|
1106
|
+
},
|
|
1107
|
+
},
|
|
1074
1108
|
{
|
|
1075
1109
|
name: "ready",
|
|
1076
1110
|
description: "Agent readiness score 0-100 for the repository: tests, lockfile, git hooks, Slop Index, a fresh receipt, agent instructions, CI, config and security. Uses git and local files only and never calls a model, so it is free and safe in read-only mode. A score below fail_under returns exit code 1 with the full report, not a tool error.",
|
|
@@ -1177,6 +1211,22 @@ const PROMPTS = [
|
|
|
1177
1211
|
{ name: "context", description: "What the agent is working on", required: false },
|
|
1178
1212
|
],
|
|
1179
1213
|
},
|
|
1214
|
+
{
|
|
1215
|
+
name: "check-alien-dna",
|
|
1216
|
+
title: "Check architecture DNA",
|
|
1217
|
+
description: "Compare the diff with the repository's established patterns and stop when the agent introduces a pattern that has never appeared in the codebase.",
|
|
1218
|
+
arguments: [
|
|
1219
|
+
{ name: "context", description: "What the change is supposed to do", required: false },
|
|
1220
|
+
],
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
name: "stress-the-chamber",
|
|
1224
|
+
title: "Stress the time chamber",
|
|
1225
|
+
description: "Age a self-contained JS/ESM function in node:vm, simulate a year of uptime and stop on sustained heap growth before the code reaches main.",
|
|
1226
|
+
arguments: [
|
|
1227
|
+
{ name: "context", description: "What the function is supposed to do", required: false },
|
|
1228
|
+
],
|
|
1229
|
+
},
|
|
1180
1230
|
{
|
|
1181
1231
|
name: "compile-hologram",
|
|
1182
1232
|
title: "Compile a context hologram",
|
|
@@ -2898,6 +2948,42 @@ async function callHoneypot(input, cwd) {
|
|
|
2898
2948
|
args.push("--force");
|
|
2899
2949
|
return toToolResult(await runCli(args, cwd));
|
|
2900
2950
|
}
|
|
2951
|
+
async function callAlienDna(input, cwd) {
|
|
2952
|
+
const temp = new TempFiles();
|
|
2953
|
+
try {
|
|
2954
|
+
const args = ["alien-dna", "--json"];
|
|
2955
|
+
const diff = stringArg(input, "diff");
|
|
2956
|
+
const base = baseArg(input);
|
|
2957
|
+
if (diff)
|
|
2958
|
+
args.push("--diff", temp.write("changes.diff", diff));
|
|
2959
|
+
if (base)
|
|
2960
|
+
args.push("--base", base);
|
|
2961
|
+
if (booleanArg(input, "staged"))
|
|
2962
|
+
args.push("--staged");
|
|
2963
|
+
if (booleanArg(input, "unstaged"))
|
|
2964
|
+
args.push("--unstaged");
|
|
2965
|
+
if (booleanArg(input, "include_untracked"))
|
|
2966
|
+
args.push("--include-untracked");
|
|
2967
|
+
return toToolResult(await runCli(args, cwd));
|
|
2968
|
+
}
|
|
2969
|
+
finally {
|
|
2970
|
+
temp.cleanup();
|
|
2971
|
+
}
|
|
2972
|
+
}
|
|
2973
|
+
async function callHyperChamber(input, cwd) {
|
|
2974
|
+
const file = stringArg(input, "file", true);
|
|
2975
|
+
const args = ["hyper-chamber", "run", file, "--json"];
|
|
2976
|
+
const days = integerArg(input, "days");
|
|
2977
|
+
if (days !== undefined)
|
|
2978
|
+
args.push("--days", String(days));
|
|
2979
|
+
const budget = integerArg(input, "budget_ms");
|
|
2980
|
+
if (budget !== undefined)
|
|
2981
|
+
args.push("--budget", `${String(budget)}ms`);
|
|
2982
|
+
const memory = integerArg(input, "memory_mb");
|
|
2983
|
+
if (memory !== undefined)
|
|
2984
|
+
args.push("--memory-limit", `${String(memory)}MB`);
|
|
2985
|
+
return toToolResult(await runCli(args, cwd));
|
|
2986
|
+
}
|
|
2901
2987
|
async function callSast(input, cwd) {
|
|
2902
2988
|
const temp = new TempFiles();
|
|
2903
2989
|
try {
|
|
@@ -3143,6 +3229,10 @@ async function dispatchTool(name, input, cwd, readOnly) {
|
|
|
3143
3229
|
return callPreflight(input, cwd);
|
|
3144
3230
|
case "honeypot":
|
|
3145
3231
|
return callHoneypot(input, cwd);
|
|
3232
|
+
case "alien_dna":
|
|
3233
|
+
return callAlienDna(input, cwd);
|
|
3234
|
+
case "hyper_chamber":
|
|
3235
|
+
return callHyperChamber(input, cwd);
|
|
3146
3236
|
case "sast":
|
|
3147
3237
|
return callSast(input, cwd);
|
|
3148
3238
|
case "authz":
|
|
@@ -3208,9 +3298,15 @@ function summarizeResult(value) {
|
|
|
3208
3298
|
const fingerprint = identity && typeof identity.fingerprint === "string" ? identity.fingerprint : "no identity";
|
|
3209
3299
|
return `oc-pilot: hivemind ${fingerprint}, ${String(value.peers.length)} peer(s)`;
|
|
3210
3300
|
}
|
|
3301
|
+
if (typeof value.status === "string" && typeof value.simulatedDays === "number" && typeof value.iterations === "number") {
|
|
3302
|
+
return `oc-pilot: hyper-chamber ${value.status}, ${String(value.simulatedDays)} day(s), ${String(value.iterations)} iteration(s)`;
|
|
3303
|
+
}
|
|
3211
3304
|
if (typeof value.status === "string" && Array.isArray(value.output) && typeof value.durationMs === "number") {
|
|
3212
3305
|
return `oc-pilot: sandbox ${value.status} for ${typeof value.file === "string" ? value.file : "?"} (${String(value.durationMs)} ms)`;
|
|
3213
3306
|
}
|
|
3307
|
+
if (typeof value.baseline === "string" && Array.isArray(value.patterns) && Array.isArray(value.triggers)) {
|
|
3308
|
+
return `oc-pilot: alien DNA ${String(value.triggers.length)} trigger(s), ${String(value.files ?? 0)} baseline file(s), ${String(value.addedLines ?? 0)} added line(s)`;
|
|
3309
|
+
}
|
|
3214
3310
|
if (typeof value.query === "string" && typeof value.count === "number" && Array.isArray(value.rows)) {
|
|
3215
3311
|
return `oc-pilot: AQL ${String(value.count)} node(s) for ${typeof value.type === "string" && value.type ? value.type : "any type"}`;
|
|
3216
3312
|
}
|
|
@@ -3447,6 +3543,10 @@ function promptBody(name, args) {
|
|
|
3447
3543
|
return `Before I commit, call the oc-pilot "preflight" tool with staged=true. It runs offline: secrets, dependency health scoped to the change, test weakening and the Slop Index delta. If the verdict is fail, fix the cheapest failing check first, then call "preflight" again. Do not disable a check with no_* flags or lower the gate just to get a pass. When it passes, report what was checked and any remaining skips.${suffix}`;
|
|
3448
3544
|
case "deploy-honeypot":
|
|
3449
3545
|
return `Call the oc-pilot "honeypot" tool with action=deploy to plant decoys, then call it with action=status and report the manifest. Treat the decoy files as traps, not as real secrets or real helpers: never import bypassAuth, never use the fake AWS keys and never call legacyDbDrop. Before committing, run "preflight"; if it reports [HONEYPOT TRIGGERED], stop, explain which decoy was touched and do not continue the task. When the exercise is over, call "honeypot" with action=remove to clean up. deploy and remove require write mode; if the server is read-only, ask the user to run oc-pilot honeypot deploy.${suffix}`;
|
|
3546
|
+
case "check-alien-dna":
|
|
3547
|
+
return `Call the oc-pilot "alien_dna" tool on the current diff. Read the baseline pattern counts and every trigger. If it reports [ALIEN DNA DETECTED], stop and explain which pattern is new, where it appears and why the codebase has 0% prior usage. Do not rewrite the code to hide the pattern, do not add a fake prior usage, and do not edit the baseline. Ask the user for explicit approval before adopting a new architectural pattern; if approved, report the decision and rerun the gate.${suffix}`;
|
|
3548
|
+
case "stress-the-chamber":
|
|
3549
|
+
return `Call the oc-pilot "hyper_chamber" tool with file set to the generated JS/ESM file, days=365, budget_ms=2000 and memory_mb=128. Report the exact status (ok, leak, timeout or error), the simulated days, the iteration count and the heap first-to-last. If it reports [MEMORY LEAK DETECTED], stop, quote the crash day and explain which retained allocation grows; do not commit, do not raise the heap limit and do not hide the leak by clearing a cache just to pass. If it is ok, say that this is a heuristic, not a proof of bounded memory. Never run native code through this tool.${suffix}`;
|
|
3450
3550
|
case "compile-hologram":
|
|
3451
3551
|
return `Call the oc-pilot "pack_hologram" tool with max_tokens=30000 and the current diff. The result is layered: LOD 0 files are complete, LOD 1 bodies are hidden behind markers, LOD 2 lists export names. Never invent a hidden body: if the implementation matters, call "zoom_symbol" with the file and symbol from the Zoom section and read the returned body before reasoning about it. Treat [Hologram: parse bailout] as a warning that the file is complete. Do not dump the whole repository or raise max_tokens just to avoid zooming; the hologram exists to save context. Report which files were LOD 0/1/2, any redacted secrets and every symbol you zoomed.${suffix}`;
|
|
3452
3552
|
case "check-invariants":
|