Skip to content

feat(workers): prior-console-errors analyzer — correlate earlier console errors with a later failure #60

Closed

Description

@jyotir-aditya

Problem

Console errors are captured per-run but treated as independent events — nothing connects "an anomalous fetch failure early in the run" to "a selector failure several steps later". Real agent feedback:

Session validation failed: TypeError: Failed to fetch was sitting in verfix show --console output the entire time — but it's just one line among many, with no signal tying it to the selector_not_found several steps later in the same run. Connecting the two required manually pulling --console and --network, cross-referencing timestamps, and reading app source.

Proposal

A prior_console_errors analyzer for the failure-analyzer pipeline:

  • Trigger: a step/assertion fails, and non-excluded console errors occurred earlier in the run (both sides already carry ISO timestamps — ConsoleLine.timestamp in workers/src/assertions/types.ts).
  • Output finding:

    prior_console_errors — 2 console errors occurred earlier in this run and may be related. First: Session validation failed: TypeError: Failed to fetch (step 1, 12.3s before this failure). See verfix show <id> --console.

  • Respect the same exclude patterns as the no_console_errors assertion — errors the user has explicitly excluded must not resurface here.
  • Skip when the failure itself is console_error (the errors are already the headline).
  • Inline the first error's full text (agents shouldn't need another round-trip for the headline), cap the rest to a count + pointer.

Notes

  • Pure synthesis over already-captured data — no new capture, no engine-lifecycle changes. Good first analyzer to write after the pipeline lands.
  • Deterministic, hypothesis language ("may be related").

Depends on

  • Failure-analyzer pipeline (findings[] contract)

Acceptance criteria

  • Finding emitted when non-excluded console errors precede a failing step; silent otherwise
  • Excluded patterns honored; console_error failures skipped
  • Fixture-based standalone test
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions