sneakoscope 8.0.2 → 8.0.4
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 +150 -37
- package/config/skills-hash-ledger.v1.json +1 -1
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/dist/bin/fast-inline.js +55 -27
- package/dist/bin/install.js +6 -32
- package/dist/bin/sks-dispatch.js +1 -1
- package/dist/cli/args.js +0 -2
- package/dist/cli/cli-theme.js +18 -9
- package/dist/cli/command-manifest-lite.js +6 -6
- package/dist/cli/command-registry.js +6 -6
- package/dist/cli/feature-commands.js +9 -7
- package/dist/cli/install-helpers-codex-lb-chain.js +198 -7
- package/dist/cli/install-helpers-codex-lb-config.js +78 -10
- package/dist/cli/install-helpers-install-support.js +9 -6
- package/dist/cli/install-helpers.js +101 -49
- package/dist/cli/install-tool-helpers.js +2 -82
- package/dist/cli/output.js +6 -1
- package/dist/cli/router.js +101 -2
- package/dist/commands/codex-lb.js +119 -19
- package/dist/commands/doctor-profile.js +1 -1
- package/dist/commands/doctor.js +727 -144
- package/dist/commands/mad-sks.js +1 -5
- package/dist/config/skills-manifest.json +4 -2
- package/dist/core/agents/agent-codex-cockpit.js +0 -3
- package/dist/core/agents/agent-effort-policy.js +5 -5
- package/dist/core/agents/agent-janitor.js +0 -20
- package/dist/core/agents/agent-orchestrator.js +9 -56
- package/dist/core/agents/agent-output-validator.js +2 -3
- package/dist/core/agents/agent-patch-schema.js +2 -2
- package/dist/core/agents/agent-proof-evidence.js +0 -65
- package/dist/core/agents/agent-recursion-guard.js +1 -1
- package/dist/core/agents/agent-runner-codex-exec.js +5 -3
- package/dist/core/agents/agent-scheduler.js +327 -85
- package/dist/core/agents/agent-schema.js +1 -1
- package/dist/core/agents/agent-trust-report.js +0 -36
- package/dist/core/agents/agent-worker-pipeline.js +0 -1
- package/dist/core/agents/fast-mode-policy.js +1 -3
- package/dist/core/agents/native-cli-worker-runtime-proof.js +1 -1
- package/dist/core/agents/native-cli-worker-runtime.js +69 -647
- package/dist/core/agents/native-cli-worker.js +6 -7
- package/dist/core/agents/native-worker-backend-router.js +2 -32
- package/dist/core/agents/no-subagent-scaling-policy.js +1 -1
- package/dist/core/agents/parallel-runtime-proof.js +1 -6
- package/dist/core/agents/runtime-proof-summary.js +1 -35
- package/dist/core/architecture-hardening/contracts/contracts.js +193 -0
- package/dist/core/architecture-hardening/migration/migration.js +111 -0
- package/dist/core/architecture-hardening/state/state-service.js +155 -0
- package/dist/core/artifact-schemas.js +0 -3
- package/dist/core/codex/codex-config-guard.js +238 -52
- package/dist/core/codex-adapter.js +5 -3
- package/dist/core/codex-app/auxiliary-oauth-policy.js +36 -0
- package/dist/core/codex-app/catalog-compat/catalog-service.js +104 -0
- package/dist/core/codex-app/child-policy/child-policy.js +35 -0
- package/dist/core/codex-app/codex-app-handoff.js +0 -1
- package/dist/core/codex-app/codex-hook-lifecycle.js +1 -1
- package/dist/core/codex-app/codex-init-deep.js +1 -1
- package/dist/core/codex-app/menubar/app-bundle.js +2 -0
- package/dist/core/codex-app/menubar/constants.js +14 -1
- package/dist/core/codex-app/menubar/global-install.js +288 -0
- package/dist/core/codex-app/menubar/installer.js +79 -14
- package/dist/core/codex-app/menubar/launch-agent.js +267 -45
- package/dist/core/codex-app/menubar/paths.js +3 -0
- package/dist/core/codex-app/menubar/rollback.js +55 -7
- package/dist/core/codex-app/menubar/status.js +75 -4
- package/dist/core/codex-app/provider-child-policy.js +64 -0
- package/dist/core/codex-app/provider-mode.js +91 -0
- package/dist/core/codex-app/provider-operation-stages.js +20 -0
- package/dist/core/codex-app/provider-session-policy.js +85 -0
- package/dist/core/codex-app/session-policy/session-pinning.js +68 -0
- package/dist/core/codex-app.js +3 -2
- package/dist/core/codex-control/codex-0139-image-path-real-probe.js +3 -1
- package/dist/core/codex-control/codex-0139-web-search-probe.js +3 -1
- package/dist/core/codex-control/codex-app-server-runtime-env.js +13 -4
- package/dist/core/codex-control/codex-app-server-v2-client.js +3 -3
- package/dist/core/codex-control/codex-control-proof.js +0 -1
- package/dist/core/codex-control/codex-task-runner.js +1 -4
- package/dist/core/codex-exec-output-schema.js +4 -1
- package/dist/core/codex-lb/codex-lb-env.js +63 -72
- package/dist/core/codex-lb/codex-lb-setup.js +15 -2
- package/dist/core/codex-lb/desktop-bridge/header-policy.js +6 -0
- package/dist/core/codex-lb/desktop-bridge/http-forward.js +48 -6
- package/dist/core/codex-lb/desktop-bridge/security.js +134 -0
- package/dist/core/codex-lb/desktop-bridge/server.js +9 -3
- package/dist/core/codex-lb/desktop-bridge/state.js +26 -6
- package/dist/core/codex-lb/desktop-bridge/types.js +1 -0
- package/dist/core/codex-lb/desktop-center-credentials.js +517 -58
- package/dist/core/codex-lb/desktop-controller.js +177 -56
- package/dist/core/codex-lb/desktop-service.js +179 -40
- package/dist/core/codex-lb/legacy-migration.js +1 -3
- package/dist/core/codex-lb/native-openai-transport/transport.js +68 -0
- package/dist/core/codex-lb/probes/cli-image-tool-probe.js +1 -1
- package/dist/core/codex-lb/provider-routing/provider-router.js +58 -0
- package/dist/core/codex-lb/routing-truth.js +327 -0
- package/dist/core/codex-native/codex-native-feature-broker.js +4 -0
- package/dist/core/codex-native/codex-native-pattern-analysis.js +1 -2
- package/dist/core/codex-native/core-skill-manifest.js +1 -1
- package/dist/core/codex-plugins/codex-plugin-json.js +26 -6
- package/dist/core/codex-plugins/codex-plugin-repair.js +32 -6
- package/dist/core/commands/basic-cli.js +9 -7
- package/dist/core/commands/computer-use-command.js +1 -1
- package/dist/core/commands/image-ux-review-command.js +16 -9
- package/dist/core/commands/install-package-command.js +105 -0
- package/dist/core/commands/intent-normalization/normalizer.js +96 -0
- package/dist/core/commands/mad-sks-command.js +23 -274
- package/dist/core/commands/mad-sks-headless.js +11 -30
- package/dist/core/commands/naruto-command.js +0 -25
- package/dist/core/commands/qa-loop-command.js +104 -22
- package/dist/core/commands/remote-command.js +2 -2
- package/dist/core/commands/research-command.js +10 -5
- package/dist/core/commands/telegram-command.js +407 -0
- package/dist/core/config-adopt/config-adopt-command.js +35 -0
- package/dist/core/config-adopt/config-adopt.js +346 -0
- package/dist/core/config-adopt/index.js +3 -0
- package/dist/core/doctor/command-alias-cleanup.js +4 -1
- package/dist/core/doctor/current-project-guidance-nested.js +37 -6
- package/dist/core/doctor/current-project-guidance.js +15 -9
- package/dist/core/doctor/doctor-dirty-planner.js +1 -4
- package/dist/core/doctor/doctor-readiness-matrix.js +15 -18
- package/dist/core/doctor/retired-managed-residue-private.js +4 -3
- package/dist/core/doctor/retired-managed-residue-runtime.js +2 -2
- package/dist/core/doctor/skill-legacy-surface.js +11 -10
- package/dist/core/doctor/sks-menubar-doctor.js +4 -0
- package/dist/core/evaluation.js +0 -19
- package/dist/core/evidence/v2/evidence-key.js +105 -0
- package/dist/core/feature-fixtures.js +12 -7
- package/dist/core/feature-registry.js +52 -21
- package/dist/core/hooks-runtime/hook-context.js +9 -0
- package/dist/core/hooks-runtime/managed-skill-admission.js +54 -4
- package/dist/core/hooks-runtime/official-subagent-lifecycle.js +69 -52
- package/dist/core/hooks-runtime/stop-finalization.js +226 -0
- package/dist/core/hooks-runtime/stop-repeat-guard.js +21 -2
- package/dist/core/hooks-runtime/subagent-skill-availability-contract.js +2 -2
- package/dist/core/hooks-runtime/subagent-skill-availability-evidence.js +3 -3
- package/dist/core/hooks-runtime/subagent-skill-availability-guards.js +43 -5
- package/dist/core/hooks-runtime/subagent-skill-availability.js +64 -30
- package/dist/core/hooks-runtime/subagent-stop-hook.js +15 -2
- package/dist/core/hooks-runtime.js +179 -212
- package/dist/core/image/reference-evidence/reference-registry.js +145 -0
- package/dist/core/image-ux-review/imagegen-adapter.js +21 -9
- package/dist/core/image-ux-review/reference-policy/reference-policy.js +9 -0
- package/dist/core/imagegen/codex-lb-imagegen-target.js +8 -0
- package/dist/core/imagegen/imagegen-capability.js +59 -2
- package/dist/core/imagegen/require-imagegen.js +2 -2
- package/dist/core/init/skills.js +17 -3
- package/dist/core/init.js +3 -3
- package/dist/core/install/installed-package-smoke.js +23 -5
- package/dist/core/json/canonical.js +9 -0
- package/dist/core/locks/file-lock.js +0 -1
- package/dist/core/loops/loop-continuation-enforcer.js +65 -7
- package/dist/core/loops/loop-decomposer.js +0 -1
- package/dist/core/loops/loop-gate-runner.js +65 -4
- package/dist/core/loops/loop-gate-selector.js +0 -2
- package/dist/core/loops/loop-proof-validation.js +38 -0
- package/dist/core/loops/loop-risk-classifier.js +1 -1
- package/dist/core/loops/loop-runtime.js +14 -2
- package/dist/core/loops/loop-scheduler.js +7 -2
- package/dist/core/loops/loop-worker-runtime.js +0 -15
- package/dist/core/loops/loop-worktree-runtime.js +52 -4
- package/dist/core/managed-assets/managed-assets-manifest.js +14 -14
- package/dist/core/naruto/hardware-capacity-probe.js +9 -6
- package/dist/core/naruto/naruto-active-pool.js +2 -14
- package/dist/core/naruto/naruto-concurrency-governor.js +71 -31
- package/dist/core/naruto/naruto-loop-worker-router.js +0 -2
- package/dist/core/naruto/naruto-verification-dag.js +0 -1
- package/dist/core/naruto/naruto-write-e2e.js +1 -2
- package/dist/core/naruto/resource-pressure-monitor.js +0 -4
- package/dist/core/observability/architecture-hardening/safe-projection.js +65 -0
- package/dist/core/perf/import-graph-budget.js +0 -1
- package/dist/core/perf/release-latency-slo.js +3 -2
- package/dist/core/preflight/parallel-preflight-engine.js +2 -15
- package/dist/core/product-design-app-server.js +13 -1
- package/dist/core/proof/fake-real-proof-policy.js +2 -17
- package/dist/core/proof/route-proof-gate.js +2 -10
- package/dist/core/proof/route-proof-policy.js +1 -1
- package/dist/core/proof/runtime-evidence-policy.js +185 -0
- package/dist/core/proof/runtime-truth-matrix.js +64 -39
- package/dist/core/proof/validation.js +27 -11
- package/dist/core/provider/provider-context.js +18 -2
- package/dist/core/providers/openrouter/openrouter-account.js +3 -2
- package/dist/core/python-tools/python-tool-runner.js +1 -1
- package/dist/core/qa-loop/qa-execution-control.js +57 -0
- package/dist/core/questions.js +1 -1
- package/dist/core/release/extreme-parallel-scheduler.js +0 -3
- package/dist/core/release/gate-manifest.js +3 -7
- package/dist/core/release/gate-pack-manifest.js +3 -7
- package/dist/core/release/package-size-budget.js +2 -2
- package/dist/core/release/physical-release-gates.js +189 -0
- package/dist/core/release/publish-preflight.js +113 -0
- package/dist/core/release/release-gate-affected-selector.js +0 -2
- package/dist/core/release/release-gate-batch-runner.js +1 -1
- package/dist/core/release/release-gate-node.js +0 -1
- package/dist/core/release/release-gate-resource-governor.js +0 -1
- package/dist/core/release/release-pack-receipt.js +5 -8
- package/dist/core/release/release-real-contract.js +0 -6
- package/dist/core/release/resource-class-budget.js +0 -1
- package/dist/core/release/stage-publish.js +178 -36
- package/dist/core/research/research-adversarial-review.js +103 -9
- package/dist/core/research.js +1 -1
- package/dist/core/retention.js +0 -1
- package/dist/core/routes/constants.js +1 -1
- package/dist/core/routes/diagnostic-allowlist.js +0 -1
- package/dist/core/routes/dollar-manifest-lite.js +1 -1
- package/dist/core/routes.js +46 -15
- package/dist/core/runtime/execution-control.js +226 -0
- package/dist/core/runtime/progress-recovery/progress-recovery.js +89 -0
- package/dist/core/runtime/task-profile.js +10 -4
- package/dist/core/runtime/verification-budget.js +10 -1
- package/dist/core/safety/intent-contract/intent-contract.js +94 -0
- package/dist/core/safety/mutation-guard.js +0 -2
- package/dist/core/safety/mutation-ledger.js +0 -2
- package/dist/core/safety/requested-scope-contract.js +0 -0
- package/dist/core/search-visibility/discovery.js +1 -1
- package/dist/core/search-visibility/index.js +12 -0
- package/dist/core/search-visibility/verifier.js +112 -3
- package/dist/core/security/private-credential-file.js +209 -0
- package/dist/core/session/project-namespace.js +0 -5
- package/dist/core/skills/skill-agent-metadata.js +1 -3
- package/dist/core/strategy/adhd-orchestrating-gate.js +0 -1
- package/dist/core/subagents/agent-catalog.js +19 -34
- package/dist/core/subagents/model-policy.js +65 -24
- package/dist/core/subagents/naruto-help-contract.js +8 -8
- package/dist/core/subagents/naruto-host-credentials.js +13 -0
- package/dist/core/subagents/official-subagent-config.js +16 -6
- package/dist/core/subagents/official-subagent-preparation.js +35 -16
- package/dist/core/subagents/official-subagent-prompt.js +7 -7
- package/dist/core/subagents/official-subagent-runner.js +27 -4
- package/dist/core/subagents/role-model-preferences.js +1 -1
- package/dist/core/subagents/thread-budget.js +19 -12
- package/dist/core/subagents/wave-lifecycle.js +18 -6
- package/dist/core/telegram/access.js +58 -0
- package/dist/core/telegram/client.js +157 -0
- package/dist/core/telegram/confirmation.js +37 -0
- package/dist/core/telegram/doctor.js +154 -0
- package/dist/core/telegram/index.js +9 -0
- package/dist/core/telegram/keychain.js +317 -0
- package/dist/core/telegram/liveness.js +118 -0
- package/dist/core/telegram/poller.js +90 -0
- package/dist/core/telegram/redaction.js +15 -0
- package/dist/core/telegram/state-lock.js +416 -0
- package/dist/core/telegram/types.js +1 -0
- package/dist/core/text/strings.js +3 -0
- package/dist/core/triwiki/context-graph/store/evidence-write-lock.js +29 -0
- package/dist/core/triwiki/context-graph/store/fragment-cache.js +24 -0
- package/dist/core/triwiki/context-graph/store/snapshot-store.js +69 -21
- package/dist/core/triwiki/triwiki-gate-impact-map.js +2 -2
- package/dist/core/triwiki/triwiki-module-card.js +1 -2
- package/dist/core/update/installed-cli-resolution.js +170 -0
- package/dist/core/update/update-diagnostics.js +52 -0
- package/dist/core/update/update-migration-state.js +30 -12
- package/dist/core/update/update-operation.js +2 -1
- package/dist/core/update/update-stage-diagnostics.js +38 -0
- package/dist/core/update/update-status.js +2 -9
- package/dist/core/update-check.js +279 -91
- package/dist/core/version.js +1 -1
- package/dist/native/sks-menubar/Sources/AppDelegate.swift +19 -1
- package/dist/native/sks-menubar/Sources/AppIdentity.swift +7 -0
- package/dist/native/sks-menubar/Sources/ControlCenterWindowController.swift +6 -2
- package/dist/native/sks-menubar/Sources/OperationCoordinator.swift +159 -92
- package/dist/native/sks-menubar/Sources/OperationModels.swift +389 -0
- package/dist/native/sks-menubar/Sources/OverviewViewController.swift +57 -0
- package/dist/native/sks-menubar/Sources/ProcessClient.swift +3 -1
- package/dist/native/sks-menubar/Sources/ProvidersConnectTest.swift +115 -0
- package/dist/native/sks-menubar/Sources/ProvidersFastMode.swift +17 -0
- package/dist/native/sks-menubar/Sources/ProvidersMultiProvider.swift +3 -0
- package/dist/native/sks-menubar/Sources/ProvidersOpenRouter.swift +58 -17
- package/dist/native/sks-menubar/Sources/ProvidersReliability.swift +302 -0
- package/dist/native/sks-menubar/Sources/ProvidersRoleModels.swift +5 -0
- package/dist/native/sks-menubar/Sources/ProvidersRoutingTruth.swift +190 -0
- package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +158 -126
- package/dist/native/sks-menubar/Sources/RemoteCodingViewController.swift +462 -26
- package/dist/native/sks-menubar/Sources/SKSKeychainStore.swift +344 -0
- package/dist/native/sks-menubar/Sources/SecureProcessEnvelope.swift +27 -0
- package/dist/native/sks-menubar/Sources/SingletonInstanceGuard.swift +328 -0
- package/dist/native/sks-menubar/Sources/StatusItemController.swift +10 -2
- package/dist/native/sks-menubar/Sources/TelegramPrivateFileStore.swift +498 -0
- package/dist/native/sks-menubar/Sources/TelegramPrivateFileSupport.swift +236 -0
- package/dist/native/sks-menubar/Sources/TelegramProcessGateway.swift +454 -0
- package/dist/native/sks-menubar/Sources/TelegramRuntimeSupport.swift +56 -0
- package/dist/native/sks-menubar/Sources/TelegramStateLock.swift +448 -0
- package/dist/native/sks-menubar/Sources/TelegramSupport.swift +187 -0
- package/dist/native/sks-menubar/Sources/TelegramTransport.swift +499 -0
- package/dist/native/sks-menubar/Sources/main.swift +15 -1
- package/dist/scripts/all-feature-deep-completion-check.js +5 -1
- package/dist/scripts/check-publish-tag.js +56 -0
- package/dist/scripts/codex-lb-fast-mode-truth-check.js +10 -3
- package/dist/scripts/codex-lb-fast-ui-preservation-check.js +12 -3
- package/dist/scripts/codex-lb-gpt56-fast-profile-check.js +4 -2
- package/dist/scripts/codex-native-agent-role-content-check.js +3 -3
- package/dist/scripts/codex-native-gate-lib.js +14 -7
- package/dist/scripts/current-command-surface-check.js +7 -7
- package/dist/scripts/current-surface-update-e2e-check.js +4 -3
- package/dist/scripts/current-upgrade-matrix-check.js +5 -24
- package/dist/scripts/docs-truthfulness-check.js +17 -13
- package/dist/scripts/gate-lib.js +0 -2
- package/dist/scripts/gate-policy-audit-check.js +3 -2
- package/dist/scripts/harness-benchmark-check.js +1 -1
- package/dist/scripts/init-deep-backup-retention-check.js +1 -1
- package/dist/scripts/lib/codex-sdk-gate-lib.js +1 -2
- package/dist/scripts/loop-directive-check-lib.js +28 -38
- package/dist/scripts/mad-sks-app-ui-no-mutation-check.js +14 -180
- package/dist/scripts/mad-sks-launch-sql-plane-boundary-check.js +2 -11
- package/dist/scripts/official-subagent-workflow-check.js +1 -1
- package/dist/scripts/packlist-performance-check.js +1 -2
- package/dist/scripts/prepublish-release-check-or-fast.js +32 -0
- package/dist/scripts/publish-preflight.js +12 -0
- package/dist/scripts/release-affected-selector-check.js +2 -2
- package/dist/scripts/release-gate-batch-runner-check.js +2 -2
- package/dist/scripts/release-metadata-check.js +8 -12
- package/dist/scripts/release-real-check.js +2 -54
- package/dist/scripts/runtime-domain-gate-lib.js +2 -96
- package/dist/scripts/runtime-proof-summary-check.js +2 -6
- package/dist/scripts/search-visibility-gate-lib.js +0 -1
- package/dist/scripts/sks-cli-gate-lib.js +1 -1
- package/dist/scripts/typed-routing-gate-lib.js +7 -59
- package/docs/demo.tape +1 -1
- package/infra-harness-gates.json +1 -1456
- package/package.json +10 -7
- package/release-gates.v2.json +0 -1
- package/schemas/agents/parallel-runtime-proof.schema.json +0 -2
- package/schemas/codex/agent-result.schema.json +0 -6
- package/schemas/naruto/naruto-concurrency-governor.schema.json +1 -3
- package/schemas/release/release-gate-node.schema.json +1 -1
- package/dist/commands/zellij-lane.js +0 -22
- package/dist/commands/zellij-monitor-pane.js +0 -26
- package/dist/commands/zellij-slot-column-anchor.js +0 -22
- package/dist/commands/zellij-slot-pane.js +0 -80
- package/dist/commands/zellij-viewport-pane.js +0 -57
- package/dist/commands/zellij.js +0 -422
- package/dist/core/agents/agent-runner-zellij.js +0 -164
- package/dist/core/agents/agent-slot-pane-binding-proof.js +0 -96
- package/dist/core/agents/parallel-write-fixture.js +0 -305
- package/dist/core/agents/worker-pane-communication-contract.js +0 -100
- package/dist/core/agents/zellij-lane-supervisor.js +0 -428
- package/dist/core/agents/zellij-right-lane-cockpit.js +0 -66
- package/dist/core/doctor/doctor-zellij-repair.js +0 -40
- package/dist/core/ops/upgrade-migration-fixtures.js +0 -119
- package/dist/core/proof/route-finalizer-fixtures.js +0 -21
- package/dist/core/zellij/homebrew-policy.js +0 -43
- package/dist/core/zellij/zellij-capability.js +0 -126
- package/dist/core/zellij/zellij-clipboard-config.js +0 -52
- package/dist/core/zellij/zellij-command.js +0 -149
- package/dist/core/zellij/zellij-fake-adapter.js +0 -186
- package/dist/core/zellij/zellij-lane-renderer.js +0 -706
- package/dist/core/zellij/zellij-lane-runtime.js +0 -189
- package/dist/core/zellij/zellij-launcher.js +0 -268
- package/dist/core/zellij/zellij-layout-builder.js +0 -191
- package/dist/core/zellij/zellij-monitor-renderer.js +0 -52
- package/dist/core/zellij/zellij-official-subagent-activity.js +0 -526
- package/dist/core/zellij/zellij-official-subagent-telemetry.js +0 -258
- package/dist/core/zellij/zellij-pane-proof.js +0 -226
- package/dist/core/zellij/zellij-right-column-manager.js +0 -308
- package/dist/core/zellij/zellij-screen-proof.js +0 -120
- package/dist/core/zellij/zellij-self-heal-types.js +0 -44
- package/dist/core/zellij/zellij-self-heal.js +0 -408
- package/dist/core/zellij/zellij-slot-column-anchor.js +0 -304
- package/dist/core/zellij/zellij-slot-pane-renderer.js +0 -521
- package/dist/core/zellij/zellij-slot-telemetry.js +0 -384
- package/dist/core/zellij/zellij-theme.js +0 -66
- package/dist/core/zellij/zellij-ui-mode.js +0 -34
- package/dist/core/zellij/zellij-update.js +0 -348
- package/dist/core/zellij/zellij-viewport-binder.js +0 -61
- package/dist/core/zellij/zellij-worker-pane-manager.js +0 -881
- package/dist/core/zellij/zellij-worker-pane-summary.js +0 -64
- package/dist/native/sks-menubar/Tests/AppRuntimeTestSupport.swift +0 -26
- package/dist/native/sks-menubar/Tests/OperationCoordinatorTests.swift +0 -174
- package/dist/native/sks-menubar/Tests/ProcessClientTests.swift +0 -20
- package/dist/native/sks-menubar/Tests/ProvidersViewControllerTests.swift +0 -142
- package/dist/scripts/zellij-pane-proof-check.js +0 -88
- package/dist/scripts/zellij-real-session-cleanup-check.js +0 -139
- package/dist/scripts/zellij-real-session-launch-check.js +0 -126
- package/dist/scripts/zellij-screen-proof-check.js +0 -43
- package/schemas/zellij/zellij-right-column-state.schema.json +0 -40
- package/schemas/zellij/zellij-slot-telemetry.schema.json +0 -89
- package/schemas/zellij/zellij-worker-pane.schema.json +0 -53
- package/scripts/build-clean-atomic.mjs +0 -323
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { readJson, readText, writeJsonAtomic } from '../fsx.js';
|
|
4
|
-
export async function buildZellijWorkerPaneSummary(root, missionId) {
|
|
5
|
-
const missionDir = path.join(path.resolve(root), '.sneakoscope', 'missions', missionId);
|
|
6
|
-
const ledgerRows = await readJsonl(path.join(path.resolve(root), 'agent-zellij-pane-launch-ledger.jsonl'));
|
|
7
|
-
const missionRows = ledgerRows.filter((row) => !row.mission_id || row.mission_id === missionId);
|
|
8
|
-
const state = await readJson(path.join(missionDir, 'zellij-right-column-state.json'), null);
|
|
9
|
-
const metrics = await readJsonl(path.join(missionDir, 'zellij', 'pane-creation-lock-events.jsonl'));
|
|
10
|
-
const requested = missionRows.filter((row) => row.worker_stacked_requested === true);
|
|
11
|
-
const applied = missionRows.filter((row) => row.worker_stacked_applied === true);
|
|
12
|
-
const fallbackRows = missionRows.filter((row) => row.worker_stacked_requested === true && row.worker_stacked_applied !== true);
|
|
13
|
-
const fallbackModes = {};
|
|
14
|
-
for (const row of fallbackRows) {
|
|
15
|
-
const mode = String(row.worker_stacked_fallback_mode || 'unknown');
|
|
16
|
-
fallbackModes[mode] = (fallbackModes[mode] || 0) + 1;
|
|
17
|
-
}
|
|
18
|
-
const anchors = new Set([
|
|
19
|
-
...missionRows.map((row) => row.slot_column_anchor_pane_id).filter(Boolean).map(String),
|
|
20
|
-
...(state?.slot_column_anchor_pane_id ? [String(state.slot_column_anchor_pane_id)] : [])
|
|
21
|
-
]);
|
|
22
|
-
const stackedCapable = missionRows.some((row) => row.worker_stacked_capability?.supports_stacked_panes === true);
|
|
23
|
-
const waitP95 = percentile(metrics.map((row) => Number(row.wait_ms || 0)), 0.95);
|
|
24
|
-
const heldP95 = percentile(metrics.map((row) => Number(row.held_ms || 0)), 0.95);
|
|
25
|
-
const blockers = [
|
|
26
|
-
...(anchors.size > 1 ? ['zellij_duplicate_slot_anchor_count_gt_1'] : []),
|
|
27
|
-
...(requested.length > 0 && applied.length === 0 && stackedCapable ? ['zellij_stacked_requested_but_none_applied'] : []),
|
|
28
|
-
...(waitP95 > 5000 && requested.length <= 1 ? ['zellij_pane_lock_wait_high_with_low_concurrency'] : [])
|
|
29
|
-
];
|
|
30
|
-
const summary = {
|
|
31
|
-
schema: 'sks.zellij-worker-pane-summary.v1',
|
|
32
|
-
ok: blockers.length === 0,
|
|
33
|
-
mission_id: missionId,
|
|
34
|
-
stacked_requested_count: requested.length,
|
|
35
|
-
stacked_applied_count: applied.length,
|
|
36
|
-
stacked_fallback_count: fallbackRows.length,
|
|
37
|
-
fallback_modes: fallbackModes,
|
|
38
|
-
pane_lock_wait_p95_ms: waitP95,
|
|
39
|
-
pane_lock_held_p95_ms: heldP95,
|
|
40
|
-
duplicate_slot_anchor_count: anchors.size,
|
|
41
|
-
blockers
|
|
42
|
-
};
|
|
43
|
-
await writeJsonAtomic(path.join(missionDir, 'zellij-worker-pane-summary.json'), summary);
|
|
44
|
-
await writeJsonAtomic(path.join(path.resolve(root), '.sneakoscope', 'reports', 'zellij-worker-pane-summary.json'), summary);
|
|
45
|
-
return summary;
|
|
46
|
-
}
|
|
47
|
-
async function readJsonl(file) {
|
|
48
|
-
const text = await readText(file, '').catch(() => '');
|
|
49
|
-
return String(text || '').split(/\n+/).filter(Boolean).flatMap((line) => {
|
|
50
|
-
try {
|
|
51
|
-
return [JSON.parse(line)];
|
|
52
|
-
}
|
|
53
|
-
catch {
|
|
54
|
-
return [];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function percentile(values, p) {
|
|
59
|
-
const sorted = values.filter((value) => Number.isFinite(value)).sort((a, b) => a - b);
|
|
60
|
-
if (!sorted.length)
|
|
61
|
-
return 0;
|
|
62
|
-
const index = Math.min(sorted.length - 1, Math.max(0, Math.ceil(sorted.length * p) - 1));
|
|
63
|
-
return Math.round(sorted[index] || 0);
|
|
64
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#if SKS_NATIVE_TESTING
|
|
2
|
-
import Foundation
|
|
3
|
-
import Darwin
|
|
4
|
-
|
|
5
|
-
private func sksCanonicalFilesystemPath(_ value: String) -> String {
|
|
6
|
-
let standardized = URL(fileURLWithPath: value, isDirectory: true)
|
|
7
|
-
.resolvingSymlinksInPath().standardizedFileURL.path
|
|
8
|
-
return standardized.withCString { pointer in
|
|
9
|
-
guard let resolved = Darwin.realpath(pointer, nil) else { return standardized }
|
|
10
|
-
defer { free(resolved) }
|
|
11
|
-
return String(cString: resolved)
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
enum AppRuntime {
|
|
16
|
-
static let actionScript = "/tmp/sks-menubar-action.sh"
|
|
17
|
-
static let projectRoot = "/tmp/sks-menubar-project"
|
|
18
|
-
static let canonicalProjectRoot = sksCanonicalFilesystemPath(projectRoot)
|
|
19
|
-
static let buildStampPath = "/tmp/sks-menubar-build-stamp.json"
|
|
20
|
-
static let configPath = "/tmp/sks-menubar-config.json"
|
|
21
|
-
static let lastActionLogPath = "/tmp/sks-menubar-last-action.log"
|
|
22
|
-
static let operationDirectory = "/tmp/sks-menubar-operations"
|
|
23
|
-
static let codexBundleId: String? = nil
|
|
24
|
-
static let packageVersion = "test"
|
|
25
|
-
}
|
|
26
|
-
#endif
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
#if canImport(XCTest)
|
|
2
|
-
import Foundation
|
|
3
|
-
import XCTest
|
|
4
|
-
|
|
5
|
-
final class OperationCoordinatorTests: XCTestCase {
|
|
6
|
-
func testCompletedSixteenStageUpdateReceiptIsAcceptedAndReleasesMutationGuard() throws {
|
|
7
|
-
let directory = FileManager.default.temporaryDirectory
|
|
8
|
-
.appendingPathComponent("sks-operation-coordinator-\(UUID().uuidString)", isDirectory: true)
|
|
9
|
-
try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true)
|
|
10
|
-
defer { try? FileManager.default.removeItem(at: directory) }
|
|
11
|
-
|
|
12
|
-
let registry = "https://registry.npmjs.org/"
|
|
13
|
-
let coordinator = OperationCoordinator(directory: directory.path)
|
|
14
|
-
let operation = try XCTUnwrap(
|
|
15
|
-
coordinator.begin(
|
|
16
|
-
kind: "update",
|
|
17
|
-
mutationGroup: "update",
|
|
18
|
-
summary: "Update SKS",
|
|
19
|
-
targetVersion: "8.0.2",
|
|
20
|
-
projectRoot: AppRuntime.canonicalProjectRoot,
|
|
21
|
-
registry: registry
|
|
22
|
-
)
|
|
23
|
-
)
|
|
24
|
-
let receiptURL = directory.appendingPathComponent("update-latest.json")
|
|
25
|
-
let stages = OperationCoordinator.updateStageOrder.enumerated().map { index, id in
|
|
26
|
-
[
|
|
27
|
-
"id": id,
|
|
28
|
-
"ok": true,
|
|
29
|
-
"status": "completed",
|
|
30
|
-
"updated_at": "2026-07-30T00:00:\(String(format: "%02d", index)).000Z"
|
|
31
|
-
] as [String: Any]
|
|
32
|
-
}
|
|
33
|
-
let receipt: [String: Any] = [
|
|
34
|
-
"schema": "sks.update-operation.v1",
|
|
35
|
-
"id": operation.id,
|
|
36
|
-
"kind": "update",
|
|
37
|
-
"state": "succeeded",
|
|
38
|
-
"current_stage": "snapshot_refresh",
|
|
39
|
-
"started_at": "2026-07-30T00:00:00.000Z",
|
|
40
|
-
"updated_at": "2026-07-30T00:00:16.000Z",
|
|
41
|
-
"from_version": "8.0.1",
|
|
42
|
-
"target_version": "8.0.2",
|
|
43
|
-
"previous_version": "8.0.1",
|
|
44
|
-
"project_root": AppRuntime.canonicalProjectRoot,
|
|
45
|
-
"registry": registry,
|
|
46
|
-
"rollback_command": "sks update rollback --version 8.0.1 --project-root \(AppRuntime.canonicalProjectRoot) --json",
|
|
47
|
-
"side_effects_started": true,
|
|
48
|
-
"stages": stages,
|
|
49
|
-
"result_status": "updated",
|
|
50
|
-
"receipt_path": receiptURL.path
|
|
51
|
-
]
|
|
52
|
-
let data = try JSONSerialization.data(withJSONObject: receipt, options: [.sortedKeys])
|
|
53
|
-
try data.write(to: receiptURL, options: .atomic)
|
|
54
|
-
try FileManager.default.setAttributes([.posixPermissions: 0o600], ofItemAtPath: receiptURL.path)
|
|
55
|
-
|
|
56
|
-
XCTAssertEqual(OperationCoordinator.updateStageOrder.count, 16)
|
|
57
|
-
XCTAssertTrue(OperationCoordinator.updateStageOrder.contains("update_finalize_doctor"))
|
|
58
|
-
|
|
59
|
-
let loaded = try XCTUnwrap(coordinator.latestUpdateReceipt())
|
|
60
|
-
XCTAssertEqual(loaded.stages.count, 16)
|
|
61
|
-
XCTAssertEqual(loaded.registry, registry)
|
|
62
|
-
XCTAssertTrue(OperationCoordinator.receiptMatchesLaunchedUpdate(loaded, operation: operation))
|
|
63
|
-
XCTAssertNil(
|
|
64
|
-
coordinator.begin(kind: "overlap", mutationGroup: "update", summary: "Overlapping update"),
|
|
65
|
-
"Polling a receipt must not release the mutation guard before the process result is validated."
|
|
66
|
-
)
|
|
67
|
-
_ = coordinator.update(
|
|
68
|
-
operation,
|
|
69
|
-
state: .terminalUncertain,
|
|
70
|
-
stage: "receipt",
|
|
71
|
-
progress: nil,
|
|
72
|
-
summary: "Unvalidated final output"
|
|
73
|
-
)
|
|
74
|
-
let retryAfterUncertain = try XCTUnwrap(
|
|
75
|
-
coordinator.begin(kind: "unverified-retry", mutationGroup: "update", summary: "Unverified retry"),
|
|
76
|
-
"Once the owned process has completed, an uncertain receipt must not permanently disable later Center mutations."
|
|
77
|
-
)
|
|
78
|
-
_ = coordinator.update(
|
|
79
|
-
retryAfterUncertain,
|
|
80
|
-
state: .cancelled,
|
|
81
|
-
stage: "cancelled",
|
|
82
|
-
progress: 1,
|
|
83
|
-
summary: "Test cleanup"
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
let synchronized = coordinator.synchronize(operation, with: loaded, processCompleted: true)
|
|
87
|
-
let projectBound = coordinator.synchronize(
|
|
88
|
-
operation,
|
|
89
|
-
with: loaded,
|
|
90
|
-
processCompleted: true,
|
|
91
|
-
expectedProjectRoot: AppRuntime.canonicalProjectRoot
|
|
92
|
-
)
|
|
93
|
-
XCTAssertEqual(projectBound.state, .succeeded)
|
|
94
|
-
XCTAssertEqual(synchronized.progress, 1)
|
|
95
|
-
XCTAssertTrue(
|
|
96
|
-
OperationCoordinator.completionContractIssues(
|
|
97
|
-
for: loaded,
|
|
98
|
-
expectedProjectRoot: AppRuntime.canonicalProjectRoot
|
|
99
|
-
).isEmpty
|
|
100
|
-
)
|
|
101
|
-
XCTAssertNotNil(
|
|
102
|
-
coordinator.begin(kind: "next-update", mutationGroup: "update", summary: "Retry update"),
|
|
103
|
-
"A terminal authoritative receipt must release the mutation guard for later Center actions."
|
|
104
|
-
)
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
func testUpdateReceiptBindingRejectsIdentityAndReviewContractMismatches() throws {
|
|
108
|
-
let directory = FileManager.default.temporaryDirectory
|
|
109
|
-
.appendingPathComponent("sks-operation-binding-\(UUID().uuidString)", isDirectory: true)
|
|
110
|
-
defer { try? FileManager.default.removeItem(at: directory) }
|
|
111
|
-
let coordinator = OperationCoordinator(directory: directory.path)
|
|
112
|
-
let operation = try XCTUnwrap(
|
|
113
|
-
coordinator.begin(
|
|
114
|
-
kind: "update",
|
|
115
|
-
mutationGroup: "update",
|
|
116
|
-
summary: "Update SKS",
|
|
117
|
-
targetVersion: "8.0.2",
|
|
118
|
-
projectRoot: AppRuntime.canonicalProjectRoot,
|
|
119
|
-
registry: "https://registry.npmjs.org/"
|
|
120
|
-
)
|
|
121
|
-
)
|
|
122
|
-
func receipt(
|
|
123
|
-
id: String? = nil,
|
|
124
|
-
kind: String = "update",
|
|
125
|
-
target: String? = "8.0.2",
|
|
126
|
-
projectRoot: String? = AppRuntime.canonicalProjectRoot,
|
|
127
|
-
registry: String? = "https://registry.npmjs.org/"
|
|
128
|
-
) -> UpdateOperationReceiptSnapshot {
|
|
129
|
-
UpdateOperationReceiptSnapshot(
|
|
130
|
-
schema: "sks.update-operation.v1",
|
|
131
|
-
id: id ?? operation.id,
|
|
132
|
-
kind: kind,
|
|
133
|
-
state: "running",
|
|
134
|
-
currentStage: "preflight",
|
|
135
|
-
startedAt: operation.startedAt,
|
|
136
|
-
updatedAt: operation.updatedAt,
|
|
137
|
-
fromVersion: "8.0.1",
|
|
138
|
-
targetVersion: target,
|
|
139
|
-
previousVersion: "8.0.1",
|
|
140
|
-
projectRoot: projectRoot,
|
|
141
|
-
registry: registry,
|
|
142
|
-
rollbackCommand: "sks update rollback --version 8.0.1 --json",
|
|
143
|
-
sideEffectsStarted: false,
|
|
144
|
-
stages: [],
|
|
145
|
-
resultStatus: nil,
|
|
146
|
-
publicError: nil,
|
|
147
|
-
receiptPath: directory.appendingPathComponent("update-latest.json").path
|
|
148
|
-
)
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
XCTAssertTrue(OperationCoordinator.receiptMatchesLaunchedUpdate(receipt(), operation: operation))
|
|
152
|
-
XCTAssertFalse(OperationCoordinator.receiptMatchesLaunchedUpdate(receipt(id: "other-operation"), operation: operation))
|
|
153
|
-
XCTAssertFalse(OperationCoordinator.receiptMatchesLaunchedUpdate(receipt(kind: "rollback"), operation: operation))
|
|
154
|
-
XCTAssertFalse(OperationCoordinator.receiptMatchesLaunchedUpdate(receipt(target: "8.0.3"), operation: operation))
|
|
155
|
-
XCTAssertFalse(OperationCoordinator.receiptMatchesLaunchedUpdate(receipt(projectRoot: "/different/project"), operation: operation))
|
|
156
|
-
XCTAssertFalse(OperationCoordinator.receiptMatchesLaunchedUpdate(receipt(registry: "https://registry.example/"), operation: operation))
|
|
157
|
-
XCTAssertFalse(OperationCoordinator.receiptMatchesLaunchedUpdate(receipt(registry: "https://registry.npmjs.org"), operation: operation))
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
func testRegistryCanonicalizationMatchesUpdateContract() {
|
|
161
|
-
XCTAssertEqual(
|
|
162
|
-
OperationCoordinator.canonicalRegistry("https://registry.npmjs.org"),
|
|
163
|
-
"https://registry.npmjs.org/"
|
|
164
|
-
)
|
|
165
|
-
XCTAssertEqual(
|
|
166
|
-
OperationCoordinator.canonicalRegistry("https://registry.npmjs.org/#ignored"),
|
|
167
|
-
"https://registry.npmjs.org/"
|
|
168
|
-
)
|
|
169
|
-
XCTAssertNil(OperationCoordinator.canonicalRegistry("file:///tmp/registry"))
|
|
170
|
-
XCTAssertNil(OperationCoordinator.canonicalRegistry("https://token@registry.npmjs.org/"))
|
|
171
|
-
XCTAssertNil(OperationCoordinator.canonicalRegistry("https://registry.npmjs.org/?token=secret"))
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
#endif
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#if canImport(XCTest)
|
|
2
|
-
import XCTest
|
|
3
|
-
|
|
4
|
-
final class ProcessClientTests: XCTestCase {
|
|
5
|
-
func testNativeTimeoutAndEmptyOutputAreStablePublicErrors() {
|
|
6
|
-
XCTAssertEqual(
|
|
7
|
-
ProcessClient.nativeFailureOutput("native_process_timeout"),
|
|
8
|
-
#"{"schema":"sks.native-process-error.v1","ok":false,"error":"native_process_timeout"}"#
|
|
9
|
-
)
|
|
10
|
-
XCTAssertEqual(
|
|
11
|
-
ProcessClient.nativeFailureOutput("native_process_empty_output"),
|
|
12
|
-
#"{"schema":"sks.native-process-error.v1","ok":false,"error":"native_process_empty_output"}"#
|
|
13
|
-
)
|
|
14
|
-
XCTAssertEqual(
|
|
15
|
-
ProcessClient.nativeFailureOutput("native_process_output_limit"),
|
|
16
|
-
#"{"schema":"sks.native-process-error.v1","ok":false,"error":"native_process_output_limit"}"#
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
#endif
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
#if canImport(XCTest)
|
|
2
|
-
import XCTest
|
|
3
|
-
|
|
4
|
-
final class ProvidersViewControllerTests: XCTestCase {
|
|
5
|
-
func testUnsignedStructuredCapabilityJSONCannotVerify() {
|
|
6
|
-
let fabricated: [String: Any] = [
|
|
7
|
-
"overall": "verified",
|
|
8
|
-
"image_generation": ["state": "verified", "source": "deep_probe"],
|
|
9
|
-
"computer_use": ["state": "verified", "source": "deep_probe"]
|
|
10
|
-
]
|
|
11
|
-
XCTAssertFalse(CapabilityVerificationTruth.deepEvidenceTrusted(in: fabricated))
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
func testTrustedValidationRequiresExactVerifiedAttestation() {
|
|
15
|
-
let trusted: [String: Any] = [
|
|
16
|
-
"overall": "verified",
|
|
17
|
-
"deep_evidence_validation": [
|
|
18
|
-
"schema": "sks.codex-lb-deep-evidence-validation.v1",
|
|
19
|
-
"state": "verified",
|
|
20
|
-
"trusted": true,
|
|
21
|
-
"blockers": []
|
|
22
|
-
]
|
|
23
|
-
]
|
|
24
|
-
XCTAssertTrue(CapabilityVerificationTruth.deepEvidenceTrusted(in: trusted))
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
func testStructuredBlockersArePreservedForFailureRendering() {
|
|
28
|
-
let blocked: [String: Any] = [
|
|
29
|
-
"overall": "blocked",
|
|
30
|
-
"image_generation": [
|
|
31
|
-
"state": "blocked",
|
|
32
|
-
"blockers": ["codex_lb_deep_evidence_stale"]
|
|
33
|
-
]
|
|
34
|
-
]
|
|
35
|
-
XCTAssertEqual(
|
|
36
|
-
CapabilityVerificationTruth.blockers(in: blocked),
|
|
37
|
-
["codex_lb_deep_evidence_stale"]
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
func testStatusV2BuiltinOpenAISelectionIsChatGPTOauthModeNotLegacyCodexLb() {
|
|
42
|
-
let status: [String: Any] = [
|
|
43
|
-
"schema": "sks.codex-lb-status.v2",
|
|
44
|
-
"ok": true,
|
|
45
|
-
"configured": true,
|
|
46
|
-
"mode": "cli-provider",
|
|
47
|
-
"oauth": [
|
|
48
|
-
"present": true,
|
|
49
|
-
"preserved": true,
|
|
50
|
-
"mode": "chatgpt_oauth"
|
|
51
|
-
],
|
|
52
|
-
"provider": [
|
|
53
|
-
"id": "openai",
|
|
54
|
-
"built_in": true,
|
|
55
|
-
"contract": "codex-lb-cli",
|
|
56
|
-
"contract_ok": true,
|
|
57
|
-
"selected": true
|
|
58
|
-
],
|
|
59
|
-
"bridge": [
|
|
60
|
-
"key_fingerprint": "sha256:fixture"
|
|
61
|
-
]
|
|
62
|
-
]
|
|
63
|
-
let snapshot = ProviderRoutingTruth.snapshot(from: status)
|
|
64
|
-
XCTAssertEqual(snapshot.mode, "cli-provider")
|
|
65
|
-
XCTAssertFalse(snapshot.desktopFullRouting)
|
|
66
|
-
XCTAssertFalse(snapshot.legacyCodexLbSelected)
|
|
67
|
-
XCTAssertTrue(snapshot.chatgptOauthPresent)
|
|
68
|
-
XCTAssertTrue(snapshot.cliProviderStored)
|
|
69
|
-
XCTAssertTrue(snapshot.cliCredentialsConfigured)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
func testStatusV2DesktopBridgeModeIsSelectableCodexLb() {
|
|
73
|
-
let status: [String: Any] = [
|
|
74
|
-
"schema": "sks.codex-lb-status.v2",
|
|
75
|
-
"configured": true,
|
|
76
|
-
"mode": "desktop-native-bridge",
|
|
77
|
-
"oauth": [
|
|
78
|
-
"present": true,
|
|
79
|
-
"mode": "chatgpt_oauth"
|
|
80
|
-
],
|
|
81
|
-
"provider": [
|
|
82
|
-
"id": "openai",
|
|
83
|
-
"selected": true,
|
|
84
|
-
"contract": "builtin-openai"
|
|
85
|
-
]
|
|
86
|
-
]
|
|
87
|
-
let snapshot = ProviderRoutingTruth.snapshot(from: status)
|
|
88
|
-
XCTAssertTrue(snapshot.desktopFullRouting)
|
|
89
|
-
XCTAssertFalse(snapshot.legacyCodexLbSelected)
|
|
90
|
-
XCTAssertTrue(snapshot.chatgptOauthPresent)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
func testStatusV2DetectsLegacyCodexLbWhenBuiltinProviderNotSelected() {
|
|
94
|
-
let status: [String: Any] = [
|
|
95
|
-
"mode": "cli-provider",
|
|
96
|
-
"configured": true,
|
|
97
|
-
"oauth": ["present": false, "mode": "openai_api_key"],
|
|
98
|
-
"provider": [
|
|
99
|
-
"id": "openai",
|
|
100
|
-
"selected": false,
|
|
101
|
-
"contract": "codex-lb-cli"
|
|
102
|
-
]
|
|
103
|
-
]
|
|
104
|
-
let snapshot = ProviderRoutingTruth.snapshot(from: status)
|
|
105
|
-
XCTAssertTrue(snapshot.legacyCodexLbSelected)
|
|
106
|
-
XCTAssertFalse(snapshot.chatgptOauthPresent)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
func testStatusV2DoesNotTreatNestedBridgeStatusAsLegacyDestructive() {
|
|
110
|
-
let status: [String: Any] = [
|
|
111
|
-
"mode": "cli-provider",
|
|
112
|
-
"configured": true,
|
|
113
|
-
"oauth": ["present": true, "mode": "chatgpt_oauth"],
|
|
114
|
-
"provider": ["id": "openai", "selected": true],
|
|
115
|
-
"bridge": ["status": "settings_missing"]
|
|
116
|
-
]
|
|
117
|
-
let snapshot = ProviderRoutingTruth.snapshot(from: status)
|
|
118
|
-
XCTAssertFalse(snapshot.legacyDestructive)
|
|
119
|
-
XCTAssertFalse(snapshot.legacyCodexLbSelected)
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
func testDisabledChatGPTOauthModeIsNotTreatedAsLegacyCodexLbSelection() {
|
|
123
|
-
let status: [String: Any] = [
|
|
124
|
-
"schema": "sks.codex-lb-status.v2",
|
|
125
|
-
"mode": "disabled",
|
|
126
|
-
"configured": false,
|
|
127
|
-
"oauth": ["present": true, "mode": "chatgpt_oauth"],
|
|
128
|
-
"provider": [
|
|
129
|
-
"id": "openai",
|
|
130
|
-
"selected": true,
|
|
131
|
-
"built_in": true,
|
|
132
|
-
"contract": "builtin-openai"
|
|
133
|
-
]
|
|
134
|
-
]
|
|
135
|
-
let snapshot = ProviderRoutingTruth.snapshot(from: status)
|
|
136
|
-
XCTAssertEqual(snapshot.mode, "disabled")
|
|
137
|
-
XCTAssertFalse(snapshot.desktopFullRouting)
|
|
138
|
-
XCTAssertFalse(snapshot.legacyCodexLbSelected)
|
|
139
|
-
XCTAssertTrue(snapshot.chatgptOauthPresent)
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
#endif
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { pathToFileURL } from 'node:url';
|
|
4
|
-
import { ensureDistFresh, root } from './lib/ensure-dist-fresh.js';
|
|
5
|
-
const freshness = ensureDistFresh({ rebuild: true });
|
|
6
|
-
if (!freshness.ok)
|
|
7
|
-
fail('dist_not_fresh', { freshness });
|
|
8
|
-
const mod = await import(pathToFileURL(path.join(root, 'dist', 'core', 'zellij', 'zellij-pane-proof.js')).href);
|
|
9
|
-
const args = process.argv.slice(2);
|
|
10
|
-
const missionId = readArg(args, '--mission');
|
|
11
|
-
const sessionName = readArg(args, '--session');
|
|
12
|
-
const expectedLaneArg = readArg(args, '--expected-lanes');
|
|
13
|
-
const expectedLaneCount = expectedLaneArg === null ? undefined : Number(expectedLaneArg);
|
|
14
|
-
const report = await mod.writeZellijPaneProof(root, {
|
|
15
|
-
require: process.env.SKS_REQUIRE_ZELLIJ === '1' || args.includes('--require-real'),
|
|
16
|
-
missionId: missionId || undefined,
|
|
17
|
-
sessionName: sessionName || undefined,
|
|
18
|
-
expectedLaneCount,
|
|
19
|
-
ledgerRoot: missionId ? path.join(root, '.sneakoscope', 'missions', missionId) : undefined
|
|
20
|
-
});
|
|
21
|
-
const positive = mod.evaluateZellijPaneProofRows(mod.normalizeZellijPaneRows([
|
|
22
|
-
{ pane_id: '1', name: 'orchestrator', command: 'sh -lc sks status --json', cwd: root, exited: false, x: 0, y: 0, width: 80, height: 24 },
|
|
23
|
-
{ pane_id: '2', name: 'slot-001', command: 'sh -lc sks zellij-lane --mission M --slot slot-001', cwd: root, exited: false, x: 80, y: 0, width: 40, height: 24 }
|
|
24
|
-
]), { expectedLaneCount: 1, expectedCwd: root });
|
|
25
|
-
const missingLane = mod.evaluateZellijPaneProofRows(mod.normalizeZellijPaneRows([
|
|
26
|
-
{ pane_id: '1', name: 'orchestrator', command: 'sh', cwd: root, exited: false }
|
|
27
|
-
]), { expectedLaneCount: 1, expectedCwd: root });
|
|
28
|
-
const exitedLane = mod.evaluateZellijPaneProofRows(mod.normalizeZellijPaneRows([
|
|
29
|
-
{ pane_id: '1', name: 'orchestrator', command: 'sh', cwd: root, exited: false },
|
|
30
|
-
{ pane_id: '2', name: 'slot-001', command: 'sks zellij-lane --mission M --slot slot-001', cwd: root, exited: true }
|
|
31
|
-
]), { expectedLaneCount: 1, expectedCwd: root });
|
|
32
|
-
const madCodexMain = mod.evaluateZellijPaneProofRows(mod.normalizeZellijPaneRows([
|
|
33
|
-
{ pane_id: '1', name: 'orchestrator', command: 'codex --profile sks-mad-high', cwd: root, exited: false },
|
|
34
|
-
{ pane_id: '2', name: 'slot-001', command: 'sks zellij-lane --mission M --slot slot-001', cwd: root, exited: false }
|
|
35
|
-
]), { expectedLaneCount: 1, expectedCwd: root, expectedMainCommandIncludes: 'codex' });
|
|
36
|
-
const madShellMain = mod.evaluateZellijPaneProofRows(mod.normalizeZellijPaneRows([
|
|
37
|
-
{ pane_id: '1', name: 'orchestrator', command: 'sh -lc sks status --json', cwd: root, exited: false },
|
|
38
|
-
{ pane_id: '2', name: 'slot-001', command: 'sks zellij-lane --mission M --slot slot-001', cwd: root, exited: false }
|
|
39
|
-
]), { expectedLaneCount: 1, expectedCwd: root, expectedMainCommandIncludes: 'codex' });
|
|
40
|
-
const codexLbOnlyMain = mod.evaluateZellijPaneProofRows(mod.normalizeZellijPaneRows([
|
|
41
|
-
{ pane_id: '1', name: 'orchestrator', command: 'sh -lc model_provider="codex-lb"', cwd: root, exited: false },
|
|
42
|
-
{ pane_id: '2', name: 'slot-001', command: 'sks zellij-lane --mission M --slot slot-001', cwd: root, exited: false }
|
|
43
|
-
]), { expectedLaneCount: 1, expectedCwd: root, expectedMainCommandIncludes: 'codex' });
|
|
44
|
-
const zellij044Rows = [
|
|
45
|
-
...Array.from({ length: 120 }, (_, index) => ({
|
|
46
|
-
id: index + 10,
|
|
47
|
-
is_plugin: true,
|
|
48
|
-
title: `zellij:fixture-${String(index).padStart(3, '0')}`,
|
|
49
|
-
terminal_command: null,
|
|
50
|
-
plugin_url: 'zellij:fixture',
|
|
51
|
-
tab_name: 'SKS fixture'
|
|
52
|
-
})),
|
|
53
|
-
{
|
|
54
|
-
id: 0,
|
|
55
|
-
is_plugin: false,
|
|
56
|
-
title: 'orchestrator',
|
|
57
|
-
exited: false,
|
|
58
|
-
exit_status: null,
|
|
59
|
-
pane_x: 0,
|
|
60
|
-
pane_y: 1,
|
|
61
|
-
pane_columns: 80,
|
|
62
|
-
pane_rows: 24,
|
|
63
|
-
terminal_command: "sh -lc exec 'codex' '--no-alt-screen'",
|
|
64
|
-
pane_command: `${path.join(root, 'node_modules', '.bin', 'codex')} --no-alt-screen`,
|
|
65
|
-
pane_cwd: root,
|
|
66
|
-
tab_name: 'SKS fixture'
|
|
67
|
-
}
|
|
68
|
-
];
|
|
69
|
-
const zellij044Json = JSON.stringify(zellij044Rows);
|
|
70
|
-
const zellij044Parsed = mod.parseZellijPaneRows(zellij044Json);
|
|
71
|
-
const zellij044Evaluation = mod.evaluateZellijPaneProofRows(mod.normalizeZellijPaneRows(zellij044Parsed), { expectedLaneCount: 0, expectedCwd: root, expectedMainCommandIncludes: 'codex' });
|
|
72
|
-
const fixtureOk = positive.blockers.length === 0
|
|
73
|
-
&& missingLane.blockers.includes('zellij_lane_pane_missing')
|
|
74
|
-
&& exitedLane.blockers.some((blocker) => blocker.startsWith('zellij_lane_pane_exited'))
|
|
75
|
-
&& madCodexMain.blockers.length === 0
|
|
76
|
-
&& madShellMain.blockers.includes('zellij_main_pane_unexpected_command:codex')
|
|
77
|
-
&& codexLbOnlyMain.blockers.includes('zellij_main_pane_unexpected_command:codex')
|
|
78
|
-
&& zellij044Json.length > 8192
|
|
79
|
-
&& zellij044Parsed.length === zellij044Rows.length
|
|
80
|
-
&& zellij044Evaluation.blockers.length === 0;
|
|
81
|
-
emit({ ...report, fixture_ok: fixtureOk, fixture_results: { positive, missingLane, exitedLane, madCodexMain, madShellMain, codexLbOnlyMain, zellij044: { json_bytes: Buffer.byteLength(zellij044Json), parsed_rows: zellij044Parsed.length, evaluation: zellij044Evaluation } }, ok: report.ok && fixtureOk });
|
|
82
|
-
function emit(report) { console.log(JSON.stringify(report, null, 2)); if (!report.ok)
|
|
83
|
-
process.exitCode = 1; }
|
|
84
|
-
function fail(blocker, detail) { emit({ schema: 'sks.zellij-pane-proof-check.v1', ok: false, blockers: [blocker], detail }); process.exit(1); }
|
|
85
|
-
function readArg(args, name) {
|
|
86
|
-
const index = args.indexOf(name);
|
|
87
|
-
return index >= 0 ? args[index + 1] || null : null;
|
|
88
|
-
}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import { createHash } from 'node:crypto';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { pathToFileURL } from 'node:url';
|
|
6
|
-
import { ensureDistFresh, root } from './lib/ensure-dist-fresh.js';
|
|
7
|
-
const freshness = ensureDistFresh({ rebuild: false });
|
|
8
|
-
if (!freshness.ok)
|
|
9
|
-
fail('dist_not_fresh', { freshness });
|
|
10
|
-
const args = process.argv.slice(2);
|
|
11
|
-
const missionId = readArg(args, '--mission');
|
|
12
|
-
const sessionName = readArg(args, '--session') || 'sks-real';
|
|
13
|
-
const socketDir = readArg(args, '--owned-socket-dir');
|
|
14
|
-
const ownerToken = String(process.env.SKS_ZELLIJ_CHECK_OWNER_TOKEN || '');
|
|
15
|
-
const command = await import(pathToFileURL(path.join(root, 'dist', 'core', 'zellij', 'zellij-command.js')).href);
|
|
16
|
-
const ownershipPath = missionId ? path.join(root, '.sneakoscope', 'missions', missionId, 'zellij-real-session-ownership.json') : null;
|
|
17
|
-
const expectedLayoutPath = missionId ? path.join(root, '.sneakoscope', 'layouts', `mad-${missionId}.kdl`) : null;
|
|
18
|
-
const ownership = ownershipPath ? await readJson(ownershipPath) : null;
|
|
19
|
-
const ownershipBlockers = [
|
|
20
|
-
...(!missionId ? ['zellij_cleanup_mission_missing'] : []),
|
|
21
|
-
...(!isSafeOwnedSocketDir(socketDir) ? ['zellij_cleanup_owned_socket_dir_invalid'] : []),
|
|
22
|
-
...(ownerToken.length < 32 ? ['zellij_cleanup_owner_token_missing'] : []),
|
|
23
|
-
...(!ownership ? ['zellij_cleanup_ownership_marker_missing'] : []),
|
|
24
|
-
...(ownership && ownership.schema !== 'sks.zellij-real-session-ownership.v1' ? ['zellij_cleanup_ownership_schema_invalid'] : []),
|
|
25
|
-
...(ownership && ownership.mission_id !== missionId ? ['zellij_cleanup_mission_mismatch'] : []),
|
|
26
|
-
...(ownership && ownership.session_name !== sessionName ? ['zellij_cleanup_session_mismatch'] : []),
|
|
27
|
-
...(ownership && path.resolve(String(ownership.socket_dir || '')) !== path.resolve(String(socketDir || '')) ? ['zellij_cleanup_socket_dir_mismatch'] : []),
|
|
28
|
-
...(ownership && ownership.owner_token_sha256 !== hashOwnerToken(ownerToken) ? ['zellij_cleanup_owner_token_mismatch'] : []),
|
|
29
|
-
...(ownership && ownership.cleanup_authorized !== true ? ['zellij_cleanup_not_authorized'] : []),
|
|
30
|
-
...(ownership && ownership.layout_cleanup_authorized !== true ? ['zellij_cleanup_layout_not_authorized'] : []),
|
|
31
|
-
...(ownership && path.resolve(String(ownership.layout_path || '')) !== path.resolve(String(expectedLayoutPath || '')) ? ['zellij_cleanup_layout_path_mismatch'] : [])
|
|
32
|
-
];
|
|
33
|
-
if (ownershipBlockers.length > 0) {
|
|
34
|
-
emit({
|
|
35
|
-
schema: 'sks.zellij-real-session-cleanup-check.v1',
|
|
36
|
-
ok: false,
|
|
37
|
-
mutation_attempted: false,
|
|
38
|
-
mission_id: missionId,
|
|
39
|
-
session_name: sessionName,
|
|
40
|
-
socket_dir: socketDir,
|
|
41
|
-
ownership_path: ownershipPath,
|
|
42
|
-
blockers: ownershipBlockers
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
const beforeEntries = await socketEntries(socketDir);
|
|
47
|
-
const result = await command.runZellij(['kill-session', sessionName], {
|
|
48
|
-
cwd: root,
|
|
49
|
-
env: { ZELLIJ_SOCKET_DIR: socketDir },
|
|
50
|
-
timeoutMs: 5000,
|
|
51
|
-
optional: true
|
|
52
|
-
});
|
|
53
|
-
const remainingEntries = await waitForSocketEntriesToClear(socketDir, 2000);
|
|
54
|
-
const sessionRemoved = !remainingEntries.includes(sessionName);
|
|
55
|
-
const socketExclusive = remainingEntries.length === 0;
|
|
56
|
-
const layoutPresentBefore = await exists(expectedLayoutPath);
|
|
57
|
-
const layoutSha256Before = layoutPresentBefore ? await sha256File(expectedLayoutPath) : null;
|
|
58
|
-
const layoutHashMatches = !layoutPresentBefore || !ownership.layout_sha256 || layoutSha256Before === ownership.layout_sha256;
|
|
59
|
-
let socketDirRemoved = false;
|
|
60
|
-
let layoutRemoved = false;
|
|
61
|
-
if (sessionRemoved && socketExclusive) {
|
|
62
|
-
await fs.rm(socketDir, { recursive: true, force: true });
|
|
63
|
-
socketDirRemoved = !(await exists(socketDir));
|
|
64
|
-
if (socketDirRemoved && layoutHashMatches) {
|
|
65
|
-
await fs.rm(expectedLayoutPath, { force: true });
|
|
66
|
-
layoutRemoved = !(await exists(expectedLayoutPath));
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
const blockers = [
|
|
70
|
-
...(!sessionRemoved ? ['zellij_cleanup_session_still_present'] : []),
|
|
71
|
-
...(!socketExclusive ? ['zellij_cleanup_owned_socket_dir_not_empty'] : []),
|
|
72
|
-
...(!socketDirRemoved ? ['zellij_cleanup_socket_dir_not_removed'] : []),
|
|
73
|
-
...(!layoutHashMatches ? ['zellij_cleanup_layout_hash_mismatch'] : []),
|
|
74
|
-
...(!layoutRemoved ? ['zellij_cleanup_layout_not_removed'] : [])
|
|
75
|
-
];
|
|
76
|
-
const report = {
|
|
77
|
-
schema: 'sks.zellij-real-session-cleanup-check.v1',
|
|
78
|
-
ok: blockers.length === 0,
|
|
79
|
-
mutation_attempted: true,
|
|
80
|
-
mission_id: missionId,
|
|
81
|
-
session_name: sessionName,
|
|
82
|
-
socket_dir: socketDir,
|
|
83
|
-
ownership_path: ownershipPath,
|
|
84
|
-
session_present_before: beforeEntries.includes(sessionName),
|
|
85
|
-
session_removed: sessionRemoved,
|
|
86
|
-
socket_dir_exclusive: socketExclusive,
|
|
87
|
-
socket_dir_removed: socketDirRemoved,
|
|
88
|
-
layout_path: expectedLayoutPath,
|
|
89
|
-
layout_sha256: ownership.layout_sha256 || null,
|
|
90
|
-
layout_sha256_before_cleanup: layoutSha256Before,
|
|
91
|
-
layout_hash_matches: layoutHashMatches,
|
|
92
|
-
layout_removed: layoutRemoved,
|
|
93
|
-
remaining_socket_entries: remainingEntries,
|
|
94
|
-
result,
|
|
95
|
-
blockers,
|
|
96
|
-
warnings: result.ok ? [] : ['zellij_kill_session_nonzero_but_absence_verified']
|
|
97
|
-
};
|
|
98
|
-
await fs.writeFile(path.join(root, '.sneakoscope', 'missions', missionId, 'zellij-real-session-cleanup.json'), `${JSON.stringify(report, null, 2)}\n`);
|
|
99
|
-
emit(report);
|
|
100
|
-
}
|
|
101
|
-
function emit(report) { console.log(JSON.stringify(report, null, 2)); if (!report.ok)
|
|
102
|
-
process.exitCode = 1; }
|
|
103
|
-
function fail(blocker, detail) { emit({ schema: 'sks.zellij-real-session-cleanup-check.v1', ok: false, blockers: [blocker], detail }); process.exit(1); }
|
|
104
|
-
function readArg(args, name) {
|
|
105
|
-
const index = args.indexOf(name);
|
|
106
|
-
return index >= 0 ? args[index + 1] || null : null;
|
|
107
|
-
}
|
|
108
|
-
function hashOwnerToken(value) {
|
|
109
|
-
return createHash('sha256').update(String(value)).digest('hex');
|
|
110
|
-
}
|
|
111
|
-
async function sha256File(file) {
|
|
112
|
-
return fs.readFile(file).then((data) => createHash('sha256').update(data).digest('hex')).catch(() => null);
|
|
113
|
-
}
|
|
114
|
-
function isSafeOwnedSocketDir(value) {
|
|
115
|
-
if (!value)
|
|
116
|
-
return false;
|
|
117
|
-
const resolved = path.resolve(String(value));
|
|
118
|
-
return path.dirname(resolved) === '/tmp' && /^sks-zj-rr-[A-Za-z0-9-]+$/.test(path.basename(resolved));
|
|
119
|
-
}
|
|
120
|
-
async function readJson(file) {
|
|
121
|
-
return fs.readFile(file, 'utf8').then((text) => JSON.parse(text)).catch(() => null);
|
|
122
|
-
}
|
|
123
|
-
async function socketEntries(socketDir) {
|
|
124
|
-
if (!socketDir)
|
|
125
|
-
return [];
|
|
126
|
-
return fs.readdir(path.join(socketDir, 'contract_version_1')).catch(() => []);
|
|
127
|
-
}
|
|
128
|
-
async function waitForSocketEntriesToClear(socketDir, timeoutMs) {
|
|
129
|
-
const deadline = Date.now() + timeoutMs;
|
|
130
|
-
for (;;) {
|
|
131
|
-
const entries = await socketEntries(socketDir);
|
|
132
|
-
if (entries.length === 0 || Date.now() >= deadline)
|
|
133
|
-
return entries;
|
|
134
|
-
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
async function exists(value) {
|
|
138
|
-
return fs.access(value).then(() => true).catch(() => false);
|
|
139
|
-
}
|