Neighborhood forum and generated client evolution

What was tried

Built a small neighborhood repair forum in ignored playground/xx1/. Residents start discussions, reply, and read pages in insertion order. The canister controller can close a discussion. Public reads remain available after closure. An owner-private Nyxus map holds topics and their reply maps. Title and body fields use SharedString, and queries copy only the selected page into owned Wire reply values. The root attaches and binds the forum service. Its memory and the forum's memory stay at V1 for both releases.

The V1 thread query made both DTOs evolvable from their first declaration. The V2 release uses the same method name and core fields, with tagged optional include_reply_count and reply_count fields. Absence in the request uses the V2 default of including the count. An explicit false leaves it out. A V1 client can keep requesting the same page and reading all its known fields. The test calls each deployed artifact with the method codecs imported from that release's actual generated .wire.ts, plus a small PocketIC transport adapter. One V2 reply is decoded by both revisions to prove the extension was present on the same bytes the old decoder accepted. Wire evolution guide · Store owner conventions

Installed results

All six check groups passed with the pinned PocketIC 16.1.0 binary on one application subnet. The driver verified 1,634 files per artifact.

Client and service Observed behavior
V1 on V1 Created a topic and three replies using the V1-generated bindings, then paged by exclusive cursor. Anonymous update, oversized text, and unauthorized closure were refused.
V1 on V2 after populated KEEP V2 decoded the missing optional request field as absence. The old client decoded the same first page and tail. On the exact first reply bytes, the V2 client saw a present count of three. The V1 client still closed the topic, saw its replies, and created a new topic with the next ID.
V2 on V2 Explicit true returned the count and explicit false omitted it. The server refused a truncated request.
V2 on a separate live V1 A request with the V2 field present still returned the expected V1 page. The V2 client decoded the missing response extension as absence.
Application bounds A request for 255 items returned the 20-item cap, with every 2,000-byte reply intact and the 21st item reachable using the cursor.

Local build times from the first standalone layout were 73.9 seconds for V1 and 14.9 seconds for the V2 feature switch. The final canonical builds after routing the package into its own folder took 30.1 and 13.6 seconds. The final installed matrix took 10.9 seconds of host wall time. These are development timings from the shared trial host.

Source and artifact identities

  • Repository commit 1d8ed59866a47dcd54c332e4790356524873f15a and SDK tree c699daad6688a2bb1338634be5f223e58736ea58.
  • Canonical wasm64 target, nightly-2026-10-15 with rustc 1.101.0-nightly (7df81381d 2026-10-14), and Node.js 24.22.3.
  • V1 default feature set and V2 feature wire-v2. The 1,614-file canonical source inventories match between the features. The SHA-256 of forum.source-before.json is 08921b83e046e24cf9e343029c56017d26ae72efcfdc9bdfd05b8e2d16347254.
  • Published IC Wire 0.34.0 archive SHA-256 44d006cdf1ce2779bd5643d9febb42164061e6aa066dc44ffb08d8d8800bec74 and derive archive SHA-256 addc9e28e21dca2dabda96b93ec39d8fcebc38c4b37524b6a4949e7827573bb1.
  • PocketIC SHA-256 6a9a75ad9b4551d2b0f4a0d954ffb8bd5bbd0ebc44ac00290679b06ad0b2f8e6 and test driver SHA-256 a966a71f53da601f3242b4fcff8279627259553049fe34793e48df9332738ffd.
Artifact V1 SHA-256 V2 SHA-256
Installed Wasm c15b8f47a52622f4427d20634c65c75785e688d1f2be19bc936d0d3bccb449d1 7397c8286fe27d4575a4118c55aeacaf00cf97b118be84ea4deb7381108e1656
Schema ecdf956e6c09d12c412084d149f1b323b2bce1ef852e5e114bfe1a00830fdb13 cc001c64d8e8bdf3d5f3bc31dfca8fbe2a6b41a0dcf224a08a2878dbff2ec551
Generated TypeScript c66e2c1a67ae1de013d7ea9f44905bc000468bf24697483ef7484c7ceb706c53 9acc92d75a58afec1664b38e911303681558a8d10602a4432638282d31a8c582

Full manifests and runtime companion hashes were recorded in the lane's ignored output at tmp/ai-app-trials-wave1/xx1/pic-final/report.json and its adjacent artifact directories. These checks cover additive optional records with unchanged storage. Other evolution shapes and storage conversions have their own trial lanes.

What changed and what we learned

