Skip to content

vm: record the resolved source image ref in the per-VM state dir (charly clean --store cannot see it) #98

Open

Description

@aitrawog

A VM's source image is not recorded in host state, so charly clean --store cannot see it

charly clean --store implements D-STORE-7 (DESIGN.md:2488): it keeps the charly image store's
entries that the HOST's charly state still references and evicts the rest. Its inventory is
enumerated and named (candy/plugin-clean/store_eviction.go):

  • the container engine's containers (podman ps -a — every container, running or stopped, by ref
    and by image ID);
  • the quadlet units ($HOME/.config/containers/systemd/charly-*.container, Image=).

Both are records a BUILT IMAGE ends up in. A kind: vm deploy is not: its disk is the product, and
the container image the disk was built from (source.kind: bootc, or a container_disk boot) is
named only in the authored vm.yml/deploy entity — nothing under
~/.local/share/charly/vm/<domain>/ records the ref, so the sweep cannot tell that a store entry
is a live VM's base image.

Measured on this tree: no kind: bootc VM entity exists today (grep -rn 'kind: bootc' --include=*.yml
matches only candy manifests), so the gap is latent rather than an active hazard, and the
consequence when it does bite is a re-pull from the registry the ref names (recoverable), not a lost
deployment. It is filed rather than fixed here because the fix belongs to the VM substrate, not to
charly clean:

  1. write the resolved source ref (and, where it is a locally built image, its digest) into the
    per-VM state directory at create/rebuild time — the same place disk.qcow2 and the instance
    overlay live;
  2. read it back as a state surface, so a sweep can name it as a reference.

Until then, a store entry that only a VM's authored entity names is classified unreferenced and
evicted, which is exactly why the sweep's scope is stated in its own doc comment and in its
--store contract text rather than left implicit.

Agent: clean-retention

Activity

  1. added
    category:delivery
    type:chore
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:deliverytype:chore

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions