sneakoscope 6.7.0 → 7.0.0

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.
Files changed (34) hide show
  1. package/README.md +3 -3
  2. package/crates/sks-core/Cargo.lock +1 -1
  3. package/crates/sks-core/Cargo.toml +1 -1
  4. package/dist/cli/install-helpers-codex-lb-config.js +71 -0
  5. package/dist/cli/install-helpers-codex-lb-selftest.js +11 -14
  6. package/dist/cli/install-helpers.js +305 -53
  7. package/dist/config/skills-manifest.json +52 -52
  8. package/dist/core/agents/agent-orchestrator.js +56 -5
  9. package/dist/core/agents/agent-roster.js +4 -2
  10. package/dist/core/codex-app/codex-app-fast-ui-repair.js +18 -1
  11. package/dist/core/codex-app/codex-app-ui-state-snapshot.js +16 -0
  12. package/dist/core/codex-app.js +52 -6
  13. package/dist/core/hooks-runtime.js +77 -3
  14. package/dist/core/managed-assets/managed-assets-manifest.js +1 -1
  15. package/dist/core/release/package-size-budget.js +1 -1
  16. package/dist/core/subagents/official-subagent-config.js +8 -5
  17. package/dist/core/subagents/official-subagent-preparation.js +24 -1
  18. package/dist/core/subagents/official-subagent-prompt.js +3 -2
  19. package/dist/core/subagents/wave-lifecycle.js +20 -0
  20. package/dist/core/subagents/wave-parent-guidance.js +42 -0
  21. package/dist/core/version.js +1 -1
  22. package/dist/native/sks-menubar/Sources/AppIdentity.swift +3 -1
  23. package/dist/native/sks-menubar/Sources/ControlCenterWindowController.swift +14 -8
  24. package/dist/native/sks-menubar/Sources/DiagnosticsViewController.swift +71 -7
  25. package/dist/native/sks-menubar/Sources/MCPServersViewController.swift +50 -9
  26. package/dist/native/sks-menubar/Sources/OverviewViewController.swift +61 -8
  27. package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +120 -29
  28. package/dist/native/sks-menubar/Sources/RemoteTelegramViewController.swift +58 -23
  29. package/dist/native/sks-menubar/Sources/SettingsViewController.swift +41 -7
  30. package/dist/native/sks-menubar/Sources/StatusItemController.swift +34 -3
  31. package/dist/native/sks-menubar/Sources/UpdatesViewController.swift +38 -8
  32. package/dist/scripts/docs-truthfulness-check.js +2 -2
  33. package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +7 -3
  34. package/package.json +1 -1
package/README.md CHANGED
@@ -18,11 +18,11 @@ Proof-first orchestration for Codex CLI, ChatGPT Desktop, AI coding agents, mult
18
18
  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.
19
19
  <!-- END SKS SEARCH VISIBILITY MARKETING -->
20
20
 
21
- Current release: **SKS 6.7.0**, validated against the official stable **Codex CLI 0.144.5** release from July 16, 2026. It makes the Control Center Overview report build, install, cache, rebuild, and probe health from their real authorities; adds root-owned Naruto follow-up waves with recovered thread capacity; separates Terra Medium exploration, Sol High implementation, and Sol Max judgment; and replaces duplicated global guidance with one concise Core Engineering Directive. The `0.145.0-alpha` line is intentionally excluded from the stable release baseline. See [CHANGELOG.md](CHANGELOG.md).
21
+ Current release: **SKS 7.0.0**, validated against the official stable **Codex CLI 0.144.5** release from July 16, 2026. It makes the Control Center Overview report build, install, cache, rebuild, and probe health from their real authorities; adds root-owned Naruto follow-up waves with recovered thread capacity; separates Terra Medium exploration, Sol High implementation, and Sol Max judgment; and replaces duplicated global guidance with one concise Core Engineering Directive. The `0.145.0-alpha` line is intentionally excluded from the stable release baseline. See [CHANGELOG.md](CHANGELOG.md).
22
22
 
23
- ## What 6.7.0 Fixes
23
+ ## What 7.0.0 Ships
24
24
 
25
- | Problem | 6.7.0 behavior |
25
+ | Problem | 7.0.0 behavior |
26
26
  | --- | --- |
27
27
  | Overview mixed Menu Bar, installed SKS, and cached registry versions | Each value is labeled by authority, stale or unavailable probes remain explicit, and Refresh forces a bounded update-status refresh. |
28
28
  | Naruto stopped creating children after its first wave | The root parent records settled waves, recovers open-thread capacity, rescans the ready DAG, and can launch later direct-child waves under the same workflow run. |
@@ -76,7 +76,7 @@ dependencies = [
76
76
 
77
77
  [[package]]
78
78
  name = "sks-core"
79
- version = "6.7.0"
79
+ version = "7.0.0"
80
80
  dependencies = [
81
81
  "serde_json",
82
82
  ]
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "sks-core"
3
- version = "6.7.0"
3
+ version = "7.0.0"
4
4
  edition = "2021"
5
5
 
6
6
  [dependencies]
@@ -21,6 +21,50 @@ export function upsertCodexLbConfig(text = '', baseUrl, selectDefault = true) {
21
21
  next = upsertTomlTable(next, 'model_providers.codex-lb', block);
22
22
  return `${next.trim()}\n`;
23
23
  }
24
+ const CODEX_LB_SHARED_OPENAI_ROUTING_MARKER = '# sks-codex-lb-managed-openai-base-url';
25
+ // Codex App can retain a per-thread `model_provider = "openai"` selection even
26
+ // after the global provider changes. While SKS places the codex-lb key in the
27
+ // shared OpenAI auth store, pin the built-in provider to the same LB endpoint so
28
+ // that stale threads cannot send that key to api.openai.com. A different existing
29
+ // override is user-owned and must never be clobbered.
30
+ export function codexLbSharedOpenAiRoutingState(text = '', baseUrl = '') {
31
+ const expectedBaseUrl = normalizeCodexLbBaseUrl(baseUrl);
32
+ const configuredBaseUrl = topLevelTomlString(text, 'openai_base_url');
33
+ return {
34
+ status: !configuredBaseUrl ? 'missing' : configuredBaseUrl === expectedBaseUrl ? 'matched' : 'conflict',
35
+ expected_base_url: expectedBaseUrl,
36
+ configured_base_url: configuredBaseUrl || null,
37
+ managed: topLevelHasLine(text, CODEX_LB_SHARED_OPENAI_ROUTING_MARKER)
38
+ };
39
+ }
40
+ export function upsertCodexLbSharedOpenAiRouting(text = '', baseUrl = '') {
41
+ const state = codexLbSharedOpenAiRoutingState(text, baseUrl);
42
+ if (!state.expected_base_url)
43
+ return { ...state, routing_status: state.status, ok: false, status: 'missing_base_url', text: String(text || '') };
44
+ if (state.status === 'conflict')
45
+ return { ...state, routing_status: state.status, ok: false, status: 'conflicting_user_openai_base_url', text: String(text || '') };
46
+ if (state.status === 'matched' && state.managed) {
47
+ return { ...state, routing_status: state.status, ok: true, status: 'present', text: String(text || '') };
48
+ }
49
+ // Matched-but-unmanaged means the URL already points at codex-lb. Claim the SKS
50
+ // marker so release/unselect can remove only this activation pin later.
51
+ const withValue = state.status === 'matched'
52
+ ? String(text || '')
53
+ : upsertTopLevelTomlString(text, 'openai_base_url', state.expected_base_url);
54
+ const next = addTopLevelMarkerBeforeKey(withValue, 'openai_base_url', CODEX_LB_SHARED_OPENAI_ROUTING_MARKER);
55
+ return { ...state, routing_status: state.status, ok: true, status: 'added', text: `${next.trim()}\n`, managed: true };
56
+ }
57
+ export function removeCodexLbSharedOpenAiRouting(text = '', baseUrl = '') {
58
+ const state = codexLbSharedOpenAiRoutingState(text, baseUrl);
59
+ if (state.status !== 'matched' || !state.managed)
60
+ return { ...state, changed: false, text: String(text || '') };
61
+ const withoutValue = removeTopLevelTomlKeyIfValue(text, 'openai_base_url', state.expected_base_url);
62
+ return {
63
+ ...state,
64
+ changed: true,
65
+ text: removeTopLevelLine(withoutValue, CODEX_LB_SHARED_OPENAI_ROUTING_MARKER)
66
+ };
67
+ }
24
68
  export function upsertCodexAppGlmConfig(text = '') {
25
69
  let next = String(text || '');
26
70
  const providerBlock = [
@@ -189,3 +233,30 @@ export async function sha256Text(value = '') {
189
233
  function escapeRegExp(value) {
190
234
  return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
191
235
  }
236
+ function topLevelTomlString(text = '', key) {
237
+ const topLevel = String(text || '').split(/\n\s*\[/)[0] || '';
238
+ return topLevel.match(new RegExp(`(^|\\n)\\s*${escapeRegExp(key)}\\s*=\\s*"([^"]+)"\\s*(?:#.*)?(?=\\n|$)`))?.[2] || '';
239
+ }
240
+ function topLevelHasLine(text = '', line) {
241
+ const topLevel = String(text || '').split(/\n\s*\[/)[0] || '';
242
+ return topLevel.split(/\r?\n/).some((candidate) => candidate.trim() === line);
243
+ }
244
+ function addTopLevelMarkerBeforeKey(text = '', key, marker) {
245
+ const lines = String(text || '').split('\n');
246
+ const firstTable = lines.findIndex((line) => /^\s*\[/.test(line));
247
+ const end = firstTable === -1 ? lines.length : firstTable;
248
+ const keyIndex = lines.slice(0, end).findIndex((line) => new RegExp(`^\\s*${escapeRegExp(key)}\\s*=`).test(line));
249
+ if (keyIndex >= 0 && !lines.slice(0, end).some((line) => line.trim() === marker))
250
+ lines.splice(keyIndex, 0, marker);
251
+ return lines.join('\n');
252
+ }
253
+ function removeTopLevelLine(text = '', target) {
254
+ const lines = String(text || '').split('\n');
255
+ const firstTable = lines.findIndex((line) => /^\s*\[/.test(line));
256
+ const end = firstTable === -1 ? lines.length : firstTable;
257
+ for (let index = end - 1; index >= 0; index -= 1) {
258
+ if (lines[index]?.trim() === target)
259
+ lines.splice(index, 1);
260
+ }
261
+ return lines.join('\n').replace(/^\n+/, '').replace(/\n{3,}/g, '\n\n');
262
+ }
@@ -234,11 +234,11 @@ export async function selftestCodexLb(tmp) {
234
234
  const codexLbReconcileRestoreJson = JSON.parse(codexLbReconcileRestoreRepair.stdout);
235
235
  const codexLbReconcileRestoreAuth = await safeReadText(path.join(codexLbHome, '.codex', 'auth.json'));
236
236
  const codexLbReconcileRestoreConfig = await safeReadText(path.join(codexLbHome, '.codex', 'config.toml'));
237
- if (codexLbReconcileRestoreJson.auth_reconcile?.status !== 'oauth_restored' || !codexLbReconcileRestoreAuth.includes('oauth-id') || codexLbReconcileRestoreAuth.includes('sk-test') || !hasTopLevelCodexLbSelected(codexLbReconcileRestoreConfig))
238
- throw new Error('selftest: codex-lb oauth restore should replace apikey auth.json with ChatGPT OAuth backup while keeping codex-lb selected');
237
+ if (codexLbReconcileRestoreJson.auth_reconcile?.status !== 'oauth_restored' || !codexLbReconcileRestoreAuth.includes('oauth-id') || codexLbReconcileRestoreAuth.includes('sk-test') || hasTopLevelCodexLbSelected(codexLbReconcileRestoreConfig) || /sks-codex-lb-managed-openai-base-url/.test(codexLbReconcileRestoreConfig))
238
+ throw new Error('selftest: codex-lb oauth restore should replace apikey auth.json with ChatGPT OAuth backup and leave an unselected, unpinned provider state');
239
239
  // codex-lb auth: release flow — restore ChatGPT OAuth from backup so the user can return to
240
- // the official ChatGPT account login. Default deselects model_provider; flags control whether
241
- // the provider stays selected and whether the backup file is removed after restore.
240
+ // the official ChatGPT account login. Default deselects model_provider; keeping codex-lb
241
+ // selected with shared OAuth is rejected because it would route OAuth credentials to the LB.
242
242
  const codexLbReleaseConfig = 'model_provider = "codex-lb"\n\n[model_providers.codex-lb]\nname = "openai"\nbase_url = "https://lb.example.test/backend-api/codex"\nwire_api = "responses"\nenv_key = "CODEX_LB_API_KEY"\nsupports_websockets = true\nrequires_openai_auth = true\n';
243
243
  const codexLbReleaseEnv = "export CODEX_LB_BASE_URL='https://lb.example.test/backend-api/codex'\nexport CODEX_LB_API_KEY='sk-test'\n";
244
244
  const codexLbReleaseApikeyAuth = '{"auth_mode":"apikey","OPENAI_API_KEY":"sk-test"}\n';
@@ -257,17 +257,16 @@ export async function selftestCodexLb(tmp) {
257
257
  const codexLbReleaseConfigAfter = await safeReadText(path.join(codexLbHome, '.codex', 'config.toml'));
258
258
  if (codexLbReleaseJson.status !== 'released' || codexLbReleaseJson.provider_unselected !== true || codexLbReleaseJson.backup_removed !== false || !codexLbReleaseAuth.includes('oauth-id') || !codexLbReleaseAuth.includes('oauth-refresh') || codexLbReleaseAuth.includes('apikey') || !codexLbReleaseBackupAfter.includes('oauth-id') || hasTopLevelCodexLbSelected(codexLbReleaseConfigAfter))
259
259
  throw new Error('selftest: codex-lb release happy path did not restore OAuth, preserve backup, and deselect model_provider');
260
- // --keep-provider: restore auth.json but leave model_provider = "codex-lb" alone.
260
+ // --keep-provider is unsafe with shared OpenAI auth and must fail without changing either file.
261
261
  await writeTextAtomic(path.join(codexLbHome, '.codex', 'auth.json'), codexLbReleaseApikeyAuth);
262
262
  await writeTextAtomic(path.join(codexLbHome, '.codex', 'auth.chatgpt-backup.json'), codexLbReleaseOauthBackup);
263
263
  await writeTextAtomic(path.join(codexLbHome, '.codex', 'config.toml'), codexLbReleaseConfig);
264
264
  const codexLbReleaseKeepRun = await runProcess(process.execPath, [packagedSksEntrypoint(), 'codex-lb', 'release', '--keep-provider', '--json'], { cwd: tmp, env: codexLbEnvForSelftest, timeoutMs: 15000, maxOutputBytes: 64 * 1024 });
265
- if (codexLbReleaseKeepRun.code !== 0)
266
- throw new Error(`selftest: codex-lb release --keep-provider exited ${codexLbReleaseKeepRun.code}: ${codexLbReleaseKeepRun.stderr}`);
267
265
  const codexLbReleaseKeepJson = JSON.parse(codexLbReleaseKeepRun.stdout);
268
266
  const codexLbReleaseKeepConfig = await safeReadText(path.join(codexLbHome, '.codex', 'config.toml'));
269
- if (codexLbReleaseKeepJson.status !== 'released' || codexLbReleaseKeepJson.provider_unselected !== false || !hasTopLevelCodexLbSelected(codexLbReleaseKeepConfig))
270
- throw new Error('selftest: codex-lb release --keep-provider should leave model_provider = "codex-lb" intact');
267
+ const codexLbReleaseKeepAuth = await safeReadText(path.join(codexLbHome, '.codex', 'auth.json'));
268
+ if (codexLbReleaseKeepRun.code === 0 || codexLbReleaseKeepJson.status !== 'failed' || codexLbReleaseKeepJson.reason !== 'keep_provider_unsafe_with_shared_auth' || !hasTopLevelCodexLbSelected(codexLbReleaseKeepConfig) || !codexLbReleaseKeepAuth.includes('apikey'))
269
+ throw new Error('selftest: codex-lb release --keep-provider should fail closed without changing the coherent codex-lb state');
271
270
  // --delete-backup: restore auth.json and remove the backup file.
272
271
  await writeTextAtomic(path.join(codexLbHome, '.codex', 'auth.json'), codexLbReleaseApikeyAuth);
273
272
  await writeTextAtomic(path.join(codexLbHome, '.codex', 'auth.chatgpt-backup.json'), codexLbReleaseOauthBackup);
@@ -288,17 +287,15 @@ export async function selftestCodexLb(tmp) {
288
287
  const codexLbReleaseMissingAuth = await safeReadText(path.join(codexLbHome, '.codex', 'auth.json'));
289
288
  if (codexLbReleaseMissingRun.code === 0 || codexLbReleaseMissingJson.status !== 'no_backup' || !codexLbReleaseMissingAuth.includes('apikey'))
290
289
  throw new Error('selftest: codex-lb release with no backup should exit non-zero and report no_backup without touching auth.json');
291
- // unselect: flip model_provider off without touching auth.json or env file.
290
+ // unselect must refuse while the shared auth store still contains the codex-lb key.
292
291
  await writeTextAtomic(path.join(codexLbHome, '.codex', 'auth.json'), codexLbReleaseApikeyAuth);
293
292
  await writeTextAtomic(path.join(codexLbHome, '.codex', 'config.toml'), codexLbReleaseConfig);
294
293
  const codexLbUnselectRun = await runProcess(process.execPath, [packagedSksEntrypoint(), 'codex-lb', 'unselect', '--json'], { cwd: tmp, env: codexLbEnvForSelftest, timeoutMs: 15000, maxOutputBytes: 64 * 1024 });
295
- if (codexLbUnselectRun.code !== 0)
296
- throw new Error(`selftest: codex-lb unselect exited ${codexLbUnselectRun.code}: ${codexLbUnselectRun.stderr}`);
297
294
  const codexLbUnselectJson = JSON.parse(codexLbUnselectRun.stdout);
298
295
  const codexLbUnselectConfig = await safeReadText(path.join(codexLbHome, '.codex', 'config.toml'));
299
296
  const codexLbUnselectAuth = await safeReadText(path.join(codexLbHome, '.codex', 'auth.json'));
300
- if (codexLbUnselectJson.status !== 'unselected' || hasTopLevelCodexLbSelected(codexLbUnselectConfig) || !codexLbUnselectConfig.includes('[model_providers.codex-lb]') || !codexLbUnselectAuth.includes('apikey'))
301
- throw new Error('selftest: codex-lb unselect should drop model_provider but preserve [model_providers.codex-lb] and auth.json');
297
+ if (codexLbUnselectRun.code === 0 || codexLbUnselectJson.status !== 'failed' || codexLbUnselectJson.reason !== 'shared_codex_lb_auth_active' || !hasTopLevelCodexLbSelected(codexLbUnselectConfig) || !codexLbUnselectAuth.includes('apikey'))
298
+ throw new Error('selftest: codex-lb unselect should fail closed while shared codex-lb auth is active');
302
299
  // Restore the doctor-test auth.json shape so downstream selftest assertions still hold.
303
300
  await writeTextAtomic(path.join(codexLbHome, '.codex', 'auth.json'), '{"auth_mode":"browser"}\n');
304
301
  await fsp.rm(path.join(codexLbHome, '.codex', 'auth.chatgpt-backup.json'), { force: true });