Skip to content

test: postage advisory policy round trip (#30) - #64

Open
mfw78 wants to merge 2 commits into
feat/postage-venue-adapterfrom
test/postage-policy-round-trip
Open

test: postage advisory policy round trip (#30)#64
mfw78 wants to merge 2 commits into
feat/postage-venue-adapterfrom
test/postage-policy-round-trip

Conversation

@mfw78

@mfw78 mfw78 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What

Adds a test-only policy_round_trip module to postage-venue that drives the real VenueRegistry submit sequence (derive-header -> advisory EgressGuard -> submit) over the postage adapter's native verbs, using a test-local VenueInvoker installed through install_for_test, mirroring the precedent submit_round_trips_through_derive_guard_submit. videre-host gains a feature-gated test_utils module (behind the test-utils feature) re-exporting nexum_runtime::engine_config::SubmitQuota and nexum_runtime::host::actor::Liveness so the venue crate's tests can call install_for_test without taking a direct nexum-runtime dependency. postage-venue's Cargo.toml gains dev-dependencies on futures (for the BoxFuture invoker projection), tokio (rt, macros), and videre-host with the test-utils feature.

Why

Closes #30

The postage adapter's guard checkpoint was covered only indirectly; this pins the actual loop order and the advisory nature of the guard on the real registry path rather than a stand-in. Three cases are pinned: (1) loop order plus the policy-legible header the guard reads (enforceable BZZ erc20 gives with canonical uint total, display-grade service wants, Gnosis settlement, eip712) and the requires-signing leg settling at the previous car's MockSigner; (2) a guard deny stays advisory, i.e. submission still reaches the adapter and its pre-sign leg; (3) a refused derivation ends the loop before the guard and submit are reached.

Testing

All checks run on a fresh clone of nullislabs/videre-nexum-module at detached origin/test/postage-policy-round-trip (4bc794d), rustc/cargo 1.94.0.

  • cargo clippy -p videre-host -p postage-venue --all-targets --all-features -- -D warnings - clean, no warnings.
  • cargo test --doc -p videre-host -p postage-venue --all-features - Doc-tests videre_host: 0 passed, 0 failed; postage-venue is crate-type = ["cdylib"] so cargo emits no doctest target for it (expected, not a gap).
  • RUSTDOCFLAGS='-D warnings' cargo doc --no-deps -p videre-host -p postage-venue --all-features - both crates documented, no warnings.

The round trip was also red-teamed by mutation: making VenueRegistry::submit enforce a Deny verdict instead of logging it turns guard_deny_stays_advisory_on_the_postage_path red, which gives the advisory-seam claim real teeth; the order assertions also catch a skipped or reordered checkpoint, and the invalid-purchase test genuinely pins that a refused derivation ends the loop before the guard and the adapter.

AI Assistance

Implementation by claude-fable-5, red-team review by claude-opus-5, PR authored by claude-sonnet-5.

mfw78 added 2 commits August 7, 2026 06:14
Drive the registry derive-header, guard, submit sequence over the postage adapter native verbs, projected onto the host wire types through a test-local VenueInvoker. A recording guard pins the loop order and the policy-legible header it reads (enforceable BZZ erc20 gives, display-grade capacity service want, Gnosis settlement, eip712), and the requires-signing outcome settles at the kit signer mock. A denying guard stays advisory: the submission still reaches the adapter and its pre-sign leg, and a refused derivation ends the loop before the checkpoint.

videre-host gains a feature-gated test-utils re-export of Liveness and SubmitQuota, so an out-of-crate install_for_test caller needs no direct nexum-runtime pin.
… registry

The invoker projected quote, status, and cancel onto the host wire types
but no test drove them, so a transposed quotation leg or a folded
refusal would have gone unseen. Price the purchase through the registry
and pin the fee as its own zero bzz leg, that pricing derives no header
and runs no checkpoint, that a quotation valid past the ledger horizon
does not stale its own submit, and that status and cancel stay
terminally unsupported through the registry.

Name the native reach in the module doc: the round trip runs over a wire
projection of the Rust verbs, not a booted postage-venue.wasm actor.
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