fix: add include guard to shared-constants.sh and remove duplicate source lines #483
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Summary
shared-constants.shso it's safe to source multiple timessource shared-constants.shlines introduced by PR refactor: increase shared-constants.sh adoption from 17% to 93% (t135.8) #480 merging on top of PR fix(portability): replace sed -i with portable sed_inplace wrapper (t145) #479Problem
PR #479 (sed portability) added
source shared-constants.shto 7 scripts. PR #480 (shared-constants adoption) independently added the same line to 155 scripts. When both merged, 5 scripts ended up with two source lines. Underset -euo pipefail, the second source fails onreadonlyre-declaration, causing all supervisor-helper.sh commands to silently exit 1 (batch, help, status, pulse — everything broken).Root Cause
shared-constants.shdeclares 81readonlyvariables. Sourcing it twice triggersreadonly variableerrors. Withset -e, this kills the script even when the second source has|| true(bash propagates errors from within sourced files).Fix
shared-constants.sh:[[ -n "${_SHARED_CONSTANTS_LOADED:-}" ]] && return 0— makes it idempotentTesting
Summary by CodeRabbit