shipwithjev

Catalog / Tools & apps

0281GitHub

jev-lint (mizchi)

Checks whether a function does what its name says, whether a comment is still true, and whether a test verifies what it claims, with a cutoff per rule.

mizchi/jev-lintREADME ↗
# jev-lint

[日本語](README-ja.md)

A lint tool that uses [Jev](https://typesafe.ai/) -- a fast classifier that
answers a natural-language question with a calibrated probability instead of
writing text -- to decide what a parser cannot.

This function is wrong, and nothing in your toolchain will say so:

```ts
/** Returns the cart, or null when no cart has this id. */
export function getCart(id: string): Cart {
  const cart = carts.get(id);
  if (!cart) throw new Error(`no cart ${id}`);
  return cart;
}
```

The comment promises `null`. The body throws. The return type is `Cart`, not
`Cart | null`. It type-checks and it lints clean.

A jev-lint rule is one sentence. An [ast-grep](https://ast-grep.github.io)
matcher picks which code to look at, and a model is asked that sentence about
each match -- here, *the comment above this code claims something that is not
true of the code* -- answering with a probability. **The code being judged is
sent to an API**, which is what the key pays for; nothing runs locally except
the matcher.

```bash
export TYPESAFE_API_KEY=...            # https://typesafe.ai
npx -y jev-lint check examples
```

```
examples/cart.ts
     16  flag  The comment above this code claims something that is not true of the code.
         comment-describes-declaration  0.89  cutoff 0.56
...
```

0.89 is the model's agreement and 0.56 the cutoff this rule ships with; under
it, nothing is reported. Six findings over two files, for a tenth of a cent;
[what a bigger run costs](docs/cost.md) is measured, not extrapolated.

## What it catches

Forty-eight questions ship, most of them asked in several languages -- 99
rules in all. Roughly:

- **A name against the thing it names.** A function, method, binding, type,
  class, trait or module; an npm script against the comm

Also filed under Tools & apps

  1. 0616

    Jevstiller: distill Jev calls into a local model

    A self-hosted proxy that trains a local model on Jev's answers. It served 72% of Banking77 locally at 15 ms, with a 2% audit and a bound on disagreement.

    tomerglick57 · Tools & apps · 15 ms local

  2. 0611

    Scruple: code checks for what linters miss

    Semantic-aware linting with System One models: rules you can state in a sentence, checked against your code by Jev.

    @nalexpeae · Tools & apps

  3. 0606

    Algolia-style Postgres search with a Jev reranker

    Typo tolerance, typeahead, barcodes and facet counts in plain Postgres SQL, plus an optional Jev step that asks one question per top-10 result.

    @alex_forman1 · Tools & apps

  4. 0604

    Virtual Closet: outfits from closet videos

    built a virtual closet & outfit generator from raw closet videos. classification + semantic search thanks to jev 🥰. clueless closet dreams finally coming to life

    @maitreemervana · Tools & apps