Repository navigation
Adopt upstream #2232: tsc - handle pretty diagnostics - #44
Merged
Merged
Conversation
Strip ANSI before parsing tsc diagnostics and fall back to raw output when a non-zero compiler exit produces no parsed errors. Fixes rtk-ai#1772.
Amendment to adopted upstream rtk-ai#2232: cli-testing.md requires filters to verify >=60% token savings against real fixtures. Fixture is real 'tsc --noEmit --pretty' output (ANSI, code frames) from a two-file TypeScript project with 9 diagnostics. Savings measured with core::tracking::estimate_tokens (chars/4) — the metric rtk gain reports; whitespace-based counting is blind to the ANSI escapes this filter strips. Co-Authored-By: Claude Fable 5 <[email protected]>
5 tasks done
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.
Closes #32.
Adopts rtk-ai/rtk#2232 (fix for upstream #1772):
tsc --pretty/ ANSI output broke diagnostic parsing, producing a false "TypeScript: No errors found" on non-zero compiler exit.Commits
a7998adfix(tsc): handle pretty diagnostics — cherry-pick of upstreamf7e806c, authorship preserved (xiaozh [email protected])842ffebtest(tsc): add real-fixture token savings test for pretty output — fork amendment (cli-testing.md requires a >=60% savings assertion; module had none)Repro (pre-cherry-pick binary, develop @ e110adc)
Fixed (post-cherry-pick)
Quality gate (local — fork CI does not run; this is the merge gate)
cargo fmt --all -- --check✅cargo clippy --all-targets✅ (0 warnings)cargo test --all✅ 2495 passed, 0 failed (one unrelated flake incore::tracking::tests::test_timed_execution_passthroughunder load; 5/5 green in isolation, green on clean rerun)Two-axis code review (Standards / Spec)
842ffeb. Minor smells (TsDiagnostic/TsError field duplication, duplicated fallback format strings) judged acceptable as-is.TSC_PRETTY_ERROR. Two pre-existing gaps noted as follow-ups, out of scope for this adoption:filter_tsc_output(pipe mode) has no exit-code input and can still print "TypeScript compilation completed" for unparsed failing output🤖 Generated with Claude Code