pumuki-ast-hooks 5.5.21 → 5.5.22

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
@@ -1065,6 +1065,15 @@ For coding standards, see [CODE_STANDARDS.md](./docs/CODE_STANDARDS.md).
1065
1065
 
1066
1066
  ## 📝 Recent Changes
1067
1067
 
1068
+ ### Version 5.5.21 (2026-01-04)
1069
+
1070
+ **🐛 Bug Fixes:**
1071
+ - Fixed fork bomb caused by wrapper scripts being copied to incorrect location
1072
+ - Excluded wrapper scripts from bin/ copy to prevent recursive calls
1073
+ - Session loader now works correctly without causing resource exhaustion
1074
+
1075
+ ---
1076
+
1068
1077
  ### Version 5.5.20 (2026-01-04)
1069
1078
 
1070
1079
  **🐛 Bug Fixes:**
@@ -1,5 +1,5 @@
1
1
  #!/bin/bash
2
- # AST Session Loader v5.5.20
2
+ # AST Session Loader v5.5.22
3
3
  # Runs on IDE startup to initialize AST hooks, show context and check tokens
4
4
  REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo ".")
5
5
 
@@ -26,7 +26,7 @@ fi
26
26
  # Banner
27
27
  echo ""
28
28
  echo -e "${BLUE}╔══════════════════════════════════════════════════════════╗${NC}"
29
- echo -e "${BLUE}║ 🤖 AST Intelligence Hooks v5.5.20 ║${NC}"
29
+ echo -e "${BLUE}║ 🤖 AST Intelligence Hooks v5.5.22 ║${NC}"
30
30
  echo -e "${BLUE}║ Workspace Opened - Loading Context... ║${NC}"
31
31
  echo -e "${BLUE}╚══════════════════════════════════════════════════════════╝${NC}"
32
32
  echo ""
@@ -1,3 +1,39 @@
1
+ # Release Notes - v5.5.21
2
+
3
+ **Release Date**: January 4, 2026
4
+ **Type**: Patch Release
5
+ **Compatibility**: Fully backward compatible with 5.5.x
6
+
7
+ ---
8
+
9
+ ## 🎯 Overview
10
+
11
+ This release fixes a critical fork bomb issue in the installer caused by wrapper scripts being copied to incorrect locations, preventing recursive calls that would exhaust system resources.
12
+
13
+ ---
14
+
15
+ ## 🐛 Bug Fixes
16
+
17
+ ### Fixed: Fork bomb in session-loader
18
+ - **Issue**: Wrapper scripts (`session-loader.sh`, `cli.js`, `install.js`) were copied from `/bin/` to `scripts/hooks-system/bin/`, causing them to call themselves recursively
19
+ - **Resolution**: Modified `FileSystemInstallerService` to exclude wrapper scripts when copying the `bin/` directory
20
+ - **Impact**: Session loader now works correctly without causing fork resource exhaustion or infinite loops
21
+
22
+ ### Technical Details
23
+ - Wrapper scripts in the library's `/bin/` directory are now excluded during installation
24
+ - This prevents the wrapper from being copied to the location where it would call itself
25
+ - Installation process is now safe and doesn't cause resource exhaustion
26
+
27
+ ---
28
+
29
+ ## 📦 Installation / Upgrade
30
+ ```bash
31
+ npm install --save-dev pumuki-ast-hooks@5.5.21
32
+ npm run install-hooks
33
+ ```
34
+
35
+ ---
36
+
1
37
  # Release Notes - v5.5.20
2
38
 
3
39
  **Release Date**: January 4, 2026
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki-ast-hooks",
3
- "version": "5.5.21",
3
+ "version": "5.5.22",
4
4
  "description": "Enterprise-grade AST Intelligence System with multi-platform support (iOS, Android, Backend, Frontend) and Feature-First + DDD + Clean Architecture enforcement. Includes dynamic violations API for intelligent querying.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -1,5 +1,107 @@
1
1
  #!/bin/bash
2
- # Script Wrapper
3
- # Redirects to the centralized implementation in scripts/hooks-system
2
+ # AST Session Loader v5.5.22
3
+ # Runs on IDE startup to initialize AST hooks, show context and check tokens
4
4
  REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo ".")
5
- bash "$REPO_ROOT/scripts/hooks-system/bin/session-loader.sh" "$@"
5
+
6
+ BLUE='\033[0;34m'
7
+ CYAN='\033[0;36m'
8
+ GREEN='\033[0;32m'
9
+ YELLOW='\033[1;33m'
10
+ MAGENTA='\033[0;35m'
11
+ NC='\033[0m'
12
+
13
+ EVIDENCE_FILE="$REPO_ROOT/.AI_EVIDENCE.json"
14
+ SESSION_FILE="$REPO_ROOT/.AI_SESSION_START.md"
15
+ TOKEN_STATUS="$REPO_ROOT/.audit_tmp/token-status.txt"
16
+ VIOLATIONS_REPORT="$REPO_ROOT/.audit_tmp/intelligent-report.txt"
17
+
18
+ TOKEN_TRACKER="$REPO_ROOT/scripts/hooks-system/infrastructure/watchdog/token-tracker.sh"
19
+ if [ -f "$TOKEN_TRACKER" ]; then
20
+ bash "$TOKEN_TRACKER"
21
+ fi
22
+
23
+ echo ""
24
+ echo -e "${BLUE}╔══════════════════════════════════════════════════════════╗${NC}"
25
+ echo -e "${BLUE}║ 🤖 AST Intelligence Hooks v5.5.22 ║${NC}"
26
+ echo -e "${BLUE}║ Workspace Opened - Loading Context... ║${NC}"
27
+ echo -e "${BLUE}╚══════════════════════════════════════════════════════════╝${NC}"
28
+ echo ""
29
+
30
+ CURRENT_BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
31
+ echo -e "${CYAN}📍 Current Branch: ${MAGENTA}$CURRENT_BRANCH${NC}"
32
+ echo ""
33
+
34
+ echo -e "${CYAN}📝 Recent Commits:${NC}"
35
+ git log --oneline -3 2>/dev/null | sed 's/^/ /' || echo " No commits yet"
36
+ echo ""
37
+
38
+ if [[ -f "$EVIDENCE_FILE" ]]; then
39
+ CURRENT_SESSION_ID=$(jq -r '.session_id // empty' "$EVIDENCE_FILE" 2>/dev/null || echo "")
40
+ CURRENT_ACTION=$(jq -r '.action // empty' "$EVIDENCE_FILE" 2>/dev/null || echo "")
41
+ if [[ -n "$CURRENT_SESSION_ID" && "$CURRENT_SESSION_ID" != "null" ]]; then
42
+ echo -e "${CYAN}📖 Session Context:${NC}"
43
+ if [[ -n "$CURRENT_ACTION" && "$CURRENT_ACTION" != "null" ]]; then
44
+ echo " Session: $CURRENT_SESSION_ID - $CURRENT_ACTION"
45
+ else
46
+ echo " Session: $CURRENT_SESSION_ID"
47
+ fi
48
+ echo ""
49
+ fi
50
+ fi
51
+
52
+ if [[ -f "$VIOLATIONS_REPORT" ]]; then
53
+ echo -e "${CYAN}🎯 Top Violations (last audit):${NC}"
54
+ grep -E "CRITICAL|HIGH|MEDIUM|LOW" "$VIOLATIONS_REPORT" 2>/dev/null | head -5 | sed 's/^/ /' || echo " No violations found"
55
+ echo ""
56
+ elif [[ -f "$REPO_ROOT/.audit_tmp/ast-summary.json" ]]; then
57
+ echo -e "${CYAN}🎯 Violations Summary:${NC}"
58
+ CRITICAL=$(jq -r '.levels.CRITICAL // 0' "$REPO_ROOT/.audit_tmp/ast-summary.json" 2>/dev/null || echo "0")
59
+ HIGH=$(jq -r '.levels.HIGH // 0' "$REPO_ROOT/.audit_tmp/ast-summary.json" 2>/dev/null || echo "0")
60
+ MEDIUM=$(jq -r '.levels.MEDIUM // 0' "$REPO_ROOT/.audit_tmp/ast-summary.json" 2>/dev/null || echo "0")
61
+ LOW=$(jq -r '.levels.LOW // 0' "$REPO_ROOT/.audit_tmp/ast-summary.json" 2>/dev/null || echo "0")
62
+ echo " 🔴 CRITICAL: $CRITICAL 🟠 HIGH: $HIGH 🟡 MEDIUM: $MEDIUM 🔵 LOW: $LOW"
63
+ echo ""
64
+ fi
65
+
66
+ AGE=0
67
+ if [[ -f "$EVIDENCE_FILE" ]]; then
68
+ EVIDENCE_TS=$(jq -r '.timestamp' "$EVIDENCE_FILE" 2>/dev/null || echo "")
69
+ if [[ -n "$EVIDENCE_TS" ]] && [[ "$EVIDENCE_TS" != "null" ]]; then
70
+ CLEAN_TS=$(echo "$EVIDENCE_TS" | sed -E 's/\.[0-9]+([+-][0-9]{2}:[0-9]{2}|Z)$/\1/')
71
+
72
+ if [[ "$CLEAN_TS" =~ \+[0-9]{2}:[0-9]{2}$ ]] || [[ "$CLEAN_TS" =~ -[0-9]{2}:[0-9]{2}$ ]]; then
73
+ EVIDENCE_EPOCH=$(python3 -c "from datetime import datetime; import sys; dt = datetime.fromisoformat('$CLEAN_TS'); print(int(dt.timestamp()))" 2>/dev/null || echo "0")
74
+ elif [[ "$CLEAN_TS" =~ Z$ ]]; then
75
+ EVIDENCE_EPOCH=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$CLEAN_TS" +%s 2>/dev/null || echo "0")
76
+ else
77
+ EVIDENCE_EPOCH=0
78
+ fi
79
+
80
+ if [[ "$EVIDENCE_EPOCH" != "0" ]]; then
81
+ NOW_EPOCH=$(date +%s)
82
+ AGE=$((NOW_EPOCH - EVIDENCE_EPOCH))
83
+
84
+ if [[ $AGE -gt 180 ]]; then
85
+ echo -e "${YELLOW}⚠️ Evidence is stale (${AGE}s old, max 3min)${NC}"
86
+ echo -e "${YELLOW} Run: ai-start${NC}"
87
+ else
88
+ echo -e "${GREEN}✅ Evidence fresh (${AGE}s old)${NC}"
89
+ fi
90
+ echo ""
91
+ fi
92
+ fi
93
+ fi
94
+
95
+ echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
96
+ echo -e "${CYAN}🚀 Quick Commands:${NC}"
97
+ echo " ai-start → Update evidence & start work"
98
+ echo " bash scripts/hooks-system/infrastructure/shell/orchestrators/audit-orchestrator.sh → Full audit"
99
+ echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
100
+ echo ""
101
+
102
+ if [[ $AGE -gt 180 ]]; then
103
+ echo -e "${YELLOW}⚠️ Run 'ai-start' to refresh evidence before working${NC}"
104
+ else
105
+ echo -e "${GREEN}✅ Session loaded - Ready to work!${NC}"
106
+ fi
107
+ echo ""