41cc045 passed bash -n, shellcheck, a function-set diff, a line-set diff
and a stubbed source run -- and still shipped a script that aborted after
language detection. Both bugs needed a real execution to see.
1. set -e. The eight `((LANG_FILES[x] > 0)) && HAS_Y=true` lines were
top-level statements, where a false `&&` merely left $? non-zero. As
the tail of detect_languages they became its return value, and the
last one (java, false for most repos) killed the script. Now `|| true`.
2. Self-referencing nameref. `local -n LANG_CODE_FILES="$1"` pointing at
a global of the same name makes bash 5.3 warn "circular name
reference" on every access -- into this script's own output. The
locals are now _code_files.
The rename then hid the array from shellcheck (SC2034), since it was only
named as a bare word. Fixed by passing it through CODE_FILES_MAP so the
reference is real, not by suppressing.
Verified against 133fccf end to end on a fixture repo: same file set,
every text artifact byte-identical, exit 0 both sides, zero warnings.
Only cscope.out.in differs, in binary padding -- same input list, same
90112 bytes.
The lesson for the recipe doc: a stubbed run sources the libs and never
calls them, so it cannot reach a bug in a seam that passes state.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY