Skip to content

fix(hermes): bucket active deltas by observation time - #155

Merged
pitimon merged 1 commit into
mainfrom
fix/154-hermes-active-delta-buckets
Aug 5, 2026
Merged

fix(hermes): bucket active deltas by observation time#155
pitimon merged 1 commit into
mainfrom
fix/154-hermes-active-delta-buckets

Conversation

@pitimon

@pitimon pitimon commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • attribute subsequent deltas from active Hermes sessions to the sync observation bucket instead of permanently growing the session start bucket
  • retain started_at for the first observation and ended_at for the final completion delta
  • add regression coverage for cross-day active sessions and token conservation across buckets
  • bump the release version to 0.39.45 across npm, macOS, and Windows metadata
  • refresh generated OpenWiki source facts and the prepublish pricing seed

Root cause

parseHermesIncremental() correctly calculated per-sync token deltas, but selected the bucket timestamp with endedAt ?? startedAt. Because active sessions have no ended_at, every later delta was assigned to the original session start time—even after midnight.

Test plan

  • Regression test demonstrated the old behavior before implementation
  • node --test --test-name-pattern='Hermes|hermes' test/rollout-parser.test.js
  • node --test test/pricing.test.js test/model-breakdown.test.js test/local-api-source-scope.test.js
  • npm run ci:local
  • npm run validate:version-lockstep
  • npm pack --dry-run --json includes dashboard and service scripts
  • npm publish --access public --dry-run
  • static security scan and git diff --check
  • Codex seven-gate QA; its initial test-coverage concern was resolved by asserting the final ended_at bucket and full-column token conservation

Release

  • npm target: @ipv9/tokentracker-cli@0.39.45
  • npm registry checked: version was not published before this PR
  • macOS + Windows release workflow required after merge

Closes #154

Keep the initial cumulative observation on started_at, place subsequent active-session deltas in the current sync bucket, and retain ended_at for the final delta. This prevents sessions spanning midnight from growing the prior day's usage while preserving totals across all token columns.
@pitimon
pitimon merged commit b2bd6f0 into main Aug 5, 2026
1 check passed
@pitimon
pitimon deleted the fix/154-hermes-active-delta-buckets branch August 5, 2026 22:48
@pitimon

pitimon commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

Release verification complete:\n\n- npm: @ipv9/tokentracker-cli@0.39.45 published and latest verified\n- CI: PR ci:local passed\n- GitHub Release: https://github.com/pitimon/TokenTracker/releases/tag/v0.39.45\n- Assets: macOS DMG, Windows x64 ZIP, and Windows installer published\n- Local macOS services: dashboard and local-sync pinned to 0.39.45; dashboard serves v0.39.45 on port 17680\n- Live attribution check: previous-day Hermes buckets stayed unchanged while the current observation bucket increased after sync, confirming the cross-day fix\n\nThe repository npm-publish job failed because NPM_TOKEN is empty; manual authenticated publish succeeded.

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.

[bug]: Hermes active-session deltas are attributed to started_at across day boundaries

1 participant