Repository navigation
Refuse approval.via on an autonomous operator approval - #47
Merged
Merged
Conversation
The operator proposal schema gave approval.via an enum but did not tie it to mode, so an autonomous approval with a via passed validation and the loader dropped the field. An if/then on the approval object now forbids via when mode is autonomous, matching ApprovalRecord. Such a receipt fails schema validation on load like any other invalid receipt. Fixes #46 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 changed
config/schemas/v1/operator-proposal.schema.json: thespec.approvalobject gets anif(modeisautonomous) /then(not required: [via]). An autonomous approval that carriesvianow fails schema validation, matchingApprovalRecord, which already refuses that combinationProposalStore.loadalready validates every receipt against this schema before building it, so such a receipt is refused there with the samejsonschemaValidationErroras any other invalid receipt, instead of the loader silently droppingviaconfig/schemasat build time, and there is no docs copy, lock or snapshot of it to updateTests
test_an_autonomous_approval_with_a_channel_is_refused_on_load(parametrized onterminalandunknown): a receipt written byautonomous_pass, hand-edited to addvia, is refused on load atspec.approval. Both cases fail with the schema change reverted ("DID NOT RAISE")test_an_autonomous_approval_is_written_and_loaded_without_a_channel: a normal autonomous receipt has noviaon disk and still loadsvia: terminaland older ones with novia(read asunknown); both still passuv run ruff check .,uv run mypy,uv run pytest(434 passed),uv run cloudfall config validate --project config/examplesanduv lock --checkare all cleanDecisions for you
viastops loading (and so does anything that lists the store, sinceProposalStore.listloads every receipt). Cloudfall code never wrote that shape, so no receipt it produced is affected. This tightens the published v1 schema, but only for a shape the model already called invalidFixes #46
🤖 Generated with Claude Code