← Catalog

@autotelic/joggle

Cross-file patterns and idioms for TypeScript — the layer above the linter and the typechecker.

Package

Install

Install with PiG

pig install npm:@autotelic/joggle

Install with Pi

pi install npm:@autotelic/joggle
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./extensions"
  ]
}

README

Written by the package's publisher, shown as published in version 0.13.0 (README.md). PiG does not review it.

joggle

Cross-file judgements for a TypeScript codebase, enforced like a linter.

CI

"I want to build the entropy reverser — a big sausage machine where you put all programs into it and you turn the handle and a smaller number of programs come out."

— Joe Armstrong, The Mess We're In, 2014

tsc checks one program. oxlint checks one file. joggle checks the codebase: it indexes it into facts, generates candidates cheaply and deterministically, and asks Jev the narrow questions a single file cannot answer. Are these two declarations one thing? Does this name mean the same here as there? Is this the primitive that already exists?

Every finding proposes one of three moves, and the report groups by them:

movewhat it says
contracta primitive already exists; this is a second copy. Delete it and use the primitive.
combinethe primitives exist; the combination was never written. A refactor.
expandneither: the vocabulary has to grow. A name, a type, a boundary. A design act.

The order is a ratchet, and the report prints it that way: the copies hide the primitives, so contract first, composing makes them explicit, and a new primitive is built out of the ones you can now see. A live repository holds many of these: each is a place the code ran ahead of its vocabulary. The moves matter more than the count. Why, and the three moves.

One rule is about promises rather than duplicates: intent-drift reads @deprecated tags, checks that the replacement they name exists, and asks the model whether a live import is a migration to finish or an intentional compatibility path. The facts stay deterministic; only the "should this change?" question is judged.

Jev

A judgement model, not a generator. It answers typed questions (yes or no, a choice among named options, a spectrum) with calibrated probabilities, and code keeps the thresholds: a decisive answer prints, an unsure one is recorded as a notice, a no is silent. Arithmetic, counts, spans and orderings all stay in code.

Verdicts are cached per question in .joggle/answers.jsonl, one sorted line per answer, so commit that file and CI replays every judgement with no key and no tokens. The lines are keyed and merge=union is enough for a branch merge, and joggle cache prune keeps the store from growing without a ceiling. A large store can be sharded instead (cache.layout: "sharded"); both are read. A yes/no is asked three times and the agreement across the asks becomes its confidence, because one number on its own has no margin. How joggle uses TypeSafe.

The evidence panel, including source excerpts, goes to api.typesafe.ai. Nothing else does, and --offline sends nothing at all.

Run it

pnpm install && pnpm build
npm link                             # puts `joggle` on PATH
joggle rules                         # what this repository enforces, by move
joggle check src                     # or no paths: tsgo says what the project is
TYPESAFE_API_KEY=… joggle check src  # the judged rules need the key
joggle check --offline               # replay the committed verdicts, no key

As a pi extension (pi.extensions → ./extensions), so pi can run it in whatever repository it is working in:

pi install /absolute/path/to/joggle  # global: adds the tools and the command
pi -e /absolute/path/to/joggle       # one run, no install

That adds joggle_check, joggle_rules, and /joggle.

Docs

thesis.md what it is for · writing-rules.md write a rule · rule-coupling.md the audit of every rule · calibration.md what the questions are worth · JOGGLE.md the architecture · docs/ everything else.

MIT.