pumuki-ast-hooks 5.5.9 → 5.5.11

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki-ast-hooks",
3
- "version": "5.5.9",
3
+ "version": "5.5.11",
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": {
@@ -116,6 +116,7 @@
116
116
  },
117
117
  "exports": {
118
118
  ".": "./index.js",
119
+ "./package.json": "./package.json",
119
120
  "./ast": "./scripts/hooks-system/infrastructure/ast/ast-intelligence.js",
120
121
  "./domain": "./scripts/hooks-system/domain/index.js",
121
122
  "./application": "./scripts/hooks-system/application/index.js",
@@ -54,10 +54,10 @@ class EvidenceManager {
54
54
  }
55
55
  const raw = fs.readFileSync(this.evidencePath, 'utf8');
56
56
  const json = JSON.parse(raw);
57
- const ts = json?.timestamp;
58
- if (!ts) return null;
59
- const ms = new Date(ts).getTime();
60
- if (Number.isNaN(ms)) return null;
57
+ const rootMs = new Date(json?.timestamp).getTime();
58
+ const severityMs = new Date(json?.severity_metrics?.last_updated).getTime();
59
+ const ms = [rootMs, severityMs].filter(Number.isFinite).reduce((max, v) => Math.max(max, v), NaN);
60
+ if (!Number.isFinite(ms)) return null;
61
61
  return ms;
62
62
  } catch (error) {
63
63
  const msg = error && error.message ? error.message : String(error);
@@ -89,7 +89,9 @@ class EvidenceMonitorService {
89
89
  try {
90
90
  const raw = this.fs.readFileSync(this.evidencePath, 'utf8');
91
91
  const data = JSON.parse(raw);
92
- const timestamp = new Date(data.timestamp).getTime();
92
+ const rootTimestamp = new Date(data.timestamp).getTime();
93
+ const severityTimestamp = new Date(data?.severity_metrics?.last_updated).getTime();
94
+ const timestamp = [rootTimestamp, severityTimestamp].filter(Number.isFinite).reduce((max, v) => Math.max(max, v), NaN);
93
95
  if (!Number.isFinite(timestamp)) {
94
96
  this.notify({
95
97
  message: 'Evidence timestamp is invalid.',
@@ -14,9 +14,9 @@ for arg in "$@"; do
14
14
  fi
15
15
  done
16
16
 
17
- CLI="$REPO_ROOT/scripts/hooks-system/bin/cli.js"
17
+ CLI="$REPO_ROOT/node_modules/pumuki-ast-hooks/scripts/hooks-system/bin/cli.js"
18
18
  if [[ ! -f "$CLI" ]]; then
19
- CLI="$REPO_ROOT/node_modules/pumuki-ast-hooks/scripts/hooks-system/bin/cli.js"
19
+ CLI="$REPO_ROOT/scripts/hooks-system/bin/cli.js"
20
20
  fi
21
21
 
22
22
  if [[ ! -f "$CLI" ]]; then
@@ -761,6 +761,8 @@ async function validateAndFix(params) {
761
761
  const McpProtocolHandler = require('./services/McpProtocolHandler');
762
762
  const protocolHandler = new McpProtocolHandler(process.stdin, process.stdout);
763
763
 
764
+ const SERVER_NAME = (process.env.MCP_SERVER_NAME || '').trim() || 'ast-intelligence-automation';
765
+
764
766
  async function handleMcpMessage(message) {
765
767
  try {
766
768
  const request = JSON.parse(message);
@@ -788,7 +790,7 @@ async function handleMcpMessage(message) {
788
790
  }
789
791
  },
790
792
  serverInfo: {
791
- name: 'ast-intelligence-automation',
793
+ name: SERVER_NAME,
792
794
  version: '3.0.0',
793
795
  description: 'Autonomous AST Intelligence + Git Flow Automation'
794
796
  }
@@ -180,6 +180,8 @@ function updateAIEvidence(violations, gateResult, tokenUsage) {
180
180
  try {
181
181
  const evidence = JSON.parse(fs.readFileSync(evidencePath, 'utf8'));
182
182
 
183
+ evidence.timestamp = new Date().toISOString();
184
+
183
185
  evidence.severity_metrics = {
184
186
  last_updated: new Date().toISOString(),
185
187
  total_violations: violations.length,