Skip to content

secret_require reaches the venue only via OpStep.Op.Env, which puts the VALUE in the IR (D-SEC-1) #70

Open

Description

@aitrawog

The violation

deploykit.InjectSecretsIntoPlans merges a map[string]string of resolved secret VALUES into OpStep.Op.Env, so the heredoc renderer emits export KEY=value into the plan. The secret value enters the IR, which D-SEC-1 forbids:

D-SEC-1 (DESIGN.md:2511): Secrets come only from the configured backend; they never enter the store, artifacts, labels, IR, state or output.

and DESIGN.md:2983: "there is no get: a value reaches a consumer as a secret: need, never as text."

Who depends on it — measured

$ find . -name 'charly.yml' -not -path '*/.build/*' -not -path '*/.check/*' -print0 2>/dev/null \
    | xargs -0 grep -l 'secret_require' 2>/dev/null
./charly/box/fedora/box/openwebui-qdrant/charly.yml
./distro-fedora/box/openwebui-qdrant/charly.yml
./layer-qdrant/charly.yml
./plugin-deploy-pod/charly.yml

layer-qdrant/charly.yml:33:

        secret_require:
            - name: QDRANT__SERVICE__API_KEY

That key reaches a qdrant deployment only through this injection. This is why the deletion was reverted in #69: removing the call without migrating the declaration would start the deploy and leave qdrant with no admin key.

The path out

The replacement already exists: deploykit.CompileSecretSteps (sdk#551) lowers each use: secret: entry to a FileStep{Source: src, Dest: dst, Mode: 0o600}, and kit/walk.go's walkFile reads the source on the operator host at realize and PutFiles it into the venue — the IR carries only the two paths, so D-SEC-1 holds by construction.

The migration, in order:

  1. Teach secret_require: to lower to use: secret: (or migrate the four consumers above to author use: secret: directly, which is the §8 form DESIGN.md:733 shows).
  2. Prove it on the qdrant deploy — the API key arrives at its dst and is absent from the plan.
  3. Then delete InjectSecretsIntoPlans and the two orphaned helpers, per sdk#552.

Why this issue exists

#69 was blocked on a regression this measurement caught. R1 does not accept "the deletion belongs elsewhere" without an issue number — so this is the number, and it names the blocker (the migration) rather than the deletion.

Related

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

    CORRECTION — the consumer count was wrong. It is ELEVEN authored manifests, not four.

    My first sweep used find . -name 'charly.yml' -not -path '*/.build/*' -not -path '*/.check/*' and reported four hits. It did not exclude ./.worktrees/, so the list was a mix of real authored manifests and every other session's checked-out duplicate — and the four I quoted were simply the ones that happened to sort first. Re-run with -not -path './.worktrees/*':

    $ find . -name 'charly.yml' -not -path '*/.build/*' -not -path '*/.check/*' -not -path './.worktrees/*' \
        | xargs grep -l 'secret_require' | sort
    ./charly/box/fedora/box/openwebui-qdrant/charly.yml
    ./distro-fedora/box/openwebui-qdrant/charly.yml
    ./layer-qdrant/charly.yml
    ./layer-strata/candy/strata/charly.yml
    ./plugin-deploy-pod/charly.yml
    ./plugin-herdr/charly/box/fedora/box/openwebui-qdrant/charly.yml
    ./plugin-secrets/candy/plugin-secrets/charly.yml
    ./pod-herdr/charly/box/fedora/box/openwebui-qdrant/charly.yml
    ./pod-openwebui/charly.yml
    ./vm-k3s-agent/charly.yml
    ./vm-k3s-server/charly.yml

    Eleven, across seven distinct repos (the plugin-herdr and pod-herdr entries are that repo's own copies of the same box).

    Why this changes the migration's shape, not just its size

    The seven I missed are not variants of qdrant:

    • layer-strata/candy/strata/charly.yml — a model server's credential (strata), a different secret entirely.
    • plugin-secrets/candy/plugin-secrets/charly.yml — the secrets plugin declares its own secret_require:. A plugin that both serves credentials and consumes one is the case that most needs the file-delivery path to be right.
    • pod-openwebui, vm-k3s-agent, vm-k3s-server — three different substrates. This is the strongest argument for FileStep/PutFile over an env heredoc: the same declaration must reach a pod, a VM and a k3s node, and PutFile is one method of the substrate-neutral DeployExecutor while the env heredoc is not.

    So the migration is not "move four manifests to §8 syntax". It is: prove the file delivery on all three substrates, on a real secret, before the injection can go.

    The rule this round earned

    A grep whose scope silently includes .worktrees/ counts other sessions' checkouts as if they were authored sources. Every count in this org needs -not -path './.worktrees/*' — and the same is true of git -C <repo> grep, which is why that form (asking origin/main, not the checkout) is the safe one.

    The three-step order stands, but step 1 is now seven manifests in seven repos, and step 2 must run on pod, VM and k3s rather than one.

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

  2. added
    category:runtime
    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:runtimetype:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions