Repository navigation
fix(resolve): carry disk_layout and installer — both were silently dropped - #6
Conversation
…opped resolveDistro is a hand-written field copy, and it forgot two fields. Everything else accepted them: spec's #Distro declares both, this plugin's own #DistroInput accepts both, charly validates a distro authoring them without a word. Then this function does not carry them and every consumer receives nil. Nothing errors. The consumer just takes its default path. The visible cost is that the BTRFS SUBVOLUME FEATURE DOES NOTHING. spec#72 added #DiskLayout/#Subvolume, plugin-vm#6 and #7 taught EmitDiskBuildScript to build subvolumes and read the ESP mount point from the distro, and charly#476 authored the four subvolumes and the /boot ESP on omarchy. All four merged green. All four are inert: every distro declaring subvolumes has been silently getting the historical bare-filesystem layout, because DistroDef IS spec.ResolvedDistro and this copy never populated DiskLayout. The installer drop is the same shape and blocks source.kind: iso outright — an iso VM cannot render its answers volume without the distro's installer: block, so `charly vm build` fails with "distro declares no installer" against a distro that plainly declares one. Found by running a real `charly vm build` against an authored omarchy-vm, not by reading. schema_parity_test.go did not catch this and could not: it compares the SERVED SCHEMA against spec, which catches "charly accepts a field and this plugin rejects it". This is the strictly worse seam, where everything accepts the field and the resolver quietly forgets it. So resolve_parity_test.go is the second guard, over the resolver rather than the schema: author every field spec declares, resolve, and fail on any that arrives zero. It reports the field names and says to add them to the struct literal. A companion test asserts the two by VALUE, so a refactor cannot satisfy the first guard with a wrong value — including that installer template bodies arrive UNRENDERED, since rendering happens later against the vm entity's data. Negative control, with the two lines removed again: resolveDistro dropped 2 field(s) that spec.ResolvedDistro declares: [DiskLayout Installer] disk_layout did not survive resolve — the btrfs subvolume feature is inert without it spec is bumped to v0.2026242.942, the first version whose ResolvedDistro carries both fields. Claude-Session: https://claude.ai/code/session_01YKF2VLqeHHbrBDz8XftaD3
Review — PASSHead SHA: Change class: bug fix (two dropped fields in a hand-written field copy) + regression guard + spec pin bump. Security screen: PASS — no secrets, no exfiltration, no weakened guardrails, no scope mismatch. The spec bump ( Checklist: All applicable rules PASS or NA.
No comments on the thread to intake. Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Review — PASSHead SHA: Security screen: PASS — no secrets/exfiltration, no weakened guardrails, no scope mismatch. The spec bump ( Checklist: All applicable rules PASS or NA.
Comment intake: One prior Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Summary
resolveDistrois a hand-written field copy, and it forgot two fields:disk_layoutand
installer.Everything else accepted them. spec's
#Distrodeclares both. This plugin's own#DistroInputaccepts both (added in #4).charly box validatepasses on a distroauthoring them without a word. Then this function does not carry them across, and every
consumer receives
nil.Nothing errors. The consumer just takes its default path.
The btrfs subvolume feature does nothing
This is the cost, and it is already merged and shipped:
#DiskLayout+#Subvolume, on#Distroand#ResolvedDistroEmitDiskBuildScriptbuilds subvolumes; the ESP mount point comes from the distro@/@home/@log/@pkgand the ESP at/bootAll four merged green. All four are inert.
DistroDefisspec.ResolvedDistro(
sdk/vmshared/spec_aliases.go:44), and this copy never populatedDiskLayout— soDiskLayoutFromDistrohas been receiving a nil layout and every distro declaringsubvolumes has silently been getting the historical bare-filesystem layout with the ESP at
/boot/efi.The
installerdrop is the same shape and blockssource.kind: isooutright: an iso VMcannot render its answers volume without the distro's
installer:block, socharly vm buildfails withagainst a distro that plainly declares one.
Found by running a real
charly vm buildagainst an authoredomarchy-vmentity, not byreading. Both drops were invisible to every gate in the chain.
Why the existing parity test could not catch this
schema_parity_test.go(from #4) compares the served schema against spec. That catches"charly accepts a field and this plugin rejects it with
field not allowed" — a loudfailure with a confusing message.
This is the strictly worse seam: everything accepts the field, it validates cleanly,
and the resolver quietly forgets it. A schema guard cannot see it, because the schema is
correct.
So
resolve_parity_test.gois a second guard over a different seam — the resolver:spec.ResolvedDistrodeclares, resolve, and fail on any thatarrives zero. The failure names the fields and says to add them to the struct literal
(and to justify in place, not delete the test, if one genuinely must not be carried).
first guard with a wrong value. It includes that installer template bodies arrive
unrendered — rendering happens later against the vm entity's data, and a resolver
that touched them would break every seed.
Adding a field to the schema is exactly the moment someone forgets the resolver, which is
why the two guards belong side by side.
How tested
Negative control — put the bug back (delete the two new lines from the struct literal,
i.e.
mainas it stands today):The guard reproduces the shipped defect exactly, which is the strongest statement that can
be made about it.
The guard also proved itself against my own fixture twice while it was being written:
it flagged
Workaroundsas dropped when the fixture used the keyworkarounds(the jsontag is the singular
workaround), and rejected a stringbase_user(it is a struct). Bothwere fixture errors, not production ones — but a guard that had passed on a wrong fixture
would have proven nothing.
go build ./...,go vet ./...andgofmt -l .all clean.The spec bump
v0.2026232.521-…tov0.2026242.942— the first published version whoseResolvedDistrocarries both fields. Without it the two new lines do not compile(
unknown field DiskLayout in struct literal), which is itself a small piece of evidencethat this plugin had never been rebuilt against the spec that introduced them.
Rulebook compliance
vm buildfailure was not worked around in the caller.It was traced through
DistroDef = spec.ResolvedDistroto this copy, and the class wasaddressed, not just the two instances.
projection path was introduced.
point of use to route around the resolver.
recurring.
-count=1suite pasted above from the committed tree, plusa negative control reproducing the shipped defect.
tree restored from a backup; the results above are from the committed state.
Change classification
go test -count=1 ./..., plus a negative control that reproduces the exact defect present onmainfully tested and validated— the changed path executes live in the tests, the defect was originally observed live viacharly vm build, and the guard was shown to fail on the unfixed codeUnblocks
plugin-vm#8(source.kind: iso) and re-activates the subvolume feature thatspec#72 / plugin-vm#6 / plugin-vm#7 / charly#476 shipped inert.
Assisted-by: Claude Code claude-opus-4-6-20260401 (fully tested and validated)