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,44 @@
|
|
|
1
|
+
import { probeEvidence } from './probe-evidence.js';
|
|
2
|
+
export function runVoiceRealtimeProbe(input) {
|
|
3
|
+
const attempted = input.attempted === true
|
|
4
|
+
|| input.createRouteVerified !== undefined
|
|
5
|
+
|| input.websocketUpgraded !== undefined;
|
|
6
|
+
const transportComplete = input.createRouteVerified === true
|
|
7
|
+
&& input.locationReceived === true
|
|
8
|
+
&& input.locationRewritten === true
|
|
9
|
+
&& input.websocketUpgraded === true
|
|
10
|
+
&& input.serverEventSeen === true
|
|
11
|
+
&& input.cleanClose === true
|
|
12
|
+
&& input.ownerBindingVerified === true;
|
|
13
|
+
const blockers = [
|
|
14
|
+
...(input.blockers || []),
|
|
15
|
+
...(attempted && input.createRouteVerified !== true ? ['realtime_create_unauthorized'] : []),
|
|
16
|
+
...(attempted && input.locationReceived !== true ? ['realtime_location_missing'] : []),
|
|
17
|
+
...(attempted && input.locationReceived === true && input.locationRewritten !== true ? ['realtime_location_not_rewritten'] : []),
|
|
18
|
+
...(attempted && input.websocketUpgraded !== true ? ['realtime_websocket_upgrade_failed'] : []),
|
|
19
|
+
...(attempted && input.websocketUpgraded === true && input.serverEventSeen !== true ? ['realtime_sideband_event_missing'] : []),
|
|
20
|
+
...(attempted && input.ownerBindingVerified !== true ? ['realtime_call_owner_binding_failed'] : [])
|
|
21
|
+
];
|
|
22
|
+
return probeEvidence({
|
|
23
|
+
advertised: input.routeAdvertised === true,
|
|
24
|
+
attempted,
|
|
25
|
+
verified: input.level === 'deep' && transportComplete,
|
|
26
|
+
fixture: input.fixture,
|
|
27
|
+
source: input.level === 'deep' ? 'deep_probe' : attempted ? 'transport' : 'manifest',
|
|
28
|
+
unsupported: input.routeAdvertised === false && !attempted,
|
|
29
|
+
blockers,
|
|
30
|
+
warnings: transportComplete && input.level !== 'deep'
|
|
31
|
+
? ['realtime_transport_verified_without_real_voice_session']
|
|
32
|
+
: [],
|
|
33
|
+
evidence: {
|
|
34
|
+
create_route_verified: input.createRouteVerified === true,
|
|
35
|
+
location_received: input.locationReceived === true,
|
|
36
|
+
location_rewritten: input.locationRewritten === true,
|
|
37
|
+
websocket_upgraded: input.websocketUpgraded === true,
|
|
38
|
+
server_event_seen: input.serverEventSeen === true,
|
|
39
|
+
clean_close: input.cleanClose === true,
|
|
40
|
+
owner_binding_verified: input.ownerBindingVerified === true,
|
|
41
|
+
fixture: input.fixture === true
|
|
42
|
+
}
|
|
43
|
+
}, input.checkedAt);
|
|
44
|
+
}
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { sha256 } from '../fsx.js';
|
|
2
|
+
import { uniqueValues as unique } from '../text/strings.js';
|
|
3
|
+
export const CODEX_LB_TRUSTED_DEEP_EVIDENCE_SCHEMA = 'sks.codex-lb-trusted-deep-evidence.v1';
|
|
4
|
+
export const CODEX_LB_DEEP_EVIDENCE_TRUST_ANCHOR_SCHEMA = 'sks.codex-lb-deep-evidence-trust-anchor.v1';
|
|
5
|
+
export const CODEX_LB_DEEP_EVIDENCE_TRUST_ANCHOR_SET_SCHEMA = 'sks.codex-lb-deep-evidence-trust-anchor-set.v1';
|
|
6
|
+
export const CODEX_LB_DEEP_EVIDENCE_VALIDATION_SCHEMA = 'sks.codex-lb-deep-evidence-validation.v1';
|
|
7
|
+
export const DEFAULT_CODEX_LB_DEEP_EVIDENCE_MAX_AGE_MS = 15 * 60 * 1000;
|
|
8
|
+
const DEFAULT_FUTURE_SKEW_MS = 60 * 1000;
|
|
9
|
+
const SHA256_PATTERN = /^[a-f0-9]{64}$/i;
|
|
10
|
+
const ID_PATTERN = /^[a-z0-9][a-z0-9._:/-]{2,127}$/i;
|
|
11
|
+
const PAYLOAD_KEYS = new Set([
|
|
12
|
+
'fixture',
|
|
13
|
+
'provider_identity_verified',
|
|
14
|
+
'picker_control_visible',
|
|
15
|
+
'picker_selected_model',
|
|
16
|
+
'configured_service_tier',
|
|
17
|
+
'request_service_tier',
|
|
18
|
+
'response_actual_service_tier',
|
|
19
|
+
'bridge_websocket_round_trip',
|
|
20
|
+
'image_route',
|
|
21
|
+
'image_request_tools_present',
|
|
22
|
+
'image_events',
|
|
23
|
+
'image_artifact_materialized',
|
|
24
|
+
'computer_events',
|
|
25
|
+
'computer_executor_completed',
|
|
26
|
+
'computer_output_submitted',
|
|
27
|
+
'computer_follow_up_completed',
|
|
28
|
+
'computer_session_affinity_preserved',
|
|
29
|
+
'browser_use_verified',
|
|
30
|
+
'voice_create_verified',
|
|
31
|
+
'voice_location_received',
|
|
32
|
+
'voice_location_rewritten',
|
|
33
|
+
'voice_websocket_upgraded',
|
|
34
|
+
'voice_server_event_seen',
|
|
35
|
+
'voice_clean_close',
|
|
36
|
+
'voice_owner_binding_verified',
|
|
37
|
+
'plugins_verified',
|
|
38
|
+
'auxiliary_routes_observed',
|
|
39
|
+
'auxiliary_events',
|
|
40
|
+
'auxiliary_output_events',
|
|
41
|
+
'auxiliary_request_body_hash_preserved',
|
|
42
|
+
'auxiliary_owner_affinity_verified',
|
|
43
|
+
'desktop_adoption_verified',
|
|
44
|
+
'desktop_adoption_source',
|
|
45
|
+
'oauth_bytes_unchanged_before_restart',
|
|
46
|
+
'oauth_semantic_identity_verified_after_restart',
|
|
47
|
+
'built_in_openai_provider_retained',
|
|
48
|
+
'fast_selector_visible',
|
|
49
|
+
'fast_effective_verified',
|
|
50
|
+
'text_response_verified',
|
|
51
|
+
'code_mcp_search_verified',
|
|
52
|
+
'files_transcribe_verified',
|
|
53
|
+
'memory_thread_goal_routes_verified',
|
|
54
|
+
'existing_thread_resumed',
|
|
55
|
+
'new_thread_created',
|
|
56
|
+
'disable_routing_verified',
|
|
57
|
+
'rollback_byte_exact_verified',
|
|
58
|
+
'app_restart_recovery_verified',
|
|
59
|
+
'mac_reboot_recovery_verified',
|
|
60
|
+
'remote_other_mac_runtime_verified',
|
|
61
|
+
'auth_mode_independence_verified',
|
|
62
|
+
'source_surface',
|
|
63
|
+
'desktop_build',
|
|
64
|
+
'codex_core_version',
|
|
65
|
+
'protocol_fixture_schema_hash',
|
|
66
|
+
'app_origin_observed'
|
|
67
|
+
]);
|
|
68
|
+
const BOOLEAN_PAYLOAD_KEYS = new Set([
|
|
69
|
+
'fixture',
|
|
70
|
+
'provider_identity_verified',
|
|
71
|
+
'picker_control_visible',
|
|
72
|
+
'bridge_websocket_round_trip',
|
|
73
|
+
'image_request_tools_present',
|
|
74
|
+
'image_artifact_materialized',
|
|
75
|
+
'computer_executor_completed',
|
|
76
|
+
'computer_output_submitted',
|
|
77
|
+
'computer_follow_up_completed',
|
|
78
|
+
'computer_session_affinity_preserved',
|
|
79
|
+
'browser_use_verified',
|
|
80
|
+
'voice_create_verified',
|
|
81
|
+
'voice_location_received',
|
|
82
|
+
'voice_location_rewritten',
|
|
83
|
+
'voice_websocket_upgraded',
|
|
84
|
+
'voice_server_event_seen',
|
|
85
|
+
'voice_clean_close',
|
|
86
|
+
'voice_owner_binding_verified',
|
|
87
|
+
'plugins_verified',
|
|
88
|
+
'auxiliary_request_body_hash_preserved',
|
|
89
|
+
'auxiliary_owner_affinity_verified',
|
|
90
|
+
'desktop_adoption_verified',
|
|
91
|
+
'oauth_bytes_unchanged_before_restart',
|
|
92
|
+
'oauth_semantic_identity_verified_after_restart',
|
|
93
|
+
'built_in_openai_provider_retained',
|
|
94
|
+
'fast_selector_visible',
|
|
95
|
+
'fast_effective_verified',
|
|
96
|
+
'text_response_verified',
|
|
97
|
+
'code_mcp_search_verified',
|
|
98
|
+
'files_transcribe_verified',
|
|
99
|
+
'memory_thread_goal_routes_verified',
|
|
100
|
+
'existing_thread_resumed',
|
|
101
|
+
'new_thread_created',
|
|
102
|
+
'disable_routing_verified',
|
|
103
|
+
'rollback_byte_exact_verified',
|
|
104
|
+
'app_restart_recovery_verified',
|
|
105
|
+
'mac_reboot_recovery_verified',
|
|
106
|
+
'remote_other_mac_runtime_verified',
|
|
107
|
+
'auth_mode_independence_verified'
|
|
108
|
+
]);
|
|
109
|
+
const NULLABLE_STRING_PAYLOAD_KEYS = new Set([
|
|
110
|
+
'picker_selected_model',
|
|
111
|
+
'configured_service_tier',
|
|
112
|
+
'request_service_tier',
|
|
113
|
+
'response_actual_service_tier',
|
|
114
|
+
'desktop_adoption_source',
|
|
115
|
+
'source_surface',
|
|
116
|
+
'desktop_build',
|
|
117
|
+
'codex_core_version',
|
|
118
|
+
'protocol_fixture_schema_hash',
|
|
119
|
+
'app_origin_observed'
|
|
120
|
+
]);
|
|
121
|
+
const ARRAY_PAYLOAD_KEYS = new Set([
|
|
122
|
+
'image_events',
|
|
123
|
+
'computer_events',
|
|
124
|
+
'auxiliary_routes_observed',
|
|
125
|
+
'auxiliary_events',
|
|
126
|
+
'auxiliary_output_events'
|
|
127
|
+
]);
|
|
128
|
+
export function validateCodexLbDesktopDeepEvidence(value, options) {
|
|
129
|
+
if (value == null)
|
|
130
|
+
return validation('available_unverified', ['codex_lb_deep_evidence_missing']);
|
|
131
|
+
const blockers = [];
|
|
132
|
+
if (!isRecord(value) || !hasExactKeys(value, ['schema', 'producer', 'created_at', 'target', 'payload', 'integrity'])) {
|
|
133
|
+
return validation('blocked', ['codex_lb_deep_evidence_schema_invalid']);
|
|
134
|
+
}
|
|
135
|
+
if (value.schema !== CODEX_LB_TRUSTED_DEEP_EVIDENCE_SCHEMA)
|
|
136
|
+
blockers.push('codex_lb_deep_evidence_schema_invalid');
|
|
137
|
+
const producer = parseProducer(value.producer, blockers, 'evidence');
|
|
138
|
+
const target = parseTarget(value.target, blockers, 'evidence');
|
|
139
|
+
const integrity = parseIntegrity(value.integrity, blockers);
|
|
140
|
+
const payload = parsePayload(value.payload, blockers);
|
|
141
|
+
const createdAt = typeof value.created_at === 'string' ? value.created_at : '';
|
|
142
|
+
const createdAtMs = Date.parse(createdAt);
|
|
143
|
+
if (!createdAt || !Number.isFinite(createdAtMs))
|
|
144
|
+
blockers.push('codex_lb_deep_evidence_created_at_invalid');
|
|
145
|
+
const expectedEndpoint = normalizeEndpoint(options.expectedEndpoint);
|
|
146
|
+
const evidenceEndpoint = target ? normalizeEndpoint(target.endpoint) : null;
|
|
147
|
+
if (!expectedEndpoint)
|
|
148
|
+
blockers.push('codex_lb_deep_evidence_expected_endpoint_invalid');
|
|
149
|
+
if (target && target.mode !== options.expectedMode)
|
|
150
|
+
blockers.push('codex_lb_deep_evidence_target_mode_mismatch');
|
|
151
|
+
if (target && (!evidenceEndpoint || evidenceEndpoint !== expectedEndpoint))
|
|
152
|
+
blockers.push('codex_lb_deep_evidence_target_endpoint_mismatch');
|
|
153
|
+
const nowMs = normalizeNow(options.now);
|
|
154
|
+
const maxAgeMs = positiveFinite(options.maxAgeMs, DEFAULT_CODEX_LB_DEEP_EVIDENCE_MAX_AGE_MS);
|
|
155
|
+
const futureSkewMs = positiveFinite(options.maxFutureSkewMs, DEFAULT_FUTURE_SKEW_MS);
|
|
156
|
+
if (Number.isFinite(createdAtMs) && createdAtMs < nowMs - maxAgeMs)
|
|
157
|
+
blockers.push('codex_lb_deep_evidence_stale');
|
|
158
|
+
if (Number.isFinite(createdAtMs) && createdAtMs > nowMs + futureSkewMs)
|
|
159
|
+
blockers.push('codex_lb_deep_evidence_created_at_in_future');
|
|
160
|
+
let contentSha256 = null;
|
|
161
|
+
if (producer && target && payload && createdAt && integrity) {
|
|
162
|
+
contentSha256 = codexLbDeepEvidenceContentSha256({
|
|
163
|
+
schema: CODEX_LB_TRUSTED_DEEP_EVIDENCE_SCHEMA,
|
|
164
|
+
producer,
|
|
165
|
+
created_at: createdAt,
|
|
166
|
+
target,
|
|
167
|
+
payload
|
|
168
|
+
});
|
|
169
|
+
if (integrity.content_sha256 !== contentSha256)
|
|
170
|
+
blockers.push('codex_lb_deep_evidence_content_sha256_mismatch');
|
|
171
|
+
}
|
|
172
|
+
const anchor = integrity
|
|
173
|
+
? (options.trustAnchors || []).find((candidate) => candidate.anchor_id === integrity.trust_anchor_id)
|
|
174
|
+
: null;
|
|
175
|
+
if (!anchor) {
|
|
176
|
+
blockers.push('codex_lb_deep_evidence_trust_anchor_missing');
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
validateAnchor(anchor, producer, target, contentSha256, blockers);
|
|
180
|
+
}
|
|
181
|
+
if (payload?.fixture === true) {
|
|
182
|
+
return {
|
|
183
|
+
...validation('available_unverified', unique([...blockers, 'codex_lb_deep_evidence_fixture_unverified'])),
|
|
184
|
+
producer_id: producer?.id || null,
|
|
185
|
+
created_at: createdAt || null,
|
|
186
|
+
content_sha256: contentSha256,
|
|
187
|
+
trust_anchor_id: integrity?.trust_anchor_id || null
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
if (blockers.length || !payload) {
|
|
191
|
+
return {
|
|
192
|
+
...validation('blocked', unique(blockers.length ? blockers : ['codex_lb_deep_evidence_invalid'])),
|
|
193
|
+
producer_id: producer?.id || null,
|
|
194
|
+
created_at: createdAt || null,
|
|
195
|
+
content_sha256: contentSha256,
|
|
196
|
+
trust_anchor_id: integrity?.trust_anchor_id || null
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
schema: CODEX_LB_DEEP_EVIDENCE_VALIDATION_SCHEMA,
|
|
201
|
+
state: 'verified',
|
|
202
|
+
trusted: true,
|
|
203
|
+
evidence: payload,
|
|
204
|
+
producer_id: producer.id,
|
|
205
|
+
created_at: createdAt,
|
|
206
|
+
content_sha256: contentSha256,
|
|
207
|
+
trust_anchor_id: integrity.trust_anchor_id,
|
|
208
|
+
blockers: [],
|
|
209
|
+
warnings: []
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
export function codexLbDeepEvidenceContentSha256(content) {
|
|
213
|
+
return sha256(canonicalJson(content));
|
|
214
|
+
}
|
|
215
|
+
export function parseCodexLbDeepEvidenceTrustAnchorSet(value) {
|
|
216
|
+
if (!isRecord(value) || !hasExactKeys(value, ['schema', 'anchors'])) {
|
|
217
|
+
return {
|
|
218
|
+
schema: CODEX_LB_DEEP_EVIDENCE_TRUST_ANCHOR_SET_SCHEMA,
|
|
219
|
+
ok: false,
|
|
220
|
+
anchors: [],
|
|
221
|
+
blockers: ['codex_lb_deep_evidence_trust_anchor_set_invalid']
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
if (value.schema !== CODEX_LB_DEEP_EVIDENCE_TRUST_ANCHOR_SET_SCHEMA
|
|
225
|
+
|| !Array.isArray(value.anchors)
|
|
226
|
+
|| value.anchors.length === 0) {
|
|
227
|
+
return {
|
|
228
|
+
schema: CODEX_LB_DEEP_EVIDENCE_TRUST_ANCHOR_SET_SCHEMA,
|
|
229
|
+
ok: false,
|
|
230
|
+
anchors: [],
|
|
231
|
+
blockers: ['codex_lb_deep_evidence_trust_anchor_set_invalid']
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
const blockers = [];
|
|
235
|
+
const anchors = [];
|
|
236
|
+
const seen = new Set();
|
|
237
|
+
for (const [index, candidate] of value.anchors.entries()) {
|
|
238
|
+
const candidateBlockers = [];
|
|
239
|
+
validateAnchor(candidate, null, null, null, candidateBlockers);
|
|
240
|
+
const anchorId = isRecord(candidate) && typeof candidate.anchor_id === 'string'
|
|
241
|
+
? candidate.anchor_id
|
|
242
|
+
: '';
|
|
243
|
+
if (anchorId && seen.has(anchorId))
|
|
244
|
+
candidateBlockers.push('codex_lb_deep_evidence_trust_anchor_duplicate');
|
|
245
|
+
if (anchorId)
|
|
246
|
+
seen.add(anchorId);
|
|
247
|
+
if (candidateBlockers.length) {
|
|
248
|
+
blockers.push(...candidateBlockers.map((blocker) => `${blocker}:${index}`));
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
anchors.push(candidate);
|
|
252
|
+
}
|
|
253
|
+
return {
|
|
254
|
+
schema: CODEX_LB_DEEP_EVIDENCE_TRUST_ANCHOR_SET_SCHEMA,
|
|
255
|
+
ok: blockers.length === 0 && anchors.length === value.anchors.length,
|
|
256
|
+
anchors: blockers.length === 0 ? anchors : [],
|
|
257
|
+
blockers: unique(blockers)
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function validateAnchor(anchor, producer, target, contentSha256, blockers) {
|
|
261
|
+
if (!isRecord(anchor) || !hasExactKeys(anchor, ['schema', 'anchor_id', 'producer', 'target', 'content_sha256'])) {
|
|
262
|
+
blockers.push('codex_lb_deep_evidence_trust_anchor_invalid');
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
if (anchor.schema !== CODEX_LB_DEEP_EVIDENCE_TRUST_ANCHOR_SCHEMA)
|
|
266
|
+
blockers.push('codex_lb_deep_evidence_trust_anchor_invalid');
|
|
267
|
+
if (typeof anchor.anchor_id !== 'string' || !ID_PATTERN.test(anchor.anchor_id))
|
|
268
|
+
blockers.push('codex_lb_deep_evidence_trust_anchor_invalid');
|
|
269
|
+
const anchorProducer = parseProducer(anchor.producer, blockers, 'anchor');
|
|
270
|
+
const anchorTarget = parseTarget(anchor.target, blockers, 'anchor');
|
|
271
|
+
if (!SHA256_PATTERN.test(anchor.content_sha256))
|
|
272
|
+
blockers.push('codex_lb_deep_evidence_trust_anchor_hash_invalid');
|
|
273
|
+
if (contentSha256 && anchor.content_sha256 !== contentSha256)
|
|
274
|
+
blockers.push('codex_lb_deep_evidence_trust_anchor_hash_mismatch');
|
|
275
|
+
if (producer && anchorProducer && canonicalJson(producer) !== canonicalJson(anchorProducer))
|
|
276
|
+
blockers.push('codex_lb_deep_evidence_trust_anchor_producer_mismatch');
|
|
277
|
+
if (target && anchorTarget && (target.mode !== anchorTarget.mode
|
|
278
|
+
|| normalizeEndpoint(target.endpoint) !== normalizeEndpoint(anchorTarget.endpoint)))
|
|
279
|
+
blockers.push('codex_lb_deep_evidence_trust_anchor_target_mismatch');
|
|
280
|
+
}
|
|
281
|
+
function parseProducer(value, blockers, scope) {
|
|
282
|
+
if (!isRecord(value) || !hasExactKeys(value, ['id', 'version', 'run_id'])) {
|
|
283
|
+
blockers.push(`codex_lb_deep_evidence_${scope}_producer_invalid`);
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
for (const key of ['id', 'version', 'run_id']) {
|
|
287
|
+
if (typeof value[key] !== 'string' || !ID_PATTERN.test(value[key])) {
|
|
288
|
+
blockers.push(`codex_lb_deep_evidence_${scope}_producer_invalid`);
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return value;
|
|
293
|
+
}
|
|
294
|
+
function parseTarget(value, blockers, scope) {
|
|
295
|
+
if (!isRecord(value) || !hasExactKeys(value, ['mode', 'endpoint'])) {
|
|
296
|
+
blockers.push(`codex_lb_deep_evidence_${scope}_target_invalid`);
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
if (!['desktop-native-bridge', 'desktop-dual-auth-compat', 'cli-provider', 'disabled'].includes(String(value.mode))) {
|
|
300
|
+
blockers.push(`codex_lb_deep_evidence_${scope}_target_invalid`);
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
if (typeof value.endpoint !== 'string' || !normalizeEndpoint(value.endpoint)) {
|
|
304
|
+
blockers.push(`codex_lb_deep_evidence_${scope}_target_invalid`);
|
|
305
|
+
return null;
|
|
306
|
+
}
|
|
307
|
+
return value;
|
|
308
|
+
}
|
|
309
|
+
function parseIntegrity(value, blockers) {
|
|
310
|
+
if (!isRecord(value) || !hasExactKeys(value, ['algorithm', 'content_sha256', 'trust_anchor_id'])) {
|
|
311
|
+
blockers.push('codex_lb_deep_evidence_integrity_invalid');
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
if (value.algorithm !== 'sha256'
|
|
315
|
+
|| typeof value.content_sha256 !== 'string'
|
|
316
|
+
|| !SHA256_PATTERN.test(value.content_sha256)
|
|
317
|
+
|| typeof value.trust_anchor_id !== 'string'
|
|
318
|
+
|| !ID_PATTERN.test(value.trust_anchor_id)) {
|
|
319
|
+
blockers.push('codex_lb_deep_evidence_integrity_invalid');
|
|
320
|
+
return null;
|
|
321
|
+
}
|
|
322
|
+
return value;
|
|
323
|
+
}
|
|
324
|
+
function parsePayload(value, blockers) {
|
|
325
|
+
if (!isRecord(value)) {
|
|
326
|
+
blockers.push('codex_lb_deep_evidence_payload_invalid');
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
const unknown = Object.keys(value).filter((key) => !PAYLOAD_KEYS.has(key));
|
|
330
|
+
if (unknown.length)
|
|
331
|
+
blockers.push('codex_lb_deep_evidence_payload_unknown_fields');
|
|
332
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
333
|
+
if (BOOLEAN_PAYLOAD_KEYS.has(key) && typeof entry !== 'boolean')
|
|
334
|
+
blockers.push(`codex_lb_deep_evidence_payload_type_invalid:${key}`);
|
|
335
|
+
if (NULLABLE_STRING_PAYLOAD_KEYS.has(key) && entry !== null && typeof entry !== 'string')
|
|
336
|
+
blockers.push(`codex_lb_deep_evidence_payload_type_invalid:${key}`);
|
|
337
|
+
if (ARRAY_PAYLOAD_KEYS.has(key) && !Array.isArray(entry))
|
|
338
|
+
blockers.push(`codex_lb_deep_evidence_payload_type_invalid:${key}`);
|
|
339
|
+
if (key === 'image_route' && entry !== null && !['responses_tool', 'images_api'].includes(String(entry))) {
|
|
340
|
+
blockers.push('codex_lb_deep_evidence_payload_type_invalid:image_route');
|
|
341
|
+
}
|
|
342
|
+
if (key === 'auxiliary_routes_observed' && Array.isArray(entry) && entry.some((item) => typeof item !== 'string')) {
|
|
343
|
+
blockers.push('codex_lb_deep_evidence_payload_type_invalid:auxiliary_routes_observed');
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
return blockers.some((blocker) => blocker.startsWith('codex_lb_deep_evidence_payload_')) ? null : value;
|
|
347
|
+
}
|
|
348
|
+
function normalizeEndpoint(value) {
|
|
349
|
+
try {
|
|
350
|
+
const url = new URL(value);
|
|
351
|
+
if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password || url.search || url.hash)
|
|
352
|
+
return null;
|
|
353
|
+
const pathname = url.pathname.replace(/\/+$/, '') || '/';
|
|
354
|
+
return `${url.protocol}//${url.host}${pathname}`;
|
|
355
|
+
}
|
|
356
|
+
catch {
|
|
357
|
+
return null;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function canonicalJson(value) {
|
|
361
|
+
if (Array.isArray(value))
|
|
362
|
+
return `[${value.map(canonicalJson).join(',')}]`;
|
|
363
|
+
if (isRecord(value)) {
|
|
364
|
+
return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson(value[key])}`).join(',')}}`;
|
|
365
|
+
}
|
|
366
|
+
return JSON.stringify(value) ?? 'null';
|
|
367
|
+
}
|
|
368
|
+
function normalizeNow(value) {
|
|
369
|
+
if (value instanceof Date)
|
|
370
|
+
return value.getTime();
|
|
371
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
372
|
+
return value;
|
|
373
|
+
if (typeof value === 'string') {
|
|
374
|
+
const parsed = Date.parse(value);
|
|
375
|
+
if (Number.isFinite(parsed))
|
|
376
|
+
return parsed;
|
|
377
|
+
}
|
|
378
|
+
return Date.now();
|
|
379
|
+
}
|
|
380
|
+
function positiveFinite(value, fallback) {
|
|
381
|
+
return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : fallback;
|
|
382
|
+
}
|
|
383
|
+
function hasExactKeys(value, expected) {
|
|
384
|
+
const actual = Object.keys(value).sort();
|
|
385
|
+
return actual.length === expected.length && actual.every((key, index) => key === [...expected].sort()[index]);
|
|
386
|
+
}
|
|
387
|
+
function isRecord(value) {
|
|
388
|
+
return Boolean(value && typeof value === 'object' && !Array.isArray(value));
|
|
389
|
+
}
|
|
390
|
+
function validation(state, blockers) {
|
|
391
|
+
return {
|
|
392
|
+
schema: CODEX_LB_DEEP_EVIDENCE_VALIDATION_SCHEMA,
|
|
393
|
+
state,
|
|
394
|
+
trusted: false,
|
|
395
|
+
evidence: null,
|
|
396
|
+
producer_id: null,
|
|
397
|
+
created_at: null,
|
|
398
|
+
content_sha256: null,
|
|
399
|
+
trust_anchor_id: null,
|
|
400
|
+
blockers,
|
|
401
|
+
warnings: []
|
|
402
|
+
};
|
|
403
|
+
}
|
|
@@ -23,9 +23,9 @@ const CORE_SKILL_DEFINITIONS = [
|
|
|
23
23
|
route: '$Naruto',
|
|
24
24
|
purpose: 'run a Codex official subagent workflow with official agent threads while parent integration remains owner.',
|
|
25
25
|
when: 'Use when the user explicitly invokes $Naruto or the selected route requires bounded parallel delegation.',
|
|
26
|
-
workflow: 'Run sks naruto run "<task>" [--agents N] [--max-threads N] [--json] with Codex official subagent threads only. The parent owns decomposition, per-wave capacity, later root-owned waves, integration, and final verification. Automatic targets begin at 4/6/8 by task size and may expand to 12 when independent useful slices and healthy host capacity remain positive; max_threads is a cap, never a target, and max_depth=1 blocks nested delegation. Route each slice to the narrowest matching Codex role and wait for every planned thread before final.',
|
|
26
|
+
workflow: 'Run sks naruto run "<task>" [--agents N] [--max-threads N] [--json] with Codex official subagent threads only. The parent owns decomposition, per-wave capacity, later root-owned waves, integration, and final verification. Automatic targets begin at 4/6/8 by task size and may expand to 12 when independent useful slices and healthy host capacity remain positive; max_threads is a cap, never a target, and max_depth=1 blocks nested delegation. Route each slice to the narrowest matching Codex role and wait for every planned thread before final. In an active Codex App Naruto mission, commit the strict parent evidence with sks naruto parent-summary --mission <id> --stdin, then return localized Markdown without exposing the JSON.',
|
|
27
27
|
safety: 'Preserve user-authored content, inherit the parent permission mode, do not spawn nested subagents, do not inject the full pack or the full TriWiki context into every child, and do not fall back to another model, process runtime, custom scheduler, or worker pool. The historical Naruto process runtime is removed; stop with explicit blocker evidence when the official path is unavailable.',
|
|
28
|
-
cli: 'sks naruto run "<task>" [--agents N] [--max-threads N] [--json]; sks naruto status|subagents|proof [--mission <id>] [--json]',
|
|
28
|
+
cli: 'sks naruto run "<task>" [--agents N] [--max-threads N] [--json]; sks naruto status|subagents|proof [--mission <id>] [--json]; sks naruto parent-summary --mission <id> --stdin [--json]',
|
|
29
29
|
evidence: 'subagent-plan.json, subagent-events.jsonl, subagent-parent-summary.json, subagent-evidence.json, naruto-summary.json, and naruto-gate.json.',
|
|
30
30
|
fallback: 'Return explicit official-subagent availability blockers and continue parent-owned only when the sealed task still has meaningful in-scope work; never fabricate process, PID, or subagent evidence.'
|
|
31
31
|
},
|
|
@@ -67,10 +67,13 @@ const CORE_SKILL_DEFINITIONS = [
|
|
|
67
67
|
canonical_name: 'image-ux-review',
|
|
68
68
|
display_name: 'image-ux-review',
|
|
69
69
|
route: '$Image-UX-Review',
|
|
70
|
-
purpose: '
|
|
71
|
-
when: 'Use for
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
purpose: 'run one screenshot-to-generated-annotation-to-UX-report pipeline without duplicate picker skills.',
|
|
71
|
+
when: 'Use for $Image-UX-Review, $UX-Review, $Visual-Review, or $UI-UX-Review requests; all aliases resolve to this one canonical skill.',
|
|
72
|
+
workflow: 'Capture or attach the real source screenshot first; web/browser/webapp capture must pass the Codex Chrome Extension readiness gate first, while Computer Use is reserved for native Mac/non-web surfaces. Send the source image as the I2I reference to the selected Codex imagegen provider with gpt-image-2 and a senior Toss UI/UX designer prompt that visibly adds numbered P0/P1/P2/P3 callouts, hierarchy, contrast, alignment, density, affordance, eye-flow arrows, and a corrected mini-comp. Then analyze the generated annotated image pixels with vision/OCR, not the source screenshot, and write the issue ledger, extraction report, and UX/UI change report with the generated image path and sha256.',
|
|
73
|
+
safety: 'Do not substitute text-only critique, a source-screenshot-only report, placeholders, partial image frames, mock evidence, or an unrelated API provider for the selected real imagegen path. Apply fixes only when requested and recheck changed screens.',
|
|
74
|
+
cli: 'sks ux-review run --image <path> [--fix] --json; legacy $sks-ux-review, $sks-visual-review, and $sks-ui-ux-review inputs route here internally.',
|
|
75
|
+
evidence: 'image-ux-screen-inventory.json, image-ux-gpt-image-2-request.json, image-ux-gpt-image-2-response.json, image-ux-generated-review-ledger.json, image-ux-issue-ledger.json, image-ux-callout-extraction-report.json, image-ux-iteration-report.json, and image-ux-review-gate.json.',
|
|
76
|
+
fallback: 'Block full verification if the real source screenshot, completed generated annotated image, generated-image callout extraction, or generated-image-based UX/UI report is unavailable.'
|
|
74
77
|
},
|
|
75
78
|
{
|
|
76
79
|
id: 'sks-core-computer-use',
|
|
@@ -117,6 +120,19 @@ const CORE_SKILL_DEFINITIONS = [
|
|
|
117
120
|
cli: 'sks seo-geo-optimizer doctor|audit|plan|apply|verify|status|rollback|fixture --mode seo|geo',
|
|
118
121
|
evidence: 'SEO intent map, canonical URL map, metadata summary, JSON-LD summary, sitemap coverage summary, internal link plan, unsupported claims ledger, Search Console/analytics follow-up plan, site inventory, route graph, seo-findings.json or geo-findings.json, claim-evidence-ledger.json, ai-crawler-policy.json, llms-txt-plan.json, verification report, route gate, and Completion Proof.',
|
|
119
122
|
fallback: 'Do not auto-allow training crawlers or fabricate AI answer visibility; mark missing live outcomes unverified and keep recovery on the unified optimizer route.'
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 'sks-core-align',
|
|
126
|
+
canonical_name: 'align',
|
|
127
|
+
display_name: 'align',
|
|
128
|
+
route: '$Align',
|
|
129
|
+
purpose: 'run a one-shot modernization that aligns SKS prompts, settings, and skill/command surfaces to the latest GPT-5.6 official grammar and guides.',
|
|
130
|
+
when: 'Use when the user invokes $Align or asks to modernize SKS prompts, settings, skills, or command surfaces against current OpenAI latest-model, programmatic tool calling, agents, and openai/skills guidance.',
|
|
131
|
+
workflow: 'Run sks align prepare|run to create the skill-first mission, then execute the sealed workstreams: (1) align prompts/settings/skills to latest GPT-5.6 official prompting grammar from https://developers.openai.com/api/docs/guides/latest-model, (2) apply programmatic tool calling guidance from https://developers.openai.com/api/docs/guides/tools-programmatic-tool-calling, (3) apply agents guidance from https://developers.openai.com/api/docs/guides/agents, (4) deeply analyze https://github.com/openai/skills and current Plugins guidance and improve every SKS command/skill accordingly, (5) keep latest-version only with no legacy version compatibility and delete unnecessary old settings, (6) deduplicate redundant prompt/config content. Prefer Naruto for independent modernization slices. Update align-ledger.json continuously and pass align-gate.json before final.',
|
|
132
|
+
safety: 'Protect immutable core skills (mutable_by_doctor/update/setup=false). Do not invent fallbacks when official docs are unavailable. Do not keep legacy model-prompt compatibility knobs. Do not rewrite this align skill body via doctor/update/setup.',
|
|
133
|
+
cli: 'sks align prepare|run|status|proof ["scope"] [--json]',
|
|
134
|
+
evidence: 'align-plan.json, align-ledger.json, align-gate.json, completion-proof.json, changed-path inventory, deleted-legacy-settings list, deduplicated-surfaces list, and Honest Mode.',
|
|
135
|
+
fallback: 'If official GPT-5.6 / openai/skills guidance cannot be fetched, record blockers in align-ledger.json and keep align-gate.json unpassed; never fabricate modernization evidence.'
|
|
120
136
|
}
|
|
121
137
|
];
|
|
122
138
|
const LEGACY_CORE_DOLLAR_NAMES = Array.from(new Set(CORE_SKILL_DEFINITIONS.flatMap((skill) => [
|
|
@@ -247,7 +247,8 @@ export async function safeWriteCodexConfigToml(configPath, current, next, tag =
|
|
|
247
247
|
}
|
|
248
248
|
export function codexFastModeDesktopStatus(text = '') {
|
|
249
249
|
const validation = validateCodexConfigRoundTrip(String(text || ''));
|
|
250
|
-
const
|
|
250
|
+
const normalizedServiceTier = String(validation.service_tier || '').toLowerCase();
|
|
251
|
+
const globalOn = validation.ok && (normalizedServiceTier === 'fast' || normalizedServiceTier === 'priority');
|
|
251
252
|
return {
|
|
252
253
|
schema: 'sks.codex-fast-mode-desktop-status.v2',
|
|
253
254
|
ok: validation.ok,
|