Rental maintenance desk
The trial implements three Ashroot tables on Hylix. Tenants report and list
work orders for their own properties. Canister controllers register properties
and contractors, assign work, and remove records. Work orders reference
properties through Restrict and contractors through SetNull. A composite
(property, due_day) index supplies bounded pages, using the last primary ID
as the tie-breaker. The app, generated artifacts, and runner are local under
playground/xx4 and tmp/ai-app-trials-wave1/xx4.
What we tried
Version 1 derived evolving Wire schemas on the query request, page and nested
work-order items. V2 added #[wire(id = 1)] assignment_label: Option<String>
to each list item, derived from the existing contractor reference. The Cargo
feature wire-v2 selects the new DTO. The owner-private Ashroot schema, source
policies, stable arena contract and root memory declaration stay identical
across the trial. This isolates the protocol extension from persistence
migration.
Used the original V1 generated TypeScript module and the independent V2
module with their emitted runtime sidecars and PocketIC transport. The
runner installs the prepared V1 Wasm, populates rows in updates, checks each
client, then installs prepared V2 with wasm_memory_persistence = keep. It
decodes the same V2 reply bytes with both clients. A V2 client querying the live
V1 is also checked for absence of the nested label. Work-order authorization,
bounded pages and relationship actions are tested through real ingress.
Wire evolution ·
Ashroot authoring ·
Engine and restoration guide
What we learned and changed
| Observation | Cause and action |
|---|---|
App-only cargo fetch succeeded. The first canonical build failed with failed to download cipher v0.5.2. |
The builder also runs locked full-workspace metadata against the SDK. A private dependency cache therefore needs the SDK workspace closure in addition to the app's closure. cargo fetch --locked --manifest-path cdk-rsx/Cargo.toml supplied it. |
#[wire(fixed)] on the refusal field failed under published ic-wire-derive 0.34.0 with expected wire(id = N), wire(required), or wire(rename = "name"). |
This upstream Wire derive rejects the field attribute. The app uses the SDK field type cdk_rsx::wire::evolve::Fixed<Option<Refusal>> and initializes it with Fixed(None) or Fixed(Some(...)). Locked native all-feature check passed with the wrapper. |
pub(crate) unsafe Table failed in table! with no rules expected keyword pub. The root attribute on App failed with expected mod. |
Both were app authoring errors. A scoped table marker writes unsafe pub(crate) Table. The root attribute annotates pub mod memory; and the separate service attribute annotates App. Opaque descriptors and the memory key can still have narrower visibility. |
| The first TypeScript client test printed matching fields and failed strict equality on a decoded cursor. | The generated record has a null prototype. The host test now checks cursor field values and compares known-field projections from both versions. The generated client stays byte-for-byte as built. |
The 32 KiB response allocation cap let ordinary pages through. The installed service trapped on 20 valid rows with Wire reply rejected: wire allocation limit. |
The encoded byte limit and conservative allocation allowance are separate. The app set both version allowances to 128 KiB, preserving the 20-row maximum, 96-byte summaries, and 4 KiB encoded response cap. It added a native maximum-shape test, using the same one-field reply envelope as the query macro. |
cargo package --list passed for cdk-rsx-ashroot. Actual cargo package --no-verify --offline --locked failed before creating a package. |
Cargo named cdk-rsx-collections as the dependency missing a version requirement. Cargo removes the path when packaging and resolves the packaged dependency by registry version. Both checks were local. |
The attribute diagnostic reproduced without the app with a standalone Rust
library depending on ic-wire = { version = "=0.34.0", features = ["typescript"] }:
#[derive(ic_wire::Wire)]
struct Reply {
#[wire(fixed)]
status: Option<u8>,
}
The reproduction isolates a guide usage mismatch. It leaves both the upstream
derive and the app wire representation unmodified. The smallest guide change
is to show Fixed<T> at a field site.
Rust wrapper source
The native maximum-shape fixture used 20 96-byte summaries, maximum-width order IDs and contractor keys, and an after-cursor. V1 encoded 2,501 bytes and needed at least 94,208 bytes of allocation allowance. V2 encoded 2,721 bytes and needed at least 103,584 bytes of allowance. These figures are native encode-admission thresholds for the pinned fixture. IC Wire debits materialization for projected sequence items on top of the byte allowance. The threshold records the codec budget, while heap peak stays unmeasured.
Inputs for a future development skill
- Choose what must survive before putting it in persistent memory. An optional
transport field computed from an existing row belongs in a Wire DTO. Add
Wireto each nested record that may evolve from the first release, use a fresh tagged ID for an optional extension, and preserve the positions and meaning of the untagged fields. - For Ashroot on Hylix alone, acquire one physical stable provider, use
Arena::formaton install andArena::openon restore, bind the same opaque database through the root, and useResources::default(). For a resource-freerecord!,ownership::scopewithrow.into_stable(owners)supplies the correctly owned input. The nullable projector derives the reference and clears only its owning row fields. - Keep the cursor's complete ordered key and row ID. Cap actual candidate visits, including a bounded extra row when detecting a next page. Derive authorization from the caller before any mutation. Convert known business refusals into the bounded reply and trap unexpected state errors.
- Use the exact prior generated client and its own runtime files. Exercise V2 on V1 as well as V1 on V2. A current client or descriptor tested against only the current Wasm cannot answer a backward-compatibility question. Explicitly require a present V2 value to distinguish skipping an extension from never sending one. Generated records can have a null prototype, so compare their named fields or normalize the record solely in the test.
- Exercise the largest legal nested reply with the real encoder and then the installed artifact. Test maximum-width values and full-size inputs together. An encoded-byte fit alone leaves allocation and traversal budgets unqualified.
- An external consumer trial needs the canonical builder and its toolchain
inputs as well as Rust dependency resolution. Use
cargo packageon the actual publishable crate and try a manifest with registry-style dependencies outside the checkout after the packaged dependency graph is available. Do the archive verification as well as a manifest file list.
Installed result
All five end-to-end checks passed using the pinned PocketIC 16.1.0 binary with
SHA-256 6a9a75ad9b4551d2b0f4a0d954ffb8bd5bbd0ebc44ac00290679b06ad0b2f8e6.
The tenant and controller operations included duplicate, unauthorized,
unknown-contractor and oversized-summary refusals. Three rows for the tenant's
property, two with an equal due day, yielded IDs 10 and 30 on the first page
and ID 20 on its continuation. A fourth row for a separate property was
outside the first property's index bounds.
The V2-generated client read a live V1 reply with both labels absent. After a populated V1-to-V2 KEEP, the original V1-generated client decoded the same bytes as the V2 client. Its known fields and cursor matched the pre-upgrade V1 reply exactly. The V2 client decoded the two present labels. The referenced property remained protected and deleting contractor 44 cleared two assignments. Both clients read all 20 96-byte summaries on a maximum page at the final budget. The maximum-shape native encoder test also passed separately for each variant.
Unified revision 1d8ed59866a47dcd54c332e4790356524873f15a, SDK Git tree
c699daad6688a2bb1338634be5f223e58736ea58, pinned nightly-2026-10-15
(Rust commit 7df81381d027710708209f36b98d11b1c88f8d2e) and prepared
wasm64-unknown-unknown. Both selected SDK source inventories had 1,604 paths.
The digest is 8c9567020bb5b5b5d9edd1936972e568783d9c9e8f9ba69b3d66fc1e9532cb42,
computed by hashing source records under the SDK root as
<sha256> <bytes> <SDK-relative path>\n in path order. The complete app and SDK
pre-build receipt was
04ff6b2390603b56d362f5ed31341070db152951997b1e68346279f3e4c807ed for both
variants. The canonical builder also verifies no source input changes during
the build.
| Version | Prepared Wasm SHA-256 | Shipped generated client SHA-256 |
|---|---|---|
| V1, default feature set | eb63967a7756a4f50ab1d826399cb48c575774117cc95ee927098a4ee9e976cb |
2c46e2b19e3e8ffe321bfb7c3bee004eed34c75f5906dcce18baf2a3b15889ef |
V2, wire-v2 |
f328dfd5681567f0fb03dba90b1bf4a1e58c1e1951af4394eef8ea10196f923f |
9c9914d3c67542e3f312b93fc0ee917cdfe8024b7e0fbd69a4ee4dffaa7beb0b |
The cold canonical V1 run took 87.8 seconds following dependency preparation.
The accepted rerun took 28.1 seconds for V1 and 27.6 seconds for V2 using the
lane's warm target. These are observed build wall times in a parallel
experiment, with no isolated compiler comparison. Local final evidence is
under tmp/ai-app-trials-wave1/xx4/trial.AmAumu/; the earlier allocation trap
is preserved under trial.To0LRx/.
From the repository root, with the pinned toolchain and private lane cache
prepared, run bash playground/xx4/run.sh for new canonical V1/V2 artifacts
and the installed regression. The underlying app-only native test is
cargo test --manifest-path playground/xx4/Cargo.toml --offline --locked.
Run it again with --all-features for the evolved page. Source the repository
environment with a private target before running Cargo directly.
Build procedure ·
PocketIC helpers