Skip to content

Remove the value-into-env secret delivery from the pod overlay (D-SEC-1), after migrating its four consumers #72

Open

Description

@aitrawog

candy/plugin-deploy-pod/overlay.go delivers a secret_require: value by merging it into
OpStep.Op.Env (deliverSecretEnv — SelectCandiesForPlans → ResolveSecretForCandy →
InjectSecretsIntoPlans). D-SEC-1 forbids that: a secret must reach a task as a file's content on the
venue, never as an environment value.

It cannot be deleted on its own. The value is read from a SERVICE'S ENVIRONMENT by four authored
consumers, so a FileStep alone does not feed them:

$ grep -rn 'secret_require:' --include='*.yml' . | grep -v '/.build/'
./layer-qdrant/charly.yml
./pod-openwebui/charly.yml
./vm-k3s-agent/charly.yml
./vm-k3s-server/charly.yml

layer-qdrant/charly.yml:112 reads $QDRANT__SERVICE__API_KEY; pod-openwebui/charly.yml reads
WEBUI_ADMIN_PASSWORD and OPENROUTER_API_KEY; the two k3s nodes read K3S_TOKEN.

The deletion is the goal; the migration is the precondition, and it needs the authored
provide:/need: surface that does not exist yet (opencharly/spec#368 is OPEN: "The capability table
declares provide: per type, but no authored key writes one"). plugin-deploy-pod#69 attempted the bare
deletion and was closed as a regression for exactly these consumers.

Blocked by: opencharly/spec#368 (authored secret surface), or a sdk bridge that emits a FileStep
from the credential store plus a per-service env-from-file wrapper in each of the four consumer repos.

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

Activity

  1. aitrawog commented on Nov 17, 2026

    @aitrawog
    ContributorAuthor

    RCA / MEASURED SCOPE — what #72 actually is, and why "delete the redundant copy" was wrong.

    The premise I carried, and the measurement that corrected it

    I framed #72 as "the config-time seam covers the four consumers, so InjectSecretsIntoPlans is a duplicate — delete it." Two measurements say otherwise.

    1. The two call sites are two DIFFERENT destinations

    $ grep -rn 'InjectSecretsIntoPlans' --include='*.go' . | grep -v '_test.go\|.build\|.worktrees'
    ./plugin-deploy-pod/candy/plugin-deploy-pod/overlay.go:88:  deploykit.InjectSecretsIntoPlans(plans, secretEnv)
    ./plugin-fleet/candy/plugin-fleet/secrets_artifacts.go:61:  deploykit.InjectSecretsIntoPlans(plans, secretEnv)
    ./sdk/deploykit/secret_declare.go:87: func InjectSecretsIntoPlans(plans []*InstallPlan, env map[string]string) {
    site what it feeds destination
    overlay.go:88 the overlay image BUILD — oci.Emit walks the plans and the value lands in a Containerfile step's env build time (IR)
    secrets_artifacts.go:61 plugin-fleet's own artifact assembly apply/venue time

    Neither is the runtime Env: the config-time seam writes. They are not duplicates of it.

    2. Nothing in this tree authors a build-time secret

    $ grep -rn 'secret_require:' --include='charly.yml' . | grep -v '.build\|.worktrees'
    ./layer-qdrant/charly.yml:33:        secret_require:      (QDRANT__SERVICE__API_KEY,  runtime env)
    ./pod-openwebui/charly.yml:128:      secret_require:      (WEBUI_ADMIN_PASSWORD / OPENROUTER_API_KEY, runtime env)
    ./vm-k3s-agent/charly.yml:19:        secret_require:      (K3S_CLUSTER_TOKEN, runtime env)
    ./vm-k3s-server/charly.yml:67:       secret_require:      (K3S_CLUSTER_TOKEN, runtime env)

    Four sites, all runtime env, none in an add_candy: overlay candy. So overlay.go:88 delivers nothing in this tree today — its plan-set injection has no secret to inject, because no overlay candy declares one.

    What that makes #72

    Not a migration. Three separate units, and only one of them is deletion:

    unit what why it is separable
    A delete overlay.go:88's injection the mechanism is unused (no overlay candy declares secret_require:), so this is R5 legacy removal — but the capability it provides (a build-time secret) is real and would need --mount=type=secret if ever used
    B migrate plugin-fleet's artifact path a genuinely different destination (apply/venue time, no container) — and the bind wire (spec#370) has no dispatch, so its handle-shaped answer does not exist either
    C the four consumers already covered by the config-time seam; the bed check-seam-proof proves the path, and #80 removed the duplicate that was leaking into state

    A is landable now and provable by one bed. B is blocked on spec#370. C is done.

    The correction to my own framing

    I said "deleting ahead of a working env seam is exactly the regression #69 recorded." That is no longer the hazard — the seam works and is proven. The hazard now is deleting a BUILD-time mechanism because its RUNTIME neighbour works. Different mechanism, different destination, and the four consumers are not evidence either way.

    That is the RCA. #72 splits into A (unused-mechanism removal), B (blocked on spec#370), C (done).

    Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

  2. aitrawog commented on Nov 17, 2026

    @aitrawog
    ContributorAuthor

    UNIT A — REBUTTED, with the measurement. deliverSecretEnv is not dead code; it is a GUARDED capability.

    I set out to delete it because my scope comment said it "delivers nothing in this tree today". Measuring first was the right order, because it delivers nothing and proves that it delivers nothing:

    $ grep -n 'deliverSecretEnv' candy/plugin-deploy-pod/*.go
    overlay.go:80       deliverSecretEnv(plans, dg.Candies, deploykit.CredentialAccessViaExecutor(ctx, exec))
    overlay.go:423      func deliverSecretEnv(plans []*spec.InstallPlan, candies map[string]spec.CandyReader, cred …
    overlay_test.go:244 deliverSecretEnv(plans, candies, cred)

    And the test at overlay_test.go:244 does not merely call it — it asserts its inertness:

    deliverSecretEnv(plans, candies, cred)
    if consulted {
        t.Fatalf("the credential store was consulted although no candy asks for a secret (D-SEC-1: …)")
    }

    Its own doc comment says so:

    "The candy EXISTS and a plan references it, so SelectCandiesForPlans really selects it and ResolveSecretForCandy really walks it — the only thing absent is a use: secret: author, which is the tree's state."

    So the function is a capability with a proof that it is currently a no-op. Deleting it deletes the guard too, and a future overlay candy that authors use: secret: would then have no mechanism AND no test telling anyone it was missing.

    That is not dead code. That is a check on a capability nobody has used yet.

    The corrected unit A

    what I said what is true
    "deliverSecretEnv is unused; removing it is R5 legacy removal" it is unused and asserted-unused; removing it removes the assertion
    "the capability would need --mount=type=secret if ever used" true, and that is an argument for keeping the current path until a build actually needs one, not for deleting it now

    The honest disposition: KEEP. #72's unit A is not a deletion.

    What that leaves of #72

    unit state
    A — deliverSecretEnv in overlay.go keep: a guarded capability, asserted inert by overlay_test.go
    B — plugin-fleet's artifact path blocked on spec#370 (the bind wire has no dispatch)
    C — the four consumers done by the config-time seam, proven by check-seam-proof

    So #72 reduces to unit B alone, and unit B is blocked on a contract gap. The issue stays open for exactly that, and for nothing else.

    Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

  3. added
    category:delivery
    type:fix
    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:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions