Skip to content

benchmarks(errors): browser-side components and slot data, 7 mistakes - #216

Merged
JuroOravec merged 22 commits into
mainfrom
benchmarks/errors-browser-components
Oct 20, 2026
Merged

JuroOravec merged 22 commits into
mainfrom
benchmarks/errors-browser-components

Conversation

@JuroOravec

Copy link
Copy Markdown
Member

Part 2, step 3 of the error-prevention benchmark plan (#158). Stacked on #215; merge that first.

Adds a browser-side component and slot data to every framework's clean app, then 7 mistakes that need them. The first commit adds only the catalogue entries, so their wording was fixed before any result was seen. The new full run is published, and the "Catching errors" section of the Benchmarks page is updated to it.

What the clean apps gain

  • A status line in the details panel. It is a browser-side component that receives open and sends close back to its parent.

    • Citry: a component with a typed open input that emits close.
    • Next.js: a component with typed props and an onClose callback.
    • Nuxt: a component with defineProps and defineEmits.
    • Django and Jinja: a nested Alpine component.
    • FastHTML has no browser-side components, so it has no status line.

    Each framework except FastHTML also gets a new browser check step list, status, which opens the details, closes them and opens them again.

  • Slot data: the card's footer receives the card's title and count, and each card gets a tone input with two allowed values.

38 existing cases changed only the surrounding text their edits search for. Each case still makes the same mistake, and none of those cells changed.

The 7 new mistakes

  • Citry:
    • Caught in the editor: m25 (misspelled input), m26 (missing required input) and m49 (input value outside its allowed choices).
    • Runtime error: m36 and m37 (slot data read under a wrong name, or as the wrong type).
    • Missed:
      • m27, because the type of an input written as an expression is not checked.
      • m28, a child component changing an input it received.
  • Next.js and Nuxt: every one caught in the editor, except m28, which their linters catch.
  • FastHTML: m36, m37 and m49 caught in the editor. m25-m28 don't apply.
  • Django and Jinja:
    • m26 and m27 don't apply, because Alpine components declare no required or typed inputs.
    • m28 is prevented: the nested component changing open is how Alpine shares it with the parent.

One existing cell changed

Citry m14 (the server and browser render different content) moved from runtime error to missed. The details panel now passes a value to a child component. Citry 0.6.0 doesn't hydrate an element that does that, so Vue sees no mismatch inside it. This is a real Citry gap, recorded on #207.

Totals, 44 mistakes

Framework Caught Reported before the app runs
Citry 29/42 24
Next.js 36/39 34
Nuxt 29/40 23
FastHTML 24/32 17
Jinja 20/35 2
Django 13/35 3

The full run (264 cases, --no-cache) took 7 min 21 s. All six clean apps passed every check and step list.

🤖 Generated with Claude Code

JuroOravec and others added 18 commits October 20, 2026 20:05
…amed journeys

The browser check's clicks become named journeys in each framework's
framework.toml, under [runtime.journeys]. The existing clicks are the
default journey, recorded at the same three points as before (after the
load, after the steps, after a reload). Every other journey starts from a
fresh load in a new browser context and records the page once. New `fill`
and `press` steps let later PRs drive forms and keyboard flows, and each
step accepts only the keys its action uses.

The page record also keeps border color, alt, id, aria-* attributes and
the disabled state, so a mistake that changes only those reads as
"silently wrong" rather than "never" (both still count as missed). Runs
of 16 or more hex digits in ids and aria values are blanked before the
comparison, because Citry mounts an interactive page into an element
with a random id on every render.

No existing cell is expected to change: the only "never" cells (m09) edit
only the button type text. The published results change only after the
next full run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adds 13 mistakes to catalogue.toml before any case is written, so the
wording is fixed before a result is seen: m29-m35, m38-m42 and m47, the
part 2 mistakes that need no change to the reference page. 11 are
neutral and 2 (m41, m42) come from Citry's own rule list, which leaves
27 of 37 neutral.

The entries are the plan's drafts with two changes:
- m32 sends `"1"` instead of `"one"`, and says that a framework that
  turns the text into a number counts as prevented, following the
  decision on open question 3.
- m30 sends the card's task count instead of its position, because the
  reference page gives a card no position, and says the mistake does not
  apply where the event carries no value.

The catalogue header and the design doc's fairness rules now name the
maintainer's hand-off list (section 2 of the plan) as a neutral source,
as the plan requires for these entries to count as neutral.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adds a case for each of m29-m35, m38-m42 and m47 in Citry, Django,
Jinja, FastHTML, Next.js and Nuxt, as edits to each baseline.

Not applicable, with the reason in each port.toml:
- m30 everywhere but Citry: the card's hide event carries no value,
  because the page's listener already knows which card it belongs to.
- m34 everywhere but Nuxt: Citry reads $state, the HTMX stacks swap in
  HTML, and Next's server action returns a bare number.
- m40 in FastHTML: the value is written into the script's text, so the
  browser code reads no name.
- m41 in Next.js and Nuxt: the API base is a plain string, and JavaScript
  has no path type to reach for.
- m47 in Citry, FastHTML and Nuxt: the page names no template or
  component file.

Prevented: m32 in Django, Jinja and FastHTML. HTMX sends form fields,
which are always text, and the server turns the field into a number, so
"1" and 1 send the same request.

Fixes made while running the cases, each to make the case express its
mistake, not to change its result: the Django and Jinja m42 edits wrote
a literal backslash-n into the file (a TOML literal string), which broke
Jinja's app.py; the Django m35 edit left extra blank lines that djLint
reported (H014), a finding unrelated to the missing fill.

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

An independent review of the new cases found one wrong claim: the m41
not-applicable reasons for Next.js and Nuxt said JavaScript's URL class
takes only an absolute address, while it also accepts a relative path
with a base address. The reasons now say that a relative setting has no
base to resolve against.

The other changes are wording only and change no edit: the m32
prevented reasons for Django and Jinja open with why the mistake cannot
be written, and several comments say plainly what the case does.

The README's reference-page table now lists the new mistakes next to
the page part each one uses, and Citry's framework notes point to m29
and m42, which now measure the two related forms the notes describe as
unreported.

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

A full run of all 37 mistakes in all six frameworks, from commit
1fb5ac267, replaces the 2026-10-20 results (the earlier run of the same
day stays in git history). It is also the first published run with the
named journeys and wider page comparison from PR 1b; none of the 144
existing cells changed, as the plan expected.

Before the app runs (errors plus warnings, of the mistakes that apply):
Citry 21 of 35, Next.js 27 of 32, Nuxt 16 of 33, FastHTML 14 of 29,
Django 3 of 33, Jinja 2 of 31. Citry misses 10, up from 4: the parent's
misspelled listener (m29), an event payload of the wrong type (m30), a
misspelled DOM event (m31), a wrong-typed or missing payload field (m32,
m33; rejected with a 422 the page never shows), and a secret sent through
js_data() (m42), which no framework reports.

Also:
- the README's notes on single cells explain m30/m34, m32, m35, m38 and
  m42, and say #207 does not list the new gaps yet;
- the docs page's "Catching errors" section and its data file match the
  run;
- the plan marks PR 2 done and records 1b's full run;
- wording fixes from an independent prose review in the catalogue
  header comment (no entry changed), the design doc, the plan and
  Citry's framework notes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The run used 1fb5ac267; rebasing onto main gave the identical tree the
hash 60e9fc2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`citry-errors run --jobs N` (default: half the CPUs, at most 8) runs the
cases of every framework side by side. Each clean app still runs alone,
before any case, so the comparison point is not measured under load.
Records keep the framework and catalogue order whatever order the cases
finish in.

Dev servers get ports from 20000-31999, below the range the operating
system uses for outgoing connections, and a port stays reserved in the
process until its server stops, so two workers never share one. A server
whose port another program took is started again on a new port.

A framework can cap its own cases with `max_jobs` in framework.toml;
Nuxt runs one case at a time, because every `nuxt dev` picks its
server-side hot reload port from the same 21 ports.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…take as an error

The report keeps only where a mistake is first reported, and a static
error decides both the errors-only and the errors-and-warnings column, so
the browser check cannot change such a cell. Those cases now skip it, and
their record names the tool in `runtime_skipped`. A static warning alone
still runs the browser check, because the errors-only column can still be
decided there. In the 2026-10-20 run this would have skipped 63 of 134
browser checks, about 38% of the run's time.

The report and the docs data script already put these cases in the
static-error bucket, so no case shows as unscored.

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

`citry-errors run` now stores each case's raw output under
.benchmarks/errors/results/: what every tool printed, unparsed, and the
browser check's record and server log. A later run reuses the stored
output when the case's inputs hash the same, and runs only new or changed
cases. The hash covers the case's port.toml and copied files, every file
of the framework's folder (framework.toml without its notes and
max_jobs), the runner code that makes raw output (execute.py, runtime.py,
work.py, config.py, cache.py, the runner's lockfile), the Node and Python
versions and the working copy's folder.

Parsing, comparing and scoring run again on every run from the raw
output, so changing them needs no rerun. The page comparison moves from
runtime.py to compare.py for this reason. Whether a case skips its
browser check is decided again too, so a case whose static catch stops
counting gets its browser check on the next run.

Output that says more about the machine than about the case is not
stored: a stage that timed out or was killed, a server that never
answered, a clean app with problems, and anything finished after Ctrl-C.
An entry's key file is written last, so an entry a run stopped writing is
ignored. run.json lists the clean apps and cases reused whole.
`--no-cache` runs everything and stores the fresh output, and a lock
keeps two runs off one cache folder. CITRY_ERRORS_CACHE moves the folder.

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

The README explains --jobs, max_jobs, the stored output and --no-cache,
with the Jinja and FastHTML timing. The design doc lists how the runner
behaves on a port clash, a worker error, Ctrl-C, a half-written entry, a
second run on the same folder and a stale stored output, and its cost
section gives the measured times. Section 8 of the plan replaces the
one-case-at-a-time estimate with the new one.

Progress lines from workers are written one at a time, so lines from
cases that finish together no longer run into each other.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…el runs and stored output

Stored output:
- Nothing of a framework is stored in a run whose clean app had a
  problem. A broken environment fails every case the same way, and that
  output would otherwise be reused after the environment is fixed.
- A browser check whose journey stopped early is not stored, because a
  step that ran out of time can come from a busy machine.
- The key also covers the installed Playwright, what each framework's
  environment installed (its venv's pyvenv.cfg, npm's package record),
  the framework folder's location, and the variables CI, FORCE_COLOR,
  NO_COLOR, NODE_ENV, NODE_OPTIONS, PYTHONWARNINGS and TERM.
- A damaged entry is treated as not stored instead of stopping the run.
- `prepare` takes the same lock as `run`, and the lock file keeps the
  running process's id when a second run is refused.

Parallel runs:
- After Ctrl-C a running case stops before its next tool or browser
  check, so the run ends without waiting for builds that have not
  started. Ctrl-C while the workers start is handled too.
- run_all rejects a zero job count or limit, and an error working out a
  task's framework fails the run instead of ending a worker silently.
- Ports come from 20000-24677, below the ports Vite and nuxt dev pick for
  hot reload. Django's "That port is already in use" also triggers a
  retry on another port.
- The development server starts from a fresh copy of the case, so the
  browser check sees the same files whether the tools ran in this run or
  their output was stored by an earlier one.

Docs: the README, design doc and plan describe these, correct the retry
count, the Nuxt row and the cache-key list, and give the measured rerun
time (8 seconds for Jinja and FastHTML, which repeats the 4 browser checks
whose journey stops on an error page).

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

- The Ctrl-C test waits until both workers are on a case and checks that
  both gave up their case before run_all returned; it was racy before.
- A stored entry that cannot be read for any reason, including a
  malformed runtime.json, is ignored with a one-line message naming it.
- A framework's location in the checkout is part of its key only when a
  command names a file there ({framework} or {repo}), so two checkouts
  sharing one cache folder reuse each other's output for the others.
- The toy check stage leaves a file in the working copy, and the toy
  browser check fails if it sees it, which proves the server starts from
  a fresh copy. New tests cover the stop check before each tool and the
  lock file keeping the running process's id.
- Comments and docs: only nuxt dev searches 24678-24698; Ctrl-C waits for
  tools and browser checks already started; a missing server log reruns
  only the browser check; the rerun time names Jinja and FastHTML.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s apps name

The citry and Django framework settings list .python-version among the
files that decide when an install is out of date, but the repository's
.gitignore ignored it, so a fresh checkout failed in prepare.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the error catalogue

Adds 7 mistakes to catalogue.toml before any case is written, so the
wording is fixed before a result is seen: m25-m28 (inputs of a
browser-side component), m36 and m37 (data a slot hands back to its
fill) and m49 (a component input given a value outside its choices).
All 7 are neutral, which leaves 34 of 44 neutral.

The entries are the plan's drafts with these changes:
- m25 says that where a nested component reads its parent's state
  through a shared scope instead of an input, as an Alpine component
  nested in another does, the misspelled name is the one it reads. This
  follows the decision that Django and Jinja write the status line as a
  nested Alpine component.
- m27's example passes the text the status line shows ("open" or
  "closed") instead of `String(open)`.
- m28 names the existing Close button instead of "its own button".
- m36's example is `titel` instead of `slot.titel`, since several stacks
  read slot data as plain names.
- m37's string-method example spells out `padStart(2, "0")`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hmark's reference apps

Adds reference-page parts A and B from the plan to every baseline, each in
the framework's usual style:

- A: inside Details, a browser-side `Status` component with a required
  boolean input `open` that shows `Status: open` or `Status: closed`, and
  a Close button that tells the parent through an event. The Details
  button reports its state through `aria-expanded`. A new `status`
  journey clicks Details, Close, then Details again. Citry, Next.js and
  Nuxt write Status as a component with a declared prop. Django and Jinja
  write it as an Alpine component nested inside the one that owns
  `open`, which reads `open` through Alpine's shared scope, as decided
  for open question 1. FastHTML has no browser-side component model, so
  it gets only `aria-expanded` and lists no status journey.
- B: the card takes a `tone` input with the choices `plain` and `accent`
  (the featured first card gets a blue border), and hands its title and
  count back to the footer fill, which now reads `Open Alpha (3)`: Citry
  slot data, a Vue scoped slot, a React render prop, a Jinja
  `caller(title, count)`, a FastHTML callback, and in Django the footer
  block reading the card's own context.

Every clean app stays clean: a run of each framework with the new cases
reported no baseline finding, no browser error and no journey failure.

Existing cases whose `old` text the baselines changed are adjusted to the
new text without changing their mistake. A rerun of those 38 cases gave
the published cell for every one except Citry m22, whose parser error
moved below the window because the card's slot tag now spans five lines.
Its new `indirect` note confirms the finding, which restores the cell.
The FastHTML m04 and m35 and the Jinja m04 and m35 mistake lines follow
the reformatted calls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…into all six frameworks

Adds a case for m25-m28, m36, m37 and m49 in every framework, each run
on its own while it was written.

Not applicable, with the reason in each port.toml:
- m26-m28 in Django and Jinja: the Alpine status component declares no
  inputs and shares its parent's scope, so there is no input to leave
  out or give the wrong type, and assigning `open` from the child is an
  ordinary way to update the parent.
- m25-m28 in FastHTML, which has no browser-side component model.

m25 in Django and Jinja misspells the name the nested Alpine component
reads, as the catalogue entry describes for a shared scope.

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

An independent review of the baselines and cases found these, now fixed:

- The Django and Jinja status line read the parent's `open` through
  `this` inside an Alpine getter, which works only because of how Alpine
  merges scopes. It now reads `open` in its markup, as Alpine's docs show
  for nested components, and the component keeps a `close()` method that
  dispatches the event. m25 there now misspells that markup read.
