pumuki-ast-hooks 5.5.2 → 5.5.4

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.
Files changed (80) hide show
  1. package/package.json +2 -2
  2. package/scripts/hooks-system/.audit-reports/auto-recovery.log +1 -0
  3. package/scripts/hooks-system/.audit-reports/install-wizard.log +4 -0
  4. package/scripts/hooks-system/.audit_tmp/audit.log +0 -0
  5. package/scripts/hooks-system/.audit_tmp/hook-metrics.jsonl +24 -0
  6. package/scripts/hooks-system/.hook-system/config.json +8 -0
  7. package/scripts/hooks-system/application/CompositionRoot.js +31 -19
  8. package/scripts/hooks-system/application/factories/AdapterFactory.js +6 -6
  9. package/scripts/hooks-system/application/services/PredictiveHookAdvisor.js +0 -2
  10. package/scripts/hooks-system/application/services/RealtimeGuardService.js +146 -2
  11. package/scripts/hooks-system/application/services/SmartDirtyTreeAnalyzer.js +0 -1
  12. package/scripts/hooks-system/application/services/guard/EvidenceManager.js +31 -7
  13. package/scripts/hooks-system/application/services/guard/GitTreeManager.js +43 -11
  14. package/scripts/hooks-system/application/services/guard/GuardNotifier.js +2 -2
  15. package/scripts/hooks-system/application/services/installation/ConfigurationGeneratorService.js +0 -2
  16. package/scripts/hooks-system/application/services/installation/GitEnvironmentService.js +0 -3
  17. package/scripts/hooks-system/application/services/installation/InstallService.js +0 -1
  18. package/scripts/hooks-system/application/services/installation/McpConfigurator.js +9 -2
  19. package/scripts/hooks-system/application/services/logging/UnifiedLogger.js +1 -1
  20. package/scripts/hooks-system/application/services/monitoring/AstMonitor.js +0 -2
  21. package/scripts/hooks-system/application/services/monitoring/DevDocsMonitor.js +0 -2
  22. package/scripts/hooks-system/application/services/monitoring/GitTreeMonitorService.js +0 -3
  23. package/scripts/hooks-system/application/services/notification/NotificationCenterService.js +22 -0
  24. package/scripts/hooks-system/application/services/notification/components/NotificationRetryExecutor.js +1 -1
  25. package/scripts/hooks-system/application/services/recovery/AutoRecoveryManager.js +0 -1
  26. package/scripts/hooks-system/application/services/token/TokenMetricsService.js +1 -1
  27. package/scripts/hooks-system/application/services/token/TokenMonitorService.js +0 -1
  28. package/scripts/hooks-system/application/use-cases/AnalyzeCodebaseUseCase.js +0 -2
  29. package/scripts/hooks-system/application/use-cases/AnalyzeStagedFilesUseCase.js +0 -2
  30. package/scripts/hooks-system/application/use-cases/AutoExecuteAIStartUseCase.js +0 -1
  31. package/scripts/hooks-system/application/use-cases/BlockCommitUseCase.js +0 -2
  32. package/scripts/hooks-system/application/use-cases/GenerateAuditReportUseCase.js +0 -3
  33. package/scripts/hooks-system/bin/cli.js +16 -0
  34. package/scripts/hooks-system/domain/services/AuditResultSerializer.js +0 -5
  35. package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidASTIntelligentAnalyzer.js +0 -2
  36. package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidASTParser.js +0 -2
  37. package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidAnalysisOrchestrator.js +0 -2
  38. package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidArchitectureDetector.js +5 -7
  39. package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidClassAnalyzer.js +0 -3
  40. package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidForbiddenLiteralsAnalyzer.js +0 -1
  41. package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidSOLIDAnalyzer.js +0 -2
  42. package/scripts/hooks-system/infrastructure/ast/archive/ios-rules.js +0 -2
  43. package/scripts/hooks-system/infrastructure/ast/archive/kotlin-analyzer.js +0 -2
  44. package/scripts/hooks-system/infrastructure/ast/archive/kotlin-parser.js +0 -2
  45. package/scripts/hooks-system/infrastructure/ast/archive/swift-analyzer.js +0 -2
  46. package/scripts/hooks-system/infrastructure/ast/backend/analyzers/BackendArchitectureDetector.js +0 -2
  47. package/scripts/hooks-system/infrastructure/ast/backend/analyzers/BackendPatternDetector.js +0 -2
  48. package/scripts/hooks-system/infrastructure/ast/common/BDDTDDWorkflowRules.js +0 -2
  49. package/scripts/hooks-system/infrastructure/ast/common/rules/BDDRules.js +0 -2
  50. package/scripts/hooks-system/infrastructure/ast/common/rules/ImplementationRules.js +0 -2
  51. package/scripts/hooks-system/infrastructure/ast/common/rules/TDDRules.js +0 -2
  52. package/scripts/hooks-system/infrastructure/ast/common/rules/WorkflowRules.js +0 -2
  53. package/scripts/hooks-system/infrastructure/ast/frontend/analyzers/FrontendArchitectureDetector.js +14 -16
  54. package/scripts/hooks-system/infrastructure/ast/frontend/analyzers/FrontendForbiddenLiteralsAnalyzer.js +0 -5
  55. package/scripts/hooks-system/infrastructure/ast/frontend/analyzers/FrontendSOLIDAnalyzer.js +0 -2
  56. package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSASTIntelligentAnalyzer.js +17 -2
  57. package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSArchitectureDetector.js +10 -12
  58. package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSArchitectureRules.js +0 -2
  59. package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSCICDRules.js +0 -2
  60. package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSEnterpriseAnalyzer.js +0 -2
  61. package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSForbiddenLiteralsAnalyzer.js +0 -1
  62. package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSNetworkingAdvancedRules.js +0 -2
  63. package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSPerformanceRules.js +0 -3
  64. package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSSPMRules.js +0 -2
  65. package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSSwiftUIAdvancedRules.js +0 -2
  66. package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSTestingAdvancedRules.js +0 -2
  67. package/scripts/hooks-system/infrastructure/ast/ios/native-bridge.js +0 -1
  68. package/scripts/hooks-system/infrastructure/ast/ios/parsers/SourceKittenParser.js +0 -2
  69. package/scripts/hooks-system/infrastructure/logging/UnifiedLoggerFactory.js +1 -1
  70. package/scripts/hooks-system/infrastructure/mcp/ast-intelligence-automation.js +154 -59
  71. package/scripts/hooks-system/infrastructure/mcp/services/McpProtocolHandler.js +14 -6
  72. package/scripts/hooks-system/infrastructure/repositories/CursorTokenRepository.js +0 -2
  73. package/scripts/hooks-system/infrastructure/repositories/FileFindingsRepository.js +0 -2
  74. package/scripts/hooks-system/infrastructure/repositories/datasources/CursorApiDataSource.js +1 -3
  75. package/scripts/hooks-system/infrastructure/repositories/datasources/CursorFileDataSource.js +0 -2
  76. package/scripts/hooks-system/infrastructure/severity/severity-evaluator.js +0 -2
  77. package/scripts/hooks-system/infrastructure/telemetry/TelemetryService.js +0 -2
  78. package/scripts/hooks-system/infrastructure/utils/token-manager.js +0 -2
  79. package/scripts/hooks-system/infrastructure/validators/enforce-english-literals.js +1 -1
  80. package/scripts/hooks-system/infrastructure/watchdog/__tests__/.audit-reports/token-monitor.log +6 -0
