Skip to content

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

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

Usage reporting was wired into Patchwork in #26 with a first-run notice and a README subsection, but no single-step way out that works across every trace-reporting program. This PR completes the disclosure without changing what is reported: the vendored trace client is updated to 0.2.0, which honours the TRACE_USAGE_REPORTING=off and DO_NOT_TRACK=1 environment variables ahead of settings.json; the first-run notice now carries the details link and the environment opt-out; and the README gains a top-level ## Usage reporting section that lists the real event and every opt-out. The endpoint, the event name and the runtime-key model (PATCHWORK_USAGE_REPORTING_KEY) are untouched. Branched from main as it stands today (0c3c548).

  • trace_client.py, tests/test_trace_client.py: re-vendored from trace-client-python 0.2.0 (only the vendoring note and one import path differ). The constructor now checks the environment first and exposes disabled_reason.
  • usage_reporting.py: the notice names the details link and TRACE_USAGE_REPORTING=off; a new firstRunNotice() returns Usage reporting is off (environment). instead when the environment has already opted out. buildClient already constructs through TraceClient whenever the settings could be read, so the environment variables win over enabled; its docstring says so.
  • tests/test_usage_reporting.py: the two environment variables are scrubbed in each test's setUp; new tests assert that DO_NOT_TRACK=1 and TRACE_USAGE_REPORTING=off send nothing to a loopback stub even with enabled: true and a key present, that disabled_reason is environment, that the notice carries the link and the env-var opt-out, and that a first run under the environment opt-out logs the off line while still writing the default block. The old notice assertion was updated.
  • README.md: the ### Usage reporting subsection under Getting Started is replaced by a top-level ## Usage reporting section before the license, per the shared wording (what is sent, what is not, every opt-out including the unset key, details link); the feature bullet links to it.

Verified with python3 -m unittest discover -s tests (Python 3.8): Ran 69 tests ... OK (59 before this change). The repository has no CI workflow.

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

Re-vendor trace-client-python 0.2.0 so TRACE_USAGE_REPORTING=off and
DO_NOT_TRACK=1 turn reporting off ahead of settings.json, extend the
first-run notice with the details link and the environment opt-out, and
promote the README section to a top-level "Usage reporting" that lists
what is sent and every way to opt out.

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