Report usage to trace - #21
Merged
Merged
Conversation
A command-line run now reports a startup event (tag version) and an ideas-written event after the session's ideas are saved, through the vendored trace-client-python 0.2.0. The program key ships in src/usage_reporting.py and in the settings.json block written on first launch, with a one-line notice. Opt out with usage_reporting.enabled: false in settings.json, TRACE_USAGE_REPORTING=off or DO_NOT_TRACK=1. Direct main() calls (the test suite) report nothing and the CI end-to-end run sets TRACE_USAGE_REPORTING=off. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012tRTngcEmZUaiHKcX2ErSS
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012tRTngcEmZUaiHKcX2ErSS
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.
Collide is part of the danielstephenson.dev showcase and now reports that it was used to trace, the same way apex and Kreatures do. A command-line run sends a
startupevent tagged with the version and anideas-writtenevent once the session's ideas are saved. Nothing about the user, the machine, the keywords or the ideas is sent. Reporting is on by default with a one-line first-run notice, and is turned off with"usage_reporting": {"enabled": false}insettings.json,TRACE_USAGE_REPORTING=offorDO_NOT_TRACK=1.src/trace_client.py: trace-client-python 0.2.0 vendored frommain, unmodified apart from the header note; it honours the environment opt-outs.src/usage_reporting.py: settings block insettings.jsonat the repository root (written on first launch, with the notice), the shipped program key (keys identify a program and are not secrets, per trace's ADR 0001) and thestartupevent. The version is0.1.0, the last release, since the repository has no version file.src/collide.py: reporting starts only from the command line;main()called directly (as the tests do) reports nothing.ideas-writtenis sent after the file is written.tests/: the client's own test suite plus tests for the settings block, the notice, the opt-outs, the event at a loopback stub, and the command-line path..github/workflows/tests.yml: the end-to-end run setsTRACE_USAGE_REPORTING=offso CI never reports; the new modules are compiled too..gitignore,README.md:settings.jsonis ignored; a## Usage reportingsection is added.Verified:
python3 -m unittest discover -s testspasses on Python 3.8 and 3.11. A real run withsettings.jsonpointed at a loopback stub deliveredstartup(tagversion) andideas-writtenforCollidewith the shipped key. One event taggedci=trueandverify=truewas sent to production with the shipped key and was accepted with HTTP 201.🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson