sneakoscope 8.6.4 → 8.6.6
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/commands/doctor.js +26 -6
- package/dist/config/skills-manifest.json +1 -1
- package/dist/core/codex-lb/desktop-bridge/http-forward.js +15 -2
- package/dist/core/codex-lb/desktop-bridge/server.js +10 -3
- package/dist/core/codex-lb/desktop-bridge/websocket-forward.js +1 -1
- package/dist/core/codex-lb/desktop-bridge-migration.js +9 -1
- package/dist/core/doctor/doctor-readiness-matrix.js +3 -0
- 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.6** — 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
|
|
package/dist/commands/doctor.js
CHANGED
|
@@ -59,6 +59,7 @@ export async function restartStaleDesktopBridgeRuntime(input) {
|
|
|
59
59
|
? { restarted: true, warnings: [`desktop_bridge_runtime_restarted:${running}:${PACKAGE_VERSION}`], blockers: [] }
|
|
60
60
|
: { restarted: false, warnings: [], blockers: [`desktop_bridge_runtime_version_stale:${running}:${PACKAGE_VERSION}`] };
|
|
61
61
|
}
|
|
62
|
+
export const CATALOG_REPAIR_MAX_ATTEMPTS = 2;
|
|
62
63
|
export function deferCommandAliasCleanupToMigrationReceipt(result) {
|
|
63
64
|
const observedBlockers = Array.isArray(result?.blockers)
|
|
64
65
|
? result.blockers.map(String).filter(Boolean)
|
|
@@ -1033,7 +1034,10 @@ async function runDoctor(args = [], root, doctorFix, deps = {}) {
|
|
|
1033
1034
|
rollback_evidence: 'combined_catalog_previous_generation_preserved'
|
|
1034
1035
|
};
|
|
1035
1036
|
try {
|
|
1036
|
-
const restarted = await restartStaleDesktopBridgeRuntime({
|
|
1037
|
+
const restarted = await restartStaleDesktopBridgeRuntime({
|
|
1038
|
+
home: path.resolve(process.env.HOME || os.homedir()),
|
|
1039
|
+
fix: doctorFix,
|
|
1040
|
+
});
|
|
1037
1041
|
const status = await desktopBridgeStatusV3({ home: root, env: process.env });
|
|
1038
1042
|
const blockers = (status?.readiness?.blockers || []).map(String);
|
|
1039
1043
|
const stale = blockers.filter((blocker) => blocker.endsWith('_catalog_stale'));
|
|
@@ -1046,13 +1050,29 @@ async function runDoctor(args = [], root, doctorFix, deps = {}) {
|
|
|
1046
1050
|
blockers: restarted.blockers
|
|
1047
1051
|
};
|
|
1048
1052
|
}
|
|
1049
|
-
const
|
|
1050
|
-
|
|
1053
|
+
const attempts = [];
|
|
1054
|
+
let syncedAndVerified = false;
|
|
1055
|
+
for (let attempt = 1; attempt <= CATALOG_REPAIR_MAX_ATTEMPTS; attempt += 1) {
|
|
1056
|
+
const sync = await executeDesktopBridgeCommandV3({ operation: 'catalog.sync' }, { home: root, env: process.env });
|
|
1057
|
+
const commandOk = sync?.ok === true && sync?.execution?.ok === true;
|
|
1058
|
+
const after = await desktopBridgeStatusV3({ home: root, env: process.env });
|
|
1059
|
+
const stillStale = (after?.readiness?.blockers || [])
|
|
1060
|
+
.map(String).filter((blocker) => blocker.endsWith('_catalog_stale'));
|
|
1061
|
+
if (commandOk && stillStale.length === 0) {
|
|
1062
|
+
syncedAndVerified = true;
|
|
1063
|
+
break;
|
|
1064
|
+
}
|
|
1065
|
+
attempts.push(`catalog_sync_attempt_${attempt}:${commandOk ? `still_stale:${stillStale.join(',')}` : (sync?.execution?.blockers || ['failed']).map(String).join(',')}`);
|
|
1066
|
+
}
|
|
1051
1067
|
return {
|
|
1052
1068
|
...base,
|
|
1053
|
-
ok:
|
|
1054
|
-
repaired:
|
|
1055
|
-
|
|
1069
|
+
ok: syncedAndVerified && restarted.blockers.length === 0,
|
|
1070
|
+
repaired: syncedAndVerified || restarted.restarted,
|
|
1071
|
+
warnings: [...restarted.warnings, ...(syncedAndVerified ? attempts : [])],
|
|
1072
|
+
blockers: [
|
|
1073
|
+
...(syncedAndVerified ? [] : ['desktop_bridge_catalog_still_stale_after_repair', ...attempts]),
|
|
1074
|
+
...restarted.blockers
|
|
1075
|
+
]
|
|
1056
1076
|
};
|
|
1057
1077
|
}
|
|
1058
1078
|
catch (error) {
|
|
@@ -3,6 +3,7 @@ import https from 'node:https';
|
|
|
3
3
|
import zlib from 'node:zlib';
|
|
4
4
|
import { pipeline } from 'node:stream/promises';
|
|
5
5
|
import { buildProviderUpstreamHeaders, rewriteResponseHeaders } from './header-policy.js';
|
|
6
|
+
import { createDesktopBridgeRejectionLogger } from './rejection-log.js';
|
|
6
7
|
import { resolveAndBindDesktopBridgeRouteContext, resolveCodexSessionIdentity, resolveDesktopBridgeTarget, safeBridgeErrorCode, singleBridgeHeader } from './security.js';
|
|
7
8
|
import { desktopBridgeListenOrigin } from './state.js';
|
|
8
9
|
import { DesktopBridgeError } from './types.js';
|
|
@@ -120,8 +121,20 @@ function connectTimeout(request, config) {
|
|
|
120
121
|
socket.once('close', () => clearTimeout(timer));
|
|
121
122
|
});
|
|
122
123
|
}
|
|
123
|
-
|
|
124
|
+
const logHttpRejection = createDesktopBridgeRejectionLogger();
|
|
125
|
+
function underlyingErrorCode(error) {
|
|
126
|
+
const code = error?.code;
|
|
127
|
+
return typeof code === 'string' && /^[A-Za-z0-9_]{1,64}$/.test(code) ? code : null;
|
|
128
|
+
}
|
|
129
|
+
function writeHttpBridgeError(res, error, req) {
|
|
124
130
|
const code = safeBridgeErrorCode(error);
|
|
131
|
+
const cause = code === 'bridge_upstream_unavailable' ? underlyingErrorCode(error) : null;
|
|
132
|
+
logHttpRejection({
|
|
133
|
+
code: cause ? `${code}:${cause}` : code,
|
|
134
|
+
transport: 'http',
|
|
135
|
+
...(req?.method === undefined ? {} : { method: req.method }),
|
|
136
|
+
...(req?.url === undefined ? {} : { url: req.url }),
|
|
137
|
+
});
|
|
125
138
|
if (res.headersSent) {
|
|
126
139
|
res.destroy(error instanceof Error ? error : undefined);
|
|
127
140
|
return;
|
|
@@ -215,6 +228,6 @@ export async function forwardHttp(req, res, config, prepared, authenticatedLocal
|
|
|
215
228
|
});
|
|
216
229
|
}
|
|
217
230
|
catch (error) {
|
|
218
|
-
writeHttpBridgeError(res, error);
|
|
231
|
+
writeHttpBridgeError(res, error, req);
|
|
219
232
|
}
|
|
220
233
|
}
|
|
@@ -188,7 +188,14 @@ async function listenExact(server, host, port) {
|
|
|
188
188
|
server.listen({ host, port, exclusive: true });
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
export const DESKTOP_BRIDGE_DRAIN_GRACE_MS = 10_000;
|
|
192
|
+
async function closeServer(server, sockets, activeRequests) {
|
|
193
|
+
if (activeRequests) {
|
|
194
|
+
const deadline = Date.now() + DESKTOP_BRIDGE_DRAIN_GRACE_MS;
|
|
195
|
+
while (activeRequests() > 0 && Date.now() < deadline) {
|
|
196
|
+
await new Promise((resolve) => setTimeout(resolve, 25));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
192
199
|
for (const socket of sockets)
|
|
193
200
|
socket.destroy();
|
|
194
201
|
if (!server.listening)
|
|
@@ -301,7 +308,7 @@ export async function startPreparedDesktopBridge(input, options = {}) {
|
|
|
301
308
|
await writeDesktopBridgeState(statePath, state);
|
|
302
309
|
}
|
|
303
310
|
catch (error) {
|
|
304
|
-
await closeServer(server, sockets);
|
|
311
|
+
await closeServer(server, sockets, () => activeRequests);
|
|
305
312
|
throw error;
|
|
306
313
|
}
|
|
307
314
|
const freshnessMs = input.stateFreshnessMs ?? 5 * 60_000;
|
|
@@ -321,7 +328,7 @@ export async function startPreparedDesktopBridge(input, options = {}) {
|
|
|
321
328
|
stopped = true;
|
|
322
329
|
if (heartbeat)
|
|
323
330
|
clearInterval(heartbeat);
|
|
324
|
-
await closeServer(server, sockets);
|
|
331
|
+
await closeServer(server, sockets, () => activeRequests);
|
|
325
332
|
if (statePath)
|
|
326
333
|
await removeDesktopBridgeStateIfOwned(statePath, state);
|
|
327
334
|
},
|
|
@@ -131,7 +131,7 @@ export async function forwardWebSocket(req, client, head, config, authenticatedL
|
|
|
131
131
|
}
|
|
132
132
|
catch (error) {
|
|
133
133
|
writeUpgradeFailure(client, error, req);
|
|
134
|
-
|
|
134
|
+
return;
|
|
135
135
|
}
|
|
136
136
|
const { provider, credential } = prepared;
|
|
137
137
|
const target = resolveDesktopBridgeTarget(req.url, provider.remote);
|
|
@@ -222,7 +222,7 @@ async function migrateDesktopBridgeConfigUnlocked(input) {
|
|
|
222
222
|
receipt_path: null,
|
|
223
223
|
auth_semantic_identity_preserved: provisional.auth_semantic_identity_preserved,
|
|
224
224
|
blockers: [
|
|
225
|
-
|
|
225
|
+
migrationFailureBlocker(error),
|
|
226
226
|
...(rollback && !rollback.ok ? ['desktop_bridge_unification_rollback_failed'] : [])
|
|
227
227
|
],
|
|
228
228
|
...(rollback ? { rollback } : {}),
|
|
@@ -230,6 +230,14 @@ async function migrateDesktopBridgeConfigUnlocked(input) {
|
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
+
export function migrationFailureBlocker(error) {
|
|
234
|
+
const base = 'desktop_bridge_unification_migration_failed';
|
|
235
|
+
const code = error?.code;
|
|
236
|
+
if (typeof code === 'string' && /^[A-Za-z0-9_]{1,64}$/.test(code))
|
|
237
|
+
return `${base}:${code}`;
|
|
238
|
+
const message = errorMessage(error).trim();
|
|
239
|
+
return /^[a-z0-9_]{1,64}$/.test(message) ? `${base}:${message}` : base;
|
|
240
|
+
}
|
|
233
241
|
function validateConfigTarget(home, configPath) {
|
|
234
242
|
const canonicalPath = path.join(path.resolve(home), '.codex', 'config.toml');
|
|
235
243
|
if (!path.isAbsolute(configPath) || path.resolve(configPath) !== canonicalPath) {
|
|
@@ -373,6 +373,9 @@ function nextActionsForBlockers(blockers) {
|
|
|
373
373
|
});
|
|
374
374
|
}
|
|
375
375
|
function nextActionForRouteBlocker(scope, blocker) {
|
|
376
|
+
if (scope === 'route-image' && /real_output_unverified|not_verified|unverified/.test(blocker)) {
|
|
377
|
+
return `Image route needs manual readiness (${blocker}): invoke Codex App \`$imagegen\` with gpt-image-2 in a fresh task and record the selected raster output path. No \`sks doctor\` run can satisfy this on its own.`;
|
|
378
|
+
}
|
|
376
379
|
if (scope === 'route-image')
|
|
377
380
|
return `Repair image route capability (${blocker}): run \`sks doctor --fix --full --yes\`, then verify Codex App/image auth.`;
|
|
378
381
|
if (scope === 'route-computer-use')
|
package/dist/core/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PACKAGE_VERSION = '8.6.
|
|
1
|
+
export const PACKAGE_VERSION = '8.6.6';
|
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.6",
|
|
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",
|