A minted box records nothing about how it was minted #103
Labels
No labels
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-triage
ready
release
scope:cli
scope:drill
scope:host
scope:installer
scope:templates
scope:tiers
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/box#103
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A minted box records nothing about how it was minted
What the mint throws away
cmd_new()knows a great deal at the moment it launches.bin/box:1038-1045:Three
user.*keys. In scope at that same line, and dropped on the floor:$root/VERSIONis read in exactly oneplace,
version()atbin/box:15, and never in the mint path$T_IMAGEisimages:debian/13/cloudin all fivetemplates (
templates/*/box.env). An unpinned alias on a moving remote.Two boxes minted a month apart from "the same template" are not the same box
and nothing on either says so.
$T_BOOTSTRAP_ROLE(bin/box:910) is passed toincus exec … rig bootstrap "$T_BOOTSTRAP_ROLE"atbin/box:1121and thenforgotten
RIG_REPO/RIG_REF(bin/box:950), substitutedinto the seed at
:956-957. Which rig converged this box is unrecoverable.(
bin/box:1296) and an export filename (:1324)pick_mode()(bin/box:778) chose vm or container; recoverablefrom the instance type, but the demand (
$T_REQUIRE_VM,:908) is notcmd_info()(bin/box:1222-1260) printsNAME / STATE / TYPE / IPV4,exposures, snapshots. It surfaces none of the three keys that already
exist. There is no host-side per-box store — the Incus instance config is
the database — so what is not stamped is simply gone.
Proposed stamp
Extend the existing
user.box.*namespace at the same single write point.That namespace is already load-bearing and already proven: drill audit item
B2 (
drill/RUNS.md:26,drill/drill.sh:454-464) establishes thatincus copypreservesuser.*, which is why clones inherit template anduser with no extra code.
Deliberately not stamped:
limits.cpuandlimits.memoryalready hold them(
bin/box:1042-1043). Duplicating invites drift when someone edits thelimit by hand. Disk is the exception: it lands as a root device size on
VMs only and is recorded nowhere for containers (
bin/box:1011, note at:1019). Either stampuser.box.diskor accept the gap knowingly.box_tier()(bin/box:26-33) derives admin/restricted/none fromlive
id -nG, never the group DB. It is a property of whoever is asking,not of the box. Stamping it records who happened to mint and then rots.
user.box.image.fingerprintis the one field that needs work rather than aflag:
$T_IMAGEis an alias, so the fingerprint is only known after thelaunch resolves it. Read it back from
volatile.base_imageand set it in afollow-up
incus config set, or accept alias-only and lose reproducibility.Where it is written, and when
One place: the
--configblock atbin/box:1038-1045, plus at most oneincus config setafter the launch for the resolved fingerprint. No new file,no new directory, no host-side index. The stamp lands before cloud-init
and before rig — it describes the mint, not the outcome.
Three existing paths need an explicit decision, and all three are places
where a naive stamp becomes a lie:
bin/box:977-988.incus copycarries everyuser.*keyforward, so a clone inherits the source's version, created-at and origin
verbatim.
reset_identity()(bin/box:986, def:846-865) is theexisting "refresh identity on clone" hook and the natural home for a
re-stamp:
origin=clone,origin.from=<srcref>, freshcreated, currentversion. Note--cpu/--memory/--diskare already refused for clones(
:979), solimits.*carry over stale too — same class of problem.bin/box:1388-1391re-stampsuser.box=1and nothing else,under a comment (
:1354-1358) that already draws the right line between"artifact truth" and "this host's truth". Mint facts are the originating
host's truth and should survive;
origin=importand an import timestampare this host's.
host/migrate-host.sh:78fabricatesuser.box.template=claude user.box.user=claudefor pre-tag boxes. Newkeys need a defensible default there, or an explicit
unknown.How it is read back
cmd_info()grows a metadata block above the existing output. Every read uses${var:-}and tolerates absence — drill audit item B4 (drill/RUNS.md:28):incus config geton an unset key returns empty with exit 0, so anold box must render as a box with blanks, never as an error.
box info --jsonalready exists and passesincus list --format jsonstraight through (
bin/box:1224) — the keys ride along inconfigfor free,which is the audit surface the issue actually asks for.
Schema versioning
user.box.schemais an integer, not the box version. It changes only when theshape changes — a key removed or repurposed. Readers treat a schema they do
not recognise as "newer than me, show what I understand, say so" rather than
refusing; a box outlives the release that minted it, which
bin/box:716-718already says out loud about legacy tags. Absent schema means pre-manifest,
which is exactly the boxes migrate-host backfills.
Open questions
incus config setafter every launch, fora field nobody reads until an incident. Cheap, but it is one more failure
point in the mint path's hottest section.
origin.fromrecords onehop. A clone of a clone either chains (unbounded) or forgets its grandparent.
One hop seems right; worth stating rather than defaulting into.
cloud-init.user-datais already readable back via
incus config get, and rig repo/ref are insideit. Arguably the seed is the record and only version + created + image
fingerprint are genuinely new information.
box listcolumns.boxes_csv()(bin/box:1153-1158) queries--columns nstS. Incus can filter and column on config keys — is aTEMPLATEorAGEcolumn inbox listworth the width?Note on scope
This issue is deliberately only about the VM as infrastructure — what box
built, from what, when, with which version. What was provisioned into the
box is rig's half, and the two must not collide: box writes host-side Incus
config, rig writes guest-side files under
/etc/rig. Neither can reach theother's store by accident — rig runs inside the guest as root with no Incus
socket (no
incus exec, no ssh, anywhere in rig's tree). The compositionpoint is
box info, which runs on the host and can read the guest's halfwhen the box is running. The other half is heavy-duty/rig#61.
Supersedes #100, which asked for this in one sentence.