fix(ci): stop version-guard demanding a bump for byte-neutral src/ changes - #111
Merged
Conversation
…anges The shipped-bytes detector matched every non-test file under src/, but TypeScript there is not shipped: it reaches users only after esbuild inlines it into build/index.js. A comment-, formatting- or type-only edit that leaves the committed bundle byte-identical was therefore hard-blocked by require-version-bump, leaving two bad options — publish a release of literally nothing, or do not write the comment. apple-photos-mcp#58 (docs + a code comment, bundle byte-identical) hit exactly this. src/**/*.ts is now a first-cause detector that implies a bump only when build/** changed too. The exemption is sound rather than convenient: ci.yml has a "Verify committed build/ matches source" step that rebuilds and requires `git diff --quiet build/`, and it lives in the `test` job whose test (22) / test (24) contexts are required by branch protection. So at merge time an unchanged build/ provably matches src/ — a src edit that DID change the bundle cannot merge without the rebuilt bundle, which build/** then catches. Everything else stays an unconditional detector: build/**, requirements.txt, and any non-.ts file under src/ — which is what package.json files[] ships verbatim (the *_reader.py sidecars in numbers/photos). The rule is written fail-safe: only .ts is treated as bundle-only, so a new file type added under src/ defaults to requiring a bump rather than silently escaping the guard. __tests__/__mocks__ paths are excluded from that detector too, since no repo ships them. Verified against 13 scenarios (photos#58 shape, docs-only, test-only, lockfile-only, src+build, build-only, requirements.txt, both .py sidecars, and hypothetical src/*.json / *.applescript additions). The file stays byte-identical across all four repos (conformance-check.sh); this same commit lands in each. .github/ does not ship, so no version bump.
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.
Problem
version-guard's shipped-bytes detector matched every non-test file undersrc/:But TypeScript under
src/is not a shipped file — it reaches users only after esbuild inlines it intobuild/index.js. So a comment-, formatting- or type-only edit that leaves the committed bundle byte-identical was hard-blocked byrequire-version-bump, leaving two bad options: publish a release of literally nothing, or don't write the comment.apple-photos-mcp#58 hit exactly this — docs plus a code comment, bundle byte-identical, guard red.
Fix
src/**/*.tsbecomes a first-cause detector that implies a bump only whenbuild/**changed too.The exemption is sound rather than merely convenient.
ci.ymlhas a "Verify committed build/ matches source" step that rebuilds and requiresgit diff --quiet build/, and it runs in thetestjob — whosetest (22)/test (24)contexts are required by branch protection. So at merge time an unchangedbuild/provably matchessrc/: asrcedit that did change the bundle cannot merge without the rebuilt bundle, andbuild/**then catches it. (That coupling is now stated in the workflow's header comment, andconformance-check.shalready asserts both the step and the contexts.)Unconditional detectors are unchanged:
build/**,requirements.txt, and any non-.tsfile undersrc/— which is precisely whatpackage.jsonfiles[]ships verbatim (the*_reader.pysidecars in numbers/photos). The rule is written fail-safe: only.tsis treated as bundle-only, so a new file type added undersrc/defaults to requiring a bump rather than silently escaping the guard.__tests__/__mocks__paths are excluded there too, since no repo ships them.Verification
Detector logic exercised against 13 scenarios:
CHANGELOG.md CLAUDE.md src/index.ts(photos#58).github/, lockfile-onlysrc/index.ts+build/index.jsbuild/index.jsonlyrequirements.txtsrc/utils/photos_reader.py,src/utils/numbers_reader.pysrc/data/table.json,src/x.applescriptYAML parses;
format:checkclean.Scope
.github/only — does not ship, so no version bump. The file stays byte-identical across all four repos (conformance-check.shIDENTICAL set); this same commit lands in each.