pumuki-ast-hooks 5.3.20 → 5.3.21

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 (95) hide show
  1. package/docs/RELEASE_NOTES.md +35 -0
  2. package/docs/VIOLATIONS_RESOLUTION_PLAN.md +58 -58
  3. package/package.json +3 -3
  4. package/scripts/hooks-system/.AI_TOKEN_STATUS.txt +1 -1
  5. package/scripts/hooks-system/.audit-reports/notifications.log +935 -0
  6. package/scripts/hooks-system/.audit-reports/token-monitor.log +2809 -0
  7. package/scripts/hooks-system/application/CompositionRoot.js +38 -22
  8. package/scripts/hooks-system/application/services/AutonomousOrchestrator.js +0 -18
  9. package/scripts/hooks-system/application/services/ContextDetectionEngine.js +0 -58
  10. package/scripts/hooks-system/application/services/DynamicRulesLoader.js +2 -12
  11. package/scripts/hooks-system/application/services/GitFlowService.js +0 -80
  12. package/scripts/hooks-system/application/services/GitTreeState.js +2 -5
  13. package/scripts/hooks-system/application/services/HookSystemScheduler.js +0 -4
  14. package/scripts/hooks-system/application/services/IntelligentCommitAnalyzer.js +0 -25
  15. package/scripts/hooks-system/application/services/IntelligentGitTreeMonitor.js +0 -11
  16. package/scripts/hooks-system/application/services/PlatformAnalysisService.js +0 -19
  17. package/scripts/hooks-system/application/services/PlatformDetectionService.js +0 -19
  18. package/scripts/hooks-system/application/services/PlaybookRunner.js +1 -22
  19. package/scripts/hooks-system/application/services/PredictiveHookAdvisor.js +0 -19
  20. package/scripts/hooks-system/application/services/RealtimeGuardPlugin.js +0 -25
  21. package/scripts/hooks-system/application/services/RealtimeGuardService.js +71 -41
  22. package/scripts/hooks-system/application/services/SmartDirtyTreeAnalyzer.js +0 -11
  23. package/scripts/hooks-system/application/services/commit/CommitMessageGenerator.js +0 -11
  24. package/scripts/hooks-system/application/services/commit/FeatureDetector.js +0 -11
  25. package/scripts/hooks-system/application/services/evidence/EvidenceContextManager.js +0 -25
  26. package/scripts/hooks-system/application/services/guard/GuardAutoManagerService.js +31 -21
  27. package/scripts/hooks-system/application/services/guard/GuardConfig.js +15 -18
  28. package/scripts/hooks-system/application/services/guard/GuardEventLogger.js +0 -11
  29. package/scripts/hooks-system/application/services/guard/GuardHealthReminder.js +0 -26
  30. package/scripts/hooks-system/application/services/guard/GuardHeartbeatMonitor.js +6 -20
  31. package/scripts/hooks-system/application/services/guard/GuardLockManager.js +0 -11
  32. package/scripts/hooks-system/application/services/guard/GuardMonitorLoop.js +0 -25
  33. package/scripts/hooks-system/application/services/guard/GuardNotificationHandler.js +0 -11
  34. package/scripts/hooks-system/application/services/guard/GuardProcessManager.js +23 -11
  35. package/scripts/hooks-system/application/services/guard/GuardRecoveryService.js +0 -11
  36. package/scripts/hooks-system/application/services/installation/ConfigurationGeneratorService.js +0 -18
  37. package/scripts/hooks-system/application/services/installation/FileSystemInstallerService.js +0 -18
  38. package/scripts/hooks-system/application/services/installation/GitEnvironmentService.js +1 -19
  39. package/scripts/hooks-system/application/services/installation/HookInstaller.js +62 -24
  40. package/scripts/hooks-system/application/services/installation/IdeIntegrationService.js +0 -11
  41. package/scripts/hooks-system/application/services/installation/InstallService.js +1 -25
  42. package/scripts/hooks-system/application/services/installation/McpConfigurator.js +2 -19
  43. package/scripts/hooks-system/application/services/installation/PlatformDetectorService.js +0 -11
  44. package/scripts/hooks-system/application/services/installation/VSCodeTaskConfigurator.js +0 -11
  45. package/scripts/hooks-system/application/services/logging/AuditLogger.js +0 -8
  46. package/scripts/hooks-system/application/services/logging/UnifiedLogger.js +13 -15
  47. package/scripts/hooks-system/application/services/monitoring/ActivityMonitor.js +0 -33
  48. package/scripts/hooks-system/application/services/monitoring/AstMonitor.js +0 -27
  49. package/scripts/hooks-system/application/services/monitoring/DevDocsMonitor.js +0 -26
  50. package/scripts/hooks-system/application/services/monitoring/EvidenceMonitor.js +0 -18
  51. package/scripts/hooks-system/application/services/monitoring/EvidenceMonitorService.js +4 -28
  52. package/scripts/hooks-system/application/services/monitoring/GitTreeMonitor.js +0 -28
  53. package/scripts/hooks-system/application/services/monitoring/GitTreeMonitorService.js +0 -26
  54. package/scripts/hooks-system/application/services/monitoring/HealthCheckProviders.js +0 -4
  55. package/scripts/hooks-system/application/services/monitoring/HealthCheckService.js +0 -25
  56. package/scripts/hooks-system/application/services/monitoring/HeartbeatMonitorService.js +0 -26
  57. package/scripts/hooks-system/application/services/monitoring/TokenMonitor.js +0 -26
  58. package/scripts/hooks-system/application/services/notification/MacNotificationSender.js +0 -11
  59. package/scripts/hooks-system/application/services/notification/NotificationCenterService.js +0 -18
  60. package/scripts/hooks-system/application/services/notification/NotificationDispatcher.js +0 -11
  61. package/scripts/hooks-system/application/services/notification/components/NotificationCooldownManager.js +0 -18
  62. package/scripts/hooks-system/application/services/notification/components/NotificationDeduplicator.js +0 -18
  63. package/scripts/hooks-system/application/services/notification/components/NotificationQueue.js +0 -11
  64. package/scripts/hooks-system/application/services/notification/components/NotificationRetryExecutor.js +0 -20
  65. package/scripts/hooks-system/application/services/platform/PlatformHeuristics.js +0 -19
  66. package/scripts/hooks-system/application/services/recovery/AutoRecoveryManager.js +0 -19
  67. package/scripts/hooks-system/application/services/smart-commit/CommitMessageSuggester.js +0 -11
  68. package/scripts/hooks-system/application/services/smart-commit/FileContextGrouper.js +0 -19
  69. package/scripts/hooks-system/application/services/smart-commit/SmartCommitSummaryBuilder.js +0 -4
  70. package/scripts/hooks-system/application/services/token/CursorTokenService.js +0 -20
  71. package/scripts/hooks-system/application/services/token/TokenMetricsService.js +2 -12
  72. package/scripts/hooks-system/application/services/token/TokenMonitorService.js +0 -19
  73. package/scripts/hooks-system/application/services/token/TokenStatusReporter.js +0 -12
  74. package/scripts/hooks-system/bin/cli.js +15 -1
  75. package/scripts/hooks-system/bin/guard-env.sh +18 -38
  76. package/scripts/hooks-system/bin/guard-supervisor.js +5 -515
  77. package/scripts/hooks-system/bin/session-loader.sh +3 -262
  78. package/scripts/hooks-system/bin/start-guards.sh +21 -184
  79. package/scripts/hooks-system/bin/update-evidence.sh +10 -1161
  80. package/scripts/hooks-system/config/project.config.json +1 -1
  81. package/scripts/hooks-system/domain/events/index.js +31 -24
  82. package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidAnalysisOrchestrator.js +3 -2
  83. package/scripts/hooks-system/infrastructure/ast/ast-core.js +12 -20
  84. package/scripts/hooks-system/infrastructure/ast/ast-intelligence.js +8 -18
  85. package/scripts/hooks-system/infrastructure/ast/backend/analyzers/BackendPatternDetector.js +2 -1
  86. package/scripts/hooks-system/infrastructure/ast/backend/ast-backend.js +18 -14
  87. package/scripts/hooks-system/infrastructure/ast/frontend/ast-frontend.js +196 -196
  88. package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSASTIntelligentAnalyzer.js +3 -2
  89. package/scripts/hooks-system/infrastructure/hooks/skill-activation-prompt.js +3 -2
  90. package/scripts/hooks-system/infrastructure/logging/UnifiedLoggerFactory.js +5 -4
  91. package/scripts/hooks-system/infrastructure/mcp/ast-intelligence-automation.js +88 -0
  92. package/scripts/hooks-system/infrastructure/orchestration/intelligent-audit.js +17 -16
  93. package/scripts/hooks-system/infrastructure/shell/orchestrators/audit-orchestrator.sh +92 -54
  94. package/scripts/hooks-system/infrastructure/telemetry/metrics-server.js +3 -2
  95. package/scripts/hooks-system/infrastructure/validators/enforce-english-literals.js +6 -8
