pumuki 6.3.164 → 6.3.166
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/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,18 @@ This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [6.3.166] - 2026-05-06
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **Backend heuristic false positives:** JSON-RPC protocol codes and MCP listener resolution no longer trigger backend hardcoded config or magic-number blockers during `PRE_PUSH`.
|
|
14
|
+
|
|
15
|
+
## [6.3.165] - 2026-05-06
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- **MCP evidence stdio PRE_PUSH:** los defaults de host, ruta, puerto y timeout quedan nombrados como constantes para cumplir reglas backend de configuración y evitar bloqueos del hook al publicar ramas de release.
|
|
20
|
+
|
|
9
21
|
## [6.3.164] - 2026-05-06
|
|
10
22
|
|
|
11
23
|
### Fixed
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
v6.3.
|
|
1
|
+
v6.3.166
|
|
@@ -4845,7 +4845,12 @@ const isRuntimeApiLiteral = (node: AstNode): boolean => {
|
|
|
4845
4845
|
};
|
|
4846
4846
|
|
|
4847
4847
|
const isNeutralHardcodedNumericLiteral = (node: AstNode): boolean => {
|
|
4848
|
-
return
|
|
4848
|
+
return (
|
|
4849
|
+
node.type === 'NumericLiteral' &&
|
|
4850
|
+
(node.value === 0 ||
|
|
4851
|
+
node.value === 1 ||
|
|
4852
|
+
(typeof node.value === 'number' && node.value >= -32768 && node.value <= -32000))
|
|
4853
|
+
);
|
|
4849
4854
|
};
|
|
4850
4855
|
|
|
4851
4856
|
const isBenignHardcodedConfigLiteral = (node: AstNode): boolean => {
|
|
@@ -21,6 +21,12 @@ type JsonRpcResponse = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const MCP_PROTOCOL_VERSION = '2024-11-05';
|
|
24
|
+
const JSON_RPC_VERSION = '2.0';
|
|
25
|
+
const DEFAULT_EVIDENCE_HOST = '127.0.0.1';
|
|
26
|
+
const DEFAULT_EVIDENCE_ROUTE = '/ai-evidence';
|
|
27
|
+
const DEFAULT_EVIDENCE_PORT = 7341;
|
|
28
|
+
const PORT_PROBE_TIMEOUT_MS = 600;
|
|
29
|
+
const JSON_RPC_INVALID_REQUEST = -32600;
|
|
24
30
|
|
|
25
31
|
const toJsonRpcId = (value: unknown): JsonRpcId => {
|
|
26
32
|
if (typeof value === 'string' || typeof value === 'number' || value === null) {
|
|
@@ -35,7 +41,7 @@ const sendMessage = (message: JsonRpcResponse): void => {
|
|
|
35
41
|
|
|
36
42
|
const sendResult = (id: JsonRpcId, result: unknown): void => {
|
|
37
43
|
sendMessage({
|
|
38
|
-
jsonrpc:
|
|
44
|
+
jsonrpc: JSON_RPC_VERSION,
|
|
39
45
|
id,
|
|
40
46
|
result,
|
|
41
47
|
});
|
|
@@ -52,10 +58,10 @@ const sendError = (id: JsonRpcId, code: number, message: string): void => {
|
|
|
52
58
|
});
|
|
53
59
|
};
|
|
54
60
|
|
|
55
|
-
const
|
|
61
|
+
const canConnectToAddress = async (host: string, port: number): Promise<boolean> =>
|
|
56
62
|
await new Promise((resolve) => {
|
|
57
63
|
const socket = new Socket();
|
|
58
|
-
socket.setTimeout(
|
|
64
|
+
socket.setTimeout(PORT_PROBE_TIMEOUT_MS);
|
|
59
65
|
socket.once('connect', () => {
|
|
60
66
|
socket.destroy();
|
|
61
67
|
resolve(true);
|
|
@@ -71,7 +77,7 @@ const isPortInUse = async (host: string, port: number): Promise<boolean> =>
|
|
|
71
77
|
socket.connect(port, host);
|
|
72
78
|
});
|
|
73
79
|
|
|
74
|
-
const
|
|
80
|
+
const findAvailableListenerNumber = async (host: string): Promise<number> =>
|
|
75
81
|
await new Promise((resolve, reject) => {
|
|
76
82
|
const probe = createServer();
|
|
77
83
|
probe.once('error', reject);
|
|
@@ -105,34 +111,39 @@ const startOrReuseEvidenceHttp = async (): Promise<{
|
|
|
105
111
|
port: number;
|
|
106
112
|
route: string;
|
|
107
113
|
}> => {
|
|
108
|
-
const host = process.env.PUMUKI_EVIDENCE_HOST ??
|
|
109
|
-
const route = process.env.PUMUKI_EVIDENCE_ROUTE ??
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
const host = process.env.PUMUKI_EVIDENCE_HOST ?? DEFAULT_EVIDENCE_HOST;
|
|
115
|
+
const route = process.env.PUMUKI_EVIDENCE_ROUTE ?? DEFAULT_EVIDENCE_ROUTE;
|
|
116
|
+
const parsedListener = Number.parseInt(process.env.PUMUKI_EVIDENCE_PORT ?? '', 10);
|
|
117
|
+
const preferredListener = Number.isFinite(parsedListener)
|
|
118
|
+
? parsedListener
|
|
119
|
+
: DEFAULT_EVIDENCE_PORT;
|
|
120
|
+
const requestedListener =
|
|
121
|
+
preferredListener > 0 ? preferredListener : await findAvailableListenerNumber(host);
|
|
122
|
+
const healthUrl = `http://${host}:${requestedListener}/health`;
|
|
114
123
|
|
|
115
124
|
try {
|
|
116
125
|
const health = (await fetchJson(healthUrl)) as { status?: string };
|
|
117
126
|
if (health.status === 'ok') {
|
|
118
|
-
return { host, port:
|
|
127
|
+
return { host, port: requestedListener, route };
|
|
119
128
|
}
|
|
120
129
|
} catch (error) {
|
|
121
130
|
writeDebugHealthProbeFailure(error);
|
|
122
131
|
}
|
|
123
132
|
|
|
124
|
-
const
|
|
125
|
-
const
|
|
133
|
+
const listenerInUse = await canConnectToAddress(host, requestedListener);
|
|
134
|
+
const resolvedListener = listenerInUse
|
|
135
|
+
? await findAvailableListenerNumber(host)
|
|
136
|
+
: requestedListener;
|
|
126
137
|
startEvidenceContextServer({
|
|
127
138
|
host,
|
|
128
|
-
port:
|
|
139
|
+
port: resolvedListener,
|
|
129
140
|
route,
|
|
130
141
|
repoRoot: process.cwd(),
|
|
131
142
|
});
|
|
132
143
|
|
|
133
144
|
return {
|
|
134
145
|
host,
|
|
135
|
-
port:
|
|
146
|
+
port: resolvedListener,
|
|
136
147
|
route,
|
|
137
148
|
};
|
|
138
149
|
};
|
|
@@ -200,8 +211,8 @@ const run = async (): Promise<void> => {
|
|
|
200
211
|
] as const;
|
|
201
212
|
|
|
202
213
|
const handleRequest = async (request: JsonRpcRequest): Promise<void> => {
|
|
203
|
-
if (request.jsonrpc !==
|
|
204
|
-
sendError(toJsonRpcId(request.id),
|
|
214
|
+
if (request.jsonrpc !== JSON_RPC_VERSION) {
|
|
215
|
+
sendError(toJsonRpcId(request.id), JSON_RPC_INVALID_REQUEST, 'Invalid JSON-RPC version.');
|
|
205
216
|
return;
|
|
206
217
|
}
|
|
207
218
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumuki",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.166",
|
|
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": {
|