@@ -1,12 +1,10 @@
1
1
 
2
2
  const fs = require('fs');
3
3
  const path = require('path');
4
- const AuditLogger = require('../../application/services/logging/AuditLogger');
5
4
 
6
5
  class TokenManager {
7
6
  constructor() {
8
7
  this.limit = 1000000;
9
- this.auditLogger = new AuditLogger({ repoRoot: process.cwd() });
10
8
  this.warningThresholds = [
11
9
  { percent: 75, level: 'INFO' },
12
10
  { percent: 85, level: 'WARNING' },
@@ -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.js');
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');
@@ -22,3 +22,9 @@
22
22
  {"timestamp":"2025-12-30T08:18:15.791Z","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"}}
23
23
  {"timestamp":"2025-12-30T08:18:15.794Z","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"}}
24
24
  {"timestamp":"2025-12-30T08:18:15.794Z","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)"}}
25
+ {"timestamp":"2026-01-03T13:32:18.916Z","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"}}
26
+ {"timestamp":"2026-01-03T13:32:18.921Z","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"}}
27
+ {"timestamp":"2026-01-03T13:32:18.923Z","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)"}}
28
+ {"timestamp":"2026-01-03T13:32:41.452Z","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"}}
29
+ {"timestamp":"2026-01-03T13:32:41.456Z","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"}}
30
+ {"timestamp":"2026-01-03T13:32:41.458Z","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)"}}