@@ -34,6 +34,41 @@ npm run install-hooks
34
34
 
35
35
  ---
36
36
 
37
+ # Release Notes - v5.3.20
38
+
39
+ **Release Date**: December 31, 2025
40
+ **Type**: Patch Release (compatible with 5.3.x)
41
+ **Compatibility**: Fully backward compatible with 5.3.x
42
+
43
+ ---
44
+
45
+ ## 🎯 Overview
46
+ - Removed runtime side-effects in the library: Express/CORS stripped from entry point; `dotenv.config()` removed from config.
47
+ - Fixed syntax in `ast-backend.js` (test block) to ensure lint/parse correctness.
48
+ - Published npm `pumuki-ast-hooks@5.3.20` (tag `latest`).
49
+
50
+ ---
51
+
52
+ ## 🐛 Bug Fixes
53
+
54
+ ### Fixed: Runtime side-effects
55
+ - **Issue**: Library had runtime side-effects due to Express/CORS and `dotenv.config()`.
56
+ - **Resolution**: Removed Express/CORS from entry point and `dotenv.config()` from config.
57
+ - **Impact**: Library no longer has runtime side-effects.
58
+
59
+ ### Fixed: Syntax in `ast-backend.js`
60
+ - **Issue**: Syntax error in `ast-backend.js` (test block) caused lint/parse issues.
61
+ - **Resolution**: Fixed syntax in `ast-backend.js` (test block).
62
+ - **Impact**: `ast-backend.js` now lint/parse correct.
63
+
64
+ ---
65
+
66
+ ## 📚 Documentation
67
+ - CHANGELOG updated with 5.3.20.
68
+ - Installation notes reviewed for safe npm consumption.
69
+
70
+ ---
71
+
37
72
  # Release Notes - v5.3.9
