RRT port completeness and logic audit
Read-only implementation review on 2026-10-27. RRT has a substantive persistent execution implementation, but it is not a complete port of the neighboring Motoko libraries. Missing archival, block-reader replay and workflow-evolution features must not be inferred from throughput qualification.
Scope and evidence
- newstack:
257b4850e7c596352e72abcbb04d7532861e7fcd; SDK:33f54b62b46a6693ff6e193a752e052eaa124884. - Compared canonical Nyxus RRT against neighboring Motoko Rechain
2f523027, Reactor5532e0cc, and Takt602609ca. Rechain and Reactor were clean. Takt had local edits, including its Reactor adapters; the review used the actual working tree, not a claim of a frozen HEAD-only comparison. - Four independent source-review lanes covered Rechain, Reactor, Takt/generation and integration/qualification. Root checked the principal findings against both implementations. No library code was changed and no tests, model checks or benchmarks were rerun for this audit.
- Muck's Transport query loaded its inputs without syntax/loading failures, but reported incomplete analysis and an exhausted effect-convergence budget. It was navigation evidence, not a successful convention or semantic gate.
- Historical reports remain unchanged. Their archive, migration, codec and representation claims apply to their recorded versions, not automatically to current source. Start with the current orchestration guide.
Feature inventory
| Area | Current Rust implementation | Difference from current Motoko |
|---|---|---|
| Rechain dispatch | Prepare all reducers, admit storage, then commit synchronously; private commit token; IC trap on postmutation invariant failure | Core ordering is preserved; preparation purity remains a convention for custom reducers |
| Transaction replay | Exact framed identity, original successful block, strict creation-time window, bounded committed cleanup | Core semantics preserved; BLAKE3 replaces the source SHA-256 fingerprint contract |
| Recorded history | Local Nyxus history with record/byte limits and bounded queries | No archive fleet, transfer recovery, archive rotation/funding/upgrades or acknowledged-prefix reclamation |
| Rechain Reader | Absent | No persistent source/chain cursor, archive redirect traversal, contiguous replay validation or application-prefix acknowledgement |
| Certification | Adaptive publication, multi-chain tip witnesses, explicit empty/unrecorded states | Rust additionally composes an application subtree with Rechain under one certified root |
| Reactor delivery | Authenticated peers, accepted-prefix storage, exact retries, completion mailboxes, backoff | Main protocol ideas are shared with Motoko; newer-reader recovery and pending-work upgrades are narrower |
| Shared scheduling | Priorities, fair bounded driver batches, callback permits, deadlines and coalesced wakes | Rust adds typed ordinary-work priority ceilings and reusable driver slots; controller mechanics differ |
| Workflow execution | Generated graphs, local/remote tasks, choices, waits, parallel joins, retries, uncertainty and child/event coordination | Substantive execution coverage; specific policy discrepancies below |
| Upgrades and migration | Root-owned persistent state, drained KEEP; opt-in unchanged local-work KEEP | No current typed definition-migration planner or pending remote/child migration equivalent |
| Inspection | Authorized current snapshots, bounded compact events and workflow metrics | Rich historical visits/progress, retained revision archives and original graph snapshots are incomplete |
| JSON generation | Typed carriers, operations, ports, graph validation and source maps | Local safety generation is wrong; declared Types.Memory lacks the source compiler witness |
| Original applications | Throughput Fourcans, Chat and basic Rechain | Financial token/NFT/account/shop integration and its original IC recovery tests are not fully ported |
Sources: Rechain scope, Takt, local-work KEEP fixture, workspace members. The financial example ledger and older port checklist are historical evidence, not current passing qualification.
Findings to address first
1. Generated local tasks bypass their replay deadline
The Rust generator assigns Safety::ReadOnly to Local nodes, including local
Dispatch recipes, and overwrites a configured Defaults safety. It separately
emits their SafeUntil callback. The engine saves that deadline but enforces it
only for Safety::Idempotent. An already expired generated local operation can
therefore run its first handler, or retry after the configured horizon.
Motoko constructs local operations as Idempotent and checks the horizon at actual execution. This is a logic defect, not an intentional codec or memory change. Synchronous commit still prevents a successful local operation from becoming an uncertain remote effect; this finding alone does not establish duplicate successful effects. Existing Fourcans local nodes do not configure this deadline, so its throughput run does not exercise the defect.
Evidence: Rust policy generation,
deadline predicate,
saved task and execution check,
Motoko local operation (takt/src/Operations.mo:12),
Motoko execution check (takt/src/Engine.mo:359).
Add a generated Local/Dispatch deadline regression; the existing manually
Idempotent engine test does not cover generator output.
2. Reactor can retain a newer-generation message without a recovery path
Rust accepts and acknowledges a contiguous frame whose required_reader exceeds
its installed reader_version, stores it, and deliberately does not schedule it.
However, rebinding requires exact equality with the saved reader version. There
is no public version-advance/reindex operation, and the supported controller
shutdown refuses a nonempty inbox. resume also refuses an unsupported frame.
This creates a catch-22 through the current supported API if such a frame arrives.
Motoko rebuilds incoming readiness during reconstruction using the newly installed reader generation, retaining the original bytes and sequence. Reader generation is a capability gate, not permission to reinterpret an incompatible Wire schema. A repair needs an explicit compatible generation transition and pending-frame upgrade qualification, rather than deleting or resetting messages.
Evidence: acceptance,
binding restriction,
drain restriction,
resume restriction,
same-reader-only regression,
Motoko recovery (reactor/src/Transport.mo:494).
Names are independent: Rechain's Reader fetches and replays block history; Reactor's reader version gates incoming message capabilities. The former may use the shared scheduler but is not Reactor's decoder-generation mechanism.
3. A full recorded history cannot progress through the current public API
Rust returns StorageFull at its local history limits. There is no archive
transfer or local-prefix release. Rebinding also requires identical saved chain
count, names, descriptions and limits, so raising a quota or adding a chain is
not currently an operational configuration transition. A native test explicitly
expects a raised limit to fail. This is a documented prototype restriction with
a practical long-running limitation, rather than silent data loss.
Motoko supports owner-configured chains and archive transfer recovery; deletion waits for validation of the accepted archive prefix. Porting just an archive query field would not restore that lifecycle.
Evidence: quota rejection,
saved configuration comparison,
configuration regression,
disabled archive metadata,
Motoko chain binding (rechain/src/lib.mo:125),
archive coordinator (rechain/src/internal/ArchiveManager.mo),
Reader implementation (rechain/src/reader.mo).
4. Chain identity does not bind one schema and reducer composition
Rust's public Chain trait supplies an ID and Action, but each dispatch receives
its reducers and listener again. Two unrelated marker types can share an ID and
append different schemas to the same history. Passing an empty reducer tuple
also omits application validation. Current application wrappers use consistent
compositions; this is an accidental-misuse gap in the library API, not evidence
that those applications have corrupted histories.
Motoko binds a typed handle once per ID and captures its encoder/reducers. Rust also calls a fallible per-dispatch listener on unrecorded chains, whereas Motoko refuses listener registration there and binds a synchronous recorded-chain listener once. A Rust listener error traps the whole message; it does not return a partially committed business success.
Evidence: Chain trait,
dispatch inputs,
empty reducers,
listener invocation,
Motoko typed handle/listener (rechain/src/lib.mo:212).
5. Custom payload sizing is inconsistent across workflow boundaries
Generated DataBytes/ErrorBytes callbacks participate in admission and normal
execution through data_fits/error_fits. Remote reply capture and explicit
resolution instead use the generic PayloadSize path. A value can be accepted
or rejected differently depending on how it enters the engine. Later consumption
may apply the custom bound after the reply is already retained; that does not
make first admission equivalent. Motoko uses its configured sizing functions at
capture and resolution too.
Evidence: custom sizing helpers,
reply capture,
explicit resolution,
Motoko capture (takt/src/Engine.mo:647).
Test custom sizes that differ from the generic representation in both directions.
Workflow evolution and developer experience
Current Takt has no typed definition-migration module equivalent to Motoko's planner. Its Coordinator bindings are transient; Motoko persists and rewatches them. Supported Rust drain checks prevent this from silently losing live child work during KEEP, but it is narrower functionality, not pending-work migration. The unchanged local-work exception checks version/signature and forbids task or producer state before accepting KEEP.
The inspector returns empty visits/activeVisitIds/progress, only the current revision and empty archive pages. Its graph projection checks numeric version without the saved definition fingerprint. The execution loop discards wrong-definition queue entries without transitioning to Motoko's explicit DefinitionChanged status. Supported upgrade gates reject mismatched live work; these are inspection/rebinding/recovery gaps, not a demonstrated bypass of those upgrade gates.
The generator also accepts Types.Memory for ownership validation without
emitting a compiler witness for that declared type. Motoko checks both directions
against the runtime memory and checks the constructor. Rust's actual carriers
are still checked through their used types; an ignored JSON memory declaration
should not be described as fully validated.
Evidence: Takt exports,
runtime drain,
local KEEP check,
Coordinator bindings,
Motoko bindings (takt/src/adapters/ReactorCoordination.mo:107),
partial inspection,
revision/archive responses,
definition mismatch,
generated type aliases,
Motoko memory witnesses (takt/generator/index.mjs:253).
What the Reactor models establish
All five .tla models, their sixteen .cfg files and the check runner match
the neighboring Motoko Reactor copies. The recorded run checks finite positive
protocol cases and intentional negative mutations. This is valuable evidence
for accepted-prefix delivery, early completion storage, subscriptions, fairness
and physical-call accounting. Those ideas already exist in the Motoko source.
It is not a Rust implementation refinement proof or evidence that its upgrade,
Store, callback and allocation paths were exhaustively model checked.
Rust-specific implementation additions include ordinary-work priority types, reusable driver slots with serial fences and explicit physical callback disposition. Rust also uses shared immutable payloads, as Motoko does. Their actual tests and qualified artifacts remain separate from the copied abstract models.
Evidence: model scope, recorded model run, typed work drivers, driver slots, physical disposition.
Qualification and next work
The shared scheduler/runtime and generated child receiver are real integration, not benchmark stand-ins. Historical actual IC runs exercise substantial completed work, local blocks and certificates. They do not qualify absent archives, Reader, financial applications or active definition migrations. See the matched Heavy16 record and its bounded native qualification scope.
Fix generated local replay safety and newer-reader recovery first, then make payload bounds consistent and bind typed chain composition once. Treat archive storage/Reader and active workflow migration as explicit feature work. Add rich inspection only from real saved state. Qualify each runtime change with targeted rejection/recovery cases and matched Nyxus/Hylix Heavy16, preserving workload, instructions and latency. This audit supplies no new performance measurement.