sneakoscope 6.0.3 → 6.1.2
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 +29 -12
- package/config/codex-releases/{rust-v0.142.0.json → rust-v0.144.1.json} +6 -6
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/dist/bin/fast-inline.js +18 -14
- package/dist/bin/sks-dispatch.js +2 -4
- package/dist/cli/args.js +2 -0
- package/dist/cli/command-manifest-lite.js +2 -3
- package/dist/cli/command-registry.js +3 -4
- package/dist/cli/help-fast.js +1 -1
- package/dist/cli/install-helpers.js +348 -763
- package/dist/cli/install-tool-helpers.js +287 -0
- package/dist/cli/router.js +91 -6
- package/dist/commands/codex-lb.js +188 -53
- package/dist/commands/codex.js +44 -5
- package/dist/commands/doctor.js +302 -46
- package/dist/commands/tmux.js +5 -1
- package/dist/commands/versioning.js +7 -0
- package/dist/commands/zellij-monitor-pane.js +2 -0
- package/dist/commands/zellij-viewport-pane.js +3 -1
- package/dist/commands/zellij.js +1 -1
- package/dist/config/skills-manifest.json +59 -59
- package/dist/core/agent-bridge/agent-manifest.js +48 -0
- package/dist/core/agents/agent-central-ledger.js +9 -0
- package/dist/core/agents/agent-cleanup-executor.js +334 -41
- package/dist/core/agents/agent-cleanup.js +20 -1
- package/dist/core/agents/agent-command-surface.js +3 -1
- package/dist/core/agents/agent-effort-policy.js +30 -38
- package/dist/core/agents/agent-janitor.js +9 -10
- package/dist/core/agents/agent-namespace-safety.js +56 -0
- package/dist/core/agents/agent-orchestrator.js +25 -3
- package/dist/core/agents/agent-output-validator.js +1 -1
- package/dist/core/agents/agent-plan.js +100 -21
- package/dist/core/agents/agent-role-config.js +43 -49
- package/dist/core/agents/agent-runner-codex-exec.js +18 -3
- package/dist/core/agents/agent-runner-process.js +1 -0
- package/dist/core/agents/agent-schema.js +3 -2
- package/dist/core/agents/fast-mode-policy.js +3 -5
- package/dist/core/agents/native-cli-session-swarm.js +1 -1
- package/dist/core/agents/native-worker-backend-router.js +2 -1
- package/dist/core/agents/work-partition/repo-inventory.js +68 -7
- package/dist/core/agents/zellij-right-lane-cockpit.js +2 -2
- package/dist/core/code-structure.js +5 -4
- package/dist/core/codex/agent-config-file-repair.js +94 -193
- package/dist/core/codex/codex-cli-update.js +723 -0
- package/dist/core/codex/codex-config-guard.js +38 -11
- package/dist/core/codex/codex-project-config-policy.js +3 -6
- package/dist/core/codex/codex-startup-config-postcheck.js +52 -42
- package/dist/core/codex-adapter.js +35 -22
- package/dist/core/codex-app/codex-agent-role-sync.js +13 -54
- package/dist/core/codex-app/codex-app-fast-ui-repair.js +51 -20
- package/dist/core/codex-app/codex-app-launcher.js +48 -17
- package/dist/core/codex-app/codex-app-restart.js +23 -2
- package/dist/core/codex-app/codex-app-ui-state-snapshot.js +11 -3
- package/dist/core/codex-app/sks-menubar.js +136 -5
- package/dist/core/codex-app.js +35 -14
- package/dist/core/codex-compat/codex-hook-warning-detector.js +10 -1
- package/dist/core/codex-compat/codex-release-manifest.js +6 -6
- package/dist/core/codex-control/codex-0139-doctor-real-probe.js +7 -1
- package/dist/core/codex-control/codex-0139-image-path-real-probe.js +29 -12
- package/dist/core/codex-control/codex-0139-probe-runner.js +103 -28
- package/dist/core/codex-control/codex-0139-real-probe-summary.js +7 -3
- package/dist/core/codex-control/codex-0139-real-probes.js +21 -6
- package/dist/core/codex-control/codex-0139-sandbox-real-probe.js +39 -13
- package/dist/core/codex-control/codex-0139-web-search-probe.js +28 -14
- package/dist/core/codex-control/{codex-0142-capability.js → codex-0144-capability.js} +22 -22
- package/dist/core/codex-control/codex-0144-collab-agent-real-probe.js +63 -0
- package/dist/core/codex-control/codex-lb-launch-recovery.js +278 -0
- package/dist/core/codex-control/codex-multi-agent-event-normalizer.js +5 -1
- package/dist/core/codex-control/codex-reliability-shield.js +93 -30
- package/dist/core/codex-control/codex-sdk-adapter.js +96 -13
- package/dist/core/codex-control/codex-sdk-config-policy.js +2 -1
- package/dist/core/codex-control/codex-sdk-sandbox-policy.js +6 -3
- package/dist/core/codex-control/codex-task-runner.js +62 -9
- package/dist/core/codex-control/python-codex-sdk-adapter.js +30 -3
- package/dist/core/codex-exec-output-schema.js +35 -6
- package/dist/core/codex-lb/codex-lb-env.js +30 -1
- package/dist/core/codex-lb/codex-lb-tool-catalog.js +478 -0
- package/dist/core/codex-lb/codex-lb-tool-output-recovery.js +291 -0
- package/dist/core/codex-native/codex-native-feature-broker.js +31 -38
- package/dist/core/codex-native/codex-native-feature-matrix.js +2 -2
- package/dist/core/codex-native/codex-native-repair-transaction.js +1 -1
- package/dist/core/codex-native/core-skill-manifest.js +8 -4
- package/dist/core/codex-native/native-capability-postcheck.js +16 -8
- package/dist/core/codex-native/native-capability-repair-matrix.js +76 -27
- package/dist/core/codex-plugins/codex-plugin-json.js +67 -21
- package/dist/core/codex-plugins/codex-plugin-repair.js +118 -0
- package/dist/core/codex-runtime/codex-desktop-config-policy.js +305 -0
- package/dist/core/commands/agent-bridge-command.js +23 -2
- package/dist/core/commands/agent-command.js +38 -5
- package/dist/core/commands/basic-cli.js +77 -30
- package/dist/core/commands/command-utils.js +1 -1
- package/dist/core/commands/gc-command.js +27 -4
- package/dist/core/commands/image-ux-review-command.js +55 -24
- package/dist/core/commands/mad-sks-command.js +182 -137
- package/dist/core/commands/naruto-command.js +643 -1153
- package/dist/core/commands/pipeline-command.js +1 -0
- package/dist/core/commands/research-command.js +293 -231
- package/dist/core/commands/run-command.js +100 -23
- package/dist/core/commands/team-command.js +2 -3
- package/dist/core/commands/team-legacy-observe-command.js +94 -359
- package/dist/core/commands/wiki-command.js +179 -83
- package/dist/core/computer-use-live-evidence.js +166 -3
- package/dist/core/computer-use-status.js +5 -2
- package/dist/core/daemon/sksd-hook-daemon-entrypoint.js +2 -2
- package/dist/core/daemon/sksd-hook-daemon.js +171 -28
- package/dist/core/daemon/sksd-hook-dispatch.js +2 -2
- package/dist/core/db-safety.js +2 -2
- package/dist/core/decision-lattice.js +6 -6
- package/dist/core/dfix/verification-selector.js +6 -4
- package/dist/core/doctor/browser-use-repair.js +54 -13
- package/dist/core/doctor/codex-0139-doctor.js +3 -2
- package/dist/core/doctor/codex-startup-config-repair.js +8 -3
- package/dist/core/doctor/computer-use-repair.js +28 -39
- package/dist/core/doctor/doctor-codex-startup-repair.js +24 -149
- package/dist/core/doctor/doctor-context7-repair.js +1 -1
- package/dist/core/doctor/doctor-dirty-planner.js +1 -1
- package/dist/core/doctor/doctor-native-capability-repair.js +74 -3
- package/dist/core/doctor/imagegen-repair.js +47 -12
- package/dist/core/doctor/legacy-global-hook-cleanup.js +179 -0
- package/dist/core/feature-fixture-executor.js +71 -7
- package/dist/core/feature-fixture-runner.js +53 -12
- package/dist/core/feature-fixtures.js +47 -14
- package/dist/core/feature-registry.js +53 -58
- package/dist/core/fsx.js +54 -6
- package/dist/core/harness-conflicts.js +19 -10
- package/dist/core/hooks-runtime/code-pack-freshness-preflight.js +5 -4
- package/dist/core/hooks-runtime/hook-invocation-dedupe.js +147 -0
- package/dist/core/hooks-runtime/hook-io.js +14 -4
- package/dist/core/hooks-runtime/light-turn.js +70 -0
- package/dist/core/hooks-runtime/payload-signals.js +270 -0
- package/dist/core/hooks-runtime/team-digest.js +0 -1
- package/dist/core/hooks-runtime/tool-output-quarantine.js +93 -0
- package/dist/core/hooks-runtime.js +418 -250
- package/dist/core/image/image-artifact-path-contract.js +8 -6
- package/dist/core/image/image-artifact-registry.js +5 -1
- package/dist/core/image-ux-review/imagegen-adapter.js +5 -2
- package/dist/core/imagegen/imagegen-capability.js +10 -13
- package/dist/core/imagegen/require-imagegen.js +37 -11
- package/dist/core/init/skills.js +16 -30
- package/dist/core/init.js +144 -36
- package/dist/core/managed-assets/managed-assets-manifest.js +417 -14
- package/dist/core/mission.js +24 -1
- package/dist/core/naruto/naruto-work-graph.js +70 -4
- package/dist/core/ops/reporting.js +3 -0
- package/dist/core/pipeline-internals/runtime-core.js +578 -180
- package/dist/core/pipeline-internals/runtime-gates.js +191 -49
- package/dist/core/ppt/style-tokens.js +1 -1
- package/dist/core/ppt-review/index.js +1 -1
- package/dist/core/ppt-review/slide-exporter.js +23 -17
- package/dist/core/ppt-review/slide-imagegen-review.js +1 -1
- package/dist/core/ppt-review/slide-issue-extraction.js +4 -2
- package/dist/core/preflight/parallel-preflight-engine.js +50 -1
- package/dist/core/product-design-plugin.js +2 -2
- package/dist/core/proof/route-finalizer.js +1 -1
- package/dist/core/proof/route-proof-gate.js +7 -2
- package/dist/core/proof-field.js +3 -3
- package/dist/core/provider/model-router.js +38 -32
- package/dist/core/recallpulse/policy.js +12 -28
- package/dist/core/recallpulse.js +11 -6
- package/dist/core/release/gate-manifest.js +18 -12
- package/dist/core/release/gate-pack-manifest.js +1 -1
- package/dist/core/release/npm-pack-proof.js +247 -0
- package/dist/core/release/package-dist-snapshot.js +151 -0
- package/dist/core/release/package-size-budget.js +5 -0
- package/dist/core/release/release-authorization-snapshot.js +115 -0
- package/dist/core/release/release-gate-affected-selector.js +15 -3
- package/dist/core/release/release-gate-cache-v2.js +30 -0
- package/dist/core/release/release-gate-contract.js +161 -0
- package/dist/core/release/release-gate-dag.js +44 -3
- package/dist/core/release/release-gate-hermetic-env.js +28 -17
- package/dist/core/release/release-real-contract.js +496 -0
- package/dist/core/release-parallel-full-coverage.js +31 -143
- package/dist/core/research/claim-evidence-matrix.js +41 -6
- package/dist/core/research/experiment-plan.js +14 -10
- package/dist/core/research/falsification.js +9 -2
- package/dist/core/research/implementation-blueprint-densifier.js +82 -60
- package/dist/core/research/implementation-blueprint.js +32 -26
- package/dist/core/research/mock-result.js +122 -11
- package/dist/core/research/replication-pack.js +15 -8
- package/dist/core/research/research-adversarial-review.js +1068 -0
- package/dist/core/research/research-claim-builder.js +69 -17
- package/dist/core/research/research-claim-synthesizer.js +343 -0
- package/dist/core/research/research-cycle-runner.js +53 -3
- package/dist/core/research/research-falsification-runner.js +176 -0
- package/dist/core/research/research-final-reviewer.js +44 -125
- package/dist/core/research/research-realistic-report.js +14 -6
- package/dist/core/research/research-review-artifact-digest.js +66 -0
- package/dist/core/research/research-source-evidence.js +144 -0
- package/dist/core/research/research-source-layer-catalog.js +68 -0
- package/dist/core/research/research-source-ledger-merge.js +250 -12
- package/dist/core/research/research-source-shards.js +26 -70
- package/dist/core/research/research-stage-runner.js +237 -247
- package/dist/core/research/research-super-search.js +184 -0
- package/dist/core/research/research-synthesis-prompt.js +20 -1
- package/dist/core/research/research-synthesis-writer.js +86 -5
- package/dist/core/research/research-work-graph.js +25 -18
- package/dist/core/research/source-quality-report.js +21 -0
- package/dist/core/research.js +429 -280
- package/dist/core/retention/retention-budget.js +25 -6
- package/dist/core/retention.js +980 -101
- package/dist/core/routes/constants.js +1 -1
- package/dist/core/routes/dollar-manifest-lite.js +11 -11
- package/dist/core/routes/evidence.js +4 -4
- package/dist/core/routes/ppt-policy.js +1 -1
- package/dist/core/routes.js +92 -64
- package/dist/core/runtime/task-profile.js +66 -0
- package/dist/core/runtime/verification-budget.js +12 -0
- package/dist/core/secret-redaction.js +4 -0
- package/dist/core/security/high-risk-contracts.js +6 -6
- package/dist/core/stop-gate/stop-gate-check.js +49 -12
- package/dist/core/subagents/agent-catalog.js +215 -0
- package/dist/core/subagents/model-policy.js +118 -0
- package/dist/core/subagents/naruto-help-contract.js +40 -0
- package/dist/core/subagents/official-subagent-config.js +488 -0
- package/dist/core/subagents/official-subagent-preparation.js +251 -0
- package/dist/core/subagents/official-subagent-prompt.js +137 -0
- package/dist/core/subagents/official-subagent-runner.js +129 -0
- package/dist/core/subagents/subagent-evidence.js +663 -0
- package/dist/core/subagents/terminology.js +16 -0
- package/dist/core/subagents/thread-budget.js +21 -0
- package/dist/core/subagents/triwiki-attention.js +65 -0
- package/dist/core/super-search/runtime-helpers.js +173 -19
- package/dist/core/super-search/runtime.js +140 -15
- package/dist/core/super-search/source-records.js +49 -8
- package/dist/core/team-review-policy.js +15 -0
- package/dist/core/triwiki/code-pack.js +8 -2
- package/dist/core/triwiki/triwiki-cache-key.js +108 -29
- package/dist/core/triwiki/triwiki-module-card.js +1 -1
- package/dist/core/triwiki-attention.js +13 -6
- package/dist/core/triwiki-provenance.js +274 -0
- package/dist/core/triwiki-runtime.js +21 -7
- package/dist/core/triwiki-wrongness/wrongness-ledger.js +187 -61
- package/dist/core/triwiki-wrongness/wrongness-retrieval.js +11 -2
- package/dist/core/triwiki-wrongness/wrongness-trust-policy.js +2 -0
- package/dist/core/update-check.js +23 -15
- package/dist/core/version-manager.js +51 -1
- package/dist/core/version.js +1 -1
- package/dist/core/wiki-coordinate.js +128 -12
- package/dist/core/work-order-ledger.js +208 -10
- package/dist/core/zellij/zellij-command.js +12 -1
- package/dist/core/zellij/zellij-dashboard-pane.js +3 -3
- package/dist/core/zellij/zellij-fake-adapter.js +3 -1
- package/dist/core/zellij/zellij-launcher.js +51 -21
- package/dist/core/zellij/zellij-layout-builder.js +14 -5
- package/dist/core/zellij/zellij-official-subagent-activity.js +477 -0
- package/dist/core/zellij/zellij-official-subagent-telemetry.js +264 -0
- package/dist/core/zellij/zellij-pane-proof.js +32 -6
- package/dist/core/zellij/zellij-slot-pane-renderer.js +17 -5
- package/dist/core/zellij/zellij-slot-telemetry.js +15 -3
- package/dist/core/zellij/zellij-ui-mode.js +1 -1
- package/dist/core/zellij/zellij-viewport-binder.js +3 -0
- package/dist/core/zellij/zellij-worker-pane-manager.js +5 -3
- package/dist/scripts/agent-fast-mode-default-check.js +48 -29
- package/dist/scripts/agent-role-config-repair-check.js +34 -15
- package/dist/scripts/agent-wiki-context-proof-check.js +16 -2
- package/dist/scripts/all-feature-deep-completion-check.js +14 -4
- package/dist/scripts/architecture-guard-check.js +8 -1
- package/dist/scripts/build-dist.js +17 -5
- package/dist/scripts/canonical-test-runner.js +188 -0
- package/dist/scripts/check-command-module-budget.js +38 -16
- package/dist/scripts/check-legacy-free.js +1 -1
- package/dist/scripts/check-route-modularity.js +0 -1
- package/dist/scripts/check-ts-contracts.js +1 -1
- package/dist/scripts/codex-0139-interrupt-agent-check.js +5 -1
- package/dist/scripts/{codex-0142-app-server-v2-check.js → codex-0144-app-server-v2-check.js} +11 -10
- package/dist/scripts/{codex-0142-binary-identity-check.js → codex-0144-binary-identity-check.js} +4 -4
- package/dist/scripts/codex-0144-capability-check.js +21 -0
- package/dist/scripts/{codex-0139-real-probes-check.js → codex-0144-core-real-probes-check.js} +19 -5
- package/dist/scripts/{codex-0142-doctor-wiring-check.js → codex-0144-doctor-wiring-check.js} +6 -6
- package/dist/scripts/{codex-0142-manifest-check.js → codex-0144-manifest-check.js} +11 -3
- package/dist/scripts/{codex-0142-policy-check.js → codex-0144-policy-check.js} +2 -2
- package/dist/scripts/{codex-0142-thread-store-check.js → codex-0144-thread-store-check.js} +3 -3
- package/dist/scripts/codex-app-provider-model-ui-check.js +53 -19
- package/dist/scripts/codex-app-ui-preservation-check.js +35 -4
- package/dist/scripts/codex-control-all-pipelines-check.js +7 -3
- package/dist/scripts/codex-control-side-effect-scope-check.js +2 -2
- package/dist/scripts/codex-control-tool-output-continuity-audit-check.js +27 -0
- package/dist/scripts/codex-effort-auto-discovery-check.js +1 -1
- package/dist/scripts/codex-lb-fast-mode-truth-check.js +1 -0
- package/dist/scripts/{codex-lb-gpt55-fast-profile-check.js → codex-lb-gpt56-fast-profile-check.js} +56 -5
- package/dist/scripts/codex-model-metadata-check.js +1 -1
- package/dist/scripts/codex-native-agent-role-content-check.js +15 -7
- package/dist/scripts/codex-native-repair-transaction-check.js +3 -1
- package/dist/scripts/codex-sdk-all-pipelines-check.js +7 -4
- package/dist/scripts/codex-sdk-research-pipeline-check.js +30 -8
- package/dist/scripts/codex-sdk-sandbox-policy-check.js +5 -1
- package/dist/scripts/codex-sdk-version-compat-check.js +2 -1
- package/dist/scripts/db-route-materialization-check.js +33 -0
- package/dist/scripts/dfix-fixture-check.js +1 -1
- package/dist/scripts/docs-truthfulness-check.js +4 -2
- package/dist/scripts/doctor-codex-startup-repair-check.js +47 -25
- package/dist/scripts/doctor-context7-repair-check.js +2 -1
- package/dist/scripts/doctor-fix-production-blackbox.js +12 -2
- package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +34 -7
- package/dist/scripts/doctor-imagegen-repair-check.js +14 -4
- package/dist/scripts/doctor-startup-config-repair-blackbox.js +9 -3
- package/dist/scripts/doctor-startup-config-repair-check.js +13 -3
- package/dist/scripts/install-update-preserves-config-check.js +7 -2
- package/dist/scripts/legacy-gate-inventory-check.js +7 -5
- package/dist/scripts/legacy-strong-inventory-check.js +7 -5
- package/dist/scripts/legacy-upgrade-matrix-check.js +4 -4
- package/dist/scripts/lib/native-cli-session-swarm-check-lib.js +173 -13
- package/dist/scripts/mad-sks-app-ui-no-mutation-check.js +165 -6
- package/dist/scripts/managed-role-manifest-parity-check.js +5 -4
- package/dist/scripts/mutation-callsite-coverage-check.js +0 -11
- package/dist/scripts/naruto-codex-e2e-check.js +14 -7
- package/dist/scripts/naruto-shadow-clone-swarm-check.js +4 -201
- package/dist/scripts/npm-publish-performance-check.js +20 -12
- package/dist/scripts/official-subagent-workflow-check.js +145 -0
- package/dist/scripts/package-published-contract-check.js +6 -20
- package/dist/scripts/packlist-performance-check.js +17 -3
- package/dist/scripts/parallel-verification-engine-check.js +2 -2
- package/dist/scripts/postinstall-safe-side-effects-check.js +8 -3
- package/dist/scripts/ppt-no-mock-as-real-check.js +3 -1
- package/dist/scripts/prepublish-release-check-or-fast.js +23 -86
- package/dist/scripts/product-design-plugin-routing-check.js +1 -1
- package/dist/scripts/release-affected-selector-check.js +74 -1
- package/dist/scripts/release-check-stamp.js +324 -239
- package/dist/scripts/release-dag-full-coverage-check.js +7 -15
- package/dist/scripts/release-dynamic-presets-check.js +10 -1
- package/dist/scripts/release-gate-dag-runner-check.js +3 -3
- package/dist/scripts/release-gate-dag-runner.js +35 -11
- package/dist/scripts/release-gate-existence-audit.js +1 -2
- package/dist/scripts/release-gate-script-parity-check.js +1 -1
- package/dist/scripts/release-parallel-full-coverage-check.js +12 -6
- package/dist/scripts/release-parallel-speed-budget-check.js +18 -2
- package/dist/scripts/release-real-check.js +390 -157
- package/dist/scripts/release-registry-check.js +61 -16
- package/dist/scripts/release-runtime-truth-matrix-check.js +22 -0
- package/dist/scripts/research-blueprint-densifier-check.js +2 -2
- package/dist/scripts/research-real-cycle-no-legacy-final-md-check.js +11 -7
- package/dist/scripts/route-proof-artifact-structure-check.js +1 -0
- package/dist/scripts/search-visibility-gate-lib.js +1 -1
- package/dist/scripts/seo-geo-route-identity-check.js +30 -4
- package/dist/scripts/sizecheck.js +4 -4
- package/dist/scripts/sks-1-11-gate-lib.js +53 -6
- package/dist/scripts/sks-3-1-4-directive-check-lib.js +8 -2
- package/dist/scripts/sks-3-1-5-directive-check-lib.js +3 -2
- package/dist/scripts/sks-3-1-6-directive-check-lib.js +5 -3
- package/dist/scripts/sks-menubar-install-check.js +8 -0
- package/dist/scripts/sks-uninstall-regression-check.js +1 -1
- package/dist/scripts/sksd-daemon-check.js +16 -6
- package/dist/scripts/trust-fixture-check.js +32 -10
- package/dist/scripts/write-build-manifest.js +2 -1
- package/dist/scripts/wrongness-fixture-check.js +1 -1
- package/dist/scripts/zellij-layout-valid-check.js +36 -11
- package/dist/scripts/zellij-pane-proof-check.js +33 -2
- package/dist/scripts/zellij-real-session-cleanup-check.js +122 -2
- package/dist/scripts/zellij-real-session-launch-check.js +76 -5
- package/dist/scripts/zellij-slot-pane-renderer-check.js +4 -4
- package/dist/scripts/zellij-spawn-on-demand-layout-check.js +3 -3
- package/docs/demo.tape +1 -1
- package/infra-harness-gates.json +1486 -0
- package/package.json +32 -19
- package/release-gates.v2.json +4060 -0
- package/runtime-required-scripts.json +9 -0
- package/schemas/codex/{app-server-0.142 → app-server-0.144}/codex_app_server_protocol.v2.schemas.json +1146 -781
- package/schemas/codex/codex-0139-real-probe-result.schema.json +39 -5
- package/schemas/codex/ppt-slide-issue-ledger.schema.json +2 -1
- package/dist/commands/db.js +0 -6
- package/dist/core/codex-control/codex-0139-multi-agent-real-probe.js +0 -107
- package/dist/core/commands/db-command.js +0 -146
- package/dist/core/research/prompt.js +0 -15
- package/dist/scripts/agent-native-release-gate.js +0 -274
- package/dist/scripts/codex-0142-capability-check.js +0 -21
- package/dist/scripts/codex-control-tool-call-sequence-repair-check.js +0 -14
- package/dist/scripts/command-performance-scorecard-check.js +0 -204
- package/dist/scripts/config-managed-merge-callsite-coverage-check.js +0 -212
- package/dist/scripts/dollar-performance-scorecard-check.js +0 -257
- package/dist/scripts/gate-timing-check.js +0 -16
- package/dist/scripts/ops-maturity-scorecard-check.js +0 -12
- package/dist/scripts/performance-baseline-check.js +0 -12
- package/dist/scripts/performance-improvement-report-check.js +0 -58
- package/dist/scripts/release-parallel-check.js +0 -389
- package/dist/scripts/release-runner-efficiency-check.js +0 -15
- package/dist/scripts/retention-long-run-smoke-check.js +0 -299
- package/docs/assets/sneakoscope-architecture-pipeline.jpg +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
import fs from 'node:fs/promises';
|
|
4
|
+
import { randomBytes } from 'node:crypto';
|
|
4
5
|
import os from 'node:os';
|
|
5
6
|
import path from 'node:path';
|
|
6
7
|
import { pathToFileURL } from 'node:url';
|
|
@@ -11,18 +12,18 @@ if (!freshness.ok)
|
|
|
11
12
|
const layoutMod = await import(pathToFileURL(path.join(root, 'dist', 'core', 'zellij', 'zellij-layout-builder.js')).href);
|
|
12
13
|
const capabilityMod = await import(pathToFileURL(path.join(root, 'dist', 'core', 'zellij', 'zellij-capability.js')).href);
|
|
13
14
|
const commandMod = await import(pathToFileURL(path.join(root, 'dist', 'core', 'zellij', 'zellij-command.js')).href);
|
|
14
|
-
process.env.SKS_ZELLIJ_VIEWPORTS = '
|
|
15
|
+
process.env.SKS_ZELLIJ_VIEWPORTS = '3';
|
|
15
16
|
const built = layoutMod.buildZellijLayoutKdl({ missionId: 'M-layout-check', ledgerRoot: path.join(root, '.sneakoscope', 'tmp', 'layout-check'), cwd: root, kind: 'mad', slotCount: 2, codexArgs: ['--profile', 'sks-mad-high', '-c', 'service_tier=fast'] });
|
|
16
17
|
const staticValidation = layoutMod.validateZellijLayoutKdl(built.layout_kdl);
|
|
17
18
|
const viewportLayoutOk = built.initial_worker_panes === 0
|
|
18
|
-
&& built.viewport_count ===
|
|
19
|
+
&& built.viewport_count === 3
|
|
19
20
|
&& built.ui_architecture === 'monitor_plus_viewports'
|
|
20
21
|
&& built.lane_runtime_policies.length === 0
|
|
21
22
|
&& built.layout_kdl.includes('pane name="orchestrator"')
|
|
22
23
|
&& built.layout_kdl.includes('pane size="35%" name="sks-monitor"')
|
|
23
24
|
&& !built.layout_kdl.includes('zellij-lane')
|
|
24
25
|
&& !built.layout_kdl.includes('zellij-slot-pane')
|
|
25
|
-
&& (built.layout_kdl.match(/pane name="sks-viewport-/g) || []).length ===
|
|
26
|
+
&& (built.layout_kdl.match(/pane name="sks-viewport-/g) || []).length === 3
|
|
26
27
|
&& built.lane_dispatch_policy?.mode === 'jsonl_nonblocking'
|
|
27
28
|
&& built.lane_dispatch_policy?.fifo_policy === 'disabled_to_avoid_writer_blocking'
|
|
28
29
|
&& built.lane_dispatch_policy?.pane_transport === 'monitor_plus_viewports';
|
|
@@ -46,7 +47,7 @@ const kindsValidated = ['mad', 'agent', 'team', 'naruto'].map((kind) => {
|
|
|
46
47
|
const hasCodexPane = kind !== 'mad' || (b.main_pane_kind === 'codex_interactive' && /exec\s+'?codex'?/.test(b.layout_kdl) && b.layout_kdl.includes('sks-mad-high') && b.layout_kdl.includes('--no-alt-screen'));
|
|
47
48
|
const viewportPaneCount = (b.layout_kdl.match(/pane name="sks-viewport-/g) || []).length;
|
|
48
49
|
const noLanePane = !b.layout_kdl.includes('zellij-lane');
|
|
49
|
-
return { kind, ok: layoutMod.validateZellijLayoutKdl(b.layout_kdl).ok && hasCodexPane && noLanePane && viewportPaneCount ===
|
|
50
|
+
return { kind, ok: layoutMod.validateZellijLayoutKdl(b.layout_kdl).ok && hasCodexPane && noLanePane && viewportPaneCount === 3 && b.initial_worker_panes === 0 && b.viewport_count === 3, main_pane_kind: b.main_pane_kind, has_codex_pane: hasCodexPane, no_lane_pane: noLanePane, viewport_pane_count: viewportPaneCount };
|
|
50
51
|
});
|
|
51
52
|
const allKindsOk = kindsValidated.every((k) => k.ok);
|
|
52
53
|
const invalidValidation = layoutMod.validateZellijLayoutKdl('layout { pane command="zellij-lane" {');
|
|
@@ -55,28 +56,37 @@ const layoutPath = path.join(tmp, 'layout.kdl');
|
|
|
55
56
|
await fs.writeFile(layoutPath, built.layout_kdl, 'utf8');
|
|
56
57
|
const requireReal = process.env.SKS_REQUIRE_ZELLIJ === '1' || process.argv.includes('--require-real');
|
|
57
58
|
const capability = await capabilityMod.checkZellijCapability({ root, require: requireReal, writeReport: true });
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
const runId = `${process.pid}-${Date.now().toString(36)}-${randomBytes(3).toString('hex')}`;
|
|
60
|
+
const sessionName = `sks-layout-check-${runId}`;
|
|
61
|
+
const socketDir = path.join('/tmp', `sks-zj-layout-${runId}`);
|
|
62
|
+
const zellijEnv = { ZELLIJ_SOCKET_DIR: socketDir };
|
|
61
63
|
const realRun = capability.status === 'ok'
|
|
62
64
|
? {
|
|
63
|
-
create_background: await commandMod.runZellij(['attach', '--create-background', sessionName, 'options', '--default-layout', layoutPath], { cwd: root, timeoutMs: 5000, optional: !requireReal }),
|
|
65
|
+
create_background: await commandMod.runZellij(['attach', '--create-background', sessionName, 'options', '--default-layout', layoutPath], { cwd: root, env: zellijEnv, timeoutMs: 5000, optional: !requireReal }),
|
|
64
66
|
cleanup: null,
|
|
67
|
+
session_removed: false,
|
|
68
|
+
socket_dir_removed: false,
|
|
65
69
|
ok: false
|
|
66
70
|
}
|
|
67
71
|
: null;
|
|
68
72
|
if (realRun) {
|
|
69
|
-
realRun.cleanup = await commandMod.runZellij(['kill-session', sessionName], { cwd: root, timeoutMs: 5000, optional: true });
|
|
70
|
-
|
|
73
|
+
realRun.cleanup = await commandMod.runZellij(['kill-session', sessionName], { cwd: root, env: zellijEnv, timeoutMs: 5000, optional: true });
|
|
74
|
+
const remaining = await waitForSocketEntriesToClear(socketDir, 2000);
|
|
75
|
+
realRun.session_removed = !remaining.includes(sessionName);
|
|
76
|
+
if (remaining.length === 0)
|
|
77
|
+
await fs.rm(socketDir, { recursive: true, force: true });
|
|
78
|
+
realRun.socket_dir_removed = !(await exists(socketDir));
|
|
79
|
+
realRun.ok = realRun.create_background.ok === true && realRun.session_removed && realRun.socket_dir_removed;
|
|
71
80
|
}
|
|
72
81
|
const ok = staticValidation.ok
|
|
73
82
|
&& viewportLayoutOk
|
|
74
83
|
&& allKindsOk
|
|
75
84
|
&& layoutMod.validateZellijLayoutKdl(narutoFanoutLayout.layout_kdl).ok
|
|
76
|
-
&& narutoFanoutPaneCount ===
|
|
85
|
+
&& narutoFanoutPaneCount === 3
|
|
77
86
|
&& invalidValidation.ok === false
|
|
78
87
|
&& capability.ok
|
|
79
88
|
&& (requireReal ? realRun?.ok === true : true);
|
|
89
|
+
await fs.rm(tmp, { recursive: true, force: true });
|
|
80
90
|
emit({
|
|
81
91
|
schema: 'sks.zellij-layout-valid-check.v1',
|
|
82
92
|
ok,
|
|
@@ -88,10 +98,25 @@ emit({
|
|
|
88
98
|
invalid_fixture: invalidValidation,
|
|
89
99
|
capability,
|
|
90
100
|
real_run: realRun,
|
|
101
|
+
isolated_session: true,
|
|
102
|
+
socket_dir: socketDir,
|
|
103
|
+
temporary_layout_removed: !(await exists(tmp)),
|
|
91
104
|
integration_optional: !requireReal,
|
|
92
105
|
blockers: ok ? [] : ['zellij_layout_valid_check_failed']
|
|
93
106
|
});
|
|
94
107
|
function emit(report) { console.log(JSON.stringify(report, null, 2)); if (!report.ok)
|
|
95
108
|
process.exitCode = 1; }
|
|
96
109
|
function fail(blocker, detail) { emit({ schema: 'sks.zellij-layout-valid-check.v1', ok: false, blockers: [blocker], detail }); process.exit(1); }
|
|
110
|
+
async function waitForSocketEntriesToClear(socketDir, timeoutMs) {
|
|
111
|
+
const deadline = Date.now() + timeoutMs;
|
|
112
|
+
for (;;) {
|
|
113
|
+
const entries = await fs.readdir(path.join(socketDir, 'contract_version_1')).catch(() => []);
|
|
114
|
+
if (entries.length === 0 || Date.now() >= deadline)
|
|
115
|
+
return entries;
|
|
116
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
async function exists(value) {
|
|
120
|
+
return fs.access(value).then(() => true).catch(() => false);
|
|
121
|
+
}
|
|
97
122
|
//# sourceMappingURL=zellij-layout-valid-check.js.map
|
|
@@ -42,13 +42,44 @@ const codexLbOnlyMain = mod.evaluateZellijPaneProofRows(mod.normalizeZellijPaneR
|
|
|
42
42
|
{ pane_id: '1', name: 'orchestrator', command: 'sh -lc model_provider="codex-lb"', cwd: root, exited: false },
|
|
43
43
|
{ pane_id: '2', name: 'slot-001', command: 'sks zellij-lane --mission M --slot slot-001', cwd: root, exited: false }
|
|
44
44
|
]), { expectedLaneCount: 1, expectedCwd: root, expectedMainCommandIncludes: 'codex' });
|
|
45
|
+
const zellij044Rows = [
|
|
46
|
+
...Array.from({ length: 120 }, (_, index) => ({
|
|
47
|
+
id: index + 10,
|
|
48
|
+
is_plugin: true,
|
|
49
|
+
title: `zellij:fixture-${String(index).padStart(3, '0')}`,
|
|
50
|
+
terminal_command: null,
|
|
51
|
+
plugin_url: 'zellij:fixture',
|
|
52
|
+
tab_name: 'SKS fixture'
|
|
53
|
+
})),
|
|
54
|
+
{
|
|
55
|
+
id: 0,
|
|
56
|
+
is_plugin: false,
|
|
57
|
+
title: 'orchestrator',
|
|
58
|
+
exited: false,
|
|
59
|
+
exit_status: null,
|
|
60
|
+
pane_x: 0,
|
|
61
|
+
pane_y: 1,
|
|
62
|
+
pane_columns: 80,
|
|
63
|
+
pane_rows: 24,
|
|
64
|
+
terminal_command: "sh -lc exec 'codex' '--no-alt-screen'",
|
|
65
|
+
pane_command: `${path.join(root, 'node_modules', '.bin', 'codex')} --no-alt-screen`,
|
|
66
|
+
pane_cwd: root,
|
|
67
|
+
tab_name: 'SKS fixture'
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
const zellij044Json = JSON.stringify(zellij044Rows);
|
|
71
|
+
const zellij044Parsed = mod.parseZellijPaneRows(zellij044Json);
|
|
72
|
+
const zellij044Evaluation = mod.evaluateZellijPaneProofRows(mod.normalizeZellijPaneRows(zellij044Parsed), { expectedLaneCount: 0, expectedCwd: root, expectedMainCommandIncludes: 'codex' });
|
|
45
73
|
const fixtureOk = positive.blockers.length === 0
|
|
46
74
|
&& missingLane.blockers.includes('zellij_lane_pane_missing')
|
|
47
75
|
&& exitedLane.blockers.some((blocker) => blocker.startsWith('zellij_lane_pane_exited'))
|
|
48
76
|
&& madCodexMain.blockers.length === 0
|
|
49
77
|
&& madShellMain.blockers.includes('zellij_main_pane_unexpected_command:codex')
|
|
50
|
-
&& codexLbOnlyMain.blockers.includes('zellij_main_pane_unexpected_command:codex')
|
|
51
|
-
|
|
78
|
+
&& codexLbOnlyMain.blockers.includes('zellij_main_pane_unexpected_command:codex')
|
|
79
|
+
&& zellij044Json.length > 8192
|
|
80
|
+
&& zellij044Parsed.length === zellij044Rows.length
|
|
81
|
+
&& zellij044Evaluation.blockers.length === 0;
|
|
82
|
+
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 });
|
|
52
83
|
function emit(report) { console.log(JSON.stringify(report, null, 2)); if (!report.ok)
|
|
53
84
|
process.exitCode = 1; }
|
|
54
85
|
function fail(blocker, detail) { emit({ schema: 'sks.zellij-pane-proof-check.v1', ok: false, blockers: [blocker], detail }); process.exit(1); }
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// @ts-nocheck
|
|
3
|
+
import fs from 'node:fs/promises';
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
3
5
|
import path from 'node:path';
|
|
4
6
|
import { pathToFileURL } from 'node:url';
|
|
5
7
|
import { ensureDistFresh, root } from './lib/ensure-dist-fresh.js';
|
|
@@ -7,10 +9,96 @@ const freshness = ensureDistFresh({ rebuild: false });
|
|
|
7
9
|
if (!freshness.ok)
|
|
8
10
|
fail('dist_not_fresh', { freshness });
|
|
9
11
|
const args = process.argv.slice(2);
|
|
12
|
+
const missionId = readArg(args, '--mission');
|
|
10
13
|
const sessionName = readArg(args, '--session') || 'sks-real';
|
|
14
|
+
const socketDir = readArg(args, '--owned-socket-dir');
|
|
15
|
+
const ownerToken = String(process.env.SKS_ZELLIJ_CHECK_OWNER_TOKEN || '');
|
|
11
16
|
const command = await import(pathToFileURL(path.join(root, 'dist', 'core', 'zellij', 'zellij-command.js')).href);
|
|
12
|
-
const
|
|
13
|
-
|
|
17
|
+
const ownershipPath = missionId ? path.join(root, '.sneakoscope', 'missions', missionId, 'zellij-real-session-ownership.json') : null;
|
|
18
|
+
const expectedLayoutPath = missionId ? path.join(root, '.sneakoscope', 'layouts', `mad-${missionId}.kdl`) : null;
|
|
19
|
+
const ownership = ownershipPath ? await readJson(ownershipPath) : null;
|
|
20
|
+
const ownershipBlockers = [
|
|
21
|
+
...(!missionId ? ['zellij_cleanup_mission_missing'] : []),
|
|
22
|
+
...(!isSafeOwnedSocketDir(socketDir) ? ['zellij_cleanup_owned_socket_dir_invalid'] : []),
|
|
23
|
+
...(ownerToken.length < 32 ? ['zellij_cleanup_owner_token_missing'] : []),
|
|
24
|
+
...(!ownership ? ['zellij_cleanup_ownership_marker_missing'] : []),
|
|
25
|
+
...(ownership && ownership.schema !== 'sks.zellij-real-session-ownership.v1' ? ['zellij_cleanup_ownership_schema_invalid'] : []),
|
|
26
|
+
...(ownership && ownership.mission_id !== missionId ? ['zellij_cleanup_mission_mismatch'] : []),
|
|
27
|
+
...(ownership && ownership.session_name !== sessionName ? ['zellij_cleanup_session_mismatch'] : []),
|
|
28
|
+
...(ownership && path.resolve(String(ownership.socket_dir || '')) !== path.resolve(String(socketDir || '')) ? ['zellij_cleanup_socket_dir_mismatch'] : []),
|
|
29
|
+
...(ownership && ownership.owner_token_sha256 !== hashOwnerToken(ownerToken) ? ['zellij_cleanup_owner_token_mismatch'] : []),
|
|
30
|
+
...(ownership && ownership.cleanup_authorized !== true ? ['zellij_cleanup_not_authorized'] : []),
|
|
31
|
+
...(ownership && ownership.layout_cleanup_authorized !== true ? ['zellij_cleanup_layout_not_authorized'] : []),
|
|
32
|
+
...(ownership && path.resolve(String(ownership.layout_path || '')) !== path.resolve(String(expectedLayoutPath || '')) ? ['zellij_cleanup_layout_path_mismatch'] : [])
|
|
33
|
+
];
|
|
34
|
+
if (ownershipBlockers.length > 0) {
|
|
35
|
+
emit({
|
|
36
|
+
schema: 'sks.zellij-real-session-cleanup-check.v1',
|
|
37
|
+
ok: false,
|
|
38
|
+
mutation_attempted: false,
|
|
39
|
+
mission_id: missionId,
|
|
40
|
+
session_name: sessionName,
|
|
41
|
+
socket_dir: socketDir,
|
|
42
|
+
ownership_path: ownershipPath,
|
|
43
|
+
blockers: ownershipBlockers
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
const beforeEntries = await socketEntries(socketDir);
|
|
48
|
+
const result = await command.runZellij(['kill-session', sessionName], {
|
|
49
|
+
cwd: root,
|
|
50
|
+
env: { ZELLIJ_SOCKET_DIR: socketDir },
|
|
51
|
+
timeoutMs: 5000,
|
|
52
|
+
optional: true
|
|
53
|
+
});
|
|
54
|
+
const remainingEntries = await waitForSocketEntriesToClear(socketDir, 2000);
|
|
55
|
+
const sessionRemoved = !remainingEntries.includes(sessionName);
|
|
56
|
+
const socketExclusive = remainingEntries.length === 0;
|
|
57
|
+
const layoutPresentBefore = await exists(expectedLayoutPath);
|
|
58
|
+
const layoutSha256Before = layoutPresentBefore ? await sha256File(expectedLayoutPath) : null;
|
|
59
|
+
const layoutHashMatches = !layoutPresentBefore || !ownership.layout_sha256 || layoutSha256Before === ownership.layout_sha256;
|
|
60
|
+
let socketDirRemoved = false;
|
|
61
|
+
let layoutRemoved = false;
|
|
62
|
+
if (sessionRemoved && socketExclusive) {
|
|
63
|
+
await fs.rm(socketDir, { recursive: true, force: true });
|
|
64
|
+
socketDirRemoved = !(await exists(socketDir));
|
|
65
|
+
if (socketDirRemoved && layoutHashMatches) {
|
|
66
|
+
await fs.rm(expectedLayoutPath, { force: true });
|
|
67
|
+
layoutRemoved = !(await exists(expectedLayoutPath));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const blockers = [
|
|
71
|
+
...(!sessionRemoved ? ['zellij_cleanup_session_still_present'] : []),
|
|
72
|
+
...(!socketExclusive ? ['zellij_cleanup_owned_socket_dir_not_empty'] : []),
|
|
73
|
+
...(!socketDirRemoved ? ['zellij_cleanup_socket_dir_not_removed'] : []),
|
|
74
|
+
...(!layoutHashMatches ? ['zellij_cleanup_layout_hash_mismatch'] : []),
|
|
75
|
+
...(!layoutRemoved ? ['zellij_cleanup_layout_not_removed'] : [])
|
|
76
|
+
];
|
|
77
|
+
const report = {
|
|
78
|
+
schema: 'sks.zellij-real-session-cleanup-check.v1',
|
|
79
|
+
ok: blockers.length === 0,
|
|
80
|
+
mutation_attempted: true,
|
|
81
|
+
mission_id: missionId,
|
|
82
|
+
session_name: sessionName,
|
|
83
|
+
socket_dir: socketDir,
|
|
84
|
+
ownership_path: ownershipPath,
|
|
85
|
+
session_present_before: beforeEntries.includes(sessionName),
|
|
86
|
+
session_removed: sessionRemoved,
|
|
87
|
+
socket_dir_exclusive: socketExclusive,
|
|
88
|
+
socket_dir_removed: socketDirRemoved,
|
|
89
|
+
layout_path: expectedLayoutPath,
|
|
90
|
+
layout_sha256: ownership.layout_sha256 || null,
|
|
91
|
+
layout_sha256_before_cleanup: layoutSha256Before,
|
|
92
|
+
layout_hash_matches: layoutHashMatches,
|
|
93
|
+
layout_removed: layoutRemoved,
|
|
94
|
+
remaining_socket_entries: remainingEntries,
|
|
95
|
+
result,
|
|
96
|
+
blockers,
|
|
97
|
+
warnings: result.ok ? [] : ['zellij_kill_session_nonzero_but_absence_verified']
|
|
98
|
+
};
|
|
99
|
+
await fs.writeFile(path.join(root, '.sneakoscope', 'missions', missionId, 'zellij-real-session-cleanup.json'), `${JSON.stringify(report, null, 2)}\n`);
|
|
100
|
+
emit(report);
|
|
101
|
+
}
|
|
14
102
|
function emit(report) { console.log(JSON.stringify(report, null, 2)); if (!report.ok)
|
|
15
103
|
process.exitCode = 1; }
|
|
16
104
|
function fail(blocker, detail) { emit({ schema: 'sks.zellij-real-session-cleanup-check.v1', ok: false, blockers: [blocker], detail }); process.exit(1); }
|
|
@@ -18,4 +106,36 @@ function readArg(args, name) {
|
|
|
18
106
|
const index = args.indexOf(name);
|
|
19
107
|
return index >= 0 ? args[index + 1] || null : null;
|
|
20
108
|
}
|
|
109
|
+
function hashOwnerToken(value) {
|
|
110
|
+
return createHash('sha256').update(String(value)).digest('hex');
|
|
111
|
+
}
|
|
112
|
+
async function sha256File(file) {
|
|
113
|
+
return fs.readFile(file).then((data) => createHash('sha256').update(data).digest('hex')).catch(() => null);
|
|
114
|
+
}
|
|
115
|
+
function isSafeOwnedSocketDir(value) {
|
|
116
|
+
if (!value)
|
|
117
|
+
return false;
|
|
118
|
+
const resolved = path.resolve(String(value));
|
|
119
|
+
return path.dirname(resolved) === '/tmp' && /^sks-zj-rr-[A-Za-z0-9-]+$/.test(path.basename(resolved));
|
|
120
|
+
}
|
|
121
|
+
async function readJson(file) {
|
|
122
|
+
return fs.readFile(file, 'utf8').then((text) => JSON.parse(text)).catch(() => null);
|
|
123
|
+
}
|
|
124
|
+
async function socketEntries(socketDir) {
|
|
125
|
+
if (!socketDir)
|
|
126
|
+
return [];
|
|
127
|
+
return fs.readdir(path.join(socketDir, 'contract_version_1')).catch(() => []);
|
|
128
|
+
}
|
|
129
|
+
async function waitForSocketEntriesToClear(socketDir, timeoutMs) {
|
|
130
|
+
const deadline = Date.now() + timeoutMs;
|
|
131
|
+
for (;;) {
|
|
132
|
+
const entries = await socketEntries(socketDir);
|
|
133
|
+
if (entries.length === 0 || Date.now() >= deadline)
|
|
134
|
+
return entries;
|
|
135
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async function exists(value) {
|
|
139
|
+
return fs.access(value).then(() => true).catch(() => false);
|
|
140
|
+
}
|
|
21
141
|
//# sourceMappingURL=zellij-real-session-cleanup-check.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
import fs from 'node:fs/promises';
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
4
5
|
import path from 'node:path';
|
|
5
6
|
import { pathToFileURL } from 'node:url';
|
|
6
7
|
import { ensureDistFresh, root } from './lib/ensure-dist-fresh.js';
|
|
@@ -8,15 +9,47 @@ const freshness = ensureDistFresh({ rebuild: true });
|
|
|
8
9
|
if (!freshness.ok)
|
|
9
10
|
fail('dist_not_fresh', { freshness });
|
|
10
11
|
const args = process.argv.slice(2);
|
|
11
|
-
const
|
|
12
|
-
const
|
|
12
|
+
const runSuffix = `${process.pid}-${Date.now().toString(36)}`;
|
|
13
|
+
const missionId = readArg(args, '--mission') || `M-zellij-real-check-${runSuffix}`;
|
|
14
|
+
const sessionName = readArg(args, '--session') || `sks-real-${runSuffix}`;
|
|
13
15
|
const requireReal = process.env.SKS_REQUIRE_ZELLIJ === '1' || args.includes('--require-real');
|
|
14
16
|
const mainOnly = args.includes('--main-only') || process.env.SKS_ZELLIJ_MAIN_ONLY === '1';
|
|
17
|
+
const ownedSession = args.includes('--owned-session');
|
|
18
|
+
const ownerToken = String(process.env.SKS_ZELLIJ_CHECK_OWNER_TOKEN || '');
|
|
15
19
|
const launcher = await import(pathToFileURL(path.join(root, 'dist', 'core', 'zellij', 'zellij-launcher.js')).href);
|
|
16
20
|
const command = await import(pathToFileURL(path.join(root, 'dist', 'core', 'zellij', 'zellij-command.js')).href);
|
|
17
21
|
const screenProof = await import(pathToFileURL(path.join(root, 'dist', 'core', 'zellij', 'zellij-screen-proof.js')).href);
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
const socketDir = command.resolveZellijProcessEnvMeta().zellij_socket_dir;
|
|
23
|
+
const missionRoot = path.join(root, '.sneakoscope', 'missions', missionId);
|
|
24
|
+
const ownershipPath = path.join(missionRoot, 'zellij-real-session-ownership.json');
|
|
25
|
+
const expectedLayoutPath = path.join(root, '.sneakoscope', 'layouts', `mad-${missionId}.kdl`);
|
|
26
|
+
let ownership = null;
|
|
27
|
+
if (ownedSession) {
|
|
28
|
+
if (!isSafeOwnedSocketDir(socketDir))
|
|
29
|
+
fail('zellij_owned_socket_dir_invalid', { socket_dir: socketDir });
|
|
30
|
+
if (ownerToken.length < 32)
|
|
31
|
+
fail('zellij_owner_token_missing', { owner_token_present: ownerToken.length > 0 });
|
|
32
|
+
const [markerExists, socketExists] = await Promise.all([exists(ownershipPath), exists(socketDir)]);
|
|
33
|
+
if (markerExists)
|
|
34
|
+
fail('zellij_ownership_marker_collision', { ownership_path: ownershipPath });
|
|
35
|
+
if (socketExists)
|
|
36
|
+
fail('zellij_owned_socket_dir_collision', { socket_dir: socketDir });
|
|
37
|
+
ownership = {
|
|
38
|
+
schema: 'sks.zellij-real-session-ownership.v1',
|
|
39
|
+
mission_id: missionId,
|
|
40
|
+
session_name: sessionName,
|
|
41
|
+
socket_dir: socketDir,
|
|
42
|
+
owner_token_sha256: hashOwnerToken(ownerToken),
|
|
43
|
+
cleanup_authorized: true,
|
|
44
|
+
layout_cleanup_authorized: true,
|
|
45
|
+
layout_path: expectedLayoutPath,
|
|
46
|
+
layout_sha256: null,
|
|
47
|
+
state: 'prepared',
|
|
48
|
+
session_created: false
|
|
49
|
+
};
|
|
50
|
+
await fs.mkdir(missionRoot, { recursive: true });
|
|
51
|
+
await fs.writeFile(ownershipPath, `${JSON.stringify(ownership, null, 2)}\n`, { flag: 'wx', mode: 0o600 });
|
|
52
|
+
}
|
|
20
53
|
const report = await launcher.launchMadZellijUi(['--session', sessionName], {
|
|
21
54
|
root,
|
|
22
55
|
missionId,
|
|
@@ -25,21 +58,42 @@ const report = await launcher.launchMadZellijUi(['--session', sessionName], {
|
|
|
25
58
|
requireZellij: requireReal,
|
|
26
59
|
slotCount: 1
|
|
27
60
|
});
|
|
61
|
+
const sessionCollision = Array.isArray(report?.launch?.create_background?.warnings)
|
|
62
|
+
&& report.launch.create_background.warnings.some((warning) => String(warning).startsWith('zellij_session_already_exists:'));
|
|
63
|
+
const layoutPathValid = !ownedSession || path.resolve(String(report?.layout_path || '')) === path.resolve(expectedLayoutPath);
|
|
64
|
+
const layoutSha256 = ownedSession && layoutPathValid ? await sha256File(expectedLayoutPath) : null;
|
|
65
|
+
if (ownership) {
|
|
66
|
+
ownership = {
|
|
67
|
+
...ownership,
|
|
68
|
+
state: report?.launch?.create_background?.ok === true && !sessionCollision ? 'launched' : 'launch_failed',
|
|
69
|
+
session_created: report?.launch?.create_background?.ok === true && !sessionCollision,
|
|
70
|
+
layout_path_valid: layoutPathValid,
|
|
71
|
+
layout_sha256: layoutSha256,
|
|
72
|
+
launch_exit_code: report?.launch?.create_background?.exit_code ?? null
|
|
73
|
+
};
|
|
74
|
+
await fs.writeFile(ownershipPath, `${JSON.stringify(ownership, null, 2)}\n`, { mode: 0o600 });
|
|
75
|
+
}
|
|
28
76
|
const heartbeatPath = path.join(root, '.sneakoscope', 'missions', missionId, 'zellij-lane-renderer-heartbeat.jsonl');
|
|
29
77
|
const heartbeat = mainOnly
|
|
30
78
|
? { ok: true, heartbeat_present: false, waited_ms: 0, timeout_ms: 0, blocker: null, skipped: true }
|
|
31
79
|
: await screenProof.waitForLaneHeartbeat(heartbeatPath, { timeoutMs: 5000 });
|
|
32
80
|
const blockers = [
|
|
81
|
+
...(sessionCollision ? ['zellij_session_name_collision'] : []),
|
|
82
|
+
...(ownedSession && !layoutPathValid ? ['zellij_owned_layout_path_invalid'] : []),
|
|
83
|
+
...(ownedSession && !layoutSha256 ? ['zellij_owned_layout_hash_missing'] : []),
|
|
33
84
|
...(requireReal && report.ok !== true ? ['zellij_real_session_launch_failed'] : []),
|
|
34
85
|
...(requireReal && heartbeat.blocker ? [heartbeat.blocker] : [])
|
|
35
86
|
];
|
|
36
87
|
const gate = {
|
|
37
88
|
schema: 'sks.zellij-real-session-launch-check.v1',
|
|
38
|
-
ok: requireReal ? (report.ok === true && heartbeat.ok === true && blockers.length === 0) : report.ok === true,
|
|
89
|
+
ok: requireReal ? (report.ok === true && heartbeat.ok === true && blockers.length === 0) : (report.ok === true && blockers.length === 0),
|
|
39
90
|
integration_optional: !requireReal,
|
|
40
91
|
main_only: mainOnly,
|
|
41
92
|
mission_id: missionId,
|
|
42
93
|
session_name: sessionName,
|
|
94
|
+
owned_session: ownedSession,
|
|
95
|
+
ownership_path: ownership ? ownershipPath : null,
|
|
96
|
+
socket_dir: socketDir,
|
|
43
97
|
heartbeat: { path: heartbeatPath, present: heartbeat.heartbeat_present, waited_ms: heartbeat.waited_ms, timeout_ms: heartbeat.timeout_ms },
|
|
44
98
|
blockers,
|
|
45
99
|
report
|
|
@@ -54,4 +108,21 @@ function readArg(args, name) {
|
|
|
54
108
|
const index = args.indexOf(name);
|
|
55
109
|
return index >= 0 ? args[index + 1] || null : null;
|
|
56
110
|
}
|
|
111
|
+
function hashOwnerToken(value) {
|
|
112
|
+
return createHash('sha256').update(String(value)).digest('hex');
|
|
113
|
+
}
|
|
114
|
+
async function sha256File(file) {
|
|
115
|
+
return fs.readFile(file).then((data) => createHash('sha256').update(data).digest('hex')).catch(() => null);
|
|
116
|
+
}
|
|
117
|
+
function isSafeOwnedSocketDir(value) {
|
|
118
|
+
if (!value)
|
|
119
|
+
return false;
|
|
120
|
+
const resolved = path.resolve(String(value));
|
|
121
|
+
return path.dirname(resolved) === '/tmp' && /^sks-zj-rr-[A-Za-z0-9-]+$/.test(path.basename(resolved));
|
|
122
|
+
}
|
|
123
|
+
async function exists(value) {
|
|
124
|
+
if (!value)
|
|
125
|
+
return false;
|
|
126
|
+
return fs.access(value).then(() => true).catch(() => false);
|
|
127
|
+
}
|
|
57
128
|
//# sourceMappingURL=zellij-real-session-launch-check.js.map
|
|
@@ -15,7 +15,7 @@ const text = renderer.renderZellijSlotPane({
|
|
|
15
15
|
serviceTier: 'fast',
|
|
16
16
|
provider: 'codex-lb',
|
|
17
17
|
authMode: 'codex_lb_key',
|
|
18
|
-
model: 'gpt-5.
|
|
18
|
+
model: 'gpt-5.6-terra',
|
|
19
19
|
reasoningEffort: 'medium',
|
|
20
20
|
currentFile: 'src/core/foo.ts',
|
|
21
21
|
currentTask: 'Editing Zellij slot pane renderer',
|
|
@@ -56,7 +56,7 @@ await fs.writeFile(path.join(artifactDir, 'zellij-worker-pane.json'), JSON.strin
|
|
|
56
56
|
}, null, 2));
|
|
57
57
|
await fs.writeFile(path.join(artifactDir, 'codex-control-proof.json'), JSON.stringify({
|
|
58
58
|
config: {
|
|
59
|
-
model: 'gpt-5.
|
|
59
|
+
model: 'gpt-5.6-terra',
|
|
60
60
|
model_provider: 'codex-lb',
|
|
61
61
|
service_tier: 'fast',
|
|
62
62
|
model_reasoning_effort: 'medium'
|
|
@@ -134,10 +134,10 @@ const report = {
|
|
|
134
134
|
max_compact_lines: 14,
|
|
135
135
|
contains_slot: /┌─ slot-003/.test(text) && /slot-003/.test(text),
|
|
136
136
|
contains_status: /coding/.test(text),
|
|
137
|
-
contains_runtime: /gpt-5\.
|
|
137
|
+
contains_runtime: /gpt-5\.6-terra·fast/.test(text),
|
|
138
138
|
contains_files: /src\/core\/foo\.ts/.test(text),
|
|
139
139
|
contains_live_event: /renderer updated live pane output/.test(text),
|
|
140
|
-
artifact_hydrates_runtime: /gpt-5\.
|
|
140
|
+
artifact_hydrates_runtime: /gpt-5\.6-terra·fast/.test(hydrated),
|
|
141
141
|
artifact_hydrates_live_event: /renderer stdout tail/.test(hydrated),
|
|
142
142
|
artifact_hydrates_planned_file: /zellij-slot-pane-renderer\.ts/.test(hydrated),
|
|
143
143
|
mission_live_telemetry_wins: /mission telemetry stale fixture/.test(missionHydrated) && /renderer stdout tail/.test(missionHydrated),
|
|
@@ -5,7 +5,7 @@ import { packageRoot } from '../core/fsx.js';
|
|
|
5
5
|
import { buildZellijLayoutKdl, validateZellijLayoutKdl, writeZellijLayout } from '../core/zellij/zellij-layout-builder.js';
|
|
6
6
|
const root = packageRoot();
|
|
7
7
|
const tmpRoot = path.join(root, '.sneakoscope', 'tmp', 'spawn-on-demand-layout-check');
|
|
8
|
-
process.env.SKS_ZELLIJ_VIEWPORTS = '
|
|
8
|
+
process.env.SKS_ZELLIJ_VIEWPORTS = '3';
|
|
9
9
|
const built = buildZellijLayoutKdl({ missionId: 'M-spawn-on-demand-layout', ledgerRoot: tmpRoot, cwd: root, kind: 'naruto', slotCount: 24 });
|
|
10
10
|
const validation = validateZellijLayoutKdl(built.layout_kdl);
|
|
11
11
|
const writeBuilt = await writeZellijLayout(root, { missionId: 'M-spawn-on-demand-layout-write', ledgerRoot: tmpRoot, cwd: root, kind: 'agent', slotCount: 5 });
|
|
@@ -15,11 +15,11 @@ const viewportPaneMatches = built.layout_kdl.match(/pane name="sks-viewport-/g)
|
|
|
15
15
|
const laneCommandMatches = built.layout_kdl.match(/\bzellij-lane\b/g) || [];
|
|
16
16
|
const ok = validation.ok
|
|
17
17
|
&& built.initial_worker_panes === 0
|
|
18
|
-
&& built.viewport_count ===
|
|
18
|
+
&& built.viewport_count === 3
|
|
19
19
|
&& built.ui_architecture === 'monitor_plus_viewports'
|
|
20
20
|
&& built.lane_runtime_policies.length === 0
|
|
21
21
|
&& workerPaneMatches.length === 0
|
|
22
|
-
&& viewportPaneMatches.length ===
|
|
22
|
+
&& viewportPaneMatches.length === 3
|
|
23
23
|
&& laneCommandMatches.length === 0
|
|
24
24
|
&& manifest.lanes.length === 0
|
|
25
25
|
&& writeBuilt.initial_worker_panes === 0;
|
package/docs/demo.tape
CHANGED
|
@@ -23,6 +23,6 @@ Type "sks ui --once"
|
|
|
23
23
|
Enter
|
|
24
24
|
Sleep 1s
|
|
25
25
|
|
|
26
|
-
Type "sks naruto run \"demo
|
|
26
|
+
Type "sks naruto run \"demo official subagent workflow\" --agents 4 --max-threads 4 --json"
|
|
27
27
|
Enter
|
|
28
28
|
Sleep 2s
|