perf: supply validated diff statistics to ACP clients - #501
Open
nikita-ashihmin wants to merge 3 commits into
Open
perf: supply validated diff statistics to ACP clients#501nikita-ashihmin wants to merge 3 commits into
nikita-ashihmin wants to merge 3 commits into
Conversation
Clients compared full file texts again to display line counts. Supply counts and the first changed line through com.intellij/diffStats metadata. Parse each update patch once and reuse it for application and statistics. Validate hunk coordinates and content before publishing the counts. Omit statistics when validation fails so clients can compare the texts. Type checking, the build, and all 610 active tests pass; 26 tests are skipped. The new coverage includes 34 statistics and file event cases. A real Codex history imported through ACP provides statistics for all 277 diffs.
Publish diff statistics at _meta.jetbrains.air.diffStats through the existing AIR metadata helper. Preserve the diff kind and the versioned envelope. Document the wire format, count semantics, navigation, and fallback behavior. Type checking, the build, and all 610 active tests pass; 26 tests are skipped.
Use the parsed patch as the source of added and removed counts. Remove navigation coordinates and duplicate validation of complete file texts. Keep the existing patch application responsible for constructing ACP content. Count created and deleted files from the content already supplied by Codex. Update the extension specification and regression tests for counts-only metadata. Type checking, the build, and the full local test suite pass. A patch with 20 additions and 30 deletions takes about one microsecond to count.
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.
Supply added and removed line counts through
_meta.jetbrains.air.diffStatsso clients can display file cards without comparing full texts again.For updates, count
+and-operations in the parsed patch. The calculator receives no file texts and computes no navigation coordinates. The existing patch application still constructs and validates the ACP content. For creation and deletion, count lines in the supplied content. Preserve_meta.kind.The AIR diff statistics specification defines the envelope, count semantics, and fallback behavior. No capability negotiation is required.
Validation: local type checking, build, and all 609 active tests passed; 26 tests were skipped. Tests cover line endings, malformed hunks, multiple hunks, large coordinates, reverse application, and relocated patches. The local suite ran in the working branch; CI checks this PR against
main.A synthetic patch with 20 additions and 30 deletions took about one microsecond per calculation. The result was unchanged at line one and line one million. This measures only statistics, excluding patch parsing, application, file IO, and GUI work.