fix-wg-secret

Fix: wg secret implementation gaps vs design (--from-stdin, --yes, OS keyring)

Metadata

Statusdone
Assignedagent-1073
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-04-29T10:59:04.405001726+00:00
Started2026-04-29T10:59:22.547184118+00:00
Completed2026-04-29T11:18:17.407205603+00:00
Tagsfix,secrets,security, eval-scheduled
Eval score0.90
└ blocking impact0.90
└ completeness0.90
└ constraint fidelity0.70
└ coordination overhead0.88
└ correctness0.95
└ downstream usability0.85
└ efficiency0.85
└ intent fidelity0.83
└ style adherence0.90

Description

Description

implement-wg-secret (commit 6f4c98d1c) shipped the secret command frame but several design requirements are missing or misnamed. Verified by live smoke 2026-04-29 ~02:55Z after cargo install --path .:

Gaps

1. "keyring" backend is actually a file store

wg secret backend show reports: Default backend: keyring (secure file store at ~/.wg/keystore/).

The design (design-secure-credential §1, §4) specified the keyring backend uses the OS credential store (keyring crate → macOS Keychain / Linux secret-service / kwallet / Windows Credential Manager). Implementation built a custom on-disk keystore at ~/.wg/keystore/ and labeled it "keyring."

Two ways forward (pick one):

  • A) Wire the actual keyring crate as the keyring backend; rename the current file-based store to keystore (or similar). User running wg secret set foo on macOS expects it in Keychain.
  • B) Keep the file-based store but rename it honestly. Default backend: keystore (secure file at ~/.wg/keystore/). Then add the OS keyring as a separate backend with scheme keyring: (or os-keyring:), or expose it only when a feature flag / config opts in.

Decision belongs in this task. Recommend A — match the design and the user's mental model. The OS keyring is materially more secure than a 0600 file (OS handles unlock, no plaintext on disk).

2. wg secret set --from-stdin flag missing

Design (design-secure-credential §3) specified wg secret set <name> --from-stdin reads one line from stdin (no prompt). Implementation rejects piped input with Error: Secret value cannot be empty and only accepts interactive TTY input. This blocks all scripted setup, all CI provisioning, and ALL non-TTY smoke testing.

3. wg secret rm --yes flag missing

Design specified --yes for non-interactive removal. Currently the rm command rejects --yes with unexpected argument. Same scripting friction.

4. Smoke scenarios under-cover non-interactive paths

The smoke manifest probably contains the round-trip scenarios from design §7, but if --from-stdin doesn't exist they can't run non-interactively. Verify the manifest entries; either they were stubbed (bad), or they depend on a TTY emulator (fragile), or the implementer skipped them. Cross-check before claiming this fix done.

Validation

  • Failing tests written first (TDD)
  • echo "value" | wg secret set foo --from-stdin round-trips: wg secret get foo --reveal returns value
  • wg secret rm foo --yes deletes without prompting and exits 0
  • Backend naming: either OS keyring is wired (A) OR the file-based store is renamed honestly (B). wg secret backend show accurately describes what it actually is.
  • If A: wg secret set foo on macOS lands in Keychain (verify with security find-generic-password -a foo -s wg); on Linux GNOME desktop lands in secret-service (verify with secret-tool search service wg account foo).
  • Smoke manifest entries from design §7 actually run end-to-end against the real binary (no stubs, no TTY emulators required for non-interactive scenarios)
  • cargo build + cargo test pass with no regressions
  • cargo install --path . was run before claiming done — and the smoke commands above were run against the installed binary AND the daemon-log evidence pasted into this task's log

Process note (per recurring user feedback)

The pattern of 'implementation shipped but missed design specifics' has happened twice in this session (bump-codex-defaults skipped its live smoke; implement-wg-secret skipped --from-stdin / --yes / OS-keyring integration). The fix is for implementation tasks to actually run the design's smoke scenarios on the installed binary BEFORE claiming done. The validation criteria above require evidence — paste actual command output, don't just check the box.

Depends on

Required by

Log