Skip to content

Disclose usage reporting: README, environment opt-out, notice link - #1

Merged
dmccoystephenson merged 1 commit into
mainfrom
trace/disclosure
Sep 16, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
trace/disclosure

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Part of the trace disclosure pass. Usage reporting was rolled out without a loud enable or a one-step exit; this release gives the Python client the environment opt-out shared by every trace client, a way for programs to say why reporting is off, and README wording that points at the public details page. Nothing about what is sent changes.

  • trace_client/trace_client.py, trace_client/__init__.py: TRACE_USAGE_REPORTING=off (accepted: off, false, 0, no, case-insensitive) and DO_NOT_TRACK=1 (accepted: 1, true, yes) are checked in the constructor before the program's own enabled flag; environment_opts_out() and the variable/reason constants are exported. A disabled_reason attribute is set once at construction to "environment", "config" or "no key" (first match wins), or None when the client reports. Header, __version__ and therefore the User-Agent are bumped to 0.2.0. Existing behaviour (returns immediately, never raises, bounded queue, close() drains) is untouched; Python 3.8+ and the standard library only.
  • pyproject.toml: version 0.2.0.
  • tests/test_trace_client.py, tests/__init__.py: tests for each variable, each accepted value, the values that must not opt out, precedence over enabled=False and over a missing key, disabled_reason in every state, and the 0.2.0 User-Agent. Every test now starts from an environment scrubbed of both variables so a host that has opted out cannot break the suite. tests/__init__.py is new: without it python -m unittest -v (the documented and CI command) discovered nothing, so CI had been failing with NO TESTS RAN on 3.12 and passing vacuously on 3.8 since the first commit. 21 tests now run and pass on 3.8 and 3.11.
  • README.md: the opt-out paragraph becomes a ## Turning it off section listing every way to switch reporting off in precedence order, disabled_reason, and the first-run notice now names TRACE_USAGE_REPORTING=off and links https://github.com/Stephenson-Software/trace#usage-reporting.

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

…bump to 0.2.0

The constructor now checks the two environment opt-outs shared by every
trace client -- TRACE_USAGE_REPORTING=off (off/false/0/no) and
DO_NOT_TRACK=1 (1/true/yes), case-insensitive -- before the program's own
enabled flag, so a user can switch off every trace-reporting program at
once. TraceClient.disabled_reason says why a client reports nothing
("environment", "config", "no key"; None when on) so programs can log it.

Adds tests/__init__.py: without it `python -m unittest -v` discovered no
tests at all (CI has been failing with "NO TESTS RAN" on 3.12 and passing
vacuously on 3.8 since the first commit). 21 tests now run on 3.8 and 3.11.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dmccoystephenson
dmccoystephenson merged commit 1a25695 into main Sep 16, 2026
3 checks passed
@dmccoystephenson
dmccoystephenson deleted the trace/disclosure branch September 16, 2026 03:57
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