Skip to content

feat(orchestrate): S6 — secrets saga phase (resolve + inject secret:// env) - #44

Merged
gustavobertoi merged 1 commit into
mainfrom
nightly/S6-saga
Jun 29, 2026
Merged

feat(orchestrate): S6 — secrets saga phase (resolve + inject secret:// env)#44
gustavobertoi merged 1 commit into
mainfrom
nightly/S6-saga

Conversation

@gustavobertoi

Copy link
Copy Markdown
Contributor

Chunk S6 — M4 capstone

The up saga now resolves every secret:// reference and injects the values into containers with no value on disk (spec 04 §6, §7.5).

  • New secrets phase (AlwaysRun, never cached, no global mutation): per requested project it collects the env-key→ref map (generate.SecretRefs — keys match the valueless keys generate emits), batches one Resolve per provider, and stashes the resolved KEY=VALUE env per project.
  • compose-up injects that env via docker.Compose.Env → Compose substitutes the valueless keys from the child process env; values live only in memory + the child env. Registry built from workspace.secrets.providers + RegisterBuiltins (SOPS+age), or injected (tests).
  • generate.SecretRefs(model, project) — the env-key→secret-ref map, keys identical to projectEnv's valueless keys.

Tests

The resolved value reaches compose-up's process env (DB_PASSWORD=…) via a fake registry/provider, and only there; happy-path re-run treats secrets as AlwaysRun. Generate determinism unchanged.

Gate

make ci + make determinism green (race).

🤖 Generated with Claude Code

…// env (spec 04 §6)

Complete M4: the up saga now resolves every secret:// reference and injects the
values into containers without any value touching disk.

- New `secrets` phase (AlwaysRun, never cached, no global mutation): for each
  requested project it collects the env-key→ref map (generate.SecretRefs, whose
  keys match the valueless keys generate already emits), batches one Resolve per
  provider via the registry, and stashes the resolved KEY=VALUE env per project.
- compose-up injects that env via docker.Compose.Env → Compose substitutes the
  valueless keys from the child process env; the values live only in memory + the
  child env (§7.5). Registry is built from workspace.secrets.providers +
  RegisterBuiltins (SOPS+age), or injected (tests).
- generate.SecretRefs(model, project): the project's env-key→secret-ref map,
  keys identical to projectEnv's valueless keys (raw verbatim; prefixed as
  <SERVICE>_<k>).

Tests: the resolved value reaches compose-up's process env (DB_PASSWORD=…) via a
fake registry/provider, and ONLY there; the happy-path re-run treats `secrets`
as AlwaysRun. Generate determinism unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gustavobertoi
gustavobertoi merged commit 2247c9a into main Jun 29, 2026
2 checks passed
@gustavobertoi
gustavobertoi deleted the nightly/S6-saga branch June 29, 2026 16:58
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