Repository navigation
feat(benchmarks): error-prevention benchmark, part 1 (#158) - #205
Merged
Merged
Conversation
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]>
… 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]>
12 tasks
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]>
…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]>
…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]>
…crolls Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.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.mdandresults.jsonsit beside it.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)
What Citry misses:
type="sumbit") is only a warning.template_data()(citry check --typesskips template type checks when a component has notemplate_data()#202).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:
indirectnote 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
results.json; the page's counts are written in prose.vue-template-diagnostics.cjs) was not compared against a running editor.citry check --typesskips template type checks when a component has notemplate_data()#202,citry check --format jsoncounts template lines from 0 for some rules and from 1 for others #203, Events spec says a bad signature answersinvalid_state403, but a signature-only tamper answersstale_state409 #204. The gaps this run found are collected in Gaps found by the error-prevention benchmark #207.🤖 Generated with Claude Code