gaia-framework 1.48.4 → 1.49.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -460,7 +460,7 @@ The single source of truth is `_gaia/_config/global.yaml`:
460
460
 
461
461
  ```yaml
462
462
  framework_name: "GAIA"
463
- framework_version: "1.48.4"
463
+ framework_version: "1.49.1"
464
464
  user_name: "your-name"
465
465
  project_name: "your-project"
466
466
  ```
package/gaia-install.sh CHANGED
@@ -6,7 +6,7 @@ set -euo pipefail
6
6
  # Installs, updates, validates, and reports on GAIA installations.
7
7
  # ─────────────────────────────────────────────────────────────────────────────
8
8
 
9
- readonly VERSION="1.48.4"
9
+ readonly VERSION="1.49.1"
10
10
  readonly GITHUB_REPO="https://github.com/jlouage/Gaia-framework.git"
11
11
  readonly MANIFEST_REL="_gaia/_config/manifest.yaml"
12
12
 
@@ -430,6 +430,21 @@ GITIGNORE
430
430
  echo ""
431
431
  }
432
432
 
433
+ # ─── find_files_in_dir ──────────────────────────────────────────────────────
434
+ # Lists all files in a directory tree. Uses null-delimited output (find -print0)
435
+ # when supported, falls back to newline-delimited output on systems where -print0
436
+ # is unavailable (e.g., Windows Git Bash with busybox find).
437
+ # GAIA file paths never contain newlines, so the newline-delimited fallback is safe.
438
+
439
+ find_files_in_dir() {
440
+ local dir="$1"
441
+ if find /dev/null -maxdepth 0 -print0 2>/dev/null | head -c0 2>/dev/null; then
442
+ find "$dir" -type f -print0
443
+ else
444
+ find "$dir" -type f
445
+ fi
446
+ }
447
+
433
448
  # ─── cmd_update ─────────────────────────────────────────────────────────────
434
449
 
