Skip to content

fix(secrets): name the stack in every secrets-verify-backup hint - #882

Merged
Gerrrt merged 2 commits into
mainfrom
gerrrt/verify-hint-stack
Oct 3, 2026
Merged

Gerrrt merged 2 commits into
mainfrom
gerrrt/verify-hint-stack

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Oct 3, 2026

Copy link
Copy Markdown
Owner

The gap

add-recipient.sh, remove-recipient.sh and bootstrap.sh each act on a stack (STACK, defaulting to observability), but each printed its verify hint without one:

make secrets-verify-backup KEY=/path/to/the/new/copy

secrets-verify-backup defaults to observability too. The sensitive tier's re-key (#835, #866) added a key that is also on the catch-all rule, so following the hint as printed would have:

  • passed against secrets/observability.sops.yaml,
  • recorded the proof under stack="observability",
  • left SecretsKeyBackupUnproven naming the key for sensitive.

The fix

Each hint now carries STACK=${STACK} for the stack the script just acted on. The heredocs are unquoted, so it expands: the same block already printed git add … secrets/sensitive.sops.yaml correctly during the #835 re-key.

bash -n and shellcheck are clean on all three, and docs and markdownlint pass.

🤖 Generated with Claude Code

add-recipient.sh, remove-recipient.sh and bootstrap.sh each act on a
chosen stack but printed `make secrets-verify-backup KEY=…` without one,
which defaults to observability. A key that is also on the catch-all rule
then passes against the wrong file and records its proof there, so
SecretsKeyBackupUnproven keeps naming it for the stack actually re-keyed.
Found following the hint after the sensitive tier's re-key (#835).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 3, 2026 23:33
@Gerrrt Gerrrt added the bug Something isn't working label Oct 3, 2026
@Gerrrt
Gerrrt enabled auto-merge (squash) October 3, 2026 23:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

All hints consistently propagate the active stack and align with the Make target’s argument handling.

Review effort: Balanced
Findings: None

What changed in this PR

Ensures backup-key verification records proof against the stack actually modified.

Changes:

  • Adds STACK=${STACK} to verification hints in three secrets scripts.
  • Documents the corrected operator workflow.
File Description
scripts/​add-recipient.sh Names the stack in the verification command.
scripts/​remove-recipient.sh Names the stack in the recovery hint.
scripts/​bootstrap.sh Names the stack in both backup-verification hints.
docs/​changelog.md Records the hint correction.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Gerrrt
Gerrrt merged commit e95e475 into main Oct 3, 2026
8 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/verify-hint-stack branch October 3, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants