2026-11-26 15:37 UTC

Plannotator releases tree-sitter semantic-diff library

state: seedheat: mediumuncertainty: mediumrelevance: mediumcode-review coding-agents semantic-diffPlannotatorTypeSafeCloudflare

What is this?

Plannotator published sem-jiff, an open-source code-diff library for identifying structural changes that ordinary line diffs can obscure, including moves, renames, reformatting, function extraction and inlining. It uses tree-sitter and returns structured operations alongside a patch for diff viewers to render. Optional second opinions use Jev, from TypeSafe, and Clef, from Cloudflare; callers supply their own credentials. The GitHub project reports tests across multiple languages and comparisons with other tools, but these are maintainer-reported results, not independent evaluations. The supplied Hacker News item dates to Nov. 16, 2026; the linked GitHub page was fetched Nov. 15 UTC. Search results show related semantic-diff tools, but do not independently verify sem-jiff’s performance or adoption.

Why it matters

Sem-jiff could make code review less noisy by helping reviewers distinguish code that merely moved or changed form from code that changed behavior. Its structured output is also usable by other diff viewers and potentially coding-agent workflows. The reported accuracy and language coverage are promising but uneven and self-evaluated, so practical reliability remains an open question.

Current assessment

New: Plannotator has made @plannotator/sem-jiff available via npm, with Node support and browser setup instructions. The project says its tree-sitter-based rules favor precision: uncertain changes fall back to a plain diff rather than receiving a potentially misleading label. Its published evaluation reports 127 of 193 extraction/inlining cases found by the engine alone (66%), with 1 wrong claim among 133; adding Jev raises the reported find rate to 87% (168/193), with 5 wrong among 181 claims; Jev plus Clef reports 89% (171/193), with 5 wrong among 186. These figures are the maintainers’ own, and denominators differ because the reported claim counts vary. Comparisons are mixed: on Java extraction/inlining cases, the project reports fewer detections than RefactoringMiner but fewer wrong claims; on its TypeScript practice set it reports more detections and fewer wrong claims than RefactoringMiner. It also reports no detections on its tested Kotlin and Swift sets, so advertised language support should not be read as equal capability across languages. The project estimates Jev costs about $0.0004 per 500-line change and says repeated identical diffs are cached; both are project claims. Significance: a reusable, structured semantic-diff layer could help people and agent tools focus review on substantive edits, but evidence supplied here does not establish independent accuracy, adoption, or downstream improvements. Track independent tests and real-world use, especially by language and change type.

Measured heat

now 0 pts/hpeak 1 pts/hcomments 0/hpeers p10momentum: steady2 platformsage 290h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

11-14 13:00⭐ origin echo-reconstructedThe HN post links to the sem-jiff GitHub repo, but the repo’s README points further upstream to this launch post, which is the originating a
Plannotator (@plannotator) on x (echo) · attributed from hn.story.50510982
—
11-15 21:28first on hacker news · published · +32.5hShow HN: Semantic/Structural diffs powered by Jev
ramoz
—
11-15 21:28amplified on hacker news 👑hn.story.50510982
ramoz
peak 5 · 1 comments · 100% of case engagement
11-15 22:20our radar first saw it · +33.4hdiscovery anchor: hn.story.50510982—
pace: p50 vs 2096 stories at the 168h mark (now 290h old) — ahead of agent-command-multiplayer-rts (1.2x), behind advocacy-groups-sue-ai-companies-to-halt-model-development (0.9x)

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnShow HN: Semantic/Structural diffs powered by Jev
Retrieved article excerpt

Open article · Retrieved 2026-11-15T22:21:37.583419+00:00

# @plannotator/sem-jiff

