Skip to content

Send a random installation ID with usage reports (trace-client-python 0.4.0) - #218

Merged
dmccoystephenson merged 1 commit into
mainfrom
trace/install-id
Oct 3, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
trace/install-id

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

The vendored trace client is re-vendored at trace-client-python 0.4.0 (the released file, with the repo's existing vendoring note and import path kept; its upstream test suite is re-vendored with it). The program now passes a per-installation ID, so trace can count installations instead of raw events.

  • What is sent: every event also carries the tag install, a random UUID. It is not derived from the machine, the user or an address; it only says "these events came from the same installation".
  • Where it lives: trace-install-id in FishE's existing save directory (config.dataDirectory: data/, or FISHE_SAVE_DIR), next to the usage-reporting-notice-shown marker — the program already keeps its state between runs there, so that is used instead of the generic user-data-dir convention. Like the marker, it is not read as a save slot by SaveFileManager. Deleting the file resets the ID. A server deployment that points FISHE_SAVE_DIR at a volume keeps its ID; an ephemeral one gets a new ID per container, which is acceptable. Setting the environment variable TRACE_INSTALL_ID (non-blank) sends that value instead, which lets an operator pin an ID.
  • Opt-outs first: the ID and the file path are handed to the client, which resolves them only after its own opt-out checks; a disabled client (settings switch, TRACE_USAGE_REPORTING=off, DO_NOT_TRACK=1) never creates, reads or sends it. The standalone install_id_from_file helper is not called.
  • Wiring: installIdPath(config) in src/usageReporting.py; createClient passes install_id=os.environ.get("TRACE_INSTALL_ID") and install_id_file=installIdPath(config). The first-run notice now mentions the ID, and the README's variable table gains TRACE_INSTALL_ID.
  • README: the Usage reporting section now says an installation ID is sent, where it is stored, that deleting the file resets it, and that the opt-outs stop it.
  • Tests: python -m pytest --verbose -vv --cov=src ... (the CI command, run here as pytest -q) passes locally on Python 3.12 with the pinned tak: 963 passed. tests/test_usageReporting.py now expects the install tag on startup and save-loaded, and covers the file living in the save directory, not reading as a save slot, being reused across starts, TRACE_INSTALL_ID winning, and no file under the FishE and environment opt-outs; tests/conftest.py clears TRACE_INSTALL_ID.
  • Notes: The in-browser (Pyodide) front-end still never builds an enabled client, so it gets no ID and nothing goes to localStorage.

🤖 Generated with Claude Code

https://claude.ai/code/session_014ztkfamsbEqQfcu76me5SL


drafted by Claude on behalf of Daniel Stephenson

… 0.4.0)

Re-vendors trace-client-python at 0.4.0 and passes it a per-installation
ID: TRACE_INSTALL_ID when set, otherwise a trace-install-id file the
client creates (only when reporting is on). The README says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ztkfamsbEqQfcu76me5SL
@dmccoystephenson
dmccoystephenson merged commit cc11eed into main Oct 3, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the trace/install-id branch October 3, 2026 23:47
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