Skip to content

chore(ocr-delegate): restore --format json behind the v1.9.3 gate that broke it - #38

Merged
sonhyrd merged 1 commit into
mainfrom
chore/ocr-delegate-format-json
Aug 17, 2026
Merged

chore(ocr-delegate): restore --format json behind the v1.9.3 gate that broke it#38
sonhyrd merged 1 commit into
mainfrom
chore/ocr-delegate-format-json

Conversation

@sonhyrd

@sonhyrd sonhyrd commented Aug 17, 2026

Copy link
Copy Markdown
Owner

What

ocr delegate gained a shared -f, --format text|json in v1.9.3, as a side effect of the SARIF work (alibaba/open-code-review#820). Our skill still stated in bold that the flag does not exist.

The CLI needed no upgrade. Installed ocr is v1.9.5; npm latest and the newest GitHub release are both v1.9.5. Nothing was installed.

Why the guard matters

Per changelogs/sss.md:31, --format json was ripped out of this skill because it exited non-zero on v1.8.10 and every run through the skill reviewed nothing. Restoring it therefore comes with the version written down and a named fallback branch to the text output for ocr < 1.9.3 — not a silent retry. The report must say which path ran.

Kept, not reverted

This stays a fork of upstream's skills/open-code-review-delegate/SKILL.md, which is the plain JSON version. All four local hardenings exist here and in no upstream release:

  • the text-output fallback
  • (path, status) checklist identity
  • the coverage-rate denominator (coverage_rate is not a field OCR emits, so Step 6 computes reviewed / reviewable_count, never / total_files)
  • the Markdown-only-repo gotcha

Upstream's non-delegate skill and its delegate-review Claude command are deliberately not pulled in: the first needs the LLM endpoint delegation mode exists to avoid, the second duplicates what sss:pr-review orchestrates.

Changes

  • plugins/sss/skills/ocr-delegate/SKILL.md — JSON primary + fallback, field-name table, version floor in compatibility, -f, --format row restored beside --max-git-procs, ocr --version prerequisite, new version-gate gotcha, metadata.version 1.0.0 → 1.1.0
  • plugins/sss/skills/pr-review/SKILL.md — probe is ocr --version; degradation clause now excludes a rejected --format, because the skill falls back on its own and degrading there would discard a working review
  • CHANGELOG.md — two ## [Unreleased] / ### Changed entries

Verification

  • ocr delegate preview --format json and ocr delegate rule --format json both run against this repo and emit schema_version: "1" with mode, from/to/merge_base, reviewable_files[], and excluded_files[] carrying exclude_reason
  • --format sarif is rejected by delegate mode, as the flag table now says
  • python3 scripts/validators/validate_all.py — 3/3 passed. make validate could not run: uv is not installed on this machine

…t broke it

`ocr delegate` gained a shared `-f, --format text|json` in v1.9.3 as a side
effect of the SARIF work (alibaba/open-code-review#820). The skill still said
in bold that the flag does not exist — true against v1.8.10, false against the
installed v1.9.5. The CLI itself is already at the latest release, so nothing
was upgraded on the binary side.

Steps 1 and 2 instruct JSON again, but the text-parsing guide stays in the file
as a named fallback branch rather than a silent retry: pinning this flag on
v1.8.10 is what made every run through the skill exit on its first command and
review nothing. The report has to say which path ran.

All four local hardenings are kept, so this stays a fork of upstream's
open-code-review-delegate rather than a re-vendor: the fallback, the
(path, status) checklist identity, the coverage-rate denominator, and the
Markdown-only-repo gotcha exist here and in no upstream release. `coverage_rate`
is not a field OCR emits, so Step 6 still computes reviewed / reviewable_count.

pr-review's probe becomes `ocr --version` rather than `which ocr`, since
presence no longer determines which path the OCR track takes, and its
degradation clause now excludes a rejected `--format` — the skill falls back on
its own, so degrading there would discard a working review.

Verified against the live CLI: preview and rule both emit schema_version "1",
and `--format sarif` is rejected by delegate mode as documented.
python3 scripts/validators/validate_all.py passes 3/3 (uv is absent on this box,
so `make validate` could not be used).
@sonhyrd
sonhyrd merged commit 19c0c89 into main Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants