Repository navigation
sync_shared: optional version lock key, the release tag on the locked commit (F14) - #31
Merged
Merged
Conversation
…ocked commit (F14)
shared.lock may now carry `version = "v0.1.0"` next to `commit`. It is a label
for people; the SHA stays the pin.
- --update looks up the release tags on the commit it moves to (one call to
GitHub's tags endpoint, first 100) and writes the highest (vX.Y.Z[-pre];
a release beats its own -rcN), or leaves the key out when the commit is
untagged. Tagging the locked commit later is picked up by the next --update
("already at 1a2b3c4 (v0.1.0)"). A failed lookup warns and doesn't fail the
update: same commit keeps its version, a new commit gets none.
- read_lock knows the key (no unknown-key warning) and refuses anything that
isn't a strict vX.Y.Z[-pre]: the value goes back into TOML as written.
- --check's label and --update's message show it; so does the COMMIT column
of sync_all_siblings.py status.
Rollout: siblings run their own copy of this script, and --update writes the
lock with the copy that is running, i.e. the one from before the update. So
the sync that delivers this script still writes a lock without `version`; the
key first appears on the following --update, written and then read by a
script that knows it. An older script only ever sees it if a lock is copied
or downgraded by hand, and then it warns and ignores the key. Rollback:
delete the line.
Refs #16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Refs #16 (F14 (b): tag
mainsoshared.lockcan carry a human-readable version next to the SHA).Convention change: the lock may carry
version = "vX.Y.Z". It is a label; the commit stays the pin.Behaviour
--updateGET /repos/{repo}/tags?per_page=100) and writes the highest. A release beats its own-rcN; non-version tags are ignored. Untagged → noversionkey, and a stale one is dropped.--updateon an already-locked commit that has since been taggedshared.lock: already at 84bf57a (v0.1.0)--updatewhen the tag lookup fails (rate limit, network)--checkshared files: all 16 match mcp-server-shared at 84bf57a v0.1.0 (locked)sync_all_siblings.py status84bf57a v0.1.0read_lockversionis a known key (no F9 warning). Anything other than a strictvX.Y.Z[-pre]is refused, because the value is written back into TOML verbatim.Rollout: why the reader doesn't need a separate release
Siblings run their own copy of
sync_shared.py(sync_all_siblings.pycallsscripts/sync_shared.pyin each sibling).--updatefetches the new script and writes the lock in one run, using the running (old) copy'sdump(). So:sync_all_siblings.py update --pr. Each sibling's old script (fromea07617) writes the newsync_shared.py(reader + writer) and a lock withoutversion, because the old script doesn't write it. No warnings anywhere.version.main. The new script writesversion, and the same commit carries that script, so the only reader of that lock is one that knows the key.An older script only sees the key if someone copies a lock by hand or downgrades the script. Even then it warns and ignores the key (F9 warns, it doesn't fail).
Rollback: delete the
versionline. Every script, old or new, accepts a lock without it.This gives you the "reader first, then writer" ordering from one PR. If you'd still rather split it (reader now, writer after B), say so and I'll cut the writer into a stacked draft.
The tag itself
Not pushed. See my question in the session about which commit
v0.1.0should be: today'smain(84bf57a), or themainthat B releases after the A-series merges. Only a tagged commit that B (or a later sync) moves to gets aversionin sibling locks.Tests
v1.10.0>v1.9.0>v1.10.0-rc2); a failed lookup keeps or drops the version as described; round trip with a bad-value refusal (incl. a TOML-injection attempt); odd API answers; the status column./tags.🤖 Generated with Claude Code