Skip to content

feat(benchmarks): error-prevention benchmark, part 1 (#158) - #205

Merged
JuroOravec merged 9 commits into
mainfrom
benchmarks/error-prevention
Oct 20, 2026
Merged

JuroOravec merged 9 commits into
mainfrom
benchmarks/error-prevention

Conversation

@JuroOravec

@JuroOravec JuroOravec commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Part 1 of #158. This first part does not close it. The next parts add checks that cover the whole data flow (backend to template, browser code and CSS; inputs, events, slots and requests), then the checks other frameworks' tools make that Citry may be blind to, and the frameworks the performance benchmark already compares.

What this adds

  • benchmarks/errors/: the same 24 developer mistakes written in Citry, Django + HTMX + Alpine, Jinja + HTMX + Alpine, FastHTML, Nuxt and Next.js. The runner applies one mistake at a time to a clean app, runs each framework's tools, then starts the dev server in Chromium and compares the page with the clean app's. It records where each mistake was first reported.
  • Each framework is measured with its starter's tools plus the linters and type checker its projects commonly add: pyright in standard mode and ruff for every Python stack, djLint for Django and Jinja templates, and ESLint for Nuxt and Next.js. A mistake caught by the language's own checks counts as caught, for example FastHTML's typed component functions under pyright.
  • results/2026-10-20/report.html: a self-contained page that opens from disk. It has a stacked bar per framework with five outcomes (static error or warning, runtime error or warning, missed) plus the mistakes that do not apply, and the full table grouped by category, Citry first. matrix.md and results.json sit beside it.
  • A docs page, About → Error prevention, with the same chart and table, built from docs_site/data/error_prevention.json.
  • docs/design/error_prevention_benchmark.md: the decisions on Benchmarks: compare which mistakes each framework catches, and when #158's open questions, the fairness rules, and how the runner behaves when something goes wrong.

Result (run of b0ef345, no uncommitted benchmark changes)

Outcome Citry Django Jinja FastHTML Nuxt Next.js
Static/IDE error 16 3 2 11 13 18
Static/IDE warning 1 0 0 0 0 0
Runtime error 3 5 10 5 5 2
N/A or prevented 0 1 3 3 1 2
Missed 4 15 9 5 5 2
(caught/total) 20/24 8/23 12/21 16/21 18/23 20/22

What Citry misses:

A fix branch for #202, the attribute-value default and misspelled c- directives is in progress separately.

Review

Three independent review rounds checked every cell against the raw tool output and did a separate prose pass. They found:

  • one wrong cell (Django m11), now fixed;
  • several unfair case shapes, fixed;
  • runner bugs: severity missing from the finding key, timings read as status codes, an indirect note that accepted any finding elsewhere, and unlocated failures counted blindly. All fixed, with tests (34 runner tests, 19 docs tests).

The commit messages list every case changed after its first result. The docs build check passes with 0 errors and 0 warnings.

Left for later

🤖 Generated with Claude Code

JuroOravec and others added 3 commits October 20, 2026 11:47
Write 24 framework-neutral developer mistakes into Citry, Django + HTMX +
Alpine, Jinja + HTMX + Alpine, FastHTML, Nuxt and Next.js, and record the
earliest place each framework reports them: editor, check, build, runtime
error or warning, silently wrong, or never. The runner in
benchmarks/errors/runner runs each framework's tools on a copy of its clean
app with one mistake laid over it, then drives the development server in
Chromium and compares the page with the clean app's.

Each framework is measured with its starter's tools plus the linters and
type checker its projects commonly add: pyright in standard mode and ruff
for the Python stacks, djLint for Django and Jinja templates, ESLint for
Nuxt and Next.js.

The docs site gets an Error prevention page with a stacked bar chart of the
six outcomes per framework and the full grouped table.

Cases fixed after their first result because they did not express their
mistake: Django m11 now renames the closing tag too (it was an unclosed
tag, m22); FastHTML m12 lost a stray f-string prefix that ruff flagged;
FastHTML m03 is not applicable (a Python call argument is m17); Next m03
writes the expression as a string literal; Next m17 computes the wrong
type in page.tsx; FastHTML m21 misspells an htmx attribute, the closest
FastHTML equivalent of a template directive. Django's cards became a
typed dataclass, as in the other Python apps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e page

The report command now also writes report.html, a self-contained page with
the stacked outcome chart and the full grouped table that opens from disk.
The 2026-10-20 results come from a full run of commit b0ef345 with no
uncommitted benchmark changes, and the docs page's data is regenerated from
it. Evidence lines in the published files drop local folder paths.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A failing command now takes the first file and line under the working copy
that its whole output names, so a Nuxt build failure points at the changed
component. A failure that names no file counts only when its message names
the changed file as a whole word; a Citry import failure always counts. The
FastHTML m22 note names ruff's `invalid-syntax` code, two m22 notes that
never applied are removed, `run` validates every case before it starts, and
published evidence blanks dev-server ports. No published cell changes; the
report is re-rendered from the same run of b0ef345.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
JuroOravec and others added 2 commits October 20, 2026 12:45
… report

report.html now uses the interaction benchmark report's layout: white
cards on a light page, collapsible sections, and an SVG chart with a
three-column legend, framework group headings, grid lines and totals to
the right of each bar, plus a Download SVG link. Each bar, here and on the
docs page, is as long as the mistakes that apply to its framework, so only
the framework with the most spans the full width. The code legend sits
below the table, and the text is smaller throughout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…unts

The six outcomes are now Static error, Static warning, Runtime error,
Runtime warning, Missed, and Missed, page unchanged, and "N/A or prevented
by design" comes before the misses in the count table. The charts drop the
numbers beside each bar and the duplicate count table, and show each
framework's N/A count under its bar instead. The full table gets a
"(caught/total)" row under its header and the same counts on every
category row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A missed mistake is now one outcome, "Missed", whether or not the page
visibly changed, so the report has five outcomes. "N/A or prevented" is
drawn as its own gray part just before Missed again, so every bar covers
all the mistakes. The report's axis counts in fives from ten up. The
README links the Citry gaps this run found (#207).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JuroOravec JuroOravec changed the title feat(benchmarks): error-prevention benchmark across six frameworks (#158) feat(benchmarks): error-prevention benchmark, part 1 (#158) Oct 20, 2026
…code

The chart and tables call the two static outcomes "Static/IDE error" and
"Static/IDE warning". A table cell shows only where a mistake was first
reported, with `w` when that report was only a warning (`Ew`), instead
of also naming the first error after it. The sentence explaining
"(caught/total)" is removed, and the docs test file is formatted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
JuroOravec and others added 2 commits October 20, 2026 17:42
…k Citry's static count

The Benchmarks page now has a Performance section and a Catching errors
section. The error chart shows each framework's static/IDE count beside its
bar and a dashed line at Citry's, and the standalone report draws the same
line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JuroOravec

Copy link
Copy Markdown
Member Author
Screenshot 2026-10-20 at 18 47 35

@JuroOravec
JuroOravec merged commit f3b15e1 into main Oct 20, 2026
30 checks passed
@JuroOravec
JuroOravec deleted the benchmarks/error-prevention branch October 20, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant