pumuki-ast-hooks 6.1.2 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki-ast-hooks",
3
- "version": "6.1.2",
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": {
@@ -32,3 +32,6 @@
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
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
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":{}}
@@ -138,3 +138,15 @@
138
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
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
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":{}}
@@ -1082,3 +1082,75 @@
1082
1082
  {"timestamp":1768375972203,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
1083
1083
  {"timestamp":1768375972203,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
1084
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"}
@@ -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
- if (command.includes('node') && command.includes('intelligent-audit.js')) {
68
- return '';
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
- if (command.includes('node') && command.includes('intelligent-audit.js')) {
122
- return '';
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
  });
@@ -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
- execSync(`node "${auditScript}"`, {
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
- execSync(
406
- `node ${path.join(HOOKS_ROOT, 'infrastructure/ast/ast-intelligence.js')} ${filteredArgs.join(' ')}`,
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
- execSync(`node ${path.join(HOOKS_ROOT, 'bin/install.js')}`, { stdio: 'inherit' });
413
+ execFileSync(process.execPath, [path.join(HOOKS_ROOT, 'bin/install.js')], { stdio: 'inherit' });
413
414
  },
414
415
 
415
416
  'verify-policy': () => {
416
- execSync(`bash ${path.join(HOOKS_ROOT, 'bin/verify-no-verify.sh')}`, { stdio: 'inherit' });
417
+ execFileSync('bash', [path.join(HOOKS_ROOT, 'bin/verify-no-verify.sh')], { stdio: 'inherit' });
417
418
  },
418
419
 
419
420
  'progress': () => {
420
- execSync(`bash ${path.join(HOOKS_ROOT, 'bin/generate-progress-report.sh')}`, { stdio: 'inherit' });
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
- execSync(`node ${path.join(HOOKS_ROOT, 'bin/watch-hooks.js')}`, { stdio: 'inherit' });
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
- execSync(`bash ${path.join(HOOKS_ROOT, 'infrastructure/shell/gitflow-enforcer.sh')} ${subcommand}`, { stdio: 'inherit' });
435
+ execFileSync('bash', [path.join(HOOKS_ROOT, 'infrastructure/shell/gitflow-enforcer.sh'), subcommand], { stdio: 'inherit' });
435
436
  },
436
437
 
437
438
  'intent': () => {
@@ -100,3 +100,12 @@
100
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
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
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)"}}