Skip to content

release: v0.6.1 — scan JSON parse, review exit code, macOS Gatekeeper, install docs#322

Merged
ajianaz merged 8 commits into
mainfrom
develop
Jun 17, 2026
Merged

release: v0.6.1 — scan JSON parse, review exit code, macOS Gatekeeper, install docs#322
ajianaz merged 8 commits into
mainfrom
develop

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Release v0.6.1 (patch)

Brings all v0.6.1 changes from develop to main for tagging. Five squash commits:

Commit PR Issue Area
447398b #317 #316 fix(scan): non-fatal batch errors + non-JSON response diagnostics
22374c4 #318 #312 fix(review): exit code reflects filtered findings
dc4a667 #319 #313 fix(install): strip macOS Gatekeeper quarantine xattrs
d026db6 #320 #314 docs(install): warn about multiple distribution channels
f1027ba #321 docs: sync website docs for v0.6.1 release

Duplicate issue #315 closed as not-planned.

What's new in v0.6.1

Fixed — Scan (#316)

  • cora scan no longer aborts on non-JSON LLM responses. Detect provider error pages / rate-limit bodies / empty responses / prose wrappers early and surface the raw response prefix (first 512 bytes) in the error.
  • Per-batch parse failures are non-fatal by default (skip + warn + continue). --no-continue-on-batch-error restores the old abort behavior.
  • New --batch-files <N> flag (default 20) to work around provider token limits.
  • Truncated-JSON and general parse errors now include the raw response prefix.

Fixed — Review (#312)

  • cora review no longer exits 2 when --severity filtering removes all blocking findings. should_block is now recomputed against the filtered issue list so the exit code matches the SARIF/pretty output the user sees. Applies to both single-chunk and --auto-chunk paths.

Fixed — Install / macOS (#313)

  • Prebuilt macOS binaries are not Apple-notarized. install.sh now strips com.apple.quarantine / com.apple.provenance xattrs on the installed binary so it is no longer killed with Killed: 9 on first launch. README + docs/installation.md document the symptom and manual workaround for direct downloads.

Changed — Docs (#314, #321)

  • Install section (README + website) warns about multiple distribution channels and adds a which -a cora check snippet.
  • Website docs/changelog.md synced from root (was stuck at v0.2.0).
  • docs/cli-reference.md documents the two new cora scan flags.
  • docs/usage.md adds a tip for lowering --batch-files on large scans.

Test plan

  • All 5 included PRs passed full CI (10 checks each, including Cora Review, Test, Build, Clippy, Format, Security Audit, Cargo Outdated, Website Build, NPM Audit, Check).
  • cargo test: 564 + 16 + 6 tests pass on develop.
  • cargo clippy -- -D warnings clean. cargo fmt --check clean.

Post-merge

After this merges to main, tag v0.6.1 on the merge commit (or main HEAD) will trigger .github/workflows/release.yml to:

  1. Verify tag is on main.
  2. Build matrix: linux x86_64/arm64, macOS arm64, windows x86_64.
  3. Publish to crates.io.
  4. Create GitHub Release with checksums + auto-extracted notes from CHANGELOG.md.

Note: main currently has a few commits (logo fix, deploy workflow trim) not yet on develop. This is a standard main→develop drift; merging this PR brings everything in sync via the merge commit.

ajianaz added 8 commits June 14, 2026 21:01
fix: remove --branch=main from deploy workflow
* fix: remove --branch=main

* fix: remove VitePress base (routing handled by Worker)

* fix: restore VitePress base for proper asset routing

* fix: add VitePress base '/docs/cora/' for asset routing

* fix: restore docs/.vitepress/config.mts from develop

* fix: remove VitePress base — routing via Worker with <base href> injection

* fix: add CF Pages _redirects

* fix: add VitePress base '/docs/cora/' to cora config

* fix: remove base prefix from head assets (VitePress prepends base automatically)

* fix: trim trailing whitespace in deploy workflow (#310)
…) (#317)

- Add early non-JSON response guard in parse_scan_response: detect HTML
  error pages, rate-limit bodies, empty responses, and prose wrappers before
  attempting strict parse. Surface raw response prefix (first 512 bytes,
  whitespace-collapsed) in the error so users can diagnose truncation vs
  provider error vs prose.
- Make per-batch parse failures non-fatal by default: skip the failing batch
  with a stderr warning and warn-level log (with file list), continue with
  remaining batches. --no-continue-on-batch-error restores old abort behavior.
- Add --batch-files <N> flag (default 20) to cap files per LLM batch — lower
  it to work around provider token limits on large scans.
- Truncated-JSON repair path now also includes raw response prefix.
- Add 14 unit tests covering looks_like_json_array, preview_raw, and
  parse_scan_response non-JSON rejection.
- Bump version 0.6.0 → 0.6.1 (patch: bug fix, no API breaking changes).
Previously `cora review` could exit 2 (EXIT_BLOCKED) even when the
`--severity` filter removed all blocking findings and the SARIF output
contained 0 error-level results. This blocked PR merges in CI when Cora
Review was configured as a required status check.

Root cause: `should_block` was computed by the engine using
`config.hook.min_severity`, but the exit-code logic used the same
`should_block` flag without re-checking against the **filtered** issue
list (after CLI `--severity` filtering). So a Major finding with
`--severity critical` would still cause exit 2 even though the filtered
output shown to the user had no findings.

Fix:
- Recompute `should_block` on `filtered_response` after severity
  filtering, so exit code matches what the user sees (both in the
  single-chunk and `--auto-chunk` paths).
- Extract exit-code logic into `compute_exit_code()` pure helper with
  8 unit tests (gate pass/fail, CI mode, hook block vs non-block).

Bump 0.6.0 -> 0.6.1 (patch).
Prebuilt macOS binaries are not Apple-notarized. When a user downloads
the `aarch64-apple-darwin` tarball directly (via `gh release download`,
browser, or curl), macOS attaches `com.apple.quarantine` and
`com.apple.provenance` extended attributes and then kills the binary on
first launch with signal 9 — producing `Killed: 9` and **no error output**.
This makes the failure look like a cora crash rather than a distribution
gap.

Changes
- install.sh: after `chmod +x`, on macOS run best-effort
  `xattr -dr com.apple.quarantine` and `xattr -dr com.apple.provenance`
  on the installed binary. Non-fatal on failure (binary may already be
  clean).
- README: add a prominent <details> block under the Install section
  explaining the `Killed: 9` symptom, the manual `xattr -dr` workaround
  for direct-download users, and the `cargo` / Homebrew alternatives.
- CHANGELOG entry under `## [0.6.1] -> Fixed — Install (macOS)`.

Note: the real fix is Apple notarization (codesign + notarytool), which
requires an Apple Developer ID certificate. This PR is the minimum-cost
stopgap documented in the issue. A follow-up can add notarization to
`.github/workflows/release.yml` once credentials are available.

Bump 0.6.0 -> 0.6.1 (patch).
The install docs listed several methods without warning that having more\nthan one on $PATH silently resolves to whichever appears first. On a real\ndeveloper machine three copies were present simultaneously\n(~/.local/bin, ~/.cargo/bin, ~/.bun/bin) and the stale npm v0.2.4 was\nbeing invoked, causing confusing behavior.\n\nChanges\n- README: pick one recommended method, list all supported channels in a\n  table, and add a `which -a cora && cora --version` check snippet with\n  guidance for pruning stale copies.\n- Cross-link issue #314 for background.\n- CHANGELOG entry under ## [0.6.1] -> Changed — Docs.\n\nAlso closes #315 as a duplicate of #314 (same title/body/author, opened\n3 seconds apart).\n\nBump 0.6.0 -> 0.6.1 (patch; docs only).
- docs/changelog.md: sync from root CHANGELOG.md (was stuck at v0.2.0 —
  now includes v0.4.x, v0.5.x, v0.6.0, and v0.6.1 with all compare links).
- docs/installation.md:
  - Update pinned-version example to v0.6.1.
  - Add 'Check for stale copies on PATH' subsection (which -a cora)
    cross-linking #314.
  - Add 'macOS: Killed: 9 on launch?' subsection documenting the
    Gatekeeper quarantine workaround (xattr -dr) from #313.
  - Replace placeholder 'cora 0.x.x' in verify snippet with 'cora 0.6.1'.
- docs/cli-reference.md: document new `cora scan` flags
  --batch-files <N> and --no-continue-on-batch-error (#316).
- docs/usage.md: add tip about lowering --batch-files for large scans
  and the non-fatal batch behavior (#316).
- README.md: update pinned-version example to v0.6.1.

No code changes. Part of the v0.6.1 patch release bundle.
@ajianaz ajianaz merged commit 3d0dd65 into main Jun 17, 2026
10 checks passed
ajianaz added a commit that referenced this pull request Jun 21, 2026
Three bugs caused tokens_used to always be None or partial:

1. parse_review_response/parse_scan_response hardcoded Ok((..., None)),
   discarding the Usage object from the API response. Fixed by threading
   Option<&Usage> through both functions and converting via
   usage_to_token_usage().

2. chat_completion_stream only collected delta.content, ignoring the
   usage field in the final SSE chunk. Now sends stream_options.include_usage
   and parses usage from top-level or choices[0].delta.usage.

3. scan multi-batch total_tokens was overwritten per batch instead of
   accumulated. Fixed with proper accumulation of input/output/cost.

Also:
- Extracted magic numbers (20, 60_000) to named constants
- Usage struct now accepts camelCase aliases (promptTokens etc)
- chat_completion returns (String, Option<Usage>) tuple
- Added 4 regression tests for token usage threading
- Bumped version 0.6.1 → 0.6.2

All 590 tests pass (568 unit + 16 CLI + 6 config).
ajianaz added a commit that referenced this pull request Jun 21, 2026
… (#323)

Three bugs caused tokens_used to always be None or partial:

1. parse_review_response/parse_scan_response hardcoded Ok((..., None)),
   discarding the Usage object from the API response. Fixed by threading
   Option<&Usage> through both functions and converting via
   usage_to_token_usage().

2. chat_completion_stream only collected delta.content, ignoring the
   usage field in the final SSE chunk. Now sends stream_options.include_usage
   and parses usage from top-level or choices[0].delta.usage.

3. scan multi-batch total_tokens was overwritten per batch instead of
   accumulated. Fixed with proper accumulation of input/output/cost.

Also:
- Extracted magic numbers (20, 60_000) to named constants
- Usage struct now accepts camelCase aliases (promptTokens etc)
- chat_completion returns (String, Option<Usage>) tuple
- Added 4 regression tests for token usage threading
- Bumped version 0.6.1 → 0.6.2

All 590 tests pass (568 unit + 16 CLI + 6 config).
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.

1 participant