38
73
 
39
74
  **Release Date**: December 29, 2025
@@ -1,97 +1,97 @@
1
- # 🚀 Plan de Resolución de Violaciones - ast-intelligence-hooks
1
+ # 🚀 Violations Resolution Plan - ast-intelligence-hooks
2
2
 
3
- ## 🧭 Leyenda de Estado (viva)
4
- - ✅ **Hecho** (tarea completada exitosamente)
5
- - 🚧 **En construcción** (tarea en progreso)
6
- - ⏳ **Pendiente** (tarea aún no iniciada)
7
- - ❌ **Bloqueada** (tarea impedida por dependencias o problemas externos)
8
- - 🔄 **Revisión** (tarea completada pero pendiente de verificación o ajustes)
3
+ ## 🧭 Status Legend (living)
4
+ - ✅ **Done** (task completed successfully)
5
+ - 🚧 **In progress** (task currently being worked on)
6
+ - ⏳ **Pending** (task not started yet)
7
+ - ❌ **Blocked** (task blocked by dependencies or external issues)
8
+ - 🔄 **Review** (completed but pending verification/adjustments)
9
9
 
10
10
  ---
11
11
 
12
- ## 📊 Resumen Ejecutivo
13
- - **Estado actual:** ⚠️ Acción requerida (1 crítica, 4 altas, 294 medias, 242 bajas)
12
+ ## 📊 Executive Summary
13
+ - **Current status:** ⚠️ Action required (211 critical, 5 high, 122 medium, 185 low)
14
14
  - **Branch:** `feature/add-prometheus-metrics`
15
- - **Fecha de inicio:** 30/12/2025 — **ETA general:** 15/01/2026
16
- - **Objetivo:** Reducir a 0 las CRÍTICAS/HIGH y bajar el total < 20 antes de permitir commits sin bypass.
17
- - **Riesgos:**
18
- 1) Complejidad al refactorizar excepciones; 2) Dependencias entre módulos/config; 3) Tiempo limitado para instrumentación (Prometheus / audit logging).
15
+ - **Start date:** 2025-12-30 — **Overall ETA:** 2026-01-15
16
+ - **Goal:** Reduce CRITICAL/HIGH to 0 and bring total < 20 before allowing commits without bypass.
17
+ - **Risks:**
18
+ 1) Exception refactor complexity; 2) Cross-module/config dependencies; 3) Limited time for instrumentation (Prometheus / audit logging).
19
19
 
20
- **Referencias rápidas:**
20
+ **Quick references:**
21
21
  - [Violations report](../.violations-by-priority.md)
22
22
  - [AST summary JSON](../.audit-reports/latest_ast_summary.json)
23
23
  - [Arquitectura](../ARCHITECTURE.md)
24
24
 
25
25
  ---
26
26
 
27
- ## 📅 Timeline Visual (fechas estimadas)
27
+ ## 📅 Visual Timeline (estimated dates)
28
28
  ```mermaid
29
29
  gantt
30
- title Fases de Resolución de Violaciones
30
+ title Violations Resolution Phases
31
31
  dateFormat YYYY-MM-DD
32
- section Fase 1: BLOQUEANTES (CRITICAL + HIGH)
33
- Resolver CRITICAL :active, crit1, 2025-12-30, 1d
34
- Resolver HIGH : high1, after crit1, 2d
32
+ section Phase 1: BLOCKERS (CRITICAL + HIGH)
33
+ Resolve CRITICAL :active, crit1, 2025-12-30, 1d
34
+ Resolve HIGH : high1, after crit1, 2d
35
35
 
36
- section Fase 2: MEDIUM
37
- Refactorización MEDIUM : med1, after high1, 7d
36
+ section Phase 2: MEDIUM
37
+ MEDIUM refactoring : med1, after high1, 7d
38
38
 
39
- section Fase 3: LOW
40
- Optimizaciones y documentación : low1, after med1, 5d
39
+ section Phase 3: LOW
40
+ Optimizations and documentation : low1, after med1, 5d
41
41
  ```
42
42
 
43
43
  ---
44
44
 
45
- ## 🔴 Fase 1: Violaciones BLOQUEANTES (CRITICAL + HIGH)
46
- | Estado | Severidad | Cant. | Responsable | DOD (Definition of Done) | Fuente |
45
+ ## 🔴 Phase 1: BLOCKER Violations (CRITICAL + HIGH)
46
+ | Status | Severity | Count | Owner | DOD (Definition of Done) | Source |
47
47
  |--------|-----------|-------|-------------|--------------------------|--------|
