Skip to content

feat(value-flow): add service asset variant - #61

Open
mfw78 wants to merge 2 commits into
docs/freeze-gate-adrsfrom
feat/value-flow-service-asset
Open

feat(value-flow): add service asset variant#61
mfw78 wants to merge 2 commits into
docs/freeze-gate-adrsfrom
feat/value-flow-service-asset

Conversation

@mfw78

@mfw78 mfw78 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What

Adds a service(service-desc) case to the videre:value-flow asset variant, where service-desc is a record carrying a description: string so 1.x can grow fields additively under the #47 freeze semantics; the name follows the pre-fold service-desc in the pinned design doc. Bindings regenerate at compile time and the host bindgen identifier smoke test now exercises Asset::Service/ServiceDesc.

videre-sdk gains AssetAmount::service(description, units), routing the unit count through the canonical uint codec, with a unit test covering both a nonzero and a zero (gratis) unit count.

videre-test gains a GoldenAsset::Service case with the matching From<Asset> arm; the kitchen-sink header mirror test now also round-trips a service-want golden and pins the kebab-case wire spellings ("service", "description"). The reference schema gains ReferenceV3 (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...0200000000000000 decodes as borsh (42, "postage batch", 2), and the header golden's gives tag 2a / wants tag 02 follow from derive_reference_header. Tag order is preserved (V1=0, V2=1, V3=2 appended). adapter_codec_conforms_to_the_published_vectors decodes and re-encodes the committed hex against the schema, and published_*_match_regeneration pins 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.

mfw78 added 2 commits August 7, 2026 04:08
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.
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.

1 participant