sneakoscope 7.3.0 → 7.6.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.
- package/README.md +129 -10
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/dist/cli/codex-app-command.js +1 -1
- package/dist/cli/command-manifest-lite.js +4 -1
- package/dist/cli/command-registry.js +2 -0
- package/dist/cli/install-helpers-codex-lb-chain.js +42 -0
- package/dist/cli/install-helpers-codex-lb-config.js +114 -9
- package/dist/cli/install-helpers-install-support.js +6 -16
- package/dist/cli/install-helpers.js +788 -600
- package/dist/cli/router.js +30 -2
- package/dist/commands/codex-app.js +37 -1
- package/dist/commands/codex-lb.js +491 -300
- package/dist/config/skills-manifest.json +57 -71
- package/dist/core/align/align-route.js +127 -0
- package/dist/core/codex-app/codex-app-fast-ui-repair.js +8 -4
- package/dist/core/codex-app/codex-app-restart.js +83 -0
- package/dist/core/codex-app/codex-app-ui-state-snapshot.js +8 -4
- package/dist/core/codex-app/desktop-routing-snapshot.js +1 -1
- package/dist/core/codex-app/menubar/constants.js +5 -0
- package/dist/core/codex-app/menubar/generation-transaction-journal.js +1 -3
- package/dist/core/codex-app/menubar/installer.js +18 -0
- package/dist/core/codex-app/multi-provider-router.js +22 -10
- package/dist/core/codex-app/openrouter-activate.js +26 -1
- package/dist/core/codex-app.js +118 -26
- package/dist/core/codex-control/codex-app-server-runtime-env.js +86 -0
- package/dist/core/codex-control/codex-app-server-v2-client.js +78 -8
- package/dist/core/codex-control/codex-task-runner.js +2 -2
- package/dist/core/codex-lb/capability-runner.js +204 -0
- package/dist/core/codex-lb/capability-types.js +1 -0
- package/dist/core/codex-lb/codex-lb-env.js +9 -13
- package/dist/core/codex-lb/codex-lb-setup.js +45 -8
- package/dist/core/codex-lb/codex-lb-tool-catalog.js +52 -74
- package/dist/core/codex-lb/codex-lb-tool-output-recovery.js +1 -1
- package/dist/core/codex-lb/desktop-auth-invariant.js +185 -0
- package/dist/core/codex-lb/desktop-bridge/client.js +34 -0
- package/dist/core/codex-lb/desktop-bridge/header-policy.js +106 -0
- package/dist/core/codex-lb/desktop-bridge/http-forward.js +101 -0
- package/dist/core/codex-lb/desktop-bridge/index.js +10 -0
- package/dist/core/codex-lb/desktop-bridge/launchd.js +81 -0
- package/dist/core/codex-lb/desktop-bridge/location-rewrite.js +27 -0
- package/dist/core/codex-lb/desktop-bridge/security.js +274 -0
- package/dist/core/codex-lb/desktop-bridge/server.js +179 -0
- package/dist/core/codex-lb/desktop-bridge/state.js +119 -0
- package/dist/core/codex-lb/desktop-bridge/types.js +16 -0
- package/dist/core/codex-lb/desktop-bridge/websocket-forward.js +151 -0
- package/dist/core/codex-lb/desktop-center-credentials.js +189 -0
- package/dist/core/codex-lb/desktop-controller.js +1410 -0
- package/dist/core/codex-lb/desktop-mode.js +32 -0
- package/dist/core/codex-lb/desktop-real-evidence.js +168 -0
- package/dist/core/codex-lb/desktop-service.js +613 -0
- package/dist/core/codex-lb/legacy-migration.js +575 -0
- package/dist/core/codex-lb/migration-receipt.js +246 -0
- package/dist/core/codex-lb/probes/auxiliary-surfaces-probe.js +60 -0
- package/dist/core/codex-lb/probes/bridge-probe.js +75 -0
- package/dist/core/codex-lb/probes/catalog-probe.js +128 -0
- package/dist/core/codex-lb/probes/computer-use-probe.js +50 -0
- package/dist/core/codex-lb/probes/image-generation-probe.js +47 -0
- package/dist/core/codex-lb/probes/probe-evidence.js +39 -0
- package/dist/core/codex-lb/probes/voice-realtime-probe.js +44 -0
- package/dist/core/codex-lb/trusted-deep-evidence.js +403 -0
- package/dist/core/codex-native/core-skill-manifest.js +22 -6
- package/dist/core/codex-runtime/codex-desktop-config-policy.js +2 -1
- package/dist/core/commands/align-command.js +220 -0
- package/dist/core/commands/image-ux-review-command.js +280 -68
- package/dist/core/commands/naruto-command.js +257 -8
- package/dist/core/commands/ppt-command.js +2 -2
- package/dist/core/commands/telegram-command.js +402 -34
- package/dist/core/commands/triwiki-command.js +11 -1
- package/dist/core/commands/triwiki-graph-command.js +160 -0
- package/dist/core/commands/wiki-command.js +100 -20
- package/dist/core/doctor/skill-legacy-surface.js +1 -3
- package/dist/core/errors/message.js +3 -0
- package/dist/core/evidence/evidence-freshness.js +14 -0
- package/dist/core/feature-fixtures.js +9 -1
- package/dist/core/feature-registry.js +5 -3
- package/dist/core/fsx.js +7 -3
- package/dist/core/hooks-runtime/codex-commit-hooks-selftest.js +82 -0
- package/dist/core/hooks-runtime/context-graph-freshness-preflight.js +113 -0
- package/dist/core/hooks-runtime/hook-context.js +15 -2
- package/dist/core/hooks-runtime/managed-skill-generation-heal.js +46 -0
- package/dist/core/hooks-runtime/naruto-terminal-finalization.js +1 -0
- package/dist/core/hooks-runtime/official-subagent-lifecycle.js +1 -1
- package/dist/core/hooks-runtime/tool-output-quarantine.js +1 -1
- package/dist/core/hooks-runtime.js +33 -89
- package/dist/core/image-ux-review/callout-extraction.js +6 -0
- package/dist/core/image-ux-review/imagegen-adapter.js +64 -23
- package/dist/core/image-ux-review/real-callout-extractor.js +1 -0
- package/dist/core/image-ux-review.js +230 -12
- package/dist/core/imagegen/codex-lb-imagegen-target.js +21 -7
- package/dist/core/imagegen/imagegen-capability.js +10 -4
- package/dist/core/imagegen/require-imagegen.js +29 -5
- package/dist/core/init/skills.js +25 -13
- package/dist/core/init.js +1 -1
- package/dist/core/install/installed-package-smoke.js +157 -4
- package/dist/core/managed-assets/managed-assets-manifest.js +2 -1
- package/dist/core/managed-path-safety.js +8 -10
- package/dist/core/mcp-config/backup.js +2 -4
- package/dist/core/mcp-config/config-reader.js +2 -4
- package/dist/core/mcp-config/scope.js +3 -5
- package/dist/core/naruto/context-graph-advisor-scope.js +242 -0
- package/dist/core/naruto/context-graph-advisor.js +0 -0
- package/dist/core/perf/release-latency-slo.js +12 -6
- package/dist/core/pipeline-internals/runtime-core.js +78 -0
- package/dist/core/pipeline-internals/runtime-gates.js +5 -2
- package/dist/core/policy/latest-version-guidance.js +113 -0
- package/dist/core/ppt.js +8 -8
- package/dist/core/preflight/parallel-preflight-engine.js +1 -1
- package/dist/core/proof/auto-finalize.js +98 -6
- package/dist/core/proof/route-proof-gate.js +12 -1
- package/dist/core/proof/route-proof-policy.js +8 -8
- package/dist/core/release/gate-manifest.js +32 -1
- package/dist/core/release/npm-stage-contract.js +21 -0
- package/dist/core/release/package-size-budget.js +2 -2
- package/dist/core/release/release-gate-contract.js +5 -0
- package/dist/core/release/release-proof-io.js +1 -3
- package/dist/core/release/release-real-contract.js +5 -4
- package/dist/core/release/release-stamp-proof.js +1 -3
- package/dist/core/release/stage-publish.js +27 -0
- package/dist/core/remote/audit-idempotency.js +50 -18
- package/dist/core/remote/codex-public-activity.js +283 -0
- package/dist/core/remote/index.js +1 -0
- package/dist/core/remote/ssh-worker-client.js +4 -1
- package/dist/core/remote/worker.js +206 -27
- package/dist/core/research/research-adversarial-review.js +1 -3
- package/dist/core/research/research-claim-synthesizer.js +1 -3
- package/dist/core/research/research-falsification-runner.js +1 -3
- package/dist/core/research/research-source-evidence.js +1 -3
- package/dist/core/responses-stream.js +65 -19
- package/dist/core/routes/constants.js +1 -1
- package/dist/core/routes/design-policy.js +7 -2
- package/dist/core/routes/dollar-manifest-lite.js +2 -4
- package/dist/core/routes/evidence.js +1 -1
- package/dist/core/routes.js +30 -10
- package/dist/core/safety/command-contract/contracts.js +2 -0
- package/dist/core/safety/command-contract/types.js +1 -1
- package/dist/core/search/context-graph-seeds.js +205 -0
- package/dist/core/search/context.js +0 -0
- package/dist/core/search/provider.js +2 -2
- package/dist/core/secret-redaction.js +6 -0
- package/dist/core/subagents/naruto-help-contract.js +2 -1
- package/dist/core/subagents/naruto-host-credentials.js +161 -0
- package/dist/core/subagents/official-subagent-preparation.js +4 -1
- package/dist/core/subagents/official-subagent-prompt.js +44 -2
- package/dist/core/subagents/official-subagent-runner.js +26 -8
- package/dist/core/subagents/triwiki-attention.js +135 -123
- package/dist/core/telegram/bot-api.js +85 -10
- package/dist/core/telegram/center-snapshot.js +718 -0
- package/dist/core/telegram/config.js +158 -31
- package/dist/core/telegram/hub.js +288 -33
- package/dist/core/telegram/index.js +2 -0
- package/dist/core/telegram/ingress-spool.js +419 -0
- package/dist/core/telegram/ledgers.js +188 -29
- package/dist/core/telegram/messages.js +26 -6
- package/dist/core/telegram/owner-lock.js +10 -7
- package/dist/core/telegram/runtime-projection.js +38 -3
- package/dist/core/telegram/runtime.js +298 -63
- package/dist/core/telegram/service.js +137 -8
- package/dist/core/telegram/setup.js +291 -73
- package/dist/core/text/strings.js +3 -0
- package/dist/core/triwiki/code-pack.js +12 -120
- package/dist/core/triwiki/context-graph/compiler/cache-key.js +277 -0
- package/dist/core/triwiki/context-graph/compiler/extract.js +104 -0
- package/dist/core/triwiki/context-graph/compiler/freshness.js +108 -0
- package/dist/core/triwiki/context-graph/compiler/index.js +237 -0
- package/dist/core/triwiki/context-graph/compiler/merge.js +0 -0
- package/dist/core/triwiki/context-graph/compiler/serialize.js +115 -0
- package/dist/core/triwiki/context-graph/contracts.js +236 -0
- package/dist/core/triwiki/context-graph/extractors/code/builders.js +150 -0
- package/dist/core/triwiki/context-graph/extractors/code/declarations.js +161 -0
- package/dist/core/triwiki/context-graph/extractors/code/index.js +265 -0
- package/dist/core/triwiki/context-graph/extractors/code/inventory.js +237 -0
- package/dist/core/triwiki/context-graph/extractors/code/module-graph.js +252 -0
- package/dist/core/triwiki/context-graph/extractors/code/modules.js +79 -0
- package/dist/core/triwiki/context-graph/extractors/code/references.js +184 -0
- package/dist/core/triwiki/context-graph/extractors/code/selection.js +100 -0
- package/dist/core/triwiki/context-graph/extractors/code/ts-config.js +161 -0
- package/dist/core/triwiki/context-graph/extractors/code/types.js +18 -0
- package/dist/core/triwiki/context-graph/extractors/evidence/claims.js +289 -0
- package/dist/core/triwiki/context-graph/extractors/evidence/index.js +54 -0
- package/dist/core/triwiki/context-graph/extractors/evidence/proof-index.js +213 -0
- package/dist/core/triwiki/context-graph/extractors/evidence/proofs.js +266 -0
- package/dist/core/triwiki/context-graph/extractors/evidence/redaction.js +177 -0
- package/dist/core/triwiki/context-graph/extractors/evidence/shared.js +0 -0
- package/dist/core/triwiki/context-graph/extractors/evidence/sources.js +154 -0
- package/dist/core/triwiki/context-graph/extractors/index.js +7 -0
- package/dist/core/triwiki/context-graph/extractors/topology/commands.js +207 -0
- package/dist/core/triwiki/context-graph/extractors/topology/gate-edges.js +201 -0
- package/dist/core/triwiki/context-graph/extractors/topology/gates.js +182 -0
- package/dist/core/triwiki/context-graph/extractors/topology/globs.js +124 -0
- package/dist/core/triwiki/context-graph/extractors/topology/index.js +92 -0
- package/dist/core/triwiki/context-graph/extractors/topology/routes.js +135 -0
- package/dist/core/triwiki/context-graph/extractors/topology/shared.js +215 -0
- package/dist/core/triwiki/context-graph/graph-index.js +143 -0
- package/dist/core/triwiki/context-graph/ids.js +0 -0
- package/dist/core/triwiki/context-graph/lint/index.js +0 -0
- package/dist/core/triwiki/context-graph/lint/rules.js +232 -0
- package/dist/core/triwiki/context-graph/lint/warnings.js +93 -0
- package/dist/core/triwiki/context-graph/paths.js +116 -0
- package/dist/core/triwiki/context-graph/profiles.js +78 -0
- package/dist/core/triwiki/context-graph/projections/anchors.js +91 -0
- package/dist/core/triwiki/context-graph/projections/attention.js +58 -0
- package/dist/core/triwiki/context-graph/projections/code-pack-workspace.js +62 -0
- package/dist/core/triwiki/context-graph/projections/code-pack.js +144 -0
- package/dist/core/triwiki/context-graph/projections/index.js +7 -0
- package/dist/core/triwiki/context-graph/projections/module-view.js +140 -0
- package/dist/core/triwiki/context-graph/projections/node-summary.js +118 -0
- package/dist/core/triwiki/context-graph/projections/pack-contract.js +6 -0
- package/dist/core/triwiki/context-graph/query/explain.js +0 -0
- package/dist/core/triwiki/context-graph/query/index.js +178 -0
- package/dist/core/triwiki/context-graph/query/load.js +116 -0
- package/dist/core/triwiki/context-graph/query/pack.js +117 -0
- package/dist/core/triwiki/context-graph/query/rank.js +142 -0
- package/dist/core/triwiki/context-graph/query/ranking-config.js +64 -0
- package/dist/core/triwiki/context-graph/query/seeds.js +241 -0
- package/dist/core/triwiki/context-graph/query/snapshot-cache.js +72 -0
- package/dist/core/triwiki/context-graph/query/traverse.js +154 -0
- package/dist/core/triwiki/context-graph/query-types.js +29 -0
- package/dist/core/triwiki/context-graph/store/compile-lock.js +21 -0
- package/dist/core/triwiki/context-graph/store/event-log.js +48 -0
- package/dist/core/triwiki/context-graph/store/fragment-cache.js +85 -0
- package/dist/core/triwiki/context-graph/store/graph-status.js +85 -0
- package/dist/core/triwiki/context-graph/store/snapshot-store.js +155 -0
- package/dist/core/triwiki/triwiki-proof-bank-index-repair.js +115 -0
- package/dist/core/triwiki/triwiki-proof-bank-index-store.js +290 -0
- package/dist/core/triwiki/triwiki-proof-bank-index.js +126 -0
- package/dist/core/triwiki/triwiki-proof-bank.js +7 -1
- package/dist/core/verification/context-graph-affected.js +271 -0
- package/dist/core/version.js +1 -1
- package/dist/native/sks-menubar/Sources/AlertFactory.swift +11 -3
- package/dist/native/sks-menubar/Sources/AppDelegate.swift +9 -0
- package/dist/native/sks-menubar/Sources/ControlCenterWindowController.swift +25 -3
- package/dist/native/sks-menubar/Sources/ControlKit.swift +19 -8
- package/dist/native/sks-menubar/Sources/DiagnosticsViewController.swift +1 -2
- package/dist/native/sks-menubar/Sources/MCPServersViewController.swift +45 -17
- package/dist/native/sks-menubar/Sources/OverviewSummary.swift +162 -0
- package/dist/native/sks-menubar/Sources/OverviewViewController.swift +136 -190
- package/dist/native/sks-menubar/Sources/ProcessClient.swift +107 -11
- package/dist/native/sks-menubar/Sources/ProvidersMultiProvider.swift +5 -1
- package/dist/native/sks-menubar/Sources/ProvidersOpenRouter.swift +16 -4
- package/dist/native/sks-menubar/Sources/ProvidersRoleModels.swift +4 -1
- package/dist/native/sks-menubar/Sources/ProvidersRoutingTruth.swift +131 -0
- package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +288 -341
- package/dist/native/sks-menubar/Sources/RemoteTelegramCenterState.swift +447 -0
- package/dist/native/sks-menubar/Sources/RemoteTelegramRendering.swift +484 -0
- package/dist/native/sks-menubar/Sources/RemoteTelegramViewController.swift +364 -115
- package/dist/native/sks-menubar/Sources/SettingsViewController.swift +73 -12
- package/dist/native/sks-menubar/Sources/SidebarItem.swift +3 -3
- package/dist/native/sks-menubar/Sources/StatusItemController.swift +13 -13
- package/dist/native/sks-menubar/Sources/TelegramHubSupervisor.swift +469 -0
- package/dist/native/sks-menubar/Sources/UpdatesViewController.swift +1 -6
- package/dist/native/sks-menubar/Tests/AppRuntimeTestSupport.swift +12 -0
- package/dist/native/sks-menubar/Tests/NativeTelegramRegressionRunner.swift +55 -0
- package/dist/native/sks-menubar/Tests/ProcessClientTests.swift +33 -0
- package/dist/native/sks-menubar/Tests/ProvidersViewControllerTests.swift +142 -0
- package/dist/native/sks-menubar/Tests/RemoteTelegramCenterStateTests.swift +56 -0
- package/dist/native/sks-menubar/Tests/TelegramHubSupervisorTests.swift +55 -0
- package/dist/scripts/codex-lb-catalog-passthrough-check.js +120 -0
- package/dist/scripts/codex-lb-desktop-auth-invariant-check.js +169 -0
- package/dist/scripts/codex-lb-desktop-bridge-check.js +394 -0
- package/dist/scripts/codex-lb-desktop-bridge-latency-check.js +196 -0
- package/dist/scripts/codex-lb-desktop-capabilities-check.js +287 -0
- package/dist/scripts/codex-lb-desktop-real-evidence-check.js +123 -0
- package/dist/scripts/codex-lb-fast-mode-truth-check.js +10 -3
- package/dist/scripts/codex-lb-fast-ui-preservation-check.js +81 -40
- package/dist/scripts/codex-lb-gpt56-fast-profile-check.js +99 -37
- package/dist/scripts/context-graph-check.js +191 -0
- package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +1 -1
- package/dist/scripts/gate-policy-audit-check.js +1 -1
- package/dist/scripts/helper-dedup-check.js +0 -2
- package/dist/scripts/installed-package-smoke-check.js +4 -1
- package/dist/scripts/latest-version-guidance-check.js +74 -0
- package/dist/scripts/release-metadata-check.js +21 -4
- package/dist/scripts/release-real-check.js +7 -0
- package/dist/scripts/ux-review-imagegen-blackbox-check.js +25 -1
- package/dist/scripts/ux-review-run-wires-imagegen-check.js +9 -1
- package/package.json +8 -3
- package/release-gates.v2.json +176 -1
- package/runtime-required-scripts.json +30 -0
- package/schemas/triwiki/context-graph.schema.json +119 -0
- package/dist/cli/install-helpers-codex-lb-selftest-chain.js +0 -112
- package/dist/cli/install-helpers-codex-lb-selftest.js +0 -481
- package/dist/core/triwiki/code-index-scanner.js +0 -309
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runCodexLbDesktopCapabilityReport, shapeCodexLbDesktopCapabilityStatus } from '../core/codex-lb/capability-runner.js';
|
|
3
|
+
import { assertGate, emitGate } from './gate-lib.js';
|
|
4
|
+
const checkedAt = '2026-07-28T00:00:00.000Z';
|
|
5
|
+
const manifest = {
|
|
6
|
+
schema_version: 'codex-lb.desktop-capabilities.v1',
|
|
7
|
+
routes: {
|
|
8
|
+
responses_http: true,
|
|
9
|
+
models: true,
|
|
10
|
+
images_generations: true,
|
|
11
|
+
realtime_calls: true,
|
|
12
|
+
files: true,
|
|
13
|
+
transcribe: true,
|
|
14
|
+
images_edits: true,
|
|
15
|
+
thread_goal: true,
|
|
16
|
+
memories_trace_summarize: true,
|
|
17
|
+
safety_arc: true,
|
|
18
|
+
agent_identities_jwks: true
|
|
19
|
+
},
|
|
20
|
+
tools: {
|
|
21
|
+
image_generation: true,
|
|
22
|
+
computer_use_passthrough: true,
|
|
23
|
+
web_search: true
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const catalog = {
|
|
27
|
+
models: [{
|
|
28
|
+
id: 'future-codex-model',
|
|
29
|
+
display_name: 'Future Codex',
|
|
30
|
+
supported_reasoning_levels: [{ effort: 'high' }],
|
|
31
|
+
truncation_policy: { mode: 'tokens' },
|
|
32
|
+
additional_speed_tiers: ['fast'],
|
|
33
|
+
service_tiers: [{ id: 'priority' }],
|
|
34
|
+
use_responses_lite: false,
|
|
35
|
+
future_catalog_field: true
|
|
36
|
+
}]
|
|
37
|
+
};
|
|
38
|
+
const advertisedOnly = runCodexLbDesktopCapabilityReport({
|
|
39
|
+
mode: 'desktop-native-bridge',
|
|
40
|
+
level: 'shallow',
|
|
41
|
+
configured: true,
|
|
42
|
+
oauthPreserved: true,
|
|
43
|
+
checkedAt,
|
|
44
|
+
manifest,
|
|
45
|
+
gatewayAuth: {
|
|
46
|
+
transport: 'x-codex-lb-api-key',
|
|
47
|
+
configured: true,
|
|
48
|
+
observed: false
|
|
49
|
+
},
|
|
50
|
+
providerIdentity: {
|
|
51
|
+
configured: true,
|
|
52
|
+
source: 'config'
|
|
53
|
+
},
|
|
54
|
+
browserUse: {
|
|
55
|
+
advertised: true,
|
|
56
|
+
source: 'manifest'
|
|
57
|
+
},
|
|
58
|
+
plugins: {
|
|
59
|
+
advertised: true,
|
|
60
|
+
source: 'manifest'
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
const advertisedStatus = shapeCodexLbDesktopCapabilityStatus(advertisedOnly);
|
|
64
|
+
const fixtureOnly = runCodexLbDesktopCapabilityReport({
|
|
65
|
+
mode: 'desktop-native-bridge',
|
|
66
|
+
level: 'deep',
|
|
67
|
+
configured: true,
|
|
68
|
+
oauthPreserved: true,
|
|
69
|
+
checkedAt,
|
|
70
|
+
manifest,
|
|
71
|
+
gatewayAuth: {
|
|
72
|
+
transport: 'x-codex-lb-api-key',
|
|
73
|
+
configured: true,
|
|
74
|
+
observed: true,
|
|
75
|
+
fixture: true
|
|
76
|
+
},
|
|
77
|
+
providerIdentity: {
|
|
78
|
+
verified: true,
|
|
79
|
+
fixture: true,
|
|
80
|
+
source: 'transport'
|
|
81
|
+
},
|
|
82
|
+
bridge: {
|
|
83
|
+
configured: true,
|
|
84
|
+
processRunning: true,
|
|
85
|
+
transportAttempted: true,
|
|
86
|
+
httpRoundTrip: true,
|
|
87
|
+
websocketRoundTrip: true,
|
|
88
|
+
fixture: true
|
|
89
|
+
},
|
|
90
|
+
catalog: {
|
|
91
|
+
catalog,
|
|
92
|
+
configuredServiceTier: 'fast',
|
|
93
|
+
pickerControlVisible: true,
|
|
94
|
+
pickerSelectedModel: 'future-codex-model',
|
|
95
|
+
requestServiceTier: 'fast',
|
|
96
|
+
responseActualServiceTier: 'priority',
|
|
97
|
+
fixture: true
|
|
98
|
+
},
|
|
99
|
+
imageGeneration: {
|
|
100
|
+
attempted: true,
|
|
101
|
+
requestToolsPresent: true,
|
|
102
|
+
events: [{ type: 'response.image_generation_call.completed' }],
|
|
103
|
+
artifactMaterialized: true,
|
|
104
|
+
fixture: true
|
|
105
|
+
},
|
|
106
|
+
computerUse: {
|
|
107
|
+
attempted: true,
|
|
108
|
+
events: [{ type: 'response.computer_call.created' }],
|
|
109
|
+
localExecutorCompleted: true,
|
|
110
|
+
outputSubmitted: true,
|
|
111
|
+
followUpCompleted: true,
|
|
112
|
+
sessionAffinityPreserved: true,
|
|
113
|
+
fixture: true
|
|
114
|
+
},
|
|
115
|
+
browserUse: {
|
|
116
|
+
verified: true,
|
|
117
|
+
fixture: true,
|
|
118
|
+
source: 'deep_probe'
|
|
119
|
+
},
|
|
120
|
+
voiceMode: {
|
|
121
|
+
attempted: true,
|
|
122
|
+
createRouteVerified: true,
|
|
123
|
+
locationReceived: true,
|
|
124
|
+
locationRewritten: true,
|
|
125
|
+
websocketUpgraded: true,
|
|
126
|
+
serverEventSeen: true,
|
|
127
|
+
cleanClose: true,
|
|
128
|
+
ownerBindingVerified: true,
|
|
129
|
+
fixture: true
|
|
130
|
+
},
|
|
131
|
+
plugins: {
|
|
132
|
+
verified: true,
|
|
133
|
+
fixture: true,
|
|
134
|
+
source: 'deep_probe'
|
|
135
|
+
},
|
|
136
|
+
auxiliarySurfaces: {
|
|
137
|
+
attempted: true,
|
|
138
|
+
inputEvents: [{ type: 'future.desktop.event', payload: { keep: true } }],
|
|
139
|
+
outputEvents: [{ type: 'future.desktop.event', payload: { keep: true } }],
|
|
140
|
+
requestBodyHashPreserved: true,
|
|
141
|
+
sessionAffinityPreserved: true,
|
|
142
|
+
fixture: true
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
const fixtureStatus = shapeCodexLbDesktopCapabilityStatus(fixtureOnly);
|
|
146
|
+
const textOnly = runCodexLbDesktopCapabilityReport({
|
|
147
|
+
mode: 'cli-provider',
|
|
148
|
+
level: 'transport',
|
|
149
|
+
configured: true,
|
|
150
|
+
oauthPreserved: false,
|
|
151
|
+
checkedAt,
|
|
152
|
+
manifest,
|
|
153
|
+
textResponses: {
|
|
154
|
+
attempted: true,
|
|
155
|
+
verified: true,
|
|
156
|
+
source: 'transport',
|
|
157
|
+
evidence: { response_completed: true }
|
|
158
|
+
},
|
|
159
|
+
browserUse: {
|
|
160
|
+
advertised: true,
|
|
161
|
+
source: 'manifest'
|
|
162
|
+
},
|
|
163
|
+
plugins: {
|
|
164
|
+
advertised: true,
|
|
165
|
+
source: 'manifest'
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
const authIndependentBase = {
|
|
169
|
+
mode: 'cli-provider',
|
|
170
|
+
level: 'shallow',
|
|
171
|
+
configured: true,
|
|
172
|
+
checkedAt,
|
|
173
|
+
manifest,
|
|
174
|
+
gatewayAuth: {
|
|
175
|
+
transport: 'x-codex-lb-api-key',
|
|
176
|
+
configured: true,
|
|
177
|
+
observed: false
|
|
178
|
+
},
|
|
179
|
+
providerIdentity: {
|
|
180
|
+
requiresOauth: true,
|
|
181
|
+
configured: true
|
|
182
|
+
},
|
|
183
|
+
catalog: {
|
|
184
|
+
catalog,
|
|
185
|
+
configuredServiceTier: 'fast'
|
|
186
|
+
},
|
|
187
|
+
browserUse: {
|
|
188
|
+
advertised: true,
|
|
189
|
+
source: 'manifest'
|
|
190
|
+
},
|
|
191
|
+
plugins: {
|
|
192
|
+
advertised: true,
|
|
193
|
+
source: 'manifest'
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
const oauthAvailable = runCodexLbDesktopCapabilityReport({
|
|
197
|
+
...authIndependentBase,
|
|
198
|
+
oauthPreserved: true
|
|
199
|
+
});
|
|
200
|
+
const oauthMissing = runCodexLbDesktopCapabilityReport({
|
|
201
|
+
...authIndependentBase,
|
|
202
|
+
oauthPreserved: false
|
|
203
|
+
});
|
|
204
|
+
const fixtureVerifiableKeys = [
|
|
205
|
+
'gateway_auth_transport',
|
|
206
|
+
'provider_identity',
|
|
207
|
+
'bridge',
|
|
208
|
+
'catalog',
|
|
209
|
+
'model_picker',
|
|
210
|
+
'fast_mode',
|
|
211
|
+
'image_generation',
|
|
212
|
+
'computer_use',
|
|
213
|
+
'browser_use',
|
|
214
|
+
'voice_mode',
|
|
215
|
+
'plugins',
|
|
216
|
+
'auxiliary_surfaces'
|
|
217
|
+
];
|
|
218
|
+
const authIndependentKeys = [
|
|
219
|
+
'gateway_auth_transport',
|
|
220
|
+
'catalog',
|
|
221
|
+
'model_picker',
|
|
222
|
+
'fast_mode',
|
|
223
|
+
'image_generation',
|
|
224
|
+
'computer_use',
|
|
225
|
+
'browser_use',
|
|
226
|
+
'voice_mode',
|
|
227
|
+
'plugins',
|
|
228
|
+
'auxiliary_surfaces'
|
|
229
|
+
];
|
|
230
|
+
const textIndependentKeys = [
|
|
231
|
+
'image_generation',
|
|
232
|
+
'computer_use',
|
|
233
|
+
'browser_use',
|
|
234
|
+
'voice_mode',
|
|
235
|
+
'plugins',
|
|
236
|
+
'auxiliary_surfaces'
|
|
237
|
+
];
|
|
238
|
+
const advertisedNotVerified = advertisedStatus.ready === false
|
|
239
|
+
&& advertisedOnly.overall === 'available_unverified'
|
|
240
|
+
&& capabilityEntries(advertisedOnly).every(([, evidence]) => evidence.state !== 'verified');
|
|
241
|
+
const fixtureNotVerified = fixtureStatus.ready === false
|
|
242
|
+
&& fixtureOnly.overall === 'available_unverified'
|
|
243
|
+
&& fixtureVerifiableKeys.every((key) => fixtureOnly[key].state === 'available_unverified');
|
|
244
|
+
const textDoesNotPromoteOtherCapabilities = textOnly.text_responses.state === 'verified'
|
|
245
|
+
&& textIndependentKeys.every((key) => textOnly[key].state !== 'verified');
|
|
246
|
+
const independentFromAuthMode = oauthAvailable.provider_identity.state === 'available_unverified'
|
|
247
|
+
&& oauthMissing.provider_identity.state === 'blocked'
|
|
248
|
+
&& authIndependentKeys.every((key) => (oauthAvailable[key].state === oauthMissing[key].state
|
|
249
|
+
&& JSON.stringify(oauthAvailable[key].blockers) === JSON.stringify(oauthMissing[key].blockers)));
|
|
250
|
+
const report = {
|
|
251
|
+
schema: 'sks.codex-lb-desktop-capabilities-check.v1',
|
|
252
|
+
ok: advertisedNotVerified
|
|
253
|
+
&& fixtureNotVerified
|
|
254
|
+
&& textDoesNotPromoteOtherCapabilities
|
|
255
|
+
&& independentFromAuthMode,
|
|
256
|
+
advertised_not_verified: advertisedNotVerified,
|
|
257
|
+
fixture_not_verified: fixtureNotVerified,
|
|
258
|
+
text_does_not_promote_other_capabilities: textDoesNotPromoteOtherCapabilities,
|
|
259
|
+
independent_from_auth_mode: independentFromAuthMode,
|
|
260
|
+
states: {
|
|
261
|
+
advertised_only: advertisedOnly.overall,
|
|
262
|
+
fixture_only: fixtureOnly.overall,
|
|
263
|
+
text_only: textOnly.overall,
|
|
264
|
+
oauth_available_provider_identity: oauthAvailable.provider_identity.state,
|
|
265
|
+
oauth_missing_provider_identity: oauthMissing.provider_identity.state
|
|
266
|
+
},
|
|
267
|
+
blockers: [
|
|
268
|
+
...(advertisedNotVerified ? [] : ['manifest_or_config_promoted_to_verified']),
|
|
269
|
+
...(fixtureNotVerified ? [] : ['fixture_evidence_promoted_to_verified']),
|
|
270
|
+
...(textDoesNotPromoteOtherCapabilities ? [] : ['text_response_evidence_promoted_other_capability']),
|
|
271
|
+
...(independentFromAuthMode ? [] : ['independent_capability_changed_with_auth_mode'])
|
|
272
|
+
]
|
|
273
|
+
};
|
|
274
|
+
assertGate(report.ok, 'codex-lb Desktop capability evidence gate failed', report);
|
|
275
|
+
emitGate('codex-lb:desktop-capabilities', {
|
|
276
|
+
advertised_not_verified: report.advertised_not_verified,
|
|
277
|
+
fixture_not_verified: report.fixture_not_verified,
|
|
278
|
+
text_does_not_promote_other_capabilities: report.text_does_not_promote_other_capabilities,
|
|
279
|
+
independent_from_auth_mode: report.independent_from_auth_mode
|
|
280
|
+
});
|
|
281
|
+
function capabilityEntries(report) {
|
|
282
|
+
return Object.entries(report)
|
|
283
|
+
.filter((entry) => {
|
|
284
|
+
const value = entry[1];
|
|
285
|
+
return Boolean(value && typeof value === 'object' && 'state' in value && 'evidence' in value);
|
|
286
|
+
});
|
|
287
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { writeJsonAtomic } from '../core/fsx.js';
|
|
4
|
+
import { codexLbDesktopStatusV2, readCodexLbDesktopDeepEvidence, readCodexLbDesktopDeepEvidenceTrustAnchors } from '../core/codex-lb/desktop-controller.js';
|
|
5
|
+
import { CODEX_LB_DESKTOP_REAL_EVIDENCE_CHECK_SCHEMA, validateCodexLbDesktopRealEvidence } from '../core/codex-lb/desktop-real-evidence.js';
|
|
6
|
+
import { uniqueValues as unique } from '../core/text/strings.js';
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
const evidencePath = readArg('--evidence')
|
|
9
|
+
|| process.env.SKS_CODEX_LB_DESKTOP_REAL_EVIDENCE_PATH
|
|
10
|
+
|| null;
|
|
11
|
+
const trustAnchorsPath = readArg('--trust-anchors')
|
|
12
|
+
|| process.env.SKS_CODEX_LB_DESKTOP_REAL_EVIDENCE_TRUST_ANCHORS_PATH
|
|
13
|
+
|| null;
|
|
14
|
+
const home = readArg('--home') || process.env.HOME || null;
|
|
15
|
+
const maxAgeMs = positiveNumber(readArg('--max-age-ms') || process.env.SKS_CODEX_LB_DESKTOP_REAL_EVIDENCE_MAX_AGE_MS);
|
|
16
|
+
const reportPath = path.join(process.cwd(), '.sneakoscope', 'reports', 'codex-lb-desktop-real-evidence-check.json');
|
|
17
|
+
const blockers = [];
|
|
18
|
+
let status = null;
|
|
19
|
+
let result;
|
|
20
|
+
try {
|
|
21
|
+
status = await codexLbDesktopStatusV2({
|
|
22
|
+
...(home ? { home } : {}),
|
|
23
|
+
networkProbes: false
|
|
24
|
+
});
|
|
25
|
+
const mode = String(status.mode || 'disabled');
|
|
26
|
+
const bridge = asRecord(status.bridge);
|
|
27
|
+
const endpoint = loopbackCodexEndpoint(bridge.listen_origin);
|
|
28
|
+
if (mode !== 'desktop-native-bridge')
|
|
29
|
+
blockers.push('codex_lb_desktop_real_evidence_native_mode_required');
|
|
30
|
+
if (!endpoint)
|
|
31
|
+
blockers.push('codex_lb_desktop_real_evidence_loopback_endpoint_missing');
|
|
32
|
+
if (!evidencePath)
|
|
33
|
+
blockers.push('codex_lb_desktop_real_evidence_path_missing');
|
|
34
|
+
if (!trustAnchorsPath)
|
|
35
|
+
blockers.push('codex_lb_desktop_real_evidence_trust_anchors_path_missing');
|
|
36
|
+
if (blockers.length || !evidencePath || !trustAnchorsPath || !endpoint) {
|
|
37
|
+
result = missingResult(mode, endpoint, blockers);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
const [evidence, trustAnchors] = await Promise.all([
|
|
41
|
+
readCodexLbDesktopDeepEvidence(evidencePath),
|
|
42
|
+
readCodexLbDesktopDeepEvidenceTrustAnchors(trustAnchorsPath)
|
|
43
|
+
]);
|
|
44
|
+
result = validateCodexLbDesktopRealEvidence(evidence, {
|
|
45
|
+
expectedMode: 'desktop-native-bridge',
|
|
46
|
+
expectedEndpoint: endpoint,
|
|
47
|
+
trustAnchors,
|
|
48
|
+
...(maxAgeMs ? { maxAgeMs } : {})
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
result = missingResult(String(status?.mode || 'disabled'), loopbackCodexEndpoint(asRecord(status?.bridge).listen_origin), [safeError(error)]);
|
|
54
|
+
}
|
|
55
|
+
const report = {
|
|
56
|
+
...result,
|
|
57
|
+
evidence_path: evidencePath ? path.resolve(evidencePath) : null,
|
|
58
|
+
trust_anchors_path: trustAnchorsPath ? path.resolve(trustAnchorsPath) : null,
|
|
59
|
+
actual_status: {
|
|
60
|
+
mode: status?.mode || null,
|
|
61
|
+
bridge_running: asRecord(status?.bridge).running === true,
|
|
62
|
+
oauth_present: asRecord(status?.oauth).present === true,
|
|
63
|
+
built_in_provider_retained: asRecord(status?.provider).built_in === true
|
|
64
|
+
},
|
|
65
|
+
report_path: path.relative(process.cwd(), reportPath).split(path.sep).join('/')
|
|
66
|
+
};
|
|
67
|
+
await writeJsonAtomic(reportPath, report);
|
|
68
|
+
console.log(JSON.stringify(report, null, 2));
|
|
69
|
+
if (report.ok !== true)
|
|
70
|
+
process.exitCode = 1;
|
|
71
|
+
function missingResult(mode, endpoint, reasons) {
|
|
72
|
+
return {
|
|
73
|
+
schema: CODEX_LB_DESKTOP_REAL_EVIDENCE_CHECK_SCHEMA,
|
|
74
|
+
ok: false,
|
|
75
|
+
status: 'real_required_missing',
|
|
76
|
+
release_authorizing: false,
|
|
77
|
+
mode,
|
|
78
|
+
endpoint,
|
|
79
|
+
producer_id: null,
|
|
80
|
+
deep_evidence_validation: null,
|
|
81
|
+
required_true_fields: [],
|
|
82
|
+
required_string_fields: [],
|
|
83
|
+
required_array_fields: [],
|
|
84
|
+
verified_fields: [],
|
|
85
|
+
blockers: unique(reasons.length ? reasons : ['codex_lb_desktop_real_evidence_missing']),
|
|
86
|
+
warnings: []
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function loopbackCodexEndpoint(value) {
|
|
90
|
+
try {
|
|
91
|
+
const origin = new URL(String(value || ''));
|
|
92
|
+
if (origin.protocol !== 'http:'
|
|
93
|
+
|| !['127.0.0.1', '::1'].includes(origin.hostname)
|
|
94
|
+
|| origin.username
|
|
95
|
+
|| origin.password
|
|
96
|
+
|| origin.search
|
|
97
|
+
|| origin.hash)
|
|
98
|
+
return null;
|
|
99
|
+
return new URL('/backend-api/codex', origin).toString().replace(/\/+$/, '');
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function readArg(name) {
|
|
106
|
+
const index = args.indexOf(name);
|
|
107
|
+
return index >= 0 && args[index + 1] ? String(args[index + 1]) : null;
|
|
108
|
+
}
|
|
109
|
+
function positiveNumber(value) {
|
|
110
|
+
const parsed = Number(value);
|
|
111
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : null;
|
|
112
|
+
}
|
|
113
|
+
function asRecord(value) {
|
|
114
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
115
|
+
? value
|
|
116
|
+
: {};
|
|
117
|
+
}
|
|
118
|
+
function safeError(error) {
|
|
119
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
120
|
+
return /^[a-z0-9_:-]+$/i.test(message)
|
|
121
|
+
? message
|
|
122
|
+
: 'codex_lb_desktop_real_evidence_check_failed';
|
|
123
|
+
}
|
|
@@ -13,15 +13,22 @@ await fs.writeFile(path.join(home, '.codex', 'config.toml'), [
|
|
|
13
13
|
'service_tier = "fast"',
|
|
14
14
|
'',
|
|
15
15
|
'[model_providers.codex-lb]',
|
|
16
|
-
'name = "
|
|
16
|
+
'name = "codex-lb"',
|
|
17
17
|
'base_url = "https://lb.example.test/backend-api/codex"',
|
|
18
18
|
'wire_api = "responses"',
|
|
19
19
|
'env_key = "CODEX_LB_API_KEY"',
|
|
20
20
|
'supports_websockets = true',
|
|
21
|
-
'requires_openai_auth =
|
|
21
|
+
'requires_openai_auth = false',
|
|
22
22
|
''
|
|
23
23
|
].join('\n'));
|
|
24
|
-
await fs.writeFile(path.join(home, '.codex', 'auth.json'), `${JSON.stringify({
|
|
24
|
+
await fs.writeFile(path.join(home, '.codex', 'auth.json'), `${JSON.stringify({
|
|
25
|
+
auth_mode: 'chatgpt',
|
|
26
|
+
account_id: 'acct-fast-truth',
|
|
27
|
+
tokens: {
|
|
28
|
+
access_token: 'oauth-fast-truth',
|
|
29
|
+
refresh_token: 'refresh-fast-truth'
|
|
30
|
+
}
|
|
31
|
+
})}\n`);
|
|
25
32
|
await fs.writeFile(path.join(home, '.codex', 'sks-codex-lb.env'), "export CODEX_LB_BASE_URL='https://lb.example.test/backend-api/codex'\nexport CODEX_LB_API_KEY='sk-fixture'\n");
|
|
26
33
|
const chain = await runFastCheck({
|
|
27
34
|
HOME: home,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import path from 'node:path';
|
|
5
|
-
import { codexLbConfigPath, codexLbEnvPath,
|
|
5
|
+
import { codexLbConfigPath, codexLbEnvPath, configureCodexLbDesktopRouting, ensureGlobalCodexFastModeDuringInstall, repairCodexLbAuth } from '../cli/install-helpers.js';
|
|
6
6
|
import { escapeRegExp } from '../core/text/regex.js';
|
|
7
7
|
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-codex-lb-fast-ui-'));
|
|
8
8
|
const home = path.join(tmp, 'home');
|
|
@@ -10,18 +10,24 @@ const codexHome = path.join(home, '.codex');
|
|
|
10
10
|
const configPath = codexLbConfigPath(home);
|
|
11
11
|
const envPath = codexLbEnvPath(home);
|
|
12
12
|
const authPath = path.join(codexHome, 'auth.json');
|
|
13
|
-
const
|
|
13
|
+
const remoteBaseUrl = 'https://lb.example.test/backend-api/codex';
|
|
14
|
+
const bridgeBaseUrl = 'http://127.0.0.1:54321/backend-api/codex';
|
|
14
15
|
await fs.mkdir(codexHome, { recursive: true });
|
|
15
|
-
const oauthAuth = JSON.stringify({
|
|
16
|
+
const oauthAuth = `${JSON.stringify({
|
|
16
17
|
auth_mode: 'chatgpt',
|
|
17
|
-
tokens: {
|
|
18
|
+
tokens: {
|
|
19
|
+
id_token: 'oauth-id',
|
|
20
|
+
access_token: 'oauth-access',
|
|
21
|
+
refresh_token: 'oauth-refresh'
|
|
22
|
+
},
|
|
18
23
|
account_id: 'acct-fast-ui-fixture'
|
|
19
|
-
}, null, 2)
|
|
24
|
+
}, null, 2)}\n`;
|
|
20
25
|
await fs.writeFile(configPath, [
|
|
21
26
|
'model = "future-codex-model"',
|
|
22
27
|
'model_reasoning_effort = "low"',
|
|
23
|
-
'model_provider = "codex-lb"',
|
|
24
28
|
'service_tier = "fast"',
|
|
29
|
+
'# sks-codex-lb-managed-desktop-bridge',
|
|
30
|
+
`openai_base_url = "${bridgeBaseUrl}"`,
|
|
25
31
|
'',
|
|
26
32
|
'[features]',
|
|
27
33
|
'fast_mode = true',
|
|
@@ -32,61 +38,96 @@ await fs.writeFile(configPath, [
|
|
|
32
38
|
'enabled = true',
|
|
33
39
|
'',
|
|
34
40
|
'[model_providers.codex-lb]',
|
|
35
|
-
'name = "
|
|
36
|
-
|
|
41
|
+
'name = "codex-lb"',
|
|
42
|
+
`base_url = "${remoteBaseUrl}"`,
|
|
37
43
|
'wire_api = "responses"',
|
|
38
44
|
'env_key = "CODEX_LB_API_KEY"',
|
|
39
45
|
'supports_websockets = true',
|
|
40
46
|
'requires_openai_auth = false',
|
|
41
47
|
''
|
|
42
48
|
].join('\n'));
|
|
43
|
-
await fs.writeFile(envPath,
|
|
44
|
-
await fs.writeFile(authPath,
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
await fs.writeFile(envPath, `export CODEX_LB_BASE_URL="${remoteBaseUrl}"\nexport CODEX_LB_API_KEY="sk-test-fast-ui"\n`);
|
|
50
|
+
await fs.writeFile(authPath, oauthAuth);
|
|
51
|
+
const install = await ensureGlobalCodexFastModeDuringInstall({
|
|
52
|
+
home,
|
|
53
|
+
configPath,
|
|
54
|
+
forceFastMode: true
|
|
55
|
+
});
|
|
56
|
+
const firstRepair = await repairCodexLbAuth({
|
|
57
|
+
home,
|
|
58
|
+
configPath,
|
|
59
|
+
envPath,
|
|
60
|
+
forceCodexLbApiKeyAuth: true,
|
|
61
|
+
forceFastMode: true,
|
|
62
|
+
authMode: 'codex-lb'
|
|
51
63
|
});
|
|
52
|
-
const install = await ensureGlobalCodexFastModeDuringInstall({ home, configPath, forceFastMode: true });
|
|
53
|
-
const firstRepair = await repairCodexLbAuth({ home, configPath, envPath, forceCodexLbApiKeyAuth: true, forceFastMode: true, authMode: 'codex-lb', toolOutputRecoveryFetch });
|
|
54
64
|
const firstConfig = await fs.readFile(configPath, 'utf8');
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const
|
|
65
|
+
const firstAuth = await fs.readFile(authPath, 'utf8');
|
|
66
|
+
const firstAssert = assertConfig(firstConfig, 'native_repair');
|
|
67
|
+
const disabled = await configureCodexLbDesktopRouting({
|
|
68
|
+
mode: 'disabled',
|
|
69
|
+
home,
|
|
70
|
+
configPath,
|
|
71
|
+
authPath
|
|
72
|
+
});
|
|
73
|
+
const disabledConfig = await fs.readFile(configPath, 'utf8');
|
|
74
|
+
const disabledAuth = await fs.readFile(authPath, 'utf8');
|
|
75
|
+
const disableAssert = assertConfig(disabledConfig, 'routing_disabled', {
|
|
76
|
+
expectBridge: false
|
|
77
|
+
});
|
|
78
|
+
const reenabled = await configureCodexLbDesktopRouting({
|
|
79
|
+
mode: 'desktop-native-bridge',
|
|
80
|
+
home,
|
|
81
|
+
configPath,
|
|
82
|
+
authPath,
|
|
83
|
+
bridgeBaseUrl,
|
|
84
|
+
remoteBaseUrl,
|
|
85
|
+
gatewayAuthTransport: 'x-codex-lb-api-key'
|
|
86
|
+
});
|
|
87
|
+
const reenabledConfig = await fs.readFile(configPath, 'utf8');
|
|
88
|
+
const reenabledAuth = await fs.readFile(authPath, 'utf8');
|
|
89
|
+
const reenableAssert = assertConfig(reenabledConfig, 'native_reenabled');
|
|
90
|
+
const authPreserved = [firstAuth, disabledAuth, reenabledAuth]
|
|
91
|
+
.every((value) => value === oauthAuth);
|
|
69
92
|
const report = {
|
|
70
|
-
schema: 'sks.codex-lb-fast-ui-preservation-check.
|
|
71
|
-
ok:
|
|
93
|
+
schema: 'sks.codex-lb-fast-ui-preservation-check.v2',
|
|
94
|
+
ok: firstRepair.ok === true
|
|
95
|
+
&& disabled.ok === true
|
|
96
|
+
&& reenabled.ok === true
|
|
97
|
+
&& authPreserved
|
|
98
|
+
&& firstAssert.ok
|
|
99
|
+
&& disableAssert.ok
|
|
100
|
+
&& reenableAssert.ok,
|
|
72
101
|
install_status: install.status,
|
|
73
102
|
first_repair_status: firstRepair.status,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
103
|
+
disable_status: disabled.status,
|
|
104
|
+
reenable_status: reenabled.status,
|
|
105
|
+
oauth_preserved: authPreserved,
|
|
106
|
+
assertions: [firstAssert, disableAssert, reenableAssert],
|
|
77
107
|
config_path: configPath,
|
|
78
|
-
blockers: [
|
|
108
|
+
blockers: [
|
|
109
|
+
...(authPreserved ? [] : ['chatgpt_oauth_changed_during_routing_or_fast_repair']),
|
|
110
|
+
...firstAssert.blockers,
|
|
111
|
+
...disableAssert.blockers,
|
|
112
|
+
...reenableAssert.blockers
|
|
113
|
+
]
|
|
79
114
|
};
|
|
80
115
|
console.log(JSON.stringify(report, null, 2));
|
|
81
116
|
if (!report.ok)
|
|
82
117
|
process.exitCode = 1;
|
|
83
|
-
function assertConfig(text, label) {
|
|
118
|
+
function assertConfig(text, label, options = {}) {
|
|
119
|
+
const expectBridge = options.expectBridge !== false;
|
|
84
120
|
const blockers = [
|
|
85
121
|
...(hasLegacyFastModeTables(text) ? ['legacy_fast_mode_tables_present'] : []),
|
|
86
122
|
...(tableKey(text, 'features', 'fast_mode') === 'true' ? [] : ['features_fast_mode_not_true']),
|
|
87
123
|
...(tableKey(text, 'features', 'fast_mode_ui') ? ['features_fast_mode_ui_legacy_flag_present'] : []),
|
|
88
124
|
...(hasTable(text, 'model_providers.codex-lb') ? [] : ['codex_lb_provider_table_missing']),
|
|
89
|
-
...(tableKey(text, 'model_providers.codex-lb', '
|
|
125
|
+
...(tableKey(text, 'model_providers.codex-lb', 'name') === 'codex-lb' ? [] : ['cli_provider_name_not_codex_lb']),
|
|
126
|
+
...(tableKey(text, 'model_providers.codex-lb', 'requires_openai_auth') === 'false' ? [] : ['cli_provider_requires_openai_auth_not_false']),
|
|
127
|
+
...(tableKey(text, 'model_providers.codex-lb', 'env_key') === 'CODEX_LB_API_KEY' ? [] : ['cli_provider_env_key_missing']),
|
|
128
|
+
...(topLevelKey(text, 'model_provider') ? ['desktop_model_provider_must_not_be_selected'] : []),
|
|
129
|
+
...(expectBridge && topLevelKey(text, 'openai_base_url') !== bridgeBaseUrl ? ['native_bridge_base_url_missing'] : []),
|
|
130
|
+
...(!expectBridge && topLevelKey(text, 'openai_base_url') ? ['disabled_routing_still_has_openai_base_url'] : []),
|
|
90
131
|
...(topLevelKey(text, 'model') === 'future-codex-model' ? [] : ['user_model_not_preserved']),
|
|
91
132
|
...(topLevelKey(text, 'model_reasoning_effort') === 'low' ? [] : ['user_reasoning_effort_not_preserved'])
|
|
92
133
|
];
|