Repository navigation
feat(protocol): declare env write grant kinds and take a write_object on data/get - #149
Open
earakely-scale wants to merge 5 commits into
Open
earakely-scale wants to merge 5 commits into
earakely-scale wants to merge 5 commits into
Conversation
… on data/get A data/get handler may take a write_object (a WriteObject the caller names) and answer uploaded_object_part(uploaded, name=..., mime_type=...), read back with uploaded_object(part). Each grant parameter a handler takes is declared under urn:agentenv:transfers/v1 as the write grant kinds it uploads through: write_namespace adds http-post-policy, write_object adds http-put and http-put-parts. client.write_kinds(card) reads the declaration, taking a card without it to accept http-post-policy alone when it advertises data-objects/v1. client.get_data sends write_object. A test freezes the object-write wire shape: receivers refuse fields they do not know, so a new capability must be a new grant kind. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…objects default Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…' into edgararakelyan/env-write-object
…rts through the local grant server The items test server takes write_object: handed an object, data/get uploads its state as a zip bundle through it, and data/add loads such a bundle back. The new local-tier test hands the deployed server a 40-URL parts grant on the local grant server, then checks three things: the server used only the URLs its bundle's size takes, more than PARTS_IN_FLIGHT of them; each part is its range; and the parts put together are the bundle. The gateway test's exact-set check of the items card now includes transfers/v1, and the README example names its bundle github.zip. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The new parts test is the first in the run to start this process's grant server, inside its own state root. A later test's containers trust that test's root's CA, so the server must start afresh, as the prompt-agent tests' fixtures already do. Without this, the file-parts test failed after it in CI. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.
Stacked on #147: review and merge that first, then this retargets to
main.Summary
An env service can now be handed one caller-named object to upload its
data/getexport to, and tell callers which write grants it takes. Thedata/getoperation itself is unchanged.write_objectparameter.@get_datahandler may take an optionalwrite_object: WriteObject._invoke_getvalidates it only for a handler that takes it, naming the failing fields and never their values, as forwrite_namespace.transfers.upload()(parallel parts for anhttp-put-partsgrant) and answersuploaded_object_part(uploaded, name=..., mime_type=...), read back withuploaded_object(part). The name must be relative.urn:agentenv:transfers/v1. It declares the write grant kinds a handler uploads through as{"write": [...]}, derived from its signature:write_namespaceaddshttp-post-policy, so these handlers' cards gain this entry next to their existing data-objects/v1;write_objectaddshttp-putandhttp-put-parts.client.write_kinds(card)reads the declaration. A card without it counts as acceptinghttp-post-policyalone if it advertises data-objects/v1, and nothing otherwise. A caller sends only a grant whose kind the card lists.client.get_data(..., write_object=)sends the grant.Wire freeze.
test_the_object_write_wire_shape_is_frozenpins the field sets ofHttpPartsPutGrant,HttpPutGrant,WriteObjectandUploaded. Receivers refuse unknown fields, so a field added later must be negotiated rather than sent to everyone. A receiver can advertise it in itstransfers/v1entry, whose unknown params readers ignore, or it can be a new grant kind.Labelled
bump-version: this is the release env services pin to start receiving parts grants. No issuer sendswrite_objectyet; that lands in core separately.Tests
test_data_objects.pycovers:write_object-only and combined handlers;write_kindsfor declared, data-objects-only and bare cards;The two existing advertisement tests now expect the transfers entry too.
Integration (local tier,
server_env_local_test.py). The items test server now takeswrite_object: it uploads its state as a zip bundle, anddata/addloads such a bundle back. The new test does the following:PARTS_IN_FLIGHTof them.It also checks that the card declares
http-put-parts.gateway_test.py's exact-set check of the items card now includestransfers/v1, and the README example names its bundlegithub.zip. Out-of-tree mutants are all killed: declaration dropped,write_objectignored,write_kindsprecedence, reply marker ignored, name unvalidated, client dropping the grant, and an error echoing the grant.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no blocking issues remain.Summary
Adds
write_objectsupport todata/get, declares accepted write grant kinds, and adds helpers to read upload results.data/gethandler can upload its export to one caller-named object.Diagram
Reviews (4) · Last reviewed commit: "test(integration): close the grant serve..." · Reviewed by Greptile