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,32 @@
|
|
|
1
|
+
export const CODEX_LB_DESKTOP_MODES = [
|
|
2
|
+
'desktop-native-bridge',
|
|
3
|
+
'desktop-dual-auth-compat',
|
|
4
|
+
'cli-provider',
|
|
5
|
+
'disabled'
|
|
6
|
+
];
|
|
7
|
+
export const CODEX_LB_GATEWAY_AUTH_TRANSPORTS = [
|
|
8
|
+
'x-codex-lb-api-key',
|
|
9
|
+
'authorization-bearer-compat'
|
|
10
|
+
];
|
|
11
|
+
export const DEFAULT_CODEX_LB_DESKTOP_MODE = 'desktop-native-bridge';
|
|
12
|
+
export const DEFAULT_CODEX_LB_GATEWAY_AUTH_TRANSPORT = 'x-codex-lb-api-key';
|
|
13
|
+
export function parseCodexLbDesktopMode(value) {
|
|
14
|
+
const normalized = String(value ?? '').trim();
|
|
15
|
+
if (CODEX_LB_DESKTOP_MODES.includes(normalized)) {
|
|
16
|
+
return normalized;
|
|
17
|
+
}
|
|
18
|
+
throw new Error(`unsupported_codex_lb_desktop_mode:${normalized || 'empty'}`);
|
|
19
|
+
}
|
|
20
|
+
export function parseCodexLbGatewayAuthTransport(value) {
|
|
21
|
+
const normalized = String(value ?? '').trim();
|
|
22
|
+
if (CODEX_LB_GATEWAY_AUTH_TRANSPORTS.includes(normalized)) {
|
|
23
|
+
return normalized;
|
|
24
|
+
}
|
|
25
|
+
throw new Error(`unsupported_codex_lb_gateway_auth_transport:${normalized || 'empty'}`);
|
|
26
|
+
}
|
|
27
|
+
export function modeRequiresChatGptOAuth(mode) {
|
|
28
|
+
return mode === 'desktop-native-bridge' || mode === 'desktop-dual-auth-compat';
|
|
29
|
+
}
|
|
30
|
+
export function modeMayMutateSharedAuth(_mode) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { isComputerCallEvent } from './probes/computer-use-probe.js';
|
|
2
|
+
import { isImageOutputEvent } from './probes/image-generation-probe.js';
|
|
3
|
+
import { validateCodexLbDesktopDeepEvidence } from './trusted-deep-evidence.js';
|
|
4
|
+
import { uniqueValues as unique } from '../text/strings.js';
|
|
5
|
+
export const CODEX_LB_DESKTOP_REAL_EVIDENCE_CHECK_SCHEMA = 'sks.codex-lb-desktop-real-evidence-check.v1';
|
|
6
|
+
export const CODEX_LB_DESKTOP_REAL_EVIDENCE_REQUIRED_TRUE_FIELDS = Object.freeze([
|
|
7
|
+
'provider_identity_verified',
|
|
8
|
+
'picker_control_visible',
|
|
9
|
+
'bridge_websocket_round_trip',
|
|
10
|
+
'image_request_tools_present',
|
|
11
|
+
'image_artifact_materialized',
|
|
12
|
+
'computer_executor_completed',
|
|
13
|
+
'computer_output_submitted',
|
|
14
|
+
'computer_follow_up_completed',
|
|
15
|
+
'computer_session_affinity_preserved',
|
|
16
|
+
'browser_use_verified',
|
|
17
|
+
'voice_create_verified',
|
|
18
|
+
'voice_location_received',
|
|
19
|
+
'voice_location_rewritten',
|
|
20
|
+
'voice_websocket_upgraded',
|
|
21
|
+
'voice_server_event_seen',
|
|
22
|
+
'voice_clean_close',
|
|
23
|
+
'voice_owner_binding_verified',
|
|
24
|
+
'plugins_verified',
|
|
25
|
+
'auxiliary_request_body_hash_preserved',
|
|
26
|
+
'auxiliary_owner_affinity_verified',
|
|
27
|
+
'desktop_adoption_verified',
|
|
28
|
+
'oauth_bytes_unchanged_before_restart',
|
|
29
|
+
'oauth_semantic_identity_verified_after_restart',
|
|
30
|
+
'built_in_openai_provider_retained',
|
|
31
|
+
'fast_selector_visible',
|
|
32
|
+
'fast_effective_verified',
|
|
33
|
+
'text_response_verified',
|
|
34
|
+
'code_mcp_search_verified',
|
|
35
|
+
'files_transcribe_verified',
|
|
36
|
+
'memory_thread_goal_routes_verified',
|
|
37
|
+
'existing_thread_resumed',
|
|
38
|
+
'new_thread_created',
|
|
39
|
+
'disable_routing_verified',
|
|
40
|
+
'rollback_byte_exact_verified',
|
|
41
|
+
'app_restart_recovery_verified',
|
|
42
|
+
'mac_reboot_recovery_verified',
|
|
43
|
+
'remote_other_mac_runtime_verified',
|
|
44
|
+
'auth_mode_independence_verified'
|
|
45
|
+
]);
|
|
46
|
+
const REQUIRED_NONEMPTY_STRING_FIELDS = Object.freeze([
|
|
47
|
+
'picker_selected_model',
|
|
48
|
+
'configured_service_tier',
|
|
49
|
+
'request_service_tier',
|
|
50
|
+
'response_actual_service_tier',
|
|
51
|
+
'source_surface',
|
|
52
|
+
'desktop_build',
|
|
53
|
+
'codex_core_version',
|
|
54
|
+
'protocol_fixture_schema_hash',
|
|
55
|
+
'app_origin_observed'
|
|
56
|
+
]);
|
|
57
|
+
const REQUIRED_NONEMPTY_ARRAY_FIELDS = Object.freeze([
|
|
58
|
+
'image_events',
|
|
59
|
+
'computer_events',
|
|
60
|
+
'auxiliary_routes_observed',
|
|
61
|
+
'auxiliary_events',
|
|
62
|
+
'auxiliary_output_events'
|
|
63
|
+
]);
|
|
64
|
+
const DEFAULT_RELEASE_PRODUCERS = Object.freeze([
|
|
65
|
+
'sks.codex-lb-desktop-blackbox'
|
|
66
|
+
]);
|
|
67
|
+
export function validateCodexLbDesktopRealEvidence(raw, options) {
|
|
68
|
+
const validation = validateCodexLbDesktopDeepEvidence(raw, {
|
|
69
|
+
expectedMode: options.expectedMode,
|
|
70
|
+
expectedEndpoint: options.expectedEndpoint,
|
|
71
|
+
trustAnchors: options.trustAnchors,
|
|
72
|
+
...(options.now !== undefined ? { now: options.now } : {}),
|
|
73
|
+
...(options.maxAgeMs !== undefined ? { maxAgeMs: options.maxAgeMs } : {}),
|
|
74
|
+
...(options.maxFutureSkewMs !== undefined ? { maxFutureSkewMs: options.maxFutureSkewMs } : {})
|
|
75
|
+
});
|
|
76
|
+
const blockers = [...validation.blockers];
|
|
77
|
+
const verifiedFields = [];
|
|
78
|
+
const payload = validation.evidence;
|
|
79
|
+
const allowedProducerIds = new Set(options.allowedProducerIds || DEFAULT_RELEASE_PRODUCERS);
|
|
80
|
+
if (validation.state !== 'verified' || !payload) {
|
|
81
|
+
blockers.push('codex_lb_desktop_real_evidence_unverified');
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
if (!validation.producer_id || !allowedProducerIds.has(validation.producer_id)) {
|
|
85
|
+
blockers.push('codex_lb_desktop_real_evidence_producer_not_allowed');
|
|
86
|
+
}
|
|
87
|
+
for (const field of CODEX_LB_DESKTOP_REAL_EVIDENCE_REQUIRED_TRUE_FIELDS) {
|
|
88
|
+
if (payload[field] === true)
|
|
89
|
+
verifiedFields.push(field);
|
|
90
|
+
else
|
|
91
|
+
blockers.push(`codex_lb_desktop_real_evidence_required_true:${field}`);
|
|
92
|
+
}
|
|
93
|
+
for (const field of REQUIRED_NONEMPTY_STRING_FIELDS) {
|
|
94
|
+
if (typeof payload[field] === 'string' && payload[field].trim())
|
|
95
|
+
verifiedFields.push(field);
|
|
96
|
+
else
|
|
97
|
+
blockers.push(`codex_lb_desktop_real_evidence_required_string:${field}`);
|
|
98
|
+
}
|
|
99
|
+
for (const field of REQUIRED_NONEMPTY_ARRAY_FIELDS) {
|
|
100
|
+
if (Array.isArray(payload[field]) && payload[field].length > 0)
|
|
101
|
+
verifiedFields.push(field);
|
|
102
|
+
else
|
|
103
|
+
blockers.push(`codex_lb_desktop_real_evidence_required_array:${field}`);
|
|
104
|
+
}
|
|
105
|
+
if (payload.desktop_adoption_source !== 'codex_desktop_runtime') {
|
|
106
|
+
blockers.push('codex_lb_desktop_real_evidence_adoption_source_invalid');
|
|
107
|
+
}
|
|
108
|
+
if (payload.source_surface !== 'codex_desktop_runtime') {
|
|
109
|
+
blockers.push('codex_lb_desktop_real_evidence_source_surface_invalid');
|
|
110
|
+
}
|
|
111
|
+
if (!/^[a-f0-9]{64}$/i.test(String(payload.protocol_fixture_schema_hash || ''))) {
|
|
112
|
+
blockers.push('codex_lb_desktop_real_evidence_protocol_fixture_hash_invalid');
|
|
113
|
+
}
|
|
114
|
+
if (!/^[a-z][a-z0-9+.-]*:\/\//i.test(String(payload.app_origin_observed || ''))) {
|
|
115
|
+
blockers.push('codex_lb_desktop_real_evidence_app_origin_invalid');
|
|
116
|
+
}
|
|
117
|
+
const requestTier = normalizeFastTier(payload.request_service_tier);
|
|
118
|
+
const responseTier = normalizeFastTier(payload.response_actual_service_tier);
|
|
119
|
+
if (requestTier !== 'priority')
|
|
120
|
+
blockers.push('codex_lb_desktop_real_evidence_fast_request_invalid');
|
|
121
|
+
if (responseTier !== 'priority')
|
|
122
|
+
blockers.push('codex_lb_desktop_real_evidence_fast_response_invalid');
|
|
123
|
+
if (!['fast', 'priority'].includes(String(payload.configured_service_tier || '').toLowerCase())) {
|
|
124
|
+
blockers.push('codex_lb_desktop_real_evidence_fast_configuration_invalid');
|
|
125
|
+
}
|
|
126
|
+
if (!['responses_tool', 'images_api'].includes(String(payload.image_route || ''))) {
|
|
127
|
+
blockers.push('codex_lb_desktop_real_evidence_image_route_invalid');
|
|
128
|
+
}
|
|
129
|
+
if (!(Array.isArray(payload.image_events) && payload.image_events.some(isImageOutputEvent))) {
|
|
130
|
+
blockers.push('codex_lb_desktop_real_evidence_image_output_event_missing');
|
|
131
|
+
}
|
|
132
|
+
if (!(Array.isArray(payload.computer_events) && payload.computer_events.some(isComputerCallEvent))) {
|
|
133
|
+
blockers.push('codex_lb_desktop_real_evidence_computer_call_event_missing');
|
|
134
|
+
}
|
|
135
|
+
if (Array.isArray(payload.auxiliary_events)
|
|
136
|
+
&& Array.isArray(payload.auxiliary_output_events)
|
|
137
|
+
&& stableJson(payload.auxiliary_events) !== stableJson(payload.auxiliary_output_events)) {
|
|
138
|
+
blockers.push('codex_lb_desktop_real_evidence_auxiliary_events_changed');
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const uniqueBlockers = unique(blockers);
|
|
142
|
+
const ok = uniqueBlockers.length === 0;
|
|
143
|
+
return {
|
|
144
|
+
schema: CODEX_LB_DESKTOP_REAL_EVIDENCE_CHECK_SCHEMA,
|
|
145
|
+
ok,
|
|
146
|
+
status: ok ? 'passed' : 'real_required_missing',
|
|
147
|
+
release_authorizing: ok,
|
|
148
|
+
mode: options.expectedMode,
|
|
149
|
+
endpoint: options.expectedEndpoint,
|
|
150
|
+
producer_id: validation.producer_id,
|
|
151
|
+
deep_evidence_validation: validation,
|
|
152
|
+
required_true_fields: CODEX_LB_DESKTOP_REAL_EVIDENCE_REQUIRED_TRUE_FIELDS,
|
|
153
|
+
required_string_fields: REQUIRED_NONEMPTY_STRING_FIELDS,
|
|
154
|
+
required_array_fields: REQUIRED_NONEMPTY_ARRAY_FIELDS,
|
|
155
|
+
verified_fields: unique(verifiedFields),
|
|
156
|
+
blockers: uniqueBlockers,
|
|
157
|
+
warnings: validation.warnings
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function normalizeFastTier(value) {
|
|
161
|
+
const tier = String(value || '').trim().toLowerCase();
|
|
162
|
+
if (tier === 'fast')
|
|
163
|
+
return 'priority';
|
|
164
|
+
return tier || null;
|
|
165
|
+
}
|
|
166
|
+
function stableJson(value) {
|
|
167
|
+
return JSON.stringify(value);
|
|
168
|
+
}
|