- Django's `close` listener sat on the status element, so the child set
  the parent's value itself. It now sits on the board, as Jinja's sits
  on the Details component. m10, m11 and m16 edit that line, so their
  `old` text drops the closing `>`.
- Nuxt's `#footer="{ title, count }"` hid the page's own `count` and
  drew a `vue/no-template-shadow` warning on the clean app. The fill now
  names its slot data `footer`; m05, m35, m36 and m37 follow.
- Django m36 and m37 are not applicable: a Django block takes no
  arguments, so the card hands the fill no data of its own. A misspelled
  or wrong-typed variable there repeats m07 and m23.
- Django and Jinja m28 are prevented instead of not applicable, like m32:
  under Alpine's shared scope the child's assignment works.
- Reasons and notes no longer say Alpine has no inputs (an `Alpine.data`
  factory takes arguments and `x-modelable` exists); they say it has no
  required or typed inputs. The FastHTML reason says its baseline uses
  plain scripts without Alpine. The Citry m36 case notes that the fill
  uses the record form, and Citry checks field names only when the fill
  unpacks them.

This narrows the plan's decision for open question 1, which ported m25-m28
through Alpine: only m25 has a natural form in an Alpine component that
declares no inputs.

Every clean app stays clean in all stages. Rerunning the affected cases,
and the cases that touch Details, kept every published cell except Citry
m14, which moved from a runtime error to silent: Citry renders an element
that contains a child component in the browser instead of hydrating it,
and Details now contains Status, so the hydration mismatch is no longer
reported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mponent and slot-data mistakes

