Expand description
Release version bumps, opened automatically once a merge lands.
magi’s own “Update & restart” only ever looks at tagged GitHub Releases
(src/updater.rs); it never builds or tags anything itself. The tag comes
from auto-tag.yml noticing a Cargo.toml version change on main, and
nothing in the graph used to touch that field - a merge that changed the
phone-facing binary left main ahead of the last tagged release with
nobody to notice, and the next “Update & restart” found nothing newer.
This module is the fix. Once crate::land confirms a merge, the caller
in crate::graph hands off here: an agent is asked which digit of
major.minor.patch the change earns, and this module opens the same
chore/release-vX.Y.Z pull request AGENTS.md already documents as the
hand-driven recipe, with automerge enabled so CI green is the only thing
standing between the merge and the tag.
Everything that can be decided without touching a network or a cargo
binary is a pure function - the version arithmetic, the Cargo.toml
rewrite, the prompt, the coalescing policy - so the policy itself is
asserted directly, the same split crate::land uses for land::decide.
Structs§
- Bump
Decision - The agent’s answer: which digit, and why.
- Pending
Bump - magi’s own record of a bump pull request it currently has open, so a burst of merges in quick succession does not each open a competing release.
- Version
major.minor.patch, the only shape a[package] versionin this ecosystem carries in practice.
Enums§
- Bump
Level - Which digit of
major.minor.patcha change earns. - Coalesce
- What a recorded
PendingBumpmeans for a fresh decision, given what the base branch’sCargo.tomlsays right now. No I/O: the caller reads both the marker and the version. - Pending
Action - What a still-open pending bump means once a fresh decision is in hand.
Functions§
- after_
merge - After a merge lands, ask an agent how big the change was and open a release bump sized to it.
- clear_
marker - Drop a recorded marker. Best-effort: a marker that is already gone is not an error.
- coalesce
- Decide what a pending marker means against
current_version. - decision_
prompt - Build the prompt asking an agent which digit of
major.minor.patcha merged change earns. - is_
release_ only - Did the merged change touch only the release manifest and its lockfile?
- marker_
path - Where
PendingBumpis recorded forrepo- one file per repository, so a machine running magi against more than one checkout does not confuse their releases with each other. - parse_
decision - Parse the agent’s reply. Never returns a default decision: an unparsable
or incomplete reply is
Err, and the caller must not open a bump pull request on the strength of a guess. - pending_
action - Compare a fresh decision against what a still-open pull request already targets.
- read_
marker - Read a recorded
PendingBump, if any. Missing or unreadable both read as “nothing pending” - a marker is bookkeeping, not a source of truth worth failing a merge over. - rewrite_
cargo_ version - Rewrite the
[package]table’sversion = "..."line, leaving every other byte untouched. - should_
release_ bump - Does this run’s final status mean the merge this call is downstream of actually happened?
- write_
marker - Persist
marker, atomically - the same tmp-then-rename shapecrate::updater::write_progressuses, since this file is read by a later, unrelated process invocation and must never be seen half-written.