Repository navigation
feat(cli): config trust store and tole config trust/untrust (#208, part 2 of 3) - #343
Merged
Merged
Conversation
…rust (#208, part 2 of 3) Trust store at $CODECORA_HOME/tole/trusted-configs.json (atomic 0600 writes, corrupt store is a hard error), a fail-closed gate function with a terminal-safe review prompt and line diff, tole config trust|untrust and a trust line in tole config check. Not wired to startup; config is still not applied to sessions. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🔍 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
Trust machinery for the project config (#208 part 2 of 3): a content-bound trust store, a fail-closed gate function (library only),
tole config trust|untrust, and atrust:line intole config check.Why
.tole/config.tomlcomes from a cloned repo and is untrusted. Before part 3 applies it to sessions, approval must be content-bound, stored outside the repo, shown terminal-safely and fail closed without a TTY.Changes
config_trust.rs: store at$CODECORA_HOME/tole/trusted-configs.json(v1, atomic write, 0600/0700, corrupt or unsupported store is a hard error, 64 KiB cap, no cwd fallback),gate()with injectedConfigTrustIo,sanitize(escapes control/bidi/zero-width chars), hand-rolled LCS line diff (summary above 2000 lines),StdIo(stderr, interactive = stdin and stderr are TTYs).config trust [--config] [--yes],config untrust [--config];config checkprints the trust line (exit code unchanged).config::read_sourcemade pub (was privateread_bounded).Testing
Unit tests (store, byte-identical trust, gate matrix, escaping, diff, commands) plus e2e tests with the real binary and a child-only
CODECORA_HOME. Mutation-checked: length-only compare, no escaping and dropped non-interactive refusal each fail tests. fmt, clippy -D warnings, workspace tests, bare-profile checks pass;cora review --stagedclean.Part of #208
🤖 Generated with Claude Code