Skip to content

fix: Bash 5.3 compatibility for associative array declaration#11

Merged
kryptobaseddev merged 1 commit into
kryptobaseddev:mainfrom
DanielViholm:fix/bash-5.3-compatibility
Jan 28, 2026
Merged

fix: Bash 5.3 compatibility for associative array declaration#11
kryptobaseddev merged 1 commit into
kryptobaseddev:mainfrom
DanielViholm:fix/bash-5.3-compatibility

Conversation

@DanielViholm
Copy link
Copy Markdown
Contributor

Summary

Fixes Bash 5.3+ compatibility issue where associative array declarations fail with "unbound variable" errors.

Bash 5.3 has stricter set -u handling where array keys like ["CLEO_FORMAT"] are evaluated as variable references, causing:

/Users/.../.cleo/lib/config.sh: line 66: CLEO_FORMAT: unbound variable

Changes

  • Temporarily disable set -u around the ENV_TO_CONFIG array declaration in lib/config.sh
  • Re-enable immediately after the declaration completes

Test Plan

  • Tested on macOS with Bash 5.3.9 (Homebrew)
  • cleo version works
  • cleo init works
  • cleo list works

Fixes #10

🤖 Generated with Claude Code

Bash 5.3+ has stricter handling of `set -u` (nounset) where array keys
in associative array declarations are evaluated as variable references.

This caused "unbound variable" errors like:
  /Users/.../.cleo/lib/config.sh: line 66: CLEO_FORMAT: unbound variable

The fix temporarily disables -u around the ENV_TO_CONFIG array
declaration, then re-enables it immediately after.

Fixes kryptobaseddev#10

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@kryptobaseddev kryptobaseddev merged commit 1ded73e into kryptobaseddev:main Jan 28, 2026
kryptobaseddev added a commit that referenced this pull request Apr 11, 2026
P1 — Broken Options & Commands (9 fixes):
- stats: remove Number() conversion so named period aliases work (#7)
- archive-stats: forward period param to engine (#8)
- reorder: remove 4 non-functional options, keep only --position (#9)
- context check/list: fix misleading help text (#10)
- detect-drift: fix hardcoded src/ paths for monorepo layout (#11)
- dash: remove 5 non-functional opts, wire --blocked-limit (#12)
- labels show: route to tasks.list with label filter (#13)
- release changelog: remove vestigial subcommand that always failed (#14)
- pull: return success:false when fetch fails (#15)

P2 — Consolidation (7 fixes):
- Deprecate phases, commands, validate with warnings (#16-18)
- Mark 5 protocol wrappers as aliases in help text (#19)
- Document token vs otel data source distinction (#20)
- Document backup create as alias for backup add (#21)
- Remove agents.ts no-op stub from registration (#22)

P3 — Help Text (5 fixes):
- Add enum values for status/priority/type/field/stage (#23)
- Document session requirements on add/bug/complete (#24)
- Clarify find query is required unless --id used (#25)
- Add output schema hints to current/start/stop/show (#26)
- Differentiate briefing vs plan vs dash use cases (#27)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kryptobaseddev added a commit that referenced this pull request Apr 15, 2026
…9a/9b/9c integration (T690/T695/T694)

Per docs/specs/stdp-wire-up-spec.md §3.9 + §3.11 + §4.1.

- T690 (A3): applyHomeostaticDecay Step 9c — 2%/day exponential decay on hebbian/stdp edges after 7-day grace; prune at <0.05; logs brain_weight_history event_kind='prune' (decay events not logged per spec decision #11); static/external edges untouched
- T695 (A8): session-bucket pair grouping O(n²) guard — spikes grouped by session_id; cross-session pairs only checked at session tail (MAX_PAIRS_PER_SESSION=50 cap); within-session pairs always generated
- T694 (A7): runConsolidation Step 9a/9b/9c chain — backfillRewardSignals → applyStdpPlasticity → applyHomeostaticDecay; logs brain_consolidation_events row with trigger, session_id, step stats, duration; trigger parameter added to runConsolidation signature; RunConsolidationResult extended with homeostaticDecay field

Tests (brain-stdp-wave3.test.ts): real SQLite, no mocks — decay math, prune behavior, grace period protection, static edge immunity, perf bound (5000 spikes <30s), within-session pair completeness, cross-session correctness, consolidation pipeline integration with ordering verification and brain_consolidation_events assertions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
kryptobaseddev added a commit that referenced this pull request May 7, 2026
…9a/9b/9c integration (T690/T695/T694)

Per docs/specs/stdp-wire-up-spec.md §3.9 + §3.11 + §4.1.

- T690 (A3): applyHomeostaticDecay Step 9c — 2%/day exponential decay on hebbian/stdp edges after 7-day grace; prune at <0.05; logs brain_weight_history event_kind='prune' (decay events not logged per spec decision #11); static/external edges untouched
- T695 (A8): session-bucket pair grouping O(n²) guard — spikes grouped by session_id; cross-session pairs only checked at session tail (MAX_PAIRS_PER_SESSION=50 cap); within-session pairs always generated
- T694 (A7): runConsolidation Step 9a/9b/9c chain — backfillRewardSignals → applyStdpPlasticity → applyHomeostaticDecay; logs brain_consolidation_events row with trigger, session_id, step stats, duration; trigger parameter added to runConsolidation signature; RunConsolidationResult extended with homeostaticDecay field

Tests (brain-stdp-wave3.test.ts): real SQLite, no mocks — decay math, prune behavior, grace period protection, static edge immunity, perf bound (5000 spikes <30s), within-session pair completeness, cross-session correctness, consolidation pipeline integration with ordering verification and brain_consolidation_events assertions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bash 5.3 compatibility: unbound variable error in config.sh associative array declaration

2 participants