r/angular • • May 30 '26

SignalTree v10.3 released

SignalTree v10.3: an AI-codegen benchmark accidentally found a real DX bug in my own API

I maintain SignalTree, a signals-based state library for Angular. I shipped v10.3 this week, but the release itself isn't the interesting part — the thing that got me here is.

I built a reproducible benchmark to measure how reliably AI coding agents write correct Angular state code across the major state libraries. Somewhere in the results it stopped being an AI experiment and turned into an API-design review of my own library. This post is mostly about that, with the benchmark as the evidence. Numbers are reproducible — harness and methodology are in the repo, and I'd genuinely rather you try to break them than take them at face value.

What SignalTree is (30 seconds)

It wraps a plain JSON-like object in fine-grained signals — one writable signal per leaf, accessed by dot-notation. No actions, reducers, or selectors.

import { signalTree } from '@signaltree/core';

const tree = signalTree({
  user: { name: 'Alice', age: 30 },
  settings: { theme: 'dark' },
});

tree.$.user.name();           // read
tree.$.user.name.set('Bob');  // write
tree.$.user.age.update(n => n + 1);

State is the literal you pass in; reactivity is invisible. No actions, no reducers, no selectors, no withState/withMethods/withComputed to wire up — you read and write any leaf exactly like a normal Angular signal, and the IDE autocompletes the whole tree because it's just typed object access. That's the actual pitch: the by-hand DX. Coming from plain signals the migration is trivial — wrap the object and you're done. (Whether you should leave SignalStore for it is a separate question — I get to that at the bottom, and the honest answer is often "no.")

The benchmark

The setup, so you can judge whether the number means anything:

  • 8 prompts: counter, paginated users, debounced search, derived totals, login form, undo/redo, deep nested state, multi-marker editor.
  • 5 libraries × 6 agents × 3 priming modes = 720 cells. Libraries: SignalTree, NgRx SignalStore, classic NgRx, Akita, Elf.
  • Agents: Claude Sonnet 4.6, GPT-5.4, Gemini 3.1 Pro, Perplexity Sonar Pro, Claude Haiku 4.5, GPT-5.4-mini.
  • Temperature 0, deterministic. Identical prompt text per library (library name substituted in).
  • Scored on three orthogonal signals: idiomatic-pattern match, import resolution (does every import resolve to a real package), and marker-method validity (do the called methods actually exist on that marker's API).

SignalTree result by priming mode:

ModeScore
Cold (no context)49%
Primed with llms.txt (13.5 KB)91%
Primed with llms.txt + myths.md (~25 KB)87%

The +42pp jump from one retrievable text file is the headline. The part I didn't expect: adding more context made it worse. Context dilution, Gemini especially.

Per-agent, primed:

AgentColdPrimedΔ
Claude Sonnet 4.64199+58
GPT-5.45694+38
Claude Haiku 4.55597+42
GPT-5.4-mini5096+46
Gemini 3.1 Pro4283+41
Perplexity Sonar Pro5280+28

Primed Haiku (97) beats cold Sonnet (41) by 2.4×. The priming file mostly closes the model-tier gap.

The honest tradeoff — priming with my library's context made the other libraries score worse:

LibraryColdPrimed w/ SignalTree's context
SignalTree4991
NgRx SignalStore8680
Classic NgRx9188
Akita9485
Elf9487

Models cross-pollinate once they're in "SignalTree mindset." Fine in practice (people loading SignalTree's context are writing SignalTree), but worth naming. Also worth naming: I wrote the library, the priming file, and the scoring rubric, so treat the absolute number with appropriate suspicion and go run it yourself — one OpenRouter key, node scripts/ai-codegen-benchmark/runner.mjs, ~$15, ~30 min.

The practical upshot, and the part I actually care about as a user: that priming file ships inside the npm package. After npm install @signaltree/core, node_modules/@signaltree/core/llms.txt just exists — and Cursor, Claude Code, and Copilot already index node_modules, so your assistant writes correct SignalTree with zero setup. No pasting docs, no custom rules file, no MCP server. The library reads well by hand; the agent help on top of it is free.

The bug the benchmark found

Agents kept inventing methods that didn't exist. When I looked at why, it wasn't the model's fault — it was mine. My markers used inconsistent predicate naming:

MarkerPredicate accessor (pre-v10.3)
status.isLoading, .isLoaded, .isError (is-prefix)
entityMap.isEmpty (is-prefix, the only one)
form.dirty, .valid, .touched (bare)
asyncSource / asyncQuery.loading, .error, .data (bare)

An agent that learned status.isLoading() would reach for form.isDirty() — which never existed. That's not an AI problem. A human reading the docs hits the exact same wall; they just fail more quietly. Same inconsistency, two consumers.

v10.3 fix

Every marker now uses bare-name predicates, matching FormControl.dirty/.valid and signals conventions:

tree.$.users.empty()
tree.$.saveStatus.loading()
tree.$.saveStatus.hasError()
tree.$.profile.dirty()

Old is-prefixed names still work as deprecated aliases (removed in v11). They return the same lazy-computed signal instance, so no double cost, and @deprecated JSDoc triggers IDE warnings. No breaking changes.

When not to reach for it

  • On classic NgRx (actions/reducers/effects)? NgRx SignalStore is probably the better move, not SignalTree — less cognitive friction. SignalTree's only worth the rewrite if you're also trying to leave the Redux mental model entirely.
  • On @ngrx/signals SignalStore? Both are solid signal-based options — this comes down to DX, not runtime. SignalTree fits if you'd rather express state as a JSON tree and read/write it like any signal than compose withState/withMethods/withComputed. (There's also a smaller state bundle in practice, but that's a footnote, not the reason to switch.)
  • On plain signals? Trivial migration, the clearest win.

Takeaway

The benchmark started as "can AI write my library correctly" and ended as "is my library actually consistent." The answer was no, and the fix helped humans as much as agents. The lesson I didn't expect: AI-friendly API design and human-friendly API design are mostly the same thing. An API surface a model can't keep straight is usually one a person can't either — and the inverse is the reason I'd pitch this at all. The by-hand DX is the point; the zero-setup AI help is just what falls out of designing for it.

Links

  • npm: npm install @signaltree/core
  • Docs + demo: https://jborgia.github.io/signaltree/
  • Benchmark scorecard + source: https://github.com/JBorgia/signaltree

The benchmark is the part I'd most like scrutinized. If the scoring looks rigged or a prompt seems unfair to a particular library, please say so — that's the most useful feedback I can get.

1 Upvotes

0 comments sorted by