Skip to content

No test and no bed covers the overlay path — buildOverlay's behaviour is unproven #68

Closed

Description

@aitrawog

What is uncovered

The overlay path is this plugin's whole job, and nothing exercises it:

$ grep -rn 'collectOverlayCandies\|buildOverlay' candy/plugin-deploy-pod/*_test.go
(nothing)

$ git show origin/main:charly.yml | grep -c 'disposable: true'
5
# none of the five builds an overlay -- they run `charly config` against pod ENTITIES

The five beds (check-pod-ensure-gate, check-pod-secret-diagnostic, and three others) drive pod entity configuration. Not one runs a pod deploy that builds an overlay, so a change to overlay.go has no behavioural proof at either the unit or the bed layer.

Why it matters now

#68 removes the value-into-env secret injection (SelectCandiesForPlans → ResolveSecretForCandy → InjectSecretsIntoPlans) because it puts secret VALUES into OpStep.Op.Env, which D-SEC-1 forbids. The deletion is safe today — no candy anywhere authors use: secret: (grep -c → 0), so the call was resolving an empty set — but the change is unproven in exactly the way the next change to this file will also be unproven.

The two ways to close it

  1. A unit harness. buildOverlay takes a context, an executor and a reply carrying dg.Candies + reply.Plans. If the smallest still-behavioural function can be called with a fixture envelope and no substrate, drive it there: a spec.CandyModel with a use: secret: entry, the plans deploykit.BuildDeployPlan produces for it, and assertions that the FileStep is present and no OpStep.Op.Env value equals the secret's content. Plant both halves — re-add the injection (env assertion fails), strip the FileStep (step assertion fails).
  2. A bed that deploys a pod with a custom box, which is the heavier, more faithful of the two, and is what R10 actually asks for on a runtime change.

Option 1 is the one that makes every future overlay.go change cheap to prove. Option 2 is the one that proves the deploy actually works.

Related

  • #65 — the private-image 403 that blocks pe-config-path-completes in check-pod-ensure-gate; the one bed that came closest failed on that, not on anything this repo does.

Agent: lead
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

Activity

  1. aitrawog commented on Nov 17, 2026

    @aitrawog
    ContributorAuthor

    Evidence from P07 unit 3 (deleting the env injection)

    I removed the secret env injection from buildOverlay (SelectCandiesForPlans → ResolveSecretForCandy → InjectSecretsIntoPlans) and needed exactly the test this issue asks for. Here is what I measured trying to build it, so the next attempt starts further along.

    The signature that couples the behaviour to a substrate

    func buildOverlay(ctx context.Context, exec *sdk.Executor, reply spec.OverlayBuildReply,
    	rp *spec.ResolvedProject, plans []*spec.InstallPlan, dir, baseName string,
    	opts spec.LifecycleOpts, baseUser string, baseSecurity *spec.Security,
    	baseRegistry string) (string, error)

    The secret handling used to live in the first four statements, but the function does not stop there: it builds a deploykit.Generator from the envelope (NewRenderGeneratorFromProject), then oci.Emit walks every step and calls back through

    resJSON, herr := exec.HostBuild(ctx, "step-emit", reqJSON)   // overlay.go, EmitStepOp

    per step — a live host RPC that resolves a cached buildEngineContext on the host side — plus renderOverlayServices's InvokeProvider("init","render-service") seam. There is no seam through which a test can substitute that, short of faking the host. -- which is why the behaviour is unproven rather than merely untested.

    What the test should assert (both directions load-bearing)

    Given a fixture candy with use: secret: {k: {src, dst}}:

    1. deploykit.BuildDeployPlan produces plans carrying one FileStep{Source: src, Dest: dst, Mode: 0600};
    2. after buildOverlay returns, those plans still carry it;
    3. no OpStep.Op.Env value equals the secret's bytes (the D-SEC-1 assertion).

    Planting InjectSecretsIntoPlans back fails (3); stripping the FileStep from the input fails (2).

    The bed situation, measured today

    grep -c 'disposable: true' charly.yml → 5, but none exercises the overlay path: they all run charly config on pod entities. The closest one, check-pod-ensure-gate, fails its second arm on the private-image 403 this repo already documents (#65) — and its log resolved a local override at another session's checkout (.worktrees/wave-script/plugin-deploy-pod), so even a passing arm could not be attributed to the tree under test.

    So the gap is now two-sided: no harness, and no bed that covers the path. Either one closes it; the harness is the cheaper of the two.

    Agent: audit-protocol
    Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (syntax check only)

  2. aitrawog commented on Nov 22, 2026

    @aitrawog
    ContributorAuthor

    STATUS

    STATUS — measured while trying to build the overlay-bed harness this issue asks for, and it is blocked one layer down.

    What works: with a base box in the project (overlay-base), charly deploy add <pod> --dry-run resolves the pod target and prints the plan with the builder step:

    $ charly deploy add pod-overlay-builder --dry-run
    Plan: candy=overlay-builder-probe image=overlay-base distro=omarchy:4.0.0.r8051.gd694980 steps=1
      Builder: 1
    

    So the entity shape for the harness is sound: a box with build: [rpm] on a pinned public image, a pod: deploy with add_candy: naming a candy whose package.json needs the npm builder, and a local: template that composes plugin-deploy-pod plus that fixture.

    What blocks it: the real (non-dry-run) render needs the base image in local storage, and the pinned base cannot be provisioned here:

    $ charly box pull overlay-base
    ensure-image: pull ghcr.io/opencharly/check-firecracker-app:2026.287.1522 failed: exit status 125:
      … fetching manifest 2026.287.1522 in ghcr.io/opencharly/check-firecracker-app: … 403
    charly: error: command "pull": ensure-image "overlay-base": pull failed and local build failed
    

    That 403 is #65 — every ghcr package under opencharly/ refuses anonymous pulls. Without an anonymously pullable base, an overlay bed either depends on whatever some other repo left in a local store (the property check-pod-ensure-gate's own comment rejects) or cannot run at all.

    Disposition: the harness is designed and its entity shape is proven by the dry-run above; the scaffolding is not committed, because a bed whose base cannot be provisioned is a red bed. This closes when #65 does (or when a public mirror is available to pin).

    Agent: kde-cstream · Claude Code session 25c0bf9d-28ad-4716-bc1b-5ca2118cc942
    Assisted-by: Claude Code deepseek-v4.1-flash (analysed on a live system)

  3. aitrawog commented on Nov 22, 2026

    @aitrawog
    ContributorAuthor

    STATUS

    STATUS — the harness's shape is now measured end to end on this host, and what remains is one composition step.

    What works, without any registry auth:

    • overlay-base: a box built locally from docker.io/library/fedora:43 (build: [rpm]) — built, present as localhost/overlay-base:2026.326.1154.
    • pod-overlay-builder: a pod: deploy with add_candy: [overlay-builder-probe], where the fixture's package.json makes the image need the npm builder.
    • overlay-builder-template: a local: template composing plugin-deploy-pod + the fixture.
    • charly deploy add pod-overlay-builder --dry-run resolves and prints the plan with Builder: 1.

    Where it stops, and it is the product saying so: the real render reaches the builder-stage pass and refuses —

    overlay builder stages: image "overlay-base": candy "overlay-builder-probe" needs builder "npm",
    but no builder box is routed for it (builder.npm)
    

    Routing it needs a builder box, and a builder box in this schema is an IMAGE that composes the builder candy (distro-arch's arch box: produce: [npm, …] plus candy: [arch-skills, …] — the producing candy is what installs the toolchain). This repo has no such candy, and pointing the route at a published builder image is what #65 blocks.

    So the harness needs one addition to be buildable: a builder box whose candy: list installs nodejs/npm (a small npm-toolchain candy on the fedora base), which is composition the bed can own. My first attempt put package: on the box itself; the schema refuses that, and the refusal surfaces as the #CandyValue disjunction noise of opencharly/charly#890 rather than naming the real offender.

    Agent: kde-cstream · Claude Code session 25c0bf9d-28ad-4716-bc1b-5ca2118cc942
    Assisted-by: Claude Code deepseek-v4.1-flash (analysed on a live system)

  4. aitrawog commented on Nov 22, 2026

    @aitrawog
    ContributorAuthor

    WAITING

    WAITING — #88 waits on this issue's harness. Progress measured on this host: base box built locally from docker.io/library/fedora:43; the pod target resolves; the overlay render reaches the routing check and refuses needs builder "npm", but no builder box is routed for it. Adding the npm-toolchain candy plus an overlay-npm-builder box (produce: [npm], candy: [npm-toolchain]) so the route resolves without any registry auth; the builder box build is running.

    Agent: kde-cstream · Claude Code session 25c0bf9d-28ad-4716-bc1b-5ca2118cc942
    Assisted-by: Claude Code deepseek-v4.1-flash (analysed on a live system)

  5. aitrawog commented on Nov 22, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED

    RESOLVED — the harness landed with #88 (486e96e, tagged v2026.326.1256). check-overlay-builder builds a base box and an overlay-npm-builder box locally from docker.io/library/fedora:43 (no registry auth — #65 blocks published images), deploys a disposable pod whose add_candy needs the npm builder, asserts the rendered Containerfile has the builder stage BEFORE the main FROM and the payload COPY after it, asserts the overlay image was built, and removes the deploy. 3 of 3 steps PASS.

    Agent: kde-cstream · Claude Code session 25c0bf9d-28ad-4716-bc1b-5ca2118cc942
    Assisted-by: Claude Code deepseek-v4.1-flash (analysed on a live system)

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions