Expand description
The version a landing allocates (ADR 0134): what the integration executor raises the
trunk’s version to when it lands a pull request, decided from three things and nothing
else — the version the trunk declares, how far the pull request moves the public contract
(ADR 0051’s measurement), and the repository’s typed release: policy.
trunk version ─┐
observed impact ─ compat::Policy::required_of ─ required ─┐
policy floor ── (an exemption lowers only this) ── floor ─┴─ max ─ selected ─ nextThe decision is a pure function, so the executor, majordomus release next, the
Cockpit and a test all reach the same answer from the same inputs. Nothing here reads a
branch’s own version: the number is always the trunk’s raised, which is what makes a
retried or repeated landing allocate once and two pull requests unable to hold the same
number.
use majordomus_cli::release::compat::Impact;
use majordomus_cli::release::landing::{decide, Allocation, ReleasePolicy};
use majordomus_cli::release::version::Version;
let policy = ReleasePolicy { allocation: Allocation::Landing, floor: Impact::Minor, exempt: vec![] };
// a fix behind the boundary still advances a minor under a minor floor
let d = decide(Version::parse("0.20.0").unwrap(), Impact::Patch, &policy, &["src/a.rs".into()]);
assert_eq!(d.next_version, "0.21.0");
assert_eq!(d.selected, Impact::Minor);Structs§
- Applied
Exemption - The exemption a decision applied, by class.
- Landing
Decision - What a landing allocates, and why, step by step.
- Release
Exemption - One exemption class of
release.exempt: a pull request whose every changed path one class covers is not held to the floor. The compatibility requirement still applies. - Release
Policy - The
release:block of.ai/repo/policy.yaml(ADR 0134). - Unreadable
- Why a landing decision could not be made: an input that could not be read. Never a decision of its own — an unreadable trunk or surface is refused, not guessed.
Enums§
- Allocation
- Whether the integration executor allocates the version when it lands a pull request.
Constants§
- DECISION_
SCHEMA - The schema a
LandingDecisioncarries, so a reader knows which rules reached it.
Functions§
- decide
- Decide what a landing allocates (ADR 0134 §2-4).
- decide_
adding decidefor a change that also says which of itschangedpaths itadded: the record of the trunk’s release lands at that release’s number only when the change adds it.decideknows of no added path, so it never grants that.- next_
for - What a landing of
headontobaseallocates in the repository atroot: the trunk’s version is the manifest atbase; the movement is the committed registry whereheadforked frombaseagainsthead’s, and the changed paths are git’s over the same span. Measuring from the fork point is what makes the movement the pull request’s own: a head that is behindbaselacks whatbaseadded since, and read againstbaseitself that absence would count as a removal it never made. Everything is read from git, so the answer is the same in any checkout and does not depend on which executable runs.