feat(value-flow): add service asset variant - #61
Open
mfw78 wants to merge 2 commits into
Open
Conversation
Add service(service-desc) to the videre:value-flow asset variant so a service-shaped want (the postage venue's shape) is expressible before the strict 1.0 freeze closes the variant (#31): variant growth is breaking for consumers. A service leg is display-grade by construction: policy has teeth on enforceable legs only, and the host never verifies it. Mirror the case in the videre-test GoldenAsset, publish it through a ReferenceV3 body in the codec vectors and header goldens, add the AssetAmount::service constructor, and make the echo-venue want service-shaped with the inline goldens pinning the leg. Part of #23; must precede #31. AI Assistance: Claude Code implemented the change and tests to the #29 spec.
`cargo fmt --all --check` failed on the v3 golden note, so the CI rustfmt job was red on the branch as pushed. The service case lands in the shared `asset` variant, so `gives` can now carry a leg that value-flow declares display-grade while `intent-header` says policy has teeth on `gives`. Record the resolution where a guard author reads it: the WIT record and the SDK constructor both state that a guard refuses a service on the enforceable leg. ADR 0002 no longer lists `service` among the 0.2+ cases, and the pinned-WIT snapshot's grown-since line names the new case, so neither document contradicts the shipped tree. The echo-venue comment justified `gives` as the venue echoing the body back, which now reads as the same echo on both legs; state the submitter's side instead. AI Assistance: Claude Code red-teamed the branch and wrote these fixes.
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
Adds a
service(service-desc)case to thevidere:value-flowassetvariant, whereservice-descis a record carrying adescription: stringso 1.x can grow fields additively under the #47 freeze semantics; the name follows the pre-foldservice-descin the pinned design doc. Bindings regenerate at compile time and the host bindgen identifier smoke test now exercisesAsset::Service/ServiceDesc.videre-sdkgainsAssetAmount::service(description, units), routing the unit count through the canonicaluintcodec, with a unit test covering both a nonzero and a zero (gratis) unit count.videre-testgains aGoldenAsset::Servicecase with the matchingFrom<Asset>arm; the kitchen-sink header mirror test now also round-trips aservice-wantgolden and pins the kebab-case wire spellings ("service","description"). The reference schema gainsReferenceV3(wire tag 2, appended after V1/V2), whose derived header wants a service leg. The published codec vectors and header goldens were regenerated additively: existing entries are byte-identical, and new v3/service entries pin the new JSON wire spellings.Why
Closes #29
Testing
Re-derived the published bytes independently rather than trusting the goldens: the v3 vector
022a...0200000000000000decodes as borsh(42, "postage batch", 2), and the header golden'sgivestag2a/wantstag02follow fromderive_reference_header. Tag order is preserved (V1=0, V2=1, V3=2 appended).adapter_codec_conforms_to_the_published_vectorsdecodes and re-encodes the committed hex against the schema, andpublished_*_match_regenerationpins the golden/vector files byte-for-byte, so the fixtures have teeth against silent drift.AI Assistance
Implemented with claude-fable-5, red-teamed with claude-opus-5, PR description written by claude-sonnet-5.