feat: stamp the plugin version on every report - #31
Merged
Conversation
A report pasted as a screenshot could not answer "which version wrote this", and that is the first question whenever one looks wrong - a missing section is either an old install or a bug we shipped, and telling those apart cost a round trip. Both headers now end with the version, and so do the three empty-data paths: no dispatches logged, no subagent transcripts, and an out-of-range window. Those are the outputs people screenshot when something looks broken, so they are the ones that most need to identify themselves. The version is read from the manifest next to the script rather than from CLAUDE_PLUGIN_ROOT, which the hook sets but a direct "node hooks/dispatch-counter.mjs report" does not. An unreadable manifest costs the stamp and nothing else - a version label must never be able to break a report.
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.
A report pasted as a screenshot could not say which version wrote it, and that is the first question whenever one looks wrong. It came up today: a report was missing its cost section, and the two candidate explanations - an install older than 0.14.0, or a bug in what 0.14.0 shipped - could not be told apart without asking the person to run another command.
Both headers now end with the version:
So do the three empty-data paths - no dispatches logged, no subagent transcripts, and a window with nothing in it. Those matter most: an empty report is exactly what people screenshot when they think something is broken, so it is the one that has to identify itself. The no-transcripts message was found by the test, not by design - it takes a different code path from the header and would have shipped unstamped.
The version is read from the manifest next to the script, not from
CLAUDE_PLUGIN_ROOT. The hook sets that variable; a directnode hooks/dispatch-counter.mjs reportdoes not, and the direct invocation is exactly how someone debugs a broken report. An unreadable manifest degrades to an unstamped header - a version label must never be able to break a report, which is what the second test pins by running the script copied away from its manifest.The stamp test reads the version from the manifest instead of hardcoding it, so it asserts the wiring rather than a literal that would go stale at the next release.
82 of 82 tests pass.