Skip to content

feat(setup): tole setup cora installs or upgrades the cora binary - #538

Merged
ajianaz merged 1 commit into
developfrom
feat/setup-cora
Nov 10, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/setup-cora

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

What

tole setup cora [--check] [--yes] installs or upgrades the cora binary that the review flow, mcp_cora_* and cora_search need, and tole doctor now points to it.

Why

The cora integration only exists when cora is on PATH at 0.19 or newer. Where it is absent (a fresh machine, a cloud sandbox) tole silently degrades to the native fallback and the agent has no review tools; tole doctor only printed an install line to copy. Closes #535.

Changes

  • New setup.rs (tole setup cora): probes cora with the existing ecosystem::probe, then decides with a pure decide() (unit tested):
    • supported: nothing to do, cargo never runs (idempotent);
    • --check: report only, exit 0;
    • no cargo on PATH: print the manual command, exit 1;
    • no terminal and no --yes: refuse, exit 2 (never silent);
    • otherwise [y/N] at a terminal, or --yes, then run the fixed cargo install cora-code --locked.
  • The install command is the one constant ecosystem::SIBLINGS already holds (the doctor prints the same string), split into program and args; nothing is assembled from user input.
  • After the install the result is verified at $CARGO_HOME/bin/cora (PATH may not list it, or may resolve an older copy first); a result that is still too old or does not answer --version is an error. If PATH still resolves a missing or too-old copy, a note says to put the cargo bin dir first. Setup does not rewrite PATH.
  • ecosystem::Sibling gains setup: Option<&str>; the cora doctor lines end with "(or run tole setup cora)".
  • Wired as a CLI subcommand only (no tool exposes it to a model) and added to the config-gate skip list next to upgrade.
  • README, CHANGELOG, docs/threat-model.md (new "tole setup cora" section; startup gating line updated).

Scope decisions, from the issue's open points:

  • No prebuilt-archive download. I could not verify cora-code's release layout (GitHub access to that repo is not available here), and cargo already gives a checksum-verified install, which is how tole upgrade works too. The mandatory-checksum acceptance item is met by delegating to cargo's registry verification rather than a tole-side download.
  • Embedding cora is not done: cora-code 0.20.0 is [[bin]] cora only (no library target; checked in the published manifest) and enables tree-sitter parsers for about a dozen languages by default.
  • Only cora, as the issue asks; the table already knows uteke, so adding it is one Tool variant.

Testing

  • cargo test --workspace passes
  • cargo fmt --all -- --check passes
  • cargo clippy --workspace --all-targets -- -D warnings passes (also the shell-tools and bare profiles)
  • Cora review run locally: not run (cora is not installed where this was written); the CI Cora Review job is the verdict.
  • Unit tests for decide() (every state x cargo x check x yes x terminal) and the doctor hint.
  • 7 end-to-end tests with the real binary and fake cargo / cora on a PATH that never contains the real cargo: installs a missing cora after --yes and verifies it; upgrades a too-old one; no-op when supported (cargo never invoked); refuses without a terminal or --yes (cargo never invoked); --check never installs; no cargo prints the manual command; an install that yields a still-too-old cora fails loudly. Mutation checked: letting a non-terminal run install makes the refusal test fail.
  • Not tested: a real cargo install cora-code (it compiles the whole crate) and the interactive [y/N] prompt path on a real terminal.

Related Issues

Closes #535. Related: #534 (review gate before commit, needs cora present), #536 (merged).

Checklist

  • Branch name follows convention (feat/)
  • Branch is from develop
  • Commit messages follow Conventional Commits
  • No secrets or credentials committed
  • One logical change per PR

Generated by Claude Code

…535)

Runs the fixed `cargo install cora-code --locked` (the same constant
`tole doctor` prints) after a [y/N] at a terminal or --yes; with neither
it refuses (exit 2). A supported cora is left alone, --check only
reports, no cargo prints the manual command. The result is verified at
$CARGO_HOME/bin/cora and a still-too-old result is an error.

`tole doctor` now ends its cora lines with "(or run `tole setup cora`)".
Same trust model as `tole upgrade`: cargo verifies the registry checksum,
tole downloads nothing. No tool exposes the command to a model.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 8c848fb into develop Nov 10, 2026
15 of 16 checks passed
@ajianaz
ajianaz deleted the feat/setup-cora branch November 11, 2026 04:10
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.

feat(doctor): tole setup cora — install or upgrade the cora binary the review flow needs

2 participants