Skip to content

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

Merged
jyotir-aditya merged 2 commits into
mainfrom
feat/console-correlation-analyzer
Jul 10, 2026
Merged

jyotir-aditya merged 2 commits into
mainfrom
feat/console-correlation-analyzer

Conversation

@jyotir-aditya

Copy link
Copy Markdown
Contributor

Closes #60. Second analyzer on the #58 pipeline — closes the second half of the field feedback behind #63:

Session validation failed: TypeError: Failed to fetch was sitting in show --console the entire time — but with no signal tying it to the selector_not_found several steps later.

  • Non-excluded console errors preceding a failing assertion emit a prior_console_errors finding: count, first error inlined with source location, and a pointer to show --console/--timeline.
  • Job-wide no_console_errors exclude patterns (global + every flow's) are threaded into the evidence bundle — user-excluded errors never resurface; invalid patterns are skipped safely.
  • console_error failures skip the analyzer (the errors are already the headline); warnings never count.
  • stale_session ranks above it when both fire, so the more specific root cause wins the fix_hint.

Tests: five new cases in analyzers.test.ts (correlation + inlining, excludes honored, console_error skip, silent path, ranking). Verified e2e with a fixture page that logs the exact error from the field report plus a failing selector — the finding appears in failures[].findings and the rendered fix_hint, stdout stays pure JSON. Full workers suite green.

…ole errors with a later failure (#60)

Non-excluded console errors that precede a failing assertion now emit a
prior_console_errors finding (first error inlined with source location,
count, and a pointer to show --console/--timeline). Job-wide
no_console_errors exclude patterns are threaded into the evidence bundle
so user-excluded errors never resurface; console_error failures skip the
analyzer since the errors are already the headline. stale_session ranks
first when both fire.
… third-party detection

- prior_console_errors only fires for selector/text/url/timeout failures —
  a network_failure already names its own cause.
- New shared isThirdPartySource(): ports ignored, loopback hosts are one
  local stack, sibling subdomains are first-party — an app's own API on
  another port (localhost:3000 page, localhost:3611 API) must never be
  labeled a third-party script. Also fixes the pre-existing origin-equality
  bug in no_console_errors' third_party flag.
- All-third-party correlations get de-ranked language; mixed sources inline
  the first first-party error.
@jyotir-aditya
jyotir-aditya merged commit 09ef679 into main Jul 10, 2026
2 checks passed
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.

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

1 participant