Runtime safety and SDK migration

The 0.2.0-dev.20261105 SDK candidate (Python version 0.2.0.dev20261105) changes local integration behaviour. It is a development candidate, not a production qualification or a deployed RGS feature announcement.

Launch reservations

SessionStore.put must atomically insert a new binding or compare an existing one. An existing token can only be accepted for the same sub-operator, player and currency. Preserve the original creation time and binding; never read then overwrite it in two separate operations. The built-in memory stores enforce this locally.

SDKs retain a token's route after an error, including a rejected retry. A timeout or refusal does not prove that no earlier launch was accepted. Delete only after a separate lifecycle check proves there is no accepted session, open round or owed settlement. Rust's forget_session is explicit lifecycle cleanup, not an error-handler action. Pass a stable token and idempotency key when retrying a launch.

Transactional webhook inbox

Custom seen stores must implement runOnce (run_once, RunOnce, RunOnceAsync in the corresponding language). The receiver no longer uses separate has and add operations to dispatch events. Return true only after a newly handled event commits; false means the event already committed. Throw/return an error when processing or storage fails, so the receiver answers a retryable 500. Legacy stores must migrate; there is no unsafe fallback.

A production implementation must:

  1. Scope the inbox to its integration/operator and enforce uniqueness for each event id in the database.
  2. Use one transaction for deduplication, the handler's database writes and the inbox marker. Concurrent duplicate requests must wait for its outcome or fail retryably. Roll back on handler failure and recover after a crash.
  3. Use the same database transaction for application writes. A separate connection does not make those writes atomic.
  4. Make external effects idempotent by event id, or insert a durable outgoing obligation in the same transaction and let an outbox worker deliver it. An arbitrary HTTP call cannot be committed atomically with a database marker.
  5. Retain inbox records for the delivery/replay window agreed with RuneCode; never evict pending work.

MemorySeenStore serializes dispatch within the shared store instance and marks an event only after handler success. It does not persist across processes/restarts or roll back arbitrary handler side effects. A durable database implementation and its crash/recovery tests remain the integrator's responsibility.

Python also supplies SQLiteSessionStore and SQLiteSeenStore in runecode_operator.sqlite_stores as durable, single-host reference adapters. Supply a stable environment/operator namespace to each store:

from runecode_operator import SQLiteSessionStore, SQLiteSeenStore
sessions = SQLiteSessionStore("/persistent/integration.sqlite", "dev/aggregator-a")
seen = SQLiteSeenStore("/persistent/integration.sqlite", "dev/aggregator-a")

def on_event(event):
    # Migrate your application/outbox tables before starting the receiver.
    # All writes here share the inbox transaction. Include the namespace in your
    # own table keys if several operators share an application database.
    seen.execute("INSERT INTO outbox (id, payload) VALUES (?, ?)", (event.id, "work to deliver"))

run_once commits the marker and handler SQL together using SQLite WAL with synchronous FULL; errors and process death before commit roll both back. seen.execute only works inside that transaction and rejects transaction control, schema changes and direct inbox mutations. Drain the outbox with idempotent external effects. The SDK does not supply your application migrations or an outbox delivery worker. Protect database, WAL and backup files as credentials. Use local persistent disk and SQLite-aware backups; these adapters do not provide cross-host replication or network-filesystem safety. Their tests cover independent processes, restart, abrupt process death, concurrent duplicates, rollback and namespace isolation. Shared-database adapters and dev service qualification remain required for a multi-host deployment.

Numbers and HTTP

Crypto dependencies

Python requires cryptography==50.0.2; C# requires NSec.Cryptography 25.4.0 and its locked libsodium dependency. These replace custom big-integer signing while preserving pure Ed25519 signature vectors (not Ed25519ph). The selected NSec release supports the SDK's .NET 8 target; newer NSec releases have a newer runtime floor. Installation/backend failure is an error; there is no custom signing fallback. This change is not a claim of independent audit, FIPS certification or qualified production key custody.

Private source bundles

python3 tools/build-private-bundles.py --output /absolute/path/to/new-directory creates seven deterministic private source archives. Each includes installation commands, tests/vectors, migration documentation, dependency declarations/locks, licensing status and source/content checksums. Dirty source is refused unless --allow-dirty explicitly requests an unmerged evaluation candidate. Output must be outside the checkout. No registry publication, release signature or qualification approval is performed. Native package installation and platform compatibility still need qualification for each supported deployment target.