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

@mmmnt/feat-adapter-model

v0.1.0

Published

Recorded-judge service adapter for Feat: a judgment port's seeded answers and captured asks in one JSON Lines file per namespace; no network, never calls a model

Readme

@mmmnt/feat-adapter-model

Recorded-judge service adapter for Feature, the .feat execution specification language. Use it for a judgment port: the part of your system that asks a language model to decide something. A spec seeds the answers the judge gives and predicts the asks the system makes. Nothing goes over a network and no model is ever called, so a run is repeatable, free and needs no key.

The adapter keeps the port's records in one JSON Lines file per namespace. Your system reads its recorded answers from that file and appends its asks to it. The adapter is the same at every tier, because there is no product behind it (ADR-0028, SPEC-ADPMODEL-001).

Install

npm install --save-dev @mmmnt/feat-adapter-model

Requires Node 20 or later and @mmmnt/feature in the project. There are no runtime dependencies beyond @mmmnt/feat-types.

Configuration

// feat.config.json
"services": {
  "model": {
    "adapter": "@mmmnt/feat-adapter-model",
    "consistency": "strong",
    "options": { "dir": ".feature/judge" }
  }
}

| Option | Type | Meaning | | --- | --- | --- | | options.dir | string | Required. The directory holding the record files, absolute or relative to the project root (the directory holding feat.config.json). It is created if missing. |

dir is the only option. Any other key, a missing dir or one that is not a non-empty string is OPTIONS_INVALID when the adapter is created. Point dir at a directory your project ignores (for example under .feature/).

Declare the service strong or acid. settle() vouches as soon as a window is open, so absences are proven without waiting out a timeout.

The record file

The file is <dir>/<namespace>.jsonl, where the namespace is the one feat run derives for each spec file (^s[0-9a-f]{12}$, SPEC-RT-006). The adapter creates the file empty at setup(), empties it at reset() (before every case) and removes it at teardown(). Without a namespace the adapter refuses with NAMESPACE_INVALID.

Every record is one line: a JSON object, then LF.

{"type":"judgment.answer","payload":{"purpose":"extraction","unitId":"ws:ws-1/entry:e-42","chunk":0,"candidates":[{"type":"Aggregate","name":"Order","context":"Sales"}]}}
{"type":"judgment.ask","payload":{"purpose":"extraction","unitId":"ws:ws-1/entry:e-42","chunk":0,"judgmentId":"0123456789abcdef0123456789abcdef"}}

| Field | Required | Meaning | | --- | --- | --- | | type | yes | A non-empty string: the record type the spec names. | | payload | yes | An object, kept exactly as written. | | key | no | A string. Without it the record is keyed by its 1-based line number. | | timestamp | no | A number. Without it the record is stamped with its line number. | | metadata | no | An object. |

A last line without its LF is a write in progress and is not read until its LF lands. A complete line that is not such an object fails the case with RECORD_MALFORMED, naming the file and the line number.

What your system does

  1. Learn the namespace (from FEAT_NAMESPACE, or from your spec host's setup) and the directory, and open <dir>/<namespace>.jsonl.
  2. To answer a judgment, read the file's complete lines and find the recorded answer your port's key names (for example the hash of the chunk's inputs). Matching an ask to an answer is your port's job: the adapter carries no matching rule, so any payload shape works.
  3. Append each ask as one line, with its LF, before your handler returns. A write buffered past the reply is outside the fence and may be missed (ADR-0021).

Example

scenario "the extraction asks once and records the judge's candidates":
  given:
    seed model [ judgment.answer with RecordedJudgeAnswer { purpose: "extraction", unitId: "ws:ws-1/entry:e-42", chunk: 0, candidates: [{ type: "Aggregate", name: "Order", context: "Sales" }] } ]
  when: Extract { pointer: "ws:ws-1/entry:e-42" }
  predict success:
    response OK Extracted { candidates: 1 }
    model has [ judgment.ask with ModelAsk { purpose: "extraction", unitId: "ws:ws-1/entry:e-42", chunk: 0, judgmentId: matching "^[0-9a-f]{32}$" } ]

The seeded answer is in the file before the window opens, so it is never captured. Only the ask the system wrote is. model has [] asserts that the system asked nothing.

Observation

The adapter declares observes = { diff: "native", state: true }.

| Prediction | What it reads | | --- | --- | | model has [...] | The complete lines appended after startCapture, in written order. peekCapture reads the same and consumes nothing. With no window open, both return []. | | model contains [...] | read(): every record in the file, seeded answers and asks, in written order. |

Faults

The adapter declares no fault catalog. A fault model ... line is FAULT_UNSUPPORTED before the case runs. To specify a judge that does not answer, seed no answer and predict your system's reaction.

Errors

ModelAdapterError { code, detail }:

| Code | When | | --- | --- | | OPTIONS_INVALID | At creation: the options are not exactly { dir } with dir a non-empty string. The detail names the key. | | NAMESPACE_INVALID | At creation: no namespace, or one that does not match ^s[0-9a-f]{12}$. | | RECORD_MALFORMED | At a capture or a read: a complete line is not JSON, or not an object with a non-empty string type and an object payload, or its key, timestamp or metadata has the wrong type. The detail names the file and the line number. |

License

MIT