Design 47 H2: H-A-588 to H-A-593, complete a partly published version instead of refusing its rebuild for ever

Issue 1984 note 3: a build that published some artifacts under its reserved version
and then failed kept that version on every build again, packed new digests and was
refused by the registries each time (214 refusals over 17 versions of 10 modules;
main.457's 91 movers stranded). ADR 0674 §1, ADR 0605 §4 and ADR 0267 §6 already
settle the shape: what a store keeps is published again by digest; what no store
keeps is built again under the same number, its held artifacts answered with the
held version; a new number only for a number another build holds; every build
module builds one source and version to one digest, held by a kit case. The lines
start H2-lead-answers-2.md, since H2-lead-answers.md passed its 60 KB bound.
This commit is contained in:
2026-11-23 15:54:35 +01:00
parent 0f45c563bf
commit 4189746951
@@ -0,0 +1,180 @@
---
layer: to-be
status: in-progress
design: 47
milestone: H
updated: 2026-11-23
decisions:
- "ADR 0674"
- "ADR 0267"
- "ADR 0605"
- "ADR 0606"
- "ADR 0611"
- "ADR 0666"
- "ADR 0664"
- "ADR 0498"
- "ADR 0487"
- "ADR 0595"
- "ADR 0596"
---
# Design 47, milestone H2: lead answers, continued
This file continues [H2-lead-answers.md](H2-lead-answers.md) from H-A-568 on, since that file passed its 60 KB bound.
H-A-568 to H-A-587 still stand in H2-lead-answers.md until a later round moves them here; H-A-588 and later are
written here alone. Each line names the record or the principle that settles it.
## Partly published versions (issue 1984 note 3, 2026-11-23 from 15:50 CET)
Issue 1984 note 3: a build that publishes some of its artifacts under its reserved version and then fails keeps that
version when it is built again (H-A-225; H §755), packs new digests and has them refused by the registries as held at
another digest: 214 refused publishes over 17 versions of 10 modules on 23 Nov, and main.457's 91 movers stranded by
one of them, mesh-delivery-builder's 0.1.216. The lines below say how such a version is completed, when a build again
takes a new number, how every build module is held to one digest per source, the tool that recovers today's versions
and how each is checked.
- **H-A-588 (a partly published version is completed from what a store keeps, else built again under its own number,
15:52)** 23 Nov, issue 1984 note 3; amends G §588 and H §755. (1) A reserved version V of a fingerprint F is partly
published when a registry seat holds at least one artifact of the module at V and not all of them, as each seat's
`versions` answers it (ADR 0605 §2). `version-unreleased` (G §369) names it, with the artifacts held and those
missing, whether the build that reserved V ended done or failed. (2) When every missing artifact's digest is on the
reservation and a store keeps its bytes (the holder's own, or the artifact store by digest, A-417), V is completed
by the builder's publish again: the stored artifacts are sent by their digests under V and nothing is built
(ADR 0674 §1; G §588, A-457). This path is unchanged. (3) When a missing artifact's bytes are kept by no store, V is
completed by building F again under V, never by publishing from a copy. That is the case of a build that ended
failed, whose packed files leave its node with the failed key (ADR 0498 §2); of a package, whose bytes no store but
its registry keeps (A-490); and of a publish again refused `not stored` (A-417). The build again takes F's standing
reservation (ADR 0606 §1: a fingerprint keeps its number; H-A-225) unless H-A-590 withdraws it. The build module
builds the module whole, as every build ask has it. Each artifact a registry already holds at V for F is answered
with the held version and digest (H-A-589), and a reproducible build gives it that digest anyway (H-A-591); the
missing ones are stored, and the catalog then says `version-released` (G §349). G §588's "its build key is built
again by `builder_build_again`, which reserves anew" reads "under its standing reservation, or at the next free
number by H-A-590". (4) Before a build module is asked for F again (by the runner's build step, `runner_rerun`,
`builder_build_again` or the builder's start pass), the builder reads the registries' record of the module's
artifacts at V, the read H-A-275 makes. It writes on the reservation the held digest of each artifact a registry
holds at V for F and marks it published, as H-A-274 marks one held at the built digest; the marking says
`package-published` of it once, as every marking does (ADR 0666 §15). So the artifacts a failed build published are
on its reservation, though a build records its digests only at its end (A-415, A-490j). In the builder
(mesh-delivery). How it is checked: H-A-593 (1) and (5). ADR 0674 §1, ADR 0606 §1, ADR 0498 §2; principles 3 and 7.
- **H-A-589 (a rebuild of a fingerprint a registry holds is answered with the held version; each holder keeps the
fingerprint of what it holds, 15:55)** 23 Nov, issue 1984 note 3; amends H-A-393, H-A-474 and A-490j for the rebuild
of a held fingerprint, which ADR 0605 §4 answers and they refused: "a rebuild of a fingerprint the seat already
holds answers the held version and stores nothing". (1) The rule holds for every holder of the four registry seats:
the distribution module for `container-image-registry` and `oci-artifact-registry`, and the gitea module's Go bundle
for `go-package-registry` and `npm-package-registry` (ADR 0605 §1). A holder may hold an artifact's name at V at
digest D and be given a `publish` that names V with another digest and the fingerprint the holder keeps for that
name and V. It then asks `reserved` as it does for every publish (G §381), naming D. When the answer holds V
reserved or released for the module, the holder says `published` with D and the publish's name, version, kind, tag,
fingerprint and commit. It stores nothing, drops the transfer and its parts (ADR 0611 §1), and writes one journal
line naming the name, V, both digests and the fingerprint. When it keeps another fingerprint for V, or none, it
refuses and names both digests and both fingerprints (H-A-393; ADR 0605 §4: "a held version offered with other
bytes"). The same digest is answered as held (H-A-474). (2) The fingerprint it keeps: each holder keeps a state of
its own, `fingerprints` (the template `state`, ADR 0595, reached by the holder alone, ADR 0596 §2). It holds one key
per name and version, `<name>.<version>`, each token escaped as a key's name is (G §73), with the digest and the
fingerprint the publish named. The holder writes the key when it stores the version and deletes it when it says
`removed`. A key is about 0.3 KiB, and the state is capped at 16 MiB, about 50,000 versions held. Past 80 % the
holder writes a finding, cleared below; at the cap it refuses a new publish with `refused` naming the cap, as its
incoming store does (design 51). A version stored before this change has no key. (3) The seats' verb `versions`
answers each version's `fingerprint` beside its digest, absent where none is kept, and is the read of that state.
The four seats' definitions in mesh-delivery-contracts gain the field; they are regenerated and each form is raised
by one. (4) A build module whose publish is answered `published` with another digest than it built names, in its
step result, the digest the seat answered for that artifact (ADR 0605 §9: a done key names the reference its seat
answered), and writes both digests in its step log. mesh-delivery-sdk's shared publish does it for every build
module. So the builder records the held digest, and A-490j's "version taken" is not met by such a rebuild. (5) The
cases every registry seat holder runs, mesh-delivery-sdk's `publishconformance` (A-490a), gain the three cases of
(1), and each holder's tests run them for every seat it fills. (6) The order is the module graph's: the builder's
`invokes` of the seats' `versions` gives an edge "B runs a version that serves A" from each holder (ADR 0666 §14).
So the holders are in an earlier tier than the builder of H-A-590, and no such builder reads a holder that keeps no
fingerprint yet. How it is checked: H-A-593 (2) and (4). ADR 0605 §2, §4, §9; ADR 0611 §1; principles 2 and 3.
- **H-A-590 (a build again keeps its number unless a registry holds that number for another build; then it takes the
next free number, 15:58)** 23 Nov, issue 1984 note 3; amends H-A-225 and H §755, and widens H-A-275 and H-A-279 from
a done build to every build again. (1) A build again of F takes F's standing reservation V (H-A-225; ADR 0606 §1),
except when a registry holds an artifact of the module at V for another fingerprint or with none kept (H-A-589 (3)).
V is then held elsewhere. The builder withdraws V, a gap kept in the key's withdrawn numbers (H-A-226). It raises
`version-held-elsewhere` (scope module), naming the artifact, the seat, both digests and the fingerprint V is held
for when one is kept (H-A-279). Then it reserves the next number no registry holds (H-A-275), for a build that ended
failed as for a done one. The reserver (`versions.Reserver.Reserve`) makes this check before it answers a standing
reservation, from the read of the registries it already makes for the held numbers. `reservations.movedElsewhere`
stays the done build's path from its publish item and makes the same withdrawal. A read that does not answer keeps
the standing reservation and is said in the builder's journal, as the reserve's read is said today; the next ask
reads again. (2) A refusal for other bytes is never asked again as it stands (ADR 0605 §4: "a version refused for
other bytes is not published again"). The builder's publish item ends at once at such a refusal and spends none of
its `publish-tries` (A-457a); (1) follows at the next build of F. A build step whose run met it ends failed at its
first run and names it (ADR 0664 §2: it is no transport fault). (3) Bound: one withdrawal per number held elsewhere.
The next number is one no registry held when it was reserved, so a fingerprint meets such a refusal at most once per
held number. (4) So a build again of the same fingerprint takes a new number only for a number another build holds,
never for its own published artifacts (H-A-589). In the builder (mesh-delivery). How it is checked: H-A-593 (1) and
(5). ADR 0605 §4, ADR 0606 §1; principles 2 and 3.
- **H-A-591 (every build module builds one source at one version to one digest, in any folder and at any time; the kit
holds it, 16:01)** 23 Nov, issue 1984 note 3: each build again of mesh-delivery-builder's fingerprint at 0.1.216
packed its program at a new digest. ADR 0267 §6 decides it: an unchanged build source gives an identical artifact,
for every kind, and nothing in it varies with the commit, the clock or the path it was built at. Issue 721's report
asks the same of the build ("build reproducibly (-trimpath, -buildvcs=false, no commit or time stamped into the
binary)"), and its triage named reproducible builds as needing a design; these lines are that design. The version is
an input of the build (G §370), so one source at one version gives one digest. (1) Go (mesh-build-go) builds with
`-trimpath` and `-buildvcs=false`, and no `.git` is in what the build sees (ADR 0267 §6); no commit and no time is
stamped into the program, its version alone (G §370). No path of the build's own workspace is in any file it writes
into the tree it compiles: a `go.mod` or `go.work` line the build writes, a `replace` into the workspace among them,
names its directory relative to the file that holds it. Nothing in the program's build settings varies per ask.
mesh-build-go keeps a workspace per ask. (2) A bundle or an archive the build module packs itself has its entries in
byte order of their paths, each entry's time the Unix epoch, its owner and group 0 and its mode as in the tree. A Go
module zip and an npm package are packed in their toolchain's own form, which the case of (4) holds as it holds the
rest. (3) An image (mesh-build-image) has its creation time and the time of every file in its layers set to the Unix
epoch (buildah's `--timestamp`), and no label or annotation the module adds names a commit, a folder, a time or a
node; the version's tag and label (G §370) stay. Issue 721's "a commit belongs in an image label" does not hold
against ADR 0267 §6 (nothing varies with the commit): a build's commit is read from its build record, never from the
image. A Dockerfile's own step that fetches over the network may still give other bytes (ADR 0487 §6, §8), and
H-A-589 answers that rebuild with the held version. (4) The build modules' conformance kit
(`sdk/steprun/conformance` in mesh-delivery-sdk, G §680) gains the case `reproducible`. It builds the kit's fixture
of each kind the module builds twice, in two workspace folders of different paths and lengths and at least a second
apart, and requires each artifact's digest to be equal; when they differ it names the artifact and both digests. The
image fixture has no step that fetches. Every build module's tests run it, and mesh-catalog's failure-kit check
(`checks/failurekit`, A-489b; ADR 0664 §6) refuses a build module whose tests do not. (5) Today's cause in
mesh-build-go is a guess (issue 1984 note 3: the workspace per ask and the `replace` lines written into it); its
developer runs the case first and fixes what it names. In mesh-delivery-sdk (the case) and mesh-catalog (the build
modules and the check). How it is checked: H-A-593 (3) and (6). ADR 0267 §6, ADR 0664 §6; issue 721; principle 3.
- **H-A-592 (the drop of a reservation names its version and says what it forgets; today's versions, 16:04)** 23 Nov,
issue 1984 note 3; amends G §369's `builder_reserved_drop` (ADR 0666 §25: a tool for every act). (1)
`builder_reserved_drop` (class `act`, written in the hand-act log) takes `module`, `series`, `version` and `why`.
`version` is new and required: the tool refuses when the key holds another version and names the one that stands, so
a reservation a newer build took after it was read is never dropped. It also refuses while the reservation's
fingerprint is building (its build key, which `builder_stuck` reads), until that build ends or its ask is dropped
(ADR 0664 §4), so no late publish lands on a number given again. (2) It forgets the key whole: the version, its
fingerprint, the artifacts' recorded digests and its withdrawn numbers (H-A-226). It also forgets the version's
publish item (A-456b) and its `version-unreleased`, which it clears. `reserved` then refuses V ("no reservation of
version V", H-A-387), so a late publish at V is refused. It keeps what the registries hold at V, a gap never
released (H-A-226) that the series' next reserve skips (H-A-275) and only a registry's own removal deletes. It keeps
the builder's record of releases (A-456b) too. Its answer and its hand-act record name what it forgot: the version,
the fingerprint, the artifacts the registries hold at V and the withdrawn numbers. (3) No narrower tool is added:
the drop that names its version is the narrow form, and a withdrawal is H-A-590's by itself. (4) Today's 17 versions
of 10 modules (issue 1984 note 3, mesh-delivery-builder's 0.1.216 among them): before H-A-588 to H-A-591 are
delivered, each is recovered by `builder_reserved_drop` of its key as the tool stands (module and series), with this
answer as its `why`, then by `runner_rerun` of its failed build step. The reserve then takes the next number no
registry holds and builds the fingerprint afresh. Once those lines are delivered, no hand act is needed: what the
registries hold of those versions keeps no fingerprint (H-A-589 (2)), so the next build of each withdraws its
version by H-A-590 and takes the next free number. In the builder (mesh-delivery). How it is checked: H-A-593 (5)
and (6). ADR 0666 §25; principle 4.
- **H-A-593 (the acceptance tests of H-A-588 to H-A-592, by level, 16:06)** 23 Nov: each is a step of its module's
existing whole test, a row of an existing table or a case of a kit, never a new top-level test function (the test
budget), as H-A-583 has it. (1) Unit (the builder's reserver, a table): a standing V of F with an artifact held at V
for F is kept, and the held digest is written on it; with an artifact held at V for another fingerprint, or held
with none kept, V is withdrawn, the next number no registry holds is reserved and `version-held-elsewhere` names
both digests; a registry read that does not answer keeps V and is said (H-A-588 (4), H-A-590 (1)). (2) Unit
(`publishconformance`, run by distribution's and gitea's tests for each seat they fill): a publish at a held V with
another digest and the kept fingerprint is answered `published` with the held digest, and nothing is stored; with
another fingerprint, or none kept, it is refused naming both digests and both fingerprints; the same digest is
answered as held; `versions` answers the kept fingerprint (H-A-589 (1) to (3)). (3) Unit, or integration where the
kind's tool must run (mesh-build-image's buildah): the kit's `reproducible` case in each build module's tests gives
one digest per artifact from two folders; the failure-kit check refuses a build module fixture whose tests do not
run it (H-A-591). (4) Unit (mesh-delivery-sdk's shared publish): a publish answered with another digest names the
answered digest in the step result and both digests in the step log (H-A-589 (4)). (5) Whole (the builder, against
the real bus and a fake registry holder): a build of F publishes two of three artifacts at V and fails on the third.
Built again, the two are answered with their held digests, the third is stored and V is released, with no refusal
and no new number. The same with the two held and no fingerprint kept withdraws V, builds and releases the next
number, and clears `version-held-elsewhere` at that release. A refusal for other bytes ends the publish item at once
with its tries unspent (H-A-588, H-A-590). Unit (the builder's tools): `builder_reserved_drop` naming another
version refuses and names the standing one, and it refuses while the fingerprint builds; naming its version, it
removes the key, the publish item and the finding, and the next reserve takes the next free number (H-A-592). (6)
Live, after delivery: the next build of each fingerprint of today's 17 versions ends released at the next free
number, after at most one withdrawal and no refusal. Over the next day no holder refuses a publish for other bytes
twice at one version, and no H-A-589 journal line names a Go program, a bundle, an archive or a package (H-A-591),
read from the holders' `refused` events and journals. Principle 3.