Round two neighborhood forum and client evolution

Reauthoring scope

Rebuilt the neighborhood forum in ignored playground/xx1-round2/ from the pinned guides. A private board owner stores topics and replies in Nyxus maps. The reply map uses a compound (thread, reply) key so the page operation can seek directly to the exclusive cursor and stop within the current thread. The app provides public reads, authenticated posts and replies, and a controller close operation. V1 and V2 share the exact persisted memory declaration.

V1 derives upstream Wire for the paginated endpoint from the start. Its optional business refusal uses Fixed<Option<Refusal>> inside the evolving page. Refusal is an ordinary SDK DTO. V2 adds the optional request flag include_reply_count and the optional response reply_count. Existing requests use the count-present default and retain the meaning of all V1 reply fields. Disabling the count explicitly exercises a different path. The host driver loads each generated TypeScript module with its own runtime and codec files. Owner conventions · Wire evolution

I used the snapshot's build, Store authoring and Wire guides. I consulted the Quickstart manifest at the pinned Git commit because the curated SDK archive contains the SDK, guides and environment helper. The round-one app source and local notes stayed unread during implementation. The task and previous experience made the design and expected test matrix familiar. The main repository's shared PocketIC helper supplied transport and lifecycle setup.

First-pass authoring and first failure

Round-one observation Round-two repeat
Offline lock creation failed against a stale dependency seed before the app could compile. The updated build guide names the online app lock and both locked fetches. They succeeded on the first attempt with the seeded private Cargo home. The new lock selected for Rust 1.100, in agreement with the published Wire dependency metadata.
The first host refusal assertion guessed a tag-only unit variant and failed. Another assertion compared low-level null-prototype records with literal objects. The new Wire guide gives both actual host representations. Used {tag, value: null} and structuredClone to compare own fields. Each first V1 caller and refusal assertion passed before the upgrade.
The initial manifest listed five SDK dependencies, following Quickstart. The build guide's facade, Store and Collections list plus the Store guide's direct Nyxus derive dependency was enough for the new app. The default root path and records build without a direct Memory ABI dependency. This app has regular native structs and no retained tagged enum.
The round-one populated KEEP passed with the feature-conditioned DTOs. The same two-release approach passed both canonical builds, then the first populated KEEP trapped with root catalog rejected. The two prepared policy inventories exposed a compiler-class mismatch before the V2 handler could run.

The fresh lane had a seeded Cargo home, an initially empty target and an author familiar with the acceptance workflow. The new notes show the information supplied by current docs. Timing is descriptive, because parallel load, cache state, source layout and prior experience all varied across rounds. Round-one forum · Build guide · Wire client representations

The first compatible-looking build pair used one Git snapshot and one source manifest. A diff of board.policies.json found the only changed raw identity at compiler/wasm64-unknown-unknown, from 8715916132171c1fc93bc3024c71bda5285988b827ec5de4b5685ee2f1bf6de9 to aafdc26c541f6551c19cd5687d916a04e16e5d742e3121c72a16e89e32ce8c00. The SDK and Cargo-home physical prefixes both had length 65. The builder's source_remappings converts the known prefixes to a set and sorts by length. Separate Python processes can reverse equal-length members. The SDK's memory ABI producer hashes the ordered CARGO_ENCODED_RUSTFLAGS. The two receipts showed /icrustmem then /cargo in V1 and the reverse in V2.

A build-free reproduction loaded the exact same V1 Cargo metadata and called source_remappings twice. Python hash seeds 0 and 4 yielded opposite orders. The set sort is present in both revisions examined. The round-two snapshot and cache layout happened to expose it. A deterministic tie-break on logical and physical prefixes can resolve this while preserving longest-match precedence. The app tried the same PYTHONHASHSEED=0 for both release builds to keep flags aligned without changing the SDK or catalog rules. Canonical remapping · Compiler class hashing

Installed outcome with aligned remapping flags

The second canonical pair passed all five PocketIC check groups. Its V1 installed Wasm is byte-identical to the first V1. The second V2 has the same Wire descriptor and generated client as the rejected candidate, with a compiler class matching V1. The detached compatibility context still differs because the application selected wire-v2 and the context records that feature. Ordinary KEEP admitted the equal persisted contract.

Call and boundary Verified behavior
V1 client on V1 Populated two threads, verified exclusive cursor paging without crossing the compound-key range, and decoded the fixed missing-thread refusal. Anonymous posting, oversized replies and unauthorized closure were refused.
V1 client on V2 after KEEP Continued to see the exact old pages. The same raw V2 response decoded with a present count of three using the V2 client and exactly the old fields using V1. V1 sent the request bytes and its absent flag exercised the V2 default.
V2 client on V2 Explicit true included the count and explicit false omitted it. The server refused a malformed request. The V1 client could still close a topic and see the resulting reply refusal.
V2 client on a separate V1 The V2 request carried the new extension and the V1 handler returned the old page. The V2 decoder produced an absent new response field.
Full application page A 120-byte title, 2,000-byte topic body and twenty 2,000-byte replies returned intact. The 21st reply remained reachable by the cursor after the page-size cap.

The first canonical V1 took 76.0 seconds and completed at 18:10:44 UTC. The first V2 took 40.8 seconds. The first successful generated-client call reached V1 at 18:11:46.914 UTC, 5.702 seconds from host driver start. It preceded the failed KEEP. The aligned builds took 41.1 and 26.1 seconds, and the final installed run took 11.1 seconds inside the driver. The initial round-one build commands took 73.9 and 14.9 seconds. These host times include different cache states and shared machine activity.

Source and artifact identities

  • Source snapshot commit b66884df99ae6b82bb223dcebb92707ab293f2bf and SDK tree a017cd90e260974bdc499d45ee174825e5827c2b.
  • Canonical target wasm64-unknown-unknown with pinned nightly 2026-10-15, rustc 1.101.0-nightly (7df81381d 2026-10-14), and Node.js 24.22.3. V1 uses default features and V2 selects wire-v2.
  • Both aligned artifacts verified 1,619 files each. Their canonical 1,599-file source list at board.source-before.json has SHA-256 7ab5c61f06c7ed0a666256ec2dee09ea48433a73812c8c5c8b00b9d3411e2ebb.
  • Pinned PocketIC 16.1.0 SHA-256 6a9a75ad9b4551d2b0f4a0d954ffb8bd5bbd0ebc44ac00290679b06ad0b2f8e6, driver SHA-256 9d052306447fcb88cf1f104366b8a682e00071a0bd51a2d4fb9d6ed3d218f8e8.
Artifact V1 SHA-256 V2 SHA-256
Aligned installed Wasm d679a63117bc38e0c0ea8ea70bdaef988f96a75a619e11317898d26c787c445f 684b7b3a6683cc1a4eb049d884dd9ea8a394042fee98c29023f82f53bc10319b
Wire descriptor 32e657b445e382632f4cab2818e7395c7ec20e35df98f98ee5fc1673d32298a5 deed5d6cdc0130bb5bfe103f3cfb602def9ace74189d4af8a6480a09b9426d9a
Generated TypeScript 1ce7548fc530ba9f93c0976ea74947025822801fafff039f65c60377a018abec 6a5ebaf2ae562ed7582f18c40afd66049fc0c333f01ca98409a753cdb8dcf15e

The incompatible V2 Wasm hash is 8699b9068301e0883fba11ffe12e3903e864546bf9a64f36f66b9ef2cbaee202. The exact runtime companions and reports are in ignored tmp/ai-app-trials-round2/xx1/installed/ and installed-aligned/, alongside separate artifact directories. The workaround changed only the local build environment.

Inputs for a future skill

  • Start standalone setup at the build guide. Create the app lock online and fetch both full locks before attempting the canonical offline build. Use an app directory boundary between Cargo source and mutable test notes.
  • For additive changes, derive upstream Wire in V1 and preserve the stable record positions. Use Fixed to carry an intentionally fixed inner DTO. Verify both omission and a present extension using the emitted method bindings. Retain each release's schema, binding, adapter and codec together.
  • Follow the generated JavaScript sum shapes and compare record fields or clone values before asserting against literals. Reuse the exact raw response to prove what old and new readers saw.
  • A compiler-class rejection during KEEP occurs before the API handler can observe the evolved request. Compare raw identities by scope in the prepared inventories, then compare the ordered compiler flags in the build receipts. Keep successful in-place KEEP evidence separate from per-build check-wire.
  • For the pinned builder and this staging layout, equal Python hash seeds made the two preexisting remap orders agree. Treat that as a targeted diagnostic and workaround. A builder regression test should exercise equal-length physical roots under separate Python hash seeds, and the resolved builder should produce one deterministic order under both.

Replay commands

From the repository root with the archived SDK snapshot, a seeded private Cargo home and a qualified POCKET_IC_BIN, keep V1 and V2 outputs separate. These are the steps for the validated aligned pair.

sdk_snapshot="$PWD/tmp/ai-app-trials-round2/source"
forum_lane="$PWD/tmp/ai-app-trials-round2/xx1"
export CARGO_HOME="$forum_lane/cargo-home" CARGO_TARGET_DIR="$forum_lane/target"
export TMPDIR="$forum_lane/temp" CARGO_BUILD_JOBS=3 PYTHONHASHSEED=0
source "$sdk_snapshot/tools/env.sh"
forum_app=playground/xx1-round2/canister/Cargo.toml
forum_run=$(mktemp -d "$forum_lane/replay.XXXXXX")
cargo fetch --manifest-path "$forum_app" --locked
cargo fetch --manifest-path "$sdk_snapshot/cdk-rsx/Cargo.toml" --locked
python3 "$sdk_snapshot/cdk-rsx/tools/build-app.py" --manifest-path "$forum_app" \
  --name board --out-dir "$forum_run/v1" --offline --locked
python3 "$sdk_snapshot/cdk-rsx/tools/build-app.py" --manifest-path "$forum_app" \
  --features wire-v2 --name board --out-dir "$forum_run/v2" --offline --locked
env -u RRT_PIC_SERVER_URL node playground/xx1-round2/check.mjs \
  "$forum_run/v1/board" "$forum_run/v2/board" "$POCKET_IC_BIN" "$forum_run/results"