Observation Fix or follow-up
The first standalone cargo generate-lockfile --offline failed on ic-wire = "=0.34.0". The private seed advertised up to 0.7.21, and an overlay from a previous evolution run lacked the exact archives too. A plain online cargo generate-lockfile followed by cargo fetch --locked downloaded the published runtime and derive archives. Locked offline native checks and canonical builds could then proceed. A standalone quickstart could show lock creation, dependency fetch and the offline build as consecutive commands.
The first installed V1 test reached the anonymous-write refusal but its handwritten expected value omitted value from a unit enum case. Generated TypeScript and the live response both showed {tag: 'Forbidden', value: null}. Corrected the harness to follow the generated declaration. Option uses null or {some: value}, business Result uses {ok: value} or {err: value}, and a unit tagged result still carries value: null. An end-to-end client example can show these encodings together.
The direct generated reader returned evolving records with null prototypes, including rows inside the reply list. Node's strict deep equality with an object literal failed even though all own fields matched. Compared normalized own-field projections in the host assertions while keeping the original generated encoders and decoders. Document the record prototype or direct readers' safe way to compare output.
The first app layout put mutable notes and the host test next to Cargo.toml. The builder collects package files beyond Rust source. Moved the canister into playground/xx1/canister/ and kept the notes and host driver at the app root. Their later edits leave the canister's source manifest valid.
The first timing wrapper tried /usr/bin/time, which is absent on this host. Used Bash's time keyword. Host build durations include parallel trial load and are only setup and iteration observations.
cargo package -p cdk-rsx --list --offline --locked --allow-dirty listed an archive and warned that the manifest lacks a description. Actual local package preparation with --no-verify failed because cdk-rsx-executor has a path dependency without a version requirement. The facade also currently declares publish = false. Before release, check packaging of versioned internal dependencies in dependency order, and verify builds from unpacked archives. A file-listing check alone does not exercise manifest normalization. No registry changes were made.
Cargo printed that published ic-wire and ic-wire-derive 0.34.0 require Rust 1.100.0. The SDK manifests inherited 1.99, while the pinned compiler here was 1.101.0-nightly. Reconcile package MSRV metadata, the dependency floor and the pinned compiler requirements before publication. The native and installed trials used the pin.

Input for a future authoring skill

  • For an endpoint expected to evolve, start at the current Wire evolution guide. Derive the upstream Wire and wire the request and return attributes from V1. Add positive tagged optional IDs, reserve them, and keep the positional core stable. Put transport DTOs outside the owner memory declarations so an endpoint-only evolution can preserve the durable contract.
  • Bring up one native cargo check before waiting on the canonical wasm64 build. The standalone manifest uses cdylib and rlib, and mirrors the maintained Quickstart's direct SDK dependencies used by the derives. Fetch the standalone lock and prepare the exact SDK tool dependencies beforehand.
  • Archive both release client modules with their generated runtime and codec siblings. A generated method codec exposes methodName, mode, encodeRequest([arg]) and decodeResponse(bytes), so the host transport bridge stays small. Prefer the emitted types to guessed JS object shapes.
  • Verify both release artifacts before installing them. Seed real state before KEEP. For additive replies, decode one V2 wire body through both generated clients and assert a present V2 extension and exact V1 known fields. Confirm that an omitted request extension and an explicit false exercise different business behavior. Keep malformed-input, largest valid application reply, and post-upgrade write checks.
  • A native check and per-artifact check-wire establish compile-time and Wasm/descriptor agreement. The live old/new client matrix supplies the cross-release evidence. Keep key schema semantics separate from admission of the persisted memory layout. Canonical builder · Wire client contract · PocketIC helpers

Reproduction

Run from the unified repository root. With a seeded private Cargo home and a qualified PocketIC binary, use a fresh final directory for each run. The app and local notes are ignored. The PocketIC driver writes a structured report with the installed Wasm, schema, generated client and runtime digests.

lane="$PWD/tmp/ai-app-trials-wave1/xx1"
export CARGO_HOME="$lane/cargo-home" CARGO_TARGET_DIR="$lane/target"
export TMPDIR="$lane/temp" CARGO_BUILD_JOBS=3
source tools/env.sh
app=playground/xx1/canister/Cargo.toml
run=$(mktemp -d "$lane/rehearsal.XXXXXX")
cargo fetch --manifest-path "$app" --locked
python3 cdk-rsx/tools/build-app.py --manifest-path "$app" --name forum \
  --out-dir "$run/v1" --offline --locked
python3 cdk-rsx/tools/build-app.py --manifest-path "$app" --name forum \
  --features wire-v2 --out-dir "$run/v2" --offline --locked
node playground/xx1/pocketic.mjs "$run/v1/forum" "$run/v2/forum" \
  "$POCKET_IC_BIN" "$run/results"