435
450
  cmd_update() {
@@ -497,6 +512,12 @@ cmd_update() {
497
512
  step "Updating framework files..."
498
513
  local updated=0 skipped=0 changed=0
499
514
 
515
+ # Feature-detect find -print0 support once before the loop (E6-S2)
516
+ local use_print0=false
517
+ if find /dev/null -maxdepth 0 -print0 2>/dev/null | head -c0 2>/dev/null; then
518
+ use_print0=true
519
+ fi
520
+
500
521
  for entry in "${update_targets[@]}"; do
501
522
  local src_path="$source/_gaia/$entry"
502
523
  local dst_path="$TARGET/_gaia/$entry"
@@ -515,12 +536,24 @@ cmd_update() {
515
536
  copy_with_backup "$src_path" "$dst_path" "$backup_dir"
516
537
  updated=$((updated + 1))
517
538
  elif [[ -d "$src_path" ]]; then
518
- # Directory — update each file
519
- while IFS= read -r -d '' file; do
520
- local rel="${file#$src_path/}"
521
- copy_with_backup "$file" "$dst_path/$rel" "$backup_dir"
522
- updated=$((updated + 1))
523
- done < <(find "$src_path" -type f -print0) || true
539
+ # Directory — update each file via find_files_in_dir helper
540
+ if [[ "$use_print0" == true ]]; then
541
+ # Null-delimited path (macOS/Linux with GNU or BSD find)
542
+ while IFS= read -r -d '' file; do
543
+ local rel="${file#$src_path/}"
544
+ copy_with_backup "$file" "$dst_path/$rel" "$backup_dir"
545
+ updated=$((updated + 1))
546
+ done < <(find_files_in_dir "$src_path") || true
547
+ else
548
+ # Newline-delimited fallback (Windows Git Bash / busybox find)
549
+ # Safe because GAIA file paths never contain newlines
550
+ while IFS= read -r file; do
551
+ [[ -z "$file" ]] && continue
552
+ local rel="${file#$src_path/}"
553
+ copy_with_backup "$file" "$dst_path/$rel" "$backup_dir"
554
+ updated=$((updated + 1))
555
+ done < <(find_files_in_dir "$src_path") || true
556
+ fi
524
557
  fi
525
558
  done
526
559
 
@@ -600,6 +633,12 @@ cmd_update() {
600
633
  # ─── cmd_validate ───────────────────────────────────────────────────────────
601
634
 
602
635
  cmd_validate() {
636
+ # Guard: reject empty, unset, or whitespace-only TARGET
637
+ if [[ -z "${TARGET:-}" || "${TARGET}" =~ ^[[:space:]]+$ ]]; then
638
+ error "TARGET path is empty or whitespace-only"
639
+ exit 1
640
+ fi
641
+
603
642
  if [[ ! -d "$TARGET/_gaia" ]]; then
604
643
  error "No GAIA installation found at $TARGET"
605
644
  exit 1
@@ -610,9 +649,12 @@ cmd_validate() {
610
649
 
611
650
  local pass=0 fail=0
612
651
 
652
+ # check: accepts a label and the exit status ($?) of a preceding test command.
653
+ # The test command runs inline before calling check, passing $? as the result.
654
+ # This avoids eval entirely — conditions execute directly via [[ ]] or grep.
613
655
  check() {
614
- local label="$1" condition="$2"
615
- if eval "$condition"; then
656
+ local label="$1" result="$2"
657
+ if [[ "$result" -eq 0 ]]; then
616
658
  printf " ${GREEN}✔${RESET} %s\n" "$label"
617
659
  pass=$((pass + 1))
618
660
  else
@@ -622,47 +664,47 @@ cmd_validate() {
622
664
  }
623
665
 
624
666
  # Manifest
625
- check "manifest.yaml exists" "[[ -f '$TARGET/$MANIFEST_REL' ]]"
667
+ [[ -f "$TARGET/$MANIFEST_REL" ]]; check "manifest.yaml exists" $?
626
668
 
627
669
  # Global config fields
628
670
  local global="$TARGET/_gaia/_config/global.yaml"
629
- check "global.yaml exists" "[[ -f '$global' ]]"
671
+ [[ -f "$global" ]]; check "global.yaml exists" $?
630
672
  if [[ -f "$global" ]]; then
631
- check "global.yaml has project_name" "grep -q '^project_name:' '$global'"
632
- check "global.yaml has user_name" "grep -q '^user_name:' '$global'"
633
- check "global.yaml has framework_version" "grep -q '^framework_version:' '$global'"
673
+ local grc=0; grep -q '^project_name:' "$global" || grc=$?; check "global.yaml has project_name" $grc
674
+ grc=0; grep -q '^user_name:' "$global" || grc=$?; check "global.yaml has user_name" $grc
675
+ grc=0; grep -q '^framework_version:' "$global" || grc=$?; check "global.yaml has framework_version" $grc
634
676
  fi
635
677
 
636
678
  # Module directories
637
679
  for mod in core lifecycle dev creative testing; do
638
- check "Module: $mod" "[[ -d '$TARGET/_gaia/$mod' ]]"
680
+ [[ -d "$TARGET/_gaia/$mod" ]]; check "Module: $mod" $?
639
681
  done
640
682
 
641
683
  # .resolved directories
642
684
  for mod in core lifecycle creative testing; do
643
- check ".resolved: $mod" "[[ -d '$TARGET/_gaia/$mod/.resolved' ]]"
685
+ [[ -d "$TARGET/_gaia/$mod/.resolved" ]]; check ".resolved: $mod" $?
644
686
  done
645
687
 
646
688
  # Memory directory at project root (ADR-013)
647
- check "_memory/ directory" "[[ -d '$TARGET/_memory' ]]"
689
+ [[ -d "$TARGET/_memory" ]]; check "_memory/ directory" $?
648
690
  for dir in "${MEMORY_DIRS[@]}"; do
649
- check "Memory: $dir" "[[ -d '$TARGET/_memory/$dir' ]]"
691
+ [[ -d "$TARGET/_memory/$dir" ]]; check "Memory: $dir" $?
650
692
  done
651
693
 
652
694
  # CLAUDE.md
653
- check "CLAUDE.md exists" "[[ -f '$TARGET/CLAUDE.md' ]]"
695
+ [[ -f "$TARGET/CLAUDE.md" ]]; check "CLAUDE.md exists" $?
654
696
 
655
697
  # Slash commands
656
- check "Slash commands directory" "[[ -d '$TARGET/.claude/commands' ]]"
698
+ [[ -d "$TARGET/.claude/commands" ]]; check "Slash commands directory" $?
657
699
  if [[ -d "$TARGET/.claude/commands" ]]; then
658
700
  local cmd_count
659
701
  cmd_count="$(find "$TARGET/.claude/commands" -name 'gaia*.md' -type f 2>/dev/null | wc -l | tr -d ' ')"
660
- check "Slash commands present (found: $cmd_count)" "[[ $cmd_count -gt 0 ]]"
702
+ [[ "$cmd_count" -gt 0 ]]; check "Slash commands present (found: $cmd_count)" $?
661
703
  fi
662
704
 
663
705
  # Docs directories
664
706
  for dir in planning-artifacts implementation-artifacts test-artifacts creative-artifacts; do
665
- check "Docs: $dir" "[[ -d '$TARGET/docs/$dir' ]]"
707
+ [[ -d "$TARGET/docs/$dir" ]]; check "Docs: $dir" $?
666
708
  done
667
709
 
668
710
  # Version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaia-framework",
3
- "version": "1.48.4",
3
+ "version": "1.49.1",
4
4
  "description": "GAIA — Generative Agile Intelligence Architecture installer",
5
5
  "bin": {
6
6
  "gaia-framework": "./bin/gaia-framework.js"