pumuki-ast-hooks 6.0.5 → 6.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -53,6 +53,7 @@ Documentation:
53
53
 
54
54
  - `docs/USAGE.md` (Interactive Menu, non‑interactive `AUDIT_OPTION`, and typical flows)
55
55
  - `CHANGELOG.md` (Release notes and changes)
56
+ - Keychain/Security casts are exempted from `ios.types.forbidden_type_cast` to avoid false positives in secure storage implementations.
56
57
 
57
58
  ---
58
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki-ast-hooks",
3
- "version": "6.0.5",
3
+ "version": "6.0.6",
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": {
@@ -135,4 +135,4 @@
135
135
  "./skills": "./skills/skill-rules.json",
136
136
  "./hooks": "./hooks/index.js"
137
137
  }
138
- }
138
+ }
@@ -18,3 +18,4 @@
18
18
  {"timestamp":"2026-01-12T19:29:17.037Z","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":{}}
19
19
  {"timestamp":"2026-01-12T23:31:06.880Z","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":{}}
20
20
  {"timestamp":"2026-01-12T23:36:15.876Z","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":{}}
21
+ {"timestamp":"2026-01-13T00:00:36.969Z","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":{}}
@@ -82,3 +82,7 @@
82
82
  {"timestamp":"2026-01-12T23:36:15.949Z","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":{}}
83
83
  {"timestamp":"2026-01-12T23:36:15.950Z","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":{}}
84
84
  {"timestamp":"2026-01-12T23:36:15.950Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_COMPLETED","data":{},"context":{}}
85
+ {"timestamp":"2026-01-13T00:00:37.042Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_START","data":{"repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"},"context":{}}
86
+ {"timestamp":"2026-01-13T00:00:37.050Z","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":{}}
87
+ {"timestamp":"2026-01-13T00:00:37.050Z","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":{}}
88
+ {"timestamp":"2026-01-13T00:00:37.050Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_COMPLETED","data":{},"context":{}}
@@ -738,3 +738,27 @@
738
738
  {"timestamp":1768260975876,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
739
739
  {"timestamp":1768260975876,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
740
740
  {"timestamp":1768260975876,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
741
+ {"timestamp":1768262436967,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
742
+ {"timestamp":1768262436968,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
743
+ {"timestamp":1768262436968,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
744
+ {"timestamp":1768262436968,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
745
+ {"timestamp":1768262436968,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
746
+ {"timestamp":1768262436968,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
747
+ {"timestamp":1768262436968,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
748
+ {"timestamp":1768262436968,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
749
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
750
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
751
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
752
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
753
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
754
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
755
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
756
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
757
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
758
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
759
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
760
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
761
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
762
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
763
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
764
+ {"timestamp":1768262436969,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
@@ -58,7 +58,7 @@ function getCurrentBranchSafe() {
58
58
 
59
59
  function getStagedFilesSafe() {
60
60
  try {
61
- const output = execSync('git diff --cached --name-only', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] });
61
+ const output = execSync('git diff --cached --name-only --diff-filter=ACMRT', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] });
62
62
  return output.trim().split('\n').filter(Boolean);
63
63
  } catch (e) {
64
64
  return [];
@@ -154,14 +154,18 @@ class iOSForbiddenLiteralsAnalyzer {
154
154
 
155
155
  analyzeTypeCasts(asExpressions, sf, findings, pushFinding) {
156
156
  if (!sf || typeof sf.getFilePath !== 'function') return;
157
+ const fullText = sf.getFullText();
158
+ const filePath = sf.getFilePath();
159
+ const hasSecurityImport = /import\s+Security\b/.test(fullText);
160
+ const isKeychainHelper = /KeychainHelper\.swift$/i.test(filePath);
161
+ if (hasSecurityImport || isKeychainHelper) return;
157
162
  asExpressions.forEach((expr) => {
158
- const fullText = sf.getFullText();
159
163
  const exprIndex = expr.getStart();
160
164
  const lineStart = fullText.lastIndexOf('\n', exprIndex) + 1;
161
165
  const lineEnd = fullText.indexOf('\n', exprIndex);
162
166
  const fullLine = fullText.substring(lineStart, lineEnd === -1 ? undefined : lineEnd);
163
167
 
164
- const isInTestFile = /\.(spec|test)\.(swift)$/i.test(sf.getFilePath());
168
+ const isInTestFile = /\.(spec|test)\.(swift)$/i.test(filePath);
165
169
  const isTypeAssertion = /as\s+(UserRole|OrderStatus|UserStatus|AlertStatus)/i.test(fullLine);
166
170
 
167
171
  if (isInTestFile || isTypeAssertion) return;
@@ -578,7 +578,7 @@ function getStagedFiles() {
578
578
  const { execSync } = require('child_process');
579
579
 
580
580
  try {
581
- const result = execSync('git diff --cached --name-only', { encoding: 'utf8' });
581
+ const result = execSync('git diff --cached --name-only --diff-filter=ACMRT', { encoding: 'utf8' });
582
582
  return result.trim().split('\n').filter(f => f);
583
583
  } catch (error) {
584
584
  process.stderr.write(`[Intelligent Audit] ⚠️ Failed to read staged files: ${toErrorMessage(error)}\n`);
@@ -58,3 +58,6 @@
58
58
  {"timestamp":"2026-01-12T23:36:17.856Z","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"}}
59
59
  {"timestamp":"2026-01-12T23:36:17.857Z","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"}}
60
60
  {"timestamp":"2026-01-12T23:36:17.857Z","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)"}}
61
+ {"timestamp":"2026-01-13T00:00:38.463Z","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"}}
62
+ {"timestamp":"2026-01-13T00:00:38.464Z","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"}}
63
+ {"timestamp":"2026-01-13T00:00:38.464Z","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)"}}