npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

causality-engine

v1.0.0-rc.1

Published

Deterministic causal world-simulation layer for games. CE owns world state, causal propagation, RNG, events, provenance, branching and rewind; your game renders.

Readme

Causality Engine (CE)

Deterministic causal world-simulation layer for games — derived conceptually from Kronos Engine, not a fork.

Traditional game logic asks: what happens when the player presses the button? Causality Engine asks: what changed in the world because the player pressed the button?

CE does not render, animate, or handle input. It remembers and propagates consequences.

GAME ENGINE  (Unreal / Unity / Godot / custom)
     ↑  rendering / physics / input
     │     ADAPTER  — player interventions → world state → events
     ↓
CAUSALITY ENGINE  — factions, economy, resources, events, persistence

Status

Under active research. The simulation core is deterministic and reproducible:

  • seed + interventions + config → identical world (SHA-256 stateHash / traceHash)
  • Cross-tick deterministic RNG (mulberry32, O(1) register capture)
  • Pure tick phases, no wall-clock, no Math.random

See docs/RECONNAISSANCE.md for the full architectural record — 20 sections covering quota, locality, tick model, agent design, and all verification evidence.

What CE currently proves

  • Causal quota as a budget governor — player pressure accumulates per-region/per-domain and crosses a threshold to trigger a resolution; cost tracks causal activity, not world size.
  • Causal locality — regions are simulation partitions; a disruption in Region A hurts neighbours with distance-decayed boundary signals and leaves distant regions alone.
  • Deterministic branching & rewindcheckpoint / restore / fork / rewind with explicit genealogy (WorldTimelineCheckpoint), across a real process boundary.
  • Feedback & convergence — a discrete-recurrence loop (grain supply → price → profitability → investment → capacity → supply) with six classified outcomes: converged, converged_at_bound, oscillating, diverging, settling, cutoff.
  • History lifecycle — provenance is bounded without changing stateHash; retention is explicit; schema migration is versioned and lossless where possible.
  • Event-stream contract — facts (fact vs internal), timeline-scoped deterministic ids, canonical per-tick total order, at-least-once delivery with idempotent consumers, explicit gap + resync_from_state.

No Unreal, networking, multiplayer, or LLM integration yet — by design.

Quick start

npm install
npm run check     # tsc --noEmit
npm test          # vitest — 305 tests (as of 2026-08-31)
npm start         # tiny deterministic world demo (3 towns / 2 factions / 5 resources)
npx tsx src/poc/stress.ts    # multi-intervention stress harness (Experiments A–G)
npx tsx src/poc/feedback.ts  # feedback & convergence driver
npx tsx src/poc/persistence.ts  # persistence & branching evidence
npx tsx src/poc/events.ts    # event-stream evidence
npx tsx src/poc/lifecycle.ts # compaction / retention evidence
npx tsx src/poc/sweep.ts     # quota parameter sweep (48 cells)

Project layout

src/core/        — deterministic engine (world, RNG, hash, event bus, retention, lifecycle)
src/game/        — generic game domains (economy, factions, ecology, civic, investment)
src/poc/         — evidence drivers + regression suites (determinism, stress, feedback, …)
docs/RECONNAISSANCE.md — the architectural record (read this first)

Ancestor

CE treats Kronos Engine as its architectural ancestor — reusing the domain-independent patterns (seeded RNG, snapshots, diff, adapters, strict TypeScript) while discarding Earth-specific content and redesigning persistence, branching, and the quota model for interactive worlds.

License

Apache-2.0 — see LICENSE.

Copyright 2026 Causality Engine Contributors. Game projects can use CE in commercial closed-source titles; see LICENSE for patent grant and attribution requirements.