fix(parser): cache parse failures so broken files aren't re-read every run (#441 follow-up)#453
Merged
Merged
Conversation
…y run (#441 follow-up) Follow-up to #450. When a session file throws during parse it was excluded but left uncached, so every refresh (~4x/min in the menubar) re-read and re-parsed it, and only the first failing file per provider was ever surfaced. - Add a negative-result marker: a failed file is cached as { fingerprint, turns: [], failed: true }. reconcileFile treats it as 'unchanged' at the same fingerprint, so it's skipped (no re-read) until the file changes. Empty turns => contributes no usage. - Warn per offending file (with its path), capped at 5 per provider per run, instead of once-per-provider — so a systemic break surfaces more than one file without flooding. Cached markers keep it quiet across refreshes. Tests: marker round-trips through save/load; reconcile stays 'unchanged' at the same fingerprint and re-parses when the file changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #450 (issue #441). Addresses the two non-blocking items noted there.
Problems
Fix
{ fingerprint, turns: [], failed: true }.reconcileFiletreats it asunchangedat the same fingerprint → it's skipped (no re-read) until the file actually changes (fingerprint differs → re-parsed/retried). Emptyturnsmeans it contributes no usage, same as before.Why it's safe
validateCachedFileaccepts the optionalfailedfield; markers round-trip through save/load.Testing
reconcileFilestaysunchangedat the same fingerprint and returnsmodifiedonce the file changes (retry).tsc --noEmitclean.