Skip to content

enhancement: replace LLM watch assessment with deterministic AST classifier #71

Open

Description

@Shanvit7

The watch assessment prompt asks “does this diff touch anything browser-visible?” — which, in many cases, has a fairly deterministic answer.

For example:

  • import-only changes, type edits, cosmetic JSX attributes, lock files → typically no
  • event handlers, async logic, new components → typically yes

This could potentially be handled via an AST-based classifier (e.g., using ts-morph) by mapping diff lines to structural regions. That would keep it fast (~10ms), avoid network calls, and reduce reliance on the LLM for straightforward cases.

The LLM could still be useful for ambiguous scenarios (e.g., indirect runtime effects, config changes), but a hybrid approach might reduce overall cost and latency.

I’ve experimented with something along these lines here:
https://github.com/Shanvit7/qagent

Happy to explore adapting it if this direction seems useful.

Activity

  1. aidenybai commented on Apr 4, 2026

    @aidenybai
    Member

    A first pass at this is going out now on main — added a deterministic classifier that runs before the LLM assessment. When all changed files match known non-browser patterns (docs, lockfiles, CI config, editor config, .gitignore, etc.), the LLM call is skipped entirely and the change is classified as "skip". (2d29862c)

    The LLM is still used for ambiguous cases. A deeper AST-based tier could be added later for type-only or comment-only changes in .ts/.tsx files.

  2. Shanvit7 commented on Apr 4, 2026

    @Shanvit7
    Author

    Makes sense as a first pass - skipping obvious cases before hitting the LLM feels like the right split.

    AST layer for .ts/.tsx could be a good next step later.

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