Skip to content

Refuse approval.via on an autonomous operator approval - #47

Merged
shipmill-romamo[bot] merged 1 commit into
mainfrom
fix/46-autonomous-approval-via
Oct 9, 2026
Merged

shipmill-romamo[bot] merged 1 commit into
mainfrom
fix/46-autonomous-approval-via

Conversation

@shipmill-romamo

Copy link
Copy Markdown
Contributor

What changed

  • config/schemas/v1/operator-proposal.schema.json: the spec.approval object gets an if (mode is autonomous) / then (not required: [via]). An autonomous approval that carries via now fails schema validation, matching ApprovalRecord, which already refuses that combination
  • ProposalStore.load already validates every receipt against this schema before building it, so such a receipt is refused there with the same jsonschema ValidationError as any other invalid receipt, instead of the loader silently dropping via
  • The schema has a single source: the wheel bundles config/schemas at build time, and there is no docs copy, lock or snapshot of it to update
  • CHANGELOG: one bullet under Unreleased, Fixed

Tests

  • test_an_autonomous_approval_with_a_channel_is_refused_on_load (parametrized on terminal and unknown): a receipt written by autonomous_pass, hand-edited to add via, is refused on load at spec.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 no via on disk and still loads
  • Existing tests already cover human approvals with via: terminal and older ones with no via (read as unknown); both still pass
  • uv run ruff check ., uv run mypy, uv run pytest (434 passed), uv run cloudfall config validate --project config/examples and uv lock --check are all clean

Decisions for you

  • Behaviour change: a receipt someone edited by hand into an autonomous approval with via stops loading (and so does anything that lists the store, since ProposalStore.list loads 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 invalid

Fixes #46

🤖 Generated with Claude Code

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>
@shipmill-romamo
shipmill-romamo Bot merged commit 65317fa into main Oct 9, 2026
1 check passed
@shipmill-romamo
shipmill-romamo Bot deleted the fix/46-autonomous-approval-via branch October 9, 2026 08:29
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.

operator-proposal schema accepts approval.via on a policy approval, and the loader drops it

0 participants