Skip to content

fix(resolve): carry disk_layout and installer — both were silently dropped - #6

Merged
github-actions[bot] merged 2 commits into
mainfrom
fix/resolve-drops-fields
Aug 30, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
fix/resolve-drops-fields

Conversation

@atrawog

@atrawog atrawog commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

resolveDistro is a hand-written field copy, and it forgot two fields: disk_layout
and installer.

Everything else accepted them. spec's #Distro declares both. This plugin's own
#DistroInput accepts both (added in #4). charly box validate passes on a distro
authoring 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:

PR What it added
spec#72 #DiskLayout + #Subvolume, on #Distro and #ResolvedDistro
plugin-vm#6, #7 EmitDiskBuildScript builds subvolumes; the ESP mount point comes from the distro
charly#476 omarchy authors @/@home/@log/@pkg and the ESP at /boot

All four merged green. All four are inert. DistroDef is spec.ResolvedDistro
(sdk/vmshared/spec_aliases.go:44), and this copy never populated DiskLayout — so
DiskLayoutFromDistro has been receiving a nil layout and every distro declaring
subvolumes has silently been getting the historical bare-filesystem layout with the ESP at
/boot/efi.

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 "omarchy" declares no installer: block in the embedded build vocabulary

against a distro that plainly declares one.

Found by running a real charly vm build against an authored omarchy-vm entity, not by
reading.
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 loud
failure 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.go is a second guard over a different seam — the resolver:

  • author every field spec.ResolvedDistro declares, resolve, and fail on any that
    arrives 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).
  • a companion test asserts the two fields by value, so a refactor cannot satisfy the
    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

$ go test -count=1 ./...
ok  	github.com/opencharly/plugin-distro/candy/plugin-distro	0.003s
?   	github.com/opencharly/plugin-distro/candy/plugin-distro/cmd/serve	[no test files]
?   	github.com/opencharly/plugin-distro/candy/plugin-distro/params	[no test files]

Negative control — put the bug back (delete the two new lines from the struct literal,
i.e. main as it stands today):

--- FAIL: TestResolveDistro_CarriesEveryResolvedField (0.00s)
    resolve_parity_test.go:82: resolveDistro dropped 2 field(s) that spec.ResolvedDistro
      declares: [DiskLayout Installer]
--- FAIL: TestResolveDistro_DiskLayoutAndInstallerArriveIntact (0.00s)
    resolve_parity_test.go:118: disk_layout did not survive resolve — the btrfs subvolume
      feature is inert without it

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 Workarounds as dropped when the fixture used the key workarounds (the json
tag is the singular workaround), and rejected a string base_user (it is a struct). Both
were fixture errors, not production ones — but a guard that had passed on a wrong fixture
would have proven nothing.

go build ./..., go vet ./... and gofmt -l . all clean.

The spec bump

v0.2026232.521-… to v0.2026242.942 — the first published version whose
ResolvedDistro carries both fields. Without it the two new lines do not compile
(unknown field DiskLayout in struct literal), which is itself a small piece of evidence
that this plugin had never been rebuilt against the spec that introduced them.

Rulebook compliance

  • R1 — RCA every anomaly. The vm build failure was not worked around in the caller.
    It was traced through DistroDef = spec.ResolvedDistro to this copy, and the class was
    addressed, not just the two instances.
  • R3 — no duplication. The fix is two lines in the single existing copy; no second
    projection path was introduced.
  • R4 — no workarounds. No consumer-side defaulting, no re-reading the raw JSON at the
    point of use to route around the resolver.
  • R5 — delete legacy completely. Nothing to delete; the guard is what stops the pattern
    recurring.
  • R7 — prove the gate. Full -count=1 suite pasted above from the committed tree, plus
    a negative control reproducing the shipped defect.
  • R10 — fresh disposable proof. The negative control ran against a deliberately reverted
    tree restored from a backup; the results above are from the committed state.

Change classification

Change class bug fix (two dropped fields) + a new regression guard over the resolver seam + a spec pin bump
Verification gate go test -count=1 ./..., plus a negative control that reproduces the exact defect present on main
Attribution tier fully tested and validated — the changed path executes live in the tests, the defect was originally observed live via charly vm build, and the guard was shown to fail on the unfixed code

