pumuki-ast-hooks 5.3.14 → 5.3.16
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 +73 -22
- package/docs/RELEASE_NOTES.md +36 -0
- package/docs/RELEASE_NOTES_5.3.4.md +170 -0
- package/package.json +4 -2
- package/scripts/hooks-system/.AI_TOKEN_STATUS.txt +1 -1
- package/scripts/hooks-system/.audit-reports/notifications.log +215 -0
- package/scripts/hooks-system/.audit-reports/token-monitor.log +645 -0
- package/scripts/hooks-system/application/services/installation/McpConfigurator.js +60 -68
- package/scripts/hooks-system/config/project.config.json +1 -51
- package/scripts/hooks-system/infrastructure/mcp/ast-intelligence-automation.js +24 -1
- package/scripts/hooks-system/infrastructure/shell/orchestrators/audit-orchestrator.sh +3 -3
package/README.md
CHANGED
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
|
|
31
31
|
### Visual Overview
|
|
32
32
|
|
|
33
|
-
<img src="
|
|
33
|
+
<img src="https://raw.githubusercontent.com/SwiftEnProfundidad/ast-intelligence-hooks/main/docs/images/ast_intelligence_01.png" alt="AST Intelligence System Overview" width="100%" />
|
|
34
34
|
|
|
35
|
-
<img src="
|
|
35
|
+
<img src="https://raw.githubusercontent.com/SwiftEnProfundidad/ast-intelligence-hooks/main/docs/images/ast_intelligence_02.png" alt="AST Intelligence Workflow" width="100%" />
|
|
36
36
|
|
|
37
|
-
<img src="
|
|
37
|
+
<img src="https://raw.githubusercontent.com/SwiftEnProfundidad/ast-intelligence-hooks/main/docs/images/ast_intelligence_03.png" alt="AST Intelligence Audit - Part 1" width="100%" />
|
|
38
38
|
|
|
39
|
-
<img src="
|
|
39
|
+
<img src="https://raw.githubusercontent.com/SwiftEnProfundidad/ast-intelligence-hooks/main/docs/images/ast_intelligence_04.png" alt="AST Intelligence Audit - Part 2" width="100%" />
|
|
40
40
|
|
|
41
|
-
<img src="
|
|
41
|
+
<img src="https://raw.githubusercontent.com/SwiftEnProfundidad/ast-intelligence-hooks/main/docs/images/ast_intelligence_05.png" alt="AST Intelligence Audit - Part 3" width="100%" />
|
|
42
42
|
|
|
43
43
|
---
|
|
44
44
|
|
|
@@ -332,17 +332,57 @@ This library was conceived to solve this fundamental problem by creating a **per
|
|
|
332
332
|
|
|
333
333
|
---
|
|
334
334
|
|
|
335
|
-
##
|
|
335
|
+
## Complete Architecture and Workflow
|
|
336
336
|
|
|
337
|
-
|
|
337
|
+
The library operates through a multi-phase process that integrates with Git and development workflows to ensure code quality and context persistence. Below is a high-level overview of the architecture and key components:
|
|
338
338
|
|
|
339
|
-
|
|
340
|
-
- ✅ **What rules apply**: All 798+ platform-specific rules loaded automatically
|
|
341
|
-
- ✅ **What patterns exist**: Architecture patterns detected and documented
|
|
342
|
-
- ✅ **What violations need fixing**: Real-time violation tracking with severity
|
|
343
|
-
- ✅ **How the architecture should be structured**: Clean Architecture, DDD, Feature-First validation
|
|
339
|
+
### Architectural Diagram
|
|
344
340
|
|
|
345
|
-
|
|
341
|
+
```mermaid
|
|
342
|
+
graph LR
|
|
343
|
+
A[Developer] -->|Runs `ai-start`| B(AI Evidence Initialization)
|
|
344
|
+
B --> C[.AI_EVIDENCE.json]
|
|
345
|
+
C --> D[Pre-Tool-Use Validator]
|
|
346
|
+
D --> E[AI Gate Check]
|
|
347
|
+
E --> F[Allow/Block Actions]
|
|
348
|
+
F --> G[Code Editing]
|
|
349
|
+
G --> H[Pre-Commit Analysis]
|
|
350
|
+
H --> I[Block Commit if Violations]
|
|
351
|
+
I --> J[Update Evidence]
|
|
352
|
+
J --> K[Commit]
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### Key Components
|
|
356
|
+
1. **AI Evidence Initialization (`ai-start`)**
|
|
357
|
+
- Generates `.AI_EVIDENCE.json` with project context and rules.
|
|
358
|
+
- Answers three critical questions about the task.
|
|
359
|
+
- Example:
|
|
360
|
+
```bash
|
|
361
|
+
ai-start feature/user-authentication
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
2. **Pre-Tool-Use Validator**
|
|
365
|
+
- Validates `.AI_EVIDENCE.json` before every AI edit operation.
|
|
366
|
+
- Ensures context is fresh and rules are loaded.
|
|
367
|
+
|
|
368
|
+
3. **AI Gate Check**
|
|
369
|
+
- Checks for blocking violations before allowing actions.
|
|
370
|
+
- Enforces quality gates.
|
|
371
|
+
|
|
372
|
+
4. **Pre-Commit Analysis**
|
|
373
|
+
- Runs AST analysis on staged files.
|
|
374
|
+
- Blocks commits with critical violations.
|
|
375
|
+
|
|
376
|
+
5. **Evidence Update**
|
|
377
|
+
- Updates `.AI_EVIDENCE.json` before commits to maintain context.
|
|
378
|
+
|
|
379
|
+
### Example Workflow
|
|
380
|
+
1. Developer runs `ai-start` to initialize context.
|
|
381
|
+
2. AI uses context to perform edits.
|
|
382
|
+
3. Pre-commit hook analyzes code and blocks if violations exist.
|
|
383
|
+
4. Developer fixes violations and commits.
|
|
384
|
+
|
|
385
|
+
For a detailed architecture, see [ARCHITECTURE.md](ARCHITECTURE.md).
|
|
346
386
|
|
|
347
387
|
---
|
|
348
388
|
|
|
@@ -358,7 +398,7 @@ With this library, your AI assistant **always knows**:
|
|
|
358
398
|
- [Phase 4: Evidence Update Before Commits](#phase-4-evidence-update-before-commits)
|
|
359
399
|
- [Tools & Technologies](#️-tools--technologies)
|
|
360
400
|
- [What, How, and When: The Developer's Perspective](#-what-how-and-when-the-developers-perspective)
|
|
361
|
-
- [
|
|
401
|
+
- [Complete Architecture and Workflow](#complete-architecture-and-workflow)
|
|
362
402
|
- [What is it?](#what-is-it)
|
|
363
403
|
- [What problems does it solve?](#what-problems-does-it-solve)
|
|
364
404
|
- [Features](#features)
|
|
@@ -394,7 +434,7 @@ With this library, your AI assistant **always knows**:
|
|
|
394
434
|
#### 🔍 Code Validation
|
|
395
435
|
- ✅ **798+ validation rules** across all platforms with severity-based quality gates
|
|
396
436
|
- ✅ **Multi-platform support**: iOS (Swift/SwiftUI), Android (Kotlin/Jetpack Compose), Backend (TypeScript/NestJS), Frontend (React/Next.js)
|
|
397
|
-
- ✅ **Automatic architecture detection**:
|
|
437
|
+
- ✅ **Automatic architecture detection**: Identifies multiple patterns per platform (iOS: MVVM, MVVM-C, MVP, VIPER, TCA, Clean Swift, Feature-First + Clean + DDD; Backend: Clean Architecture, DDD, CQRS; Frontend: Feature-First, Component-Based, Atomic Design; Android: MVVM, MVI, MVP, Clean Architecture)
|
|
398
438
|
- ✅ **BDD→TDD workflow enforcement**: CRITICAL priority - ensures feature files exist before implementation and tests before code
|
|
399
439
|
- ✅ **Pre-commit Git hooks**: Automatic validation blocks commits with CRITICAL/HIGH violations
|
|
400
440
|
- ✅ **AST analysis engine**: Deep static code analysis using Abstract Syntax Trees
|
|
@@ -919,11 +959,6 @@ export HOOK_GUARD_AUTO_REFRESH=true
|
|
|
919
959
|
export AUTO_COMMIT_ENABLED=true
|
|
920
960
|
export AUTO_PUSH_ENABLED=true
|
|
921
961
|
export AUTO_PR_ENABLED=false
|
|
922
|
-
|
|
923
|
-
# Analysis mode
|
|
924
|
-
export AUDIT_STRICT=false
|
|
925
|
-
export AUDIT_STAGED_ONLY=false
|
|
926
|
-
export AUDIT_CRITICAL_HIGH_ONLY=false
|
|
927
962
|
```
|
|
928
963
|
|
|
929
964
|
### Configuration Files
|
|
@@ -1023,7 +1058,7 @@ Start by fixing CRITICAL and HIGH. MEDIUM and LOW are warnings and don't block c
|
|
|
1023
1058
|
```bash
|
|
1024
1059
|
# Automatically via MCP
|
|
1025
1060
|
# Or manually
|
|
1026
|
-
|
|
1061
|
+
bash scripts/hooks-system/infrastructure/shell/orchestrators/audit-orchestrator.sh
|
|
1027
1062
|
```
|
|
1028
1063
|
|
|
1029
1064
|
For more questions, check the issues on GitHub.
|
|
@@ -1121,4 +1156,20 @@ Developed by **Pumuki Team®**
|
|
|
1121
1156
|
|
|
1122
1157
|
---
|
|
1123
1158
|
|
|
1124
|
-
**⭐ If this project is useful to you, please consider giving it a star on GitHub.**
|
|
1159
|
+
**⭐ If this project is useful to you, please consider giving it a star on GitHub.**
|
|
1160
|
+
|
|
1161
|
+
### Run the Audit
|
|
1162
|
+
|
|
1163
|
+
To start the interactive audit menu, run:
|
|
1164
|
+
|
|
1165
|
+
```bash
|
|
1166
|
+
bash scripts/hooks-system/infrastructure/shell/orchestrators/audit-orchestrator.sh
|
|
1167
|
+
```
|
|
1168
|
+
|
|
1169
|
+
This will present a menu with options for different audit modes.
|
|
1170
|
+
|
|
1171
|
+
For non-interactive use, specify the mode directly:
|
|
1172
|
+
|
|
1173
|
+
```bash
|
|
1174
|
+
bash scripts/hooks-system/infrastructure/shell/orchestrators/audit-orchestrator.sh analyze # Full repository analysis
|
|
1175
|
+
bash scripts/hooks-system/infrastructure/shell/orchestrators/audit-orchestrator.sh staged # Analyze only staged files (pre-commit mode)
|
package/docs/RELEASE_NOTES.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
# Release Notes - v5.3.15
|
|
2
|
+
|
|
3
|
+
**Release Date**: December 30, 2025
|
|
4
|
+
**Type**: Patch Release
|
|
5
|
+
**Compatibility**: Fully backward compatible with 5.3.x
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🎯 Overview
|
|
10
|
+
|
|
11
|
+
This release fixes MCP configuration in Windsurf to avoid collisions when multiple projects are open in parallel. It now uses a single global entry with an absolute path to the repo’s local binary and removes the legacy hardcode in the CLI configurator.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 🐛 Bug Fixes
|
|
16
|
+
|
|
17
|
+
### Fixed: MCP collision when opening multiple repos in Windsurf
|
|
18
|
+
- **Issue**: MCP was generated per workspace with a fixed legacy ID, causing duplicates/cancellations of `ai_gate_check`.
|
|
19
|
+
- **Resolution**: Configuration only in `~/.codeium/windsurf/mcp_config.json` with fixed ID `ast-intelligence-automation` pointing to the local binary; legacy hardcode removed in `pumuki-mcp.js`.
|
|
20
|
+
- **Impact**: MCP no longer collides when working with multiple repos simultaneously.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 📚 Documentation
|
|
25
|
+
- New guide: `docs/MCP_CONFIGURATION.md` explaining global configuration and `ai_gate_check` validation in Windsurf.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 📦 Installation / Upgrade
|
|
30
|
+
```bash
|
|
31
|
+
npm install --save-dev pumuki-ast-hooks@5.3.15
|
|
32
|
+
npm run install-hooks
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
1
37
|
# Release Notes - v5.3.9
|
|
2
38
|
|
|
3
39
|
**Release Date**: December 29, 2025
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Release Notes - v5.3.4
|
|
2
|
+
|
|
3
|
+
**Release Date**: December 29, 2025
|
|
4
|
+
**Type**: Patch Release
|
|
5
|
+
**Compatibility**: Fully backward compatible with 5.3.x
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🎯 Overview
|
|
10
|
+
|
|
11
|
+
Version 5.3.4 addresses critical bugs in the audit orchestrator that were preventing correct analysis of repository files. This patch ensures that audit options work as intended and provide accurate violation reports.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 🐛 Bug Fixes
|
|
16
|
+
|
|
17
|
+
### Fixed: Audit Option 2 Analyzing Only Staged Files
|
|
18
|
+
|
|
19
|
+
**Issue**: Option 2 (Strict REPO+STAGING) was incorrectly configured with `STAGING_ONLY_MODE=1`, causing it to analyze only staged files instead of the entire repository.
|
|
20
|
+
|
|
21
|
+
**Impact**: Users running full repository audits were only seeing violations from staged files, missing thousands of potential issues in the codebase.
|
|
22
|
+
|
|
23
|
+
**Resolution**:
|
|
24
|
+
- Added `unset STAGING_ONLY_MODE` in `full_audit_strict_repo_and_staging()` function
|
|
25
|
+
- Added `export AUDIT_LIBRARY=true` to include library files in analysis
|
|
26
|
+
- Fixed environment variable propagation to Node.js subprocess
|
|
27
|
+
|
|
28
|
+
**Files Changed**:
|
|
29
|
+
- `scripts/hooks-system/infrastructure/shell/orchestrators/audit-orchestrator.sh`
|
|
30
|
+
|
|
31
|
+
**Verification**:
|
|
32
|
+
```bash
|
|
33
|
+
# Before: Only staged files analyzed
|
|
34
|
+
npm run audit # Option 2 → ~376 files, ~546 violations
|
|
35
|
+
|
|
36
|
+
# After: Full repository analyzed
|
|
37
|
+
npm run audit # Option 2 → All files, correct violation count
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### Fixed: AUDIT_LIBRARY Not Passed to Node.js Process
|
|
43
|
+
|
|
44
|
+
**Issue**: The `AUDIT_LIBRARY` environment variable was set in the shell but not exported to the Node.js subprocess executing `ast-intelligence.js`.
|
|
45
|
+
|
|
46
|
+
**Impact**: When auditing the library itself, files in `scripts/hooks-system/` were being incorrectly filtered out.
|
|
47
|
+
|
|
48
|
+
**Resolution**:
|
|
49
|
+
- Modified `run_ast_intelligence()` to explicitly export `AUDIT_LIBRARY` when spawning Node.js process
|
|
50
|
+
- Ensured variable is available in both execution paths (with and without `NODE_PATH`)
|
|
51
|
+
|
|
52
|
+
**Files Changed**:
|
|
53
|
+
- `scripts/hooks-system/infrastructure/shell/orchestrators/audit-orchestrator.sh` (lines 1014, 1016)
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
### Improved: Staged File Path Matching
|
|
58
|
+
|
|
59
|
+
**Issue**: Violations in staged files were not being correctly matched due to differences between absolute and relative path formats.
|
|
60
|
+
|
|
61
|
+
**Impact**: Staged file summary showed incorrect violation counts.
|
|
62
|
+
|
|
63
|
+
**Resolution**:
|
|
64
|
+
- Enhanced `compute_staged_summary()` to use both relative and absolute paths for matching
|
|
65
|
+
- Implemented more robust path comparison using `endswith()` logic
|
|
66
|
+
- Added `staged-rel.txt` for relative path storage
|
|
67
|
+
|
|
68
|
+
**Files Changed**:
|
|
69
|
+
- `scripts/hooks-system/infrastructure/shell/orchestrators/audit-orchestrator.sh` (lines 337-370)
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 🔧 Improvements
|
|
74
|
+
|
|
75
|
+
### Enhanced Error Messages
|
|
76
|
+
|
|
77
|
+
- Improved informative messages when no AST-compatible files are staged (Option 3)
|
|
78
|
+
- Better debug output for troubleshooting audit issues
|
|
79
|
+
|
|
80
|
+
### Code Quality
|
|
81
|
+
|
|
82
|
+
- Cleaned up debug console.log statements
|
|
83
|
+
- Improved code organization in audit orchestrator
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 📦 Installation
|
|
88
|
+
|
|
89
|
+
### New Installation
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm install --save-dev @pumuki/ast-intelligence-hooks@5.3.4
|
|
93
|
+
npm run install-hooks
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Upgrade from 5.3.3
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
npm install --save-dev @pumuki/ast-intelligence-hooks@5.3.4
|
|
100
|
+
npm run install-hooks # Recommended to update orchestrator scripts
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
See [Migration Guide](./MIGRATION_5.3.4.md) for detailed upgrade instructions.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## ✅ Verification
|
|
108
|
+
|
|
109
|
+
After upgrading, verify the fixes:
|
|
110
|
+
|
|
111
|
+
### Test 1: Full Repository Audit (Option 2)
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npm run audit
|
|
115
|
+
# Select option 2: "Strict REPO+STAGING"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Expected**: Should analyze ALL files in repository, not just staged files.
|
|
119
|
+
|
|
120
|
+
### Test 2: Staging Only Audit (Option 3)
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
git add src/some-file.ts
|
|
124
|
+
npm run audit
|
|
125
|
+
# Select option 3: "Strict STAGING only"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Expected**: Should analyze only staged files and show correct violations.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## 🔄 Breaking Changes
|
|
133
|
+
|
|
134
|
+
**None**. This is a fully backward-compatible patch release.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 📚 Documentation
|
|
139
|
+
|
|
140
|
+
- [CHANGELOG](../CHANGELOG.md)
|
|
141
|
+
- [Migration Guide](./MIGRATION_5.3.4.md)
|
|
142
|
+
- [Installation Guide](./INSTALLATION.md)
|
|
143
|
+
- [API Reference](./API_REFERENCE.md)
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 🙏 Acknowledgments
|
|
148
|
+
|
|
149
|
+
Thanks to all users who reported issues and helped identify these bugs.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 📞 Support
|
|
154
|
+
|
|
155
|
+
- **Issues**: [GitHub Issues](https://github.com/SwiftEnProfundidad/ast-intelligence-hooks/issues)
|
|
156
|
+
- **Discussions**: [GitHub Discussions](https://github.com/SwiftEnProfundidad/ast-intelligence-hooks/discussions)
|
|
157
|
+
- **Email**: freelancemerlos@gmail.com
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## 🚀 What's Next?
|
|
162
|
+
|
|
163
|
+
Stay tuned for upcoming features in future releases:
|
|
164
|
+
- Enhanced violation reporting
|
|
165
|
+
- Performance optimizations
|
|
166
|
+
- Additional platform support
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
**Full Changelog**: [5.3.3...5.3.4](https://github.com/SwiftEnProfundidad/ast-intelligence-hooks/compare/v5.3.3...v5.3.4)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumuki-ast-hooks",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.16",
|
|
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": {
|
|
@@ -39,7 +39,9 @@
|
|
|
39
39
|
"lint": "npm run lint:hooks",
|
|
40
40
|
"lint:hooks": "eslint \"scripts/hooks-system/application/**/*.js\" \"bin/**/*.js\"",
|
|
41
41
|
"build:ts": "tsc --noEmit",
|
|
42
|
-
"typecheck": "tsc --noEmit"
|
|
42
|
+
"typecheck": "tsc --noEmit",
|
|
43
|
+
"ast:refresh": "node scripts/hooks-system/bin/update-evidence.sh",
|
|
44
|
+
"ast:audit": "node scripts/hooks-system/infrastructure/ast/ast-intelligence.js"
|
|
43
45
|
},
|
|
44
46
|
"keywords": [
|
|
45
47
|
"ast",
|