Ashroot integrity and lifecycle probe

This fixture is also the versioned authoring reference. Domain declarations, relationships, projections and complete converters live together:

src/
  lib.rs                     endpoints delegate to domain views
  api.rs                     bounded Wire records for this fixture
  fleet/
    mod.rs                   domain service selection
    checked.rs               transient managed-table view and business methods
    manual.rs                matched handwritten benchmark control
    memory/
      mod.rs                 frozen versions and current selector
      v1.rs                  predecessor tables and interpretation
      v2.rs                  successor tables and complete V1 → V2 converter
      v3.rs                  successor tables and complete V1/V2 → V3 converters
  root/
    mod.rs                   declarative lifecycle and service binding
    storage.rs               one physical authority and provider restoration
    memory/
      mod.rs                 version selector only
      v1.rs                  root Data/Children/Memory wiring
      v2.rs                  root wiring and opaque child conversion
      v3.rs                  root wiring and opaque child conversion

The domain's version policies capture the complete production version file and shared fixture row definition, with explicit engine/configuration inputs. Root converters only delegate opaque children. The extra handwritten control and feature matrix are qualification machinery; an application needs its own domain view and the versions it actually supports. See the convention for the placement and authoring obligations.

This fixture owns four private table modules. The default selects Nyxus for all four. With mixed, People uses Nyxus, Cars and Locks use Hylix, and Passes uses Minima fixed slots with retained primary/index storage. Hylix and Minima share one physical stable authority; transient resources are reconstructed after KEEP.

People has descending score, unique name and composite country/score indexes. Cars points to People with cascade. Passes points to both People and Cars with cascade, forming a diamond. Locks restricts deletion of a referenced Pass. Every query snapshot includes all primary rows and every secondary/reverse index for an independent host oracle. Row values are fixed four-u64 fixture records; this probe does not establish arbitrary Hylix owning-row conversions.

Run from a release

Use the release build with example=ashroot-mixed and add --features mixed to build-app.py. Use the local host setup to set host and POCKET_IC_BIN.

node "$host/packaged-probes.mjs" ashroot-mixed "$run/artifacts/ashroot-mixed" \
  "$POCKET_IC_BIN" "$run/ashroot-result"

The generated client seeds 32 rows in each table, compares the rows, indexes, and stable image across same-image KEEP, then exercises Restrict and the diamond Cascade on the restored tables. See the root lifecycle, shared stable authority, and managed view.

Replay Reindex and Recode

Keep the mixed V1 artifact from the initial release build. Build V2 and V3 from the same app directory and lockfile. Each feature selection uses the same Wire methods with a different installed database schema.

(
set -e
for schema in v2 v3; do
  python3 "$sdk/tools/build-app.py" --manifest-path "$run/app/Cargo.toml" \
    --out-dir "$run/artifacts-$schema" --name ashroot-mixed \
    --features "mixed,$schema" --offline --locked
done
node "$host/packaged-probes.mjs" ashroot-mixed "$run/artifacts/ashroot-mixed" \
  "$POCKET_IC_BIN" "$run/ashroot-migration-result" \
  --reindex "$run/artifacts-v2/ashroot-mixed" \
  --recode "$run/artifacts-v3/ashroot-mixed"
)

The runner seeds one canister and upgrades it twice. V2 uses Reindex to retain the primary rows and add an ordered age index. A V2 insert must survive the next upgrade. V3 uses Recode to move People to Hylix, Cars to Minima, and Passes to Nyxus. It also converts Cars to nullable owners and changes the score index projection. The original client reads both successors. All three clients agree on the converted snapshot, and a V3 delete exercises SetNull on the converted relationship. V2 index migration · V3 row and engine conversion

Qualify migration from the checkout

The companion features reject-contract and trap-upgrade exercise rejected interpretation and rollback after admitted restoration. The frozen V1 schema and root also support actual two-image conversions. v2 adds an age index and rebuilds all indexes through checked Reindex mappers. v2-engine implies v2,mixed and additionally moves People Nyxus to Hylix, Cars Hylix to Minima, and Passes Minima to Nyxus through Recode mappers. Locks remains Hylix. v2-unique-age replaces the new age index with a unique index, allowing the runner to reject a seeded source with duplicate ages and verify complete rollback. Adding trap-upgrade to a V2 image traps after conversion and checks rollback to the V1 state.

Build each feature variant separately with the canonical SDK builder, fresh artifact destinations and one owned Cargo target. Root workspace entry is tests/Cargo.toml, package ashroot-probe-canister. SDK sources and the source pin must stay fixed throughout each qualification. These feature combinations are deliberately separate images; the fixture does not support an all-features build.