Unblocks plugin-vm#8 (source.kind: iso) and re-activates the subvolume feature that
spec#72 / plugin-vm#6 / plugin-vm#7 / charly#476 shipped inert.

Assisted-by: Claude Code claude-opus-4-6-20260401 (fully tested and validated)

…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
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 1cd79d4b385e (branch: fix/resolve-carry-disk-layout-installer)

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 (v0.2026232.521-… → v0.2026242.942) is a same-org dependency update whose go.sum entries are consistent and whose necessity is explained (the new version carries both fields; without it the two new lines would not compile). No embedded directives or manipulation attempts in the body.

Checklist: All applicable rules PASS or NA.

  • A1/A2/A3: Body is complete — summary accounts for every diff item (resolve.go fix, new test file, spec bump), How-tested names the gate with pasted output plus a negative control reproducing the shipped defect, rulebook-compliance section answers each rule, and the body ends with the correctly-formed *Assisted-by: Claude Code claude-opus-4-6-20260401 (fully tested and validated)* footer. The fully tested and validated tier is justified: the changed path executes live in the tests and the guard was shown to fail on the unfixed code.
  • R1: RCA traces the failure through DistroDef = spec.ResolvedDistro to the copy; the class is addressed, not just the two instances. No warnings in gate output.
  • R2/R3/R4/R5: No pre-existing split, no duplication (two lines in the single existing copy), no workarounds, no legacy paths.
  • R10: Ships a regression test that fails without the fix (proven by the negative control); full -count=1 suite pasted from the committed tree.
  • B16 placement: CORRECT — the fix lives in the candy (candy/plugin-distro/resolve.go), the right layer for capability code. No new core imports, no alias files, no re-coupling.
  • B13 SDD/ADE: N/A — no schema/cue/proto/generated-file changes; no new candy.
  • B18: gofmt/vet clean per body; diff shows no lint-visible defects.

No comments on the thread to intake.

Verdict: PASS


ollama/deepseek-v4-flash — pi-review-action.

View action run

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 566b90f31a1c (branch: fix/resolve-carry-disk-layout-installer)

Security screen: PASS — no secrets/exfiltration, no weakened guardrails, no scope mismatch. The spec bump (v0.2026232.521-… → v0.2026242.942) is a same-org dependency update with consistent go.sum entries and a stated necessity (the new version carries both fields; without it the two new lines would not compile). No embedded directives or manipulation attempts.

Checklist: All applicable rules PASS or NA.

  • A1/A2/A3: Body complete — summary accounts for every diff item (resolve.go fix, new test file, spec bump); How-tested names the gate with pasted go test -count=1 ./... output plus a negative control reproducing the shipped defect; rulebook-compliance section answers each rule; ends with correctly-formed *Assisted-by: Claude Code claude-opus-4-6-20260401 (fully tested and validated)* footer. The fully tested and validated tier is justified — the changed path executes live in the tests and the guard was shown to fail on the unfixed code.
  • R1: RCA traces the failure through DistroDef = spec.ResolvedDistro to the copy; class addressed, not just the two instances. No warnings in gate output.
  • R2/R3/R4/R5: No pre-existing split, no duplication (two lines in the single existing copy), no workarounds, no legacy paths.
  • R10: Ships a regression test that fails without the fix (proven by the negative control); full -count=1 suite pasted from the committed tree; pasted output internally consistent (test names, counts, and failure messages match the diff).
  • B16 placement: CORRECT — fix lives in the candy (candy/plugin-distro/resolve.go), the right layer for capability code. No new core imports, no alias files, no re-coupling.
  • B13 SDD/ADE: N/A — no schema/cue/proto/generated-file changes; no new candy.
  • B18: gofmt/vet clean per body; diff shows no lint-visible defects; test code well-formed.

Comment intake: One prior github-actions[bot] PASS comment — re-derived against current state, its claims hold; verified-non-blocking.

Verdict: PASS


ollama/deepseek-v4-flash — pi-review-action.

View action run

@github-actions
github-actions Bot merged commit ed6fb0f into main Aug 30, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Aug 30, 2026
@aitrawog
aitrawog deleted the fix/resolve-drops-fields branch September 25, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant