pumuki-ast-hooks 5.5.3 → 5.5.5
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 +2 -2
- package/scripts/hooks-system/.audit-reports/auto-recovery.log +2 -0
- package/scripts/hooks-system/.audit-reports/install-wizard.log +8 -0
- package/scripts/hooks-system/.audit_tmp/audit.log +0 -0
- package/scripts/hooks-system/.audit_tmp/hook-metrics.jsonl +48 -0
- package/scripts/hooks-system/.hook-system/config.json +8 -0
- package/scripts/hooks-system/application/CompositionRoot.js +31 -19
- package/scripts/hooks-system/application/factories/AdapterFactory.js +6 -6
- package/scripts/hooks-system/application/services/PredictiveHookAdvisor.js +0 -2
- package/scripts/hooks-system/application/services/RealtimeGuardService.js +146 -2
- package/scripts/hooks-system/application/services/SmartDirtyTreeAnalyzer.js +0 -1
- package/scripts/hooks-system/application/services/guard/EvidenceManager.js +31 -7
- package/scripts/hooks-system/application/services/guard/GitTreeManager.js +43 -11
- package/scripts/hooks-system/application/services/guard/GuardNotifier.js +2 -2
- package/scripts/hooks-system/application/services/installation/ConfigurationGeneratorService.js +0 -2
- package/scripts/hooks-system/application/services/installation/GitEnvironmentService.js +0 -3
- package/scripts/hooks-system/application/services/installation/InstallService.js +2 -4
- package/scripts/hooks-system/application/services/installation/McpConfigurator.js +9 -2
- package/scripts/hooks-system/application/services/logging/UnifiedLogger.js +1 -1
- package/scripts/hooks-system/application/services/monitoring/AstMonitor.js +0 -2
- package/scripts/hooks-system/application/services/monitoring/DevDocsMonitor.js +0 -2
- package/scripts/hooks-system/application/services/monitoring/GitTreeMonitorService.js +0 -3
- package/scripts/hooks-system/application/services/notification/NotificationCenterService.js +22 -0
- package/scripts/hooks-system/application/services/notification/components/NotificationRetryExecutor.js +1 -1
- package/scripts/hooks-system/application/services/recovery/AutoRecoveryManager.js +0 -1
- package/scripts/hooks-system/application/services/token/TokenMetricsService.js +1 -1
- package/scripts/hooks-system/application/services/token/TokenMonitorService.js +0 -1
- package/scripts/hooks-system/application/use-cases/AnalyzeCodebaseUseCase.js +0 -2
- package/scripts/hooks-system/application/use-cases/AnalyzeStagedFilesUseCase.js +0 -2
- package/scripts/hooks-system/application/use-cases/AutoExecuteAIStartUseCase.js +0 -1
- package/scripts/hooks-system/application/use-cases/BlockCommitUseCase.js +0 -2
- package/scripts/hooks-system/application/use-cases/GenerateAuditReportUseCase.js +0 -3
- package/scripts/hooks-system/bin/cli.js +16 -0
- package/scripts/hooks-system/domain/services/AuditResultSerializer.js +0 -5
- package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidASTIntelligentAnalyzer.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidASTParser.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidAnalysisOrchestrator.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidArchitectureDetector.js +5 -7
- package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidClassAnalyzer.js +0 -3
- package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidForbiddenLiteralsAnalyzer.js +0 -1
- package/scripts/hooks-system/infrastructure/ast/android/analyzers/AndroidSOLIDAnalyzer.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/archive/ios-rules.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/archive/kotlin-analyzer.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/archive/kotlin-parser.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/archive/swift-analyzer.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/backend/analyzers/BackendArchitectureDetector.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/backend/analyzers/BackendPatternDetector.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/common/BDDTDDWorkflowRules.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/common/rules/BDDRules.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/common/rules/ImplementationRules.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/common/rules/TDDRules.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/common/rules/WorkflowRules.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/frontend/analyzers/FrontendArchitectureDetector.js +14 -16
- package/scripts/hooks-system/infrastructure/ast/frontend/analyzers/FrontendForbiddenLiteralsAnalyzer.js +0 -5
- package/scripts/hooks-system/infrastructure/ast/frontend/analyzers/FrontendSOLIDAnalyzer.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSASTIntelligentAnalyzer.js +17 -2
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSArchitectureDetector.js +10 -12
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSArchitectureRules.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSCICDRules.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSEnterpriseAnalyzer.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSForbiddenLiteralsAnalyzer.js +0 -1
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSNetworkingAdvancedRules.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSPerformanceRules.js +0 -3
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSSPMRules.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSSwiftUIAdvancedRules.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSTestingAdvancedRules.js +0 -2
- package/scripts/hooks-system/infrastructure/ast/ios/native-bridge.js +0 -1
- package/scripts/hooks-system/infrastructure/ast/ios/parsers/SourceKittenParser.js +0 -2
- package/scripts/hooks-system/infrastructure/logging/UnifiedLoggerFactory.js +1 -1
- package/scripts/hooks-system/infrastructure/mcp/ast-intelligence-automation.js +149 -57
- package/scripts/hooks-system/infrastructure/mcp/services/McpProtocolHandler.js +14 -6
- package/scripts/hooks-system/infrastructure/repositories/CursorTokenRepository.js +0 -2
- package/scripts/hooks-system/infrastructure/repositories/FileFindingsRepository.js +0 -2
- package/scripts/hooks-system/infrastructure/repositories/datasources/CursorApiDataSource.js +1 -3
- package/scripts/hooks-system/infrastructure/repositories/datasources/CursorFileDataSource.js +0 -2
- package/scripts/hooks-system/infrastructure/severity/severity-evaluator.js +0 -2
- package/scripts/hooks-system/infrastructure/telemetry/TelemetryService.js +0 -2
- package/scripts/hooks-system/infrastructure/utils/token-manager.js +0 -2
- package/scripts/hooks-system/infrastructure/validators/enforce-english-literals.js +1 -1
- package/scripts/hooks-system/infrastructure/watchdog/__tests__/.audit-reports/token-monitor.log +9 -0
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
|
-
const AuditLogger = require('../../application/services/logging/AuditLogger');
|
|
4
3
|
|
|
5
4
|
class TelemetryService {
|
|
6
5
|
constructor(repoRoot) {
|
|
7
6
|
this.repoRoot = repoRoot || process.cwd();
|
|
8
|
-
this.auditLogger = new AuditLogger({ repoRoot: this.repoRoot });
|
|
9
7
|
this.logFile = path.join(this.repoRoot, '.audit_tmp/autonomous-decisions.jsonl');
|
|
10
8
|
this.thresholds = {
|
|
11
9
|
autoExecute: 90,
|
|
@@ -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('
|
|
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');
|
package/scripts/hooks-system/infrastructure/watchdog/__tests__/.audit-reports/token-monitor.log
CHANGED
|
@@ -22,3 +22,12 @@
|
|
|
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)"}}
|
|
31
|
+
{"timestamp":"2026-01-03T13:47:43.092Z","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"}}
|
|
32
|
+
{"timestamp":"2026-01-03T13:47:43.095Z","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"}}
|
|
33
|
+
{"timestamp":"2026-01-03T13:47:43.096Z","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)"}}
|