-
Notifications
You must be signed in to change notification settings - Fork 0
Enforce constrained delegated-agent writes #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dispatch-developer
wants to merge
3
commits into
main
Choose a base branch
from
fix/constrained-delegated-writes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| ALTER TABLE append_batches | ||
| ADD COLUMN request_version smallint, | ||
| ADD COLUMN request_digest bytea, | ||
| ADD COLUMN source text, | ||
| ADD COLUMN turn_id text, | ||
| ADD COLUMN tenant_id text, | ||
| ADD COLUMN owner_ref text, | ||
| ADD COLUMN agent_ref text, | ||
| ADD COLUMN item_count integer, | ||
| ADD COLUMN item_ids text[]; | ||
|
|
||
| ALTER TABLE append_batches ADD CONSTRAINT append_batches_delegated_request_check CHECK ( | ||
| (request_version IS NULL AND request_digest IS NULL AND source IS NULL AND turn_id IS NULL | ||
| AND tenant_id IS NULL AND owner_ref IS NULL AND agent_ref IS NULL AND item_count IS NULL | ||
| AND item_ids IS NULL) | ||
| OR | ||
| (request_version IS NOT NULL AND request_digest IS NOT NULL AND source IS NOT NULL | ||
| AND turn_id IS NOT NULL AND tenant_id IS NOT NULL AND owner_ref IS NOT NULL | ||
| AND agent_ref IS NOT NULL AND item_count IS NOT NULL AND item_ids IS NOT NULL | ||
| AND request_version = 1 AND octet_length(request_digest) = 32 AND source = 'agent' | ||
| AND item_count BETWEEN 1 AND 100 AND cardinality(item_ids) = item_count | ||
| AND first_seq > 0 AND last_seq >= first_seq | ||
| AND item_count::bigint = last_seq - first_seq + 1) | ||
| ); |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking CI:
cargo clippy --all-features --all-targets -- -D warningsfails becauseAppendItemsis unused in the imports. Remove it (or use it) so the build completes and the skipped test step can run.