Repository navigation
Propagate settings parse errors from SettingsCommand::from_statement - #482
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
cipherstash-agent
left a comment
There was a problem hiding this comment.
Review attestation: Claude Code /code-review medium followed by company-skills:cross-check-review-findings, against head bf4322f.
Result: no findings. No critical or blocking issues.
- All callers of
SettingsCommand::from_statement(prepare,simple_query,project_settings_effects,settings_simple_query_requires_fail_closed) now propagate the error. No.ok()discard remains. - Error paths leave no partial state.
preparebuilds the command before inserting intoself.prepared, andsimple_queryfails inproject_settings_effectsbefore touchingpending. - Existing callers still run
validate_settingfirst (lifecycle.rs:158,frontend.rs:350), so there is no behaviour change for clients, as the description says. - Existing PR feedback: only a Codex status comment (review still running), nothing to cross-check against.
Generated by Claude Code
Generated by Claude Code
SettingsCommand::from_statement discarded SettingChange::parse errors with .ok(), so an invalid CIPHERSTASH.* setting became SettingsCommand::Other. Every caller validates the statement first, so this was unreachable, but a future caller that skipped validation would silently treat an invalid setting as an ordinary statement. from_statement now returns Result, and SettingsProtocol::prepare, SettingsProtocol::simple_query, project_settings_effects and settings_simple_query_requires_fail_closed propagate the error. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
tobyhede
force-pushed
the
claude/project-thread-xb3ruh
branch
from
October 22, 2026 23:47
bf4322f to
235f796
Compare
freshtonic
approved these changes
Oct 23, 2026
freshtonic
left a comment
Contributor
There was a problem hiding this comment.
Reviewed head 235f796b. I found no problems.
What I checked
SettingsCommand::from_statementhas two callers outside the tests:SettingsProtocol::prepareandproject_settings_effects. Both now propagate the error. No.ok()discard is left.- The change is unreachable for clients today, as the description says.
validate_setting(lifecycle.rs:521) calls the sameSettingChange::parsewith?, so every input thatfrom_statementnow rejects is rejected first, byvalidate_setting:- Extended protocol:
prepare_parsecallsvalidate_setting(lifecycle.rs:158) beforeprepare_settings_statement(:159). - Simple protocol:
query_handlervalidates every parsed statement (frontend.rs:349-351) beforesettings_simple_query_requires_fail_closedand before bothregister_querycalls (:416,:516).register_queryis the only caller ofexecute_simple_settings_statements, and it receives a subset of the validated statements.
- Extended protocol:
- No partial state is left after an error.
preparebuilds the command before it inserts intoprepared.simple_queryreturns an error fromproject_settings_effectsbefore it changespending. project_settings_effectsnow collects into aVecand does not return a lazy iterator. This is correct: a later statement's projection depends on the earlier statements, and the batch is small.- The new test fails if the
.ok()discard comes back. With.ok(), all three inputs becomeSettingsCommand::Other, sois_err()is false. - CI passed on this head, with all 9 checks.
Approved.
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.
Requested by Toby
SettingsCommand::from_statementdiscardedSettingChange::parseerrors with.ok(), so an invalidCIPHERSTASH.*setting silently becameSettingsCommand::Other.Every current caller runs
validate_settingfirst, so this was unreachable, but a future caller that skipped validation would treat an invalid setting as an ordinary statement.Changes:
SettingsCommand::from_statementnow returnsResult<Self, Error>.SettingsProtocol::prepare,SettingsProtocol::simple_query,project_settings_effectsandContext::settings_simple_query_requires_fail_closedpropagate the error.settings_command_reports_an_invalid_cipherstash_settingcovers an invalid keyset id, an invalid mapping value and an unknownCIPHERSTASH.*name.No behaviour change for clients, so no changelog entry.
Validated locally with
cargo test -p cipherstash-proxy --lib(424 passed),cargo clippy --all-targets --all-features -- -D warningsandcargo fmt --check.Acknowledgment
By submitting this pull request, I confirm that CipherStash can use, modify, copy, and redistribute this contribution, under the terms of CipherStash's choice.
Generated by Claude Code