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,147 @@
|
|
|
1
|
+
import fsp from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { sha256 } from '../fsx.js';
|
|
4
|
+
const DEDUPE_EVENTS = new Set([
|
|
5
|
+
'user-prompt-submit',
|
|
6
|
+
'post-tool',
|
|
7
|
+
'stop',
|
|
8
|
+
'session-start',
|
|
9
|
+
'pre-compact',
|
|
10
|
+
'post-compact',
|
|
11
|
+
'subagent-start',
|
|
12
|
+
'subagent-stop'
|
|
13
|
+
]);
|
|
14
|
+
const DEFAULT_WINDOW_MS = 3_000;
|
|
15
|
+
const DEFAULT_MAX_MARKERS = 64;
|
|
16
|
+
export async function claimHookInvocation(root, name, payload = {}) {
|
|
17
|
+
const event = String(name || '').trim();
|
|
18
|
+
if (!DEDUPE_EVENTS.has(event))
|
|
19
|
+
return { duplicate: false, claimed: false, reason: 'event_not_deduped' };
|
|
20
|
+
const identity = hookInvocationIdentity(event, payload);
|
|
21
|
+
if (!identity)
|
|
22
|
+
return { duplicate: false, claimed: false, reason: 'stable_host_identity_missing' };
|
|
23
|
+
const windowMs = hookDedupeWindowMs();
|
|
24
|
+
const dir = await prepareDedupeDir(root);
|
|
25
|
+
const digest = sha256(JSON.stringify(identity)).slice(0, 32);
|
|
26
|
+
const marker = path.join(dir, `${digest}.json`);
|
|
27
|
+
const claimed = await createMarker(marker, windowMs);
|
|
28
|
+
await pruneMarkers(dir, windowMs).catch(() => null);
|
|
29
|
+
return {
|
|
30
|
+
duplicate: !claimed,
|
|
31
|
+
claimed,
|
|
32
|
+
reason: claimed ? 'invocation_claimed' : 'duplicate_host_invocation',
|
|
33
|
+
digest
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function hookInvocationIdentity(event, payload) {
|
|
37
|
+
const turnId = firstText(payload.turn_id, payload.turnId, payload.request_id, payload.requestId);
|
|
38
|
+
const toolUseId = firstText(payload.tool_use_id, payload.toolUseId, payload.item_id, payload.itemId);
|
|
39
|
+
const agentId = firstText(payload.agent_id, payload.agentId);
|
|
40
|
+
if (!turnId && !toolUseId && !agentId)
|
|
41
|
+
return null;
|
|
42
|
+
const sessionId = firstText(payload.session_id, payload.sessionId, payload.conversation_id, payload.thread_id, payload.threadId, payload.chat_id);
|
|
43
|
+
const content = event === 'user-prompt-submit'
|
|
44
|
+
? firstText(payload.prompt, payload.user_prompt, payload.userPrompt, payload.message, payload.input?.prompt, payload.input?.message)
|
|
45
|
+
: event === 'stop'
|
|
46
|
+
? firstText(payload.last_assistant_message, payload.assistant_message, payload.message, payload.response)
|
|
47
|
+
: '';
|
|
48
|
+
return {
|
|
49
|
+
event,
|
|
50
|
+
session_id: sessionId || null,
|
|
51
|
+
turn_id: turnId || null,
|
|
52
|
+
tool_use_id: toolUseId || null,
|
|
53
|
+
agent_id: agentId || null,
|
|
54
|
+
content_hash: content ? sha256(content).slice(0, 16) : null
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
async function createMarker(marker, windowMs) {
|
|
58
|
+
try {
|
|
59
|
+
const handle = await fsp.open(marker, 'wx');
|
|
60
|
+
try {
|
|
61
|
+
await handle.writeFile(JSON.stringify({ created_at_ms: Date.now() }));
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
await handle.close();
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
if (error?.code !== 'EEXIST')
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
const stat = await fsp.stat(marker).catch(() => null);
|
|
73
|
+
if (stat && Date.now() - stat.mtimeMs <= windowMs)
|
|
74
|
+
return false;
|
|
75
|
+
await fsp.rm(marker, { force: true }).catch(() => null);
|
|
76
|
+
try {
|
|
77
|
+
const handle = await fsp.open(marker, 'wx');
|
|
78
|
+
try {
|
|
79
|
+
await handle.writeFile(JSON.stringify({ created_at_ms: Date.now() }));
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
await handle.close();
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
if (error?.code === 'EEXIST')
|
|
88
|
+
return false;
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
async function pruneMarkers(dir, windowMs) {
|
|
93
|
+
const directoryNames = await fsp.readdir(dir).catch(() => []);
|
|
94
|
+
const names = directoryNames.filter((name) => /^[0-9a-f]{32}\.json$/.test(name));
|
|
95
|
+
if (names.length <= DEFAULT_MAX_MARKERS)
|
|
96
|
+
return;
|
|
97
|
+
const cutoff = Date.now() - Math.max(windowMs * 4, 12_000);
|
|
98
|
+
const rows = await Promise.all(names.map(async (name) => {
|
|
99
|
+
const file = path.join(dir, name);
|
|
100
|
+
const stat = await fsp.lstat(file).catch(() => null);
|
|
101
|
+
return { file, mtimeMs: stat?.isFile() && !stat.isSymbolicLink() ? stat.mtimeMs : 0, removable: Boolean(stat?.isFile() && !stat.isSymbolicLink()) };
|
|
102
|
+
}));
|
|
103
|
+
const stale = rows
|
|
104
|
+
.filter((row) => row.removable && row.mtimeMs < cutoff && path.dirname(row.file) === dir)
|
|
105
|
+
.sort((a, b) => a.mtimeMs - b.mtimeMs);
|
|
106
|
+
const overflow = Math.max(0, rows.length - DEFAULT_MAX_MARKERS);
|
|
107
|
+
for (const row of stale.slice(0, Math.max(overflow, stale.length))) {
|
|
108
|
+
await fsp.rm(row.file, { force: true }).catch(() => null);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
async function prepareDedupeDir(root) {
|
|
112
|
+
const sksDir = path.resolve(root, '.sneakoscope');
|
|
113
|
+
const stateDir = path.join(sksDir, 'state');
|
|
114
|
+
const dir = path.join(stateDir, 'hook-invocation-dedupe');
|
|
115
|
+
await fsp.mkdir(sksDir, { recursive: true });
|
|
116
|
+
await assertRealDirectoryWithin(root, sksDir, path.resolve(root));
|
|
117
|
+
await fsp.mkdir(stateDir, { recursive: true });
|
|
118
|
+
await assertRealDirectoryWithin(root, stateDir, sksDir);
|
|
119
|
+
await fsp.mkdir(dir, { recursive: true });
|
|
120
|
+
await assertRealDirectoryWithin(root, dir, stateDir);
|
|
121
|
+
return dir;
|
|
122
|
+
}
|
|
123
|
+
async function assertRealDirectoryWithin(root, candidate, parent) {
|
|
124
|
+
const stat = await fsp.lstat(candidate);
|
|
125
|
+
if (!stat.isDirectory() || stat.isSymbolicLink())
|
|
126
|
+
throw new Error(`unsafe_hook_dedupe_directory:${path.relative(root, candidate)}`);
|
|
127
|
+
const [realCandidate, realParent] = await Promise.all([fsp.realpath(candidate), fsp.realpath(parent)]);
|
|
128
|
+
const relative = path.relative(realParent, realCandidate);
|
|
129
|
+
if (relative.startsWith('..') || path.isAbsolute(relative))
|
|
130
|
+
throw new Error(`hook_dedupe_directory_outside_root:${path.relative(root, candidate)}`);
|
|
131
|
+
}
|
|
132
|
+
function hookDedupeWindowMs() {
|
|
133
|
+
const configured = Number(process.env.SKS_HOOK_DEDUPE_WINDOW_MS || DEFAULT_WINDOW_MS);
|
|
134
|
+
if (!Number.isFinite(configured))
|
|
135
|
+
return DEFAULT_WINDOW_MS;
|
|
136
|
+
return Math.max(250, Math.min(30_000, Math.floor(configured)));
|
|
137
|
+
}
|
|
138
|
+
function firstText(...values) {
|
|
139
|
+
for (const value of values) {
|
|
140
|
+
if (typeof value === 'string' && value.trim())
|
|
141
|
+
return value.trim();
|
|
142
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
143
|
+
return String(value);
|
|
144
|
+
}
|
|
145
|
+
return '';
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=hook-invocation-dedupe.js.map
|
|
@@ -19,7 +19,15 @@ export async function loadHookPayload() {
|
|
|
19
19
|
export function normalizeHookResult(name, result = {}) {
|
|
20
20
|
const eventName = codexHookEventName(name);
|
|
21
21
|
const out = { ...result };
|
|
22
|
-
|
|
22
|
+
// Project and legacy user-level SKS hooks can briefly coexist during an
|
|
23
|
+
// upgrade. The runtime owner performs the work once; duplicate invocations
|
|
24
|
+
// must be silent so Codex does not inject the same route or Stop feedback
|
|
25
|
+
// twice into one turn.
|
|
26
|
+
if (out.suppressedDuplicate === true)
|
|
27
|
+
return { continue: true };
|
|
28
|
+
const systemMessage = out.silent === true
|
|
29
|
+
? undefined
|
|
30
|
+
: out.systemMessage || visibleHookMessage(name, out.reason || out.additionalContext || '');
|
|
23
31
|
const reason = out.reason || 'SKS guard denied this action.';
|
|
24
32
|
if (eventName === 'UserPromptSubmit' || eventName === 'PostToolUse') {
|
|
25
33
|
if (eventName === 'UserPromptSubmit') {
|
|
@@ -96,8 +104,10 @@ export function visibleHookMessage(name, text = '') {
|
|
|
96
104
|
return 'SKS: native Computer Use lane injected; defer TriWiki/Honest Mode to final closeout.';
|
|
97
105
|
if (body.includes('MANDATORY ambiguity-removal gate') || body.includes('VISIBLE RESPONSE CONTRACT') || body.includes('Required questions still pending'))
|
|
98
106
|
return 'SKS: stale clarification gate detected; continue from inferred route contract.';
|
|
107
|
+
if (body.includes('$Naruto route prepared') || body.includes('Codex subagent workflow'))
|
|
108
|
+
return 'SKS: Naruto Codex subagent delegation context injected.';
|
|
99
109
|
if (body.includes('$Team route prepared') || body.includes('Team route'))
|
|
100
|
-
return 'SKS: Team route
|
|
110
|
+
return 'SKS: Team compatibility route redirected to the Naruto Codex subagent workflow.';
|
|
101
111
|
if (body.includes('$Research route prepared'))
|
|
102
112
|
return 'SKS: Research route, xhigh Eureka agent council, source/debate ledgers, paper output, and falsification gate injected.';
|
|
103
113
|
if (body.includes('$AutoResearch route prepared'))
|
|
@@ -112,8 +122,8 @@ export function visibleHookMessage(name, text = '') {
|
|
|
112
122
|
return 'SKS: GX visual context route injected.';
|
|
113
123
|
if (body.includes('$QA-LOOP route prepared'))
|
|
114
124
|
return 'SKS: QA-LOOP route and safety checklist injected.';
|
|
115
|
-
if (body.includes('
|
|
116
|
-
return 'SKS: route context injected;
|
|
125
|
+
if (body.includes('Codex subagent workflow: required'))
|
|
126
|
+
return 'SKS: route context injected; official subagent evidence gate is active.';
|
|
117
127
|
return 'SKS: skill-first route context injected.';
|
|
118
128
|
}
|
|
119
129
|
if (name === 'post-tool')
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import fsp from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { nowIso, readJson, sha256, writeJsonAtomic } from '../fsx.js';
|
|
4
|
+
export async function armLightTurnStopBypass(root, input) {
|
|
5
|
+
const sessionKeyHash = lightTurnSessionHash(input.sessionKey);
|
|
6
|
+
const createdAt = nowIso();
|
|
7
|
+
const ttlMs = Math.max(1_000, Math.min(10 * 60_000, Math.floor(Number(input.ttlMs) || 0)));
|
|
8
|
+
const receipt = {
|
|
9
|
+
schema: 'sks.light-turn.v1',
|
|
10
|
+
session_key_hash: sessionKeyHash,
|
|
11
|
+
turn_id_hash: sha256(String(input.turnId || '')).slice(0, 32),
|
|
12
|
+
prompt_hash: sha256(String(input.prompt || '')).slice(0, 32),
|
|
13
|
+
profile: input.profile,
|
|
14
|
+
created_at: createdAt,
|
|
15
|
+
expires_at: new Date(Date.parse(createdAt) + ttlMs).toISOString(),
|
|
16
|
+
consumed: false
|
|
17
|
+
};
|
|
18
|
+
await writeJsonAtomic(lightTurnReceiptPath(root, sessionKeyHash), receipt);
|
|
19
|
+
return receipt;
|
|
20
|
+
}
|
|
21
|
+
export async function consumeLightTurnStopBypass(root, input) {
|
|
22
|
+
const sessionKeyHash = lightTurnSessionHash(input.sessionKey);
|
|
23
|
+
const file = lightTurnReceiptPath(root, sessionKeyHash);
|
|
24
|
+
const receipt = await readJson(file, null).catch(() => null);
|
|
25
|
+
if (!receipt)
|
|
26
|
+
return { accepted: false, receipt: null, reason: 'receipt_missing' };
|
|
27
|
+
// A light receipt is single-use. Remove it before evaluating stale route
|
|
28
|
+
// state so it can never become durable completion evidence or be replayed.
|
|
29
|
+
await fsp.rm(file, { force: true }).catch(() => null);
|
|
30
|
+
if (receipt.schema !== 'sks.light-turn.v1')
|
|
31
|
+
return { accepted: false, receipt, reason: 'schema_mismatch' };
|
|
32
|
+
if (receipt.session_key_hash !== sessionKeyHash)
|
|
33
|
+
return { accepted: false, receipt, reason: 'session_mismatch' };
|
|
34
|
+
if (receipt.turn_id_hash !== sha256(String(input.turnId || '')).slice(0, 32))
|
|
35
|
+
return { accepted: false, receipt, reason: 'turn_mismatch' };
|
|
36
|
+
if (receipt.consumed === true)
|
|
37
|
+
return { accepted: false, receipt, reason: 'already_consumed' };
|
|
38
|
+
const expiresAt = Date.parse(receipt.expires_at);
|
|
39
|
+
if (!Number.isFinite(expiresAt) || expiresAt < Date.now())
|
|
40
|
+
return { accepted: false, receipt, reason: 'expired' };
|
|
41
|
+
return { accepted: true, receipt: { ...receipt, consumed: true }, reason: 'accepted' };
|
|
42
|
+
}
|
|
43
|
+
export async function hasMatchingLightTurnStopBypass(root, input) {
|
|
44
|
+
const turnId = String(input.turnId || '').trim();
|
|
45
|
+
if (!turnId)
|
|
46
|
+
return false;
|
|
47
|
+
const sessionKeyHash = lightTurnSessionHash(input.sessionKey);
|
|
48
|
+
const receipt = await readJson(lightTurnReceiptPath(root, sessionKeyHash), null).catch(() => null);
|
|
49
|
+
if (!receipt || receipt.schema !== 'sks.light-turn.v1' || receipt.consumed === true)
|
|
50
|
+
return false;
|
|
51
|
+
if (receipt.session_key_hash !== sessionKeyHash)
|
|
52
|
+
return false;
|
|
53
|
+
if (receipt.turn_id_hash !== sha256(turnId).slice(0, 32))
|
|
54
|
+
return false;
|
|
55
|
+
const expiresAt = Date.parse(receipt.expires_at);
|
|
56
|
+
return Number.isFinite(expiresAt) && expiresAt >= Date.now();
|
|
57
|
+
}
|
|
58
|
+
export async function clearLightTurnStopBypass(root, input) {
|
|
59
|
+
await fsp.rm(lightTurnReceiptPath(root, input.sessionKey), { force: true }).catch(() => undefined);
|
|
60
|
+
}
|
|
61
|
+
export function lightTurnReceiptPath(root, sessionKeyOrHash) {
|
|
62
|
+
const hash = /^[0-9a-f]{32}$/.test(String(sessionKeyOrHash || ''))
|
|
63
|
+
? String(sessionKeyOrHash)
|
|
64
|
+
: lightTurnSessionHash(sessionKeyOrHash);
|
|
65
|
+
return path.join(root, '.sneakoscope', 'state', 'light-turn', `${hash}.json`);
|
|
66
|
+
}
|
|
67
|
+
function lightTurnSessionHash(sessionKey) {
|
|
68
|
+
return sha256(String(sessionKey || 'default')).slice(0, 32);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=light-turn.js.map
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { stripVisibleDecisionAnswerBlocks } from '../routes.js';
|
|
2
|
+
export function extractLastMessage(payload = {}) {
|
|
3
|
+
return payload.last_assistant_message || payload.assistant_message || payload.message || payload.response || payload.raw || '';
|
|
4
|
+
}
|
|
5
|
+
export function extractUserPrompt(payload = {}) {
|
|
6
|
+
return payload.prompt
|
|
7
|
+
|| payload.user_prompt
|
|
8
|
+
|| payload.userPrompt
|
|
9
|
+
|| payload.message
|
|
10
|
+
|| payload.input?.prompt
|
|
11
|
+
|| payload.input?.message
|
|
12
|
+
|| payload.raw
|
|
13
|
+
|| '';
|
|
14
|
+
}
|
|
15
|
+
export function conversationId(payload = {}) {
|
|
16
|
+
return String(payload.conversation_id || payload.thread_id || payload.session_id || payload.chat_id || payload.cwd || 'default');
|
|
17
|
+
}
|
|
18
|
+
export function explicitConversationId(payload = {}) {
|
|
19
|
+
return payload.conversation_id || payload.thread_id || payload.session_id || payload.chat_id || null;
|
|
20
|
+
}
|
|
21
|
+
export function hookTurnId(payload = {}) {
|
|
22
|
+
return String(payload.turn_id || payload.turnId || payload.metadata?.turn_id || payload.metadata?.turnId || '');
|
|
23
|
+
}
|
|
24
|
+
export function extractCommand(payload = {}) {
|
|
25
|
+
return payload.command || payload.tool_input?.command || payload.toolInput?.command || payload.input?.command || payload.tool?.input?.command || '';
|
|
26
|
+
}
|
|
27
|
+
export function codexGitActionMetadataText(payload = {}) {
|
|
28
|
+
const seen = new Set();
|
|
29
|
+
const out = [];
|
|
30
|
+
const interesting = new Set([
|
|
31
|
+
'action',
|
|
32
|
+
'intent',
|
|
33
|
+
'operation',
|
|
34
|
+
'permission',
|
|
35
|
+
'description',
|
|
36
|
+
'kind',
|
|
37
|
+
'type',
|
|
38
|
+
'feature',
|
|
39
|
+
'tool_name',
|
|
40
|
+
'toolName',
|
|
41
|
+
'name',
|
|
42
|
+
'label',
|
|
43
|
+
'title',
|
|
44
|
+
'source',
|
|
45
|
+
'event',
|
|
46
|
+
'hook',
|
|
47
|
+
'hook_name',
|
|
48
|
+
'hookName',
|
|
49
|
+
'hook_event_name',
|
|
50
|
+
'hookEventName',
|
|
51
|
+
'id',
|
|
52
|
+
'command'
|
|
53
|
+
]);
|
|
54
|
+
const noisy = new Set([
|
|
55
|
+
'prompt',
|
|
56
|
+
'user_prompt',
|
|
57
|
+
'userPrompt',
|
|
58
|
+
'message',
|
|
59
|
+
'assistant_message',
|
|
60
|
+
'last_assistant_message',
|
|
61
|
+
'response',
|
|
62
|
+
'raw',
|
|
63
|
+
'stdout',
|
|
64
|
+
'stderr'
|
|
65
|
+
]);
|
|
66
|
+
function walk(value, depth = 0, parentKey = '') {
|
|
67
|
+
if (!value || typeof value !== 'object' || depth > 5 || seen.has(value))
|
|
68
|
+
return;
|
|
69
|
+
seen.add(value);
|
|
70
|
+
for (const [key, candidate] of Object.entries(value)) {
|
|
71
|
+
if (noisy.has(key))
|
|
72
|
+
continue;
|
|
73
|
+
if (typeof candidate === 'string') {
|
|
74
|
+
if (interesting.has(key) || /\b(?:codex[_\s-]*app|git[_\s-]*actions?|codex_git_|gitCommit|gitPush|pull\s+request)\b/i.test(candidate)) {
|
|
75
|
+
out.push(`${key}:${candidate}`);
|
|
76
|
+
}
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (candidate && typeof candidate === 'object') {
|
|
80
|
+
const allowedContainer = interesting.has(key)
|
|
81
|
+
|| /^(?:input|metadata|context|client|thread|session|request|payload|tool|tool_input|toolInput|permission_request|permissionRequest)$/i.test(key)
|
|
82
|
+
|| parentKey;
|
|
83
|
+
if (allowedContainer)
|
|
84
|
+
walk(candidate, depth + 1, key);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
walk(payload);
|
|
89
|
+
return out.join(' ');
|
|
90
|
+
}
|
|
91
|
+
export function codexGitActionMetadataSignal(text = '') {
|
|
92
|
+
const s = String(text || '');
|
|
93
|
+
if (!s)
|
|
94
|
+
return false;
|
|
95
|
+
const action = String(s)
|
|
96
|
+
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
97
|
+
.replace(/[_-]+/g, ' ');
|
|
98
|
+
if (/\bcodex\s*app\b[\s\S]{0,120}\bgit\b[\s\S]{0,120}\b(?:action|actions|commit|push|pr|pull request)\b/i.test(action))
|
|
99
|
+
return true;
|
|
100
|
+
if (/\bgit\s*actions?\b[\s\S]{0,120}\b(?:commit|push|pr|pull request|commit\s*(?:and|&)\s*push)\b/i.test(action))
|
|
101
|
+
return true;
|
|
102
|
+
if (/\bcodex\s*git\s*(?:commit|push|pr|pull request|commit\s*(?:and|&)\s*push)\b/i.test(action))
|
|
103
|
+
return true;
|
|
104
|
+
if (/\b(?:git\s*)?(?:commit|push|commit\s*(?:and|&)\s*push|create\s+(?:a\s+)?pull\s+request|pull\s+request|pr)\b/i.test(action)) {
|
|
105
|
+
return /\b(?:action|intent|operation|permission|feature|tool\s*name|source|event|hook|name|label|title|type|kind|id)\s*:/i.test(action);
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
export function toolFailed(payload = {}) {
|
|
110
|
+
const candidates = [
|
|
111
|
+
payload.exit_code,
|
|
112
|
+
payload.exitCode,
|
|
113
|
+
payload.tool_response?.exit_code,
|
|
114
|
+
payload.toolResponse?.exitCode,
|
|
115
|
+
payload.result?.exit_code,
|
|
116
|
+
payload.result?.exitCode
|
|
117
|
+
];
|
|
118
|
+
for (const candidate of candidates) {
|
|
119
|
+
if (candidate === undefined || candidate === null || candidate === '')
|
|
120
|
+
continue;
|
|
121
|
+
const n = Number(candidate);
|
|
122
|
+
if (Number.isFinite(n))
|
|
123
|
+
return n !== 0;
|
|
124
|
+
}
|
|
125
|
+
if (payload.isError === true || payload.tool_response?.isError === true || payload.toolResponse?.isError === true || payload.result?.isError === true)
|
|
126
|
+
return true;
|
|
127
|
+
if (payload.success === false || payload.tool_response?.success === false || payload.toolResponse?.success === false || payload.result?.success === false)
|
|
128
|
+
return true;
|
|
129
|
+
if (payload.executed === false)
|
|
130
|
+
return true;
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
export function compactAnswerContext(prompt = '') {
|
|
134
|
+
return [
|
|
135
|
+
'SKS answer-only pipeline active (light turn).',
|
|
136
|
+
'Answer the user directly. Do not create or continue a mission, prepare a route, reconcile project skills, load active route context, read TriWiki/code-pack preflight state, or open a subagent workflow for this turn.',
|
|
137
|
+
'Use tools only when the answer itself needs current repository facts, official documentation, web evidence, or another source explicitly requested by the user.',
|
|
138
|
+
`Question: ${String(prompt || '').trim()}`
|
|
139
|
+
].join('\n');
|
|
140
|
+
}
|
|
141
|
+
export function looksLikeMadSksConfirmationPrompt(prompt = '') {
|
|
142
|
+
return /^(yes|y|no|n|confirm|confirmed|approve|approved|proceed|continue|ok|okay|stop|abort|cancel|deny|denied|네|예|응|아니|아니요|허용|승인|진행|계속|중단|취소|거부|삭제\s*허용|테이블\s*삭제\s*허용)(?=$|\s|[.!?。!?,,])/i.test(String(prompt || '').trim());
|
|
143
|
+
}
|
|
144
|
+
export function observedParentModel(payload = {}) {
|
|
145
|
+
const value = payload.parent_model
|
|
146
|
+
|| payload.parentModel
|
|
147
|
+
|| payload.model
|
|
148
|
+
|| payload.metadata?.parent_model
|
|
149
|
+
|| payload.metadata?.model
|
|
150
|
+
|| payload.session?.model
|
|
151
|
+
|| null;
|
|
152
|
+
return typeof value === 'string' && value.trim() ? value.trim() : null;
|
|
153
|
+
}
|
|
154
|
+
export function observedParentModelMismatch(model, expectedModel) {
|
|
155
|
+
const value = String(model || '').trim();
|
|
156
|
+
if (!value)
|
|
157
|
+
return false;
|
|
158
|
+
return value.toLowerCase() !== expectedModel && !/gpt[-_. ]?5\.6[-_. ]?sol|\bsol(?:\s+max)?\b/i.test(value);
|
|
159
|
+
}
|
|
160
|
+
export function looksLikeCodexUiSettingsEvent(payload = {}) {
|
|
161
|
+
const prompt = stripVisibleDecisionAnswerBlocks(extractUserPrompt(payload));
|
|
162
|
+
const haystack = [
|
|
163
|
+
payload.action,
|
|
164
|
+
payload.intent,
|
|
165
|
+
payload.operation,
|
|
166
|
+
payload.permission,
|
|
167
|
+
payload.description,
|
|
168
|
+
payload.kind,
|
|
169
|
+
payload.type,
|
|
170
|
+
payload.feature,
|
|
171
|
+
payload.source,
|
|
172
|
+
payload.event,
|
|
173
|
+
payload.hook,
|
|
174
|
+
payload.hook_name,
|
|
175
|
+
payload.metadata?.action,
|
|
176
|
+
payload.metadata?.intent,
|
|
177
|
+
payload.metadata?.operation,
|
|
178
|
+
payload.metadata?.feature,
|
|
179
|
+
payload.metadata?.source,
|
|
180
|
+
payload.context?.surface,
|
|
181
|
+
payload.session?.surface
|
|
182
|
+
].filter(Boolean).join(' ');
|
|
183
|
+
return !prompt && /\b(?:settings|preferences|profile|speed|fast[_\s-]*mode|reasoning|model[_\s-]*select|codex[_\s-]*app)\b/i.test(haystack);
|
|
184
|
+
}
|
|
185
|
+
export function looksLikeCodexGitAction(payload = {}) {
|
|
186
|
+
const prompt = stripVisibleDecisionAnswerBlocks(extractUserPrompt(payload));
|
|
187
|
+
const metadataText = codexGitActionMetadataText(payload);
|
|
188
|
+
const haystack = [
|
|
189
|
+
metadataText,
|
|
190
|
+
payload.action,
|
|
191
|
+
payload.intent,
|
|
192
|
+
payload.operation,
|
|
193
|
+
payload.permission,
|
|
194
|
+
payload.description,
|
|
195
|
+
payload.kind,
|
|
196
|
+
payload.type,
|
|
197
|
+
payload.feature,
|
|
198
|
+
payload.tool_name,
|
|
199
|
+
payload.toolName,
|
|
200
|
+
payload.source,
|
|
201
|
+
payload.event,
|
|
202
|
+
payload.hook,
|
|
203
|
+
payload.hook_name,
|
|
204
|
+
payload.input?.action,
|
|
205
|
+
payload.input?.intent,
|
|
206
|
+
payload.input?.operation,
|
|
207
|
+
payload.input?.feature,
|
|
208
|
+
payload.input?.source,
|
|
209
|
+
payload.metadata?.action,
|
|
210
|
+
payload.metadata?.intent,
|
|
211
|
+
payload.metadata?.operation,
|
|
212
|
+
payload.metadata?.feature,
|
|
213
|
+
payload.metadata?.source
|
|
214
|
+
].filter(Boolean).join(' ');
|
|
215
|
+
const codexAppGitSignal = /\bcodex[_\s-]*app\b[\s\S]{0,80}\bgit\b[\s\S]{0,80}\b(?:action|actions|commit|push|pr)\b/i.test(haystack);
|
|
216
|
+
const gitActionSignal = /\bgit[_\s-]*actions?\b[\s\S]{0,80}\b(?:commit|push|commit[\s_-]*(?:and|&)?[\s_-]*push)\b/i.test(haystack);
|
|
217
|
+
const appSignal = codexGitActionMetadataSignal(metadataText)
|
|
218
|
+
|| codexAppGitSignal
|
|
219
|
+
|| gitActionSignal
|
|
220
|
+
|| /\b(?:codex[_\s-]*(?:app[_\s-]*)?)?(?:git[_\s-]*)?(?:commit[_\s-]*message|git[_\s-]*commit|git[_\s-]*push|git[_\s-]*pr|codex_git_commit|codex_git_push|codex_git_pr)\b/i.test(haystack)
|
|
221
|
+
|| /커밋\s*메시지\s*생성/i.test(haystack);
|
|
222
|
+
const promptSignal = /\bgenerate(?:\s+a)?(?:\s+git)?\s+commit\s+message\b/i.test(prompt)
|
|
223
|
+
|| /\bcommit\s+message\b[\s\S]{0,80}\b(?:staged|diff|changes?|git)\b/i.test(prompt)
|
|
224
|
+
|| looksLikeStockCodexGitActionPrompt(prompt)
|
|
225
|
+
|| /커밋\s*메시지\s*생성/i.test(prompt);
|
|
226
|
+
if (!appSignal && !promptSignal)
|
|
227
|
+
return false;
|
|
228
|
+
if (looksLikeStockCodexGitActionPrompt(prompt))
|
|
229
|
+
return true;
|
|
230
|
+
if (appSignal)
|
|
231
|
+
return true;
|
|
232
|
+
return !looksLikeUserImplementationRequest(prompt);
|
|
233
|
+
}
|
|
234
|
+
export function looksLikeStockCodexGitActionPrompt(prompt = '') {
|
|
235
|
+
const text = String(prompt || '').trim();
|
|
236
|
+
if (!text || text.length > 120)
|
|
237
|
+
return false;
|
|
238
|
+
return /^(?:generate\s+(?:a\s+)?git\s+commit\s+message(?:\s+for\s+(?:the\s+)?(?:staged\s+)?diff)?|commit\s+changes|commit\s+and\s+push\s+changes|push\s+changes|create\s+(?:a\s+)?commit|create\s+(?:a\s+)?pull\s+request)\.?$/i.test(text);
|
|
239
|
+
}
|
|
240
|
+
export function looksLikeCodexGitActionStopCompletion(last = '', payload = {}) {
|
|
241
|
+
const text = String(last || '').trim();
|
|
242
|
+
const metadataText = codexGitActionMetadataText(payload);
|
|
243
|
+
const haystack = [
|
|
244
|
+
metadataText,
|
|
245
|
+
payload.action,
|
|
246
|
+
payload.intent,
|
|
247
|
+
payload.operation,
|
|
248
|
+
payload.kind,
|
|
249
|
+
payload.type,
|
|
250
|
+
payload.feature,
|
|
251
|
+
payload.source,
|
|
252
|
+
payload.event,
|
|
253
|
+
payload.metadata?.action,
|
|
254
|
+
payload.metadata?.intent,
|
|
255
|
+
payload.metadata?.operation,
|
|
256
|
+
payload.metadata?.feature,
|
|
257
|
+
payload.metadata?.source
|
|
258
|
+
].filter(Boolean).join(' ');
|
|
259
|
+
if (codexGitActionMetadataSignal(metadataText))
|
|
260
|
+
return true;
|
|
261
|
+
if (/\bcodex[_\s-]*app\b[\s\S]{0,80}\bgit\b[\s\S]{0,80}\b(?:action|commit|push|pr)\b/i.test(haystack))
|
|
262
|
+
return true;
|
|
263
|
+
if (!text || text.length > 180)
|
|
264
|
+
return false;
|
|
265
|
+
return /^(?:commit(?:ted)?(?:\s+and\s+pushed)?(?:\s+changes)?(?:\s+complete[.!]?)?|push(?:ed)?(?:\s+changes)?(?:\s+complete[.!]?)?|created\s+(?:a\s+)?pull\s+request[.!]?)$/i.test(text);
|
|
266
|
+
}
|
|
267
|
+
function looksLikeUserImplementationRequest(text = '') {
|
|
268
|
+
return /(fix|bug|broken|error|issue|implement|change|update|repair|수정|버그|오류|에러|문제|고쳐|고치|해결|변경|수리|패치|안생기|안\s*생기)/i.test(String(text || ''));
|
|
269
|
+
}
|
|
270
|
+
//# sourceMappingURL=payload-signals.js.map
|
|
@@ -30,7 +30,6 @@ export async function teamLiveDigest(root, state = {}) {
|
|
|
30
30
|
const lines = events.map(formatTeamDigestEvent);
|
|
31
31
|
const context = boundText([
|
|
32
32
|
`SKS Team live digest: mission ${id}, phase ${phase}, source ${source}.`,
|
|
33
|
-
`Open Zellij multi-view with: sks team open-zellij ${id}`,
|
|
34
33
|
`Open live view with: sks team watch ${id}`,
|
|
35
34
|
'Recent events:',
|
|
36
35
|
...lines.map((line) => `- ${line}`)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { nowIso, readJson, sha256, writeJsonAtomic } from '../fsx.js';
|
|
3
|
+
export const TOOL_OUTPUT_QUARANTINE_SCHEMA = 'sks.tool-output-quarantine.v1';
|
|
4
|
+
export function missingToolOutputCallId(text) {
|
|
5
|
+
return String(text || '').match(/\[No tool output found for (?:custom\s+)?tool call\s+([^\].\s]+)\.?\]/i)?.[1] || null;
|
|
6
|
+
}
|
|
7
|
+
export function missingToolOutputCallIdFromPayload(payload = {}) {
|
|
8
|
+
const candidates = [
|
|
9
|
+
payload.prompt,
|
|
10
|
+
payload.user_prompt,
|
|
11
|
+
payload.userPrompt,
|
|
12
|
+
payload.last_assistant_message,
|
|
13
|
+
payload.assistant_message,
|
|
14
|
+
payload.previous_assistant_message,
|
|
15
|
+
payload.prior_assistant_message,
|
|
16
|
+
payload.response,
|
|
17
|
+
payload.raw,
|
|
18
|
+
payload.error,
|
|
19
|
+
payload.error_message,
|
|
20
|
+
payload.errorMessage,
|
|
21
|
+
payload.last_error,
|
|
22
|
+
payload.raw_error,
|
|
23
|
+
payload.rawError,
|
|
24
|
+
payload.result
|
|
25
|
+
];
|
|
26
|
+
const seen = new Set();
|
|
27
|
+
let visited = 0;
|
|
28
|
+
const scan = (value, depth = 0) => {
|
|
29
|
+
if (visited >= 128 || depth > 4 || value === null || value === undefined)
|
|
30
|
+
return null;
|
|
31
|
+
visited += 1;
|
|
32
|
+
if (typeof value === 'string' || typeof value === 'number')
|
|
33
|
+
return missingToolOutputCallId(value);
|
|
34
|
+
if (typeof value !== 'object' || seen.has(value))
|
|
35
|
+
return null;
|
|
36
|
+
seen.add(value);
|
|
37
|
+
if (Array.isArray(value)) {
|
|
38
|
+
for (const item of value) {
|
|
39
|
+
const found = scan(item, depth + 1);
|
|
40
|
+
if (found)
|
|
41
|
+
return found;
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
for (const nested of Object.values(value)) {
|
|
46
|
+
const found = scan(nested, depth + 1);
|
|
47
|
+
if (found)
|
|
48
|
+
return found;
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
};
|
|
52
|
+
for (const candidate of candidates) {
|
|
53
|
+
const found = scan(candidate);
|
|
54
|
+
if (found)
|
|
55
|
+
return found;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
export function toolOutputQuarantinePath(root, sessionKey) {
|
|
60
|
+
return path.join(root, '.sneakoscope', 'state', 'tool-output-quarantine', `${sha256(String(sessionKey || 'default')).slice(0, 32)}.json`);
|
|
61
|
+
}
|
|
62
|
+
export async function readToolOutputQuarantine(root, sessionKey) {
|
|
63
|
+
const record = await readJson(toolOutputQuarantinePath(root, sessionKey), null).catch(() => null);
|
|
64
|
+
return record?.schema === TOOL_OUTPUT_QUARANTINE_SCHEMA && record.active === true ? record : null;
|
|
65
|
+
}
|
|
66
|
+
export async function quarantineMissingToolOutput(input) {
|
|
67
|
+
const previous = await readToolOutputQuarantine(input.root, input.sessionKey);
|
|
68
|
+
const now = nowIso();
|
|
69
|
+
const record = {
|
|
70
|
+
schema: TOOL_OUTPUT_QUARANTINE_SCHEMA,
|
|
71
|
+
active: true,
|
|
72
|
+
session_key_hash: sha256(String(input.sessionKey || 'default')).slice(0, 24),
|
|
73
|
+
call_id: String(input.callId || previous?.call_id || 'unknown'),
|
|
74
|
+
mission_id: String(input.missionId || previous?.mission_id || '').trim() || null,
|
|
75
|
+
turn_id: String(input.turnId || '').trim() || previous?.turn_id || null,
|
|
76
|
+
first_seen_at: previous?.first_seen_at || now,
|
|
77
|
+
updated_at: now,
|
|
78
|
+
recovery: 'fresh_thread_required'
|
|
79
|
+
};
|
|
80
|
+
await writeJsonAtomic(toolOutputQuarantinePath(input.root, input.sessionKey), record);
|
|
81
|
+
return record;
|
|
82
|
+
}
|
|
83
|
+
export function interruptedToolOutputRecoveryBlockReason(input = {}) {
|
|
84
|
+
const callId = String(input.callId || 'unknown');
|
|
85
|
+
const missionId = String(input.missionId || '').trim() || 'none';
|
|
86
|
+
return [
|
|
87
|
+
`SKS blocked same-thread continuation because custom tool call ${callId} has no correlated output (active mission: ${missionId}).`,
|
|
88
|
+
'The current Codex conversation state may be structurally invalid, so additional context cannot repair the pending Responses request.',
|
|
89
|
+
'Treat the call result as unknown and do not replay a possibly mutating action.',
|
|
90
|
+
'Upgrade the selected codex-lb to 1.21.0-beta.3 or later, or explicitly switch with `sks codex-lb use-oauth`, then open a fresh Codex thread and continue the persisted mission after inspecting side effects.'
|
|
91
|
+
].join(' ');
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=tool-output-quarantine.js.map
|