48
- | ⏳ | CRITICAL | 1 | BE | Resolver la violación CRITICAL en repositorio (0 CRITICAL para desbloquear) | `.audit_tmp/ast-summary.json` / `.violations-by-priority.md` |
49
- | ⏳ | HIGH | 4 | BE | Resolver las 4 violaciones HIGH en repositorio (0 HIGH para desbloquear) | `.audit_tmp/ast-summary.json` / `.violations-by-priority.md` |
48
+ | ⏳ | CRITICAL | 211 | BE | Resolve CRITICAL violations in repository (0 CRITICAL to unblock) | `.audit_tmp/ast-summary.json` / `.violations-by-priority.md` |
49
+ | ⏳ | HIGH | 5 | BE | Resolve HIGH violations in repository (0 HIGH to unblock) | `.audit_tmp/ast-summary.json` / `.violations-by-priority.md` |
50
50
 
51
51
  ---
52
52
 
53
- ## 🟠 Fase 2: Violaciones MEDIUM (294)
54
- | Estado | Violación | Cant. | Responsable | DOD | Doc |
53
+ ## 🟠 Phase 2: MEDIUM Violations (122)
54
+ | Status | Violation | Count | Owner | DOD | Doc |
55
55
  |--------|-----------|-------|-------------|-----|-----|
56
- | ⏳ | MEDIUM | 294 | BE | Resolver violaciones de complejidad media restantes | [Medium violations](../docs/medium-violations.md) |
56
+ | ⏳ | MEDIUM | 122 | BE | Resolve remaining medium-complexity violations | [Medium violations](../docs/medium-violations.md) |
57
57
 
58
58
  ---
59
59
 
60
- ## 🔵 Fase 3: Violaciones LOW (242)
61
- | Estado | Violación | Cant. | Responsable | DOD | Doc |
60
+ ## 🔵 Phase 3: LOW Violations (185)
61
+ | Status | Violation | Count | Owner | DOD | Doc |
62
62
  |--------|-----------|-------|-------------|-----|-----|
63
- | ⏳ | LOW | 242 | BE/FE | Resolver violaciones de baja prioridad restantes | [Low violations](../docs/low-violations.md) |
63
+ | ⏳ | LOW | 185 | BE/FE | Resolve remaining low-priority violations | [Low violations](../docs/low-violations.md) |
64
64
 
65
65
  ---
66
66
 
67
- ## 🎯 Top violaciones (por volumen / impacto) — para priorizar dentro de MEDIUM/LOW
68
- | Prioridad | Violación | Cant. | Notas |
67
+ ## 🎯 Top violations (by volume / impact) — to prioritize within MEDIUM/LOW
68
+ | Priority | Violation | Count | Notes |
69
69
  |----------|-----------|-------|------|
70
- | P1 | backend.error.custom_exceptions | 105 | Normalmente MEDIUM: refactor a CustomError + reemplazo de `Error` genérico en BE |
71
- | P1 | backend.config.missing_env_separation | 81 | Normalmente MEDIUM: separar config por entorno |
72
- | P1 | backend.security.missing_audit_logging | 69 | Normalmente MEDIUM: audit trail en operaciones sensibles |
73
- | P2 | backend.metrics.missing_prometheus | 42 | MEDIUM/LOW según regla: instrumentación de servicios |
74
- | P2 | backend.reliability.missing_bulkhead | 41 | MEDIUM/LOW: bulkheads/timeouts en puntos críticos |
75
- | P2 | backend.testing.mocks | 40 | MEDIUM: mejorar estrategia de tests |
76
- | P2 | backend.observability.missing_prometheus | 30 | LOW: observabilidad y dashboards |
77
- | P3 | backend.event.handler | 26 | LOW: try/catch y resiliencia |
70
+ | P1 | backend.error.custom_exceptions | 105 | Typically MEDIUM: refactor to CustomError + replace generic `Error` in backend |
71
+ | P1 | backend.config.missing_env_separation | 81 | Typically MEDIUM: environment-specific config separation |
72
+ | P1 | backend.security.missing_audit_logging | 69 | Typically MEDIUM: audit trail for sensitive operations |
73
+ | P2 | backend.metrics.missing_prometheus | 42 | MEDIUM/LOW depending on rule: service instrumentation |
74
+ | P2 | backend.reliability.missing_bulkhead | 41 | MEDIUM/LOW: bulkheads/timeouts in critical paths |
75
+ | P2 | backend.testing.mocks | 40 | MEDIUM: improve testing strategy |
76
+ | P2 | backend.observability.missing_prometheus | 30 | LOW: observability and dashboards |
77
+ | P3 | backend.event.handler | 26 | LOW: try/catch and resilience |
78
78
  | P3 | backend.auth.missing_cors | 17 | LOW: CORS/headers |
