oc-pilot 0.92.0 → 0.94.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 +15 -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 +44 -0
- package/dist/cli.test.js.map +1 -1
- package/dist/commands/apoptosis.js +107 -0
- package/dist/commands/apoptosis.js.map +1 -0
- package/dist/commands/blindfold.js +196 -0
- package/dist/commands/blindfold.js.map +1 -0
- package/dist/core/apoptosis.js +210 -0
- package/dist/core/apoptosis.js.map +1 -0
- package/dist/core/apoptosis.test.js +104 -0
- package/dist/core/apoptosis.test.js.map +1 -0
- package/dist/core/blindfold.js +451 -0
- package/dist/core/blindfold.js.map +1 -0
- package/dist/core/blindfold.test.js +77 -0
- package/dist/core/blindfold.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 +124 -0
- package/dist/mcp.js.map +1 -1
- package/dist/mcp.test.js +11 -0
- package/dist/mcp.test.js.map +1 -1
- package/dist/skills.test.js +4 -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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.94.0
|
|
4
|
+
|
|
5
|
+
- Новая команда `apoptosis`: сканирует функции с маркером `/* @lifespan: 30d */` и показывает `[Senescent]`, когда маркер старше срока и на символ больше нет ссылок.
|
|
6
|
+
- `apoptosis apply --confirm` комментирует сенесцентные функции в отдельном git worktree, запускает тестовую команду и переносит diff в рабочий проект только при зелёном прогоне; при падении дерево остаётся нетронутым.
|
|
7
|
+
- MCP-инструмент `apoptosis` и промпт `prune-senescent-code`; apply требует `--allow-write` и явный `confirm`.
|
|
8
|
+
- Документация и skill; 5 core-тестов и CLI-тест; 704 теста; версия 0.94.0.
|
|
9
|
+
|
|
10
|
+
## 0.93.0
|
|
11
|
+
|
|
12
|
+
- Новая команда `blindfold`: детерминированное обезличивание идентификаторов (`calculateDiscount(user)` → `fn_A(var_B)`) перед отправкой кода модели.
|
|
13
|
+
- Модель получает только очищенный код и обязана вернуть строгий JSON-вердикт; команда падает с `[BLINDFOLD REJECTED]`, если логика не восстановлена, найдена уязвимость или уверенность ниже `--min-confidence`.
|
|
14
|
+
- `--dry-run` печатает обезличенный код и карту замен без вызова модели; `--file` проверяет один файл, остальные режимы берут добавленные строки diff.
|
|
15
|
+
- MCP-инструмент `blindfold` и промпт `interrogate-the-blindfold`; это слепая проверка, а не математическое доказательство.
|
|
16
|
+
- Документация и skill; 6 core-тестов и CLI-тест; 698 тестов; версия 0.93.0.
|
|
17
|
+
|
|
3
18
|
## 0.92.0
|
|
4
19
|
|
|
5
20
|
- Новая команда `butterfly`: детерминированный локальный chaos engineering для тестового прогона.
|
package/README.md
CHANGED
|
@@ -944,7 +944,7 @@ Environment variables: `OC_PILOT_ENGINE`, `OC_PILOT_BASE_URL`, `OC_PILOT_API_KEY
|
|
|
944
944
|
|
|
945
945
|
Besides tools, the server exposes read-only MCP resources: `oc-pilot://config` (resolved configuration), `oc-pilot://rules` (project rules with secrets redacted), `oc-pilot://prompt/en` and `oc-pilot://prompt/ru` (the built-in system prompts), and `oc-pilot://version`. `oc-pilot://slop` returns the Slop Index as JSON without calling a model. Resource templates cover live data: `oc-pilot://diff/{mode}` (staged/unstaged/head diff, secrets redacted), `oc-pilot://scan/{mode}` (offline secret scan as JSON) and `oc-pilot://file/{+path}` (any project file up to 2 MB with detected secrets redacted). Hosts can list them with `resources/list` and `resources/templates/list`.
|
|
946
946
|
|
|
947
|
-
Tools: `review`, `invariants`, `test_fix`, `fix`, `test_gen`, `docgen`, `custom`, `scan`, `commit`, `stats`, `slop`, `mutate`, `fuzz`, `bankruptcy`, `query_ast`, `sandbox`, `hivemind_status`, `flaky`, `impact`, `deps`, `coverage`, `reviewers`, `test_guard`, `env_sync`, `mock_leak`, `ecosystem_verify`, `pack`, `pack_hologram`, `zoom_symbol`, `contract_drift`, `anti_regression`, `boundaries`, `test_plan`, `compliance_verify`, `brag`, `battle`, `cleanup`, `arch_diff`, `roast`, `cinema`, `bounty`, `autopsy`, `echo`, `sast`, `authz`, `preflight`, `honeypot`, `alien_dna`, `hyper_chamber`, `butterfly`, `ready`, `receipt_verify`. `scan` accepts `all: true` to sweep the whole repository instead of the diff. `slop` runs the offline Slop Index and accepts `since`, `since_days`, `limit`, `exclude` and `no_blame`. `mutate` runs mutation testing on the changed code, accepts `command`, `max_mutants` and `min_score`, and returns the score plus every surviving mutant; a score below `min_score` is a normal result with exit code 1. `flaky` runs the test command several times and compares per-test results, accepting `runs`, `command`, `fail_on_flaky`, `shuffle` and `seed`; it never edits source files itself but does run the project's tests. `impact` lists the declarations the diff changed or removed and every untouched file that still mentions them, accepting the same source flags; the search is textual, so comments and strings can match. `deps` audits declared, imported and locked dependencies, explains a chain with `why`, adds OSV vulnerabilities and licenses with `audit`, and can rewrite `package.json` with `fix` or emit a CycloneDX SBOM; `fix` and `sbom` write files. `coverage` compares changed lines with a local lcov, Istanbul, Cobertura or Go coverage report and returns uncovered lines, missing files and a gate on `fail_under` or `max_uncovered`. `reviewers` ranks the authors who touched the changed files, lists CODEOWNERS owners and accepts `limit`, `depth` and `exclude`; it uses git history only. `test_guard` runs the offline anti-cheating check on the diff: skipped, focused or deleted tests, removed or commented assertions, raised timeouts, strict matchers replaced by existence checks, `@ts-ignore` and empty catch blocks; with `fail_on_weakening` a finding returns exit code 1. `env_sync` compares the environment variables added by the diff (`process.env`, `import.meta.env`, `Deno.env`, `Bun.env`) with the local `.env` files and `.env.example`/`.sample`/`.template`: missing definitions fail with `fail_on_missing`, and defined but undocumented variables warn. `mock_leak` scans added production code for forgotten stubs and hardcode: local paths, test tokens, `if (true)`/`if (false)`, mock/fake/stub identifiers, mock comments and localhost URLs; `fail_on_leak` returns exit code 1 at the chosen severity. `ecosystem_verify` checks that named imports from the changed files exist in the installed package entry or its `.d.ts`, and flags packages that are neither installed nor declared; with `online` it also checks the age and weekly downloads of newly added npm packages, and `fail_on_issue` returns exit code 1 at the chosen severity. `pack` builds a compact context bundle for a task: project rules, changed-file signatures, related references and an optional test log, capped by `budget` characters; it never edits files. `contract_drift` compares changed TypeScript interfaces, Zod objects, Prisma models, Pydantic models and JSON Schema with the previous version, flags removed or newly required fields and type changes, and reports untouched consumers that still use a removed field; `fail_on_drift` returns exit code 1 at the chosen severity. `anti_regression` compares the lines added by the diff with lines a human explicitly deleted in git history, cites the deleting commit and flags re-added code or imports; `fail_on_regression` returns exit code 1. `boundaries` checks added imports against `.oc-pilot/architecture.json` layer rules, reports the file, line, import and rule reason, and `fail_on_violation` returns exit code 1 when a layer boundary is crossed. `test_plan` selects the test files affected by the diff from a static import graph: changed tests, direct and transitive importers, naming matches and symbol references, with uncovered changed files reported and an optional `fail_on_uncovered` gate. `compliance_verify` checks a signed audit manifest for the current commit: SHA-256, commit, previous-manifest hash chain and optional Ed25519 signature; a missing, edited or broken manifest is a normal result with exit code 1. `brag` builds a self-contained HTML or SVG session report from stats, git history, the last review and the receipt; it uses inline assets only, never calls a model or the network, and `no_paths` hides file locations. `test_gen` asks the model for tests that cover the changed code; with `apply` it writes test files, runs the suite and reverts failing tests unless `keep_failing`, while `coverage` narrows generation to uncovered changed lines and `from_slop` picks untested files. `cleanup` builds an offline cleanup plan from dependency issues, the Slop Index, environment variables and weakened tests; `apply` performs only safe dependency fixes and needs `--allow-write`. `arch_diff` renders a Mermaid diagram of the internal imports the diff added and removed: green edges are new dependencies, red dashed edges are removed ones, and `fail_on_removed` returns exit code 1 when a dependency disappears. `roast` turns the diff into a technically grounded comedy roast in a chosen persona (linus, ramsay, corporate or default), cites file:line for every joke and ends with one real fix; it is model-backed and never edits files. `cinema` builds a terminal timelapse of the session from commits, runs, API calls, the last review and the receipt: a self-contained HTML player or an asciinema v2 cast, with no network, external assets or model call; `no_paths` hides subjects and finding locations. `bounty` scores every file from SAST findings, duplicated blocks, dead exports, aged TODOs and churn without tests, then renders an ASCII WANTED poster with the worst file and its reasons; deterministic and offline. `autopsy` performs a post-mortem on a commit: diff stats, SAST on added lines, weakened tests, mock leaks, ranked suspects and a before/after timeline; `fail_on_risk` returns exit 1 for a dangerous verdict. `echo` builds self-contained SVG badges from local stats, git history and the receipt (commits, agent runs, API calls, cache hits, findings and test status); `submit` sends only the nickname, window and aggregate numbers to an explicit `endpoint`, never paths, diffs or secrets, and there is no network by default. `sast` runs the deterministic static analysis over the change or over explicit `paths` and accepts `fail_on_issue`, `ignore` and `no_suppressions`; a finding at or above the gate is a normal result with exit code 1. `authz` checks route authorization over the change or explicit `paths` and accepts `fail_on_issue`, `ignore`, `public` and `no_suppressions`; a route finding at or above the gate is also a normal result with exit code 1. `preflight` returns one offline verdict over the planned change and accepts the same source flags (`diff`, `base`, `staged`, `unstaged`, `include_untracked`), plus `since`, `max_delta`, `fail_on_issue`, `no_secret_scan`, `no_sast`, `no_authz`, `no_deps`, `no_tests` and `no_slop`; a failed check is a normal result with `status: "fail"` and exit code 1, so the agent sees the failing check instead of a tool error. `ready` returns the offline agent readiness score 0-100 and accepts `fail_under`; a score below the threshold is also a normal result with exit code 1. `receipt_verify` recomputes the SHA-256 hash of the receipt, compares the recorded commit with HEAD and reports `ok`, `hashOk` and `stale`; a missing, edited or stale receipt is a normal result with `ok: false` and exit code 1, so an agent can see why the proof failed. The `fix` tool accepts `from_sast` and `from_authz` to repair security findings and rescan; the result then carries `sast` or `authz` with `{before, after, remaining}`. The server is read-only by default; start it with `--allow-write` to permit `fix` with `apply: true`, `commit` with `apply: true`, `test_fix` with a command, `stats` with `clear: true` and `mutate`, which rewrites source files temporarily. `test_gen` with `apply: true` also needs `--allow-write`. The `fix` result carries the unified `patch`, its `files` and `patchStats` (`additions`, `deletions`, `hunks`, `bytes`); patches over 200 000 characters are cut and marked with `patchTruncated` and `patchBytes`, so a host can show or apply the change without parsing the diff again.
|
|
947
|
+
Tools: `review`, `invariants`, `test_fix`, `fix`, `test_gen`, `docgen`, `custom`, `scan`, `commit`, `stats`, `slop`, `mutate`, `fuzz`, `bankruptcy`, `query_ast`, `sandbox`, `hivemind_status`, `flaky`, `impact`, `deps`, `coverage`, `reviewers`, `test_guard`, `env_sync`, `mock_leak`, `ecosystem_verify`, `pack`, `pack_hologram`, `zoom_symbol`, `contract_drift`, `anti_regression`, `boundaries`, `test_plan`, `compliance_verify`, `brag`, `battle`, `cleanup`, `arch_diff`, `roast`, `cinema`, `bounty`, `autopsy`, `echo`, `sast`, `authz`, `preflight`, `honeypot`, `alien_dna`, `hyper_chamber`, `butterfly`, `blindfold`, `apoptosis`, `ready`, `receipt_verify`. `scan` accepts `all: true` to sweep the whole repository instead of the diff. `slop` runs the offline Slop Index and accepts `since`, `since_days`, `limit`, `exclude` and `no_blame`. `mutate` runs mutation testing on the changed code, accepts `command`, `max_mutants` and `min_score`, and returns the score plus every surviving mutant; a score below `min_score` is a normal result with exit code 1. `flaky` runs the test command several times and compares per-test results, accepting `runs`, `command`, `fail_on_flaky`, `shuffle` and `seed`; it never edits source files itself but does run the project's tests. `impact` lists the declarations the diff changed or removed and every untouched file that still mentions them, accepting the same source flags; the search is textual, so comments and strings can match. `deps` audits declared, imported and locked dependencies, explains a chain with `why`, adds OSV vulnerabilities and licenses with `audit`, and can rewrite `package.json` with `fix` or emit a CycloneDX SBOM; `fix` and `sbom` write files. `coverage` compares changed lines with a local lcov, Istanbul, Cobertura or Go coverage report and returns uncovered lines, missing files and a gate on `fail_under` or `max_uncovered`. `reviewers` ranks the authors who touched the changed files, lists CODEOWNERS owners and accepts `limit`, `depth` and `exclude`; it uses git history only. `test_guard` runs the offline anti-cheating check on the diff: skipped, focused or deleted tests, removed or commented assertions, raised timeouts, strict matchers replaced by existence checks, `@ts-ignore` and empty catch blocks; with `fail_on_weakening` a finding returns exit code 1. `env_sync` compares the environment variables added by the diff (`process.env`, `import.meta.env`, `Deno.env`, `Bun.env`) with the local `.env` files and `.env.example`/`.sample`/`.template`: missing definitions fail with `fail_on_missing`, and defined but undocumented variables warn. `mock_leak` scans added production code for forgotten stubs and hardcode: local paths, test tokens, `if (true)`/`if (false)`, mock/fake/stub identifiers, mock comments and localhost URLs; `fail_on_leak` returns exit code 1 at the chosen severity. `ecosystem_verify` checks that named imports from the changed files exist in the installed package entry or its `.d.ts`, and flags packages that are neither installed nor declared; with `online` it also checks the age and weekly downloads of newly added npm packages, and `fail_on_issue` returns exit code 1 at the chosen severity. `pack` builds a compact context bundle for a task: project rules, changed-file signatures, related references and an optional test log, capped by `budget` characters; it never edits files. `contract_drift` compares changed TypeScript interfaces, Zod objects, Prisma models, Pydantic models and JSON Schema with the previous version, flags removed or newly required fields and type changes, and reports untouched consumers that still use a removed field; `fail_on_drift` returns exit code 1 at the chosen severity. `anti_regression` compares the lines added by the diff with lines a human explicitly deleted in git history, cites the deleting commit and flags re-added code or imports; `fail_on_regression` returns exit code 1. `boundaries` checks added imports against `.oc-pilot/architecture.json` layer rules, reports the file, line, import and rule reason, and `fail_on_violation` returns exit code 1 when a layer boundary is crossed. `test_plan` selects the test files affected by the diff from a static import graph: changed tests, direct and transitive importers, naming matches and symbol references, with uncovered changed files reported and an optional `fail_on_uncovered` gate. `compliance_verify` checks a signed audit manifest for the current commit: SHA-256, commit, previous-manifest hash chain and optional Ed25519 signature; a missing, edited or broken manifest is a normal result with exit code 1. `brag` builds a self-contained HTML or SVG session report from stats, git history, the last review and the receipt; it uses inline assets only, never calls a model or the network, and `no_paths` hides file locations. `test_gen` asks the model for tests that cover the changed code; with `apply` it writes test files, runs the suite and reverts failing tests unless `keep_failing`, while `coverage` narrows generation to uncovered changed lines and `from_slop` picks untested files. `cleanup` builds an offline cleanup plan from dependency issues, the Slop Index, environment variables and weakened tests; `apply` performs only safe dependency fixes and needs `--allow-write`. `arch_diff` renders a Mermaid diagram of the internal imports the diff added and removed: green edges are new dependencies, red dashed edges are removed ones, and `fail_on_removed` returns exit code 1 when a dependency disappears. `roast` turns the diff into a technically grounded comedy roast in a chosen persona (linus, ramsay, corporate or default), cites file:line for every joke and ends with one real fix; it is model-backed and never edits files. `cinema` builds a terminal timelapse of the session from commits, runs, API calls, the last review and the receipt: a self-contained HTML player or an asciinema v2 cast, with no network, external assets or model call; `no_paths` hides subjects and finding locations. `bounty` scores every file from SAST findings, duplicated blocks, dead exports, aged TODOs and churn without tests, then renders an ASCII WANTED poster with the worst file and its reasons; deterministic and offline. `autopsy` performs a post-mortem on a commit: diff stats, SAST on added lines, weakened tests, mock leaks, ranked suspects and a before/after timeline; `fail_on_risk` returns exit 1 for a dangerous verdict. `echo` builds self-contained SVG badges from local stats, git history and the receipt (commits, agent runs, API calls, cache hits, findings and test status); `submit` sends only the nickname, window and aggregate numbers to an explicit `endpoint`, never paths, diffs or secrets, and there is no network by default. `sast` runs the deterministic static analysis over the change or over explicit `paths` and accepts `fail_on_issue`, `ignore` and `no_suppressions`; a finding at or above the gate is a normal result with exit code 1. `authz` checks route authorization over the change or explicit `paths` and accepts `fail_on_issue`, `ignore`, `public` and `no_suppressions`; a route finding at or above the gate is also a normal result with exit code 1. `preflight` returns one offline verdict over the planned change and accepts the same source flags (`diff`, `base`, `staged`, `unstaged`, `include_untracked`), plus `since`, `max_delta`, `fail_on_issue`, `no_secret_scan`, `no_sast`, `no_authz`, `no_deps`, `no_tests` and `no_slop`; a failed check is a normal result with `status: "fail"` and exit code 1, so the agent sees the failing check instead of a tool error. `ready` returns the offline agent readiness score 0-100 and accepts `fail_under`; a score below the threshold is also a normal result with exit code 1. `receipt_verify` recomputes the SHA-256 hash of the receipt, compares the recorded commit with HEAD and reports `ok`, `hashOk` and `stale`; a missing, edited or stale receipt is a normal result with `ok: false` and exit code 1, so an agent can see why the proof failed. The `fix` tool accepts `from_sast` and `from_authz` to repair security findings and rescan; the result then carries `sast` or `authz` with `{before, after, remaining}`. The server is read-only by default; start it with `--allow-write` to permit `fix` with `apply: true`, `commit` with `apply: true`, `test_fix` with a command, `stats` with `clear: true` and `mutate`, which rewrites source files temporarily. `test_gen` with `apply: true` also needs `--allow-write`. The `fix` result carries the unified `patch`, its `files` and `patchStats` (`additions`, `deletions`, `hunks`, `bytes`); patches over 200 000 characters are cut and marked with `patchTruncated` and `patchBytes`, so a host can show or apply the change without parsing the diff again.
|
|
948
948
|
|
|
949
949
|
`invariants` checks the diff against `.oc-pilot/invariants.md`
|
|
950
950
|
|
|
@@ -959,6 +959,10 @@ Tools: `review`, `invariants`, `test_fix`, `fix`, `test_gen`, `docgen`, `custom`
|
|
|
959
959
|
`hyper-chamber run <file>` ages one self-contained JavaScript or ESM file in `node:vm`: it fakes `Date.now`, accelerates timers, forces GC and samples the heap through `node:v8` while simulating up to a year of uptime in a short real budget. Sustained growth returns `[MEMORY LEAK DETECTED]: AI code survives Day 1, but crashes on Day N of simulated uptime.` The file must export `run`, `tick`, `main` or `default`; a plain script is wrapped and re-executed. This is a deterministic heuristic, not a proof, and native code is not supported.
|
|
960
960
|
`butterfly` runs the project test command under deterministic local chaos: `fetch` can return HTTP 500, add latency or broken JSON, and `fs` can return `EIO` for code under `--scope` (default `src/`). It reports injected fault counts, exit code and output tail; the test runner and `node_modules` are excluded by a stack filter, and database driver patching is best-effort. This is a test aid, not an OS sandbox.
|
|
961
961
|
|
|
962
|
+
`blindfold` obfuscates identifiers (`calculateDiscount(user)` becomes `fn_A(var_B)`) and sends only the stripped code to the model, asking for a strict JSON verdict. It fails with `[BLINDFOLD REJECTED]` when the model cannot explain the logic, finds a vulnerability, or confidence is below `--min-confidence`; `--dry-run` prints the mapping without a model call. It is a blind review, not a mathematical proof.
|
|
963
|
+
|
|
964
|
+
`apoptosis` scans functions marked `/* @lifespan: 30d */`. When the marker is older than the lifespan and the symbol has no references, it reports `[Senescent]`; `apoptosis apply --confirm` comments those functions out in a shadow git worktree, runs the test command and lands the diff only if the suite is green. A failed run leaves the working tree untouched. It is a cleanup workflow for AI-written code, not an automatic guarantee that the function is unused at runtime.
|
|
965
|
+
|
|
962
966
|
`query` runs a chainable AQL query against a lightweight code graph: `find(File|Function|Class|Import|CallExpression).where(field, value).sort(field).limit(n).select(fields...).count()`. It is not SQL and not a full TypeScript AST; it is a fast textual graph that the agent can probe before editing. MCP exposes it as `query_ast`.
|
|
963
967
|
|
|
964
968
|
`bankruptcy` forecasts technical debt from commit history: it scores each commit by weakened tests, SAST high/medium findings, added TODOs, churn and a slop proxy, smooths the daily series with a 14-day moving average, drops outliers and fits a linear regression. The output is the current score, slope, forecast date and a self-contained SVG chart; fewer than 10 commits returns `[INSUFFICIENT DATA: Need at least 10 commits to compute Slop Velocity]`. `--explain` prints the exact weights, where test weakening (0.35) and security (0.30) dominate.
|
|
@@ -969,9 +973,9 @@ Tools: `review`, `invariants`, `test_fix`, `fix`, `test_gen`, `docgen`, `custom`
|
|
|
969
973
|
|
|
970
974
|
`pack --hologram` builds a layered context instead of dumping the repository: LOD 0 keeps diff files complete, LOD 1 hides function bodies behind `body hidden` markers with `EFFECTS` hints and adds matching tests, LOD 2 lists export names only. Unbalanced braces fall back to full text with `[Hologram: parse bailout]`, and the final Markdown is secret-scanned. `zoom-symbol <file> <symbol>` returns one hidden body on demand; `pack_hologram` and `zoom_symbol` expose the same flow over MCP.
|
|
971
975
|
|
|
972
|
-
Every tool accepts `max_findings` (default 50; a capped result also carries `truncated` and `totalFindings`) and `verbosity` (`full` returns the JSON payload, `compact` returns a one-line summary and keeps the same data in `structuredContent`). When a client sends `_meta.progressToken`, the server emits `notifications/progress`; after `logging/setLevel` it also emits `notifications/message` per call. `--max-calls <n>` (or `OC_PILOT_MCP_MAX_CALLS`) caps model-backed calls per session, `0` disables the cap, and the offline tools `scan`, `fuzz`, `bankruptcy`, `query_ast`, `sandbox`, `hivemind_status`, `stats`, `slop`, `flaky`, `impact`, `deps`, `coverage`, `reviewers`, `test_guard`, `env_sync`, `mock_leak`, `ecosystem_verify`, `pack`, `pack_hologram`, `zoom_symbol`, `contract_drift`, `anti_regression`, `boundaries`, `test_plan`, `compliance_verify`, `brag`, `cleanup`, `arch_diff`, `roast`, `cinema`, `bounty`, `autopsy`, `echo`, `sast`, `authz`, `preflight`, `honeypot`, `alien_dna`, `hyper_chamber`, `butterfly`, `ready` and `receipt_verify` keep working after the budget is exhausted.
|
|
976
|
+
Every tool accepts `max_findings` (default 50; a capped result also carries `truncated` and `totalFindings`) and `verbosity` (`full` returns the JSON payload, `compact` returns a one-line summary and keeps the same data in `structuredContent`). When a client sends `_meta.progressToken`, the server emits `notifications/progress`; after `logging/setLevel` it also emits `notifications/message` per call. `--max-calls <n>` (or `OC_PILOT_MCP_MAX_CALLS`) caps model-backed calls per session, `0` disables the cap, and the offline tools `scan`, `fuzz`, `bankruptcy`, `query_ast`, `sandbox`, `hivemind_status`, `stats`, `slop`, `flaky`, `impact`, `deps`, `coverage`, `reviewers`, `test_guard`, `env_sync`, `mock_leak`, `ecosystem_verify`, `pack`, `pack_hologram`, `zoom_symbol`, `contract_drift`, `anti_regression`, `boundaries`, `test_plan`, `compliance_verify`, `brag`, `cleanup`, `arch_diff`, `roast`, `cinema`, `bounty`, `autopsy`, `echo`, `sast`, `authz`, `preflight`, `honeypot`, `alien_dna`, `hyper_chamber`, `butterfly`, `apoptosis`, `ready` and `receipt_verify` keep working after the budget is exhausted.
|
|
973
977
|
|
|
974
|
-
Ready-made prompts are advertised through `prompts/list` and rendered by `prompts/get`, so a host can offer them in its own menu: `review-my-diff` (optional `context`), `fix-failing-tests` (optional `log`), `pre-commit-gate` (scan, review and commit in one pass), `secure-change` (security-focused review), `slop-check` (entropy check for vibe-coded changes) and `preflight-before-commit` (run the offline gate, fix the cheapest failing check, rerun until the verdict is pass), `deploy-honeypot` (deploy decoy files, run preflight, stop on `[HONEYPOT TRIGGERED]` and remove the decoys when done), `check-alien-dna` (compare the diff with the architecture DNA at HEAD, stop on `[ALIEN DNA DETECTED]` and ask before adopting a new pattern), `stress-the-chamber` (age a generated JS/ESM file in node:vm, simulate a year of uptime, stop on `[MEMORY LEAK DETECTED]` and treat a clean run as a heuristic rather than proof), `release-the-butterfly` (run the test command under deterministic chaos: fetch 500s, latency and broken JSON, fs EIO under the scope, then report injected faults and whether the suite survived), `compile-hologram` (build a layered hologram, keep LOD 0 complete, treat hidden LOD 1 bodies as unknown and call `zoom_symbol` before reasoning about them), `check-invariants` (check the change against `.oc-pilot/invariants.md`, explain every violation with file:line and never hide a CRITICAL rule), `fuzz-the-diff` (call the new exports with hostile inputs in isolated processes, fix every crash and never count blocked targets as tested), `forecast-tech-debt` (read the tech-debt trend, explain the score and weights, and use the forecast date to plan repayment instead of gaming TODO counts), `query-the-ast` (locate calls, functions, classes and imports with AQL, verify each hit in the source and use the evidence to plan a refactor), `sandbox-script` (run a generated JS/ESM file in node:vm with imports and side effects blocked, then report its output and exact status), `join-the-swarm` (check the hivemind identity and trusted peers, then exchange only diffs, AST and LLM requests over the encrypted mesh; never send executable commands), `get-ready` (score the repository, fix the safe gaps, prove the result with a receipt and rerun until the score is at least 85), `fix-security` (repair SAST or route-authorization findings and rescan until no high findings remain), `stabilize-flaky` (reproduce a flaky test with repeated and shuffled runs and make the smallest deterministic fix), `check-impact` (find external references to changed declarations, update what the change broke and rerun until no stale references remain), `triage-deps` (audit dependencies and OSV vulnerabilities, fix the cheapest issue first and rerun without hiding findings), `cover-changed-lines` (add tests for the changed lines that no test executed and rerun the same gate), `generate-tests` (generate tests for the change or its uncovered lines, apply them, run the suite and iterate until green), `pick-reviewers` (choose the smallest set of reviewers who know the changed files, with evidence from history and CODEOWNERS), `guard-tests` (find tests the change skipped, weakened or deleted, restore their protection and rerun until the guard passes), `sync-env` (compare the environment variables added by the change with `.env` and `.env.example`, add the missing definitions and document them without inventing secrets), `remove-mocks` (find forgotten mocks, local paths, test tokens and always-true conditions in production code, replace them with the real implementation and rerun until the leak report is clean), `verify-ecosystem` (check that imports exist in installed packages and that new npm packages are not brand new with a handful of downloads, and do not install a suspicious package without a human decision), `pack-context` (build a compact task bundle of rules, signatures, references and test log and use it instead of dumping whole files), `check-contracts` (find removed or narrowed fields in changed types and schemas, update every remaining consumer without silently breaking callers), `guard-regressions` (compare added lines with code a human deleted, inspect the deleting commit and do not re-add it without an explicit decision), `respect-boundaries` (check added imports against the layer rules, fix the dependency direction and rerun until no boundary is crossed), `plan-tests` (run the affected-test plan, run only those tests, add a test for every uncovered changed file and rerun without widening the strategy), `prove-compliance` (verify the signed audit manifest for HEAD, check the hash chain and signature, and never claim completion while the manifest is invalid), `cleanup-plan` (build an offline cleanup plan and apply only safe dependency fixes), `show-arch-diff` (render a Mermaid diagram of the internal imports the change adds and removes), `roast-my-code` (roast the diff in a chosen persona, cite file:line and end with one real fix), `play-session` (build a terminal timelapse of the session as a self-contained HTML player or an asciinema cast), `wanted-poster` (post a WANTED poster for the worst file, explain its reasons and the highest-weight fix, and rerun after the fix), `autopsy-commit` (run a post-mortem on a commit, list its signals, rank the suspects, read the before/after timeline and propose the smallest fix and the test that would have caught it), `share-progress` (build local SVG badges and, only with explicit approval, submit the anonymous aggregate payload to the given endpoint), `prove-tests` (run mutation testing on the change and strengthen the tests until the mutation score is at least 80) and `prove-done` (verify the receipt for HEAD, create a fresh one when it is missing or stale, and refuse to claim completion until `ok` is true and the tests in the receipt passed).
|
|
978
|
+
Ready-made prompts are advertised through `prompts/list` and rendered by `prompts/get`, so a host can offer them in its own menu: `review-my-diff` (optional `context`), `fix-failing-tests` (optional `log`), `pre-commit-gate` (scan, review and commit in one pass), `secure-change` (security-focused review), `slop-check` (entropy check for vibe-coded changes) and `preflight-before-commit` (run the offline gate, fix the cheapest failing check, rerun until the verdict is pass), `deploy-honeypot` (deploy decoy files, run preflight, stop on `[HONEYPOT TRIGGERED]` and remove the decoys when done), `check-alien-dna` (compare the diff with the architecture DNA at HEAD, stop on `[ALIEN DNA DETECTED]` and ask before adopting a new pattern), `stress-the-chamber` (age a generated JS/ESM file in node:vm, simulate a year of uptime, stop on `[MEMORY LEAK DETECTED]` and treat a clean run as a heuristic rather than proof), `release-the-butterfly` (run the test command under deterministic chaos: fetch 500s, latency and broken JSON, fs EIO under the scope, then report injected faults and whether the suite survived), `interrogate-the-blindfold` (obfuscate added code, ask the model for a strict JSON verdict, stop on `[BLINDFOLD REJECTED]`, fix the real code path, never reveal original names or raise the threshold to force a pass), `prune-senescent-code` (scan expired `@lifespan` markers, report every `[Senescent]` candidate with file, age and references, and apply only with explicit approval and a green test run), `compile-hologram` (build a layered hologram, keep LOD 0 complete, treat hidden LOD 1 bodies as unknown and call `zoom_symbol` before reasoning about them), `check-invariants` (check the change against `.oc-pilot/invariants.md`, explain every violation with file:line and never hide a CRITICAL rule), `fuzz-the-diff` (call the new exports with hostile inputs in isolated processes, fix every crash and never count blocked targets as tested), `forecast-tech-debt` (read the tech-debt trend, explain the score and weights, and use the forecast date to plan repayment instead of gaming TODO counts), `query-the-ast` (locate calls, functions, classes and imports with AQL, verify each hit in the source and use the evidence to plan a refactor), `sandbox-script` (run a generated JS/ESM file in node:vm with imports and side effects blocked, then report its output and exact status), `join-the-swarm` (check the hivemind identity and trusted peers, then exchange only diffs, AST and LLM requests over the encrypted mesh; never send executable commands), `get-ready` (score the repository, fix the safe gaps, prove the result with a receipt and rerun until the score is at least 85), `fix-security` (repair SAST or route-authorization findings and rescan until no high findings remain), `stabilize-flaky` (reproduce a flaky test with repeated and shuffled runs and make the smallest deterministic fix), `check-impact` (find external references to changed declarations, update what the change broke and rerun until no stale references remain), `triage-deps` (audit dependencies and OSV vulnerabilities, fix the cheapest issue first and rerun without hiding findings), `cover-changed-lines` (add tests for the changed lines that no test executed and rerun the same gate), `generate-tests` (generate tests for the change or its uncovered lines, apply them, run the suite and iterate until green), `pick-reviewers` (choose the smallest set of reviewers who know the changed files, with evidence from history and CODEOWNERS), `guard-tests` (find tests the change skipped, weakened or deleted, restore their protection and rerun until the guard passes), `sync-env` (compare the environment variables added by the change with `.env` and `.env.example`, add the missing definitions and document them without inventing secrets), `remove-mocks` (find forgotten mocks, local paths, test tokens and always-true conditions in production code, replace them with the real implementation and rerun until the leak report is clean), `verify-ecosystem` (check that imports exist in installed packages and that new npm packages are not brand new with a handful of downloads, and do not install a suspicious package without a human decision), `pack-context` (build a compact task bundle of rules, signatures, references and test log and use it instead of dumping whole files), `check-contracts` (find removed or narrowed fields in changed types and schemas, update every remaining consumer without silently breaking callers), `guard-regressions` (compare added lines with code a human deleted, inspect the deleting commit and do not re-add it without an explicit decision), `respect-boundaries` (check added imports against the layer rules, fix the dependency direction and rerun until no boundary is crossed), `plan-tests` (run the affected-test plan, run only those tests, add a test for every uncovered changed file and rerun without widening the strategy), `prove-compliance` (verify the signed audit manifest for HEAD, check the hash chain and signature, and never claim completion while the manifest is invalid), `cleanup-plan` (build an offline cleanup plan and apply only safe dependency fixes), `show-arch-diff` (render a Mermaid diagram of the internal imports the change adds and removes), `roast-my-code` (roast the diff in a chosen persona, cite file:line and end with one real fix), `play-session` (build a terminal timelapse of the session as a self-contained HTML player or an asciinema cast), `wanted-poster` (post a WANTED poster for the worst file, explain its reasons and the highest-weight fix, and rerun after the fix), `autopsy-commit` (run a post-mortem on a commit, list its signals, rank the suspects, read the before/after timeline and propose the smallest fix and the test that would have caught it), `share-progress` (build local SVG badges and, only with explicit approval, submit the anonymous aggregate payload to the given endpoint), `prove-tests` (run mutation testing on the change and strengthen the tests until the mutation score is at least 80) and `prove-done` (verify the receipt for HEAD, create a fresh one when it is missing or stale, and refuse to claim completion until `ok` is true and the tests in the receipt passed).
|
|
975
979
|
|
|
976
980
|
Configure a client automatically:
|
|
977
981
|
|
|
@@ -990,7 +994,7 @@ Start the server manually with an explicit project directory:
|
|
|
990
994
|
```bash
|
|
991
995
|
oc-pilot-mcp --cwd /absolute/path/to/project
|
|
992
996
|
# pinned for reproducibility:
|
|
993
|
-
npx -y oc-pilot@0.
|
|
997
|
+
npx -y oc-pilot@0.94.0 mcp --cwd /absolute/path/to/project
|
|
994
998
|
```
|
|
995
999
|
|
|
996
1000
|
The `diff` and `log` tool arguments are text, not file paths. `paths` and `files` are project-relative and cannot escape the project directory. `context` is literal text, not an `@file` reference. `base` must be a git ref. `lang`, `fail_on`, `repo_context`, and `no_secret_scan` are available where the corresponding CLI command supports them.
|
|
@@ -1165,7 +1169,7 @@ jobs:
|
|
|
1165
1169
|
- uses: actions/checkout@v4
|
|
1166
1170
|
with:
|
|
1167
1171
|
fetch-depth: 0
|
|
1168
|
-
- uses: MyNameIsNikki/oc-pilot@v0.
|
|
1172
|
+
- uses: MyNameIsNikki/oc-pilot@v0.94.0
|
|
1169
1173
|
with:
|
|
1170
1174
|
command: scan
|
|
1171
1175
|
args: --base origin/${{ github.base_ref }} --fail-on-secrets
|
|
@@ -1188,7 +1192,7 @@ jobs:
|
|
|
1188
1192
|
- uses: actions/setup-node@v4
|
|
1189
1193
|
with:
|
|
1190
1194
|
node-version: 22
|
|
1191
|
-
- run: npm install -g https://github.com/MyNameIsNikki/oc-pilot/archive/refs/tags/v0.
|
|
1195
|
+
- run: npm install -g https://github.com/MyNameIsNikki/oc-pilot/archive/refs/tags/v0.94.0.tar.gz
|
|
1192
1196
|
- run: oc-pilot scan --base origin/${{ github.base_ref }}
|
|
1193
1197
|
- run: oc-pilot review --base origin/${{ github.base_ref }} --fail-on warning --fail-on-secrets --github
|
|
1194
1198
|
env:
|
package/README.ru.md
CHANGED
|
@@ -907,7 +907,7 @@ oc-pilot setup --client cursor --global
|
|
|
907
907
|
|
|
908
908
|
ZCode импортирует серверы из Claude Code, Codex, OpenCode и `.agents`, либо пишет нативный конфиг через `oc-pilot setup --client zcode`.
|
|
909
909
|
|
|
910
|
-
Инструменты: `review`, `invariants`, `test_fix`, `fix`, `test_gen`, `docgen`, `custom`, `scan`, `commit`, `stats`, `slop`, `mutate`, `fuzz`, `bankruptcy`, `query_ast`, `sandbox`, `hivemind_status`, `flaky`, `impact`, `deps`, `coverage`, `reviewers`, `test_guard`, `env_sync`, `mock_leak`, `ecosystem_verify`, `pack`, `pack_hologram`, `zoom_symbol`, `contract_drift`, `anti_regression`, `boundaries`, `test_plan`, `compliance_verify`, `brag`, `battle`, `cleanup`, `arch_diff`, `roast`, `cinema`, `bounty`, `autopsy`, `echo`, `sast`, `authz`, `preflight`, `honeypot`, `alien_dna`, `hyper_chamber`, `butterfly`, `ready`, `receipt_verify`. У `scan` есть `all: true` — проверка всего репозитория, а не diff. `slop` запускает офлайн Slop Index и принимает `since`, `since_days`, `limit`, `exclude` и `no_blame`. `mutate` прогоняет мутационное тестирование по изменённому коду, принимает `command`, `max_mutants` и `min_score` и возвращает оценку и всех выживших мутантов; оценка ниже `min_score` — обычный результат с кодом 1. `flaky` несколько раз запускает тестовую команду и сравнивает результаты отдельных тестов, принимая `runs`, `command`, `fail_on_flaky`, `shuffle` и `seed`; сам он файлы не меняет, но запускает тесты проекта. `impact` показывает, какие объявления diff изменил или удалил и в каких нетронутых файлах эти имена ещё встречаются; принимает те же флаги источника, а поиск текстовый, поэтому совпадения в комментариях и строках возможны. `deps` проверяет объявленные, импортируемые и залоченные зависимости, `why` объясняет цепочку, `audit` добавляет уязвимости OSV и лицензии, `fix` правит `package.json`, а `sbom` пишет CycloneDX; `fix` и `sbom` пишут файлы и требуют `--allow-write`. `coverage` сверяет изменённые строки с локальным отчётом lcov, Istanbul, Cobertura или Go и возвращает непокрытые строки, файлы без данных и гейт по `fail_under` или `max_uncovered`. `reviewers` ранжирует авторов, которые трогали изменённые файлы, показывает владельцев из CODEOWNERS и принимает `limit`, `depth` и `exclude`; используется только история git. `test_guard` запускает офлайн-проверку на ослабление тестов: пропущенные, сфокусированные или удалённые тесты, удалённые и закомментированные проверки, поднятые таймауты, строгие матчеры, заменённые проверкой существования, `@ts-ignore` и пустые catch; с `fail_on_weakening` находка даёт код 1. `env_sync` сверяет переменные окружения, добавленные diff (`process.env`, `import.meta.env`, `Deno.env`, `Bun.env`), с локальными `.env` и `.env.example`/`.sample`/`.template`: отсутствие определения даёт fail с `fail_on_missing`, а определённые, но не задокументированные переменные — warn. `mock_leak` ищет забытые заглушки и хардкод в добавленном прод-коде: локальные пути, тестовые токены, `if (true)`/`if (false)`, имена mock/fake/stub, комментарии про заглушки и localhost-адреса; `fail_on_leak` даёт код 1 на выбранном уровне. `ecosystem_verify` проверяет, что именованные импорты из изменённых файлов существуют в установленном пакете или его `.d.ts`, и ищет пакеты, которых нет ни в `node_modules`, ни в `package.json`; с `online` дополнительно смотрит возраст и недельные загрузки новых npm-пакетов, а `fail_on_issue` даёт код 1 на выбранном уровне. `pack` собирает компактный контекст задачи: правила проекта, подписи изменённых файлов, связанные ссылки и необязательный лог тестов, с ограничением `budget` в символах; файлы не меняет. `contract_drift` сравнивает изменённые TypeScript-интерфейсы, Zod-объекты, Prisma-модели, Pydantic-модели и JSON Schema с предыдущей версией, находит удалённые поля, ставшие обязательными поля и смену типов и показывает нетронутые файлы, где удалённое поле ещё используется; `fail_on_drift` даёт код 1 на выбранной строгости. `anti_regression` сравнивает строки, добавленные diff, со строками, которые человек явно удалил в истории git, указывает коммит-удаление и ловит повторно добавленный код или импорты; `fail_on_regression` даёт код 1. `boundaries` проверяет добавленные импорты по правилам слоёв из `.oc-pilot/architecture.json`, показывает файл, строку, импорт и причину правила, а `fail_on_violation` даёт код 1 при пересечении границы слоя. `test_plan` выбирает тестовые файлы, затронутые diff, по статическому графу импортов: изменённые тесты, прямые и транзитивные импортёры, совпадения по имени и ссылки на символы; непокрытые изменённые файлы попадают в отчёт, а `fail_on_uncovered` даёт код 1. `compliance_verify` проверяет подписанный аудит-манифест текущего коммита: SHA-256, коммит, цепочку хешей предыдущих манифестов и необязательную подпись Ed25519; отсутствующий, изменённый или разорванный манифест — обычный результат с кодом 1. `test_gen` просит модель написать тесты на изменённый код; с `apply` он пишет файлы, прогоняет тесты и откатывает падения, если не указан `keep_failing`; `coverage` сужает генерацию до непокрытых изменённых строк, а `from_slop` выбирает файлы без тестов. `brag` собирает самодостаточный HTML/SVG-отчёт о сессии из статистики, истории git, последнего ревью и квитанции; только встроенные ресурсы, без модели и сети, `no_paths` скрывает пути. `battle` запускает экспериментальный цикл Coder/Hacker: кодер предлагает патч, хакер делает ревью и прогоняет SAST, авторизацию и проверку ослабления тестов, а цикл останавливается только когда high-находок нет и тесты проходят; `apply` требует `--allow-write`. `cleanup` собирает офлайн-план уборки из проблем зависимостей, Slop Index, переменных окружения и ослабленных тестов; `apply` выполняет только безопасные исправления зависимостей и требует `--allow-write`. `arch_diff` рисует Mermaid-схему внутренних импортов, которые diff добавил или удалил: зелёные стрелки — новые зависимости, красные пунктирные — удалённые, а `fail_on_removed` даёт код 1, когда зависимость исчезла. `roast` превращает diff в технически обоснованную прожарку в выбранной роли (linus, ramsay, corporate или default), ссылается на file:line для каждой шутки и заканчивает одним реальным фиксом; вызывает модель и не меняет файлы. `cinema` собирает терминальный таймлапс сессии из коммитов, запусков, вызовов API, последнего ревью и квитанции: самодостаточный HTML-плеер или asciinema v2 cast, без сети, внешних ресурсов и вызова модели; `no_paths` скрывает темы коммитов и места находок. `bounty` оценивает каждый файл по находкам SAST, дубликатам, мёртвым экспортам, старым TODO и churn без тестов и рисует ASCII-плакат WANTED с худшим файлом и причинами; детерминированно и офлайн. `autopsy` разбирает коммит как детектив: статистика diff, SAST по добавленным строкам, ослабленные тесты, утечки заглушек, рейтинг подозреваемых и хронология до/после; `fail_on_risk` даёт код 1 при опасном вердикте. `echo` собирает самодостаточные SVG-бейджи из локальной статистики, истории git и квитанции (коммиты, запуски агента, вызовы API, попадания в кеш, находки и статус тестов); `submit` отправляет на явный `endpoint` только ник, окно и агрегаты, без путей, diff и секретов, а по умолчанию сети нет. `sast` запускает детерминированный статический анализ по изменению или по явным `paths` и принимает `fail_on_issue`, `ignore` и `no_suppressions`; находка на уровне порога или выше — обычный результат с кодом 1. `authz` проверяет авторизацию маршрутов по изменению или явным `paths` и принимает `fail_on_issue`, `ignore`, `public` и `no_suppressions`; находка маршрута на уровне порога или выше — тоже обычный результат с кодом 1. `preflight` возвращает один офлайн-вердикт по планируемому изменению и принимает те же флаги источника (`diff`, `base`, `staged`, `unstaged`, `include_untracked`), плюс `since`, `max_delta`, `fail_on_issue`, `no_secret_scan`, `no_sast`, `no_authz`, `no_deps`, `no_tests` и `no_slop`; проваленная проверка — обычный результат со `status: "fail"` и кодом 1, а не ошибка инструмента, чтобы агент видел, какая именно проверка упала. `ready` возвращает офлайн-оценку готовности 0–100 и принимает `fail_under`; оценка ниже порога — тоже обычный результат с кодом 1. `receipt_verify` пересчитывает SHA-256 квитанции, сверяет записанный коммит с HEAD и возвращает `ok`, `hashOk` и `stale`; отсутствующая, изменённая или устаревшая квитанция — обычный результат с `ok: false` и кодом 1, чтобы агент видел, почему доказательство не прошло. Инструмент `fix` принимает `from_sast` и `from_authz`, чтобы чинить находки безопасности и пересканировать; результат тогда содержит `sast` или `authz` с `{before, after, remaining}`. Сервер по умолчанию read-only: `--allow-write` разрешает `fix` с `apply: true`, `commit` с `apply: true`, `test_fix` с командой, `stats` с `clear: true` и `mutate`, который временно перезаписывает исходники. Результат `fix` содержит unified-патч, список `files` и `patchStats` (`additions`, `deletions`, `hunks`, `bytes`); патчи длиннее 200 000 символов обрезаются с флагами `patchTruncated` и `patchBytes`, чтобы хост мог показать или применить изменение, не разбирая diff заново.
|
|
910
|
+
Инструменты: `review`, `invariants`, `test_fix`, `fix`, `test_gen`, `docgen`, `custom`, `scan`, `commit`, `stats`, `slop`, `mutate`, `fuzz`, `bankruptcy`, `query_ast`, `sandbox`, `hivemind_status`, `flaky`, `impact`, `deps`, `coverage`, `reviewers`, `test_guard`, `env_sync`, `mock_leak`, `ecosystem_verify`, `pack`, `pack_hologram`, `zoom_symbol`, `contract_drift`, `anti_regression`, `boundaries`, `test_plan`, `compliance_verify`, `brag`, `battle`, `cleanup`, `arch_diff`, `roast`, `cinema`, `bounty`, `autopsy`, `echo`, `sast`, `authz`, `preflight`, `honeypot`, `alien_dna`, `hyper_chamber`, `butterfly`, `blindfold`, `apoptosis`, `ready`, `receipt_verify`. У `scan` есть `all: true` — проверка всего репозитория, а не diff. `slop` запускает офлайн Slop Index и принимает `since`, `since_days`, `limit`, `exclude` и `no_blame`. `mutate` прогоняет мутационное тестирование по изменённому коду, принимает `command`, `max_mutants` и `min_score` и возвращает оценку и всех выживших мутантов; оценка ниже `min_score` — обычный результат с кодом 1. `flaky` несколько раз запускает тестовую команду и сравнивает результаты отдельных тестов, принимая `runs`, `command`, `fail_on_flaky`, `shuffle` и `seed`; сам он файлы не меняет, но запускает тесты проекта. `impact` показывает, какие объявления diff изменил или удалил и в каких нетронутых файлах эти имена ещё встречаются; принимает те же флаги источника, а поиск текстовый, поэтому совпадения в комментариях и строках возможны. `deps` проверяет объявленные, импортируемые и залоченные зависимости, `why` объясняет цепочку, `audit` добавляет уязвимости OSV и лицензии, `fix` правит `package.json`, а `sbom` пишет CycloneDX; `fix` и `sbom` пишут файлы и требуют `--allow-write`. `coverage` сверяет изменённые строки с локальным отчётом lcov, Istanbul, Cobertura или Go и возвращает непокрытые строки, файлы без данных и гейт по `fail_under` или `max_uncovered`. `reviewers` ранжирует авторов, которые трогали изменённые файлы, показывает владельцев из CODEOWNERS и принимает `limit`, `depth` и `exclude`; используется только история git. `test_guard` запускает офлайн-проверку на ослабление тестов: пропущенные, сфокусированные или удалённые тесты, удалённые и закомментированные проверки, поднятые таймауты, строгие матчеры, заменённые проверкой существования, `@ts-ignore` и пустые catch; с `fail_on_weakening` находка даёт код 1. `env_sync` сверяет переменные окружения, добавленные diff (`process.env`, `import.meta.env`, `Deno.env`, `Bun.env`), с локальными `.env` и `.env.example`/`.sample`/`.template`: отсутствие определения даёт fail с `fail_on_missing`, а определённые, но не задокументированные переменные — warn. `mock_leak` ищет забытые заглушки и хардкод в добавленном прод-коде: локальные пути, тестовые токены, `if (true)`/`if (false)`, имена mock/fake/stub, комментарии про заглушки и localhost-адреса; `fail_on_leak` даёт код 1 на выбранном уровне. `ecosystem_verify` проверяет, что именованные импорты из изменённых файлов существуют в установленном пакете или его `.d.ts`, и ищет пакеты, которых нет ни в `node_modules`, ни в `package.json`; с `online` дополнительно смотрит возраст и недельные загрузки новых npm-пакетов, а `fail_on_issue` даёт код 1 на выбранном уровне. `pack` собирает компактный контекст задачи: правила проекта, подписи изменённых файлов, связанные ссылки и необязательный лог тестов, с ограничением `budget` в символах; файлы не меняет. `contract_drift` сравнивает изменённые TypeScript-интерфейсы, Zod-объекты, Prisma-модели, Pydantic-модели и JSON Schema с предыдущей версией, находит удалённые поля, ставшие обязательными поля и смену типов и показывает нетронутые файлы, где удалённое поле ещё используется; `fail_on_drift` даёт код 1 на выбранной строгости. `anti_regression` сравнивает строки, добавленные diff, со строками, которые человек явно удалил в истории git, указывает коммит-удаление и ловит повторно добавленный код или импорты; `fail_on_regression` даёт код 1. `boundaries` проверяет добавленные импорты по правилам слоёв из `.oc-pilot/architecture.json`, показывает файл, строку, импорт и причину правила, а `fail_on_violation` даёт код 1 при пересечении границы слоя. `test_plan` выбирает тестовые файлы, затронутые diff, по статическому графу импортов: изменённые тесты, прямые и транзитивные импортёры, совпадения по имени и ссылки на символы; непокрытые изменённые файлы попадают в отчёт, а `fail_on_uncovered` даёт код 1. `compliance_verify` проверяет подписанный аудит-манифест текущего коммита: SHA-256, коммит, цепочку хешей предыдущих манифестов и необязательную подпись Ed25519; отсутствующий, изменённый или разорванный манифест — обычный результат с кодом 1. `test_gen` просит модель написать тесты на изменённый код; с `apply` он пишет файлы, прогоняет тесты и откатывает падения, если не указан `keep_failing`; `coverage` сужает генерацию до непокрытых изменённых строк, а `from_slop` выбирает файлы без тестов. `brag` собирает самодостаточный HTML/SVG-отчёт о сессии из статистики, истории git, последнего ревью и квитанции; только встроенные ресурсы, без модели и сети, `no_paths` скрывает пути. `battle` запускает экспериментальный цикл Coder/Hacker: кодер предлагает патч, хакер делает ревью и прогоняет SAST, авторизацию и проверку ослабления тестов, а цикл останавливается только когда high-находок нет и тесты проходят; `apply` требует `--allow-write`. `cleanup` собирает офлайн-план уборки из проблем зависимостей, Slop Index, переменных окружения и ослабленных тестов; `apply` выполняет только безопасные исправления зависимостей и требует `--allow-write`. `arch_diff` рисует Mermaid-схему внутренних импортов, которые diff добавил или удалил: зелёные стрелки — новые зависимости, красные пунктирные — удалённые, а `fail_on_removed` даёт код 1, когда зависимость исчезла. `roast` превращает diff в технически обоснованную прожарку в выбранной роли (linus, ramsay, corporate или default), ссылается на file:line для каждой шутки и заканчивает одним реальным фиксом; вызывает модель и не меняет файлы. `cinema` собирает терминальный таймлапс сессии из коммитов, запусков, вызовов API, последнего ревью и квитанции: самодостаточный HTML-плеер или asciinema v2 cast, без сети, внешних ресурсов и вызова модели; `no_paths` скрывает темы коммитов и места находок. `bounty` оценивает каждый файл по находкам SAST, дубликатам, мёртвым экспортам, старым TODO и churn без тестов и рисует ASCII-плакат WANTED с худшим файлом и причинами; детерминированно и офлайн. `autopsy` разбирает коммит как детектив: статистика diff, SAST по добавленным строкам, ослабленные тесты, утечки заглушек, рейтинг подозреваемых и хронология до/после; `fail_on_risk` даёт код 1 при опасном вердикте. `echo` собирает самодостаточные SVG-бейджи из локальной статистики, истории git и квитанции (коммиты, запуски агента, вызовы API, попадания в кеш, находки и статус тестов); `submit` отправляет на явный `endpoint` только ник, окно и агрегаты, без путей, diff и секретов, а по умолчанию сети нет. `sast` запускает детерминированный статический анализ по изменению или по явным `paths` и принимает `fail_on_issue`, `ignore` и `no_suppressions`; находка на уровне порога или выше — обычный результат с кодом 1. `authz` проверяет авторизацию маршрутов по изменению или явным `paths` и принимает `fail_on_issue`, `ignore`, `public` и `no_suppressions`; находка маршрута на уровне порога или выше — тоже обычный результат с кодом 1. `preflight` возвращает один офлайн-вердикт по планируемому изменению и принимает те же флаги источника (`diff`, `base`, `staged`, `unstaged`, `include_untracked`), плюс `since`, `max_delta`, `fail_on_issue`, `no_secret_scan`, `no_sast`, `no_authz`, `no_deps`, `no_tests` и `no_slop`; проваленная проверка — обычный результат со `status: "fail"` и кодом 1, а не ошибка инструмента, чтобы агент видел, какая именно проверка упала. `ready` возвращает офлайн-оценку готовности 0–100 и принимает `fail_under`; оценка ниже порога — тоже обычный результат с кодом 1. `receipt_verify` пересчитывает SHA-256 квитанции, сверяет записанный коммит с HEAD и возвращает `ok`, `hashOk` и `stale`; отсутствующая, изменённая или устаревшая квитанция — обычный результат с `ok: false` и кодом 1, чтобы агент видел, почему доказательство не прошло. Инструмент `fix` принимает `from_sast` и `from_authz`, чтобы чинить находки безопасности и пересканировать; результат тогда содержит `sast` или `authz` с `{before, after, remaining}`. Сервер по умолчанию read-only: `--allow-write` разрешает `fix` с `apply: true`, `commit` с `apply: true`, `test_fix` с командой, `stats` с `clear: true` и `mutate`, который временно перезаписывает исходники. Результат `fix` содержит unified-патч, список `files` и `patchStats` (`additions`, `deletions`, `hunks`, `bytes`); патчи длиннее 200 000 символов обрезаются с флагами `patchTruncated` и `patchBytes`, чтобы хост мог показать или применить изменение, не разбирая diff заново.
|
|
911
911
|
|
|
912
912
|
`invariants` проверяет diff против `.oc-pilot/invariants.md`
|
|
913
913
|
|
|
@@ -922,6 +922,10 @@ ZCode импортирует серверы из Claude Code, Codex, OpenCode и
|
|
|
922
922
|
`hyper-chamber run <file>` проживает один самодостаточный JavaScript или ESM-файл в `node:vm`: подменяет `Date.now`, ускоряет таймеры, вызывает GC и снимает heap через `node:v8`, симулируя до года работы за короткий реальный бюджет. Устойчивый рост даёт `[MEMORY LEAK DETECTED]: AI code survives Day 1, but crashes on Day N of simulated uptime.` Файл должен экспортировать `run`, `tick`, `main` или `default`; обычный скрипт оборачивается в функцию и вызывается повторно. Это детерминированная эвристика, а не доказательство; нативный код не поддерживается.
|
|
923
923
|
`butterfly` запускает тестовую команду проекта в детерминированном локальном хаосе: `fetch` может вернуть HTTP 500, добавить задержку или битый JSON, а `fs` — `EIO` для кода в пределах `--scope` (по умолчанию `src/`). Он показывает число внедрённых сбоев, код выхода и хвост вывода; тест-раннер и `node_modules` исключены фильтром по стеку, а патчи драйверов БД — best-effort. Это помощник для тестов, а не ОС-песочница.
|
|
924
924
|
|
|
925
|
+
`blindfold` обезличивает идентификаторы (`calculateDiscount(user)` превращается в `fn_A(var_B)`) и отправляет модели только очищенный код, требуя строгий JSON-вердикт. Он падает с `[BLINDFOLD REJECTED]`, если модель не может объяснить логику, находит уязвимость или уверенность ниже `--min-confidence`; `--dry-run` печатает карту замен без вызова модели. Это слепая проверка, а не математическое доказательство.
|
|
926
|
+
|
|
927
|
+
`apoptosis` сканирует функции с маркером `/* @lifespan: 30d */`. Если маркер старше срока и на символ больше нет ссылок, он показывает `[Senescent]`; `apoptosis apply --confirm` комментирует такие функции в отдельном git worktree, запускает тестовую команду и переносит diff только при зелёном прогоне. Неудачный прогон оставляет рабочее дерево нетронутым. Это уборка AI-кода, а не гарантия, что функция не используется во время выполнения.
|
|
928
|
+
|
|
925
929
|
`query` выполняет цепочный AQL-запрос к облегчённому графу кода: `find(File|Function|Class|Import|CallExpression).where(field, value).sort(field).limit(n).select(fields...).count()`. Это не SQL и не полный TypeScript AST, а быстрый текстовый граф, который агент может опросить перед правкой. В MCP он доступен как `query_ast`.
|
|
926
930
|
|
|
927
931
|
`bankruptcy` прогнозирует техдолг по истории коммитов: оценивает каждый коммит по ослабленным тестам, SAST high/medium, добавленным TODO, churn и slop-прокси, сглаживает дневной ряд скользящим средним за 14 дней, выбрасывает выбросы и строит линейную регрессию. На выходе — текущий балл, скорость, дата прогноза и самодостаточный SVG-график; меньше 10 коммитов даёт `[INSUFFICIENT DATA: Need at least 10 commits to compute Slop Velocity]`. `--explain` печатает точные веса, где доминируют ослабленные тесты (0.35) и безопасность (0.30).
|
|
@@ -932,16 +936,16 @@ ZCode импортирует серверы из Claude Code, Codex, OpenCode и
|
|
|
932
936
|
|
|
933
937
|
`pack --hologram` собирает слоистый контекст вместо дампа репозитория: LOD 0 оставляет файлы из diff целиком, LOD 1 скрывает тела функций за маркерами `body hidden` с подсказками `EFFECTS` и добавляет подходящие тесты, LOD 2 показывает только имена экспортов. При несбалансированных скобках файл отдаётся целиком с `[Hologram: parse bailout]`, а итоговый Markdown проходит проверку секретов. `zoom-symbol <file> <symbol>` возвращает скрытое тело по запросу; `pack_hologram` и `zoom_symbol` дают тот же сценарий через MCP.
|
|
934
938
|
|
|
935
|
-
Каждый инструмент принимает `max_findings` (по умолчанию 50; урезанный результат дополнительно содержит `truncated` и `totalFindings`) и `verbosity` (`full` отдаёт JSON, `compact` — одну строку сводки, а те же данные остаются в `structuredContent`). Если клиент передал `_meta.progressToken`, сервер шлёт `notifications/progress`; после `logging/setLevel` — ещё и `notifications/message` на каждый вызов. `--max-calls <n>` (или `OC_PILOT_MCP_MAX_CALLS`) ограничивает число вызовов с моделью за сессию, `0` снимает лимит, а офлайн-инструменты `scan`, `fuzz`, `bankruptcy`, `query_ast`, `sandbox`, `hivemind_status`, `stats`, `slop`, `flaky`, `impact`, `deps`, `coverage`, `reviewers`, `test_guard`, `env_sync`, `mock_leak`, `ecosystem_verify`, `pack`, `pack_hologram`, `zoom_symbol`, `contract_drift`, `anti_regression`, `boundaries`, `test_plan`, `compliance_verify`, `brag`, `cleanup`, `arch_diff`, `roast`, `cinema`, `bounty`, `autopsy`, `echo`, `sast`, `authz`, `preflight`, `honeypot`, `alien_dna`, `hyper_chamber`, `butterfly`, `ready` и `receipt_verify` работают и после исчерпания бюджета.
|
|
939
|
+
Каждый инструмент принимает `max_findings` (по умолчанию 50; урезанный результат дополнительно содержит `truncated` и `totalFindings`) и `verbosity` (`full` отдаёт JSON, `compact` — одну строку сводки, а те же данные остаются в `structuredContent`). Если клиент передал `_meta.progressToken`, сервер шлёт `notifications/progress`; после `logging/setLevel` — ещё и `notifications/message` на каждый вызов. `--max-calls <n>` (или `OC_PILOT_MCP_MAX_CALLS`) ограничивает число вызовов с моделью за сессию, `0` снимает лимит, а офлайн-инструменты `scan`, `fuzz`, `bankruptcy`, `query_ast`, `sandbox`, `hivemind_status`, `stats`, `slop`, `flaky`, `impact`, `deps`, `coverage`, `reviewers`, `test_guard`, `env_sync`, `mock_leak`, `ecosystem_verify`, `pack`, `pack_hologram`, `zoom_symbol`, `contract_drift`, `anti_regression`, `boundaries`, `test_plan`, `compliance_verify`, `brag`, `cleanup`, `arch_diff`, `roast`, `cinema`, `bounty`, `autopsy`, `echo`, `sast`, `authz`, `preflight`, `honeypot`, `alien_dna`, `hyper_chamber`, `butterfly`, `apoptosis`, `ready` и `receipt_verify` работают и после исчерпания бюджета.
|
|
936
940
|
|
|
937
|
-
Готовые промпты отдаются через `prompts/list` и рендерятся `prompts/get`, чтобы клиент мог показать их в своём меню: `review-my-diff` (необязательный `context`), `fix-failing-tests` (необязательный `log`), `pre-commit-gate` (scan, review и commit одним проходом), `secure-change` (ревью с фокусом на безопасность), `slop-check` (проверка энтропии вайб-кода) и `preflight-before-commit` (прогнать офлайн-гейт, починить самую дешёвую упавшую проверку и повторять до вердикта pass), `deploy-honeypot` (развернуть файлы-приманки, прогнать preflight, остановиться на `[HONEYPOT TRIGGERED]` и удалить приманки после проверки), `check-alien-dna` (сравнить diff с архитектурной ДНК на HEAD, остановиться на `[ALIEN DNA DETECTED]` и спросить разрешение перед новым паттерном), `stress-the-chamber` (прожить сгенерированный JS/ESM-файл в node:vm, симулировать год работы, остановиться на `[MEMORY LEAK DETECTED]` и считать чистый прогон эвристикой, а не доказательством), `release-the-butterfly` (запустить тестовую команду в детерминированном хаосе: 500 от fetch, задержки и битый JSON, EIO от fs в пределах scope, затем показать число внедрённых сбоев и выжил ли набор тестов), `compile-hologram` (собрать слоистую голограмму, оставить LOD 0 полным, считать скрытые тела LOD 1 неизвестными и вызывать `zoom_symbol` перед рассуждением о них), `check-invariants` (проверить изменение против `.oc-pilot/invariants.md`, объяснить каждое нарушение с file:line и не скрывать CRITICAL-правило), `fuzz-the-diff` (вызвать новые экспорты с мусорными входами в изолированных процессах, починить каждое падение и не считать заблокированные цели проверенными), `forecast-tech-debt` (прочитать тренд техдолга, объяснить балл и веса и использовать дату прогноза для плана выплаты, а не для игры с TODO), `query-the-ast` (найти вызовы, функции, классы и импорты через AQL, проверить каждое попадание в исходнике и использовать доказательства для плана рефакторинга), `sandbox-script` (запустить сгенерированный JS/ESM-файл в node:vm с блокировкой импортов и побочных эффектов, затем показать вывод и точный статус), `join-the-swarm` (проверить identity и доверенных узлов hivemind, затем обмениваться только diff, AST и LLM-запросами по шифрованной сети; никогда не отправлять исполняемые команды), `get-ready` (оценить репозиторий, починить безопасные пробелы, доказать результат квитанцией и повторять до оценки не ниже 85), `fix-security` (починить находки SAST или авторизации маршрутов и пересканировать, пока не останется high), `stabilize-flaky` (воспроизвести нестабильный тест повторными и перемешанными прогонами и внести минимальное детерминированное исправление), `check-impact` (найти внешние ссылки на изменённые объявления, починить сломанные места и повторять, пока не останется устаревших ссылок), `triage-deps` (проверить зависимости и уязвимости OSV, починить самое дешёвое и повторить, не скрывая находки), `cover-changed-lines` (добавить тесты на изменённые строки, которые не выполнил ни один тест, и повторить тот же гейт), `generate-tests` (сгенерировать тесты на изменение или его непокрытые строки, применить, прогнать и повторять до зелёного), `pick-reviewers` (выбрать минимальный набор ревьюеров, которые знают изменённые файлы, с доказательствами из истории и CODEOWNERS), `guard-tests` (найти тесты, которые изменение пропустило, ослабило или удалило, вернуть им защиту и повторять до прохождения гейта), `sync-env` (сверить переменные окружения, добавленные изменением, с `.env` и `.env.example`, добавить недостающие определения и задокументировать их, не выдумывая секреты), `remove-mocks` (найти забытые заглушки, локальные пути, тестовые токены и всегда истинные условия в прод-коде, заменить их реальной реализацией и повторять до чистого отчёта), `verify-ecosystem` (проверить, что импорты существуют в установленных пакетах, а новые npm-пакеты не появились вчера с парой загрузок, и не ставить подозрительный пакет без решения человека), `pack-context` (собрать компактный контекст задачи из правил, подписей, ссылок и лога тестов и использовать его вместо вываливания целых файлов), `check-contracts` (найти удалённые или суженные поля в изменённых типах и схемах, обновить всех оставшихся потребителей, не ломая их молча), `guard-regressions` (сравнить добавленные строки с кодом, который человек удалил, изучить коммит-удаление и не возвращать его без явного решения), `respect-boundaries` (проверить добавленные импорты по правилам слоёв, исправить направление зависимости и повторять, пока ни одна граница не пересечена), `plan-tests` (прогнать план затронутых тестов, запустить только их, добавить тест на каждый непокрытый изменённый файл и повторить, не расширяя стратегию), `prove-compliance` (проверить подписанный аудит-манифест для HEAD, цепочку хешей и подпись и не заявлять о готовности, пока манифест недействителен), `cleanup-plan` (собрать офлайн-план уборки и применить только безопасные исправления зависимостей), `show-arch-diff` (нарисовать Mermaid-схему добавленных и удалённых внутренних импортов), `roast-my-code` (прожарить diff в выбранной персоне, с file:line и одним реальным исправлением), `play-session` (собрать терминальный таймлапс сессии в виде самодостаточного HTML-плеера или asciinema cast), `wanted-poster` (нарисовать плакат WANTED для худшего файла, объяснить причины и самое весомое исправление и повторить после исправления), `autopsy-commit` (разобрать коммит, перечислить сигналы, ранжировать подозреваемых, прочитать хронологию до/после и предложить минимальное исправление и тест, который поймал бы проблему), `share-progress` (собрать локальные SVG-бейджи и только с явного разрешения отправить анонимные агрегаты на указанный endpoint), `prove-tests` (прогнать мутационное тестирование по изменению и усилить тесты, пока mutation score не достигнет 80) и `prove-done` (проверить квитанцию для HEAD, создать свежую, если её нет или она устарела, и не заявлять о готовности, пока `ok` не равен true, а тесты в квитанции не пройдены).
|
|
941
|
+
Готовые промпты отдаются через `prompts/list` и рендерятся `prompts/get`, чтобы клиент мог показать их в своём меню: `review-my-diff` (необязательный `context`), `fix-failing-tests` (необязательный `log`), `pre-commit-gate` (scan, review и commit одним проходом), `secure-change` (ревью с фокусом на безопасность), `slop-check` (проверка энтропии вайб-кода) и `preflight-before-commit` (прогнать офлайн-гейт, починить самую дешёвую упавшую проверку и повторять до вердикта pass), `deploy-honeypot` (развернуть файлы-приманки, прогнать preflight, остановиться на `[HONEYPOT TRIGGERED]` и удалить приманки после проверки), `check-alien-dna` (сравнить diff с архитектурной ДНК на HEAD, остановиться на `[ALIEN DNA DETECTED]` и спросить разрешение перед новым паттерном), `stress-the-chamber` (прожить сгенерированный JS/ESM-файл в node:vm, симулировать год работы, остановиться на `[MEMORY LEAK DETECTED]` и считать чистый прогон эвристикой, а не доказательством), `release-the-butterfly` (запустить тестовую команду в детерминированном хаосе: 500 от fetch, задержки и битый JSON, EIO от fs в пределах scope, затем показать число внедрённых сбоев и выжил ли набор тестов), `interrogate-the-blindfold` (обезличить добавленный код, запросить у модели строгий JSON-вердикт, остановиться на `[BLINDFOLD REJECTED]`, исправить реальный путь кода, никогда не раскрывать исходные имена и не поднимать порог, чтобы получить pass), `prune-senescent-code` (проверить истёкшие маркеры `@lifespan`, показать каждого кандидата `[Senescent]` с файлом, возрастом и ссылками и применять только с явным подтверждением и зелёными тестами), `compile-hologram` (собрать слоистую голограмму, оставить LOD 0 полным, считать скрытые тела LOD 1 неизвестными и вызывать `zoom_symbol` перед рассуждением о них), `check-invariants` (проверить изменение против `.oc-pilot/invariants.md`, объяснить каждое нарушение с file:line и не скрывать CRITICAL-правило), `fuzz-the-diff` (вызвать новые экспорты с мусорными входами в изолированных процессах, починить каждое падение и не считать заблокированные цели проверенными), `forecast-tech-debt` (прочитать тренд техдолга, объяснить балл и веса и использовать дату прогноза для плана выплаты, а не для игры с TODO), `query-the-ast` (найти вызовы, функции, классы и импорты через AQL, проверить каждое попадание в исходнике и использовать доказательства для плана рефакторинга), `sandbox-script` (запустить сгенерированный JS/ESM-файл в node:vm с блокировкой импортов и побочных эффектов, затем показать вывод и точный статус), `join-the-swarm` (проверить identity и доверенных узлов hivemind, затем обмениваться только diff, AST и LLM-запросами по шифрованной сети; никогда не отправлять исполняемые команды), `get-ready` (оценить репозиторий, починить безопасные пробелы, доказать результат квитанцией и повторять до оценки не ниже 85), `fix-security` (починить находки SAST или авторизации маршрутов и пересканировать, пока не останется high), `stabilize-flaky` (воспроизвести нестабильный тест повторными и перемешанными прогонами и внести минимальное детерминированное исправление), `check-impact` (найти внешние ссылки на изменённые объявления, починить сломанные места и повторять, пока не останется устаревших ссылок), `triage-deps` (проверить зависимости и уязвимости OSV, починить самое дешёвое и повторить, не скрывая находки), `cover-changed-lines` (добавить тесты на изменённые строки, которые не выполнил ни один тест, и повторить тот же гейт), `generate-tests` (сгенерировать тесты на изменение или его непокрытые строки, применить, прогнать и повторять до зелёного), `pick-reviewers` (выбрать минимальный набор ревьюеров, которые знают изменённые файлы, с доказательствами из истории и CODEOWNERS), `guard-tests` (найти тесты, которые изменение пропустило, ослабило или удалило, вернуть им защиту и повторять до прохождения гейта), `sync-env` (сверить переменные окружения, добавленные изменением, с `.env` и `.env.example`, добавить недостающие определения и задокументировать их, не выдумывая секреты), `remove-mocks` (найти забытые заглушки, локальные пути, тестовые токены и всегда истинные условия в прод-коде, заменить их реальной реализацией и повторять до чистого отчёта), `verify-ecosystem` (проверить, что импорты существуют в установленных пакетах, а новые npm-пакеты не появились вчера с парой загрузок, и не ставить подозрительный пакет без решения человека), `pack-context` (собрать компактный контекст задачи из правил, подписей, ссылок и лога тестов и использовать его вместо вываливания целых файлов), `check-contracts` (найти удалённые или суженные поля в изменённых типах и схемах, обновить всех оставшихся потребителей, не ломая их молча), `guard-regressions` (сравнить добавленные строки с кодом, который человек удалил, изучить коммит-удаление и не возвращать его без явного решения), `respect-boundaries` (проверить добавленные импорты по правилам слоёв, исправить направление зависимости и повторять, пока ни одна граница не пересечена), `plan-tests` (прогнать план затронутых тестов, запустить только их, добавить тест на каждый непокрытый изменённый файл и повторить, не расширяя стратегию), `prove-compliance` (проверить подписанный аудит-манифест для HEAD, цепочку хешей и подпись и не заявлять о готовности, пока манифест недействителен), `cleanup-plan` (собрать офлайн-план уборки и применить только безопасные исправления зависимостей), `show-arch-diff` (нарисовать Mermaid-схему добавленных и удалённых внутренних импортов), `roast-my-code` (прожарить diff в выбранной персоне, с file:line и одним реальным исправлением), `play-session` (собрать терминальный таймлапс сессии в виде самодостаточного HTML-плеера или asciinema cast), `wanted-poster` (нарисовать плакат WANTED для худшего файла, объяснить причины и самое весомое исправление и повторить после исправления), `autopsy-commit` (разобрать коммит, перечислить сигналы, ранжировать подозреваемых, прочитать хронологию до/после и предложить минимальное исправление и тест, который поймал бы проблему), `share-progress` (собрать локальные SVG-бейджи и только с явного разрешения отправить анонимные агрегаты на указанный endpoint), `prove-tests` (прогнать мутационное тестирование по изменению и усилить тесты, пока mutation score не достигнет 80) и `prove-done` (проверить квитанцию для HEAD, создать свежую, если её нет или она устарела, и не заявлять о готовности, пока `ok` не равен true, а тесты в квитанции не пройдены).
|
|
938
942
|
|
|
939
943
|
Запуск вручную:
|
|
940
944
|
|
|
941
945
|
```bash
|
|
942
946
|
oc-pilot-mcp --cwd "C:\path\to\project"
|
|
943
947
|
# версия зафиксирована для воспроизводимости:
|
|
944
|
-
npx -y oc-pilot@0.
|
|
948
|
+
npx -y oc-pilot@0.94.0 mcp --cwd "C:\path\to\project"
|
|
945
949
|
```
|
|
946
950
|
|
|
947
951
|
Пример для Claude Code (`.mcp.json`):
|
|
@@ -1013,7 +1017,7 @@ jobs:
|
|
|
1013
1017
|
- uses: actions/checkout@v4
|
|
1014
1018
|
with:
|
|
1015
1019
|
fetch-depth: 0
|
|
1016
|
-
- uses: MyNameIsNikki/oc-pilot@v0.
|
|
1020
|
+
- uses: MyNameIsNikki/oc-pilot@v0.94.0
|
|
1017
1021
|
with:
|
|
1018
1022
|
command: scan
|
|
1019
1023
|
args: --base origin/${{ github.base_ref }} --fail-on-secrets
|
package/dist/cli.js
CHANGED
|
@@ -57,6 +57,8 @@ import { runHoneypot } from "./commands/honeypot.js";
|
|
|
57
57
|
import { runAlienDna } from "./commands/alien-dna.js";
|
|
58
58
|
import { runHyperChamberCommand } from "./commands/hyper-chamber.js";
|
|
59
59
|
import { runButterflyCommand } from "./commands/butterfly.js";
|
|
60
|
+
import { runBlindfold } from "./commands/blindfold.js";
|
|
61
|
+
import { runApoptosis } from "./commands/apoptosis.js";
|
|
60
62
|
import { runSast } from "./commands/sast.js";
|
|
61
63
|
import { runAuthz } from "./commands/authz.js";
|
|
62
64
|
import { PilotError, toPilotError } from "./core/errors.js";
|
|
@@ -81,6 +83,8 @@ const HANDLERS = {
|
|
|
81
83
|
"alien-dna": runAlienDna,
|
|
82
84
|
"hyper-chamber": runHyperChamberCommand,
|
|
83
85
|
butterfly: runButterflyCommand,
|
|
86
|
+
blindfold: runBlindfold,
|
|
87
|
+
apoptosis: runApoptosis,
|
|
84
88
|
sast: runSast,
|
|
85
89
|
authz: runAuthz,
|
|
86
90
|
fix: runFix,
|
|
@@ -177,6 +181,8 @@ const HELP = `oc-pilot ${VERSION} — AI-ревью, разбор тестов
|
|
|
177
181
|
alien-dna Проверка архитектурной ДНК: паттерны diff против HEAD
|
|
178
182
|
hyper-chamber Симуляция года работы и поиск утечек памяти
|
|
179
183
|
butterfly Локальный chaos engineering для тестов: 500, задержки, битый JSON
|
|
184
|
+
blindfold Обезличить код и допросить модель на скрытые уязвимости
|
|
185
|
+
apoptosis Найти сенесцентные функции по @lifespan и удалить их после тестов
|
|
180
186
|
receipt Квитанция о тестах и preflight, привязанная к коммиту
|
|
181
187
|
ready Оценить готовность репозитория к работе с ИИ-агентом
|
|
182
188
|
commit Сгенерировать commit-сообщение по staged (--apply — закоммитить)
|
|
@@ -248,6 +254,8 @@ ${COMMON_HELP}
|
|
|
248
254
|
oc-pilot alien-dna --staged
|
|
249
255
|
oc-pilot hyper-chamber run scripts/task.mjs
|
|
250
256
|
oc-pilot butterfly --command "npm test"
|
|
257
|
+
oc-pilot blindfold --file src/checkout.ts
|
|
258
|
+
oc-pilot apoptosis scan --fail-on-senescent
|
|
251
259
|
oc-pilot receipt --staged
|
|
252
260
|
oc-pilot docgen "src/**/*.ts" --symbol buildPrompt
|
|
253
261
|
git diff | oc-pilot scan --stdin
|
|
@@ -290,7 +298,7 @@ async function main(argv) {
|
|
|
290
298
|
});
|
|
291
299
|
}
|
|
292
300
|
throw new PilotError(`Неизвестная команда: ${command}`, {
|
|
293
|
-
hint: "Доступные команды: review, test-fix, test-gen, test-guard, flaky, mutate, fuzz, bankruptcy, query, sandbox, hivemind, sast, authz, fix, docgen, custom, scan, deps, ecosystem-verify, env-sync, mock-leak, coverage, pack, zoom-symbol, contract-drift, anti-regression, boundaries, test-plan, compliance, brag, battle, cleanup, arch-diff, roast, cinema, bounty, autopsy, echo, invariants, preflight, honeypot, alien-dna, hyper-chamber, butterfly, receipt, ready, commit, install-hook, restore, cache, stats, day, impact, explain, reviewers, replay, slop, setup, init.",
|
|
301
|
+
hint: "Доступные команды: review, test-fix, test-gen, test-guard, flaky, mutate, fuzz, bankruptcy, query, sandbox, hivemind, sast, authz, fix, docgen, custom, scan, deps, ecosystem-verify, env-sync, mock-leak, coverage, pack, zoom-symbol, contract-drift, anti-regression, boundaries, test-plan, compliance, brag, battle, cleanup, arch-diff, roast, cinema, bounty, autopsy, echo, invariants, preflight, honeypot, alien-dna, hyper-chamber, butterfly, blindfold, apoptosis, receipt, ready, commit, install-hook, restore, cache, stats, day, impact, explain, reviewers, replay, slop, setup, init.",
|
|
294
302
|
exitCode: 2,
|
|
295
303
|
});
|
|
296
304
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CA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{
|
|
|
1104
1104
|
rmSync(dir, { recursive: true, force: true });
|
|
1105
1105
|
}
|
|
1106
1106
|
});
|
|
1107
|
+
test("blindfold dry-run obfuscates code without calling a model", () => {
|
|
1108
|
+
const dir = mkdtempSync(join(tmpdir(), "oc-pilot-cli-blindfold-"));
|
|
1109
|
+
try {
|
|
1110
|
+
mkdirSync(join(dir, "src"), { recursive: true });
|
|
1111
|
+
writeFileSync(join(dir, "src", "checkout.ts"), "export function calculateDiscount(user: { total: number }) { return user.total * 0.9; }\n", "utf8");
|
|
1112
|
+
const result = runCli(["blindfold", "--file", "src/checkout.ts", "--dry-run", "--cwd", dir, "--json"], dir);
|
|
1113
|
+
assert.equal(result.status, 0, result.stderr);
|
|
1114
|
+
const payload = JSON.parse(result.stdout);
|
|
1115
|
+
assert.ok(!payload.code.includes("calculateDiscount"));
|
|
1116
|
+
assert.ok(payload.mapping.some((entry) => entry.original === "calculateDiscount"));
|
|
1117
|
+
}
|
|
1118
|
+
finally {
|
|
1119
|
+
rmSync(dir, { recursive: true, force: true });
|
|
1120
|
+
}
|
|
1121
|
+
});
|
|
1122
|
+
test("apoptosis scan marks an unreferenced old function as senescent", () => {
|
|
1123
|
+
const dir = mkdtempSync(join(tmpdir(), "oc-pilot-cli-apoptosis-"));
|
|
1124
|
+
const git = (args, env = {}) => {
|
|
1125
|
+
const result = spawnSync("git", args, { cwd: dir, encoding: "utf8", env: { ...process.env, ...env } });
|
|
1126
|
+
assert.equal(result.status, 0, result.stderr);
|
|
1127
|
+
};
|
|
1128
|
+
try {
|
|
1129
|
+
git(["init", "-q"]);
|
|
1130
|
+
git(["config", "user.email", "test@example.com"]);
|
|
1131
|
+
git(["config", "user.name", "Test"]);
|
|
1132
|
+
mkdirSync(join(dir, "src"), { recursive: true });
|
|
1133
|
+
writeFileSync(join(dir, "src", "app.ts"), "/* @lifespan: 30d */\nexport function oldFn() {\n return 1;\n}\n", "utf8");
|
|
1134
|
+
git(["add", "."]);
|
|
1135
|
+
git(["commit", "-m", "init"], {
|
|
1136
|
+
GIT_AUTHOR_DATE: "2020-01-01T00:00:00Z",
|
|
1137
|
+
GIT_COMMITTER_DATE: "2020-01-01T00:00:00Z",
|
|
1138
|
+
});
|
|
1139
|
+
const result = runCli(["apoptosis", "scan", "--cwd", dir, "--json"], dir);
|
|
1140
|
+
assert.equal(result.status, 0, result.stderr);
|
|
1141
|
+
const payload = JSON.parse(result.stdout);
|
|
1142
|
+
assert.equal(payload.senescent, 1);
|
|
1143
|
+
assert.equal(payload.entries[0]?.symbol, "oldFn");
|
|
1144
|
+
assert.equal(payload.entries[0]?.status, "senescent");
|
|
1145
|
+
assert.match(payload.content, /\[Senescent\]/);
|
|
1146
|
+
}
|
|
1147
|
+
finally {
|
|
1148
|
+
rmSync(dir, { recursive: true, force: true });
|
|
1149
|
+
}
|
|
1150
|
+
});
|
|
1107
1151
|
test("receipt records a run and verifies against HEAD", () => {
|
|
1108
1152
|
const dir = mkdtempSync(join(tmpdir(), "oc-pilot-cli-receipt-"));
|
|
1109
1153
|
try {
|