pumuki-ast-hooks 5.3.23 → 5.3.25

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": "5.3.23",
3
+ "version": "5.3.25",
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": {
@@ -3,7 +3,7 @@ const path = require('path');
3
3
  const { getGitTreeState, isTreeBeyondLimit } = require('./GitTreeState');
4
4
  const AuditLogger = require('./logging/AuditLogger');
5
5
  const { recordMetric } = require('../../infrastructure/telemetry/metrics-logger');
6
- const env = require('../../../config/env');
6
+ const env = require('../../config/env.js');
7
7
 
8
8
  class RealtimeGuardService {
9
9
  /**
@@ -11,7 +11,7 @@ const GuardNotificationHandler = require('./GuardNotificationHandler');
11
11
  const GuardMonitorLoop = require('./GuardMonitorLoop');
12
12
  const GuardHealthReminder = require('./GuardHealthReminder');
13
13
  const AuditLogger = require('../logging/AuditLogger');
14
- const envHelper = require('../../../config/env');
14
+ const envHelper = require('../../../config/env.js');
15
15
  const { recordMetric } = require('../../../infrastructure/telemetry/metrics-logger');
16
16
 
17
17
  class GuardAutoManagerService {
@@ -1,4 +1,4 @@
1
- const envHelper = require('../../../config/env');
1
+ const envHelper = require('../../../config/env.js');
2
2
 
3
3
  class GuardConfig {
4
4
  constructor(env = envHelper) {
@@ -1,6 +1,6 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
- const env = require('../../../config/env');
3
+ const env = require('../../../config/env.js');
4
4
 
5
5
  class GuardHeartbeatMonitor {
6
6
  constructor({
@@ -3,7 +3,7 @@ const path = require('path');
3
3
  const { execSync } = require('child_process');
4
4
  const crypto = require('crypto');
5
5
  const os = require('os');
6
- const env = require('../../../config/env');
6
+ const env = require('../../../config/env.js');
7
7
 
8
8
  const COLORS = {
9
9
  reset: '\x1b[0m',
@@ -98,7 +98,7 @@ class UnifiedLogger {
98
98
  fs.appendFileSync(this.fileConfig.path, `${JSON.stringify(entry)}\n`, 'utf8');
99
99
  } catch (error) {
100
100
  try {
101
- const env = require('../../../config/env');
101
+ const env = require('../../../config/env.js');
102
102
  if (env.getBool('DEBUG', false)) {
103
103
  console.error('[UnifiedLogger] Failed to write log file', {
104
104
  path: this.fileConfig.path,
@@ -1,7 +1,7 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
3
  const { execSync } = require('child_process');
4
- const env = require('../../../config/env');
4
+ const env = require('../../../config/env.js');
5
5
 
6
6
  function resolveUpdateEvidenceScript(repoRoot) {
7
7
  const candidates = [
@@ -54,7 +54,7 @@ class TokenMetricsService {
54
54
  if (untrusted) {
55
55
  level = 'ok';
56
56
  }
57
- const env = require('../../../config/env');
57
+ const env = require('../../../config/env.js');
58
58
  const forceLevel = (env.get('TOKEN_MONITOR_FORCE_LEVEL', '') || '').toLowerCase();
59
59
  if (forceLevel === 'warning' || forceLevel === 'critical' || forceLevel === 'ok') {
60
60
  level = forceLevel;
@@ -121,20 +121,25 @@ const commands = {
121
121
  },
122
122
 
123
123
  ast: () => {
124
- const env = { ...process.env };
125
124
  const filteredArgs = [];
125
+ let stagingOnlyMode = false;
126
126
 
127
127
  for (const arg of args) {
128
128
  if (arg === '--staged') {
129
- env.STAGING_ONLY_MODE = '1';
129
+ stagingOnlyMode = true;
130
130
  } else {
131
131
  filteredArgs.push(arg);
132
132
  }
133
133
  }
134
134
 
135
+ const execEnv = { ...process.env };
136
+ if (stagingOnlyMode) {
137
+ execEnv.STAGING_ONLY_MODE = '1';
138
+ }
139
+
135
140
  execSync(
136
141
  `node ${path.join(HOOKS_ROOT, 'infrastructure/ast/ast-intelligence.js')} ${filteredArgs.join(' ')}`,
137
- { stdio: 'inherit', env }
142
+ { stdio: 'inherit', env: execEnv }
138
143
  );
139
144
  },
140
145
 
@@ -1,4 +1,6 @@
1
- const ENV = (process.env.NODE_ENV || 'development').toLowerCase();
1
+ const ENV = (function () {
2
+ return (process.env.NODE_ENV || 'development').toLowerCase();
3
+ })();
2
4
 
3
5
  function normalizeBool(val, defaultValue = false) {
4
6
  if (val === undefined) return defaultValue;
@@ -2,7 +2,7 @@
2
2
  const { Project, Node, SyntaxKind, ScriptTarget, ModuleKind } = require("ts-morph");
3
3
  const path = require("path");
4
4
  const fs = require("fs");
5
- const env = require("../../../config/env");
5
+ const env = require("../../config/env.js");
6
6
 
7
7
  let SeverityEvaluator = null;
8
8
  let severityEvaluatorInstance = null;
@@ -1,7 +1,7 @@
1
1
 
2
2
  const path = require("path");
3
3
  const fs = require("fs");
4
- const env = require("../../../config/env");
4
+ const env = require("../../config/env.js");
5
5
 
6
6
  const astModulesPath = __dirname;
7
7
  const { createProject, platformOf, mapToLevel } = require(path.join(astModulesPath, "ast-core"));
@@ -1,5 +1,5 @@
1
1
  const path = require('path');
2
- const env = require('../../../config/env');
2
+ const env = require('../../../config/env.js');
3
3
  const {
4
4
  platformOf,
5
5
  pushFinding,
@@ -3,7 +3,7 @@
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
5
  const { execSync } = require('child_process');
6
- const env = require('../../../config/env');
6
+ const env = require('../../../config/env.js');
7
7
 
8
8
  const projectDir = env.get('CLAUDE_PROJECT_DIR', process.cwd());
9
9
  const rulesPath = path.join(projectDir, '.cursor', 'ai-skills', 'skill-rules.json');
@@ -1,6 +1,6 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
- const env = require('../../../config/env');
3
+ const env = require('../../../config/env.js');
4
4
 
5
5
  const UnifiedLogger = require('../../application/services/logging/UnifiedLogger');
6
6
 
@@ -8,7 +8,7 @@ const { TokenManager } = require('../utils/token-manager');
8
8
  const { toErrorMessage } = require('../utils/error-utils');
9
9
  const fs = require('fs');
10
10
  const path = require('path');
11
- const env = require('../../../config/env');
11
+ const env = require('../../../config/env.js');
12
12
 
13
13
  function resolveAuditTmpDir() {
14
14
  const configured = (env.get('AUDIT_TMP', '') || '').trim();
@@ -3,7 +3,7 @@
3
3
  const http = require('http');
4
4
  const fs = require('fs');
5
5
  const path = require('path');
6
- const env = require('../../../config/env');
6
+ const env = require('../../../config/env.js');
7
7
 
8
8
  const PORT = env.getNumber('HOOK_METRICS_PORT', 9464);
9
9
  const METRICS_FILE = path.join(process.cwd(), env.get('HOOK_METRICS_FILE', '.audit_tmp/hook-metrics.jsonl'));
@@ -4,7 +4,7 @@
4
4
  const fs = require('fs');
5
5
  const path = require('path');
6
6
  const { execSync } = require('child_process');
7
- const env = require('../../../config/env');
7
+ const env = require('../../../config/env.js');
8
8
 
9
9
  const REPO_ROOT = env.get('HOOK_GUARD_REPO_ROOT', process.cwd());
10
10
  const CONFIG_PATH = path.join(REPO_ROOT, 'scripts', 'hooks-system', 'config', 'language-guard.json');