79
- | P3 | backend.event.emitter | 14 | LOW: emisores de eventos seguros |
79
+ | P3 | backend.event.emitter | 14 | LOW: safe event emitters |
80
80
 
81
81
  ---
82
82
 
83
- ## 📈 Métricas de Progreso
84
- | Fase | Total | Completado | % |
83
+ ## 📈 Progress Metrics
84
+ | Phase | Total | Completed | % |
85
85
  |------|-------|------------|---|
86
- | BLOQUEANTES (CRITICAL + HIGH) | 5 | 0 | 0% |
87
- | MEDIUM | 294 | 0 | 0% |
88
- | LOW | 242 | 0 | 0% |
89
- | **TOTAL** | **541** | **0** | **0%** |
90
-
91
- **Riesgos actualizados:**
92
- 1) Implementación de Prometheus podría requerir cambios de infra; 2) Revisión de seguridad depende de disponibilidad de equipo; 3) Refactorizaciones pueden impactar tiempos.
93
-
94
- **Comentarios/Notas colaborativas:**
95
- - Añade comentarios bajo cada tabla al cerrar tareas (usa la leyenda para actualizar estados).
96
- - Progreso en métricas Prometheus: aplicada una barrida automática sobre `scripts/hooks-system/application/services/**`; el audit sigue reportando 42 (`backend.metrics.missing_prometheus`) y 30 (`backend.observability.missing_prometheus`) pendientes.
97
- - Último escaneo: 449 archivos, 541 violaciones totales (1 crítica, 4 altas, 294 medias, 242 bajas).
86
+ | BLOCKERS (CRITICAL + HIGH) | 216 | 0 | 0% |
87
+ | MEDIUM | 122 | 0 | 0% |
88
+ | LOW | 185 | 0 | 0% |
89
+ | **TOTAL** | **523** | **0** | **0%** |
90
+
91
+ **Updated risks:**
92
+ 1) Prometheus implementation may require infra changes; 2) Security review depends on team availability; 3) Refactors may impact timelines.
93
+
94
+ **Collaborative notes:**
95
+ - Add notes under each table when closing tasks (use the legend to update status).
96
+ - Progress on Prometheus metrics: automatic sweep applied over `scripts/hooks-system/application/services/**`; the audit still reports 42 (`backend.metrics.missing_prometheus`) and 30 (`backend.observability.missing_prometheus`) pending.
97
+ - Last scan (31/12/2025 10:39): 451 files, 523 total violations (211 critical, 5 high, 122 medium, 185 low).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki-ast-hooks",
3
- "version": "5.3.20",
3
+ "version": "5.3.21",
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": {
@@ -20,7 +20,7 @@
20
20
  "hook-plan-review": "./bin/plan-review.js"
21
21
  },
22
22
  "scripts": {
23
- "install-hooks": "npx ast-install",
23
+ "install-hooks": "node bin/install.js",
24
24
  "check-version": "node bin/check-version.js",
25
25
  "audit": "node bin/ast",
26
26
  "ast": "node bin/ast",
@@ -122,4 +122,4 @@
122
122
  "./skills": "./skills/skill-rules.json",
123
123
  "./hooks": "./hooks/index.js"
124
124
  }
125
- }
125
+ }
@@ -12,5 +12,5 @@ Source: file
12
12
 
13
13
  ℹ️ Data is stale. Ensure guards are running and refreshing token usage.
14
14
 
15
- Last updated: 2025-12-30T08:58:22.226Z
15
+ Last updated: 2026-01-02T08:34:46.296Z
16
16
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━