sneakoscope 8.6.3 → 8.6.4
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 +1 -1
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/dist/config/skills-manifest.json +1 -1
- package/dist/core/codex-lb/desktop-bridge/security.js +1 -1
- package/dist/core/codex-lb/desktop-bridge/websocket-forward.js +55 -10
- package/dist/core/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Proof-first orchestration for Codex CLI, ChatGPT Desktop, AI coding agents, mult
|
|
|
22
22
|
Sneakoscope Codex (`sks`) is an open-source trust layer for Codex CLI and ChatGPT Desktop. It coordinates bounded AI coding agents, records machine-verifiable evidence, preserves project memory, and blocks release claims that are not supported by current tests or artifacts. Search visibility outcomes are measured separately; SKS does not promise rankings or traffic.
|
|
23
23
|
<!-- END SKS SEARCH VISIBILITY MARKETING -->
|
|
24
24
|
|
|
25
|
-
This README documents package **SKS 8.6.
|
|
25
|
+
This README documents package **SKS 8.6.4** — its own identity, read from `package.json` and subject to release-gate verification, not advice about what to install.
|
|
26
26
|
|
|
27
27
|
Use the official latest stable SKS and Codex CLI releases. The Codex compatibility SSOT is always the **current latest stable** host; capability probes measure what that host can actually do. Product docs do not crown a fixed `0.x.y` string as SSOT (release pins and schema directories are measured artifacts for the current package, not a permanent product version claim). Menu Bar / Center induce updates to the latest stable build. Run `sks update-check` for what is installed and read the capability report for what is supported. Install SSOT is npm `sneakoscope@latest`; PATH `sks` and Menu Bar stamped generation must match that version or gates fail. It resolves managed SKS skills from the authoritative global install, preserves a runnable Naruto child slot when `max_threads=2`, and keeps Menu Bar repair transactional so stamped generations remain verifiable. Naruto uses stable opt-in multi-agent V2 when the host exposes it (Codex official multi-agent wrap-only; SKS does not reimplement a parallel runtime). Local code search is mode-separated (`sks search files|text|structure|symbol|context`); `context` is answered by the compiled TriWiki Context Graph (`context-graph.json` is exhaustive authority; `context-pack.json` and managed `AGENTS.md` are bounded projections) — see [docs/architecture/context-graph.md](https://github.com/mandarange/Sneakoscope-Codex/blob/main/docs/architecture/context-graph.md) and [docs/PRODUCT-CONTRACT.md](https://github.com/mandarange/Sneakoscope-Codex/blob/main/docs/PRODUCT-CONTRACT.md). See [CHANGELOG.md](https://github.com/mandarange/Sneakoscope-Codex/blob/main/CHANGELOG.md).
|
|
28
28
|
|
|
@@ -284,7 +284,7 @@ function sameSessionPin(left, right) {
|
|
|
284
284
|
&& left.catalog_generation === right.catalog_generation
|
|
285
285
|
&& left.route_policy_generation === right.route_policy_generation;
|
|
286
286
|
}
|
|
287
|
-
function canonicalSessionId(value) {
|
|
287
|
+
export function canonicalSessionId(value) {
|
|
288
288
|
const sessionId = typeof value === 'string' ? value.trim() : '';
|
|
289
289
|
if (!sessionId || sessionId.length > 256 || !/^[A-Za-z0-9._:/-]+$/.test(sessionId)) {
|
|
290
290
|
throw new DesktopBridgeError('bridge_session_id_invalid');
|
|
@@ -2,8 +2,9 @@ import { createHash, randomBytes } from 'node:crypto';
|
|
|
2
2
|
import net from 'node:net';
|
|
3
3
|
import tls from 'node:tls';
|
|
4
4
|
import { buildProviderWebSocketHeaders } from './header-policy.js';
|
|
5
|
+
import { createDesktopBridgeRejectionLogger } from './rejection-log.js';
|
|
5
6
|
import { rewriteLocationHeader } from './location-rewrite.js';
|
|
6
|
-
import { resolveAndBindDesktopBridgeRouteContext, resolveCodexSessionIdentity, resolveDesktopBridgeTarget, singleBridgeHeader } from './security.js';
|
|
7
|
+
import { resolveAndBindDesktopBridgeRouteContext, resolveCodexSessionIdentity, resolveDesktopBridgeTarget, safeBridgeErrorCode, singleBridgeHeader, canonicalSessionId } from './security.js';
|
|
7
8
|
import { desktopBridgeListenOrigin } from './state.js';
|
|
8
9
|
import { DESKTOP_BRIDGE_DIAGNOSTIC_PROTOCOL, DesktopBridgeError, } from './types.js';
|
|
9
10
|
const MAX_HEAD = 64 * 1024;
|
|
@@ -64,10 +65,28 @@ function rewriteUpgradeResponseHead(head, providerBaseUrl, localOrigin) {
|
|
|
64
65
|
}
|
|
65
66
|
return Buffer.from(`${output.join('\r\n')}\r\n\r\n`, 'latin1');
|
|
66
67
|
}
|
|
68
|
+
function websocketPinnedModel(threadId, config) {
|
|
69
|
+
if (!threadId)
|
|
70
|
+
return null;
|
|
71
|
+
let canonical;
|
|
72
|
+
try {
|
|
73
|
+
canonical = canonicalSessionId(threadId);
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const pin = config.providerSessionPins.find((entry) => entry.thread_id === canonical);
|
|
79
|
+
return pin?.public_model || null;
|
|
80
|
+
}
|
|
67
81
|
export async function prepareDesktopBridgeWebSocketRequest(req, config) {
|
|
68
82
|
const sessionIdentity = resolveCodexSessionIdentity(req.headers);
|
|
83
|
+
const pinnedModel = websocketPinnedModel(sessionIdentity.thread_id, config);
|
|
84
|
+
const publicModel = singleBridgeHeader(req.headers, 'x-sks-model') || pinnedModel || '';
|
|
85
|
+
if (!publicModel) {
|
|
86
|
+
throw new DesktopBridgeError('bridge_websocket_route_unresolvable');
|
|
87
|
+
}
|
|
69
88
|
const route = await resolveAndBindDesktopBridgeRouteContext({
|
|
70
|
-
public_model:
|
|
89
|
+
public_model: publicModel,
|
|
71
90
|
session_id: sessionIdentity.thread_id,
|
|
72
91
|
pathname: new URL(req.url || '/', 'http://bridge.invalid').pathname,
|
|
73
92
|
transport: 'websocket', headers: req.headers,
|
|
@@ -82,9 +101,28 @@ export async function prepareDesktopBridgeWebSocketRequest(req, config) {
|
|
|
82
101
|
}
|
|
83
102
|
return { route, provider, credential };
|
|
84
103
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
104
|
+
const logWebSocketRejection = createDesktopBridgeRejectionLogger();
|
|
105
|
+
const PERMANENT_UPGRADE_REFUSALS = new Set([
|
|
106
|
+
'bridge_websocket_route_unresolvable',
|
|
107
|
+
'catalog_model_route_missing',
|
|
108
|
+
'bridge_provider_route_unavailable',
|
|
109
|
+
]);
|
|
110
|
+
function writeUpgradeFailure(client, error, req) {
|
|
111
|
+
const code = safeBridgeErrorCode(error) || 'bridge_websocket_upstream_unavailable';
|
|
112
|
+
const permanent = PERMANENT_UPGRADE_REFUSALS.has(code);
|
|
113
|
+
const status = permanent ? 501 : 502;
|
|
114
|
+
const reason = permanent ? 'Not Implemented' : 'Bad Gateway';
|
|
115
|
+
logWebSocketRejection({
|
|
116
|
+
code,
|
|
117
|
+
transport: 'websocket',
|
|
118
|
+
...(req?.method === undefined ? {} : { method: req.method }),
|
|
119
|
+
...(req?.url === undefined ? {} : { url: req.url }),
|
|
120
|
+
status,
|
|
121
|
+
});
|
|
122
|
+
if (client.destroyed)
|
|
123
|
+
return;
|
|
124
|
+
client.end(`HTTP/1.1 ${status} ${reason}\r\nContent-Type: application/json\r\nCache-Control: no-store\r\nConnection: close\r\n\r\n`
|
|
125
|
+
+ JSON.stringify({ error: { type: 'sks_bridge_error', code, retryable: !permanent } }));
|
|
88
126
|
}
|
|
89
127
|
export async function forwardWebSocket(req, client, head, config, authenticatedLocalBaseUrl = desktopBridgeListenOrigin(config)) {
|
|
90
128
|
let prepared;
|
|
@@ -92,7 +130,7 @@ export async function forwardWebSocket(req, client, head, config, authenticatedL
|
|
|
92
130
|
prepared = await prepareDesktopBridgeWebSocketRequest(req, config);
|
|
93
131
|
}
|
|
94
132
|
catch (error) {
|
|
95
|
-
writeUpgradeFailure(client);
|
|
133
|
+
writeUpgradeFailure(client, error, req);
|
|
96
134
|
throw error;
|
|
97
135
|
}
|
|
98
136
|
const { provider, credential } = prepared;
|
|
@@ -106,15 +144,22 @@ export async function forwardWebSocket(req, client, head, config, authenticatedL
|
|
|
106
144
|
let response = Buffer.alloc(0);
|
|
107
145
|
const timer = setTimeout(() => upstream.destroy(new DesktopBridgeError('bridge_upstream_connect_timeout')), config.connectTimeoutMs);
|
|
108
146
|
timer.unref();
|
|
109
|
-
const fail = () => { clearTimeout(timer); if (!connected)
|
|
110
|
-
writeUpgradeFailure(client);
|
|
147
|
+
const fail = (error) => { clearTimeout(timer); if (!connected)
|
|
148
|
+
writeUpgradeFailure(client, error, req);
|
|
111
149
|
else
|
|
112
150
|
client.destroy(); };
|
|
113
151
|
const onConnected = () => {
|
|
114
152
|
connected = true;
|
|
115
153
|
clearTimeout(timer);
|
|
116
154
|
upstream.setNoDelay(true);
|
|
117
|
-
upstream.setTimeout(config.idleTimeoutMs, () =>
|
|
155
|
+
upstream.setTimeout(config.idleTimeoutMs, () => {
|
|
156
|
+
logWebSocketRejection({
|
|
157
|
+
code: 'bridge_websocket_upstream_idle_timeout',
|
|
158
|
+
transport: 'websocket',
|
|
159
|
+
...(req.url === undefined ? {} : { url: req.url }),
|
|
160
|
+
});
|
|
161
|
+
upstream.destroy(new DesktopBridgeError('bridge_websocket_upstream_idle_timeout'));
|
|
162
|
+
});
|
|
118
163
|
const headers = buildProviderWebSocketHeaders(req.headers, { providerId: provider.provider_id, authTransport: provider.auth_transport, credential }, target.host);
|
|
119
164
|
upstream.write([`${req.method || 'GET'} ${target.pathname}${target.search} HTTP/1.1`, ...serializeHeaders(headers), '', ''].join('\r\n'));
|
|
120
165
|
if (head.length)
|
|
@@ -150,7 +195,7 @@ export async function forwardWebSocket(req, client, head, config, authenticatedL
|
|
|
150
195
|
upstream.once('secureConnect', onConnected);
|
|
151
196
|
else
|
|
152
197
|
upstream.once('connect', onConnected);
|
|
153
|
-
upstream.once('error', fail);
|
|
198
|
+
upstream.once('error', (error) => fail(error));
|
|
154
199
|
upstream.once('close', () => { clearTimeout(timer); if (!client.destroyed)
|
|
155
200
|
client.end(); });
|
|
156
201
|
client.once('error', () => upstream.destroy());
|
package/dist/core/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PACKAGE_VERSION = '8.6.
|
|
1
|
+
export const PACKAGE_VERSION = '8.6.4';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sneakoscope",
|
|
3
3
|
"displayName": "ㅅㅋㅅ",
|
|
4
|
-
"version": "8.6.
|
|
4
|
+
"version": "8.6.4",
|
|
5
5
|
"description": "Sneakoscope Codex (`sks`) is an open-source trust layer for Codex CLI and ChatGPT Desktop. It coordinates bounded AI coding agents, records machine-verifiable evidence, preserves project memory, and blocks release claims that are not supported by current tests or artifacts. Search visibility outcomes are measured separately; SKS does not promise rankings or traffic.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"homepage": "https://github.com/mandarange/Sneakoscope-Codex#readme",
|