feat: cross-link muse release add --tag and muse tag add --release (muse#57 item 2)
`muse release add <tag>` and `muse tag add <tag>` have always been two independent systems pointed at the same tag string -- creating one never touched the other, matching the ticket's background: "muse release add v1.0.0 currently creates a MuseHub release record independently of muse tag."
`muse release add v1.0.0 --tag`: after creating the release, also writes a local VersionTagRecord at the same commit (same semver, author from the commit, message from --title) if a version tag with that name doesn't already exist locally. If one already exists at a DIFFERENT commit, warns on stderr with the exact repoint command rather than silently overwriting it -- same non-clobbering stance as this codebase's merge-conflict conventions.
`muse tag add v1.0.0 --release`: after creating the version tag, also builds a changelog since the last non-draft release (reusing build_changelog -- the exact logic `release add` itself uses) and writes a local draft ReleaseRecord (is_draft=True) at the same commit, if a release for that tag doesn't already exist. Composes independently with --sign (both flags can be passed together).
Both directions add a boolean field to their JSON envelope (tag_created / release_created) so scripts/agents can tell whether the cross-link actually fired or the target already existed.
New tests/test_release_tag_crosslink.py (8): --tag creates a version tag and is idempotent against an existing one at the same commit, omitting --tag creates nothing, an existing version tag at a DIFFERENT commit is warned about and left untouched; --release creates a draft release, omitting --release creates nothing, an existing release is not duplicated, and --sign + --release compose correctly together. Confirmed genuine RED (7/8 failed -- unknown flags, missing tag_created/release_created keys) before GREEN with the fix restored.
Targeted regression suite -- the new file plus test_cmd_version_tags.py, test_cmd_tag_sign.py, test_release.py, test_cmd_release_hardening.py -- all pass (311 passed), zero regressions.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Semantic Changes
35 symbols
Files Changed
+1
~3
1221 in snapshot
0 comments
muse hub commit comment sha256:2837c666bf81eea8e28651b4303b6638407601d46ca28955a7158464e08b4c5e --body "your comment"
No comments yet. Be the first to start the discussion.