Skip to content

feat(config): review_gate config key, project can only tighten (#534) - #556

Merged
ajianaz merged 1 commit into
developfrom
fix/review-gate-config
Nov 10, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/review-gate-config

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

What

Adds a review_gate config key (off | warn | block) for the review gate before git commit (#534), usable in the project config and the user config.

Why

The gate shipped env/flag only, because a project's .tole/config.toml is untrusted and review_gate = "off" there would let a cloned repo switch the gate off. Users want to set it once in their user config.

Changes

  • config.rs: new key, validated at parse (off|warn|block). layered merges it differently from every other key: the STRICTER of the two layers wins (block > warn > off), so a project can keep or tighten the gate but never loosen what the user config chose. A project-only value is used as given, behind the existing content-bound trust gate.
  • config_apply.rs: Settings.review_gate, precedence flag > env > config > user config > default block, shown by tole config check with its source.
  • main.rs: a config value is exported as TOLE_REVIEW_GATE (like the flag) so the roster and child agents see it; flag/env already win inside resolve.
  • README, threat model and CHANGELOG updated.

Testing

  • New tests: validation, strictness merge (every layer combination), precedence, and that the env name matches review_gate::ENV.
  • Mutation check: flipping the strictness comparison makes the merge test fail; restored.
  • cargo fmt, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace pass; tole-cli --no-default-features builds.

Generated by Claude Code

@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 4297a33 into develop Nov 10, 2026
15 of 16 checks passed
@ajianaz
ajianaz deleted the fix/review-gate-config 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.

2 participants