Repository navigation
fix: count a near-miss usage-reporting opt-out as off - #264
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LYNeupL3KtraCJoZMADVQE
1 of 2 tasks
dmccoystephenson
added a commit
that referenced
this pull request
Nov 20, 2026
#265) docs/TESTING.md still said only an explicit 0/false/no/off opts out and an unreadable notify.env just warns, which #263 and #264 changed: the switch fails closed, an unreadable notify.env is off, and near-miss opt-out spellings count as off. README and usage.py's docstring now also say that an environment variable saying on wins over an unreadable notify.env, as tests/test_usage.py asserts. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A usage-reporting opt-out that is not spelled exactly
GARDENER_USAGE_REPORTING_ENABLEDis now counted as off (has_near_miss_opt_outingardener/usage.py). Any name that normalises (lower case, letters and digits only) to something containing "usagereport" is checked:GARDENER_USAGE_REPORTING_ENABLE,gardener_usage_reporting_enabled,Gardener-Usage-Reporting-Enabled) or the bare name (GARDENER_USAGE_REPORTING,USAGE_REPORTING) with a value that is not clearly on;GARDENER_USAGE_REPORTING_DISABLED) with a value that is on.It is applied to
notify.envand to the environment (there only to names that mention gardener, so another program'sFISHE_USAGE_REPORTING_ENABLED=falseorROAM_USAGE_REPORTING=0does not switch gardener off). A near-miss wins over the real setting saying on...._ENDPOINTand..._KEYare never read as a switch. gardener never writesnotify.env, so there is no save path to change.One existing test pinned
TRACE_USAGE_REPORTING=offwritten innotify.envas "on" (the client-wide variables are environment-only). Under the near-miss rule that line now counts as an opt-out; the test was updated (DO_NOT_TRACK=1innotify.envis still not read). An unreadablenotify.envstill leaves an explicitGARDENER_USAGE_REPORTING_ENABLED=truein the environment in charge, as before.Why
A real-server repro showed that an opt-out written under another spelling was not recognised: it was treated as missing, reporting stayed on by default, and the program reported. Reference fix (Java): Dans-Plugins/Medieval-Roleplay-Engine#418
Tests
New tests cover eight near-miss opt-outs in
notify.env(each off, also over the real switch saying on in the file or the environment, and in the environment for gardener-named ones), six lines that must stay on (including endpoint/key), and other programs' switches in the environment being ignored. README updated.Python 3.12,
PYTHONPATH=. python -m unittest discover -s tests: 1395 tests, OK (2 skipped).🤖 Generated with Claude Code
https://claude.ai/code/session_01LYNeupL3KtraCJoZMADVQE
drafted by Claude on behalf of Daniel Stephenson