feat(emergent-time): @ruvector/emergent-time WASM package + TypeScript SDK#566
Open
ruvnet wants to merge 1 commit into
Open
feat(emergent-time): @ruvector/emergent-time WASM package + TypeScript SDK#566ruvnet wants to merge 1 commit into
ruvnet wants to merge 1 commit into
Conversation
… Time
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: claude-flow <ruv@ruv.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
@ruvector/emergent-time— a WebAssembly build of theemergent-timecrate's Agentic Time layer, with a TypeScript SDK. Published to npm as@ruvector/emergent-time@0.1.0.Contents
crates/emergent-time-wasm/—wasm-bindgencdylib wrappingemergent-time(path dep).opt-level="z", lto, strip,dlmallocallocator. Excluded from the workspace so the cdylib is not built on the host by the workspace CI shards.npm/packages/emergent-time/— the published package: builtpkg/(wasm + JS glue +.d.ts),package.json,scripts/build.sh, and a detailed README.SDK
Centers on the agentic-time API (hand-rolled getters, no serde, to keep the wasm small):
AgenticClock— feed six-channelStateDeltas, get explainableTicks, cumulative agentic time, the Agentic Time Index (ATI), and 7-state health classification.WindowedDeltaClock(rolling z-score) andPageHinkleyDetector(adaptive CUSUM) change-point detectors.LearnedWeights— inference of an offline-trained logistic scorer.The physics modules (Wheeler–DeWitt, Page–Wootters, entropic, thermal) are not wrapped — they operate on dense complex matrices that don't serialize cheaply over the JS boundary; the README points to the
emergent-timecrate on crates.io for those.Sizes / validation
wasm-opt -Oz;wasm-tools validatepasses..d.ts.--target webloaded viainitSync): constructs a clock, feeds synthetic deltas, walks Healthy→Drifting→NeedsReplan→Collapsing→NeedsHumanReview as contradiction climbs; both detectors fire at the planted change-point.tsc --noEmit --strictpasses against a usage example.Honesty note
The README carries the same caveat as the crate/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 are exported so users can compare.
🤖 Generated with claude-flow