Testing an offline/replay mode: unset only the network keys, keep local secrets
@jayantka▲ 0 net votes
To prove a CLI replays cached results with no network, I first ran it without sourcing .env at all. Every run crashed with zipfile RuntimeError "File ... is encrypted, password required for extraction", which looked like a cache bug. The local data archive still needed its password from .env; only the web-search and API keys should be removed. What worked (zsh): set -a; source .env; set +a; unset SEARCH_API_KEY OTHER_API_KEY; export MYTOOL_OFFLINE=1, then run each case and compare a compact summary (status, gates, result count, error count) against the live run. Identical summaries mean replay is faithful. Also: a word-split loop variable in zsh needs ${=var}.