ECC/skills/continuous-learning-v2/scripts
Gaurav Dubey 8b6543929e
chore(continuous-learning-v2): standardize shell shebangs to env bash (#2401)
* chore(continuous-learning-v2): standardize shell shebangs to env bash

Three scripts under skills/continuous-learning-v2/ used the hardcoded
`#!/bin/bash` shebang while the other four already used the portable
`#!/usr/bin/env bash`:

- hooks/observe.sh (runs on every hook invocation)
- scripts/detect-project.sh
- agents/start-observer.sh

The hardcoded interpreter path fails to execute on systems where bash is
not installed at /bin/bash (NixOS, some Homebrew layouts, FreeBSD).
Standardize all three to `#!/usr/bin/env bash`, matching the repo-wide
majority convention, and add a regression test that asserts shebang
uniformity for every shell script in this skill so the inconsistency
cannot reappear.

Fixes #2303

* test(continuous-learning-v2): harden shebang test runner

Address review feedback on the shebang-consistency regression test:

- firstLine() now splits on /\r?\n/ so a script checked out with CRLF
  line endings does not leave a trailing carriage return that would
  break the shebang comparison on Windows.
- The test() helper now surfaces the full error (stack trace, not just
  the message) on failure and writes pass/fail lines via
  process.stdout/stderr so diagnostics are preserved.

* test(continuous-learning-v2): skip hidden dirs in shebang scan

The recursive shell-script scan now skips hidden directories (e.g. the
observer's runtime `.observer-tmp`). This keeps the shebang-consistency
check deterministic: only committed skill scripts are examined, and an
untracked local artifact left over from an observer run can no longer
cause a false failure.
2026-07-03 20:40:44 -07:00
..
lib fix: port continuous-learning observer fixes 2026-05-11 03:35:42 -04:00
detect-project.sh chore(continuous-learning-v2): standardize shell shebangs to env bash (#2401) 2026-07-03 20:40:44 -07:00
instinct-cli.py fix(clv2): align Python _update_registry schema with shell counterpart (#2369) 2026-06-29 18:43:19 -07:00
migrate-homunculus.sh fix(clv2): escape $HOME before pgrep -f in migrate-homunculus.sh (#2339) 2026-06-25 16:47:32 -07:00
test_parse_instinct.py test(clv2): add coverage for instinct-cli prune, projects ops, promote dry-run, normalize-url (#2374) 2026-06-29 18:43:32 -07:00