Part of Plannotator, try [Plannotator Inbox](https://github.com/backnotprop/plannotator); an inbox to stay in the loop and organize better code review.

A diff shows lines that were added and deleted. Much of that is not a real change: a function moved,
a variable renamed, code reformatted, a block pulled out into a helper. sem-jiff reads both versions of a
file and says what each change really is, so a reviewer can skip what kept its meaning. It returns plain
data (`semanticOperations`, `semanticFolds` and the matching patch) that any diff viewer can draw.
The operation types in `src/pierre-types.ts` are copied from
[Pierre](https://github.com/pierrecomputer/pierre) (Apache-2.0).

Example, rendered in Plannotator:  
[Screenshot 2026-11-15 at 11 39 21 AM](https://private-user-images.githubusercontent.com/7244317/706991678-a54a923c-d2f9-408f-b5da-48ce40755bfb.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTQ3ODE1OTcsIm5iZiI6MTc5NDc4MTI5NywicGF0aCI6Ii83MjQ0MzE3LzcwNjk5MTY3OC1hNTRhOTIzYy1kMmY5LTQwOGYtYjVkYS00OGNlNDA3NTViZmIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MTExNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjExMTVUMjIyMTM3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGQwMjMyNzQ4Y2YyNWI5NTVkZmNiN2I1OWMxNGQ1ZTYyMjgyYjY4OWE2NWVjYzJjMGNlNjU4MjhkZTY5MDZhNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.sHkRI13sVxeUfEYSvyObrGtadeeG1x_irB77tfKkpQ4)

## What it finds

| Change | Example |
| --- | --- |
| Moved | `loadUser` moved below `saveUser`, unchanged |
| Moved and edited | moved, with a line changed on the way |
| Renamed | `MAX_RETRIES` became `MAX_ATTEMPTS` everywhere, nothing else changed |
| Reformatted | the same code laid out differently (line breaks, Prettier) |
| Reordered | imports or members re-sorted |
| Extracted function | a loop left `checkout` and now lives in a new `sumLineItems` it calls |
| Inlined function | a helper was removed and its body pasted where it was called |
| Added, deleted, edited | everything else, as a plain diff |

It prefers saying nothing to saying something wrong: a missed change falls back to
the plain diff, while a wrong label would mislead the reviewer.

## Install

```
npm install @plannotator/sem-jiff
```

## Usage

```
import { semanticDiffFile, languageForPath } from '@plannotator/sem-jiff';

const language = languageForPath('src/users.ts'); // 'typescript'
const { semanticOperations, semanticFolds, patch } =
  await semanticDiffFile(language, oldText, newText, 'src/users.ts');

// Give your diff viewer the patch too, so its layout matches the operations,
// then draw semanticOperations over it.
```

In Node nothing else is needed. In a browser, copy the grammars next to your app
(`npx sem-jiff-copy-wasm <dir>`) and tell the engine where they are served from with
`configure({ locateGrammar, locateRuntime })`. Options, `reviewSummary` and browser setup: [docs/usage.md](https://github.com/plannotator/sem-jiff/blob/main/docs/usage.md).

## Power Up: Jev and Clef

The rules are strict, so they miss extracted functions whose code was reworded on the way out.
Add a decision model and the engine asks it about exactly those candidates, once per file.
Your key, your account; call it from a server or your own machine.

**Try it with Jev** (by TypeSafe):

```
import { jevOpinion } from '@plannotator/sem-jiff/opinions';

const diff = await semanticDiffFile('typescript', oldText, newText, 'src/cart.ts', {
  secondOpinion: jevOpinion({ apiKey }),
});
```

**Or with both:** Clef (Cloudflare) breaks the tie when Jev is unsure.

```
import { jevOpinion, clefScore } from '@plannotator/sem-jiff/opinions';

const secondOpinion = jevOpinion({ apiKey, tieBreaker: { ask: clefScore({ accountId, apiToken }) } });
```

Fresh final set, 193 real extract and inline cases in TypeScript, Go, Rust, Python, Java and C#. Engine alone: 127 found (66%), 1 wrong of 133 claims. With Jev: 168 found (87%), 5 wrong of 181 claims. With Jev and Clef as tie-breaker: 171 found (89%), 5 wrong of 186 claims.

About $0.0004 per 500-line change with Jev. Answers are remembered, so opening the same diff again
costs nothing. More in [docs/usage.md](https://github.com/plannotator/sem-jiff/blob/main/docs/usage.md#second-opinion-power-up).

## How it compares

Extract and inline on real Java commits, 122 real cases in Guava, Kafka, Spring Boot and Netty: RefactoringMiner 96 found (79%), 19 wrong; sem-jiff 74 found (61%), 1 wrong. Wrong claims on held-out commits, moves, renames and formatting. Kotlin (ktor, Exposed): sem-jiff 0 of 46, difftastic 51 of 70, sem 0.8.0 40 of 164 audited. Swift (swift-nio, swift-composable-architecture): sem-jiff 0 of 158, difftastic 13 of 88 audited, sem 0.8.0 4 of 95 audited.

On TypeScript practice commits (187 real cases): RefactoringMiner 73 found, 14 wrong; sem-jiff 105, 1 wrong;
with Jev 148, 1 wrong. Every comparison: [harness/compare/README.md](https://github.com/plannotator/sem-jiff/blob/main/harness/compare/README.md).
How the engine is tested: [docs/verification.md](https://github.com/plannotator/sem-jiff/blob/main/docs/verification.md).

## Languages

TypeScript and TSX, JavaScript, Python, Go, Rust, Java, C#, PHP, Ruby, Kotlin and Swift.
What each one holds back in this version is in [CHANGELOG.md](https://github.com/plannotator/sem-jiff/blob/main/CHANGELOG.md).

## More

- [docs/usage.md](https://github.com/plannotator/sem-jiff/blob/main/docs/usage.md): options, `reviewSummary`, browser setup, second opinion, development commands
- [docs/verification.md](https://github.com/plannotator/sem-jiff/blob/main/docs/verification.md): how it is verified, every result, the known erratum in Pierre's fixture
- [docs/history.md](https://github.com/plannotator/sem-jiff/blob/main/docs/history.md): development milestones
- [docs/layout.md](https://github.com/plannotator/sem-jiff/blob/main/docs/layout.md): source layout and how a language is added
- [PACKAGING.md](https://github.com/plannotator/sem-jiff/blob/main/PACKAGING.md), [CHANGELOG.md](https://github.com/plannotator/sem-jiff/blob/main/CHANGELOG.md)

## Licence

MIT or Apache-2.0, at your choice (`LICENSE-MIT`, `LICENSE-APACHE`), like Plannotator.
`src/pierre-types.ts` and the Pierre fixture are Apache-2.0, copied from
[Pierre](https://github.com/pierrecomputer/pierre).
The WebAssembly files in `wasm/` (web-tree-sitter and the grammars) keep their own licences: see
`THIRD-PARTY-NOTICES`.
ramoz51
🟧 echo.x ⭐The HN post links to the sem-jiff GitHub repo, but the repo’s README points further upstream to this launch post, which is the originating aPlannotator (@plannotator)——

Interpretation history

Decision trace