Rechain archive Reader probe

One prepared wasm64 image runs as three canisters. The source publishes scalar records and hands an acknowledged prefix to an archive. The independent indexer applies verified prefixes to a Nyxus vector and stores its Reader checkpoint under the same typed root. The fixture uses Reactor permits and bounded Wire calls for peer reads and transfer.

The host runner checks the source's archive redirect, accepts one record, then performs drained KEEP of the indexer using the same prepared image. A controller-only fault changes one returned archive payload. The Reader must reject that response while preserving the checkpoint and projection. Once the fault is cleared, the Reader resumes at the saved archive route, reads the live tail and leaves each source value in the projection exactly once.

The archive and mixed-version rehearsals share the prepared V1 artifact. Each runner starts its own PocketIC session.

Run from a release

Use the release build with example=rechain-archive-reader and the default features for the simulated production V1. Use the local host setup to set host and POCKET_IC_BIN.

v1="$run/artifacts/rechain-archive-reader"
node "$host/rechain-archive-reader.mjs" "$v1" "$POCKET_IC_BIN" "$run/archive-result"

For mixed-version history, keep the original artifact and generated client. Build the evolution-v2 candidate from the same application directory. The feature switch keeps the application source files in place. When you edit the source of your own app between builds, load the original client in your rehearsal with the saved manifest hash and frozen V1 source directory. Use the live-source loader for the current candidate. Verify a frozen app and build the candidate

python3 "$sdk/tools/build-app.py" --manifest-path "$run/app/Cargo.toml" \
  --name rechain-archive-reader --features evolution-v2 --offline --locked \
  --out-dir "$run/artifacts-v2" >"$run/build-v2.log" 2>&1
node "$host/rechain-evolution.mjs" "$v1" "$run/artifacts-v2/rechain-archive-reader" \
  "$POCKET_IC_BIN" "$run/history-result"

Rehearse mixed-version history

The default build is the fixture's simulated production V1. The evolution-v2 build adds an optional tagged transfer memo and two action kinds. Both retain the same Rechain block and record-family identities. Their application envelope keeps a stable group, action ID, and bounded body. Its economic group requires the projection to understand the effect. The auxiliary group promises that unknown actions have no effect on the V1 transfer view.

The rehearsal installs the V1 source, archive and indexer, populates the chain and stores a Reader checkpoint. Only the source upgrades to V2. The original TS client can still publish a transfer. The V1 archive accepts both versions, and the V1 indexer verifies each link through an unknown auxiliary note before matching its checkpoint hash to the certified tip. The V1 codec reads the old core of a new transfer with a present memo. The V2 codec reads a historical transfer with the memo absent. A V2 indexer replays all records, including the new actions. The generated codecs also decode and re-encode the original Rust-produced bytes for the fixed record envelope and the evolving transfer body. The original generated client's header codec feeds independent JavaScript BLAKE3 verification from the archive through the source's signed tip. The host verifies freshness with the replica clock and rejects a changed tip, a changed witness, and a stale certificate.

The runner also checks tampered archive bytes, an unknown economic action that the V1 projection refuses, and a malformed known payload that prevents projection of the same batch's valid leading record. Projection rows and the acknowledged Reader prefix are committed together. The simulated production baseline is the default build of this fixture at the tested revision.

Run both rehearsals with the repository test runner and a qualified POCKET_IC_BIN.

python3 tools/test.py run --task integration:rechain-evolution