From e7bc5fdaffc33ab66e3a30e474733b90a63cbe80 Mon Sep 17 00:00:00 2001 From: bcherb2 Date: Wed, 18 Nov 2026 02:45:19 -0500 Subject: [PATCH] chore: lab verbatim check defaults to $HOME, and the fake private tier is resynced The default named a real home path in the public tier (SEC-1), and two of the three verbatim copies had drifted from the private repo. --- .tests/lab/check-verbatim.sh | 2 +- .tests/lab/fake-private/.chezmoiignore | 6 ++++++ .../bin/private_executable_dotsecrets.tmpl | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.tests/lab/check-verbatim.sh b/.tests/lab/check-verbatim.sh index 51adb6c..7ecf53f 100755 --- a/.tests/lab/check-verbatim.sh +++ b/.tests/lab/check-verbatim.sh @@ -5,7 +5,7 @@ # edited -- which happened within the hour of creating it. Check, don't hope. set -eu cd "$(dirname "$0")" -REAL=${1:-/home/dev/code/dotfiles-private} +REAL=${1:-$HOME/code/dotfiles-private} rc=0 for f in .chezmoiignore run_after_50-secrets.sh.tmpl \ dot_local/bin/private_executable_dotsecrets.tmpl; do diff --git a/.tests/lab/fake-private/.chezmoiignore b/.tests/lab/fake-private/.chezmoiignore index b06adc4..34eb7cd 100644 --- a/.tests/lab/fake-private/.chezmoiignore +++ b/.tests/lab/fake-private/.chezmoiignore @@ -13,6 +13,12 @@ README.md bootstrap.env.example +# Agent instructions for working IN this repo (the test-isolation rule), not a +# dotfile. Without this entry it lands as ~/CLAUDE.md, which Claude Code then +# loads into every session under $HOME. .claude/ and .design/ need no entry: +# chezmoi skips every dot-prefixed source name except .chezmoi*. +CLAUDE.md + # Runbook scripts for the bootstrap endpoint. Operator tooling that is run by # hand a few times a year, not configuration that belongs in a home directory. # They live here rather than in the public tier because they name the endpoint diff --git a/.tests/lab/fake-private/dot_local/bin/private_executable_dotsecrets.tmpl b/.tests/lab/fake-private/dot_local/bin/private_executable_dotsecrets.tmpl index 3391248..a5ac991 100644 --- a/.tests/lab/fake-private/dot_local/bin/private_executable_dotsecrets.tmpl +++ b/.tests/lab/fake-private/dot_local/bin/private_executable_dotsecrets.tmpl @@ -77,6 +77,12 @@ shquote() { [ -r "$TOKEN_FILE" ] || abort "no bws token at $TOKEN_FILE (public-only machine?)" +# dotup installs bws into ~/.local/bin, and the very first run arrives from +# the pre-login shell where ~/.local/bin is NOT on PATH yet -- the same +# fresh-box quirk the public README documents for dotup itself. Without this +# probe the first apply of a brand-new machine silently ends with no +# secrets.zsh (found live 2026-08-22, phase 5 VM). +command -v bws >/dev/null 2>&1 || PATH="$HOME/.local/bin:$PATH" command -v bws >/dev/null 2>&1 \ || abort "bws is not installed or not on PATH -- https://bitwarden.com/help/secrets-manager-cli/" @@ -158,6 +164,17 @@ while [ "$#" -ge 2 ]; do esac value=${line#"$name"=} + + # Newer bws releases wrap the value in double quotes in `-o env` output; + # the versions on the existing machines did not. Strip exactly one + # symmetric pair, or every consumer gets a key with literal quotes in it + # and a 401 that looks like a rotated credential (found live 2026-08-22, + # phase 5 VM -- the fake bws in the tests does not quote, so only a real + # fresh install could surface it). + case $value in + \"*\") value=${value#\"}; value=${value%\"} ;; + esac + [ -n "$value" ] || abort "bws returned an empty value for $name" printf 'export %s=%s\n' "$name" "$(shquote "$value")" >>"$TMP" \