pumuki 6.3.165 → 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,12 @@ 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
|
+
|
|
9
15
|
## [6.3.165] - 2026-05-06
|
|
10
16
|
|
|
11
17
|
### 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,10 +21,12 @@ type JsonRpcResponse = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const MCP_PROTOCOL_VERSION = '2024-11-05';
|
|
24
|
+
const JSON_RPC_VERSION = '2.0';
|
|
24
25
|
const DEFAULT_EVIDENCE_HOST = '127.0.0.1';
|
|
25
26
|
const DEFAULT_EVIDENCE_ROUTE = '/ai-evidence';
|
|
26
27
|
const DEFAULT_EVIDENCE_PORT = 7341;
|
|
27
28
|
const PORT_PROBE_TIMEOUT_MS = 600;
|
|
29
|
+
const JSON_RPC_INVALID_REQUEST = -32600;
|
|
28
30
|
|
|
29
31
|
const toJsonRpcId = (value: unknown): JsonRpcId => {
|
|
30
32
|
if (typeof value === 'string' || typeof value === 'number' || value === null) {
|
|
@@ -39,7 +41,7 @@ const sendMessage = (message: JsonRpcResponse): void => {
|
|
|
39
41
|
|
|
40
42
|
const sendResult = (id: JsonRpcId, result: unknown): void => {
|
|
41
43
|
sendMessage({
|
|
42
|
-
jsonrpc:
|
|
44
|
+
jsonrpc: JSON_RPC_VERSION,
|
|
43
45
|
id,
|
|
44
46
|
result,
|
|
45
47
|
});
|
|
@@ -56,7 +58,7 @@ const sendError = (id: JsonRpcId, code: number, message: string): void => {
|
|
|
56
58
|
});
|
|
57
59
|
};
|
|
58
60
|
|
|
59
|
-
const
|
|
61
|
+
const canConnectToAddress = async (host: string, port: number): Promise<boolean> =>
|
|
60
62
|
await new Promise((resolve) => {
|
|
61
63
|
const socket = new Socket();
|
|
62
64
|
socket.setTimeout(PORT_PROBE_TIMEOUT_MS);
|
|
@@ -75,7 +77,7 @@ const isPortInUse = async (host: string, port: number): Promise<boolean> =>
|
|
|
75
77
|
socket.connect(port, host);
|
|
76
78
|
});
|
|
77
79
|
|
|
78
|
-
const
|
|
80
|
+
const findAvailableListenerNumber = async (host: string): Promise<number> =>
|
|
79
81
|
await new Promise((resolve, reject) => {
|
|
80
82
|
const probe = createServer();
|
|
81
83
|
probe.once('error', reject);
|
|
@@ -111,32 +113,37 @@ const startOrReuseEvidenceHttp = async (): Promise<{
|
|
|
111
113
|
}> => {
|
|
112
114
|
const host = process.env.PUMUKI_EVIDENCE_HOST ?? DEFAULT_EVIDENCE_HOST;
|
|
113
115
|
const route = process.env.PUMUKI_EVIDENCE_ROUTE ?? DEFAULT_EVIDENCE_ROUTE;
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
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`;
|
|
118
123
|
|
|
119
124
|
try {
|
|
120
125
|
const health = (await fetchJson(healthUrl)) as { status?: string };
|
|
121
126
|
if (health.status === 'ok') {
|
|
122
|
-
return { host, port:
|
|
127
|
+
return { host, port: requestedListener, route };
|
|
123
128
|
}
|
|
124
129
|
} catch (error) {
|
|
125
130
|
writeDebugHealthProbeFailure(error);
|
|
126
131
|
}
|
|
127
132
|
|
|
128
|
-
const
|
|
129
|
-
const
|
|
133
|
+
const listenerInUse = await canConnectToAddress(host, requestedListener);
|
|
134
|
+
const resolvedListener = listenerInUse
|
|
135
|
+
? await findAvailableListenerNumber(host)
|
|
136
|
+
: requestedListener;
|
|
130
137
|
startEvidenceContextServer({
|
|
131
138
|
host,
|
|
132
|
-
port:
|
|
139
|
+
port: resolvedListener,
|
|
133
140
|
route,
|
|
134
141
|
repoRoot: process.cwd(),
|
|
135
142
|
});
|
|
136
143
|
|
|
137
144
|
return {
|
|
138
145
|
host,
|
|
139
|
-
port:
|
|
146
|
+
port: resolvedListener,
|
|
140
147
|
route,
|
|
141
148
|
};
|
|
142
149
|
};
|
|
@@ -204,8 +211,8 @@ const run = async (): Promise<void> => {
|
|
|
204
211
|
] as const;
|
|
205
212
|
|
|
206
213
|
const handleRequest = async (request: JsonRpcRequest): Promise<void> => {
|
|
207
|
-
if (request.jsonrpc !==
|
|
208
|
-
sendError(toJsonRpcId(request.id),
|
|
214
|
+
if (request.jsonrpc !== JSON_RPC_VERSION) {
|
|
215
|
+
sendError(toJsonRpcId(request.id), JSON_RPC_INVALID_REQUEST, 'Invalid JSON-RPC version.');
|
|
209
216
|
return;
|
|
210
217
|
}
|
|
211
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": {
|