Skip to content

Gaps found by the error-prevention benchmark #207

Closed

Description

@JuroOravec

The error-prevention benchmark (#158, #205) writes the same 24 developer mistakes in Citry and five other frameworks and records how early each framework reports them. This issue collects the mistakes Citry does not catch early, so we can explore and close them over time. Add new gaps here as later benchmark runs find them.

Status as of the 2026-10-20 run (Citry 0.6.0). The m-numbers are the cases in benchmarks/errors/catalogue.toml.

Missed: nothing reports the mistake

  • Misspelled HTML element (m11). <dvi class="board"> renders as an unknown inline element. Next.js catches this through TypeScript's JSX element types.
  • Misspelled HTML attribute name (m10). titel="Board" renders as an unknown attribute, and the tooltip disappears. Next.js catches this.
  • Misspelled CSS class (m16). class="bord" matches no rule and renders unstyled. No framework in the benchmark catches this.
  • Misspelled field in a request payload (m18). A server event called with {amont: 1} is rejected with invalid_args, but only inside the batch response, which the reference page does not display. Payload keys are not checked against the event's input schema before running. Next.js catches this with typed server action arguments.

Warning only

Caught only at runtime

  • Misspelled Vue directive (m21). v-iff is rejected only by Vue, in the browser. A misspelled server-side c-iff is silent today; fix: catch more template mistakes in citry check #206 adds a check rule for that.
  • Syntax error in a browser (Vue) expression (m19). citry check does not run the Vue template compiler, so the error appears as a 500 when the page renders.
  • Server and browser rendering different content (m14). It shows only as a hydration error in the browser.

Caught only through a workaround

Near-misses next to cases Citry does catch

These forms of the same mistakes are not measured, but they go unreported today:

  • Misspelling an event in the parent's listener (@hdie="hideCard"). The child's misspelled emit is caught (m24).
  • Sending a server-only value to the browser through js_data(). Reading it in Vue code is caught (m12).

Runtime input types

Activity

  1. JuroOravec commented on Oct 20, 2026

    @JuroOravec
    MemberAuthor

    Another gap, found while reworking #208: citry check and the editor skip components whose base class comes from another module.

    Without importing the app, Citry finds a component only when its class inherits Component or LibraryComponent from citry, or another component class in the same file. A shared base imported from elsewhere is not followed:

    # myapp/base.py
    class AppComponent(Component): ...
    
    # myapp/card.py
    from myapp.base import AppComponent
    
    class Card(AppComponent):  # citry check does not see this template
        template = """..."""

    Checking citry_ui/components/ctabs.py finds 5 templates today, and 0 once its classes inherit a base imported from citry_ui._base. The code that does this is _ast_component_declarations (packages/py/citry/citry/analysis.py:4246-4313), and the fallback used while a file is being edited, _COMPONENT_CLASS_RE (analysis.py:4315). Any project that puts a shared base class in its own module gets no template checks, with no message saying so. This is also why #208 gives every Citry UI component its own class Lint: instead of one shared base.

  2. JuroOravec commented on Oct 20, 2026

    @JuroOravec
    MemberAuthor

    More gaps from the second benchmark round (#214), where 13 data-flow mistakes were added. Each mistake below is reported by nothing in Citry, or only once the page runs:

    • A misspelled event name on a listener is silent. This covers a parent listening for a custom event (@hdie where the child emits hide, m29) and a misspelled browser event (@clik, m31). TypeScript catches both in Next.js.
    • An event's payload type isn't checked (m30). emits: ['hide'] declares only the name, so emitting a value of the wrong type is silent.
    • A request payload with a wrong or missing field passes every static check (m32, m33). A field sent as text where the handler expects a number, or a missing field, makes the server answer 422. The answer is hidden inside a 200 batch response, so the page just doesn't update. Next.js's typed server actions catch both in the editor.
    • A secret returned from js_data() reaches the page with no warning (m42). No framework in the benchmark reports this either.
    • A value that can't be sent as JSON from js_data() is caught only at runtime (m41). The runtime error message is clear, but a static check could report it earlier.
  3. JuroOravec commented on Oct 20, 2026

    @JuroOravec
    MemberAuthor

    More gaps from the third benchmark round (#216), which adds a browser-side component and slot data:

    • A hydration mismatch inside an element that passes values to a child component goes unreported (m14). Citry 0.6.0 doesn't hydrate such an element, so Vue never compares it. When the details panel started passing open to a child, the existing m14 case (server and browser render different content) moved from runtime error to missed.
    • The type of a component input written as an expression isn't checked (m27). :open="count" where open is a bool goes unreported. Only literal values are checked.
    • A child component changing an input it received isn't reported (m28). Nuxt (vue/no-mutating-props) and Next.js (react-hooks/immutability) both flag this in the linter.
    • Slot data read under a wrong name or as the wrong type fails only when the page renders (m36, m37). This happens when the slot passes a record, such as SlotInput[FooterData]; the editor doesn't report it.
  4. JuroOravec commented on Oct 20, 2026

    @JuroOravec
    MemberAuthor

    More gaps from the fourth benchmark round (#220), which adds forms, links, assets, a CSS variable and a translation argument:

    • A misspelled CSS variable that css_data() sets goes unreported (m43). var(--acent) where css_data() sets accent just leaves the heading in its default color. Nuxt's Vue tooling catches the matching mistake in v-bind().
    • Nothing compares a form's field names with the server event's data class (m44). The server rejects the call with a 422 inside a 200 batch response, and it lands in $error('search'), which the page doesn't show. No framework in the benchmark catches this.
    • A link to a route that doesn't exist, or a misspelled static file path, shows up only as a 404 (m45, m48). Next.js's typedRoutes would catch the route case in the editor, and Nuxt's build catches the asset case.
  5. JuroOravec commented on Oct 21, 2026

    @JuroOravec
    MemberAuthor

    Gaps from part 3 of the benchmark (#224), which adds 13 mistakes taken from what other frameworks' tools check:

    Missed entirely:

    • m53: an <img> without alt. Django's djLint and Next.js's jsx-a11y report it.
    • m54: a misspelled ARIA attribute name, such as :aria-expandd.
    • m57: the same id used twice on a page.
    • m60: an event handler that takes more arguments than the emit sends.
    • m62: disabled="false". The browser still disables the element, and the invalid-attribute-value rule doesn't cover it.

    Caught only when the page renders:

    • m51: a loop without #c-key.
    • m52: a <div> inside a <p>. It fails as Vue's InvalidEndTag.
    • m61: a link path that doesn't match a route, such as /projects/alpha. It shows only as a 404.
    • m63: v-model on a <form>. browser.invalid-state-binding-target checks only :c-* bindings, so this shows up as a render failure whose message (MODEL_HELPER_MISMATCH) doesn't point at the form.
  6. JuroOravec commented on Oct 21, 2026

    @JuroOravec
    MemberAuthor

    One more gap from the last benchmark round (#228): inject() with a key no ancestor provides (m50). self.inject("bord"), when the page wraps the cards in <c-provide key="board">, fails only when the page renders, with a KeyError. The error message does suggest board. A static check would compare literal inject() keys with the <c-provide key> values in the templates that render the component. That is cross-file, so it belongs with the B proposals.

  7. JuroOravec commented on Oct 22, 2026

    @JuroOravec
    MemberAuthor

    Status

    Every proposal in docs/design/issue_207_proposals.md is now either merged or in an open PR.

    Merged:

    Open:

    Benchmark: Citry built from this repository reports 54 of its 61 applicable mistakes before the app runs, up from 29 for Citry 0.6.0. That's the most of the 12 frameworks (#241). #242 to #244 don't change that count, because the remaining benchmark cases use forms those checks don't cover (see below).

    What remains after #242 to #244

    These are known limits rather than open proposals:

    1. m61: a FastAPI route parameter typed only in the function signature (project_id: int). The link check can't see that type.
    2. m30, m60: emit payload types and handler argument counts are checked only when emits are typed. Array-form emits and untyped handlers stay unchecked.
    3. m42: only values wrapped in citry.Secret are caught. A secret in a plain string can't be detected.
    4. m14: the hydration mismatch is reported only by the development-mode browser check. It can't be checked statically.
    5. Editor coverage: these rules run in citry check with the app loaded, but not in the editor:
      • the three CSS class rules and the CSS variable rule;
      • the missing #c-key rule.
    6. Expressions in server-event payloads: these aren't type-checked; only literals are (proposal 3/7, deferred).
    7. --static discovery: following imports to find components whose base class lives in another module (proposal 1, Option 3, deferred).
    8. Smaller items:

    Proposal: once #242, #243 and #244 merge, close this issue and move the list above into a new follow-up issue.

  8. JuroOravec commented on Oct 22, 2026

    @JuroOravec
    MemberAuthor

    #242, #243 and #244 are merged. The remaining known limits moved to 248 → #248. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions