archied setup took -forge-token, -provider-api-key and -telegram-token, each
carrying a secret VALUE. That is wrong twice over: the value lands in shell
history and in every process listing, and it is a second way to set a secret
that no secret engine knows about.
The codebase already holds the opposite invariant, and had before this landed:
- configuration.md:423-425 states it directly -- "setup writes the reference to
TOML and the value to the secret engine".
- No CLI flag anywhere in the repository accepted a secret value; these three
were the only ones.
- install.sh already does it correctly: read_secret prompts without echoing so
the value never reaches scrollback, and set_env_key writes it into the systemd
EnvironmentFile, which is the env engine's backing store.
So the SecretSink half was right -- writing the value to the env file IS writing
it to the secret engine, for the env engine -- and the prompt path was right.
Only the three value-carrying flags were wrong.
Removed: Params.ForgeToken, Params.ProviderAPIKey, Params.TelegramToken and the
flags that fed them, along with the parameter plumbing in step_forge,
step_provider and step_chat. Those steps now always read the secret from the
prompt surface. Params gains a comment recording why it deliberately has no
secret-valued field, so the absence is a decision rather than an oversight.
TelegramUserIDs stays: an allowlist of user IDs is access policy, not a
credential.
Two tests pinned the wrong behaviour and are replaced rather than deleted:
- TestRunParams_ProviderAPIKeyNeverPrompts asserted a secret could arrive as a
parameter. It becomes TestRunParams_SecretsComeOnlyFromThePrompter, which
supplies every non-secret answer through Params and scripts only the secret
reads, so it fails if a secret ever comes from anywhere else.
- TestRunSetup_DefaultsWithForgeTokenWritesEnv exercised the removed flag. It
becomes TestRunSetupRejectsSecretValueFlags, which asserts all three flags are
rejected with exit 2 and that neither a config nor an env file is written --
verified by re-adding -forge-token and watching it fail.
The unused rejectingPrompter went with them; its remaining replacement uses a
scripted prompter instead.