oc-pilot 0.114.5 → 0.114.7

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.114.7
4
+
5
+ - `ready` теперь проверяет оба управляемых хука, `pre-commit` и `pre-push`: если хотя бы один использует устаревший бинарник, проверка хуков показывает предупреждение, а не pass.
6
+ - Версия и путь бинарника определяются один раз для обоих хуков; README описывает покрытие pre-push.
7
+ - 863 теста; версия 0.114.7.
8
+
9
+ ## 0.114.6
10
+
11
+ - `ready` и `doctor` теперь сравнивают версию найденного бинарника хука с текущим CLI. Устаревший глобальный `oc-pilot` больше не выглядит здоровым хуком: отчёт предупреждает, какую версию запустит pre-commit.
12
+ - Общие `readBinaryVersion`, `parseBinaryVersion` и `versionInvocation` вынесены в `src/core/hooks.ts`; на Windows локальный `.cmd`-шим выбирается раньше shell-обёртки, поэтому проверка версии работает и там.
13
+ - README описывает проверку версии; 861 тест; версия 0.114.6.
14
+
3
15
  ## 0.114.5
4
16
 
5
17
  - `resolveHookBinary` проверяет, что установленный управляемый хук действительно найдёт oc-pilot: `OC_PILOT_BIN`, локальный `node_modules/.bin/oc-pilot`, затем `PATH`.
package/README.md CHANGED
@@ -438,7 +438,7 @@ A receipt carries `{version, tool, toolVersion, createdAt, commit, branch, dirty
438
438
 
439
439
  ### `ready`
440
440
 
441
- Scores how ready a repository is for an AI agent. One offline number from 0 to 100 across nine checks: tests (15), lockfile (10), git hooks (15), Slop Index (15), a fresh receipt (10), agent instructions (10), CI (5), config (5) and security (15). Each check is `pass`, `warn` or `fail` and earns 100%, 50% or 0% of its weight. The security check runs the deterministic SAST and route-authorization rules over the repository and respects `.oc-pilot/baseline.json`. No model call, no network, but it does require a git repository. The hooks check also verifies that an installed managed hook can resolve an oc-pilot binary; a hook that would silently skip is reported as a warning.
441
+ Scores how ready a repository is for an AI agent. One offline number from 0 to 100 across nine checks: tests (15), lockfile (10), git hooks (15), Slop Index (15), a fresh receipt (10), agent instructions (10), CI (5), config (5) and security (15). Each check is `pass`, `warn` or `fail` and earns 100%, 50% or 0% of its weight. The security check runs the deterministic SAST and route-authorization rules over the repository and respects `.oc-pilot/baseline.json`. No model call, no network, but it does require a git repository. The hooks check also verifies that installed managed hooks (pre-commit and pre-push) can resolve an oc-pilot binary and use the same version; a hook that would silently skip or run a stale binary is reported as a warning.
442
442
 
443
443
  ```bash
444
444
  oc-pilot ready
@@ -610,7 +610,7 @@ oc-pilot install-hook --pre-push
610
610
  oc-pilot install-hook --uninstall
611
611
  ```
612
612
 
613
- Hooks are opt-in and reversible. A hook that does not belong to oc-pilot is never overwritten unless `--force` is passed, and then the old file is kept as `<hook>.oc-pilot.bak`. Every managed hook is stamped with a marker; hooks written by older versions are reported as outdated by `oc-pilot doctor` and upgraded in place with `oc-pilot doctor --fix`. Set `OC_PILOT_SKIP=1` to bypass the hooks for a single command. The hook prefers `OC_PILOT_BIN`, then `./node_modules/.bin/oc-pilot`, then `oc-pilot` from `PATH`; if none is found, it prints a warning and skips the check. `core.hooksPath` and worktrees are respected.
613
+ Hooks are opt-in and reversible. A hook that does not belong to oc-pilot is never overwritten unless `--force` is passed, and then the old file is kept as `<hook>.oc-pilot.bak`. Every managed hook is stamped with a marker; hooks written by older versions are reported as outdated by `oc-pilot doctor` and upgraded in place with `oc-pilot doctor --fix`. Set `OC_PILOT_SKIP=1` to bypass the hooks for a single command. The hook prefers `OC_PILOT_BIN`, then `./node_modules/.bin/oc-pilot`, then `oc-pilot` from `PATH`; if none is found, it prints a warning and skips the check. `oc-pilot ready` and `oc-pilot doctor` also compare the resolved binary version with the running CLI and warn when they differ. `core.hooksPath` and worktrees are respected.
614
614
 
615
615
  ### `restore`
616
616
 
@@ -1034,7 +1034,7 @@ Start the server manually with an explicit project directory:
1034
1034
  ```bash
1035
1035
  oc-pilot-mcp --cwd /absolute/path/to/project
1036
1036
  # pinned for reproducibility:
1037
- npx -y oc-pilot@0.114.5 mcp --cwd /absolute/path/to/project
1037
+ npx -y oc-pilot@0.114.7 mcp --cwd /absolute/path/to/project
1038
1038
  ```
1039
1039
 
1040
1040
  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.
@@ -1209,7 +1209,7 @@ jobs:
1209
1209
  - uses: actions/checkout@v4
1210
1210
  with:
1211
1211
  fetch-depth: 0
1212
- - uses: MyNameIsNikki/oc-pilot@v0.114.5
1212
+ - uses: MyNameIsNikki/oc-pilot@v0.114.7
1213
1213
  with:
1214
1214
  command: scan
1215
1215
  args: --base origin/${{ github.base_ref }} --fail-on-secrets
@@ -1232,7 +1232,7 @@ jobs:
1232
1232
  - uses: actions/setup-node@v4
1233
1233
  with:
1234
1234
  node-version: 22
1235
- - run: npm install -g https://github.com/MyNameIsNikki/oc-pilot/archive/refs/tags/v0.114.5.tar.gz
1235
+ - run: npm install -g https://github.com/MyNameIsNikki/oc-pilot/archive/refs/tags/v0.114.7.tar.gz
1236
1236
  - run: oc-pilot scan --base origin/${{ github.base_ref }}
1237
1237
  - run: oc-pilot review --base origin/${{ github.base_ref }} --fail-on warning --fail-on-secrets --github
1238
1238
  env:
package/README.ru.md CHANGED
@@ -449,7 +449,7 @@ oc-pilot receipt --verify --public-key receipt.key.pub
449
449
 
450
450
  ### `ready`
451
451
 
452
- Оценивает готовность репозитория к работе с ИИ-агентом. Одно офлайн-число от 0 до 100 по девяти проверкам: тесты (15), lockfile (10), git-хуки (15), Slop Index (15), свежая квитанция (10), инструкции для агента (10), CI (5), конфиг (5) и безопасность (15). Каждая проверка даёт `pass`, `warn` или `fail` и приносит 100%, 50% или 0% своего веса. Проверка безопасности прогоняет детерминированные правила SAST и авторизации маршрутов по репозиторию и учитывает `.oc-pilot/baseline.json`. Модель не вызывается, сеть не используется, но нужен git-репозиторий. Проверка хуков также убеждается, что установленный управляемый хук может найти бинарник oc-pilot; хук, который молча пропустит проверку, показывается как предупреждение.
452
+ Оценивает готовность репозитория к работе с ИИ-агентом. Одно офлайн-число от 0 до 100 по девяти проверкам: тесты (15), lockfile (10), git-хуки (15), Slop Index (15), свежая квитанция (10), инструкции для агента (10), CI (5), конфиг (5) и безопасность (15). Каждая проверка даёт `pass`, `warn` или `fail` и приносит 100%, 50% или 0% своего веса. Проверка безопасности прогоняет детерминированные правила SAST и авторизации маршрутов по репозиторию и учитывает `.oc-pilot/baseline.json`. Модель не вызывается, сеть не используется, но нужен git-репозиторий. Проверка хуков также убеждается, что установленные управляемые хуки pre-commit и pre-push могут найти бинарник oc-pilot и используют ту же версию; хук, который молча пропустит проверку или запустит устаревший бинарник, показывается как предупреждение.
453
453
 
454
454
  ```bash
455
455
  oc-pilot ready
@@ -621,7 +621,7 @@ oc-pilot install-hook --pre-push
621
621
  oc-pilot install-hook --uninstall
622
622
  ```
623
623
 
624
- Хуки опциональны и обратимы. Чужой хук не перезаписывается без `--force`, а при замене сохраняется как `<hook>.oc-pilot.bak`. Каждый управляемый хук помечен маркером; хуки старых версий `oc-pilot doctor` показывает как устаревшие и обновляет через `oc-pilot doctor --fix`. Обход на одну команду — `OC_PILOT_SKIP=1`. Хук сначала берёт `OC_PILOT_BIN`, затем `./node_modules/.bin/oc-pilot`, затем `oc-pilot` из `PATH`; если ничего не найдено, он печатает предупреждение и пропускает проверку. Поддерживаются `core.hooksPath` и worktrees.
624
+ Хуки опциональны и обратимы. Чужой хук не перезаписывается без `--force`, а при замене сохраняется как `<hook>.oc-pilot.bak`. Каждый управляемый хук помечен маркером; хуки старых версий `oc-pilot doctor` показывает как устаревшие и обновляет через `oc-pilot doctor --fix`. Обход на одну команду — `OC_PILOT_SKIP=1`. Хук сначала берёт `OC_PILOT_BIN`, затем `./node_modules/.bin/oc-pilot`, затем `oc-pilot` из `PATH`; если ничего не найдено, он печатает предупреждение и пропускает проверку. `oc-pilot ready` и `oc-pilot doctor` также сравнивают версию найденного бинарника с текущим CLI и предупреждают при расхождении. Поддерживаются `core.hooksPath` и worktrees.
625
625
 
626
626
  ### `restore`
627
627
 
@@ -985,7 +985,7 @@ ZCode импортирует серверы из Claude Code, Codex, OpenCode и
985
985
  ```bash
986
986
  oc-pilot-mcp --cwd "C:\path\to\project"
987
987
  # версия зафиксирована для воспроизводимости:
988
- npx -y oc-pilot@0.114.5 mcp --cwd "C:\path\to\project"
988
+ npx -y oc-pilot@0.114.7 mcp --cwd "C:\path\to\project"
989
989
  ```
990
990
 
991
991
  Пример для Claude Code (`.mcp.json`):
@@ -1057,7 +1057,7 @@ jobs:
1057
1057
  - uses: actions/checkout@v4
1058
1058
  with:
1059
1059
  fetch-depth: 0
1060
- - uses: MyNameIsNikki/oc-pilot@v0.114.5
1060
+ - uses: MyNameIsNikki/oc-pilot@v0.114.7
1061
1061
  with:
1062
1062
  command: scan
1063
1063
  args: --base origin/${{ github.base_ref }} --fail-on-secrets
package/dist/cli.test.js CHANGED
@@ -4,6 +4,7 @@ import { tmpdir } from "node:os";
4
4
  import { delimiter, join, resolve } from "node:path";
5
5
  import { spawn, spawnSync } from "node:child_process";
6
6
  import { test } from "node:test";
7
+ import { VERSION } from "./version.js";
7
8
  const CLI = resolve("dist/cli.js");
8
9
  const AWS_KEY = ["AKIA", "IOSFODNN7EXAMPLE"].join("");
9
10
  function runCli(args, cwd, extraEnv = {}) {
@@ -1589,10 +1590,14 @@ test("ready --fix installs the hook, config and instructions", () => {
1589
1590
  writeFileSync(join(dir, "package-lock.json"), JSON.stringify({ name: "demo", lockfileVersion: 3, packages: { "": { name: "demo" } } }), "utf8");
1590
1591
  const binDir = join(dir, "node_modules", ".bin");
1591
1592
  mkdirSync(binDir, { recursive: true });
1592
- const bin = join(binDir, "oc-pilot");
1593
- writeFileSync(bin, "#!/bin/sh\nexit 0\n", "utf8");
1594
- if (process.platform !== "win32")
1593
+ if (process.platform === "win32") {
1594
+ writeFileSync(join(binDir, "oc-pilot.cmd"), `@echo oc-pilot ${VERSION}\r\n`, "utf8");
1595
+ }
1596
+ else {
1597
+ const bin = join(binDir, "oc-pilot");
1598
+ writeFileSync(bin, `#!/bin/sh\necho "oc-pilot ${VERSION}"\n`, "utf8");
1595
1599
  chmodSync(bin, 0o755);
1600
+ }
1596
1601
  const before = runCli(["ready", "--cwd", dir, "--json"], dir);
1597
1602
  assert.equal(before.status, 0, before.stderr);
1598
1603
  const baseline = JSON.parse(before.stdout);