pumuki-ast-hooks 6.1.1 → 6.1.3
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 +4 -4
- package/bin/__tests__/check-version.spec.js +1 -2
- package/docs/API_REFERENCE.md +1 -1
- package/docs/HOW_IT_WORKS.md +1 -1
- package/docs/INSTALLATION.md +18 -18
- package/docs/MIGRATION_5.3.4.md +3 -3
- package/docs/RELEASE_NOTES.md +1 -1
- package/docs/RELEASE_NOTES_5.3.4.md +2 -2
- package/docs/USAGE.md +19 -19
- package/index.js +1 -1
- package/package.json +1 -1
- package/scripts/hooks-system/.audit-reports/auto-recovery.log +5 -0
- package/scripts/hooks-system/.audit-reports/install-wizard.log +20 -0
- package/scripts/hooks-system/.audit_tmp/hook-metrics.jsonl +120 -0
- package/scripts/hooks-system/application/services/evidence/EvidenceContextManager.js +1 -1
- package/scripts/hooks-system/application/services/guard/EvidenceManager.js +1 -2
- package/scripts/hooks-system/application/services/installation/VSCodeTaskConfigurator.js +0 -1
- package/scripts/hooks-system/application/services/monitoring/EvidenceMonitor.js +1 -1
- package/scripts/hooks-system/application/services/monitoring/EvidenceMonitorService.js +1 -1
- package/scripts/hooks-system/application/use-cases/AutoExecuteAIStartUseCase.js +1 -1
- package/scripts/hooks-system/bin/__tests__/check-version.spec.js +5 -14
- package/scripts/hooks-system/bin/__tests__/cli.spec.js +36 -6
- package/scripts/hooks-system/bin/ai-commit.sh +1 -1
- package/scripts/hooks-system/bin/check-version.js +6 -10
- package/scripts/hooks-system/bin/cli.js +10 -9
- package/scripts/hooks-system/bin/demo-recording.sh +1 -1
- package/scripts/hooks-system/bin/guard-env.sh +0 -7
- package/scripts/hooks-system/bin/start-guards.sh +3 -5
- package/scripts/hooks-system/index.js +1 -1
- package/scripts/hooks-system/infrastructure/adapters/FileEvidenceAdapter.js +1 -1
- package/scripts/hooks-system/infrastructure/mcp/ast-intelligence-automation.js +6 -6
- package/scripts/hooks-system/infrastructure/shell/orchestrators/audit-orchestrator.sh +9 -9
- package/scripts/hooks-system/infrastructure/watchdog/__tests__/.audit-reports/token-monitor.log +15 -0
- package/scripts/hooks-system/presentation/cli/audit.sh +2 -2
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Portable, project‑agnostic, multi‑platform enterprise framework to govern AI
|
|
|
16
16
|
## Quick Start (30–60s)
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
npm install --save-dev
|
|
19
|
+
npm install --save-dev pumuki-ast-hooks
|
|
20
20
|
npm run install-hooks
|
|
21
21
|
npx ast-hooks
|
|
22
22
|
```
|
|
@@ -363,7 +363,7 @@ The Git Flow cycle includes branch validation, commits, push, PR, merge (by poli
|
|
|
363
363
|
### Install (dev)
|
|
364
364
|
|
|
365
365
|
```bash
|
|
366
|
-
npm install --save-dev
|
|
366
|
+
npm install --save-dev pumuki-ast-hooks
|
|
367
367
|
```
|
|
368
368
|
|
|
369
369
|
### Legacy install
|
|
@@ -375,14 +375,14 @@ npm install --save-dev pumuki-ast-hooks
|
|
|
375
375
|
### Update
|
|
376
376
|
|
|
377
377
|
```bash
|
|
378
|
-
npm install --save-dev
|
|
378
|
+
npm install --save-dev pumuki-ast-hooks@latest
|
|
379
379
|
npm run install-hooks
|
|
380
380
|
```
|
|
381
381
|
|
|
382
382
|
### Uninstall
|
|
383
383
|
|
|
384
384
|
```bash
|
|
385
|
-
npm uninstall
|
|
385
|
+
npm uninstall pumuki-ast-hooks
|
|
386
386
|
```
|
|
387
387
|
|
|
388
388
|
### Install hooks
|
|
@@ -9,7 +9,7 @@ let originalResolve;
|
|
|
9
9
|
|
|
10
10
|
function makeMockPackageJson(version) {
|
|
11
11
|
return JSON.stringify({
|
|
12
|
-
name: '
|
|
12
|
+
name: 'pumuki-ast-hooks',
|
|
13
13
|
version,
|
|
14
14
|
});
|
|
15
15
|
}
|
|
@@ -44,7 +44,6 @@ describe('check-version', () => {
|
|
|
44
44
|
fsReadSpy.mockReturnValue(makeMockPackageJson(mockVersion));
|
|
45
45
|
require.resolve = (request) => {
|
|
46
46
|
if (
|
|
47
|
-
request === '@pumuki/ast-intelligence-hooks/package.json' ||
|
|
48
47
|
request === 'pumuki-ast-hooks/package.json'
|
|
49
48
|
) {
|
|
50
49
|
return '/tmp/mock/pkg.json';
|
package/docs/API_REFERENCE.md
CHANGED
|
@@ -83,7 +83,7 @@ Located in `infrastructure/guards/`:
|
|
|
83
83
|
## Architecture
|
|
84
84
|
|
|
85
85
|
```
|
|
86
|
-
node_modules
|
|
86
|
+
node_modules/pumuki-ast-hooks/
|
|
87
87
|
├── application/ # Business logic (Use Cases, Services)
|
|
88
88
|
├── domain/ # Core entities (SeverityConfig, etc.)
|
|
89
89
|
├── infrastructure/ # Technical implementations
|
package/docs/HOW_IT_WORKS.md
CHANGED
|
@@ -225,7 +225,7 @@ Rules are used by `ai-start` when generating `.AI_EVIDENCE.json` to provide cont
|
|
|
225
225
|
```bash
|
|
226
226
|
#!/bin/bash
|
|
227
227
|
# AST Intelligence Hooks - Pre-commit
|
|
228
|
-
# Auto-generated by
|
|
228
|
+
# Auto-generated by pumuki-ast-hooks v5.3.1
|
|
229
229
|
|
|
230
230
|
# Check for bypass
|
|
231
231
|
if [[ -n "${GIT_BYPASS_HOOK}" ]]; then
|
package/docs/INSTALLATION.md
CHANGED
|
@@ -85,7 +85,7 @@ The installer will detect if Git is missing and show a clear warning:
|
|
|
85
85
|
|
|
86
86
|
```bash
|
|
87
87
|
# Install as development dependency
|
|
88
|
-
npm install --save-dev
|
|
88
|
+
npm install --save-dev pumuki-ast-hooks
|
|
89
89
|
|
|
90
90
|
# Configure hooks
|
|
91
91
|
npm run install-hooks
|
|
@@ -95,7 +95,7 @@ npm run install-hooks
|
|
|
95
95
|
|
|
96
96
|
```bash
|
|
97
97
|
# Install globally
|
|
98
|
-
npm install -g
|
|
98
|
+
npm install -g pumuki-ast-hooks
|
|
99
99
|
|
|
100
100
|
# In each project, install hooks
|
|
101
101
|
cd /path/to/project
|
|
@@ -123,7 +123,7 @@ npm link
|
|
|
123
123
|
|
|
124
124
|
# In your project
|
|
125
125
|
cd /path/to/your-project
|
|
126
|
-
npm link
|
|
126
|
+
npm link pumuki-ast-hooks
|
|
127
127
|
npm run install-hooks
|
|
128
128
|
```
|
|
129
129
|
|
|
@@ -141,7 +141,7 @@ npm install
|
|
|
141
141
|
npm link
|
|
142
142
|
|
|
143
143
|
# In the root project
|
|
144
|
-
npm link
|
|
144
|
+
npm link pumuki-ast-hooks
|
|
145
145
|
npm run install-hooks
|
|
146
146
|
```
|
|
147
147
|
|
|
@@ -231,7 +231,7 @@ cat > .cursor/mcp.json << 'EOF'
|
|
|
231
231
|
"ai-evidence-watcher": {
|
|
232
232
|
"command": "node",
|
|
233
233
|
"args": [
|
|
234
|
-
"${workspaceFolder}/node_modules
|
|
234
|
+
"${workspaceFolder}/node_modules/pumuki-ast-hooks/infrastructure/mcp/evidence-watcher.js"
|
|
235
235
|
],
|
|
236
236
|
"env": {
|
|
237
237
|
"REPO_ROOT": "${workspaceFolder}"
|
|
@@ -349,10 +349,10 @@ The library provides templates for project-specific configurations in `templates
|
|
|
349
349
|
|
|
350
350
|
```bash
|
|
351
351
|
# Copy templates to your project's config directory
|
|
352
|
-
cp node_modules
|
|
352
|
+
cp node_modules/pumuki-ast-hooks/templates/config/paths.conf.template \
|
|
353
353
|
scripts/hooks-system/config/paths.conf
|
|
354
354
|
|
|
355
|
-
cp node_modules
|
|
355
|
+
cp node_modules/pumuki-ast-hooks/templates/config/rules.json.template \
|
|
356
356
|
scripts/hooks-system/config/rules.json
|
|
357
357
|
|
|
358
358
|
# Then customize as needed
|
|
@@ -385,7 +385,7 @@ Create or edit `config/ast-exclusions.json`:
|
|
|
385
385
|
|
|
386
386
|
```bash
|
|
387
387
|
# Verify it's installed
|
|
388
|
-
npm list
|
|
388
|
+
npm list pumuki-ast-hooks
|
|
389
389
|
|
|
390
390
|
# View version
|
|
391
391
|
ast-hooks --version
|
|
@@ -442,11 +442,11 @@ git commit -m "test: verify hooks installation"
|
|
|
442
442
|
|
|
443
443
|
```bash
|
|
444
444
|
# Give execution permissions
|
|
445
|
-
chmod +x node_modules
|
|
445
|
+
chmod +x node_modules/pumuki-ast-hooks/bin/*
|
|
446
446
|
|
|
447
447
|
# Or reinstall
|
|
448
|
-
npm uninstall
|
|
449
|
-
npm install --save-dev
|
|
448
|
+
npm uninstall pumuki-ast-hooks
|
|
449
|
+
npm install --save-dev pumuki-ast-hooks
|
|
450
450
|
```
|
|
451
451
|
|
|
452
452
|
#### Problem: SourceKitten Not Found
|
|
@@ -566,7 +566,7 @@ monorepo/
|
|
|
566
566
|
|
|
567
567
|
```bash
|
|
568
568
|
# At monorepo root
|
|
569
|
-
npm install --save-dev
|
|
569
|
+
npm install --save-dev pumuki-ast-hooks
|
|
570
570
|
|
|
571
571
|
# Configure hooks (will run on entire root)
|
|
572
572
|
npm run install-hooks
|
|
@@ -619,7 +619,7 @@ Checking latest version on npm...
|
|
|
619
619
|
|
|
620
620
|
To update:
|
|
621
621
|
1. Update package:
|
|
622
|
-
npm install --save-dev
|
|
622
|
+
npm install --save-dev pumuki-ast-hooks@latest
|
|
623
623
|
|
|
624
624
|
2. Re-install hooks (to get latest features):
|
|
625
625
|
npm run install-hooks
|
|
@@ -636,10 +636,10 @@ When a new version is available:
|
|
|
636
636
|
|
|
637
637
|
```bash
|
|
638
638
|
# Update to latest version
|
|
639
|
-
npm install --save-dev
|
|
639
|
+
npm install --save-dev pumuki-ast-hooks@latest
|
|
640
640
|
|
|
641
641
|
# Or update to specific version
|
|
642
|
-
npm install --save-dev
|
|
642
|
+
npm install --save-dev pumuki-ast-hooks@5.3.1
|
|
643
643
|
```
|
|
644
644
|
|
|
645
645
|
#### Step 2: Re-install Hooks
|
|
@@ -727,10 +727,10 @@ If you prefer manual checking:
|
|
|
727
727
|
|
|
728
728
|
```bash
|
|
729
729
|
# View installed version
|
|
730
|
-
npm list
|
|
730
|
+
npm list pumuki-ast-hooks
|
|
731
731
|
|
|
732
732
|
# View latest available version
|
|
733
|
-
npm view
|
|
733
|
+
npm view pumuki-ast-hooks version
|
|
734
734
|
```
|
|
735
735
|
|
|
736
736
|
---
|
|
@@ -741,7 +741,7 @@ npm view @pumuki/ast-intelligence-hooks version
|
|
|
741
741
|
|
|
742
742
|
```bash
|
|
743
743
|
# Uninstall
|
|
744
|
-
npm uninstall
|
|
744
|
+
npm uninstall pumuki-ast-hooks
|
|
745
745
|
|
|
746
746
|
# Remove hooks (optional)
|
|
747
747
|
rm .git/hooks/pre-commit
|
package/docs/MIGRATION_5.3.4.md
CHANGED
|
@@ -30,7 +30,7 @@ Version 5.3.4 is a **patch release** that fixes critical bugs in the audit orche
|
|
|
30
30
|
### Step 1: Update the Package
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
npm install
|
|
33
|
+
npm install pumuki-ast-hooks@5.3.4
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
### Step 2: Reinstall Hooks (Recommended)
|
|
@@ -98,7 +98,7 @@ None reported for 5.3.4.
|
|
|
98
98
|
If you need to rollback to 5.3.3:
|
|
99
99
|
|
|
100
100
|
```bash
|
|
101
|
-
npm install
|
|
101
|
+
npm install pumuki-ast-hooks@5.3.3
|
|
102
102
|
npm run install-hooks
|
|
103
103
|
```
|
|
104
104
|
|
|
@@ -118,4 +118,4 @@ After upgrading, we recommend:
|
|
|
118
118
|
|
|
119
119
|
---
|
|
120
120
|
|
|
121
|
-
**Thank you for using
|
|
121
|
+
**Thank you for using pumuki-ast-hooks!** 🚀
|
package/docs/RELEASE_NOTES.md
CHANGED
|
@@ -503,7 +503,7 @@ Version 5.3.9 refines installer version resolution and removes silent `catch` bl
|
|
|
503
503
|
- **Impact**: Wizard and pre-commit now show the correct version.
|
|
504
504
|
|
|
505
505
|
### Fixed: Hooks showing old version
|
|
506
|
-
- **Issue**: Pre-commit displayed
|
|
506
|
+
- **Issue**: Pre-commit displayed `pumuki-ast-hooks v5.3.1`.
|
|
507
507
|
- **Resolution**: `GitEnvironmentService` receives the resolved version and uses it in the hook.
|
|
508
508
|
- **Impact**: Hook reflects the actual installed version (`pumuki-ast-hooks`).
|
|
509
509
|
|
|
@@ -89,14 +89,14 @@ npm run audit # Option 2 → All files, correct violation count
|
|
|
89
89
|
### New Installation
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
|
-
npm install --save-dev
|
|
92
|
+
npm install --save-dev pumuki-ast-hooks@5.3.4
|
|
93
93
|
npm run install-hooks
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
### Upgrade from 5.3.3
|
|
97
97
|
|
|
98
98
|
```bash
|
|
99
|
-
npm install --save-dev
|
|
99
|
+
npm install --save-dev pumuki-ast-hooks@5.3.4
|
|
100
100
|
npm run install-hooks # Recommended to update orchestrator scripts
|
|
101
101
|
```
|
|
102
102
|
|
package/docs/USAGE.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
### Step 1: Install
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
npm install --save-dev
|
|
27
|
+
npm install --save-dev pumuki-ast-hooks
|
|
28
28
|
npm run install-hooks
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -105,7 +105,7 @@ The library includes an **interactive menu** for selecting audit options:
|
|
|
105
105
|
```bash
|
|
106
106
|
# Run interactive menu (recommended for manual audits)
|
|
107
107
|
# From node_modules (when installed via npm):
|
|
108
|
-
bash node_modules
|
|
108
|
+
bash node_modules/pumuki-ast-hooks/presentation/cli/audit.sh
|
|
109
109
|
|
|
110
110
|
# Or from scripts/hooks-system (local development):
|
|
111
111
|
bash scripts/hooks-system/presentation/cli/audit.sh
|
|
@@ -128,8 +128,8 @@ npx audit
|
|
|
128
128
|
**Non-interactive mode:**
|
|
129
129
|
```bash
|
|
130
130
|
# Execute specific option directly (from node_modules):
|
|
131
|
-
AUDIT_OPTION=7 bash node_modules
|
|
132
|
-
AUDIT_OPTION=3 bash node_modules
|
|
131
|
+
AUDIT_OPTION=7 bash node_modules/pumuki-ast-hooks/presentation/cli/audit.sh # AST Intelligence
|
|
132
|
+
AUDIT_OPTION=3 bash node_modules/pumuki-ast-hooks/presentation/cli/audit.sh # Staged files only
|
|
133
133
|
|
|
134
134
|
# Or from scripts/hooks-system:
|
|
135
135
|
AUDIT_OPTION=7 bash scripts/hooks-system/presentation/cli/audit.sh # AST Intelligence
|
|
@@ -372,7 +372,7 @@ chmod +x .git/hooks/post-commit
|
|
|
372
372
|
### Basic Example
|
|
373
373
|
|
|
374
374
|
```javascript
|
|
375
|
-
const { runASTIntelligence } = require('
|
|
375
|
+
const { runASTIntelligence } = require('pumuki-ast-hooks');
|
|
376
376
|
|
|
377
377
|
async function analyzeCode() {
|
|
378
378
|
const result = await runASTIntelligence({
|
|
@@ -401,9 +401,9 @@ analyzeCode().catch(console.error);
|
|
|
401
401
|
### Use Use Cases Directly
|
|
402
402
|
|
|
403
403
|
```javascript
|
|
404
|
-
const { AnalyzeStagedFilesUseCase } = require('
|
|
405
|
-
const { FileFindingsRepository } = require('
|
|
406
|
-
const { PlatformDetectionService } = require('
|
|
404
|
+
const { AnalyzeStagedFilesUseCase } = require('pumuki-ast-hooks');
|
|
405
|
+
const { FileFindingsRepository } = require('pumuki-ast-hooks/infrastructure/repositories');
|
|
406
|
+
const { PlatformDetectionService } = require('pumuki-ast-hooks/application/services');
|
|
407
407
|
|
|
408
408
|
// Create use case instance
|
|
409
409
|
const repository = new FileFindingsRepository();
|
|
@@ -426,7 +426,7 @@ async function analyzeStaged() {
|
|
|
426
426
|
### Custom Analysis
|
|
427
427
|
|
|
428
428
|
```javascript
|
|
429
|
-
const { runBackendIntelligence } = require('
|
|
429
|
+
const { runBackendIntelligence } = require('pumuki-ast-hooks');
|
|
430
430
|
const glob = require('glob');
|
|
431
431
|
|
|
432
432
|
// Analyze only specific files
|
|
@@ -448,7 +448,7 @@ findings.forEach(finding => {
|
|
|
448
448
|
### Filter Violations
|
|
449
449
|
|
|
450
450
|
```javascript
|
|
451
|
-
const { AuditResult } = require('
|
|
451
|
+
const { AuditResult } = require('pumuki-ast-hooks');
|
|
452
452
|
|
|
453
453
|
// Get only HIGH and CRITICAL violations
|
|
454
454
|
const criticalAndHigh = result.getFindings().filter(f => {
|
|
@@ -474,7 +474,7 @@ result.getFindings().forEach(finding => {
|
|
|
474
474
|
### Example 1: Webhook Integration
|
|
475
475
|
|
|
476
476
|
```javascript
|
|
477
|
-
const { runASTIntelligence } = require('
|
|
477
|
+
const { runASTIntelligence } = require('pumuki-ast-hooks');
|
|
478
478
|
const express = require('express');
|
|
479
479
|
|
|
480
480
|
const app = express();
|
|
@@ -506,7 +506,7 @@ app.listen(3000);
|
|
|
506
506
|
### Example 2: Custom Report
|
|
507
507
|
|
|
508
508
|
```javascript
|
|
509
|
-
const { runASTIntelligence } = require('
|
|
509
|
+
const { runASTIntelligence } = require('pumuki-ast-hooks');
|
|
510
510
|
const fs = require('fs');
|
|
511
511
|
|
|
512
512
|
async function generateCustomReport() {
|
|
@@ -563,7 +563,7 @@ generateCustomReport();
|
|
|
563
563
|
### Example 3: Incremental Analysis
|
|
564
564
|
|
|
565
565
|
```javascript
|
|
566
|
-
const { AnalyzeStagedFilesUseCase } = require('
|
|
566
|
+
const { AnalyzeStagedFilesUseCase } = require('pumuki-ast-hooks');
|
|
567
567
|
const { execSync } = require('child_process');
|
|
568
568
|
|
|
569
569
|
// Get only staged files
|
|
@@ -601,7 +601,7 @@ async function analyzeStagedOnly() {
|
|
|
601
601
|
### Example 4: Notification Integration
|
|
602
602
|
|
|
603
603
|
```javascript
|
|
604
|
-
const { runASTIntelligence } = require('
|
|
604
|
+
const { runASTIntelligence } = require('pumuki-ast-hooks');
|
|
605
605
|
const { NotificationAdapter } = require('./notification-adapter');
|
|
606
606
|
|
|
607
607
|
async function analyzeAndNotify() {
|
|
@@ -653,7 +653,7 @@ jobs:
|
|
|
653
653
|
run: npm ci
|
|
654
654
|
|
|
655
655
|
- name: Install AST Intelligence Hooks
|
|
656
|
-
run: npm install --save-dev
|
|
656
|
+
run: npm install --save-dev pumuki-ast-hooks
|
|
657
657
|
|
|
658
658
|
- name: Run AST Analysis
|
|
659
659
|
run: npm run audit
|
|
@@ -676,7 +676,7 @@ ast_analysis:
|
|
|
676
676
|
|
|
677
677
|
script:
|
|
678
678
|
- npm ci
|
|
679
|
-
- npm install --save-dev
|
|
679
|
+
- npm install --save-dev pumuki-ast-hooks
|
|
680
680
|
- npm run audit || true
|
|
681
681
|
- npm run violations:summary > violations-summary.txt
|
|
682
682
|
|
|
@@ -698,7 +698,7 @@ pipeline {
|
|
|
698
698
|
stage('AST Analysis') {
|
|
699
699
|
steps {
|
|
700
700
|
sh 'npm ci'
|
|
701
|
-
sh 'npm install --save-dev
|
|
701
|
+
sh 'npm install --save-dev pumuki-ast-hooks'
|
|
702
702
|
sh 'npm run audit || true'
|
|
703
703
|
archiveArtifacts artifacts: '.audit-reports/**', fingerprint: true
|
|
704
704
|
}
|
|
@@ -729,7 +729,7 @@ jobs:
|
|
|
729
729
|
steps:
|
|
730
730
|
- checkout
|
|
731
731
|
- run: npm ci
|
|
732
|
-
- run: npm install --save-dev
|
|
732
|
+
- run: npm install --save-dev pumuki-ast-hooks
|
|
733
733
|
- run: npm run audit || true
|
|
734
734
|
- store_artifacts:
|
|
735
735
|
path: .audit-reports
|
|
@@ -857,7 +857,7 @@ Edit `config/language-guard.json`:
|
|
|
857
857
|
|
|
858
858
|
```javascript
|
|
859
859
|
// In your custom code
|
|
860
|
-
const { CommitBlockingRules } = require('
|
|
860
|
+
const { CommitBlockingRules } = require('pumuki-ast-hooks');
|
|
861
861
|
|
|
862
862
|
// Extend blocking rules
|
|
863
863
|
class CustomCommitBlockingRules extends CommitBlockingRules {
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumuki-ast-hooks",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.3",
|
|
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": {
|
|
@@ -30,3 +30,8 @@
|
|
|
30
30
|
{"timestamp":"2026-01-13T17:21:43.217Z","level":"info","component":"AutoRecovery","event":"NotificationCenterService shutdown","data":{"totalEnqueued":0,"totalSent":0,"totalDeduplicated":0,"totalCooldownSkipped":0,"totalFailed":0,"totalRetries":0,"queueSize":0,"deduplication":{"size":0},"cooldowns":{"activeCooldowns":0}},"context":{}}
|
|
31
31
|
{"timestamp":"2026-01-13T17:53:22.925Z","level":"info","component":"AutoRecovery","event":"NotificationCenterService shutdown","data":{"totalEnqueued":0,"totalSent":0,"totalDeduplicated":0,"totalCooldownSkipped":0,"totalFailed":0,"totalRetries":0,"queueSize":0,"deduplication":{"size":0},"cooldowns":{"activeCooldowns":0}},"context":{}}
|
|
32
32
|
{"timestamp":"2026-01-13T17:54:11.574Z","level":"info","component":"AutoRecovery","event":"NotificationCenterService shutdown","data":{"totalEnqueued":0,"totalSent":0,"totalDeduplicated":0,"totalCooldownSkipped":0,"totalFailed":0,"totalRetries":0,"queueSize":0,"deduplication":{"size":0},"cooldowns":{"activeCooldowns":0}},"context":{}}
|
|
33
|
+
{"timestamp":"2026-01-14T07:11:01.436Z","level":"info","component":"AutoRecovery","event":"NotificationCenterService shutdown","data":{"totalEnqueued":0,"totalSent":0,"totalDeduplicated":0,"totalCooldownSkipped":0,"totalFailed":0,"totalRetries":0,"queueSize":0,"deduplication":{"size":0},"cooldowns":{"activeCooldowns":0}},"context":{}}
|
|
34
|
+
{"timestamp":"2026-01-14T07:32:52.204Z","level":"info","component":"AutoRecovery","event":"NotificationCenterService shutdown","data":{"totalEnqueued":0,"totalSent":0,"totalDeduplicated":0,"totalCooldownSkipped":0,"totalFailed":0,"totalRetries":0,"queueSize":0,"deduplication":{"size":0},"cooldowns":{"activeCooldowns":0}},"context":{}}
|
|
35
|
+
{"timestamp":"2026-01-14T10:52:05.241Z","level":"info","component":"AutoRecovery","event":"NotificationCenterService shutdown","data":{"totalEnqueued":0,"totalSent":0,"totalDeduplicated":0,"totalCooldownSkipped":0,"totalFailed":0,"totalRetries":0,"queueSize":0,"deduplication":{"size":0},"cooldowns":{"activeCooldowns":0}},"context":{}}
|
|
36
|
+
{"timestamp":"2026-01-14T10:53:08.625Z","level":"info","component":"AutoRecovery","event":"NotificationCenterService shutdown","data":{"totalEnqueued":0,"totalSent":0,"totalDeduplicated":0,"totalCooldownSkipped":0,"totalFailed":0,"totalRetries":0,"queueSize":0,"deduplication":{"size":0},"cooldowns":{"activeCooldowns":0}},"context":{}}
|
|
37
|
+
{"timestamp":"2026-01-14T10:53:45.774Z","level":"info","component":"AutoRecovery","event":"NotificationCenterService shutdown","data":{"totalEnqueued":0,"totalSent":0,"totalDeduplicated":0,"totalCooldownSkipped":0,"totalFailed":0,"totalRetries":0,"queueSize":0,"deduplication":{"size":0},"cooldowns":{"activeCooldowns":0}},"context":{}}
|
|
@@ -130,3 +130,23 @@
|
|
|
130
130
|
{"timestamp":"2026-01-13T17:54:11.678Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_CONFIG_EXISTS","data":{"configPath":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/.hook-system/config.json"},"context":{}}
|
|
131
131
|
{"timestamp":"2026-01-13T17:54:11.678Z","level":"error","component":"InstallWizard","event":"INSTALL_WIZARD_SYMLINK_FAILED","data":{"error":"EEXIST: file already exists, symlink '/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/scripts/hooks-system/bin/guard-supervisor.js' -> '/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/.git/hooks/guard-supervisor'"},"context":{}}
|
|
132
132
|
{"timestamp":"2026-01-13T17:54:11.679Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_COMPLETED","data":{},"context":{}}
|
|
133
|
+
{"timestamp":"2026-01-14T07:11:01.498Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_START","data":{"repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"},"context":{}}
|
|
134
|
+
{"timestamp":"2026-01-14T07:11:01.506Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_CONFIG_EXISTS","data":{"configPath":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/.hook-system/config.json"},"context":{}}
|
|
135
|
+
{"timestamp":"2026-01-14T07:11:01.506Z","level":"error","component":"InstallWizard","event":"INSTALL_WIZARD_SYMLINK_FAILED","data":{"error":"EEXIST: file already exists, symlink '/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/scripts/hooks-system/bin/guard-supervisor.js' -> '/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/.git/hooks/guard-supervisor'"},"context":{}}
|
|
136
|
+
{"timestamp":"2026-01-14T07:11:01.506Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_COMPLETED","data":{},"context":{}}
|
|
137
|
+
{"timestamp":"2026-01-14T07:32:52.276Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_START","data":{"repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"},"context":{}}
|
|
138
|
+
{"timestamp":"2026-01-14T07:32:52.286Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_CONFIG_EXISTS","data":{"configPath":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/.hook-system/config.json"},"context":{}}
|
|
139
|
+
{"timestamp":"2026-01-14T07:32:52.287Z","level":"error","component":"InstallWizard","event":"INSTALL_WIZARD_SYMLINK_FAILED","data":{"error":"EEXIST: file already exists, symlink '/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/scripts/hooks-system/bin/guard-supervisor.js' -> '/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/.git/hooks/guard-supervisor'"},"context":{}}
|
|
140
|
+
{"timestamp":"2026-01-14T07:32:52.287Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_COMPLETED","data":{},"context":{}}
|
|
141
|
+
{"timestamp":"2026-01-14T10:52:05.384Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_START","data":{"repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"},"context":{}}
|
|
142
|
+
{"timestamp":"2026-01-14T10:52:05.395Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_CONFIG_EXISTS","data":{"configPath":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/.hook-system/config.json"},"context":{}}
|
|
143
|
+
{"timestamp":"2026-01-14T10:52:05.395Z","level":"error","component":"InstallWizard","event":"INSTALL_WIZARD_SYMLINK_FAILED","data":{"error":"EEXIST: file already exists, symlink '/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/scripts/hooks-system/bin/guard-supervisor.js' -> '/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/.git/hooks/guard-supervisor'"},"context":{}}
|
|
144
|
+
{"timestamp":"2026-01-14T10:52:05.395Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_COMPLETED","data":{},"context":{}}
|
|
145
|
+
{"timestamp":"2026-01-14T10:53:08.774Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_START","data":{"repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"},"context":{}}
|
|
146
|
+
{"timestamp":"2026-01-14T10:53:08.783Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_CONFIG_EXISTS","data":{"configPath":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/.hook-system/config.json"},"context":{}}
|
|
147
|
+
{"timestamp":"2026-01-14T10:53:08.783Z","level":"error","component":"InstallWizard","event":"INSTALL_WIZARD_SYMLINK_FAILED","data":{"error":"EEXIST: file already exists, symlink '/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/scripts/hooks-system/bin/guard-supervisor.js' -> '/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/.git/hooks/guard-supervisor'"},"context":{}}
|
|
148
|
+
{"timestamp":"2026-01-14T10:53:08.783Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_COMPLETED","data":{},"context":{}}
|
|
149
|
+
{"timestamp":"2026-01-14T10:53:45.930Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_START","data":{"repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"},"context":{}}
|
|
150
|
+
{"timestamp":"2026-01-14T10:53:45.937Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_CONFIG_EXISTS","data":{"configPath":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/.hook-system/config.json"},"context":{}}
|
|
151
|
+
{"timestamp":"2026-01-14T10:53:45.939Z","level":"error","component":"InstallWizard","event":"INSTALL_WIZARD_SYMLINK_FAILED","data":{"error":"EEXIST: file already exists, symlink '/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/scripts/hooks-system/bin/guard-supervisor.js' -> '/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system/.git/hooks/guard-supervisor'"},"context":{}}
|
|
152
|
+
{"timestamp":"2026-01-14T10:53:45.939Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_COMPLETED","data":{},"context":{}}
|
|
@@ -1034,3 +1034,123 @@
|
|
|
1034
1034
|
{"timestamp":1768326851574,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1035
1035
|
{"timestamp":1768326851574,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1036
1036
|
{"timestamp":1768326851574,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1037
|
+
{"timestamp":1768374661434,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1038
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1039
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1040
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1041
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1042
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1043
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1044
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1045
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1046
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1047
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1048
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1049
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1050
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1051
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1052
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1053
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1054
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1055
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1056
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1057
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1058
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1059
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1060
|
+
{"timestamp":1768374661435,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1061
|
+
{"timestamp":1768375972202,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1062
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1063
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1064
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1065
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1066
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1067
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1068
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1069
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1070
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1071
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1072
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1073
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1074
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1075
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1076
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1077
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1078
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1079
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1080
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1081
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1082
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1083
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1084
|
+
{"timestamp":1768375972203,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1085
|
+
{"timestamp":1768387925238,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1086
|
+
{"timestamp":1768387925240,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1087
|
+
{"timestamp":1768387925240,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1088
|
+
{"timestamp":1768387925240,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1089
|
+
{"timestamp":1768387925240,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1090
|
+
{"timestamp":1768387925240,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1091
|
+
{"timestamp":1768387925240,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1092
|
+
{"timestamp":1768387925240,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1093
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1094
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1095
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1096
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1097
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1098
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1099
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1100
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1101
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1102
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1103
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1104
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1105
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1106
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1107
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1108
|
+
{"timestamp":1768387925241,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1109
|
+
{"timestamp":1768387988623,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1110
|
+
{"timestamp":1768387988624,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1111
|
+
{"timestamp":1768387988624,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1112
|
+
{"timestamp":1768387988624,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1113
|
+
{"timestamp":1768387988624,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1114
|
+
{"timestamp":1768387988624,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1115
|
+
{"timestamp":1768387988624,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1116
|
+
{"timestamp":1768387988624,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1117
|
+
{"timestamp":1768387988624,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1118
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1119
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1120
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1121
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1122
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1123
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1124
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1125
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1126
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1127
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1128
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1129
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1130
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1131
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1132
|
+
{"timestamp":1768387988625,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1133
|
+
{"timestamp":1768388025771,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1134
|
+
{"timestamp":1768388025772,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1135
|
+
{"timestamp":1768388025772,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1136
|
+
{"timestamp":1768388025773,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1137
|
+
{"timestamp":1768388025773,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1138
|
+
{"timestamp":1768388025773,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1139
|
+
{"timestamp":1768388025773,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1140
|
+
{"timestamp":1768388025773,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1141
|
+
{"timestamp":1768388025773,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1142
|
+
{"timestamp":1768388025773,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1143
|
+
{"timestamp":1768388025773,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1144
|
+
{"timestamp":1768388025773,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1145
|
+
{"timestamp":1768388025773,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1146
|
+
{"timestamp":1768388025773,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1147
|
+
{"timestamp":1768388025773,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1148
|
+
{"timestamp":1768388025774,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1149
|
+
{"timestamp":1768388025774,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1150
|
+
{"timestamp":1768388025774,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1151
|
+
{"timestamp":1768388025774,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1152
|
+
{"timestamp":1768388025774,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1153
|
+
{"timestamp":1768388025774,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
1154
|
+
{"timestamp":1768388025774,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
1155
|
+
{"timestamp":1768388025774,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
1156
|
+
{"timestamp":1768388025774,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
@@ -9,7 +9,7 @@ const DEFAULT_PLATFORMS = ['1', '2', '3', '4'];
|
|
|
9
9
|
function resolveUpdateEvidenceScript(repoRoot) {
|
|
10
10
|
const candidates = [
|
|
11
11
|
path.join(repoRoot, 'scripts/hooks-system/bin/update-evidence.sh'),
|
|
12
|
-
path.join(repoRoot, 'node_modules
|
|
12
|
+
path.join(repoRoot, 'node_modules/pumuki-ast-hooks/bin/update-evidence.sh'),
|
|
13
13
|
path.join(repoRoot, 'bin/update-evidence.sh')
|
|
14
14
|
];
|
|
15
15
|
|
|
@@ -135,7 +135,7 @@ class EvidenceManager {
|
|
|
135
135
|
|
|
136
136
|
const updateScriptCandidates = [
|
|
137
137
|
path.join(process.cwd(), 'scripts/hooks-system/bin/update-evidence.sh'),
|
|
138
|
-
path.join(process.cwd(), 'node_modules
|
|
138
|
+
path.join(process.cwd(), 'node_modules/pumuki-ast-hooks/bin/update-evidence.sh'),
|
|
139
139
|
path.join(process.cwd(), 'bin/update-evidence.sh')
|
|
140
140
|
];
|
|
141
141
|
|
|
@@ -171,7 +171,6 @@ class EvidenceManager {
|
|
|
171
171
|
async runDirectEvidenceRefresh(_reason) {
|
|
172
172
|
const updateScriptCandidates = [
|
|
173
173
|
path.join(process.cwd(), 'scripts/hooks-system/bin/update-evidence.sh'),
|
|
174
|
-
path.join(process.cwd(), 'node_modules/@pumuki/ast-intelligence-hooks/scripts/hooks-system/bin/update-evidence.sh'),
|
|
175
174
|
path.join(process.cwd(), 'node_modules/pumuki-ast-hooks/scripts/hooks-system/bin/update-evidence.sh')
|
|
176
175
|
];
|
|
177
176
|
|
|
@@ -63,7 +63,6 @@ class VSCodeTaskConfigurator {
|
|
|
63
63
|
[
|
|
64
64
|
'bash "${workspaceFolder}/scripts/hooks-system/bin/session-loader.sh"',
|
|
65
65
|
'|| bash "${workspaceFolder}/node_modules/pumuki-ast-hooks/scripts/hooks-system/bin/session-loader.sh"',
|
|
66
|
-
'|| bash "${workspaceFolder}/node_modules/@pumuki/ast-intelligence-hooks/bin/session-loader.sh"',
|
|
67
66
|
'|| (echo "AST Session Loader not found." >&2; exit 127)'
|
|
68
67
|
].join(' ')
|
|
69
68
|
],
|
|
@@ -94,7 +94,7 @@ class EvidenceMonitor {
|
|
|
94
94
|
|
|
95
95
|
resolveUpdateEvidenceScript() {
|
|
96
96
|
const candidates = [
|
|
97
|
-
path.join(this.repoRoot, 'node_modules
|
|
97
|
+
path.join(this.repoRoot, 'node_modules/pumuki-ast-hooks/bin/update-evidence.sh'),
|
|
98
98
|
path.join(this.repoRoot, 'scripts/hooks-system/bin/update-evidence.sh'),
|
|
99
99
|
path.join(this.repoRoot, 'bin/update-evidence.sh')
|
|
100
100
|
];
|
|
@@ -7,7 +7,7 @@ const AuditLogger = require('../logging/AuditLogger');
|
|
|
7
7
|
function resolveUpdateEvidenceScript(repoRoot) {
|
|
8
8
|
const candidates = [
|
|
9
9
|
path.join(repoRoot, 'scripts/hooks-system/bin/update-evidence.sh'),
|
|
10
|
-
path.join(repoRoot, 'node_modules
|
|
10
|
+
path.join(repoRoot, 'node_modules/pumuki-ast-hooks/bin/update-evidence.sh'),
|
|
11
11
|
path.join(repoRoot, 'bin/update-evidence.sh')
|
|
12
12
|
];
|
|
13
13
|
|
|
@@ -6,7 +6,7 @@ const AuditLogger = require('../../application/services/logging/AuditLogger');
|
|
|
6
6
|
function resolveUpdateEvidenceScript(repoRoot) {
|
|
7
7
|
const candidates = [
|
|
8
8
|
path.join(repoRoot, 'scripts/hooks-system/bin/update-evidence.sh'),
|
|
9
|
-
path.join(repoRoot, 'node_modules
|
|
9
|
+
path.join(repoRoot, 'node_modules/pumuki-ast-hooks/bin/update-evidence.sh'),
|
|
10
10
|
path.join(repoRoot, 'bin/update-evidence.sh')
|
|
11
11
|
];
|
|
12
12
|
|
|
@@ -9,7 +9,7 @@ let originalResolve;
|
|
|
9
9
|
|
|
10
10
|
function makeMockPackageJson(version) {
|
|
11
11
|
return JSON.stringify({
|
|
12
|
-
name: '
|
|
12
|
+
name: 'pumuki-ast-hooks',
|
|
13
13
|
version,
|
|
14
14
|
});
|
|
15
15
|
}
|
|
@@ -31,10 +31,7 @@ describe('check-version', () => {
|
|
|
31
31
|
if (request === 'babel.config.js' || request === 'babel.config.cjs') {
|
|
32
32
|
return path.join(process.cwd(), 'babel.config.js');
|
|
33
33
|
}
|
|
34
|
-
if (
|
|
35
|
-
request === '@pumuki/ast-intelligence-hooks/package.json' ||
|
|
36
|
-
request === 'pumuki-ast-hooks/package.json'
|
|
37
|
-
) {
|
|
34
|
+
if (request === 'pumuki-ast-hooks/package.json') {
|
|
38
35
|
return path.join(process.cwd(), request);
|
|
39
36
|
}
|
|
40
37
|
return originalResolve(request);
|
|
@@ -55,10 +52,7 @@ describe('check-version', () => {
|
|
|
55
52
|
fsExistsSpy.mockReturnValue(true);
|
|
56
53
|
fsReadSpy.mockReturnValue(makeMockPackageJson(mockVersion));
|
|
57
54
|
require.resolve = (request) => {
|
|
58
|
-
if (
|
|
59
|
-
request === '@pumuki/ast-intelligence-hooks/package.json' ||
|
|
60
|
-
request === 'pumuki-ast-hooks/package.json'
|
|
61
|
-
) {
|
|
55
|
+
if (request === 'pumuki-ast-hooks/package.json') {
|
|
62
56
|
return '/tmp/mock/pkg.json';
|
|
63
57
|
}
|
|
64
58
|
return originalResolve(request);
|
|
@@ -77,10 +71,7 @@ describe('check-version', () => {
|
|
|
77
71
|
});
|
|
78
72
|
fsReadSpy.mockReturnValue(makeMockPackageJson('5.3.1'));
|
|
79
73
|
require.resolve = (request) => {
|
|
80
|
-
if (
|
|
81
|
-
request === '@pumuki/ast-intelligence-hooks/package.json' ||
|
|
82
|
-
request === 'pumuki-ast-hooks/package.json'
|
|
83
|
-
) {
|
|
74
|
+
if (request === 'pumuki-ast-hooks/package.json') {
|
|
84
75
|
return '/tmp/mock/pkg.json';
|
|
85
76
|
}
|
|
86
77
|
return originalResolve(request);
|
|
@@ -194,7 +185,7 @@ describe('check-version', () => {
|
|
|
194
185
|
describe('getInstalledVersion - additional cases', () => {
|
|
195
186
|
it('should return npm version when package is in node_modules', () => {
|
|
196
187
|
const mockVersion = '5.3.1';
|
|
197
|
-
const nodeModulesPath = path.join(process.cwd(), 'node_modules', '
|
|
188
|
+
const nodeModulesPath = path.join(process.cwd(), 'node_modules', 'pumuki-ast-hooks', 'package.json');
|
|
198
189
|
fsExistsSpy.mockImplementation((filePath) => {
|
|
199
190
|
if (filePath === nodeModulesPath) return true;
|
|
200
191
|
return false;
|
|
@@ -13,6 +13,7 @@ describe('cli', () => {
|
|
|
13
13
|
const childProcess = require('child_process');
|
|
14
14
|
|
|
15
15
|
const originalExecSync = childProcess.execSync;
|
|
16
|
+
const originalExecFileSync = childProcess.execFileSync;
|
|
16
17
|
childProcess.execSync = (cmd) => {
|
|
17
18
|
const command = String(cmd);
|
|
18
19
|
if (command.includes('git log') && command.includes('--pretty=%s')) {
|
|
@@ -33,6 +34,7 @@ describe('cli', () => {
|
|
|
33
34
|
expect(proposed.primary_goal.toLowerCase()).toContain('token economy');
|
|
34
35
|
|
|
35
36
|
childProcess.execSync = originalExecSync;
|
|
37
|
+
childProcess.execFileSync = originalExecFileSync;
|
|
36
38
|
});
|
|
37
39
|
|
|
38
40
|
it('wrap-up should auto-save human_intent by default', () => {
|
|
@@ -45,6 +47,7 @@ describe('cli', () => {
|
|
|
45
47
|
|
|
46
48
|
const originalArgv = process.argv;
|
|
47
49
|
const originalExecSync = childProcess.execSync;
|
|
50
|
+
const originalExecFileSync = childProcess.execFileSync;
|
|
48
51
|
|
|
49
52
|
const existsSyncSpy = jest.spyOn(fs, 'existsSync').mockImplementation(() => true);
|
|
50
53
|
const readFileSyncSpy = jest.spyOn(fs, 'readFileSync').mockImplementation(() => JSON.stringify({ ai_gate: { status: 'ALLOWED' }, platforms: {} }));
|
|
@@ -64,9 +67,10 @@ describe('cli', () => {
|
|
|
64
67
|
if (command.includes('git log') && command.includes('--pretty=%s')) {
|
|
65
68
|
return 'fix: token economy docs, assets and MCP outputs\n';
|
|
66
69
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
return '';
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
childProcess.execFileSync = () => {
|
|
70
74
|
return '';
|
|
71
75
|
};
|
|
72
76
|
|
|
@@ -84,6 +88,7 @@ describe('cli', () => {
|
|
|
84
88
|
console.log = originalConsoleLog;
|
|
85
89
|
process.argv = originalArgv;
|
|
86
90
|
childProcess.execSync = originalExecSync;
|
|
91
|
+
childProcess.execFileSync = originalExecFileSync;
|
|
87
92
|
existsSyncSpy.mockRestore();
|
|
88
93
|
readFileSyncSpy.mockRestore();
|
|
89
94
|
writeFileSyncSpy.mockRestore();
|
|
@@ -99,6 +104,7 @@ describe('cli', () => {
|
|
|
99
104
|
|
|
100
105
|
const originalArgv = process.argv;
|
|
101
106
|
const originalExecSync = childProcess.execSync;
|
|
107
|
+
const originalExecFileSync = childProcess.execFileSync;
|
|
102
108
|
|
|
103
109
|
const existsSyncSpy = jest.spyOn(fs, 'existsSync').mockImplementation(() => true);
|
|
104
110
|
const readFileSyncSpy = jest.spyOn(fs, 'readFileSync').mockImplementation(() => JSON.stringify({ ai_gate: { status: 'ALLOWED' }, platforms: {} }));
|
|
@@ -118,9 +124,10 @@ describe('cli', () => {
|
|
|
118
124
|
if (command.includes('git log') && command.includes('--pretty=%s')) {
|
|
119
125
|
return 'fix: token economy docs, assets and MCP outputs\n';
|
|
120
126
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
127
|
+
return '';
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
childProcess.execFileSync = () => {
|
|
124
131
|
return '';
|
|
125
132
|
};
|
|
126
133
|
|
|
@@ -137,8 +144,31 @@ describe('cli', () => {
|
|
|
137
144
|
console.log = originalConsoleLog;
|
|
138
145
|
process.argv = originalArgv;
|
|
139
146
|
childProcess.execSync = originalExecSync;
|
|
147
|
+
childProcess.execFileSync = originalExecFileSync;
|
|
140
148
|
existsSyncSpy.mockRestore();
|
|
141
149
|
readFileSyncSpy.mockRestore();
|
|
142
150
|
writeFileSyncSpy.mockRestore();
|
|
143
151
|
});
|
|
152
|
+
|
|
153
|
+
it('install should execute install.js using execFileSync with args', () => {
|
|
154
|
+
const path = require('path');
|
|
155
|
+
const childProcess = require('child_process');
|
|
156
|
+
|
|
157
|
+
const originalArgv = process.argv;
|
|
158
|
+
const originalExecFileSync = childProcess.execFileSync;
|
|
159
|
+
|
|
160
|
+
const execFileSyncSpy = jest.fn();
|
|
161
|
+
childProcess.execFileSync = execFileSyncSpy;
|
|
162
|
+
|
|
163
|
+
process.argv = ['node', 'cli.js', 'install'];
|
|
164
|
+
jest.resetModules();
|
|
165
|
+
const { commands } = require('../cli.js');
|
|
166
|
+
commands.install();
|
|
167
|
+
|
|
168
|
+
const expectedInstallPath = path.join(__dirname, '..', '..', 'bin', 'install.js');
|
|
169
|
+
expect(execFileSyncSpy).toHaveBeenCalledWith(process.execPath, [expectedInstallPath], { stdio: 'inherit' });
|
|
170
|
+
|
|
171
|
+
process.argv = originalArgv;
|
|
172
|
+
childProcess.execFileSync = originalExecFileSync;
|
|
173
|
+
});
|
|
144
174
|
});
|
|
@@ -15,7 +15,7 @@ echo "🤖 AI-COMMIT: Preparando commit..."
|
|
|
15
15
|
|
|
16
16
|
# Detect if running from node_modules (installed package) or from scripts/hooks-system (local dev)
|
|
17
17
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
18
|
-
if [[ "$SCRIPT_DIR" == *"node_modules
|
|
18
|
+
if [[ "$SCRIPT_DIR" == *"node_modules/pumuki-ast-hooks"* ]]; then
|
|
19
19
|
HOOKS_SYSTEM_DIR="$(dirname "$(dirname "$SCRIPT_DIR")")"
|
|
20
20
|
if [[ -d "$REPO_ROOT/scripts/hooks-system" ]]; then
|
|
21
21
|
HOOKS_SYSTEM_DIR="$REPO_ROOT/scripts/hooks-system"
|
|
@@ -21,7 +21,7 @@ const COLORS = {
|
|
|
21
21
|
|
|
22
22
|
function getInstalledVersion() {
|
|
23
23
|
const projectRoot = process.cwd();
|
|
24
|
-
const packageNames = ['
|
|
24
|
+
const packageNames = ['pumuki-ast-hooks'];
|
|
25
25
|
|
|
26
26
|
for (const packageName of packageNames) {
|
|
27
27
|
try {
|
|
@@ -69,9 +69,7 @@ function getInstalledVersion() {
|
|
|
69
69
|
return { version: 'unknown (local)', type: 'local', path: libPath, packageName };
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
const nodeModulesPath =
|
|
73
|
-
? path.join(projectRoot, 'node_modules', packageName.replace('/', path.sep), 'package.json')
|
|
74
|
-
: path.join(projectRoot, 'node_modules', packageName, 'package.json');
|
|
72
|
+
const nodeModulesPath = path.join(projectRoot, 'node_modules', packageName, 'package.json');
|
|
75
73
|
|
|
76
74
|
if (fs.existsSync(nodeModulesPath)) {
|
|
77
75
|
const installedPkg = JSON.parse(fs.readFileSync(nodeModulesPath, 'utf-8'));
|
|
@@ -84,9 +82,7 @@ function getInstalledVersion() {
|
|
|
84
82
|
}
|
|
85
83
|
|
|
86
84
|
for (const packageName of packageNames) {
|
|
87
|
-
const nodeModulesPath =
|
|
88
|
-
? path.join(projectRoot, 'node_modules', packageName.replace('/', path.sep), 'package.json')
|
|
89
|
-
: path.join(projectRoot, 'node_modules', packageName, 'package.json');
|
|
85
|
+
const nodeModulesPath = path.join(projectRoot, 'node_modules', packageName, 'package.json');
|
|
90
86
|
|
|
91
87
|
if (fs.existsSync(nodeModulesPath)) {
|
|
92
88
|
const pkg = JSON.parse(fs.readFileSync(nodeModulesPath, 'utf-8'));
|
|
@@ -139,7 +135,7 @@ function main() {
|
|
|
139
135
|
if (!installed) {
|
|
140
136
|
console.log(`${COLORS.red}❌ ast-intelligence-hooks not found in this project${COLORS.reset}`);
|
|
141
137
|
console.log(`\n${COLORS.cyan}Install it with:${COLORS.reset}`);
|
|
142
|
-
console.log(
|
|
138
|
+
console.log(' npm install --save-dev pumuki-ast-hooks');
|
|
143
139
|
console.log(` npm run install-hooks\n`);
|
|
144
140
|
process.exit(1);
|
|
145
141
|
}
|
|
@@ -167,7 +163,7 @@ function main() {
|
|
|
167
163
|
console.log(`${COLORS.yellow}⚠️ Partial installation detected${COLORS.reset}`);
|
|
168
164
|
console.log(` It seems hooks are installed but the package is missing.\n`);
|
|
169
165
|
console.log(`${COLORS.cyan}Try reinstalling:${COLORS.reset}`);
|
|
170
|
-
console.log(
|
|
166
|
+
console.log(' npm install --save-dev pumuki-ast-hooks');
|
|
171
167
|
console.log(` npm run install-hooks\n`);
|
|
172
168
|
process.exit(0);
|
|
173
169
|
}
|
|
@@ -193,7 +189,7 @@ function main() {
|
|
|
193
189
|
console.log(`${COLORS.yellow}⚠️ UPDATE AVAILABLE${COLORS.reset}`);
|
|
194
190
|
console.log(`\n${COLORS.cyan}To update:${COLORS.reset}`);
|
|
195
191
|
console.log(` 1. Update package:${COLORS.reset}`);
|
|
196
|
-
console.log(
|
|
192
|
+
console.log(' npm install --save-dev pumuki-ast-hooks@latest');
|
|
197
193
|
console.log(`\n 2. Re-install hooks (to get latest features):${COLORS.reset}`);
|
|
198
194
|
console.log(` npm run install-hooks`);
|
|
199
195
|
console.log(`\n${COLORS.cyan}What's new in ${latest}:${COLORS.reset}`);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Unified CLI to run audits from any project
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const { execSync } = require('child_process');
|
|
9
|
+
const { execSync, execFileSync } = require('child_process');
|
|
10
10
|
const fs = require('fs');
|
|
11
11
|
const path = require('path');
|
|
12
12
|
const env = require('../config/env');
|
|
@@ -365,7 +365,7 @@ const commands = {
|
|
|
365
365
|
console.log('🔍 Running full AST analysis and updating evidence...');
|
|
366
366
|
|
|
367
367
|
try {
|
|
368
|
-
|
|
368
|
+
execFileSync(process.execPath, [auditScript], {
|
|
369
369
|
stdio: 'inherit',
|
|
370
370
|
env: {
|
|
371
371
|
...process.env,
|
|
@@ -402,22 +402,23 @@ const commands = {
|
|
|
402
402
|
execEnv.STAGING_ONLY_MODE = '1';
|
|
403
403
|
}
|
|
404
404
|
|
|
405
|
-
|
|
406
|
-
|
|
405
|
+
execFileSync(
|
|
406
|
+
process.execPath,
|
|
407
|
+
[path.join(HOOKS_ROOT, 'infrastructure/ast/ast-intelligence.js'), ...filteredArgs],
|
|
407
408
|
{ stdio: 'inherit', env: execEnv }
|
|
408
409
|
);
|
|
409
410
|
},
|
|
410
411
|
|
|
411
412
|
install: () => {
|
|
412
|
-
|
|
413
|
+
execFileSync(process.execPath, [path.join(HOOKS_ROOT, 'bin/install.js')], { stdio: 'inherit' });
|
|
413
414
|
},
|
|
414
415
|
|
|
415
416
|
'verify-policy': () => {
|
|
416
|
-
|
|
417
|
+
execFileSync('bash', [path.join(HOOKS_ROOT, 'bin/verify-no-verify.sh')], { stdio: 'inherit' });
|
|
417
418
|
},
|
|
418
419
|
|
|
419
420
|
'progress': () => {
|
|
420
|
-
|
|
421
|
+
execFileSync('bash', [path.join(HOOKS_ROOT, 'bin/generate-progress-report.sh')], { stdio: 'inherit' });
|
|
421
422
|
},
|
|
422
423
|
|
|
423
424
|
health: () => {
|
|
@@ -426,12 +427,12 @@ const commands = {
|
|
|
426
427
|
},
|
|
427
428
|
|
|
428
429
|
watch: () => {
|
|
429
|
-
|
|
430
|
+
execFileSync(process.execPath, [path.join(HOOKS_ROOT, 'bin/watch-hooks.js')], { stdio: 'inherit' });
|
|
430
431
|
},
|
|
431
432
|
|
|
432
433
|
'gitflow': () => {
|
|
433
434
|
const subcommand = args[0] || 'check';
|
|
434
|
-
|
|
435
|
+
execFileSync('bash', [path.join(HOOKS_ROOT, 'infrastructure/shell/gitflow-enforcer.sh'), subcommand], { stdio: 'inherit' });
|
|
435
436
|
},
|
|
436
437
|
|
|
437
438
|
'intent': () => {
|
|
@@ -2,13 +2,6 @@
|
|
|
2
2
|
# Script Wrapper
|
|
3
3
|
# Redirects to the centralized implementation in scripts/hooks-system
|
|
4
4
|
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo ".")
|
|
5
|
-
IMPL="$REPO_ROOT/node_modules/@pumuki/ast-intelligence-hooks/scripts/hooks-system/bin/guard-env.sh"
|
|
6
|
-
if [[ -f "$IMPL" ]]; then
|
|
7
|
-
# shellcheck disable=SC1090
|
|
8
|
-
source "$IMPL"
|
|
9
|
-
return 0 2>/dev/null || exit 0
|
|
10
|
-
fi
|
|
11
|
-
|
|
12
5
|
IMPL="$REPO_ROOT/node_modules/pumuki-ast-hooks/scripts/hooks-system/bin/guard-env.sh"
|
|
13
6
|
if [[ -f "$IMPL" ]]; then
|
|
14
7
|
# shellcheck disable=SC1090
|
|
@@ -6,14 +6,12 @@ REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo ".")
|
|
|
6
6
|
LOCK_DIR="$REPO_ROOT/.audit_tmp/guard-supervisor.lock"
|
|
7
7
|
if [[ -d "$LOCK_DIR" ]]; then
|
|
8
8
|
if ! ps -ax -o command= | grep -F "$REPO_ROOT/scripts/hooks-system/bin/guard-supervisor.js" | grep -v grep >/dev/null 2>&1; then
|
|
9
|
-
if ! ps -ax -o command= | grep -F "$REPO_ROOT/node_modules
|
|
10
|
-
|
|
11
|
-
rm -rf "$LOCK_DIR" 2>/dev/null || true
|
|
12
|
-
fi
|
|
9
|
+
if ! ps -ax -o command= | grep -F "$REPO_ROOT/node_modules/pumuki-ast-hooks/scripts/hooks-system/bin/guard-supervisor.js" | grep -v grep >/dev/null 2>&1; then
|
|
10
|
+
rm -rf "$LOCK_DIR" 2>/dev/null || true
|
|
13
11
|
fi
|
|
14
12
|
fi
|
|
15
13
|
fi
|
|
16
|
-
IMPL="$REPO_ROOT/
|
|
14
|
+
IMPL="$REPO_ROOT/scripts/hooks-system/bin/start-guards.sh"
|
|
17
15
|
if [[ -f "$IMPL" ]]; then
|
|
18
16
|
exec bash "$IMPL" "$@"
|
|
19
17
|
fi
|
|
@@ -13,7 +13,7 @@ const AuditLogger = require('../../application/services/logging/AuditLogger');
|
|
|
13
13
|
function resolveUpdateEvidenceScript(repoRoot) {
|
|
14
14
|
const candidates = [
|
|
15
15
|
path.join(repoRoot, 'scripts/hooks-system/bin/update-evidence.sh'),
|
|
16
|
-
path.join(repoRoot, 'node_modules
|
|
16
|
+
path.join(repoRoot, 'node_modules/pumuki-ast-hooks/bin/update-evidence.sh'),
|
|
17
17
|
path.join(repoRoot, 'bin/update-evidence.sh')
|
|
18
18
|
];
|
|
19
19
|
|
|
@@ -359,8 +359,8 @@ function getLibraryInstallPath() {
|
|
|
359
359
|
const repoRoot = REPO_ROOT;
|
|
360
360
|
|
|
361
361
|
// Try to find library path relative to repo root
|
|
362
|
-
if (scriptPath.includes('node_modules
|
|
363
|
-
return 'node_modules
|
|
362
|
+
if (scriptPath.includes('node_modules/pumuki-ast-hooks')) {
|
|
363
|
+
return 'node_modules/pumuki-ast-hooks';
|
|
364
364
|
}
|
|
365
365
|
if (scriptPath.includes('scripts/hooks-system')) {
|
|
366
366
|
return 'scripts/hooks-system';
|
|
@@ -368,8 +368,8 @@ function getLibraryInstallPath() {
|
|
|
368
368
|
// If script is in repo root, try to detect from package.json
|
|
369
369
|
try {
|
|
370
370
|
const packageJson = JSON.parse(fs.readFileSync(path.join(repoRoot, 'package.json'), 'utf8'));
|
|
371
|
-
const libPath = packageJson.devDependencies?.['
|
|
372
|
-
packageJson.dependencies?.['
|
|
371
|
+
const libPath = packageJson.devDependencies?.['pumuki-ast-hooks'] ||
|
|
372
|
+
packageJson.dependencies?.['pumuki-ast-hooks'];
|
|
373
373
|
if (libPath && libPath.startsWith('file:')) {
|
|
374
374
|
// Local file path, extract relative path
|
|
375
375
|
const relativePath = libPath.replace('file:', '').replace(/^\.\.\//, '');
|
|
@@ -454,8 +454,8 @@ function resolveUpdateEvidenceScript() {
|
|
|
454
454
|
const candidates = [
|
|
455
455
|
path.join(REPO_ROOT, 'scripts/hooks-system/bin/update-evidence.sh'),
|
|
456
456
|
path.join(process.cwd(), 'scripts/hooks-system/bin/update-evidence.sh'),
|
|
457
|
-
path.join(REPO_ROOT, 'node_modules
|
|
458
|
-
path.join(process.cwd(), 'node_modules
|
|
457
|
+
path.join(REPO_ROOT, 'node_modules/pumuki-ast-hooks/bin/update-evidence.sh'),
|
|
458
|
+
path.join(process.cwd(), 'node_modules/pumuki-ast-hooks/bin/update-evidence.sh'),
|
|
459
459
|
path.join(REPO_ROOT, 'bin/update-evidence.sh'),
|
|
460
460
|
path.join(process.cwd(), 'bin/update-evidence.sh'),
|
|
461
461
|
path.join(scriptDir, '../../bin/update-evidence.sh'),
|
|
@@ -8,10 +8,10 @@ set -euo pipefail
|
|
|
8
8
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
9
9
|
|
|
10
10
|
# Detect if running from node_modules or scripts/hooks-system
|
|
11
|
-
if [[ "$SCRIPT_DIR" == *"node_modules
|
|
11
|
+
if [[ "$SCRIPT_DIR" == *"node_modules/pumuki-ast-hooks"* ]]; then
|
|
12
12
|
# Running from installed npm package
|
|
13
|
-
# SCRIPT_DIR is: node_modules
|
|
14
|
-
# Need to go up 3 levels: ../../.. = node_modules
|
|
13
|
+
# SCRIPT_DIR is: node_modules/pumuki-ast-hooks/infrastructure/shell/orchestrators
|
|
14
|
+
# Need to go up 3 levels: ../../.. = node_modules/pumuki-ast-hooks
|
|
15
15
|
HOOKS_SYSTEM_DIR="$(cd "$SCRIPT_DIR/../../.." && pwd)"
|
|
16
16
|
elif [[ "$SCRIPT_DIR" == *"scripts/hooks-system"* ]]; then
|
|
17
17
|
# Running from local scripts/hooks-system
|
|
@@ -32,8 +32,8 @@ elif [[ "$SCRIPT_DIR" == *"scripts/hooks-system"* ]]; then
|
|
|
32
32
|
else
|
|
33
33
|
# Fallback: try to find it relative to current directory
|
|
34
34
|
REPO_ROOT="$(pwd)"
|
|
35
|
-
if [[ -d "$REPO_ROOT/node_modules
|
|
36
|
-
HOOKS_SYSTEM_DIR="$REPO_ROOT/node_modules
|
|
35
|
+
if [[ -d "$REPO_ROOT/node_modules/pumuki-ast-hooks" ]]; then
|
|
36
|
+
HOOKS_SYSTEM_DIR="$REPO_ROOT/node_modules/pumuki-ast-hooks"
|
|
37
37
|
elif [[ -d "$REPO_ROOT/scripts/hooks-system" ]]; then
|
|
38
38
|
HOOKS_SYSTEM_DIR="$REPO_ROOT/scripts/hooks-system"
|
|
39
39
|
else
|
|
@@ -1046,12 +1046,12 @@ run_ast_intelligence() {
|
|
|
1046
1046
|
node_path_parts+=("$HOOKS_SYSTEM_DIR/node_modules")
|
|
1047
1047
|
fi
|
|
1048
1048
|
|
|
1049
|
-
# Also check if we're in a project with node_modules
|
|
1049
|
+
# Also check if we're in a project with node_modules/pumuki-ast-hooks
|
|
1050
1050
|
local repo_root=""
|
|
1051
1051
|
if [[ "$HOOKS_SYSTEM_DIR" == *"scripts/hooks-system"* ]]; then
|
|
1052
1052
|
# Running from scripts/hooks-system, go to repo root
|
|
1053
1053
|
repo_root="$(cd "$HOOKS_SYSTEM_DIR/../.." && pwd)"
|
|
1054
|
-
elif [[ "$HOOKS_SYSTEM_DIR" == *"node_modules
|
|
1054
|
+
elif [[ "$HOOKS_SYSTEM_DIR" == *"node_modules/pumuki-ast-hooks"* ]]; then
|
|
1055
1055
|
# Running from node_modules, go to repo root
|
|
1056
1056
|
repo_root="$(cd "$HOOKS_SYSTEM_DIR/../../.." && pwd)"
|
|
1057
1057
|
else
|
|
@@ -1059,8 +1059,8 @@ run_ast_intelligence() {
|
|
|
1059
1059
|
repo_root="$(pwd)"
|
|
1060
1060
|
fi
|
|
1061
1061
|
|
|
1062
|
-
if [[ -n "$repo_root" ]] && [[ -d "$repo_root/node_modules
|
|
1063
|
-
node_path_parts+=("$repo_root/node_modules
|
|
1062
|
+
if [[ -n "$repo_root" ]] && [[ -d "$repo_root/node_modules/pumuki-ast-hooks/node_modules" ]]; then
|
|
1063
|
+
node_path_parts+=("$repo_root/node_modules/pumuki-ast-hooks/node_modules")
|
|
1064
1064
|
fi
|
|
1065
1065
|
|
|
1066
1066
|
if [[ -n "$repo_root" ]] && [[ -d "$repo_root/node_modules" ]]; then
|
package/scripts/hooks-system/infrastructure/watchdog/__tests__/.audit-reports/token-monitor.log
CHANGED
|
@@ -94,3 +94,18 @@
|
|
|
94
94
|
{"timestamp":"2026-01-13T17:54:13.230Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":10,"tokensUsed":100000,"maxTokens":1000000,"source":"realtime","stale":false},"context":{"message":"Result level=ok percent=10% used=100000/1000000 source=realtime"}}
|
|
95
95
|
{"timestamp":"2026-01-13T17:54:13.231Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"warning","percentUsed":91,"tokensUsed":910000,"maxTokens":1000000,"source":"fallback","stale":false},"context":{"message":"Result level=warning percent=91% used=910000/1000000 source=fallback"}}
|
|
96
96
|
{"timestamp":"2026-01-13T17:54:13.231Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"critical","percentUsed":98,"tokensUsed":980000,"maxTokens":1000000,"source":"realtime","stale":true},"context":{"message":"Result level=critical percent=98% used=980000/1000000 source=realtime (stale)"}}
|
|
97
|
+
{"timestamp":"2026-01-14T07:11:03.511Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":10,"tokensUsed":100000,"maxTokens":1000000,"source":"realtime","stale":false},"context":{"message":"Result level=ok percent=10% used=100000/1000000 source=realtime"}}
|
|
98
|
+
{"timestamp":"2026-01-14T07:11:03.512Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"warning","percentUsed":91,"tokensUsed":910000,"maxTokens":1000000,"source":"fallback","stale":false},"context":{"message":"Result level=warning percent=91% used=910000/1000000 source=fallback"}}
|
|
99
|
+
{"timestamp":"2026-01-14T07:11:03.512Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"critical","percentUsed":98,"tokensUsed":980000,"maxTokens":1000000,"source":"realtime","stale":true},"context":{"message":"Result level=critical percent=98% used=980000/1000000 source=realtime (stale)"}}
|
|
100
|
+
{"timestamp":"2026-01-14T07:32:54.063Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":10,"tokensUsed":100000,"maxTokens":1000000,"source":"realtime","stale":false},"context":{"message":"Result level=ok percent=10% used=100000/1000000 source=realtime"}}
|
|
101
|
+
{"timestamp":"2026-01-14T07:32:54.064Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"warning","percentUsed":91,"tokensUsed":910000,"maxTokens":1000000,"source":"fallback","stale":false},"context":{"message":"Result level=warning percent=91% used=910000/1000000 source=fallback"}}
|
|
102
|
+
{"timestamp":"2026-01-14T07:32:54.064Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"critical","percentUsed":98,"tokensUsed":980000,"maxTokens":1000000,"source":"realtime","stale":true},"context":{"message":"Result level=critical percent=98% used=980000/1000000 source=realtime (stale)"}}
|
|
103
|
+
{"timestamp":"2026-01-14T10:52:07.651Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":10,"tokensUsed":100000,"maxTokens":1000000,"source":"realtime","stale":false},"context":{"message":"Result level=ok percent=10% used=100000/1000000 source=realtime"}}
|
|
104
|
+
{"timestamp":"2026-01-14T10:52:07.652Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"warning","percentUsed":91,"tokensUsed":910000,"maxTokens":1000000,"source":"fallback","stale":false},"context":{"message":"Result level=warning percent=91% used=910000/1000000 source=fallback"}}
|
|
105
|
+
{"timestamp":"2026-01-14T10:52:07.652Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"critical","percentUsed":98,"tokensUsed":980000,"maxTokens":1000000,"source":"realtime","stale":true},"context":{"message":"Result level=critical percent=98% used=980000/1000000 source=realtime (stale)"}}
|
|
106
|
+
{"timestamp":"2026-01-14T10:53:10.842Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":10,"tokensUsed":100000,"maxTokens":1000000,"source":"realtime","stale":false},"context":{"message":"Result level=ok percent=10% used=100000/1000000 source=realtime"}}
|
|
107
|
+
{"timestamp":"2026-01-14T10:53:10.843Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"warning","percentUsed":91,"tokensUsed":910000,"maxTokens":1000000,"source":"fallback","stale":false},"context":{"message":"Result level=warning percent=91% used=910000/1000000 source=fallback"}}
|
|
108
|
+
{"timestamp":"2026-01-14T10:53:10.843Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"critical","percentUsed":98,"tokensUsed":980000,"maxTokens":1000000,"source":"realtime","stale":true},"context":{"message":"Result level=critical percent=98% used=980000/1000000 source=realtime (stale)"}}
|
|
109
|
+
{"timestamp":"2026-01-14T10:53:47.998Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":10,"tokensUsed":100000,"maxTokens":1000000,"source":"realtime","stale":false},"context":{"message":"Result level=ok percent=10% used=100000/1000000 source=realtime"}}
|
|
110
|
+
{"timestamp":"2026-01-14T10:53:47.999Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"warning","percentUsed":91,"tokensUsed":910000,"maxTokens":1000000,"source":"fallback","stale":false},"context":{"message":"Result level=warning percent=91% used=910000/1000000 source=fallback"}}
|
|
111
|
+
{"timestamp":"2026-01-14T10:53:47.999Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"critical","percentUsed":98,"tokensUsed":980000,"maxTokens":1000000,"source":"realtime","stale":true},"context":{"message":"Result level=critical percent=98% used=980000/1000000 source=realtime (stale)"}}
|
|
@@ -8,11 +8,11 @@ set -euo pipefail
|
|
|
8
8
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
9
9
|
|
|
10
10
|
# Robustly find HOOKS_SYSTEM_DIR (works for both local development and node_modules installation)
|
|
11
|
-
if [[ "$SCRIPT_DIR" == *"/node_modules
|
|
11
|
+
if [[ "$SCRIPT_DIR" == *"/node_modules/pumuki-ast-hooks/scripts/hooks-system/presentation/cli"* ]]; then
|
|
12
12
|
# Installed in node_modules (package includes scripts/hooks-system/...)
|
|
13
13
|
PACKAGE_ROOT="$(cd "$SCRIPT_DIR/../../../../" && pwd)"
|
|
14
14
|
HOOKS_SYSTEM_DIR="$PACKAGE_ROOT/scripts/hooks-system"
|
|
15
|
-
elif [[ "$SCRIPT_DIR" == *"/node_modules
|
|
15
|
+
elif [[ "$SCRIPT_DIR" == *"/node_modules/pumuki-ast-hooks/presentation/cli"* ]]; then
|
|
16
16
|
# Installed in node_modules (legacy package layout)
|
|
17
17
|
HOOKS_SYSTEM_DIR="$(cd "$SCRIPT_DIR/../../.." && pwd)"
|
|
18
18
|
else
|