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
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { sha256 } from '../fsx.js';
|
|
2
|
+
import { normalizeSubagentParentSummary } from '../subagents/subagent-evidence.js';
|
|
3
|
+
import { appendZellijSlotTelemetry, readZellijSlotTelemetrySnapshotNoRebuild } from './zellij-slot-telemetry.js';
|
|
4
|
+
export const SKS_ZELLIJ_HOST_MISSION_ENV = 'SKS_ZELLIJ_HOST_MISSION_ID';
|
|
5
|
+
export async function recordOfficialSubagentZellijTelemetry(input) {
|
|
6
|
+
const threadId = String(input.event?.thread_id || '').trim();
|
|
7
|
+
if (!threadId)
|
|
8
|
+
return { written: false, mission_ids: [], blocker: 'official_subagent_thread_id_missing' };
|
|
9
|
+
const missionIds = officialSubagentTelemetryMissionIds(input.routeMissionId, input.env);
|
|
10
|
+
if (!missionIds.length)
|
|
11
|
+
return { written: false, mission_ids: [], blocker: 'official_subagent_telemetry_mission_missing' };
|
|
12
|
+
const payload = objectValue(input.payload);
|
|
13
|
+
const plan = objectValue(input.plan);
|
|
14
|
+
const role = resolveRole(payload, plan);
|
|
15
|
+
const rolePolicy = objectValue(objectValue(plan.agents)[role]);
|
|
16
|
+
const model = firstText(input.event.model, payload.model, rolePolicy.model) || 'unknown';
|
|
17
|
+
const reasoning = firstText(payload.model_reasoning_effort, payload.reasoning_effort, payload.reasoningEffort, rolePolicy.model_reasoning_effort) || 'unknown';
|
|
18
|
+
const provider = firstText(payload.provider, payload.model_provider, payload.modelProvider) || 'unknown';
|
|
19
|
+
const serviceTier = firstText(payload.service_tier, payload.serviceTier) || 'unknown';
|
|
20
|
+
const stopped = input.event.event_name === 'SubagentStop';
|
|
21
|
+
const slotId = officialSubagentSlotId(threadId);
|
|
22
|
+
const latest = await latestThreadSlot(input.root, missionIds, threadId);
|
|
23
|
+
const generationIndex = stopped
|
|
24
|
+
? latest?.generation_index || 1
|
|
25
|
+
: latest && isTerminal(latest.status) ? latest.generation_index + 1 : latest?.generation_index || 1;
|
|
26
|
+
const nickname = firstText(payload.nickname, payload.display_name, payload.displayName, payload.agent_name, payload.agentName);
|
|
27
|
+
const summary = boundedText(firstText(payload.last_assistant_message, payload.lastAssistantMessage, payload.summary, payload.result), 1200);
|
|
28
|
+
const explicitTaskTitle = boundedText(firstText(payload.task_title, payload.taskTitle, payload.task, nickname ? `${nickname} (${role})` : null), 240);
|
|
29
|
+
const taskTitle = stopped ? explicitTaskTitle : explicitTaskTitle || `${role} active`;
|
|
30
|
+
const lifecycleEvent = {
|
|
31
|
+
schema: 'sks.zellij-slot-telemetry-event.v1',
|
|
32
|
+
ts: input.event.occurred_at,
|
|
33
|
+
slot_id: slotId,
|
|
34
|
+
generation_index: generationIndex,
|
|
35
|
+
worker_id: threadId,
|
|
36
|
+
event_type: stopped ? 'verification_started' : 'worker_spawned',
|
|
37
|
+
status: stopped ? 'verifying' : 'running',
|
|
38
|
+
role,
|
|
39
|
+
backend: 'official-codex-subagent',
|
|
40
|
+
provider,
|
|
41
|
+
service_tier: serviceTier,
|
|
42
|
+
model,
|
|
43
|
+
reasoning_effort: reasoning,
|
|
44
|
+
task_id: threadId,
|
|
45
|
+
...(taskTitle ? { task_title: taskTitle } : {}),
|
|
46
|
+
current_file: null,
|
|
47
|
+
...(!stopped ? { spawned_at: input.event.occurred_at } : {}),
|
|
48
|
+
artifact_paths: routeArtifactPaths(input.routeMissionId),
|
|
49
|
+
log_tail: summary || `${stopped ? 'SubagentStop received; parent verdict pending' : 'Started'} · ${role} · ${model}/${reasoning}`,
|
|
50
|
+
blockers: stopped && input.event.outcome !== 'stopped' ? [`awaiting_parent_verdict:${input.event.outcome}`] : []
|
|
51
|
+
};
|
|
52
|
+
const appendResult = await appendToMissions(input.root, missionIds, lifecycleEvent);
|
|
53
|
+
return {
|
|
54
|
+
written: appendResult.written_mission_ids.length > 0,
|
|
55
|
+
mission_ids: missionIds,
|
|
56
|
+
written_mission_ids: appendResult.written_mission_ids,
|
|
57
|
+
failed_mission_ids: appendResult.failed_mission_ids,
|
|
58
|
+
...(appendResult.failed_mission_ids.length > 0
|
|
59
|
+
? { blocker: appendResult.written_mission_ids.length > 0 ? 'official_subagent_telemetry_partial_write' : 'official_subagent_telemetry_write_failed' }
|
|
60
|
+
: {}),
|
|
61
|
+
slot_id: slotId,
|
|
62
|
+
generation_index: generationIndex,
|
|
63
|
+
status: lifecycleEvent.status,
|
|
64
|
+
role,
|
|
65
|
+
model
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export async function recordOfficialSubagentParentOutcomesTelemetry(input) {
|
|
69
|
+
const normalized = normalizeSubagentParentSummary(input.parentSummary);
|
|
70
|
+
const parent = normalized.raw;
|
|
71
|
+
if (!normalized.trustworthy || !parent) {
|
|
72
|
+
return { written: false, mission_ids: [], blocker: 'trustworthy_parent_summary_missing' };
|
|
73
|
+
}
|
|
74
|
+
const plan = objectValue(input.plan);
|
|
75
|
+
const activeRunId = firstText(plan.workflow_run_id, plan.run_id);
|
|
76
|
+
if (activeRunId && parent.run_id !== activeRunId) {
|
|
77
|
+
return { written: false, mission_ids: [], blocker: 'parent_summary_run_id_mismatch' };
|
|
78
|
+
}
|
|
79
|
+
const missionIds = officialSubagentTelemetryMissionIds(input.routeMissionId, input.env);
|
|
80
|
+
const rows = Array.isArray(parent.thread_outcomes) ? parent.thread_outcomes : [];
|
|
81
|
+
if (!missionIds.length || !rows.length) {
|
|
82
|
+
return { written: false, mission_ids: missionIds, blocker: rows.length ? 'official_subagent_telemetry_mission_missing' : 'parent_thread_outcomes_missing' };
|
|
83
|
+
}
|
|
84
|
+
const written = [];
|
|
85
|
+
const skipped = [];
|
|
86
|
+
const alreadyApplied = [];
|
|
87
|
+
const successfulThreadIds = [];
|
|
88
|
+
const failedWrites = [];
|
|
89
|
+
for (const outcome of rows) {
|
|
90
|
+
const threadId = String(outcome?.thread_id || '').trim();
|
|
91
|
+
if (!threadId)
|
|
92
|
+
continue;
|
|
93
|
+
for (const missionId of missionIds) {
|
|
94
|
+
const latest = await latestThreadSlotForMission(input.root, missionId, threadId);
|
|
95
|
+
const stopFailureBlocker = failedOrAmbiguousStopBlocker(latest?.blockers);
|
|
96
|
+
// SubagentStop has no trustworthy success status of its own, but a
|
|
97
|
+
// normalized failed/ambiguous outcome is still negative evidence. A
|
|
98
|
+
// structurally valid parent summary must not erase that evidence by
|
|
99
|
+
// declaring the same thread completed. Surface the contradiction as a
|
|
100
|
+
// failed slot so the CLI/Zellij observer remains fail closed.
|
|
101
|
+
const completed = outcome.status === 'completed' && !stopFailureBlocker;
|
|
102
|
+
const desiredStatus = completed ? 'completed' : 'failed';
|
|
103
|
+
if (latest?.status === desiredStatus) {
|
|
104
|
+
alreadyApplied.push(`${missionId}:${threadId}`);
|
|
105
|
+
successfulThreadIds.push(threadId);
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (!latest || latest.status !== 'verifying') {
|
|
109
|
+
skipped.push(`${missionId}:${threadId}`);
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
const role = latest.role || singleSuggestedAgent(plan) || 'official_subagent';
|
|
113
|
+
const parentOutcomeConflict = outcome.status === 'completed' && Boolean(stopFailureBlocker);
|
|
114
|
+
const event = {
|
|
115
|
+
schema: 'sks.zellij-slot-telemetry-event.v1',
|
|
116
|
+
ts: new Date().toISOString(),
|
|
117
|
+
mission_id: missionId,
|
|
118
|
+
slot_id: officialSubagentSlotId(threadId),
|
|
119
|
+
generation_index: latest.generation_index || 1,
|
|
120
|
+
worker_id: threadId,
|
|
121
|
+
event_type: completed ? 'verification_passed' : 'verification_failed',
|
|
122
|
+
status: desiredStatus,
|
|
123
|
+
role,
|
|
124
|
+
backend: latest.backend || 'official-codex-subagent',
|
|
125
|
+
provider: latest.provider || 'unknown',
|
|
126
|
+
service_tier: latest.service_tier || 'unknown',
|
|
127
|
+
model: latest.model || modelForRole(plan, role) || 'unknown',
|
|
128
|
+
reasoning_effort: latest.reasoning_effort || reasoningForRole(plan, role) || 'unknown',
|
|
129
|
+
task_id: threadId,
|
|
130
|
+
task_title: boundedText(latest.task_title || `${role} parent verdict`, 240) || `${role} parent verdict`,
|
|
131
|
+
current_file: latest.current_file || null,
|
|
132
|
+
artifact_paths: routeArtifactPaths(input.routeMissionId),
|
|
133
|
+
log_tail: parentOutcomeConflict
|
|
134
|
+
? `${role}: completed parent verdict rejected because ${stopFailureBlocker}`
|
|
135
|
+
: boundedText(outcome.summary, 1200) || `${role}: ${outcome.status}`,
|
|
136
|
+
blockers: completed
|
|
137
|
+
? []
|
|
138
|
+
: parentOutcomeConflict
|
|
139
|
+
? [String(stopFailureBlocker), 'parent_thread_outcome_conflict:completed']
|
|
140
|
+
: [`parent_thread_outcome:${outcome.status}`]
|
|
141
|
+
};
|
|
142
|
+
try {
|
|
143
|
+
await appendZellijSlotTelemetry(input.root, event);
|
|
144
|
+
written.push(`${missionId}:${threadId}`);
|
|
145
|
+
successfulThreadIds.push(threadId);
|
|
146
|
+
}
|
|
147
|
+
catch (err) {
|
|
148
|
+
failedWrites.push({ mission_id: missionId, thread_id: threadId, error: boundedText(err?.message || String(err), 320) || 'telemetry_write_failed' });
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
written: written.length > 0 || alreadyApplied.length > 0,
|
|
154
|
+
mission_ids: missionIds,
|
|
155
|
+
thread_ids: unique(successfulThreadIds),
|
|
156
|
+
written_mission_threads: written,
|
|
157
|
+
already_applied_mission_threads: alreadyApplied,
|
|
158
|
+
skipped_thread_ids: skipped,
|
|
159
|
+
failed_writes: failedWrites,
|
|
160
|
+
failed_mission_ids: unique(failedWrites.map((row) => row.mission_id)),
|
|
161
|
+
...(failedWrites.length > 0
|
|
162
|
+
? { blocker: written.length > 0 || alreadyApplied.length > 0 ? 'official_subagent_parent_telemetry_partial_write' : 'official_subagent_parent_telemetry_write_failed' }
|
|
163
|
+
: written.length === 0 && alreadyApplied.length === 0 && skipped.length > 0
|
|
164
|
+
? { blocker: 'subagent_stop_telemetry_missing' }
|
|
165
|
+
: {})
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
export function officialSubagentTelemetryMissionIds(routeMissionId, env = process.env) {
|
|
169
|
+
return unique([
|
|
170
|
+
safeMissionId(routeMissionId),
|
|
171
|
+
safeMissionId(env[SKS_ZELLIJ_HOST_MISSION_ENV])
|
|
172
|
+
]);
|
|
173
|
+
}
|
|
174
|
+
export function officialSubagentSlotId(threadId) {
|
|
175
|
+
return `sub-${sha256(String(threadId || '')).slice(0, 8)}`;
|
|
176
|
+
}
|
|
177
|
+
async function appendToMissions(root, missionIds, event) {
|
|
178
|
+
const results = await Promise.allSettled(missionIds.map((missionId) => appendZellijSlotTelemetry(root, { ...event, mission_id: missionId })));
|
|
179
|
+
return {
|
|
180
|
+
written_mission_ids: missionIds.filter((_missionId, index) => results[index]?.status === 'fulfilled'),
|
|
181
|
+
failed_mission_ids: missionIds.filter((_missionId, index) => results[index]?.status === 'rejected')
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
async function latestThreadSlot(root, missionIds, threadId) {
|
|
185
|
+
let latest = null;
|
|
186
|
+
for (const missionId of missionIds) {
|
|
187
|
+
const snapshot = await readZellijSlotTelemetrySnapshotNoRebuild(root, missionId).catch(() => null);
|
|
188
|
+
for (const row of Object.values(snapshot?.slots || {})) {
|
|
189
|
+
if (row.worker_id !== threadId)
|
|
190
|
+
continue;
|
|
191
|
+
if (!latest || row.generation_index > latest.generation_index || Date.parse(row.latest_ts) > Date.parse(latest.latest_ts))
|
|
192
|
+
latest = row;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return latest;
|
|
196
|
+
}
|
|
197
|
+
async function latestThreadSlotForMission(root, missionId, threadId) {
|
|
198
|
+
const snapshot = await readZellijSlotTelemetrySnapshotNoRebuild(root, missionId).catch(() => null);
|
|
199
|
+
let latest = null;
|
|
200
|
+
for (const row of Object.values(snapshot?.slots || {})) {
|
|
201
|
+
if (row.worker_id !== threadId)
|
|
202
|
+
continue;
|
|
203
|
+
if (!latest || row.generation_index > latest.generation_index || Date.parse(row.latest_ts) > Date.parse(latest.latest_ts))
|
|
204
|
+
latest = row;
|
|
205
|
+
}
|
|
206
|
+
return latest;
|
|
207
|
+
}
|
|
208
|
+
function resolveRole(payload, plan) {
|
|
209
|
+
return firstText(payload.agent_type, payload.agentType, payload.custom_agent, payload.customAgent, payload.role, payload.name, singleSuggestedAgent(plan)) || 'official_subagent';
|
|
210
|
+
}
|
|
211
|
+
function singleSuggestedAgent(plan) {
|
|
212
|
+
const suggested = Array.isArray(plan.suggested_agents) ? plan.suggested_agents.map(String).filter(Boolean) : [];
|
|
213
|
+
return suggested.length === 1 ? suggested[0] || null : null;
|
|
214
|
+
}
|
|
215
|
+
function modelForRole(plan, role) {
|
|
216
|
+
return firstText(objectValue(objectValue(plan).agents)[role]?.model);
|
|
217
|
+
}
|
|
218
|
+
function reasoningForRole(plan, role) {
|
|
219
|
+
return firstText(objectValue(objectValue(plan).agents)[role]?.model_reasoning_effort);
|
|
220
|
+
}
|
|
221
|
+
function routeArtifactPaths(missionId) {
|
|
222
|
+
const mission = safeMissionId(missionId);
|
|
223
|
+
if (!mission)
|
|
224
|
+
return [];
|
|
225
|
+
const base = `.sneakoscope/missions/${mission}`;
|
|
226
|
+
return [`${base}/subagent-plan.json`, `${base}/subagent-events.jsonl`, `${base}/subagent-evidence.json`];
|
|
227
|
+
}
|
|
228
|
+
function isTerminal(status) {
|
|
229
|
+
return ['completed', 'failed', 'drained'].includes(String(status || '').toLowerCase());
|
|
230
|
+
}
|
|
231
|
+
function failedOrAmbiguousStopBlocker(blockers) {
|
|
232
|
+
if (!Array.isArray(blockers))
|
|
233
|
+
return null;
|
|
234
|
+
return blockers
|
|
235
|
+
.map((value) => String(value || '').trim())
|
|
236
|
+
.find((value) => /^awaiting_parent_verdict:(failed|ambiguous)$/.test(value)) || null;
|
|
237
|
+
}
|
|
238
|
+
function safeMissionId(value) {
|
|
239
|
+
const text = String(value || '').trim();
|
|
240
|
+
if (!text || !/^[A-Za-z0-9._:-]+$/.test(text))
|
|
241
|
+
return '';
|
|
242
|
+
return text;
|
|
243
|
+
}
|
|
244
|
+
function boundedText(value, max) {
|
|
245
|
+
const text = String(value || '').replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, '').replace(/\s+/g, ' ').trim();
|
|
246
|
+
if (!text)
|
|
247
|
+
return null;
|
|
248
|
+
return text.length > max ? `${text.slice(0, Math.max(0, max - 1))}…` : text;
|
|
249
|
+
}
|
|
250
|
+
function firstText(...values) {
|
|
251
|
+
for (const value of values) {
|
|
252
|
+
const text = String(value || '').replace(/\s+/g, ' ').trim();
|
|
253
|
+
if (text)
|
|
254
|
+
return text;
|
|
255
|
+
}
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
258
|
+
function objectValue(value) {
|
|
259
|
+
return value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
260
|
+
}
|
|
261
|
+
function unique(values) {
|
|
262
|
+
return [...new Set(values.map(String).filter(Boolean))];
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=zellij-official-subagent-telemetry.js.map
|
|
@@ -2,7 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
import { nowIso, readJson, writeJsonAtomic } from '../fsx.js';
|
|
3
3
|
import { reconcileZellijLaneSupervisorPaneIds } from '../agents/zellij-lane-supervisor.js';
|
|
4
4
|
import { checkZellijCapability } from './zellij-capability.js';
|
|
5
|
-
import { runZellij } from './zellij-command.js';
|
|
5
|
+
import { runZellij, zellijCommandStdout } from './zellij-command.js';
|
|
6
6
|
export const ZELLIJ_PANE_PROOF_SCHEMA = 'sks.zellij-pane-proof.v1';
|
|
7
7
|
export async function writeZellijPaneProof(root, opts = {}) {
|
|
8
8
|
const outRoot = path.resolve(opts.ledgerRoot || (opts.missionId ? path.join(root, '.sneakoscope', 'missions', opts.missionId) : path.join(root, '.sneakoscope', 'reports')));
|
|
@@ -13,10 +13,31 @@ export async function writeZellijPaneProof(root, opts = {}) {
|
|
|
13
13
|
const command = sessionName
|
|
14
14
|
? ['--session', sessionName, 'action', 'list-panes', '--json', '--all']
|
|
15
15
|
: ['action', 'list-panes', '--json', '--all'];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
16
|
+
let paneRun = null;
|
|
17
|
+
let rawRows = [];
|
|
18
|
+
const probeAttempts = [];
|
|
19
|
+
const maxProbeAttempts = opts.phase === 'post_launch' && opts.require === true ? 8 : 1;
|
|
20
|
+
if (capability.status === 'ok') {
|
|
21
|
+
for (let attempt = 1; attempt <= maxProbeAttempts; attempt += 1) {
|
|
22
|
+
paneRun = await runZellij(command, {
|
|
23
|
+
cwd: root,
|
|
24
|
+
timeoutMs: 5000,
|
|
25
|
+
maxOutputBytes: 1024 * 1024,
|
|
26
|
+
optional: opts.require !== true
|
|
27
|
+
});
|
|
28
|
+
rawRows = parseZellijPaneRows(zellijCommandStdout(paneRun));
|
|
29
|
+
probeAttempts.push({
|
|
30
|
+
attempt,
|
|
31
|
+
ok: paneRun.ok,
|
|
32
|
+
pane_count: rawRows.length,
|
|
33
|
+
duration_ms: paneRun.duration_ms,
|
|
34
|
+
output_truncated: paneRun.output_truncated
|
|
35
|
+
});
|
|
36
|
+
if (rawRows.length > 0 || !paneRun.ok || attempt === maxProbeAttempts)
|
|
37
|
+
break;
|
|
38
|
+
await delay(Math.min(400, 75 * attempt));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
20
41
|
const paneRows = normalizeZellijPaneRows(rawRows);
|
|
21
42
|
const evaluationOpts = { expectedCwd: opts.expectedCwd || root };
|
|
22
43
|
if (opts.expectedLaneCount !== undefined)
|
|
@@ -37,6 +58,7 @@ export async function writeZellijPaneProof(root, opts = {}) {
|
|
|
37
58
|
const blockers = [
|
|
38
59
|
...capability.blockers,
|
|
39
60
|
...(opts.require === true && paneRun && !paneRun.ok ? paneRun.blockers.map((blocker) => `zellij_pane_${blocker}`) : []),
|
|
61
|
+
...(opts.require === true && paneRun?.output_truncated ? ['zellij_pane_output_truncated'] : []),
|
|
40
62
|
...(opts.require === true && capability.status === 'ok' && paneRows.length === 0 ? ['zellij_no_panes_listed'] : []),
|
|
41
63
|
...(opts.require === true ? evaluation.blockers : [])
|
|
42
64
|
];
|
|
@@ -58,6 +80,7 @@ export async function writeZellijPaneProof(root, opts = {}) {
|
|
|
58
80
|
geometry_distinct: evaluation.geometry_distinct,
|
|
59
81
|
pane_id_reconciliation: paneIdReconciliation,
|
|
60
82
|
panes: paneRows,
|
|
83
|
+
probe_attempts: probeAttempts,
|
|
61
84
|
command: ['zellij', ...command],
|
|
62
85
|
command_result: paneRun,
|
|
63
86
|
blockers,
|
|
@@ -73,7 +96,7 @@ export async function writeZellijPaneProof(root, opts = {}) {
|
|
|
73
96
|
export async function readZellijPaneProof(root) {
|
|
74
97
|
return readJson(path.join(root, 'zellij-pane-proof.json'), null);
|
|
75
98
|
}
|
|
76
|
-
function
|
|
99
|
+
export function parseZellijPaneRows(text) {
|
|
77
100
|
if (!text.trim())
|
|
78
101
|
return [];
|
|
79
102
|
try {
|
|
@@ -88,6 +111,9 @@ function parsePaneRows(text) {
|
|
|
88
111
|
return [];
|
|
89
112
|
}
|
|
90
113
|
}
|
|
114
|
+
function delay(ms) {
|
|
115
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
116
|
+
}
|
|
91
117
|
export function normalizeZellijPaneRows(rows) {
|
|
92
118
|
return rows.map((row, index) => {
|
|
93
119
|
const paneId = stringValue(row.pane_id ?? row.paneId ?? row.id ?? row.index ?? index);
|
|
@@ -13,7 +13,7 @@ export function renderZellijSlotPane(input) {
|
|
|
13
13
|
const stderr = (input.stderrTail || []).filter(Boolean).slice(-1);
|
|
14
14
|
const fullDebug = mode === 'full-debug';
|
|
15
15
|
const fixtureLoopProof = String(input.backend || '').includes('fixture') || String(input.patchStatus || '').includes('fixture');
|
|
16
|
-
const meta = [input.model || input.provider || '?', input.serviceTier || '?'].filter(Boolean).join('·');
|
|
16
|
+
const meta = [input.model || input.provider || '?', input.reasoningEffort || '?', input.serviceTier || '?'].filter(Boolean).join('·');
|
|
17
17
|
const head = `${statusBadge(theme, input.status || 'queued')} ${paint(theme, ANSI_CODES.bold, input.slotId)}` +
|
|
18
18
|
` ${t(input.role || 'worker', 12)} ${paint(theme, ANSI_CODES.dim, t(meta, 28))}`;
|
|
19
19
|
const prog = input.progress && input.progress.total > 0
|
|
@@ -101,16 +101,28 @@ function mergeRenderInputWithLiveTelemetry(detail, live) {
|
|
|
101
101
|
currentTask: live.task_title || detail.currentTask || null,
|
|
102
102
|
currentFile: live.current_file || detail.currentFile || null,
|
|
103
103
|
role: live.role || detail.role || null,
|
|
104
|
-
backend: live.backend
|
|
105
|
-
provider: live.provider
|
|
106
|
-
|
|
104
|
+
backend: preferKnownTelemetryValue(live.backend, detail.backend),
|
|
105
|
+
provider: preferKnownTelemetryValue(live.provider, detail.provider),
|
|
106
|
+
model: preferKnownTelemetryValue(live.model, detail.model),
|
|
107
|
+
serviceTier: preferKnownTelemetryValue(live.service_tier, detail.serviceTier),
|
|
108
|
+
reasoningEffort: preferKnownTelemetryValue(live.reasoning_effort, detail.reasoningEffort),
|
|
107
109
|
progress: live.progress ?? null,
|
|
108
110
|
blockers: live.blockers || [],
|
|
109
111
|
telemetryTs: live.latest_ts || null,
|
|
110
112
|
heartbeatAgeMs: live.latest_ts ? Math.max(0, Date.now() - Date.parse(live.latest_ts)) : detail.heartbeatAgeMs ?? null,
|
|
111
|
-
worktreeId: live.worktree_id || detail.worktreeId || null
|
|
113
|
+
worktreeId: live.worktree_id || detail.worktreeId || null,
|
|
114
|
+
stdoutTail: live.log_tail
|
|
115
|
+
? [...(detail.stdoutTail || []), ...String(live.log_tail).split(/\r?\n/).filter(Boolean)].slice(-6)
|
|
116
|
+
: detail.stdoutTail || []
|
|
112
117
|
};
|
|
113
118
|
}
|
|
119
|
+
function preferKnownTelemetryValue(live, fallback) {
|
|
120
|
+
const liveText = String(live || '').trim();
|
|
121
|
+
if (liveText && liveText.toLowerCase() !== 'unknown' && liveText !== '?')
|
|
122
|
+
return liveText;
|
|
123
|
+
const fallbackText = String(fallback || '').trim();
|
|
124
|
+
return fallbackText && fallbackText.toLowerCase() !== 'unknown' && fallbackText !== '?' ? fallbackText : null;
|
|
125
|
+
}
|
|
114
126
|
async function renderZellijSlotPaneFromArtifactDir(input) {
|
|
115
127
|
const detail = await renderInputFromArtifactDir(input);
|
|
116
128
|
if (!detail)
|
|
@@ -22,7 +22,11 @@ export async function appendZellijSlotTelemetry(root, event) {
|
|
|
22
22
|
const normalized = normalizeTelemetryEvent(event);
|
|
23
23
|
const file = slotTelemetryEventPath(root, missionId);
|
|
24
24
|
await ensureDir(path.dirname(file));
|
|
25
|
-
await
|
|
25
|
+
await withFileLock({
|
|
26
|
+
lockPath: `${file}.append.lock`,
|
|
27
|
+
timeoutMs: 30_000,
|
|
28
|
+
staleMs: 2 * 60 * 1000
|
|
29
|
+
}, async () => appendJsonlBounded(file, normalized));
|
|
26
30
|
const previous = await readZellijSlotTelemetrySnapshotNoRebuild(root, missionId);
|
|
27
31
|
if (previous) {
|
|
28
32
|
const snapshotPath = slotTelemetrySnapshotPath(root, missionId);
|
|
@@ -181,6 +185,8 @@ function normalizeTelemetryEvent(event) {
|
|
|
181
185
|
...(event.backend ? { backend: String(event.backend) } : {}),
|
|
182
186
|
...(event.provider ? { provider: String(event.provider) } : {}),
|
|
183
187
|
...(event.service_tier ? { service_tier: String(event.service_tier) } : {}),
|
|
188
|
+
...(event.model ? { model: String(event.model) } : {}),
|
|
189
|
+
...(event.reasoning_effort ? { reasoning_effort: String(event.reasoning_effort) } : {}),
|
|
184
190
|
worktree_id: event.worktree_id == null ? null : String(event.worktree_id),
|
|
185
191
|
worktree_path: event.worktree_path == null ? null : String(event.worktree_path),
|
|
186
192
|
...(event.task_id ? { task_id: String(event.task_id) } : {}),
|
|
@@ -193,7 +199,9 @@ function normalizeTelemetryEvent(event) {
|
|
|
193
199
|
})() : {}),
|
|
194
200
|
...(Array.isArray(event.artifact_paths) ? { artifact_paths: event.artifact_paths.map(String).filter(Boolean) } : {}),
|
|
195
201
|
...(event.log_tail ? { log_tail: tail(event.log_tail, 1200) } : {}),
|
|
196
|
-
...(Array.isArray(event.blockers) ? { blockers: event.blockers.map(String).filter(Boolean) } : {})
|
|
202
|
+
...(Array.isArray(event.blockers) ? { blockers: event.blockers.map(String).filter(Boolean) } : {}),
|
|
203
|
+
...(event.activity_source ? { activity_source: String(event.activity_source) } : {}),
|
|
204
|
+
...(event.activity_hash ? { activity_hash: String(event.activity_hash) } : {})
|
|
197
205
|
};
|
|
198
206
|
}
|
|
199
207
|
function mergeSlotTelemetry(previous, event) {
|
|
@@ -214,6 +222,8 @@ function mergeSlotTelemetry(previous, event) {
|
|
|
214
222
|
backend: event.backend || previous?.backend || 'unknown',
|
|
215
223
|
provider: event.provider || previous?.provider || 'unknown',
|
|
216
224
|
service_tier: event.service_tier || previous?.service_tier || 'unknown',
|
|
225
|
+
model: event.model || previous?.model || 'unknown',
|
|
226
|
+
reasoning_effort: event.reasoning_effort || previous?.reasoning_effort || 'unknown',
|
|
217
227
|
worktree_id: event.worktree_id ?? previous?.worktree_id ?? null,
|
|
218
228
|
worktree_path: event.worktree_path ?? previous?.worktree_path ?? null,
|
|
219
229
|
task_title: event.task_title || previous?.task_title || event.task_id || 'waiting for task',
|
|
@@ -225,7 +235,9 @@ function mergeSlotTelemetry(previous, event) {
|
|
|
225
235
|
progress: stale ? previous.progress || (terminalRegression ? null : event.progress || null) : event.progress || previous?.progress || null,
|
|
226
236
|
artifact_paths: unique([...(previous?.artifact_paths || []), ...(event.artifact_paths || [])]),
|
|
227
237
|
blockers: unique([...(previous?.blockers || []), ...(event.blockers || [])]),
|
|
228
|
-
log_tail: stale ? previous.log_tail || (terminalRegression ? '' : event.log_tail || '') : event.log_tail || previous?.log_tail || ''
|
|
238
|
+
log_tail: stale ? previous.log_tail || (terminalRegression ? '' : event.log_tail || '') : event.log_tail || previous?.log_tail || '',
|
|
239
|
+
activity_source: stale ? previous.activity_source ?? null : event.activity_source || previous?.activity_source || null,
|
|
240
|
+
activity_hash: stale ? previous.activity_hash ?? null : event.activity_hash || previous?.activity_hash || null
|
|
229
241
|
};
|
|
230
242
|
}
|
|
231
243
|
function countSlotTelemetry(slots) {
|
|
@@ -3,7 +3,7 @@ export function resolveZellijUiConfig(args = [], env = process.env) {
|
|
|
3
3
|
mode: resolveZellijUiMode(args, env),
|
|
4
4
|
color: env.SKS_ZELLIJ_COLOR !== '0' && env.NO_COLOR !== '1',
|
|
5
5
|
visiblePanes: Number(env.SKS_ZELLIJ_VISIBLE_PANES) || null,
|
|
6
|
-
viewports: boundedInt(env.SKS_ZELLIJ_VIEWPORTS,
|
|
6
|
+
viewports: boundedInt(env.SKS_ZELLIJ_VIEWPORTS, 1, 0, 3),
|
|
7
7
|
monitorRows: Math.max(4, Number(env.SKS_ZELLIJ_MONITOR_ROWS || 12)),
|
|
8
8
|
monitor: env.SKS_ZELLIJ_MONITOR_PANE !== '0',
|
|
9
9
|
intervalMs: Math.max(500, Number(env.SKS_ZELLIJ_REFRESH_MS) || 1000)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const ACTIVE = new Set(['running', 'verifying', 'launching']);
|
|
2
2
|
const ATTENTION = new Set(['failed', 'blocked', 'timed_out']);
|
|
3
|
+
const RECENT_COMPLETED_GRACE_MS = 60_000;
|
|
3
4
|
function scoreSlot(s, now) {
|
|
4
5
|
const ts = Date.parse(String(s.latest_ts || '')) || 0;
|
|
5
6
|
const age = Math.max(0, now - ts);
|
|
@@ -12,6 +13,8 @@ function scoreSlot(s, now) {
|
|
|
12
13
|
return 2_000_000 - age / 1000;
|
|
13
14
|
if (st === 'queued' || st === 'launching')
|
|
14
15
|
return 1_000_000 - age / 1000;
|
|
16
|
+
if ((st === 'completed' || st === 'done' || st === 'drained') && age < RECENT_COMPLETED_GRACE_MS)
|
|
17
|
+
return 500_000 - age / 1000;
|
|
15
18
|
return -1;
|
|
16
19
|
}
|
|
17
20
|
export function bindViewports(input) {
|
|
@@ -4,7 +4,7 @@ import { appendParallelRuntimeEvent } from '../agents/parallel-runtime-proof.js'
|
|
|
4
4
|
import { providerPaneLabel } from '../provider/provider-badge.js';
|
|
5
5
|
import { resolveProviderContext } from '../provider/provider-context.js';
|
|
6
6
|
import { checkZellijStackedPaneCapability } from './zellij-capability.js';
|
|
7
|
-
import { runZellij } from './zellij-command.js';
|
|
7
|
+
import { runZellij, zellijCommandStdout } from './zellij-command.js';
|
|
8
8
|
import { extractZellijPaneIdFromOutput } from './zellij-lane-runtime.js';
|
|
9
9
|
import { buildZellijSlotColumnAnchorCommand } from './zellij-slot-column-anchor.js';
|
|
10
10
|
import { closeWorkerInRightColumn, prepareWorkerInRightColumn, readRightColumnState, recordSlotColumnAnchorInRightColumn, recordWorkerPaneInRightColumn } from './zellij-right-column-manager.js';
|
|
@@ -629,6 +629,7 @@ async function reconcileZellijWorkerPaneId(sessionName, paneName, resultPath, cw
|
|
|
629
629
|
const listed = await runZellij(['--session', sessionName, 'action', 'list-panes', '--json', '--all'], {
|
|
630
630
|
cwd,
|
|
631
631
|
timeoutMs: 5000,
|
|
632
|
+
maxOutputBytes: 1024 * 1024,
|
|
632
633
|
optional: true
|
|
633
634
|
});
|
|
634
635
|
const screen = await runZellij(['--session', sessionName, 'action', 'dump-screen'], {
|
|
@@ -636,7 +637,7 @@ async function reconcileZellijWorkerPaneId(sessionName, paneName, resultPath, cw
|
|
|
636
637
|
timeoutMs: 5000,
|
|
637
638
|
optional: true
|
|
638
639
|
});
|
|
639
|
-
const rows = parsePaneRows(listed
|
|
640
|
+
const rows = parsePaneRows(zellijCommandStdout(listed));
|
|
640
641
|
const pane = rows.find((row) => {
|
|
641
642
|
const title = String(row.title || row.name || row.pane_name || '');
|
|
642
643
|
const command = String(row.terminal_command || row.command || row.command_line || row.running_command || '');
|
|
@@ -665,11 +666,12 @@ async function findExistingSlotsAnchorPaneId(sessionName, cwd) {
|
|
|
665
666
|
const listed = await runZellij(['--session', sessionName, 'action', 'list-panes', '--json', '--all'], {
|
|
666
667
|
cwd,
|
|
667
668
|
timeoutMs: 5000,
|
|
669
|
+
maxOutputBytes: 1024 * 1024,
|
|
668
670
|
optional: true
|
|
669
671
|
});
|
|
670
672
|
if (!listed.ok)
|
|
671
673
|
return null;
|
|
672
|
-
const rows = parsePaneRows(listed
|
|
674
|
+
const rows = parsePaneRows(zellijCommandStdout(listed));
|
|
673
675
|
const pane = rows.find((row) => {
|
|
674
676
|
if (row?.is_plugin === true)
|
|
675
677
|
return false;
|
|
@@ -1,37 +1,54 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
import fs from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
4
5
|
import path from 'node:path';
|
|
5
6
|
import { execFileSync } from 'node:child_process';
|
|
6
7
|
import { assertGate, emitGate, root } from './sks-1-18-gate-lib.js';
|
|
7
8
|
const distCli = path.join(root, 'dist', 'bin', 'sks.js');
|
|
8
9
|
function run(extra = []) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
const fixtureRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'sks-agent-fast-mode-fixture-'));
|
|
11
|
+
const fixtureHome = path.join(fixtureRoot, 'home');
|
|
12
|
+
try {
|
|
13
|
+
return JSON.parse(execFileSync(process.execPath, [
|
|
14
|
+
distCli,
|
|
15
|
+
'agent',
|
|
16
|
+
'run',
|
|
17
|
+
'fast mode default fixture',
|
|
18
|
+
'--mock',
|
|
19
|
+
'--agents',
|
|
20
|
+
'2',
|
|
21
|
+
'--concurrency',
|
|
22
|
+
'2',
|
|
23
|
+
'--work-items',
|
|
24
|
+
'2',
|
|
25
|
+
'--minimum-work-items',
|
|
26
|
+
'2',
|
|
27
|
+
'--json',
|
|
28
|
+
...extra
|
|
29
|
+
], {
|
|
30
|
+
cwd: fixtureRoot,
|
|
31
|
+
encoding: 'utf8',
|
|
32
|
+
env: {
|
|
33
|
+
...process.env,
|
|
34
|
+
HOME: fixtureHome,
|
|
35
|
+
CODEX_HOME: path.join(fixtureHome, '.codex'),
|
|
36
|
+
SKS_GLOBAL_ROOT: path.join(fixtureHome, '.sneakoscope-global'),
|
|
37
|
+
TMPDIR: fixtureRoot,
|
|
38
|
+
TMP: fixtureRoot,
|
|
39
|
+
TEMP: fixtureRoot,
|
|
40
|
+
PWD: fixtureRoot,
|
|
41
|
+
SKS_TEST_ISOLATION: '1',
|
|
42
|
+
SKS_UPDATE_MIGRATION_GATE_DISABLED: '1',
|
|
43
|
+
NODE_ENV: 'test',
|
|
44
|
+
CI: 'true'
|
|
45
|
+
},
|
|
46
|
+
maxBuffer: 32 * 1024 * 1024
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
fs.rmSync(fixtureRoot, { recursive: true, force: true });
|
|
51
|
+
}
|
|
35
52
|
}
|
|
36
53
|
const defaultRun = run();
|
|
37
54
|
const fastRun = run(['--fast']);
|
|
@@ -44,6 +61,7 @@ const report = {
|
|
|
44
61
|
mission_id: defaultRun.mission_id,
|
|
45
62
|
fast_mode: defaultRun.fast_mode_policy?.fast_mode,
|
|
46
63
|
service_tier: defaultRun.fast_mode_policy?.service_tier,
|
|
64
|
+
default_fast_mode: defaultRun.fast_mode_policy?.default_fast_mode,
|
|
47
65
|
preference_mode: defaultRun.fast_mode_policy?.preference_mode,
|
|
48
66
|
explicit_fast: defaultRun.fast_mode_policy?.explicit_fast,
|
|
49
67
|
explicit_service_tier: defaultRun.fast_mode_policy?.explicit_service_tier,
|
|
@@ -73,11 +91,12 @@ fs.mkdirSync(path.dirname(out), { recursive: true });
|
|
|
73
91
|
fs.writeFileSync(out, `${JSON.stringify(report, null, 2)}\n`);
|
|
74
92
|
assertGate(defaultRun.ok === true, 'default agent run must pass', report);
|
|
75
93
|
assertGate(defaultRun.fast_mode_policy?.explicit_fast === false && defaultRun.fast_mode_policy?.explicit_service_tier === null, 'default run must not use explicit fast/service-tier flags', report);
|
|
76
|
-
|
|
77
|
-
|
|
94
|
+
assertGate(defaultRun.fast_mode_policy?.default_fast_mode === true, 'built-in Fast default must be recorded', report);
|
|
95
|
+
if (defaultRun.fast_mode_policy?.preference_mode === 'standard') {
|
|
96
|
+
assertGate(defaultRun.fast_mode_policy?.fast_mode === false && defaultRun.fast_mode_policy?.service_tier === 'standard', 'default run must honor saved standard preference', report);
|
|
78
97
|
}
|
|
79
98
|
else {
|
|
80
|
-
assertGate(defaultRun.fast_mode_policy?.fast_mode ===
|
|
99
|
+
assertGate(defaultRun.fast_mode_policy?.fast_mode === true && defaultRun.fast_mode_policy?.service_tier === 'fast', 'default run without a saved standard preference must use Fast', report);
|
|
81
100
|
}
|
|
82
101
|
assertGate(fastRun.fast_mode_policy?.fast_mode === true, '--fast must enable fast mode', report);
|
|
83
102
|
assertGate(fastRun.fast_mode_policy?.service_tier === 'fast', '--fast must record service_tier fast', report);
|