pumuki-ast-hooks 6.0.6 → 6.0.8
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 +7 -0
- package/docs/RELEASE_NOTES.md +28 -0
- package/docs/USAGE.md +7 -0
- package/package.json +1 -1
- package/scripts/hooks-system/.audit-reports/auto-recovery.log +1 -0
- package/scripts/hooks-system/.audit-reports/install-wizard.log +4 -0
- package/scripts/hooks-system/.audit_tmp/hook-metrics.jsonl +32 -0
- package/scripts/hooks-system/application/__tests__/DIValidationService.spec.js +17 -0
- package/scripts/hooks-system/domain/strategies/ConcreteDependencyStrategy.js +23 -2
- package/scripts/hooks-system/infrastructure/ast/backend/ast-backend.js +13 -3
- package/scripts/hooks-system/infrastructure/ast/backend/detectors/god-class-detector.js +29 -7
- package/scripts/hooks-system/infrastructure/watchdog/__tests__/.audit-reports/token-monitor.log +3 -0
package/README.md
CHANGED
|
@@ -55,6 +55,13 @@ Documentation:
|
|
|
55
55
|
- `CHANGELOG.md` (Release notes and changes)
|
|
56
56
|
- Keychain/Security casts are exempted from `ios.types.forbidden_type_cast` to avoid false positives in secure storage implementations.
|
|
57
57
|
|
|
58
|
+
Release 6.0.6:
|
|
59
|
+
- Keychain/Security casts are exempted from `ios.types.forbidden_type_cast` to avoid false positives in secure storage implementations.
|
|
60
|
+
- Staging-only detection now ignores deleted files when building the file list.
|
|
61
|
+
|
|
62
|
+
Release 6.0.7:
|
|
63
|
+
- God Class detection (backend): baseline-first by default; optional hard cap via env; detector always runs (with or without baseline).
|
|
64
|
+
|
|
58
65
|
---
|
|
59
66
|
|
|
60
67
|
## Visual Overview
|
package/docs/RELEASE_NOTES.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
# Release Notes - v6.0.8
|
|
2
|
+
|
|
3
|
+
**Release Date**: January 13, 2026
|
|
4
|
+
**Type**: Patch Release
|
|
5
|
+
**Compatibility**: Fully backward compatible with 6.0.x
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## ✅ Fixes
|
|
10
|
+
|
|
11
|
+
- **iOS DIP detector**: protocol-constrained generics (e.g. `<Client: APIClientProtocol>`) are treated as abstract dependencies.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Release Notes - v6.0.7
|
|
16
|
+
|
|
17
|
+
**Release Date**: January 13, 2026
|
|
18
|
+
**Type**: Patch Release
|
|
19
|
+
**Compatibility**: Fully backward compatible with 6.0.x
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## ✅ Fixes
|
|
24
|
+
|
|
25
|
+
- **God Class detection (backend)**: baseline-first by default; optional hard cap via env; detector always runs (with or without baseline).
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
1
29
|
# Release Notes - v5.5.25
|
|
2
30
|
|
|
3
31
|
**Release Date**: January 4, 2026
|
package/docs/USAGE.md
CHANGED
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
+
## Recent Changes (v6.0.6)
|
|
16
|
+
|
|
17
|
+
- Keychain/Security casts are exempted from `ios.types.forbidden_type_cast` to avoid false positives.
|
|
18
|
+
- Staging gate evaluation ignores deleted files when assembling the staged file list.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
15
22
|
## Minimal Example (5 minutes)
|
|
16
23
|
|
|
17
24
|
### Step 1: Install
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumuki-ast-hooks",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.8",
|
|
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": {
|
|
@@ -19,3 +19,4 @@
|
|
|
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
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":{}}
|
|
22
|
+
{"timestamp":"2026-01-13T07:51:05.490Z","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":{}}
|
|
@@ -86,3 +86,7 @@
|
|
|
86
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
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
88
|
{"timestamp":"2026-01-13T00:00:37.050Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_COMPLETED","data":{},"context":{}}
|
|
89
|
+
{"timestamp":"2026-01-13T07:51:05.568Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_START","data":{"repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"},"context":{}}
|
|
90
|
+
{"timestamp":"2026-01-13T07:51:05.577Z","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":{}}
|
|
91
|
+
{"timestamp":"2026-01-13T07:51:05.577Z","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":{}}
|
|
92
|
+
{"timestamp":"2026-01-13T07:51:05.577Z","level":"info","component":"InstallWizard","event":"INSTALL_WIZARD_COMPLETED","data":{},"context":{}}
|
|
@@ -762,3 +762,35 @@
|
|
|
762
762
|
{"timestamp":1768262436969,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
763
763
|
{"timestamp":1768262436969,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
764
764
|
{"timestamp":1768262436969,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
765
|
+
{"timestamp":1768288829103,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
766
|
+
{"timestamp":1768288829103,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
767
|
+
{"timestamp":1768288829103,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
768
|
+
{"timestamp":1768288829103,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
769
|
+
{"timestamp":1768290665487,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
770
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
771
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
772
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
773
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
774
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
775
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
776
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
777
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
778
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
779
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
780
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
781
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
782
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
783
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
784
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
785
|
+
{"timestamp":1768290665488,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
786
|
+
{"timestamp":1768290665489,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
787
|
+
{"timestamp":1768290665489,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
788
|
+
{"timestamp":1768290665489,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
789
|
+
{"timestamp":1768290665489,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
790
|
+
{"timestamp":1768290665489,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
791
|
+
{"timestamp":1768290665489,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
792
|
+
{"timestamp":1768290665489,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
793
|
+
{"timestamp":1768293907758,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
794
|
+
{"timestamp":1768293907758,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
795
|
+
{"timestamp":1768293907758,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
796
|
+
{"timestamp":1768293907758,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
@@ -77,5 +77,22 @@ describe('DIValidationService', () => {
|
|
|
77
77
|
|
|
78
78
|
expect(mockAnalyzer.pushFinding).not.toHaveBeenCalled();
|
|
79
79
|
});
|
|
80
|
+
|
|
81
|
+
it('should skip generic constraints that bind to protocols', async () => {
|
|
82
|
+
mockAnalyzer.fileContent = 'final class TestViewModel<Client: APIClientProtocol> { }';
|
|
83
|
+
const properties = [
|
|
84
|
+
{ 'key.name': 'apiClient', 'key.typename': 'Client' }
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
await diValidationService.validateDependencyInjection(
|
|
88
|
+
mockAnalyzer,
|
|
89
|
+
properties,
|
|
90
|
+
'TestViewModel.swift',
|
|
91
|
+
'TestViewModel',
|
|
92
|
+
10
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
expect(mockAnalyzer.pushFinding).not.toHaveBeenCalled();
|
|
96
|
+
});
|
|
80
97
|
});
|
|
81
98
|
});
|
|
@@ -18,7 +18,7 @@ class ConcreteDependencyStrategy extends DIStrategy {
|
|
|
18
18
|
const typename = prop['key.typename'] || '';
|
|
19
19
|
const propName = prop['key.name'] || '';
|
|
20
20
|
|
|
21
|
-
if (this._shouldSkipType(typename, propName, className)) {
|
|
21
|
+
if (this._shouldSkipType(typename, propName, className, context)) {
|
|
22
22
|
continue;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -34,7 +34,7 @@ class ConcreteDependencyStrategy extends DIStrategy {
|
|
|
34
34
|
return violations;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
_shouldSkipType(typename, propName, className) {
|
|
37
|
+
_shouldSkipType(typename, propName, className, context) {
|
|
38
38
|
if (this.config.allowedTypes.includes(typename)) {
|
|
39
39
|
return true;
|
|
40
40
|
}
|
|
@@ -43,6 +43,10 @@ class ConcreteDependencyStrategy extends DIStrategy {
|
|
|
43
43
|
return true;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
if (this._isGenericConstraintType(typename, className, context)) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
|
|
46
50
|
return false;
|
|
47
51
|
}
|
|
48
52
|
|
|
@@ -62,6 +66,23 @@ class ConcreteDependencyStrategy extends DIStrategy {
|
|
|
62
66
|
return isSingleLetter || (isCamelCase && hasContextHint);
|
|
63
67
|
}
|
|
64
68
|
|
|
69
|
+
_isGenericConstraintType(typename, className, context) {
|
|
70
|
+
const content = context?.analyzer?.fileContent || '';
|
|
71
|
+
if (!content) return false;
|
|
72
|
+
|
|
73
|
+
const classPattern = new RegExp(`\\b(class|struct)\\s+${className}\\s*<([^>]+)>`);
|
|
74
|
+
const match = content.match(classPattern);
|
|
75
|
+
if (!match) return false;
|
|
76
|
+
|
|
77
|
+
const genericClause = match[2];
|
|
78
|
+
const constraints = genericClause.split(',').map((part) => part.trim());
|
|
79
|
+
|
|
80
|
+
return constraints.some((constraint) => {
|
|
81
|
+
const [name, bound] = constraint.split(':').map((value) => value.trim());
|
|
82
|
+
return name === typename && bound;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
65
86
|
_isConcreteService(typename) {
|
|
66
87
|
const hasConcretePattern = this.config.concretePatterns.some(pattern =>
|
|
67
88
|
new RegExp(pattern).test(typename)
|
|
@@ -310,9 +310,19 @@ function runBackendIntelligence(project, findings, platform) {
|
|
|
310
310
|
pushFinding("backend.config.missing_validation", "warning", sf, sf, "Environment variables without validation - consider Joi or class-validator", findings);
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
313
|
+
const hardMaxLines = env.getNumber('AST_GODCLASS_HARD_MAX_LINES', 0);
|
|
314
|
+
const softMaxLines = env.getNumber('AST_GODCLASS_SOFT_MAX_LINES', 500);
|
|
315
|
+
const absoluteGodLines = env.getNumber('AST_GODCLASS_ABSOLUTE_LINES', 1000);
|
|
316
|
+
const underThresholdLines = env.getNumber('AST_GODCLASS_UNDER_THRESHOLD_LINES', 300);
|
|
317
|
+
analyzeGodClasses(sf, findings, {
|
|
318
|
+
SyntaxKind,
|
|
319
|
+
pushFinding,
|
|
320
|
+
godClassBaseline,
|
|
321
|
+
hardMaxLines,
|
|
322
|
+
softMaxLines,
|
|
323
|
+
absoluteGodLines,
|
|
324
|
+
underThresholdLines
|
|
325
|
+
});
|
|
316
326
|
|
|
317
327
|
if (!isRealBackendAppFile) {
|
|
318
328
|
return;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* God Class detector extracted from ast-backend.js to keep responsibilities separated.
|
|
3
3
|
*/
|
|
4
|
-
function analyzeGodClasses(sourceFile, findings, {
|
|
4
|
+
function analyzeGodClasses(sourceFile, findings, {
|
|
5
|
+
SyntaxKind,
|
|
6
|
+
pushFinding,
|
|
7
|
+
godClassBaseline,
|
|
8
|
+
hardMaxLines,
|
|
9
|
+
softMaxLines,
|
|
10
|
+
absoluteGodLines,
|
|
11
|
+
underThresholdLines
|
|
12
|
+
}) {
|
|
5
13
|
const filePath = sourceFile.getFilePath().replace(/\\/g, '/');
|
|
6
14
|
if (
|
|
7
15
|
/\/infrastructure\/ast\//i.test(filePath) ||
|
|
@@ -24,6 +32,12 @@ function analyzeGodClasses(sourceFile, findings, { SyntaxKind, pushFinding, godC
|
|
|
24
32
|
const endLine = cls.getEndLineNumber();
|
|
25
33
|
const lineCount = Math.max(0, endLine - startLine);
|
|
26
34
|
|
|
35
|
+
const hardMax = Number.isFinite(hardMaxLines) && hardMaxLines > 0 ? hardMaxLines : 0;
|
|
36
|
+
const softMax = Number.isFinite(softMaxLines) && softMaxLines > 0 ? softMaxLines : 500;
|
|
37
|
+
const absoluteLines = Number.isFinite(absoluteGodLines) && absoluteGodLines > 0 ? absoluteGodLines : 1000;
|
|
38
|
+
const underLines = Number.isFinite(underThresholdLines) && underThresholdLines > 0 ? underThresholdLines : 300;
|
|
39
|
+
const isHardMaxViolation = hardMax > 0 && lineCount > hardMax;
|
|
40
|
+
|
|
27
41
|
const decisionKinds = [
|
|
28
42
|
SyntaxKind.IfStatement,
|
|
29
43
|
SyntaxKind.ForStatement,
|
|
@@ -51,12 +65,20 @@ function analyzeGodClasses(sourceFile, findings, { SyntaxKind, pushFinding, godC
|
|
|
51
65
|
if (/\bgit\b|rev-parse|git diff|git status|git log/i.test(clsText)) concerns.add('git');
|
|
52
66
|
const concernCount = concerns.size;
|
|
53
67
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
68
|
+
if (isHardMaxViolation) {
|
|
69
|
+
pushFinding("backend.antipattern.god_classes", "critical", sourceFile, cls,
|
|
70
|
+
`God class detected: ${methodsCount} methods, ${propertiesCount} properties, ${lineCount} lines, complexity ${complexity}, concerns ${concernCount} - VIOLATES SRP`,
|
|
71
|
+
findings
|
|
72
|
+
);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const isMassiveFile = lineCount > softMax;
|
|
77
|
+
const isAbsoluteGod = lineCount > absoluteLines ||
|
|
78
|
+
(lineCount > softMax && complexity > 50) ||
|
|
79
|
+
(lineCount > softMax && methodsCount > 20) ||
|
|
80
|
+
(lineCount > (softMax + 100) && methodsCount > 30 && complexity > 80);
|
|
81
|
+
const isUnderThreshold = lineCount < underLines && methodsCount < 15 && complexity < 30;
|
|
60
82
|
|
|
61
83
|
if (!godClassBaseline) {
|
|
62
84
|
if (!isUnderThreshold && (isMassiveFile || isAbsoluteGod)) {
|
package/scripts/hooks-system/infrastructure/watchdog/__tests__/.audit-reports/token-monitor.log
CHANGED
|
@@ -61,3 +61,6 @@
|
|
|
61
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
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
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)"}}
|
|
64
|
+
{"timestamp":"2026-01-13T07:51:07.491Z","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"}}
|
|
65
|
+
{"timestamp":"2026-01-13T07:51:07.492Z","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"}}
|
|
66
|
+
{"timestamp":"2026-01-13T07:51:07.493Z","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)"}}
|