fix(analytics): replace time-language with byte-ratio wording (#1023) - #1062
Open
gegemeimingzi wants to merge 1 commit into
Open
fix(analytics): replace time-language with byte-ratio wording (#1023)#1062gegemeimingzi wants to merge 1 commit into
gegemeimingzi wants to merge 1 commit into
Conversation
…#1023) The "ran Nx longer before compact fired" metric was a byte ratio (bytesAvoided + bytesReturned) / bytesReturned presented as a time multiplier. No timestamp, turn count, or proximity-to-compact measurement contributes to the value. Replace with "Nx more data diverted from context window" which accurately describes what the number measures: how many times more bytes were kept out of the model context than entered it. TDD: new test in tests/analytics/format-report.test.ts drives a 1001x byte ratio (100KB avoided, 100B returned) and asserts the output contains no time language while still showing the multiplier.
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.
What / Why / How
Fixes #1023.
What — Replace the misleading "your AI ran N× longer before /compact fired" wording with "N× more data diverted from context window".
Why — The
convMultvalue isround((bytesAvoided + bytesReturned) / bytesReturned)— a pure byte ratio. No timestamp, turn count, or proximity-to-compact measurement contributes to it. Presenting a byte ratio with time language ("ran ... longer") makes a causation claim the data doesn't support. With a single redirect avoiding 100KB and returning 100B, the report says "ran 1001× longer" which is meaningless as a time statement.How — One-line string change in
src/session/analytics.ts:2219. The new wording"N× more data diverted from context window"accurately describes what the number measures without implying temporal causation.Affected platforms
Test plan
TDD (red → green) — added test to
tests/analytics/format-report.test.ts:"ran"and"longer"(time language)"1001×"multiplier without time languageAll existing tests pass:
tests/analytics/format-report.test.ts: 38/38npm run typecheck: passesChecklist
npm testpasses — analytics tests all greennpm run typecheckpassesnextbranch (unless hotfix)