Replaces results/2026-10-20/ with a full run of all 44 mistakes in the six
frameworks (264 cases, `--no-cache`, 7.5 minutes), taken at commit
3825b79 after the catalogue entries were fixed in b3b495f. Every clean
app was clean in every stage and journey.

Compared with the previous run, one existing cell changed: Citry m14 went
from a runtime error to missed. Citry 0.6.0 does not hydrate an element
that passes values to a child component, and the details panel now passes
`open` to `Status`, so the hydration mismatch is no longer reported. Citry
m22 keeps its error and is marked as confirmed through its `indirect`
note. The new cells:

- Citry: m25, m26, m49 in the editor; m36, m37 at runtime; m27, m28
  missed.
- Next.js and Nuxt: every new mistake in the editor, except m28, which
  their linters report.
- FastHTML: m36, m37, m49 in the editor; m25-m28 n/a.
- Django: m25 at runtime; m49 missed; m26, m27, m36, m37 n/a; m28
  prevented.
- Jinja: m25, m37 at runtime; m36, m49 missed; m26, m27 n/a; m28
  prevented.

The README gains the new reference-page parts, the status journey and
notes on m14, m25-m28, m36 and m37, and the measured full-run time. The
docs page's "Catching errors" counts and lists, its data file, and the
plan's PR 3 status follow the run.

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

# Conflicts:
#	docs/design/error_prevention_benchmark_plan.md
Base automatically changed from benchmarks/errors-faster-runner to main October 20, 2026 21:52
main matches the merged #215, which this branch already contains, so the
files are unchanged.
@JuroOravec
JuroOravec merged commit 3ba9ebc into main Oct 20, 2026
4 checks passed
@JuroOravec
JuroOravec deleted the benchmarks/errors-browser-components branch October 20, 2026 22:12
JuroOravec added a commit that referenced this pull request Oct 20, 2026
main matches the merged #216, which this branch already contains, so the
files are unchanged.
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