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

@crewhaus/watchme-store

v0.5.8

Published

Durable "watch me" observation store — per-harness session digests, judge verdicts, and the cross-harness registry behind crewhaus watchme

Readme

@crewhaus/watchme-store

Durable state for the "watch me" feature (crewhaus watchme) — the store that outlives the 30-day transcript TTL. Three pieces: a per-harness store of redacted session digests and judge verdicts, the global cross-harness registry, and the pure quality→shadow-arm join behind watchme report --feed-routing. Zero-dep by design: redaction is an injected callback at every CLI append site — this package never imports PII detectors and never inspects content.

Per-harness store

openWatchmeStore(rootDir, opts?) roots the store at <rootDir>/watchme (rootDir is the harness .crewhaus directory, the scoreboard convention) and returns { dir, appendObservation, readObservations, readAggregates, appendJudgment, readJudgments, compact, state, setState, windowKey, acquireLock }. Files (all mode 0600):

  • observations.jsonl — append-only WatchmeObservation digests plus {agg:1} Welford aggregate lines. No TTL: digests must stand alone after the transcript sweep (sessionId is provenance only, never a pointer). Appends are atomic small-line O_APPEND writes, so concurrent harness processes never lose each other's lines; malformed/torn lines are skipped on read. compact() folds raw lines into one Welford aggregate per <specName>|<target> key (mean/M2 of turn counts and pooled quality, summed token/cost/tool/feedback counters, per-intent counts) and lands write-then-rename; aggregates parallel-combine (Chan et al.) with later lines on the next compaction.
  • judgments.jsonl — append-only WatchmeJudgment verdicts from the budgeted phase-2 judge. Machine signal stays OUT of the human feedback channel; the explicit --emit-feedback bridge converts, never this store.
  • state.jsonWatchmeState (watching flag, analysis watermark, consumed report windows, last report time), tmp+rename atomic. A missing or torn file reads as the default rather than wedging the schedule.
  • run.lock — advisory single-writer lock in the dream-engine mold: acquireLock() is a try-once O_EXCL create returning a release fn or undefined on contention; a lock older than 30 s (holder crashed) is stolen and re-raced.

windowKey(nowMs, everyMs) is the report-window idempotency key — watchme:<spec>:<floor(nowMs/everyMs)>, fixed epoch-anchored flooring so every process computes the same window for the same clock. Pass specName in the options; without it the harness directory basename stands in.

Cross-harness registry

openHarnessRegistry(globalRoot, opts?) opens <globalRoot>/harnesses.json (global root default ~/.crewhaus/watchme; the CLI overrides via CREWHAUS_WATCHME_ROOT or --root) and returns { register, deregister, list }. Entries are keyed by absolute harness dir; register upserts (keeping registeredAt, refreshing lastSeen) and lands tmp+rename atomic. list() prunes tolerantly: entries whose dir vanished are dropped from the returned list and reported via onWarn — the file is only rewritten by register/deregister, so reads never race writers.

Quality join

joinQualityToArms(decisions, quality) joins durable route decisions to delayed quality scores per (sessionId, turnNumber); the decision's model names the arm. Emitted rows carry SHADOW routeKeys — "q:" + routeKey, a namespace the runtime router never mints or reads — so recording them observes routing quality without steering it. Scores clamp to [0, 1] and multiple scores for one turn average. Rewards are computed by the caller via routing-store's computeReward with obs.quality set; this module stays reward-free and fs-free.

Exports

openWatchmeStore, openHarnessRegistry, joinQualityToArms, and the types WatchmeObservation, WatchmeAggregate, WatchmeJudgment, WatchmeState, HarnessEntry, WatchmeStore, WatchmeStoreOptions, HarnessRegistry, HarnessRegistryOptions, RouteDecision, TurnQuality, QualityArmRow.