docs: retire the wallet notes, and guard against a wallet coming back (wallet removal, Phase 8)

The 23 wallet notes move to docs/retired/ with a banner; every link between
notes is rewritten for the move and checked. The index lists them as one
Retired paragraph, and seven kept notes carry a line on what changed. The
README and CLAUDE.md describe a Giza with no wallet.

brand-audit.sh loses its "bennu/ exception: every such tag was a wallet's,
so one now is a wallet coming back. wallet-audit.sh --check, in check and
in CI, fails on a retired kind in the app's code, a lightning-kmp import,
a file named for a wallet's pieces, or sats in a string.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kgothatso NgakoandClaude Opus 5.5 committed 2026-11-18 16:15:13 +02:00
1 parent 005cbc2f23
commit b27ed2a05f
41 files changed
+313 -207

No files matched your search

+16 -17
View File
@@ -5,15 +5,18 @@
# docs/scripts/brand-audit.sh lists the lines that break the rule
# docs/scripts/brand-audit.sh --check and exits 1 if there are any
#
# The rule, in the parts that build or ship (composeApp, iosApp, testing and the gradle
# scripts): Bennu may be named in a comment, and in a `bennu/` derivation tag,
# and nowhere else. The tags are hash inputs Giza shares with Bennu, so they stay spelled
# as they are (giza-rebrand.md, "What does not carry the name"). A comment can explain the
# fork. Anything else -- a string a person reads, a client tag, an identifier, a package --
# is a leftover.
# The rule, in the parts that build or ship (composeApp, iosApp and the gradle scripts):
# Bennu may be named in a comment, and nowhere else. A comment can explain the fork.
# Anything else -- a string a person reads, a client tag, an identifier, a package, a
# derivation tag -- is a leftover.
#
# Prose (README.md, CLAUDE.md, docs/ and the Markdown under testing/) is not checked: it
# explains the fork, and docs/ records decisions taken while the app was Bennu.
# There used to be a second exception, for the twelve `bennu/` derivation tags, which are
# hash inputs Giza shared with Bennu. Every one of them was a wallet's, and they went with
# the wallets (docs/giza-wallet-removal.md). The tags that stay are `mantra/`. So a
# `bennu/` tag in the code now is a wallet coming back, and fails like any other leftover.
#
# Prose (README.md, CLAUDE.md and docs/) is not checked: it explains the fork, and docs/
# records decisions taken while the app was Bennu.
#
# Why it exists: a merge from Bennu (Phase 9) brings Bennu's new strings with it, and
# docs/scripts/giza-rename.sh renames code, not words. This is what fails the build when
@@ -30,7 +33,7 @@ CHECK=0
violations=$(
git grep -niI 'bennu' -- \
composeApp iosApp testing settings.gradle.kts build.gradle.kts \
composeApp iosApp settings.gradle.kts build.gradle.kts \
| awk '
{
# path:line:text -- the text may itself contain colons.
@@ -38,14 +41,10 @@ violations=$(
text = $0; sub(/^[^:]*:[^:]*:/, "", text)
code = text; sub(/^[ \t]+/, "", code)
}
# A derivation tag: the one place the name is protocol.
text ~ /"bennu\// { next }
# Comments in Kotlin and Gradle scripts: //, /* and KDoc continuation lines.
path ~ /\.(kt|kts)$/ && (code ~ /^\/\// || code ~ /^\/\*/ || code ~ /^\*/) { next }
# Comments in YAML, shell and HOCON (the regtest stack).
path ~ /\.(yml|yaml|sh|conf)$/ && code ~ /^#/ { next }
# Markdown under testing/ -- the regtest README -- is prose, like docs/.
path ~ /\.md$/ { next }
# Comments in YAML and shell.
path ~ /\.(yml|yaml|sh)$/ && code ~ /^#/ { next }
{ print }
'
)
@@ -53,13 +52,13 @@ violations=$(
count=0
[[ -n "$violations" ]] && count=$(printf '%s\n' "$violations" | wc -l)
echo "Bennu outside comments and derivation tags: $count"
echo "Bennu outside comments: $count"
if (( count > 0 )); then
printf '%s\n' "$violations" | sed 's/^/ /'
fi
if (( CHECK && count > 0 )); then
echo "Name it Giza, or, if it is protocol shared with Bennu, say so in a comment." >&2
echo "Name it Giza. A bennu/ derivation tag is a wallet coming back: see docs/giza-wallet-removal.md." >&2
exit 1
fi
exit 0
+66
View File
@@ -0,0 +1,66 @@
#!/usr/bin/env bash
#
# That the wallets stay removed: docs/giza-wallet-removal.md, Phase 8.
#
# docs/scripts/wallet-audit.sh lists the lines that break a rule
# docs/scripts/wallet-audit.sh --check and exits 1 if there are any
#
# Giza keeps no wallet, and Bennu, which it takes fixes from, keeps several. Four rules
# catch one coming back:
#
# 1. a retired kind's number (30331-30337, 30350-30366) in the app's own code. They
# are Bennu's and stay reserved -- RetiredKinds.kt says why. Allowed in that file,
# in the migrations (which have to keep meaning what they meant) and in tests, which
# assert that Giza declines them;
# 2. an import of lightning-kmp (`fr.acinq.lightning`). Nothing in the app needs it;
# 3. a source file named for one of the wallets' own pieces -- the group wallet, the
# Lightning wallet, Iceberg, guardians, member and guarded wallets, spends,
# transactions, Electrum. Named rather than every *Wallet*: the profile pickers under
# widgets/wallet/ and the SovereignWallet* startup kept Phoenix-era names, and the
# files that decline a wallet (WalletRefusal, RemoveWalletsMigration) are about one;
# 4. an amount in sats in a string a person reads.
#
# Needs only bash and git, like the other two audits, so the CI budgets job can run it.
set -uo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/../.." || exit 1
CHECK=0
[[ "${1:-}" == "--check" ]] && CHECK=1
MAIN=(composeApp/src/commonMain composeApp/src/androidMain composeApp/src/jvmMain composeApp/src/iosMain)
kinds=$(
git grep -nE '\b303(3[1-7]|5[0-9]|6[0-6])\b' -- "${MAIN[@]}" \
':!*/nostr/RetiredKinds.kt' ':!*/database/migrations/*'
)
lightning=$(git grep -nE '^import fr\.acinq\.lightning' -- composeApp)
files=$(
git ls-files composeApp/src \
| grep -E '/(GroupWallet|GroupLightning|Iceberg|Guardian|GuardedWallet|MemberWallet|MemberSend|GroupSend|GroupSpend|GroupTransaction|GroupOnchain|GroupChainClients|StandaloneElectrum|IdentityElectrum|ProposedSpend)[A-Za-z]*\.kt$'
)
sats=$(git grep -niE '>[^<]*\b(sats?|satoshis?)\b' -- composeApp/src/commonMain/composeResources)
report() {
local title=$1 lines=$2 n=0
[[ -n "$lines" ]] && n=$(printf '%s\n' "$lines" | wc -l)
echo "$title: $n"
[[ -n "$lines" ]] && printf '%s\n' "$lines" | sed 's/^/ /'
total=$((total + n))
}
total=0
report "Retired wallet kinds in the app's code" "$kinds"
report "lightning-kmp imports" "$lightning"
report "Files named for a wallet's pieces" "$files"
report "Amounts in sats in the strings" "$sats"
if (( CHECK && total > 0 )); then
echo "Giza keeps no wallet. See docs/giza-wallet-removal.md before bringing one back." >&2
exit 1
fi
exit 0