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

@unreal-harness/rsi-trace

v0.1.0

Published

Discovery-tree trace and deterministic replay over a DeepSeek Harness session log

Downloads

115

Readme


description: "Discovery-tree tracing for RSI-style exploration harnesses: the durable rsi/node event, a ctx.sessionProjections fold, and the ctx.rsiTrace reader." kind: "package-reference"

@deepseek-ai/dsh-rsi-trace

English | 中文

Summary

dsh-rsi-trace turns a session's event log into a discovery tree — a tree of exploration attempts in which each node is one attempt and each edge is a fork. It adds no storage: it declares the durable rsi/node event, registers a ctx.sessionProjections unit that folds the log into the tree, and exposes ctx.rsiTrace for readers.

Mount it when a session explores rather than merely converses: when attempts branch from earlier attempts, carry a score, and are meant to be replayed or audited later. It is the trace/read half of an exploration harness — a replay engine, a policy runtime, and a workspace-snapshot store are separate concerns that consume it.

Table of Contents


Use this package

Mount the plugin. It provides ctx.sessionProjections registration and ctx.rsiTrace in one load, so neither can be present without the other.

- name: '@deepseek-ai/dsh-rsi-trace'

A session records its own node, then reports outcomes as they arrive:

// The attempt starts.
agent.session.append('rsi/node', {
  nodeId: 'root/b0',
  parent: 'root',
  branch: 0,
  attempt: 0,
  siblingOrder: 0,
  status: 'open',
})

// The evaluator returns. This UPDATES the node; it does not create a second one.
agent.session.append('rsi/node', {
  nodeId: 'root/b0',
  parent: 'root',
  branch: 0,
  attempt: 0,
  siblingOrder: 0,
  status: 'scored',
  score: 0.42,
})

Read it back through the service:

| Method | Returns | |---|---| | ctx.rsiTrace.tree(session) | the whole folded tree, or undefined before any state exists | | ctx.rsiTrace.nodes(session) | this session's owned nodes in creation order | | ctx.rsiTrace.childrenOf(session, parentId) | one node's children in creation order | | ctx.rsiTrace.current(session) | the node this session currently represents |

rebuildDiscoveryTree(header, inheritedEventCount, events) is exported for callers that rebuild from a raw log without a live projection.

Understand the implementation

A discovery node is one attempt, and its identity is the session that produced it. The tree is therefore not a new store: it is a projection of the session event log, and rsi/node is an ordinary durable event.

Two decisions carry the design.

Lineage comes from session metadata, not from events. init(header, inheritedEventCount) reads header.parentSession and header.isSeeded, so a fork edge is free — dsh already records it. The fold then skips every event before inheritedEventCount, so an inherited prefix never restates itself as the child's own work. A fork child's tree is exactly its own attempts.

Create-only fields are distinguished from updatable ones. seq (the position of the first record that created the node) and turns are create-only; status and score are updatable. A later record for the same node updates it in place. This matters because replay's youngest-first rule reads creation order: if an update moved seq, the tree would silently reorder.

The projection's stateVersion must be bumped whenever the serialized fields or the fold semantics change, so persisted rows from an older unit are discarded rather than forward-applied into garbage.

Further Exploration

Model Experience

None directly. rsi/node is log-only: it is not a SurfaceEventType, so it can never produce a surface node and the model never sees it. The service adds no tools and no prompt sections.

KV Cache effect

None. A discovery record appends to the log without touching the model-visible surface, so it neither extends nor invalidates a cached prefix.

Known Limitations and Deferred Work

  • The tree is only as complete as the records. A session that never appends rsi/node has a valid but empty tree; this package cannot infer attempts from turns alone, because which turn begins an attempt is a harness decision, not a log fact.
  • No replay, no policy runtime, no workspace snapshot. Replaying recorded children, executing policy code, and materializing per-node filesystem state are deliberately out of scope. This package answers "what is the tree", not "what would have happened".
  • siblingOrder is trusted, not derived. The youngest-first replay rule depends on it, so a writer that records it carelessly produces a well-formed tree with the wrong traversal order.
  • No tree-wide views. The reader is session-scoped, matching the projection's own scope. Aggregating a root's full descendant tree across sessions is the corpus reader's job (see session-query).
  • Scores are opaque numbers. No normalization, no comparison across tasks; a consumer that needs a scale owns that decision.