#!/usr/bin/env bats # ============================================================================= # tests/lib-load-project.bats — Regression guard for the #862 fix. # # TOML allows dashes in bare keys, so `[agents.dev-qwen2]` is a valid section # header. Before #862, load-project.sh translated the section name into a # shell variable name via Python's `.upper()` alone, which kept the dash and # produced `AGENT_DEV-QWEN2_BASE_URL`. `export "AGENT_DEV-QWEN2_..."` is # rejected by bash ("not a valid identifier"), and with `set -euo pipefail` # anywhere up-stack that error aborts load-project.sh — effectively crashing # the factory on the N+1 run after a dashed agent was hired. # # The fix normalizes via `.upper().replace('-', '_')`, matching the # `tr 'a-z-' 'A-Z_'` convention already used in hire-agent.sh and # generators.sh. # ============================================================================= setup() { ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)" TOML="${BATS_TEST_TMPDIR}/test.toml" } @test "dashed [agents.*] section name parses without error" { cat > "$TOML" < "$TOML" < "$TOML" <