Global telemetry opt-out does not suppress sponsor usage metering
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 19.9k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 30
Description
Summary
Jcode's global telemetry opt-outs do not suppress sponsored-discovery usage metering. With sponsors enabled, sponsored MCP/tool provenance can still send connect, call, and error reports even when JCODE_NO_TELEMETRY, DO_NOT_TRACK, or the no-telemetry marker disables ordinary telemetry.
Why this matters
From an operator privacy boundary, both paths are product-originated usage reporting. A global telemetry/privacy opt-out should either cover all such egress or the sponsor channel should require separate, explicit consent with clear UI and documentation.
Today the two controls can produce a surprising state: ordinary telemetry reports disabled while sponsored usage reports remain enabled.
Source trace
Audited at 008abc44b1653efa65ccf98acb3b7236ce8507e6:
- Ordinary telemetry's
is_enabledhonors the environment and marker-file opt-outs. - Sponsored provenance/reporting checks
sponsors.enabledindependently. - The sponsor path emits session/day/connect/call/error usage reports in
provenance.rs.
Reproduction shape
- Leave sponsored discovery enabled.
- Set
JCODE_NO_TELEMETRY=1,DO_NOT_TRACK=1, or create the no-telemetry marker. - Use a discovery-tagged sponsored MCP/tool.
- Observe that the sponsor reporting path remains eligible to send usage events because it does not consult the telemetry/privacy opt-out.
Expected behavior
One of these contracts should be explicit and enforced:
- Global privacy opt-out suppresses ordinary telemetry and sponsored usage metering, or
- Sponsored metering is a separately consented feature that is off until the operator explicitly enables it.
In either case, status/doctor output should show every outbound usage-reporting channel and its effective state.
Suggested regression
Add a no-network unit test around the sponsor reporter that enables sponsors, activates each global opt-out mechanism, triggers a sponsored call, and asserts that no report is queued or sent.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in crates/jcode-telemetry-core/src/lib.rs, where is_enabled handles environment and marker-file opt-outs, then compare it with the sponsors.enabled and reporting logic in crates/jcode-base/src/sponsors/provenance.rs. Add a no-network regression test covering each global opt-out during a sponsored call. Done means the chosen consent contract is enforced and status/doctor output reflects every outbound usage-reporting channel.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100