Conformance

Host integration checklist, import surface status, and netcode conformance requirements for integrators building on Ananke.

What this uses

@its-not-rocket-science/ananke @its-not-rocket-science/ananke/session examples/reference/host-coherence/ docs/host-contract.md docs/bridge-contract.md STABLE_API.md

Conformance means your host correctly implements the Ananke integration contract: deterministic tick stepping, correct command dispatch, and coherent state management. Non-conformant integrations will exhibit world state drift, incorrect physics outcomes, or replay failures.

Host integration checklist

0 / 0
Session lifecycle
  • Use createSession with a fixed worldSeed — never use Math.random() anywhere in the simulation path
  • Advance world time with runSession — do not manually increment tick counters or call kernel functions directly
  • Serialize with serializeSession before persistence — do not JSON-stringify internal entity maps directly
  • Fork with forkSession for branching — do not deep-clone session objects manually
  • Fixed-point arithmetic
  • All simulation values use fixed-point integers (Q scale = 65536). Never convert to floats in the simulation path
  • Display-only conversion: displayValue = q_int / 65536 — never feed converted floats back into the kernel
  • Distance in sub-metres (Sm): 1 Sm = 0.0001 m. Mass in Skg: 1 Skg = 0.001 kg
  • Determinism
  • Same worldSeed + same command sequence → identical tick-by-tick outcomes on any platform
  • Command log is the authoritative record — not entity snapshots. Store the command log, not the state.
  • No async operations inside the simulation tick loop — all commands dispatched synchronously per tick
  • Command dispatch
  • Commands are validated before dispatch — see src/sim/commands.ts for the full command schema
  • Entity IDs are stable across ticks — never reuse a dead entity's ID in the same session
  • Netcode / replication
  • All clients receive identical command streams — lock-step or deterministic rollback only
  • Clock synchronisation: tick dispatch times must be consistent across peers (within ±½ tick tolerance)
  • State divergence detected: compare serializeSession hashes across peers every N ticks

Import surface status

@its-not-rocket-science/ananke Tier 1 stable ✓
@its-not-rocket-science/ananke/session Tier 1 stable ✓
@its-not-rocket-science/ananke/units Tier 1 stable ✓
@its-not-rocket-science/ananke/sim/combat Tier 2 stable ✓
resolveHit · computeWeaponEnergy · CombatResult — full pair-based resolution, >95% coverage
@its-not-rocket-science/ananke/sim/disease Tier 2 stable ✓
exposeToDisease · stepDiseaseForEntity · spreadDisease — 6 built-in profiles, 100% coverage
@its-not-rocket-science/ananke/sim/hazard Tier 2 stable ✓
computeHazardExposure · deriveHazardEffect · stepHazardZone — 5 built-in zones, >95% coverage

Tier 1 exports have no breaking changes without a major version bump. Tier 2 stable exports are API-stable within @minor — breaking changes require a minor bump + CHANGELOG entry. See STABLE_API.md for the full contract.

Try this

  1. Read host-contract.md first — it is the normative integration spec.
  2. Run the host coherence reference implementation to see a conformant integration: examples/reference/host-coherence/
  3. Check the validation dashboard after each upgrade: Validation Dashboard — regressions appear immediately.
  4. Add a golden replay fixture in test/ for your core scenario — CI will catch any physics regressions.