Skip to content

fix(analytics): replace time-language with byte-ratio wording (#1023) - #1062

Open
gegemeimingzi wants to merge 1 commit into
mksglu:nextfrom
gegemeimingzi:fix/analytics-byte-ratio-wording
Open

fix(analytics): replace time-language with byte-ratio wording (#1023)#1062
gegemeimingzi wants to merge 1 commit into
mksglu:nextfrom
gegemeimingzi:fix/analytics-byte-ratio-wording

Conversation

@gegemeimingzi

Copy link
Copy Markdown

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 convMult value is round((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

  • All platforms

Test plan

TDD (red → green) — added test to tests/analytics/format-report.test.ts:

  • Drives a 1001× byte ratio (100KB avoided, 100B returned)
  • Red: output contained "ran" and "longer" (time language)
  • Green: output contains "1001×" multiplier without time language

All existing tests pass:

  • tests/analytics/format-report.test.ts: 38/38
  • npm run typecheck: passes

Checklist

  • Tests added/updated (TDD: red → green)
  • npm test passes — analytics tests all green
  • npm run typecheck passes
  • Docs updated if needed (README, platform-support.md) — n/a
  • No Windows path regressions (forward slashes only)
  • Targets next branch (unless hotfix)

…#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.
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.

1 participant