Skip to content

feat(config): a -D override value is resolved with the same ${ENV_VAR:default} substitution as a file value - #127

Merged
acn-ericlaw merged 3 commits into
mainfrom
feat/override-substitution
Nov 17, 2026
Merged

acn-ericlaw merged 3 commits into
mainfrom
feat/override-substitution

Conversation

@acn-ericlaw

Copy link
Copy Markdown
Contributor

What

  • AppConfig.get: an override's string value (a -D argument, or appConfig().set) goes through the same ${ENV_VAR:default} substitution as a file value - an environment variable with a default, or a reference to another configuration key, resolved at read time; a non-string override is returned as it is.
  • test/config.test.ts: a reference to a file key inside a URL, a default, an unresolved reference as undefined, the environment read at read time, a set() value. npm test: 499 tests, 434 passed, 0 failed, 65 skipped.
  • README (the configuration paragraph), CHANGELOG Unreleased Changed 1.

Why

Eric's request of 2026-11-17, met while the transcript audit store (#126) was wired: a key moved from application.yml to a -D flag silently lost its substitution, so -Dkey='${POSTGRES_PASSWORD}' would have sent the literal text and a credential had to travel on the command line in clear. The Java engine returned a system property raw too, so this is a parity change in all four runtimes the same day (mercury-composable feat/system-property-substitution, mercury Increment 203, mercury-python feat/override-substitution): -Dkey='${ENV_VAR}' keeps the secret out of the process list and container args arrays, which do no shell expansion, and resolves it inside the application. The one compatibility edge, a -D value that relied on a literal ${...}, is accepted: a file value never allowed it, and an unresolved reference without a default is no value, as in a file.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com

acn-ericlaw and others added 3 commits November 17, 2026 16:39
…:default} substitution as a file value

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@acn-ericlaw
acn-ericlaw merged commit 87a1e7a into main Nov 17, 2026
5 checks passed
@acn-ericlaw
acn-ericlaw deleted the feat/override-substitution branch November 17, 2026 08:53
acn-ericlaw added a commit that referenced this pull request Nov 17, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
acn-ericlaw added a commit that referenced this pull request Nov 17, 2026
docs(llm-helper): the README's -D caveat after #127
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