The manual feature selects a native handwritten control with the same four private table memories, primary rows, complete indexes, foreign checks and operation gate. It shares only the public bounded deletion planner and key ordering wrapper with Ashroot. Supply its artifact as --manual-native to run the same oracle, work sequence and cost captures. This measures typed table coordination overhead over that control; it is not a dependency-free image or a mixed-engine manual cost comparison. Combining manual with mixed or v2 deliberately rejects compilation rather than silently substituting storage or migration behavior.

The minimum representative lifecycle/cost screen uses these 13 separately built images. It covers native and mixed paths plus the handwritten native control; the broader scale, key-shape and timing matrix remains separate qualification.

Artifact directory Cargo features
native none
mixed mixed
manual-native manual
native-reject reject-contract
mixed-reject mixed,reject-contract
native-trap trap-upgrade
mixed-trap mixed,trap-upgrade
native-v2 v2
mixed-v2 mixed,v2
mixed-v2-engine v2-engine
native-v2-unique v2-unique-age
native-v2-trap v2,trap-upgrade
mixed-v2-engine-trap v2-engine,trap-upgrade

An optional mixed-v2-trap image with mixed,v2,trap-upgrade repeats the late rollback check for mixed same-engine reindexing. An optional mixed-v2-unique image with v2-engine,v2-unique-age rejects duplicate ages while populating a new Hylix People table. Supply them as --mixed-v2-restore-trap and --mixed-v2-unique-age respectively. Neither unrun cell is implied by the minimum screen.

Build from the factory root with an exclusively owned Cargo target and a fresh artifact root. The following commands are a reproducible recipe, not a build receipt. Set ASHROOT_RUN_DIR to a new directory below tests/tmp:

(
set -e
export CARGO_TARGET_DIR="$ASHROOT_RUN_DIR/target"
export TMPDIR="$ASHROOT_RUN_DIR/temp"
source tools/env.sh
while IFS='|' read -r variant features; do
  args=(--manifest-path tests/Cargo.toml --package ashroot-probe-canister
        --out-dir "$ASHROOT_RUN_DIR/artifacts/$variant" --name probe
        --offline --locked)
  if [[ -n "$features" ]]; then args+=(--features "$features"); fi
  python3 cdk-rsx/tools/build-app.py "${args[@]}"
done <<'MATRIX'
native|
mixed|mixed
manual-native|manual
native-reject|reject-contract
mixed-reject|mixed,reject-contract
native-trap|trap-upgrade
mixed-trap|mixed,trap-upgrade
native-v2|v2
mixed-v2|mixed,v2
mixed-v2-engine|v2-engine
native-v2-unique|v2-unique-age
native-v2-trap|v2,trap-upgrade
mixed-v2-engine-trap|v2-engine,trap-upgrade
MATRIX
)

Stop on any failed build and preserve its fresh output. Prepare the generic Wire runtime from one completed artifact's tool if it is not already current:

python3 cdk-rsx/tools/wire_runtime.py \
  --wasm-tool "$ASHROOT_RUN_DIR/artifacts/native/probe.wasm-tool" \
  --out-dir tests/pocketic/.generated

Run the actual artifact checks from the factory root. A second run uses a new output directory and its own server; two fresh runs provide independent samples without conflating the lifecycle checks with a latency distribution:

env -u LD_LIBRARY_PATH -u LD_PRELOAD node tests/pocketic/ashroot-lifecycle.mjs \
  --source-root="$PWD" --pocket-ic="$POCKET_IC_BIN" \
  --native="$ASHROOT_RUN_DIR/artifacts/native/probe" \
  --native-reject="$ASHROOT_RUN_DIR/artifacts/native-reject/probe" \
  --native-restore-trap="$ASHROOT_RUN_DIR/artifacts/native-trap/probe" \
  --native-v2="$ASHROOT_RUN_DIR/artifacts/native-v2/probe" \
  --native-v2-unique-age="$ASHROOT_RUN_DIR/artifacts/native-v2-unique/probe" \
  --native-v2-restore-trap="$ASHROOT_RUN_DIR/artifacts/native-v2-trap/probe" \
  --mixed="$ASHROOT_RUN_DIR/artifacts/mixed/probe" \
  --mixed-reject="$ASHROOT_RUN_DIR/artifacts/mixed-reject/probe" \
  --mixed-restore-trap="$ASHROOT_RUN_DIR/artifacts/mixed-trap/probe" \
  --mixed-v2="$ASHROOT_RUN_DIR/artifacts/mixed-v2/probe" \
  --mixed-v2-engine="$ASHROOT_RUN_DIR/artifacts/mixed-v2-engine/probe" \
  --mixed-v2-engine-restore-trap="$ASHROOT_RUN_DIR/artifacts/mixed-v2-engine-trap/probe" \
  --manual-native="$ASHROOT_RUN_DIR/artifacts/manual-native/probe" \
  --output="$ASHROOT_RUN_DIR/results-1"

The runner owns its server/instance, checks canonical build receipts and preserves full per-update traces. Body counters, whole-update instructions, included page costs, cycle debits and raw/prepared/gzip sizes remain separate. Missing optional artifact companions are reported explicitly. Migration cases use separate V1 canisters, check the complete rebuilt index oracle, reject downgrades, check same-artifact V2 KEEP and exercise fresh indexed CRUD/cascades. Ordinary same-artifact KEEP remains a separate qualification result.

For the complete thirteen-image matrix and two independent 32-row plus one 1,000-row cohort, use qualify-ashroot.py with an exclusive target and a fresh result directory:

source tools/env.sh
python3 tests/tools/qualify-ashroot.py \
  --target-dir "$CARGO_TARGET_DIR" \
  --output "$PWD/tests/tmp/ashroot-fresh-qualification" \
  --pocket-ic "$POCKET_IC_BIN"

Heavy repeated upgrade tests can exhaust install-code quota. The runner records that exact platform refusal, allows 100 normal scheduler rounds and retries the same upgrade at most three times. It preserves rate limits and application data; all other upgrade errors propagate immediately. Ordinary captured update costs remain separate from these lifecycle retries. The recorded qualification preserves the original quota-limited attempt and the successful rerun.

Fresh-generation V3 evolution and sustained operations

The current source uses scalable Lists and generalized source-selected migration. Its new V1 builds are a fresh generation. Frozen first-generation archives, binaries and evidence remain unchanged; these images do not claim admission of those old binaries.

tests/pocketic/ashroot-evolution.mjs requires the following 12 images, built separately with the same canonical builder and fresh artifact destinations:

Runner argument Cargo features
--native none
--mixed mixed
--manual-native manual
--native-v2 v2
--mixed-v2 mixed,v2
--native-v3 v3
--mixed-v3 mixed,v3
--mixed-v3-hylix-car v3-hylix-car
--native-v3-missing-parent v3-missing-parent
--mixed-v3-missing-parent mixed,v3-missing-parent
--native-v3-trap v3,trap-upgrade
--mixed-v3-trap mixed,v3,trap-upgrade

Supply every argument as the corresponding canonical artifact stem, together with --source-root, --pocket-ic and a fresh --output below tests/tmp. --rows=32 selects the small integrity population. --large-rows=50000 selects the real mixed migration population; the runner requires an actual post-upgrade attempt with more than one DTS slice. A smaller population which never crosses a slice fails that gate rather than silently receiving a DTS qualification label. Source seeding uses bounded earlier update calls; migration itself is one synchronous installation operation.

V3 changes four tables into five in a different order, drops Locks, adds Tags and Receipts, changes indexes/FKs and explicitly recodes Cars into a real boolean-plus-owner row. Its nullable FK uses SetNull. The derived unique key checks conflicts between multiple prospective null rows and against a live unaffected null row before mutation. New optional Cascade references construct a cycle through ordinary checked writes. The Hylix-Car image repeats the SetNull cases on Hylix, alongside Nyxus and hybrid Minima. Complete paged primary/index oracles verify large datasets without increasing the bounded legacy snapshot response.

The runner also performs 180 scalar CRUD calls per arm and real N1/N16/N100 bounded-prefix batches over native, mixed and handwritten native storage. It checks first/middle/last refusal, untouched input suffix, zero-item admission, complete frame rollback after batch/SetNull writes, top-100 ordering and exact candidate/control outcomes. Prefix completion is explicit; it is not labelled all-or-nothing batch admission. Complete traces, instruction/page coverage, cycles, local host time, source hashes and platform quota-retry attempts remain separate evidence. The runner performs no external deployment.

The current native V3 car conversion uses NativeValues to exercise consuming conversion and index construction in one pass; mixed-engine car conversion uses Recode. Both use the same pure row mapper and host oracle. The V3 Cars table uses table!'s inline validator. The declaration tests check forwarded Serde field attributes and exact Wire encoding. The mixed configuration also checks fixed-width Hylix encoding.