Skip to content

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

@Shanvit7

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.

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