Skip to content

Make the plugin version identify the bytes it was built from - #161

Merged
silverstein merged 1 commit into
masterfrom
plugin-version-provenance
Aug 15, 2026
Merged

Make the plugin version identify the bytes it was built from#161
silverstein merged 1 commit into
masterfrom
plugin-version-provenance

Conversation

@silverstein

Copy link
Copy Markdown
Member

The problem

package.json only moves at release time, so every publish between releases claimed the previous version while carrying different server code.

That is not hypothetical. The published plugin read 0.10.0 while built from ffe9130, which is 86 commits past that tag and includes the signalled-shutdown change that alters process exit codes. PROVENANCE.md recorded the truth, but nothing a host shows a user did. The publisher exists to stop the distribution channel drifting from source, and it had no defence against drifting in the one field people actually read.

The fix

plugin.json and the Codex manifest derive their version from git describe.

Build metadata after + is valid semver and is ignored for precedence, so a build made at a tag still reads 0.11.0, while one made after it reads 0.11.0+95.gb09d23d. Verified both ways: a dirty tree produced 0.10.0+94.g4953297.dirty and a clean one 0.10.0+95.gb09d23d.

The count is git describe's, meaning commits since the tag along its default walk. rev-list --count and --first-parent answer different questions and give different numbers for the same pair, so the comment names the measure rather than leaving someone to guess which of the three they are reading. That ambiguity has already produced one wrong number in a cross-lane report today.

The trap this nearly walked into

A checkout with no tags falls back to package.json and announces it on stderr.

That case is real: actions/checkout clones at depth 1 by default, finds no tags, and would have silently restored the old behaviour inside the republish workflow I added earlier today. The workflow has been fixed in the plugin repo to use fetch-depth: 0, so the fallback stays a genuine edge case rather than the normal path.

🤖 Generated with Claude Code

package.json only moves at release time, so every publish between releases
claimed the previous version while carrying different server code. The published
plugin read 0.10.0 while built from ffe9130, which is 86 commits past that tag
and includes a signalled-shutdown behaviour change that alters exit codes.
PROVENANCE.md recorded the truth, but nothing a host displays to a user did, and
the publisher exists precisely to stop the distribution channel drifting from
source.

plugin.json and the Codex manifest now derive their version from git describe.
Build metadata after "+" is valid semver and is ignored for precedence, so a
build made at a tag still reads 0.11.0 while one made after it reads
0.11.0+94.g4953297. The count is git describe's, meaning commits since the tag
along its default walk; rev-list --count and --first-parent answer different
questions and give different numbers for the same pair, so the comment names the
measure rather than leaving it to be guessed.

A checkout with no tags falls back to package.json and says so on stderr. That
case is real rather than theoretical: actions/checkout clones at depth 1 by
default, which would have silently restored the old behaviour in the republish
workflow. That workflow is being fixed in the same change to fetch full history.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@silverstein
silverstein merged commit 2a4f831 into master Aug 15, 2026
2 checks passed
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