Skip to content

feat: add TrackingLineParser for source-line-accurate event attribution - #77

Merged
alexey1312 merged 2 commits into
ldomaradzki:masterfrom
JacobHearst:master
Jul 21, 2026
Merged

feat: add TrackingLineParser for source-line-accurate event attribution#77
alexey1312 merged 2 commits into
ldomaradzki:masterfrom
JacobHearst:master

Conversation

@JacobHearst

Copy link
Copy Markdown
Contributor

Closes #75

LineParser's look-ahead buffering and internal event queue decouple events from the input lines that produced them. TrackingLineParser wraps LineParser and maintains a FIFO queue of pending line numbers, using a pendingEventCount hook on LineParser to compute exact attribution for all edge cases (buffered look-ahead, comment-continuation merges, fatalError double-event path).

LineParser's look-ahead buffering and internal event queue decouple events
from the input lines that produced them. TrackingLineParser wraps LineParser
and maintains a FIFO queue of pending line numbers, using a pendingEventCount
hook on LineParser to compute exact attribution for all edge cases (buffered
look-ahead, comment-continuation merges, fatalError double-event path).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alexey1312

Copy link
Copy Markdown
Collaborator

I found an attribution bug for an unparseable recorded an issue line. LineParser returns .buffering for any line containing the marker, but can later return .ignored while enqueueing the next line’s event. TrackingLineParser ignores that queue change, so subsequent events get the stale source line.

Reproduced locally on this commit:

1: buffering
0: ignored
1: consumed

The last event comes from input line 2, so it should be attributed to line 2. Could you add a regression test and handle this path?

LineParser's flushRecordedIssue can resolve a buffered look-ahead line
with no event while enqueueing an unrelated overflow event in the same
call. TrackingLineParser didn't distinguish that dead-slot case from a
plain .ignored line, so it left a stale queue entry and misattributed
the next real event to the dead buffered line instead of its actual
source line.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@alexey1312
alexey1312 merged commit 72e6a56 into ldomaradzki:master Jul 21, 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.

[Feature proposal] TrackingLineParser: Track line numbers of parse events

2 participants