ruvector/npm/packages/emergent-time/scripts
rUv 90a1dc12e1
feat(emergent-time): @ruvector/emergent-time WASM package for Agentic Time (#566)
Wrap the agentic-time layer of the dependency-free `emergent-time` crate in a
tiny wasm-bindgen surface for the browser, edge, and Node.

- crates/emergent-time-wasm: standalone cdylib (workspace-excluded so it carries
  its own opt-level="z" / lto / strip / panic=abort release profile and dlmalloc
  global allocator, mirroring crates/rvf/rvf-wasm). Hand-rolled getters, no serde,
  to keep the wasm tiny.
- SDK surface: AgenticClock (tick → explainable Tick{class,reason,deltaTime,
  per-channel}; cumulativeTime, ATI, 7-state health), StateDelta, Tick,
  TickClassJs, AgentHealthJs, WindowedDeltaClock + PageHinkleyDetector
  change-point detectors, LearnedWeights inference, version().
- Physics core (Wheeler-DeWitt / Page-Wootters / entropic / thermal / Structural
  Proper Time) deliberately not wrapped: dense matrices don't serialize cheaply
  over the JS boundary and would bloat the wasm. Documented in the README.
- npm/packages/emergent-time: package.json (@ruvector/emergent-time@0.1.0, ESM,
  main/module/types → pkg, files include pkg + README, publishConfig public),
  detailed README, build.sh pipeline (cargo @1.89 → wasm-bindgen --target web →
  wasm-opt -Oz with bulk-memory/nontrapping-float-to-int enabled), and the built
  pkg/ (wasm + JS glue + .d.ts).

Validation: wasm raw 62475B / opt 55009B (wasm-tools VALID); Node ESM smoke test
passes end-to-end (AgenticClock Healthy→Drifting→NeedsReplan→Collapsing→
NeedsHumanReview, cumulativeTime 19.36, both detectors fire at the planted jump);
tsc --noEmit --strict on a usage example against the shipped .d.ts exits 0;
npm pack --dry-run lists README.md + .wasm + .js + .d.ts.

Honest scope (mirrors ADR-251): the agentic clock is a diagnostic signal; it does
not establish an early-warning lead over a fair baseline on real traces. Both
fair baselines (windowed z-score, Page-Hinkley) are exported.

Co-authored-by: ruv <ruvnet@users.noreply.github.com>
2026-06-22 09:52:00 -04:00
..
build.sh feat(emergent-time): @ruvector/emergent-time WASM package for Agentic Time (#566) 2026-06-22 09:52:00 -04:00