Skip to content

fix: remove the worldwide token counter - #4322

Open
ScriptedAlchemy wants to merge 5 commits into
masterfrom
fix/3619-remove-worldwide-counter
Open

ScriptedAlchemy wants to merge 5 commits into
masterfrom
fix/3619-remove-worldwide-counter

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Fixes #3619

What was broken. The worldwide token counter was still live: the CLI and MCP server uploaded pending token amounts to the hosted Cloudflare Worker (/increment, /total), the doctor probed it, and user.upload_enabled.v1, enable-upload-counter and disable-upload-counter advertised it.

Fix. The counter is removed end to end and local accounting is untouched.

  • Removed the Worker client in cloud.rs, global::try_flush, startup and shutdown flushes, MCP pending-delta scheduling and persistence in ledger.rs, and the doctor reachability probe.
  • Removed the two upload commands and their help text. They now fail as unknown subcommands (parser test).
  • Removed user.upload_enabled.v1 and upload_enabled from the configuration registry, API patch, dashboard settings and observatory controls. A patch or read that names them is refused.
  • Regenerated dashboard contracts. The TypeScript SDK and embedded/server.mjs are unaffected.
  • Legacy profiles: upload_enabled, pending_upload, last_upload_at and last_worldwide_* in an old config.toml, and the stored user.upload_enabled.v1 row, load normally. The next write drops them. The pending amount is never uploaded.
  • Kept: current-counter, reset-counter, gain, cost, the monitor, savings ledger persistence, and the independent release callback in the dashboard cloud bridge.
  • Decommission note in docs/USER-GUIDE.md and docs/REBRAND-COMPATIBILITY-POLICY.md (A5). The Worker and its Upstash Redis store are not in this repository, so shutting them down is a maintainer action.

Evidence. git grep finds no worker host, no /increment or /total call, and none of the removed names outside retired-feature tests, docs and the changelog.
Bazel, all passing: unit_test for tracedecay, tracedecay-api, tracedecay-cli, tracedecay-configuration, tracedecay-dashboard-api, tracedecay-domain, tracedecay-global-db and tracedecay-session-memory, plus core_cli_suite, mcp_suite, dashboard_api_test and runtime_acceptance_suite. Clippy and rustfmt_check_2024 are clean for those crates, gen_builds.py --check is current, dashboard contracts:check is up to date, tsc --noEmit is clean, and the observatory, settings and fixture vitest files pass (296 tests).
Legacy-state regression tests: global-db persistence (old enabled opt-in converges), session-memory user_config (old keys ignored and dropped), dashboard settings API (patch refused, field not served), CLI configuration get of the retired key, and a doctor test that asserts no counter probe.


Devin Review

@changeset-bot

changeset-bot Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b9e75b6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

This branch has not been deployed

No deployments
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.

Remove the worldwide token counter entirely while preserving local metrics

1 participant