Repository navigation
feat(setup): tole setup cora installs or upgrades the cora binary - #538
Merged
Merged
Conversation
…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.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
tole setup cora [--check] [--yes]installs or upgrades the cora binary that the review flow,mcp_cora_*andcora_searchneed, andtole doctornow points to it.Why
The cora integration only exists when
corais 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 doctoronly printed an install line to copy. Closes #535.Changes
setup.rs(tole setup cora): probes cora with the existingecosystem::probe, then decides with a puredecide()(unit tested):--check: report only, exit 0;cargoon PATH: print the manual command, exit 1;--yes: refuse, exit 2 (never silent);[y/N]at a terminal, or--yes, then run the fixedcargo install cora-code --locked.ecosystem::SIBLINGSalready holds (the doctor prints the same string), split into program and args; nothing is assembled from user input.$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--versionis 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::Siblinggainssetup: Option<&str>; the cora doctor lines end with "(or runtole setup cora)".upgrade.docs/threat-model.md(new "tole setup cora" section; startup gating line updated).Scope decisions, from the issue's open points:
cora-code's release layout (GitHub access to that repo is not available here), and cargo already gives a checksum-verified install, which is howtole upgradeworks too. The mandatory-checksum acceptance item is met by delegating to cargo's registry verification rather than a tole-side download.cora-code0.20.0 is[[bin]] coraonly (no library target; checked in the published manifest) and enables tree-sitter parsers for about a dozen languages by default.cora, as the issue asks; the table already knowsuteke, so adding it is oneToolvariant.Testing
cargo test --workspacepassescargo fmt --all -- --checkpassescargo clippy --workspace --all-targets -- -D warningspasses (also theshell-toolsand bare profiles)corais not installed where this was written); the CI Cora Review job is the verdict.decide()(every state x cargo x check x yes x terminal) and the doctor hint.cargo/coraon a PATH that never contains the real cargo: installs a missing cora after--yesand verifies it; upgrades a too-old one; no-op when supported (cargo never invoked); refuses without a terminal or--yes(cargo never invoked);--checknever 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.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
feat/)developGenerated by Claude Code