pumuki-ast-hooks 6.0.6 → 6.0.7
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 +14 -0
- package/docs/USAGE.md +7 -0
- package/package.json +2 -2
- 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 +28 -0
- 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,17 @@
|
|
|
1
|
+
# Release Notes - v6.0.7
|
|
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
|
+
- **God Class detection (backend)**: baseline-first by default; optional hard cap via env; detector always runs (with or without baseline).
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
1
15
|
# Release Notes - v5.5.25
|
|
2
16
|
|
|
3
17
|
**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.7",
|
|
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
|
+
}
|
|
@@ -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,31 @@
|
|
|
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"}
|
|
@@ -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)"}}
|