sneakoscope 2.0.14 → 2.0.16
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 +6 -3
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/crates/sks-core/src/main.rs +1 -1
- package/dist/.sks-build-stamp.json +4 -4
- package/dist/bin/sks.js +1 -1
- package/dist/cli/command-registry.js +2 -1
- package/dist/commands/mad-db.js +5 -0
- package/dist/commands/zellij-slot-pane.js +3 -1
- package/dist/core/agents/agent-orchestrator.js +66 -3
- package/dist/core/agents/agent-plan.js +3 -2
- package/dist/core/agents/agent-scheduler.js +204 -86
- package/dist/core/agents/agent-schema.js +1 -1
- package/dist/core/agents/native-cli-session-swarm.js +199 -15
- package/dist/core/agents/native-cli-worker.js +85 -0
- package/dist/core/agents/parallel-runtime-proof.js +217 -0
- package/dist/core/codex-control/codex-task-runner.js +32 -4
- package/dist/core/codex-control/model-call-concurrency.js +106 -0
- package/dist/core/commands/basic-cli.js +1 -1
- package/dist/core/commands/command-suggestions.js +1 -1
- package/dist/core/commands/mad-db-command.js +106 -0
- package/dist/core/commands/mad-sks-command.js +50 -13
- package/dist/core/commands/naruto-command.js +128 -5
- package/dist/core/commands/research-command.js +13 -1
- package/dist/core/commands/team-command.js +23 -175
- package/dist/core/db-safety.js +55 -1
- package/dist/core/fsx.js +1 -1
- package/dist/core/git/git-worktree-capability.js +18 -0
- package/dist/core/git/git-worktree-manager.js +80 -0
- package/dist/core/git/git-worktree-pool.js +4 -0
- package/dist/core/mad-db/mad-db-capability.js +116 -0
- package/dist/core/mad-db/mad-db-ledger.js +31 -0
- package/dist/core/mad-db/mad-db-policy-resolver.js +48 -0
- package/dist/core/naruto/naruto-concurrency-governor.js +14 -1
- package/dist/core/pipeline-internals/runtime-core.js +74 -8
- package/dist/core/pipeline-internals/runtime-gates.js +44 -0
- package/dist/core/proof/route-proof-gate.js +5 -3
- package/dist/core/proof/route-proof-policy.js +9 -1
- package/dist/core/release/release-gate-affected-selector.js +113 -0
- package/dist/core/release/release-gate-batch-runner.js +67 -0
- package/dist/core/release/release-gate-dag.js +22 -3
- package/dist/core/release/release-gate-resource-governor.js +23 -11
- package/dist/core/research/implementation-blueprint-densifier.js +1 -1
- package/dist/core/research/implementation-blueprint-markdown.js +1 -1
- package/dist/core/research/implementation-blueprint.js +68 -7
- package/dist/core/research/research-final-reviewer.js +27 -1
- package/dist/core/research/research-handoff.js +69 -5
- package/dist/core/research/research-realistic-report.js +162 -0
- package/dist/core/research/research-repetition-detector.js +75 -0
- package/dist/core/research/research-report-quality.js +27 -5
- package/dist/core/research/research-stage-runner.js +40 -13
- package/dist/core/research/research-synthesis-prompt.js +52 -0
- package/dist/core/research/research-synthesis-writer.js +208 -0
- package/dist/core/research.js +60 -48
- package/dist/core/routes.js +23 -19
- package/dist/core/update/update-notice.js +120 -0
- package/dist/core/version.js +1 -1
- package/dist/core/zellij/zellij-dashboard-renderer.js +2 -0
- package/dist/core/zellij/zellij-slot-column-anchor.js +35 -1
- package/dist/core/zellij/zellij-slot-pane-renderer.js +57 -0
- package/dist/core/zellij/zellij-slot-telemetry.js +237 -0
- package/dist/scripts/release-gate-dag-runner.js +5 -0
- package/dist/scripts/release-speed-summary.js +27 -0
- package/package.json +76 -5
- package/schemas/agents/parallel-runtime-proof.schema.json +48 -0
- package/schemas/mad-db/mad-db-capability.schema.json +31 -0
- package/schemas/mad-db/mad-db-ledger.schema.json +14 -0
- package/schemas/research/implementation-blueprint.schema.json +6 -1
- package/schemas/research/research-final-review.schema.json +10 -0
- package/schemas/research/research-synthesis-output.schema.json +62 -0
- package/schemas/update/update-notice.schema.json +19 -0
- package/schemas/zellij/zellij-slot-telemetry.schema.json +89 -0
- package/dist/scripts/agent-ast-aware-work-graph-check.js +0 -25
- package/dist/scripts/agent-backfill-replenishment-check.js +0 -13
- package/dist/scripts/agent-backfill-route-blackbox.js +0 -5
- package/dist/scripts/agent-background-terminals-check.js +0 -16
- package/dist/scripts/agent-cleanup-command-ux-check.js +0 -12
- package/dist/scripts/agent-cleanup-executor-check.js +0 -53
- package/dist/scripts/agent-cleanup-executor-v2-check.js +0 -39
- package/dist/scripts/agent-cli-options-to-task-graph-check.js +0 -5
- package/dist/scripts/agent-codex-app-cockpit-check.js +0 -91
- package/dist/scripts/agent-codex-child-overlap-check.js +0 -21
- package/dist/scripts/agent-dynamic-cockpit-check.js +0 -10
- package/dist/scripts/agent-dynamic-pool-check.js +0 -13
- package/dist/scripts/agent-dynamic-pool-route-blackbox.js +0 -5
- package/dist/scripts/agent-fast-mode-default-check.js +0 -62
- package/dist/scripts/agent-fast-mode-worker-propagation-check.js +0 -7
- package/dist/scripts/agent-follow-up-work-schema-check.js +0 -80
- package/dist/scripts/agent-goal-mode-propagation-check.js +0 -9
- package/dist/scripts/agent-intelligent-work-graph-check.js +0 -25
- package/dist/scripts/agent-janitor-check.js +0 -76
- package/dist/scripts/agent-main-no-scout-check.js +0 -11
- package/dist/scripts/agent-model-authored-patch-envelope-check.js +0 -15
- package/dist/scripts/agent-multi-project-isolation-check.js +0 -86
- package/dist/scripts/agent-native-cli-session-proof-check.js +0 -7
- package/dist/scripts/agent-native-cli-session-swarm-10-check.js +0 -7
- package/dist/scripts/agent-native-cli-session-swarm-20-check.js +0 -7
- package/dist/scripts/agent-native-cli-session-swarm-check.js +0 -7
- package/dist/scripts/agent-no-subagent-scaling-check.js +0 -7
- package/dist/scripts/agent-parallel-write-blackbox.js +0 -56
- package/dist/scripts/agent-parallel-write-kernel-check.js +0 -103
- package/dist/scripts/agent-patch-conflict-rebase-check.js +0 -198
- package/dist/scripts/agent-patch-envelope-extraction-check.js +0 -17
- package/dist/scripts/agent-patch-proof-check.js +0 -41
- package/dist/scripts/agent-patch-proof-runtime-check.js +0 -63
- package/dist/scripts/agent-patch-queue-runtime-check.js +0 -36
- package/dist/scripts/agent-patch-rollback-check.js +0 -38
- package/dist/scripts/agent-patch-rollback-dag-check.js +0 -14
- package/dist/scripts/agent-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/agent-patch-swarm-runtime-check.js +0 -10
- package/dist/scripts/agent-patch-swarm-runtime-truth-check.js +0 -76
- package/dist/scripts/agent-patch-transaction-journal-check.js +0 -57
- package/dist/scripts/agent-patch-verification-dag-check.js +0 -14
- package/dist/scripts/agent-proof-contract-reconciled-check.js +0 -5
- package/dist/scripts/agent-real-codex-dynamic-smoke-check.js +0 -166
- package/dist/scripts/agent-real-codex-dynamic-smoke-v2-check.js +0 -14
- package/dist/scripts/agent-real-codex-in-zellij-worker-pane-check.js +0 -229
- package/dist/scripts/agent-real-codex-parallel-workers-10-check.js +0 -5
- package/dist/scripts/agent-real-codex-parallel-workers-20-check.js +0 -5
- package/dist/scripts/agent-real-codex-parallel-workers-5-check.js +0 -5
- package/dist/scripts/agent-real-codex-parallel-workers-check.js +0 -5
- package/dist/scripts/agent-role-config-repair-check.js +0 -33
- package/dist/scripts/agent-rollback-command-check.js +0 -86
- package/dist/scripts/agent-route-truth-backfill-check.js +0 -5
- package/dist/scripts/agent-scheduler-proof-check.js +0 -13
- package/dist/scripts/agent-scheduler-proof-hardening-check.js +0 -22
- package/dist/scripts/agent-session-generation-check.js +0 -21
- package/dist/scripts/agent-slot-pane-binding-proof-check.js +0 -64
- package/dist/scripts/agent-source-intelligence-propagation-check.js +0 -9
- package/dist/scripts/agent-strategy-to-lease-wiring-check.js +0 -32
- package/dist/scripts/agent-strategy-to-patch-strict-check.js +0 -54
- package/dist/scripts/agent-task-graph-expansion-check.js +0 -14
- package/dist/scripts/agent-terminal-generations-check.js +0 -23
- package/dist/scripts/agent-visual-consistency-check.js +0 -9
- package/dist/scripts/agent-wiki-context-proof-check.js +0 -62
- package/dist/scripts/agent-worker-backend-router-check.js +0 -63
- package/dist/scripts/agent-worker-scout-limited-check.js +0 -17
- package/dist/scripts/agent-zellij-dynamic-backfill-panes-check.js +0 -34
- package/dist/scripts/agent-zellij-runtime-check.js +0 -84
- package/dist/scripts/all-feature-deep-completion-check.js +0 -31
- package/dist/scripts/appshots-capability-check.js +0 -18
- package/dist/scripts/appshots-evidence-check.js +0 -48
- package/dist/scripts/appshots-operator-policy-check.js +0 -25
- package/dist/scripts/appshots-privacy-safety-check.js +0 -48
- package/dist/scripts/appshots-source-intelligence-check.js +0 -53
- package/dist/scripts/appshots-thread-attachment-discovery-check.js +0 -87
- package/dist/scripts/appshots-triwiki-voxel-check.js +0 -46
- package/dist/scripts/architecture-guard-check.js +0 -55
- package/dist/scripts/changelog-check.js +0 -47
- package/dist/scripts/codex-0-133-official-compat-report.js +0 -53
- package/dist/scripts/codex-0-134-official-compat-report.js +0 -110
- package/dist/scripts/codex-0-134-runner-truth-check.js +0 -66
- package/dist/scripts/codex-0-135-compat-check.js +0 -57
- package/dist/scripts/codex-0-136-compat-check.js +0 -30
- package/dist/scripts/codex-0-137-compat-check.js +0 -27
- package/dist/scripts/codex-app-fast-ui-preservation-check.js +0 -32
- package/dist/scripts/codex-app-provider-badge-check.js +0 -37
- package/dist/scripts/codex-app-ui-clobber-guard-check.js +0 -22
- package/dist/scripts/codex-app-ui-preservation-check.js +0 -96
- package/dist/scripts/codex-control-all-pipelines-check.js +0 -36
- package/dist/scripts/codex-control-capability-check.js +0 -10
- package/dist/scripts/codex-control-empty-result-retry-check.js +0 -43
- package/dist/scripts/codex-control-event-stream-ledger-check.js +0 -10
- package/dist/scripts/codex-control-keepalive-no-cot-leak-check.js +0 -14
- package/dist/scripts/codex-control-no-legacy-fallback-check.js +0 -31
- package/dist/scripts/codex-control-side-effect-scope-check.js +0 -26
- package/dist/scripts/codex-control-stream-idle-watchdog-check.js +0 -18
- package/dist/scripts/codex-control-structured-output-check.js +0 -11
- package/dist/scripts/codex-control-thread-registry-check.js +0 -11
- package/dist/scripts/codex-control-tool-call-sequence-repair-check.js +0 -14
- package/dist/scripts/codex-environment-scoped-approvals-check.js +0 -10
- package/dist/scripts/codex-exec-output-schema-actual-syntax-check.js +0 -33
- package/dist/scripts/codex-fast-mode-profile-propagation-check.js +0 -12
- package/dist/scripts/codex-history-search-check.js +0 -19
- package/dist/scripts/codex-hook-semantic-check.js +0 -15
- package/dist/scripts/codex-hook-strict-subset-check.js +0 -61
- package/dist/scripts/codex-lb-config-toml-safety-check.js +0 -85
- package/dist/scripts/codex-lb-persistence-truth-check.js +0 -96
- package/dist/scripts/codex-lb-setup-fixture-check.js +0 -91
- package/dist/scripts/codex-lb-setup-truthfulness-check.js +0 -84
- package/dist/scripts/codex-legacy-profile-consumers-removed-check.js +0 -24
- package/dist/scripts/codex-managed-proxy-env-check.js +0 -17
- package/dist/scripts/codex-output-schema-fixture-check.js +0 -25
- package/dist/scripts/codex-permission-profiles-check.js +0 -36
- package/dist/scripts/codex-plugin-list-json-check.js +0 -8
- package/dist/scripts/codex-profile-primary-check.js +0 -13
- package/dist/scripts/codex-project-config-policy-splitter-check.js +0 -51
- package/dist/scripts/codex-resume-cwd-truth-check.js +0 -17
- package/dist/scripts/codex-sdk-all-pipelines-check.js +0 -32
- package/dist/scripts/codex-sdk-backend-router-check.js +0 -65
- package/dist/scripts/codex-sdk-capability-check.js +0 -11
- package/dist/scripts/codex-sdk-core-skill-pipeline-check.js +0 -9
- package/dist/scripts/codex-sdk-dfix-pipeline-check.js +0 -9
- package/dist/scripts/codex-sdk-event-stream-ledger-check.js +0 -9
- package/dist/scripts/codex-sdk-no-legacy-fallback-check.js +0 -33
- package/dist/scripts/codex-sdk-qa-pipeline-check.js +0 -8
- package/dist/scripts/codex-sdk-real-smoke-check.js +0 -39
- package/dist/scripts/codex-sdk-release-review-pipeline-check.js +0 -13
- package/dist/scripts/codex-sdk-research-pipeline-check.js +0 -47
- package/dist/scripts/codex-sdk-sandbox-policy-check.js +0 -21
- package/dist/scripts/codex-sdk-structured-output-check.js +0 -10
- package/dist/scripts/codex-sdk-team-naruto-agent-pipeline-check.js +0 -12
- package/dist/scripts/codex-sdk-thread-registry-check.js +0 -11
- package/dist/scripts/codex-sdk-ux-ppt-review-pipeline-check.js +0 -9
- package/dist/scripts/codex-sdk-zellij-pane-binding-check.js +0 -13
- package/dist/scripts/codex-thread-runtime-choice-check.js +0 -10
- package/dist/scripts/codex-web-adapter-check.js +0 -12
- package/dist/scripts/computer-use-live-evidence-check.js +0 -55
- package/dist/scripts/computer-use-live-optional-check.js +0 -32
- package/dist/scripts/computer-use-policy-check.js +0 -69
- package/dist/scripts/computer-use-visual-route-fixture-check.js +0 -37
- package/dist/scripts/core-skill-card-schema-check.js +0 -61
- package/dist/scripts/core-skill-deployment-snapshot-check.js +0 -54
- package/dist/scripts/core-skill-heldout-validation-check.js +0 -49
- package/dist/scripts/core-skill-no-inference-optimizer-check.js +0 -75
- package/dist/scripts/core-skill-patch-check.js +0 -79
- package/dist/scripts/core-skill-promotion-side-effect-ledger-check.js +0 -64
- package/dist/scripts/core-skill-rollout-scoring-check.js +0 -72
- package/dist/scripts/core-skill-route-runtime-integration-check.js +0 -49
- package/dist/scripts/dfix-fast-blackbox-check.js +0 -37
- package/dist/scripts/dfix-fast-kernel-check.js +0 -26
- package/dist/scripts/dfix-fixture-check.js +0 -6
- package/dist/scripts/dfix-parallel-write-blackbox.js +0 -48
- package/dist/scripts/dfix-patch-handoff-check.js +0 -13
- package/dist/scripts/dfix-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/dfix-performance-check.js +0 -15
- package/dist/scripts/dfix-verification-check.js +0 -9
- package/dist/scripts/dfix-verification-recommendation-check.js +0 -15
- package/dist/scripts/docs-truthfulness-check.js +0 -61
- package/dist/scripts/doctor-codex-doctor-parity-check.js +0 -17
- package/dist/scripts/doctor-fix-proves-codex-read-check.js +0 -64
- package/dist/scripts/doctor-fix-recovers-corrupted-config-check.js +0 -122
- package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +0 -39
- package/dist/scripts/evidence-fixture-check.js +0 -26
- package/dist/scripts/evidence-flagship-coverage-check.js +0 -55
- package/dist/scripts/fake-real-proof-policy-v2-check.js +0 -27
- package/dist/scripts/fake-vs-real-proof-policy-check.js +0 -14
- package/dist/scripts/fast-codex-service-tier-proof-check.js +0 -42
- package/dist/scripts/flagship-proof-graph-v2-check.js +0 -48
- package/dist/scripts/flagship-proof-graph-v3-check.js +0 -67
- package/dist/scripts/flagship-proof-graph-v4-check.js +0 -61
- package/dist/scripts/git-precommit-fixture-check.js +0 -41
- package/dist/scripts/git-worktree-cache-performance-check.js +0 -25
- package/dist/scripts/git-worktree-capability-check.js +0 -27
- package/dist/scripts/git-worktree-checkpoint-check.js +0 -20
- package/dist/scripts/git-worktree-cleanup-check.js +0 -27
- package/dist/scripts/git-worktree-cross-rebase-check.js +0 -39
- package/dist/scripts/git-worktree-diff-envelope-check.js +0 -17
- package/dist/scripts/git-worktree-diff-export-check.js +0 -43
- package/dist/scripts/git-worktree-dirty-lock-check.js +0 -17
- package/dist/scripts/git-worktree-dirty-main-detection-check.js +0 -14
- package/dist/scripts/git-worktree-integration-primary-check.js +0 -24
- package/dist/scripts/git-worktree-integration-primary-runtime-check.js +0 -20
- package/dist/scripts/git-worktree-manager-check.js +0 -37
- package/dist/scripts/git-worktree-manifest-append-check.js +0 -18
- package/dist/scripts/git-worktree-merge-queue-check.js +0 -31
- package/dist/scripts/git-worktree-pool-performance-check.js +0 -20
- package/dist/scripts/git-worktree-untracked-diff-check.js +0 -18
- package/dist/scripts/goal-mode-official-default-check.js +0 -12
- package/dist/scripts/gpt-final-arbiter-check.js +0 -63
- package/dist/scripts/gpt-final-arbiter-performance-check.js +0 -36
- package/dist/scripts/gpt-image-2-request-validator-check.js +0 -35
- package/dist/scripts/hooks-0.134-context-parity-check.js +0 -20
- package/dist/scripts/hooks-actual-parity-check.js +0 -17
- package/dist/scripts/hooks-actual-parity-v2-check.js +0 -21
- package/dist/scripts/hooks-latest-schema-check.js +0 -20
- package/dist/scripts/hooks-managed-install-fixture-check.js +0 -21
- package/dist/scripts/hooks-official-hash-oracle-check.js +0 -35
- package/dist/scripts/hooks-official-hash-parity-check.js +0 -17
- package/dist/scripts/hooks-subagent-events-check.js +0 -17
- package/dist/scripts/hooks-trust-state-check.js +0 -14
- package/dist/scripts/image-fidelity-fixture-check.js +0 -24
- package/dist/scripts/imagegen-capability-check.js +0 -30
- package/dist/scripts/imagegen-real-smoke-check.js +0 -155
- package/dist/scripts/install-update-preserves-config-check.js +0 -87
- package/dist/scripts/json-schema-recursive-check.js +0 -78
- package/dist/scripts/legacy-multiagent-removal-check.js +0 -85
- package/dist/scripts/legacy-upgrade-matrix-check.js +0 -300
- package/dist/scripts/local-collab-all-pipelines-final-gpt-check.js +0 -21
- package/dist/scripts/local-collab-gpt-final-availability-check.js +0 -58
- package/dist/scripts/local-collab-no-local-only-final-check.js +0 -27
- package/dist/scripts/local-collab-policy-check.js +0 -17
- package/dist/scripts/local-collab-worktree-gpt-final-apply-policy-check.js +0 -63
- package/dist/scripts/local-llm-all-pipelines-check.js +0 -11
- package/dist/scripts/local-llm-cache-performance-check.js +0 -10
- package/dist/scripts/local-llm-capability-check.js +0 -14
- package/dist/scripts/local-llm-smoke-check.js +0 -23
- package/dist/scripts/local-llm-structured-output-check.js +0 -11
- package/dist/scripts/local-llm-throughput-check.js +0 -10
- package/dist/scripts/local-llm-tool-call-repair-check.js +0 -10
- package/dist/scripts/local-llm-warmup-check.js +0 -11
- package/dist/scripts/loop-blocker-check.js +0 -15
- package/dist/scripts/mad-preflight-blocks-unreadable-config-check.js +0 -35
- package/dist/scripts/mad-sks-actual-executor-blackbox.js +0 -5
- package/dist/scripts/mad-sks-app-ui-no-mutation-check.js +0 -92
- package/dist/scripts/mad-sks-audit-proof-check.js +0 -34
- package/dist/scripts/mad-sks-db-executor-check.js +0 -5
- package/dist/scripts/mad-sks-executor-proof-graph-check.js +0 -5
- package/dist/scripts/mad-sks-fast-mode-propagation-check.js +0 -24
- package/dist/scripts/mad-sks-file-write-executor-check.js +0 -5
- package/dist/scripts/mad-sks-immutable-harness-check.js +0 -36
- package/dist/scripts/mad-sks-no-harness-modification-check.js +0 -25
- package/dist/scripts/mad-sks-package-executor-check.js +0 -5
- package/dist/scripts/mad-sks-permission-model-check.js +0 -22
- package/dist/scripts/mad-sks-rollback-apply-check.js +0 -5
- package/dist/scripts/mad-sks-service-executor-check.js +0 -5
- package/dist/scripts/mad-sks-shell-executor-check.js +0 -5
- package/dist/scripts/mad-sks-write-guard-check.js +0 -28
- package/dist/scripts/mad-sks-zellij-default-pane-worker-check.js +0 -37
- package/dist/scripts/mad-sks-zellij-launch-check.js +0 -102
- package/dist/scripts/mcp-0-134-modernization-check.js +0 -55
- package/dist/scripts/mcp-readonly-concurrency-check.js +0 -17
- package/dist/scripts/mcp-readonly-runtime-scheduler-check.js +0 -20
- package/dist/scripts/mcp-tool-naming-parity-check.js +0 -16
- package/dist/scripts/memory-summary-rebuild-check.js +0 -22
- package/dist/scripts/mutation-callsite-coverage-check.js +0 -180
- package/dist/scripts/naruto-active-pool-check.js +0 -39
- package/dist/scripts/naruto-actual-worker-control-plane-check.js +0 -56
- package/dist/scripts/naruto-allocation-policy-check.js +0 -33
- package/dist/scripts/naruto-allocation-runtime-wiring-check.js +0 -92
- package/dist/scripts/naruto-concurrency-governor-check.js +0 -53
- package/dist/scripts/naruto-extreme-parallelism-check.js +0 -22
- package/dist/scripts/naruto-extreme-parallelism-real-check.js +0 -43
- package/dist/scripts/naruto-gpt-final-pack-check.js +0 -34
- package/dist/scripts/naruto-orchestrator-runtime-source-check.js +0 -70
- package/dist/scripts/naruto-parallel-patch-apply-check.js +0 -41
- package/dist/scripts/naruto-readonly-routing-check.js +0 -116
- package/dist/scripts/naruto-real-active-pool-check.js +0 -39
- package/dist/scripts/naruto-real-active-pool-runtime-check.js +0 -55
- package/dist/scripts/naruto-rebalance-policy-check.js +0 -41
- package/dist/scripts/naruto-role-distribution-check.js +0 -23
- package/dist/scripts/naruto-shadow-clone-swarm-check.js +0 -153
- package/dist/scripts/naruto-verification-pool-check.js +0 -36
- package/dist/scripts/naruto-work-graph-check.js +0 -24
- package/dist/scripts/naruto-worktree-coding-blackbox.js +0 -29
- package/dist/scripts/naruto-worktree-coding-check.js +0 -44
- package/dist/scripts/naruto-worktree-gpt-final-check.js +0 -45
- package/dist/scripts/naruto-worktree-zellij-ui-check.js +0 -28
- package/dist/scripts/naruto-zellij-dynamic-right-column-check.js +0 -48
- package/dist/scripts/naruto-zellij-massive-ui-check.js +0 -23
- package/dist/scripts/non-recursive-pipeline-check.js +0 -68
- package/dist/scripts/npm-publish-performance-check.js +0 -65
- package/dist/scripts/official-docs-compat-report.js +0 -304
- package/dist/scripts/packlist-performance-check.js +0 -83
- package/dist/scripts/parallel-verification-engine-check.js +0 -85
- package/dist/scripts/postinstall-safe-side-effects-check.js +0 -65
- package/dist/scripts/ppt-full-e2e-artifact-graph-check.js +0 -40
- package/dist/scripts/ppt-full-e2e-blackbox-check.js +0 -109
- package/dist/scripts/ppt-image-voxel-relations-check.js +0 -9
- package/dist/scripts/ppt-imagegen-blackbox-check.js +0 -46
- package/dist/scripts/ppt-imagegen-review-fixture-check.js +0 -6
- package/dist/scripts/ppt-issue-extraction-fixture-check.js +0 -7
- package/dist/scripts/ppt-no-mock-as-real-check.js +0 -8
- package/dist/scripts/ppt-no-text-fallback-check.js +0 -7
- package/dist/scripts/ppt-proof-trust-fixture-check.js +0 -10
- package/dist/scripts/ppt-real-export-adapter-check.js +0 -13
- package/dist/scripts/ppt-real-imagegen-smoke-check.js +0 -42
- package/dist/scripts/ppt-real-imagegen-wiring-check.js +0 -16
- package/dist/scripts/ppt-reexport-rereview-check.js +0 -19
- package/dist/scripts/ppt-slide-export-fixture-check.js +0 -7
- package/dist/scripts/prepublish-fast-check.js +0 -128
- package/dist/scripts/priority-full-closure-check.js +0 -12
- package/dist/scripts/product-design-auto-install-check.js +0 -119
- package/dist/scripts/product-design-plugin-routing-check.js +0 -101
- package/dist/scripts/prompt-placeholder-guard-check.js +0 -33
- package/dist/scripts/provider-badge-context-check.js +0 -26
- package/dist/scripts/provider-context-config-toml-check.js +0 -63
- package/dist/scripts/python-codex-sdk-all-pipelines-check.js +0 -47
- package/dist/scripts/python-codex-sdk-capability-check.js +0 -75
- package/dist/scripts/python-codex-sdk-sandbox-policy-check.js +0 -10
- package/dist/scripts/python-codex-sdk-stream-bridge-check.js +0 -12
- package/dist/scripts/python-tools-smoke-check.js +0 -71
- package/dist/scripts/qa-actual-route-backfill-check.js +0 -5
- package/dist/scripts/qa-backfill-route-blackbox.js +0 -5
- package/dist/scripts/qa-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/readme-architecture-imagegen-official-check.js +0 -448
- package/dist/scripts/release-cache-glob-hashing-check.js +0 -42
- package/dist/scripts/release-dag-full-coverage-check.js +0 -66
- package/dist/scripts/release-dist-freshness-check.js +0 -8
- package/dist/scripts/release-dynamic-performance-check.js +0 -103
- package/dist/scripts/release-gate-budget-check.js +0 -36
- package/dist/scripts/release-gate-dag-runner-check.js +0 -17
- package/dist/scripts/release-metadata-1-11-check.js +0 -37
- package/dist/scripts/release-metadata-1-12-check.js +0 -48
- package/dist/scripts/release-metadata-1-13-check.js +0 -53
- package/dist/scripts/release-metadata-1-14-check.js +0 -63
- package/dist/scripts/release-metadata-1-16-check.js +0 -81
- package/dist/scripts/release-metadata-1-17-check.js +0 -51
- package/dist/scripts/release-metadata-1-19-check.js +0 -371
- package/dist/scripts/release-metadata-check.js +0 -7
- package/dist/scripts/release-native-agent-fixture-check.js +0 -41
- package/dist/scripts/release-parallel-check.js +0 -374
- package/dist/scripts/release-parallel-full-coverage-check.js +0 -13
- package/dist/scripts/release-parallel-speed-budget-check.js +0 -84
- package/dist/scripts/release-provenance-check.js +0 -150
- package/dist/scripts/release-real-check.js +0 -330
- package/dist/scripts/release-registry-check.js +0 -344
- package/dist/scripts/release-runtime-truth-matrix-check.js +0 -47
- package/dist/scripts/release-stability-report-check.js +0 -99
- package/dist/scripts/release-version-truth-check.js +0 -134
- package/dist/scripts/research-actual-route-backfill-check.js +0 -5
- package/dist/scripts/research-backfill-route-blackbox.js +0 -5
- package/dist/scripts/research-blueprint-densifier-check.js +0 -21
- package/dist/scripts/research-claim-builder-check.js +0 -19
- package/dist/scripts/research-complete-package-fixture-check.js +0 -23
- package/dist/scripts/research-final-reviewer-blackbox.js +0 -22
- package/dist/scripts/research-parallel-source-shards-check.js +0 -22
- package/dist/scripts/research-quality-gate-check.js +0 -111
- package/dist/scripts/research-real-cycle-no-legacy-final-md-check.js +0 -14
- package/dist/scripts/research-short-report-rejection-check.js +0 -46
- package/dist/scripts/research-source-ledger-merge-check.js +0 -26
- package/dist/scripts/research-stage-cycle-runtime-blackbox.js +0 -24
- package/dist/scripts/responses-retry-policy-centralized-check.js +0 -19
- package/dist/scripts/retention-cleanup-safety-check.js +0 -155
- package/dist/scripts/route-blackbox-realism-check.js +0 -21
- package/dist/scripts/route-proof-artifact-structure-check.js +0 -145
- package/dist/scripts/runtime-dist-parity-check.js +0 -78
- package/dist/scripts/runtime-no-mjs-scripts-check.js +0 -45
- package/dist/scripts/runtime-no-src-mjs-check.js +0 -32
- package/dist/scripts/runtime-no-tmux-check.js +0 -113
- package/dist/scripts/runtime-ts-python-boundary-check.js +0 -59
- package/dist/scripts/runtime-ts-rust-boundary-check.js +0 -74
- package/dist/scripts/runtime-ts-source-of-truth-check.js +0 -55
- package/dist/scripts/safety-check.js +0 -23
- package/dist/scripts/shared-memory-fixture-check.js +0 -27
- package/dist/scripts/side-effect-runtime-report-check.js +0 -19
- package/dist/scripts/side-effect-zero-gate-check.js +0 -226
- package/dist/scripts/sks-1-11-fixture-check.js +0 -130
- package/dist/scripts/source-intelligence-all-modes-check.js +0 -32
- package/dist/scripts/source-intelligence-policy-check.js +0 -13
- package/dist/scripts/strategy-adhd-orchestrating-gate-check.js +0 -22
- package/dist/scripts/strategy-file-ownership-plan-check.js +0 -18
- package/dist/scripts/strategy-parallel-modification-plan-check.js +0 -19
- package/dist/scripts/strategy-verification-rollback-dag-check.js +0 -19
- package/dist/scripts/team-actual-route-backfill-check.js +0 -5
- package/dist/scripts/team-backfill-route-blackbox.js +0 -5
- package/dist/scripts/team-parallel-write-blackbox.js +0 -55
- package/dist/scripts/team-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/terminal-keyboard-enhancement-safety-check.js +0 -12
- package/dist/scripts/terminal-tui-output-stability-check.js +0 -35
- package/dist/scripts/test-no-orphan-dist-imports-check.js +0 -73
- package/dist/scripts/trust-fixture-check.js +0 -33
- package/dist/scripts/typescript-migration-report.js +0 -78
- package/dist/scripts/ultra-router-auto-router-check.js +0 -33
- package/dist/scripts/ultra-router-classification-check.js +0 -28
- package/dist/scripts/ux-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/ux-ppt-structured-extraction-check.js +0 -21
- package/dist/scripts/ux-review-extract-real-callouts-fixture-check.js +0 -8
- package/dist/scripts/ux-review-extract-wires-real-extractor-check.js +0 -15
- package/dist/scripts/ux-review-generate-callouts-fixture-check.js +0 -9
- package/dist/scripts/ux-review-image-voxel-relations-check.js +0 -31
- package/dist/scripts/ux-review-imagegen-blackbox-check.js +0 -67
- package/dist/scripts/ux-review-no-fake-callouts-check.js +0 -8
- package/dist/scripts/ux-review-no-text-fallback-check.js +0 -25
- package/dist/scripts/ux-review-patch-diff-recheck-check.js +0 -20
- package/dist/scripts/ux-review-patch-handoff-fixture-check.js +0 -8
- package/dist/scripts/ux-review-real-imagegen-smoke-check.js +0 -31
- package/dist/scripts/ux-review-real-loop-fixture-check.js +0 -24
- package/dist/scripts/ux-review-recapture-recheck-fixture-check.js +0 -8
- package/dist/scripts/ux-review-run-wires-imagegen-check.js +0 -11
- package/dist/scripts/worker-pane-communication-contract-check.js +0 -54
- package/dist/scripts/wrongness-fixture-check.js +0 -65
- package/dist/scripts/xai-mcp-capability-check.js +0 -14
- package/dist/scripts/zellij-capability-check.js +0 -15
- package/dist/scripts/zellij-dashboard-pane-check.js +0 -70
- package/dist/scripts/zellij-developer-controls-check.js +0 -20
- package/dist/scripts/zellij-doctor-readiness-check.js +0 -63
- package/dist/scripts/zellij-dynamic-pane-lifecycle-check.js +0 -21
- package/dist/scripts/zellij-first-slot-down-stack-check.js +0 -20
- package/dist/scripts/zellij-first-slot-down-stack-real-check.js +0 -356
- package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -28
- package/dist/scripts/zellij-lane-renderer-check.js +0 -65
- package/dist/scripts/zellij-launch-command-truth-check.js +0 -75
- package/dist/scripts/zellij-layout-valid-check.js +0 -90
- package/dist/scripts/zellij-pane-proof-check.js +0 -59
- package/dist/scripts/zellij-real-session-cleanup-check.js +0 -21
- package/dist/scripts/zellij-real-session-heartbeat-check.js +0 -49
- package/dist/scripts/zellij-real-session-launch-check.js +0 -57
- package/dist/scripts/zellij-right-column-headless-overflow-check.js +0 -22
- package/dist/scripts/zellij-right-column-manager-check.js +0 -27
- package/dist/scripts/zellij-screen-proof-check.js +0 -45
- package/dist/scripts/zellij-slot-column-anchor-check.js +0 -66
- package/dist/scripts/zellij-slot-only-ui-check.js +0 -26
- package/dist/scripts/zellij-slot-pane-renderer-check.js +0 -106
- package/dist/scripts/zellij-slot-renderer-proof-semantics-check.js +0 -59
- package/dist/scripts/zellij-spawn-on-demand-layout-check.js +0 -40
- package/dist/scripts/zellij-ui-design-check.js +0 -105
- package/dist/scripts/zellij-worker-pane-manager-check.js +0 -109
- package/dist/scripts/zellij-worker-pane-manager-single-owner-check.js +0 -47
- package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -202
- package/dist/scripts/zellij-worker-pane-spawn-order-check.js +0 -35
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { appendJsonlBounded, ensureDir, nowIso, readText, writeJsonAtomic } from '../fsx.js';
|
|
3
|
+
export const PARALLEL_RUNTIME_EVENT_SCHEMA = 'sks.parallel-runtime-event.v1';
|
|
4
|
+
export const PARALLEL_RUNTIME_PROOF_SCHEMA = 'sks.parallel-runtime-proof.v1';
|
|
5
|
+
export function parallelRuntimeEventPath(root, missionId) {
|
|
6
|
+
return path.join(inferAgentsDir(root, missionId), 'parallel-runtime.events.jsonl');
|
|
7
|
+
}
|
|
8
|
+
export function parallelRuntimeProofPath(root, missionId) {
|
|
9
|
+
return path.join(inferAgentsDir(root, missionId), 'parallel-runtime-proof.json');
|
|
10
|
+
}
|
|
11
|
+
export async function appendParallelRuntimeEvent(root, missionId, event) {
|
|
12
|
+
const row = normalizeParallelRuntimeEvent(missionId, event);
|
|
13
|
+
const file = parallelRuntimeEventPath(root, missionId);
|
|
14
|
+
await ensureDir(path.dirname(file));
|
|
15
|
+
await appendJsonlBounded(file, row);
|
|
16
|
+
return row;
|
|
17
|
+
}
|
|
18
|
+
export async function buildParallelRuntimeProof(root, missionId, opts = {}) {
|
|
19
|
+
const events = await readParallelRuntimeEvents(root, missionId);
|
|
20
|
+
const sorted = events.sort((a, b) => a.ms - b.ms);
|
|
21
|
+
const firstMs = sorted[0]?.ms || Date.now();
|
|
22
|
+
const lastMs = sorted[sorted.length - 1]?.ms || firstMs;
|
|
23
|
+
const workerActive = new Set();
|
|
24
|
+
const processActive = new Set();
|
|
25
|
+
const modelActive = new Set();
|
|
26
|
+
const workerStarts = new Map();
|
|
27
|
+
const workerDurations = [];
|
|
28
|
+
const workerPids = new Set();
|
|
29
|
+
const modelIds = new Set();
|
|
30
|
+
const overlapWindows = [];
|
|
31
|
+
let maxWorkers = 0;
|
|
32
|
+
let maxProcesses = 0;
|
|
33
|
+
let maxModels = 0;
|
|
34
|
+
let previousMs = firstMs;
|
|
35
|
+
let firstBatchLaunchSpanMs = 0;
|
|
36
|
+
const batchStart = new Map();
|
|
37
|
+
const batchCompleted = new Map();
|
|
38
|
+
for (const event of sorted) {
|
|
39
|
+
if (event.ms > previousMs) {
|
|
40
|
+
overlapWindows.push({
|
|
41
|
+
start_ms: previousMs - firstMs,
|
|
42
|
+
end_ms: event.ms - firstMs,
|
|
43
|
+
active_workers: workerActive.size,
|
|
44
|
+
active_model_calls: modelActive.size
|
|
45
|
+
});
|
|
46
|
+
previousMs = event.ms;
|
|
47
|
+
}
|
|
48
|
+
const workerKey = event.session_id || event.slot_id || (event.pid == null ? '' : `pid:${event.pid}`);
|
|
49
|
+
const processKey = event.pid == null ? workerKey : `pid:${event.pid}`;
|
|
50
|
+
if (event.event_type === 'batch_dispatch_started' && event.batch_id)
|
|
51
|
+
batchStart.set(event.batch_id, event.ms);
|
|
52
|
+
if (event.event_type === 'batch_dispatch_completed' && event.batch_id) {
|
|
53
|
+
batchCompleted.set(event.batch_id, event.ms);
|
|
54
|
+
const started = batchStart.get(event.batch_id);
|
|
55
|
+
if (started != null && firstBatchLaunchSpanMs === 0)
|
|
56
|
+
firstBatchLaunchSpanMs = Math.max(0, event.ms - started);
|
|
57
|
+
}
|
|
58
|
+
if (event.event_type === 'worker_launch_invoked' || event.event_type === 'worker_process_spawned') {
|
|
59
|
+
if (workerKey) {
|
|
60
|
+
workerActive.add(workerKey);
|
|
61
|
+
if (!workerStarts.has(workerKey))
|
|
62
|
+
workerStarts.set(workerKey, event.ms);
|
|
63
|
+
}
|
|
64
|
+
if (event.event_type === 'worker_process_spawned' && processKey)
|
|
65
|
+
processActive.add(processKey);
|
|
66
|
+
if (event.pid != null)
|
|
67
|
+
workerPids.add(event.pid);
|
|
68
|
+
}
|
|
69
|
+
if (event.event_type === 'worker_completed' || event.event_type === 'worker_failed') {
|
|
70
|
+
if (workerKey) {
|
|
71
|
+
workerActive.delete(workerKey);
|
|
72
|
+
const started = workerStarts.get(workerKey);
|
|
73
|
+
if (started != null)
|
|
74
|
+
workerDurations.push(Math.max(0, event.ms - started));
|
|
75
|
+
}
|
|
76
|
+
if (processKey)
|
|
77
|
+
processActive.delete(processKey);
|
|
78
|
+
}
|
|
79
|
+
if (event.event_type === 'model_call_started') {
|
|
80
|
+
const id = event.model_call_id || event.session_id || `model:${event.ms}:${modelActive.size}`;
|
|
81
|
+
modelActive.add(id);
|
|
82
|
+
modelIds.add(id);
|
|
83
|
+
}
|
|
84
|
+
if (event.event_type === 'model_call_completed') {
|
|
85
|
+
const id = event.model_call_id || event.session_id || '';
|
|
86
|
+
if (id)
|
|
87
|
+
modelActive.delete(id);
|
|
88
|
+
}
|
|
89
|
+
maxWorkers = Math.max(maxWorkers, workerActive.size);
|
|
90
|
+
maxProcesses = Math.max(maxProcesses, processActive.size);
|
|
91
|
+
maxModels = Math.max(maxModels, modelActive.size);
|
|
92
|
+
}
|
|
93
|
+
const requestedWorkers = positiveInt(opts.requestedWorkers, workerStarts.size || workerPids.size || maxWorkers);
|
|
94
|
+
const targetActiveSlots = positiveInt(opts.targetActiveSlots, requestedWorkers);
|
|
95
|
+
const wallMs = Math.max(0, lastMs - firstMs);
|
|
96
|
+
const sequentialEstimateMs = workerDurations.length
|
|
97
|
+
? workerDurations.reduce((sum, value) => sum + value, 0)
|
|
98
|
+
: requestedWorkers * positiveInt(opts.expectedWorkerRuntimeMs, 4000);
|
|
99
|
+
const visiblePanes = nonNegativeInt(opts.visiblePanes, sorted.filter((event) => event.placement === 'zellij-pane').length ? new Set(sorted.filter((event) => event.placement === 'zellij-pane').map((event) => event.slot_id || event.session_id || '')).size : 0);
|
|
100
|
+
const observedHeadlessWorkers = sorted.filter((event) => event.placement === 'headless' && (event.event_type === 'worker_launch_invoked' || event.event_type === 'worker_process_spawned')).length;
|
|
101
|
+
const headlessWorkers = Math.max(observedHeadlessWorkers, Math.max(0, targetActiveSlots - visiblePanes));
|
|
102
|
+
const minActiveWorkers = opts.minActiveWorkers === undefined
|
|
103
|
+
? Math.min(targetActiveSlots, requestedWorkers)
|
|
104
|
+
: nonNegativeInt(opts.minActiveWorkers, Math.min(targetActiveSlots, requestedWorkers));
|
|
105
|
+
const minSpeedup = Number.isFinite(Number(opts.minSpeedupRatio)) ? Number(opts.minSpeedupRatio) : requestedWorkers >= 16 ? 5 : 1;
|
|
106
|
+
const speedupRatio = wallMs > 0 ? Number((sequentialEstimateMs / wallMs).toFixed(3)) : 0;
|
|
107
|
+
const launchEvents = sorted.filter((event) => event.event_type === 'worker_launch_invoked' || event.event_type === 'worker_process_spawned');
|
|
108
|
+
const launchSpanMs = launchEvents.length ? Math.max(...launchEvents.map((event) => event.ms)) - Math.min(...launchEvents.map((event) => event.ms)) : 0;
|
|
109
|
+
const firstBatchLimit = positiveInt(opts.firstBatchLaunchSpanLimitMs, requestedWorkers >= 16 ? 2500 : 30000);
|
|
110
|
+
const blockers = [
|
|
111
|
+
...(sorted.length ? [] : ['parallel_runtime_events_missing']),
|
|
112
|
+
...(minActiveWorkers <= 0 || maxWorkers >= minActiveWorkers ? [] : ['max_observed_active_workers_below_target']),
|
|
113
|
+
...(requestedWorkers >= 16 && workerPids.size && workerPids.size < minActiveWorkers ? ['unique_worker_pids_below_target'] : []),
|
|
114
|
+
...(speedupRatio >= minSpeedup ? [] : ['speedup_ratio_below_target']),
|
|
115
|
+
...(firstBatchLaunchSpanMs <= firstBatchLimit ? [] : ['first_batch_launch_span_above_limit'])
|
|
116
|
+
];
|
|
117
|
+
return {
|
|
118
|
+
schema: PARALLEL_RUNTIME_PROOF_SCHEMA,
|
|
119
|
+
mission_id: missionId,
|
|
120
|
+
generated_at: nowIso(),
|
|
121
|
+
requested_workers: requestedWorkers,
|
|
122
|
+
target_active_slots: targetActiveSlots,
|
|
123
|
+
max_observed_active_workers: maxWorkers,
|
|
124
|
+
max_observed_worker_processes: Math.max(maxProcesses, workerPids.size ? maxProcesses : maxWorkers),
|
|
125
|
+
unique_worker_pids: workerPids.size,
|
|
126
|
+
unique_model_call_ids: modelIds.size,
|
|
127
|
+
max_observed_model_calls: maxModels,
|
|
128
|
+
launch_span_ms: launchSpanMs,
|
|
129
|
+
first_batch_launch_span_ms: firstBatchLaunchSpanMs,
|
|
130
|
+
wall_ms: wallMs,
|
|
131
|
+
sequential_estimate_ms: sequentialEstimateMs,
|
|
132
|
+
speedup_ratio: speedupRatio,
|
|
133
|
+
overlap_windows: coalesceOverlapWindows(overlapWindows),
|
|
134
|
+
visible_panes: visiblePanes,
|
|
135
|
+
headless_workers: headlessWorkers,
|
|
136
|
+
passed: blockers.length === 0,
|
|
137
|
+
blockers
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export async function writeParallelRuntimeProof(root, missionId, opts = {}) {
|
|
141
|
+
const proof = await buildParallelRuntimeProof(root, missionId, opts);
|
|
142
|
+
await writeJsonAtomic(parallelRuntimeProofPath(root, missionId), proof);
|
|
143
|
+
return proof;
|
|
144
|
+
}
|
|
145
|
+
async function readParallelRuntimeEvents(root, missionId) {
|
|
146
|
+
const text = await readText(parallelRuntimeEventPath(root, missionId), '');
|
|
147
|
+
return String(text)
|
|
148
|
+
.split(/\r?\n/)
|
|
149
|
+
.map((line) => line.trim())
|
|
150
|
+
.filter(Boolean)
|
|
151
|
+
.map((line) => {
|
|
152
|
+
try {
|
|
153
|
+
const parsed = JSON.parse(line);
|
|
154
|
+
return parsed?.schema === PARALLEL_RUNTIME_EVENT_SCHEMA ? parsed : null;
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
})
|
|
160
|
+
.filter((row) => Boolean(row));
|
|
161
|
+
}
|
|
162
|
+
function normalizeParallelRuntimeEvent(missionId, event) {
|
|
163
|
+
return {
|
|
164
|
+
schema: PARALLEL_RUNTIME_EVENT_SCHEMA,
|
|
165
|
+
ts: nowIso(),
|
|
166
|
+
ms: Date.now(),
|
|
167
|
+
mission_id: missionId,
|
|
168
|
+
event_type: event.event_type,
|
|
169
|
+
slot_id: event.slot_id == null ? null : String(event.slot_id),
|
|
170
|
+
generation_index: event.generation_index == null ? null : Math.max(1, Math.floor(Number(event.generation_index) || 1)),
|
|
171
|
+
session_id: event.session_id == null ? null : String(event.session_id),
|
|
172
|
+
pid: event.pid == null || !Number.isFinite(Number(event.pid)) ? null : Math.floor(Number(event.pid)),
|
|
173
|
+
backend: String(event.backend || 'unknown'),
|
|
174
|
+
placement: normalizePlacement(event.placement),
|
|
175
|
+
...(event.worktree_id === undefined ? {} : { worktree_id: event.worktree_id == null ? null : String(event.worktree_id) }),
|
|
176
|
+
...(event.model_call_id === undefined ? {} : { model_call_id: event.model_call_id == null ? null : String(event.model_call_id) }),
|
|
177
|
+
...(event.batch_id === undefined ? {} : { batch_id: event.batch_id == null ? null : String(event.batch_id) }),
|
|
178
|
+
...(event.meta && typeof event.meta === 'object' ? { meta: event.meta } : {})
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
function normalizePlacement(value) {
|
|
182
|
+
const text = String(value || 'unknown');
|
|
183
|
+
if (text === 'zellij-pane' || text === 'process' || text === 'headless')
|
|
184
|
+
return text;
|
|
185
|
+
return 'unknown';
|
|
186
|
+
}
|
|
187
|
+
function positiveInt(value, fallback) {
|
|
188
|
+
const parsed = Number(value);
|
|
189
|
+
if (!Number.isFinite(parsed) || parsed < 1)
|
|
190
|
+
return Math.max(1, Math.floor(fallback || 1));
|
|
191
|
+
return Math.floor(parsed);
|
|
192
|
+
}
|
|
193
|
+
function nonNegativeInt(value, fallback) {
|
|
194
|
+
const parsed = Number(value);
|
|
195
|
+
if (!Number.isFinite(parsed) || parsed < 0)
|
|
196
|
+
return Math.max(0, Math.floor(fallback || 0));
|
|
197
|
+
return Math.floor(parsed);
|
|
198
|
+
}
|
|
199
|
+
function coalesceOverlapWindows(windows) {
|
|
200
|
+
return windows
|
|
201
|
+
.filter((window) => window.end_ms > window.start_ms)
|
|
202
|
+
.filter((window) => window.active_workers > 0 || window.active_model_calls > 0)
|
|
203
|
+
.slice(0, 2000);
|
|
204
|
+
}
|
|
205
|
+
function inferAgentsDir(root, missionId) {
|
|
206
|
+
const resolved = path.resolve(root);
|
|
207
|
+
if (path.basename(resolved) === 'agents' && path.basename(path.dirname(resolved)) === missionId)
|
|
208
|
+
return resolved;
|
|
209
|
+
if (path.basename(resolved) === missionId && path.basename(path.dirname(resolved)) === 'missions')
|
|
210
|
+
return path.join(resolved, 'agents');
|
|
211
|
+
const marker = `${path.sep}.sneakoscope${path.sep}missions${path.sep}${missionId}${path.sep}`;
|
|
212
|
+
const index = resolved.indexOf(marker);
|
|
213
|
+
if (index >= 0)
|
|
214
|
+
return path.join(resolved.slice(0, index + marker.length - 1), 'agents');
|
|
215
|
+
return path.join(resolved, '.sneakoscope', 'missions', missionId, 'agents');
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=parallel-runtime-proof.js.map
|
|
@@ -16,6 +16,7 @@ import { writeUltraRouterProof } from '../router/router-proof.js';
|
|
|
16
16
|
import { readLocalModelConfig } from '../agents/ollama-worker-config.js';
|
|
17
17
|
import { runLocalLlmTask } from '../local-llm/local-llm-control-adapter.js';
|
|
18
18
|
import { detectPythonCodexSdkCapability, runPythonCodexSdkTask } from './python-codex-sdk-adapter.js';
|
|
19
|
+
import { defaultModelCallBudget, withModelCallSlot } from './model-call-concurrency.js';
|
|
19
20
|
export async function runCodexTask(input) {
|
|
20
21
|
const root = path.resolve(input.mutationLedgerRoot);
|
|
21
22
|
await ensureDir(root);
|
|
@@ -46,7 +47,16 @@ export async function runCodexTask(input) {
|
|
|
46
47
|
];
|
|
47
48
|
let adapterResult = null;
|
|
48
49
|
if (!blockers.length) {
|
|
49
|
-
adapterResult = await
|
|
50
|
+
adapterResult = await withModelCallSlot({
|
|
51
|
+
root,
|
|
52
|
+
missionId: task.missionId,
|
|
53
|
+
provider: 'codex-sdk',
|
|
54
|
+
budget: defaultModelCallBudget('codex-sdk'),
|
|
55
|
+
slotId: task.slotId || null,
|
|
56
|
+
generationIndex: task.generationIndex ?? null,
|
|
57
|
+
sessionId: task.sessionId || null,
|
|
58
|
+
backend: 'codex-sdk'
|
|
59
|
+
}, () => runWithCodexReliabilityShield(task, async () => {
|
|
50
60
|
try {
|
|
51
61
|
return fakeAllowed
|
|
52
62
|
? await runFakeCodexSdkTask(task)
|
|
@@ -63,7 +73,7 @@ export async function runCodexTask(input) {
|
|
|
63
73
|
blockers: ['codex_sdk_run_failed:' + String(err?.message || err)]
|
|
64
74
|
};
|
|
65
75
|
}
|
|
66
|
-
});
|
|
76
|
+
}));
|
|
67
77
|
}
|
|
68
78
|
const events = Array.isArray(adapterResult?.events) ? adapterResult.events : [];
|
|
69
79
|
const translatedEvents = translateCodexSdkEvents(events);
|
|
@@ -153,7 +163,16 @@ async function runPythonControlTask(root, task, schema, routerDecision) {
|
|
|
153
163
|
await ensureDir(runtime.env.env.CODEX_HOME);
|
|
154
164
|
const fakeAllowed = process.env.SKS_PYTHON_CODEX_SDK_FAKE === '1';
|
|
155
165
|
const adapterResult = capability.ok || fakeAllowed
|
|
156
|
-
? await
|
|
166
|
+
? await withModelCallSlot({
|
|
167
|
+
root,
|
|
168
|
+
missionId: task.missionId,
|
|
169
|
+
provider: 'python-codex-sdk',
|
|
170
|
+
budget: defaultModelCallBudget('python-codex-sdk'),
|
|
171
|
+
slotId: task.slotId || null,
|
|
172
|
+
generationIndex: task.generationIndex ?? null,
|
|
173
|
+
sessionId: task.sessionId || null,
|
|
174
|
+
backend: 'python-codex-sdk'
|
|
175
|
+
}, () => runPythonCodexSdkTask(task, { env: runtime.env.env, config: runtime.config }))
|
|
157
176
|
: { ok: false, events: [], translatedEvents: [], finalResponse: '', threadId: '', turnId: '', blockers: capability.blockers, capability };
|
|
158
177
|
const events = Array.isArray(adapterResult.events) ? adapterResult.events : [];
|
|
159
178
|
const translatedEvents = Array.isArray(adapterResult.translatedEvents) ? adapterResult.translatedEvents : [];
|
|
@@ -251,7 +270,16 @@ async function runPythonControlTask(root, task, schema, routerDecision) {
|
|
|
251
270
|
}
|
|
252
271
|
async function runLocalControlTask(root, task, schema, routerDecision) {
|
|
253
272
|
const config = await readLocalModelConfig();
|
|
254
|
-
const adapterResult = await
|
|
273
|
+
const adapterResult = await withModelCallSlot({
|
|
274
|
+
root,
|
|
275
|
+
missionId: task.missionId,
|
|
276
|
+
provider: 'local-llm',
|
|
277
|
+
budget: defaultModelCallBudget('local-llm'),
|
|
278
|
+
slotId: task.slotId || null,
|
|
279
|
+
generationIndex: task.generationIndex ?? null,
|
|
280
|
+
sessionId: task.sessionId || null,
|
|
281
|
+
backend: 'local-llm'
|
|
282
|
+
}, () => runLocalLlmTask(task, { config, outputSchema: schema }));
|
|
255
283
|
for (const event of adapterResult.events || [])
|
|
256
284
|
await appendJsonl(path.join(root, 'local-llm-events.jsonl'), event);
|
|
257
285
|
const structuredOutput = adapterResult.structuredOutput;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { appendParallelRuntimeEvent } from '../agents/parallel-runtime-proof.js';
|
|
2
|
+
const semaphores = new Map();
|
|
3
|
+
export function getModelCallSemaphore(provider, budget) {
|
|
4
|
+
const normalizedProvider = String(provider || 'codex-sdk');
|
|
5
|
+
const normalizedBudget = Math.max(1, Math.floor(Number(budget || 1)));
|
|
6
|
+
const key = `${normalizedProvider}:${normalizedBudget}`;
|
|
7
|
+
const existing = semaphores.get(key);
|
|
8
|
+
if (existing)
|
|
9
|
+
return existing;
|
|
10
|
+
const created = new ModelCallSemaphoreImpl(normalizedProvider, normalizedBudget);
|
|
11
|
+
semaphores.set(key, created);
|
|
12
|
+
return created;
|
|
13
|
+
}
|
|
14
|
+
export async function withModelCallSlot(input, fn) {
|
|
15
|
+
const semaphore = getModelCallSemaphore(input.provider, input.budget);
|
|
16
|
+
const modelCallId = input.modelCallId || `${input.provider}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
17
|
+
return semaphore.run(async () => {
|
|
18
|
+
await appendParallelRuntimeEvent(input.root, input.missionId, {
|
|
19
|
+
event_type: 'model_call_started',
|
|
20
|
+
slot_id: input.slotId ?? null,
|
|
21
|
+
generation_index: input.generationIndex ?? null,
|
|
22
|
+
session_id: input.sessionId ?? null,
|
|
23
|
+
model_call_id: modelCallId,
|
|
24
|
+
backend: input.backend || input.provider,
|
|
25
|
+
placement: 'unknown',
|
|
26
|
+
meta: {
|
|
27
|
+
provider: input.provider,
|
|
28
|
+
budget: semaphore.budget,
|
|
29
|
+
active_model_calls: semaphore.active,
|
|
30
|
+
queued_model_calls: semaphore.queued
|
|
31
|
+
}
|
|
32
|
+
}).catch(() => undefined);
|
|
33
|
+
try {
|
|
34
|
+
return await fn();
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
await appendParallelRuntimeEvent(input.root, input.missionId, {
|
|
38
|
+
event_type: 'model_call_completed',
|
|
39
|
+
slot_id: input.slotId ?? null,
|
|
40
|
+
generation_index: input.generationIndex ?? null,
|
|
41
|
+
session_id: input.sessionId ?? null,
|
|
42
|
+
model_call_id: modelCallId,
|
|
43
|
+
backend: input.backend || input.provider,
|
|
44
|
+
placement: 'unknown',
|
|
45
|
+
meta: {
|
|
46
|
+
provider: input.provider,
|
|
47
|
+
budget: semaphore.budget,
|
|
48
|
+
max_observed_model_calls: semaphore.maxObserved,
|
|
49
|
+
queued_model_calls: semaphore.queued
|
|
50
|
+
}
|
|
51
|
+
}).catch(() => undefined);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export function defaultModelCallBudget(provider) {
|
|
56
|
+
const text = String(provider || '');
|
|
57
|
+
if (text === 'local-llm' || text === 'ollama')
|
|
58
|
+
return envInt('SKS_LOCAL_LLM_MAX_PARALLEL_REQUESTS', 4);
|
|
59
|
+
return envInt('SKS_REMOTE_API_PARALLEL_BUDGET', 12);
|
|
60
|
+
}
|
|
61
|
+
class ModelCallSemaphoreImpl {
|
|
62
|
+
provider;
|
|
63
|
+
budget;
|
|
64
|
+
active = 0;
|
|
65
|
+
queued = 0;
|
|
66
|
+
maxObserved = 0;
|
|
67
|
+
waiters = [];
|
|
68
|
+
constructor(provider, budget) {
|
|
69
|
+
this.provider = provider;
|
|
70
|
+
this.budget = budget;
|
|
71
|
+
}
|
|
72
|
+
async run(fn) {
|
|
73
|
+
await this.acquire();
|
|
74
|
+
try {
|
|
75
|
+
return await fn();
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
this.release();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async acquire() {
|
|
82
|
+
if (this.active < this.budget) {
|
|
83
|
+
this.active += 1;
|
|
84
|
+
this.maxObserved = Math.max(this.maxObserved, this.active);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
this.queued += 1;
|
|
88
|
+
await new Promise((resolve) => this.waiters.push(resolve));
|
|
89
|
+
this.queued = Math.max(0, this.queued - 1);
|
|
90
|
+
this.active += 1;
|
|
91
|
+
this.maxObserved = Math.max(this.maxObserved, this.active);
|
|
92
|
+
}
|
|
93
|
+
release() {
|
|
94
|
+
this.active = Math.max(0, this.active - 1);
|
|
95
|
+
const next = this.waiters.shift();
|
|
96
|
+
if (next)
|
|
97
|
+
next();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function envInt(name, fallback) {
|
|
101
|
+
const parsed = Number(process.env[name]);
|
|
102
|
+
if (!Number.isFinite(parsed) || parsed < 1)
|
|
103
|
+
return fallback;
|
|
104
|
+
return Math.floor(parsed);
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=model-call-concurrency.js.map
|
|
@@ -101,7 +101,7 @@ export function quickstartCommand() {
|
|
|
101
101
|
sks dollar-commands
|
|
102
102
|
sks all-features selftest --mock --execute-fixtures --strict-artifacts --json
|
|
103
103
|
|
|
104
|
-
For implementation work, use Codex App prompt routes such as $
|
|
104
|
+
For implementation work, use Codex App prompt routes such as $Naruto, $Goal, $QA-LOOP, $Image-UX-Review, and $Computer-Use.`);
|
|
105
105
|
}
|
|
106
106
|
export async function updateCheckCommand(args = []) {
|
|
107
107
|
const result = await runSksUpdateCheck();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const COMMAND_SUGGESTIONS_SCHEMA = 'sks.command-suggestions.v1';
|
|
2
2
|
export function suggestSksCommands(input) {
|
|
3
3
|
const query = String(input || '').toLowerCase();
|
|
4
|
-
const commands = ['$
|
|
4
|
+
const commands = ['$Naruto', '$Goal', '$DFix', '$QA-LOOP', '$Research', '$PPT', '$Image-UX-Review', '$Computer-Use'];
|
|
5
5
|
const suggestions = commands.filter((command) => command.toLowerCase().includes(query.replace(/^\$/, ''))).slice(0, 8);
|
|
6
6
|
return {
|
|
7
7
|
schema: COMMAND_SUGGESTIONS_SCHEMA,
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { initProject } from '../init.js';
|
|
2
|
+
import { createMission, findLatestMission, setCurrent } from '../mission.js';
|
|
3
|
+
import { exists, sksRoot } from '../fsx.js';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { createMadDbCapability, isMadDbCapabilityActive, MAD_DB_ACK, readMadDbCapability, resolveMadDbMissionId, revokeMadDbCapability } from '../mad-db/mad-db-capability.js';
|
|
6
|
+
export async function madDbCommand(args = []) {
|
|
7
|
+
const action = String(args[0] && !String(args[0]).startsWith('--') ? args[0] : 'status');
|
|
8
|
+
const rest = action === args[0] ? args.slice(1) : args;
|
|
9
|
+
const root = await sksRoot();
|
|
10
|
+
if (!(await exists(path.join(root, '.sneakoscope'))))
|
|
11
|
+
await initProject(root, {});
|
|
12
|
+
if (action === 'enable')
|
|
13
|
+
return enableMadDb(root, rest);
|
|
14
|
+
if (action === 'revoke')
|
|
15
|
+
return revokeMadDb(root, rest);
|
|
16
|
+
if (action === 'status')
|
|
17
|
+
return statusMadDb(root, rest);
|
|
18
|
+
console.error('Usage: sks mad-db enable --ack "I AUTHORIZE ONE-CYCLE DB BREAK-GLASS" [--mission latest|new|M-...] | status | revoke');
|
|
19
|
+
process.exitCode = 1;
|
|
20
|
+
}
|
|
21
|
+
async function enableMadDb(root, args) {
|
|
22
|
+
const json = hasFlag(args, '--json');
|
|
23
|
+
const ack = readOption(args, '--ack', '');
|
|
24
|
+
if (ack !== MAD_DB_ACK) {
|
|
25
|
+
const result = { schema: 'sks.mad-db-command.v1', ok: false, action: 'enable', reason: 'ack_phrase_required', required_ack: MAD_DB_ACK };
|
|
26
|
+
if (json)
|
|
27
|
+
return console.log(JSON.stringify(result, null, 2));
|
|
28
|
+
console.error(`Mad-DB enable blocked. Required --ack ${JSON.stringify(MAD_DB_ACK)}`);
|
|
29
|
+
process.exitCode = 2;
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
const requestedMission = readOption(args, '--mission', 'latest');
|
|
33
|
+
let missionId = requestedMission === 'new' ? null : await resolveMadDbMissionId(root, {}, requestedMission);
|
|
34
|
+
if (!missionId) {
|
|
35
|
+
const created = await createMission(root, { mode: 'mad-db', prompt: 'sks mad-db enable one-cycle DB break-glass' });
|
|
36
|
+
missionId = created.id;
|
|
37
|
+
}
|
|
38
|
+
const capability = await createMadDbCapability(root, {
|
|
39
|
+
missionId,
|
|
40
|
+
ack,
|
|
41
|
+
cwd: process.cwd(),
|
|
42
|
+
ttlMs: Number(readOption(args, '--ttl-ms', String(2 * 60 * 60 * 1000)))
|
|
43
|
+
});
|
|
44
|
+
await setCurrent(root, {
|
|
45
|
+
mission_id: missionId,
|
|
46
|
+
route: 'MadDB',
|
|
47
|
+
route_command: '$MAD-DB',
|
|
48
|
+
mode: 'MADDB',
|
|
49
|
+
phase: 'MADDB_ONE_CYCLE_CAPABILITY_ACTIVE',
|
|
50
|
+
mad_db_active: true,
|
|
51
|
+
mad_db_cycle_id: capability.cycle_id,
|
|
52
|
+
mad_db_capability_file: 'mad-db-capability.json',
|
|
53
|
+
mad_db_ack_phrase: 'accepted',
|
|
54
|
+
stop_gate: 'mad-db-capability.json'
|
|
55
|
+
});
|
|
56
|
+
const result = { schema: 'sks.mad-db-command.v1', ok: true, action: 'enable', mission_id: missionId, capability };
|
|
57
|
+
if (json)
|
|
58
|
+
return console.log(JSON.stringify(result, null, 2));
|
|
59
|
+
console.log(`Mad-DB one-cycle capability active for ${missionId}; expires ${capability.expires_at}.`);
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
async function statusMadDb(root, args) {
|
|
63
|
+
const json = hasFlag(args, '--json');
|
|
64
|
+
const missionId = await resolveMadDbMissionId(root, {}, readOption(args, '--mission', 'latest'));
|
|
65
|
+
const capability = missionId ? await readMadDbCapability(root, missionId) : null;
|
|
66
|
+
const result = {
|
|
67
|
+
schema: 'sks.mad-db-command.v1',
|
|
68
|
+
ok: true,
|
|
69
|
+
action: 'status',
|
|
70
|
+
mission_id: missionId,
|
|
71
|
+
active: isMadDbCapabilityActive(capability),
|
|
72
|
+
capability
|
|
73
|
+
};
|
|
74
|
+
if (json)
|
|
75
|
+
return console.log(JSON.stringify(result, null, 2));
|
|
76
|
+
if (!missionId || !capability)
|
|
77
|
+
console.log('Mad-DB: no capability found.');
|
|
78
|
+
else
|
|
79
|
+
console.log(`Mad-DB: ${result.active ? 'active' : 'inactive'} for ${missionId}; consumed=${capability.consumed}; expires=${capability.expires_at}.`);
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
async function revokeMadDb(root, args) {
|
|
83
|
+
const json = hasFlag(args, '--json');
|
|
84
|
+
const missionId = await resolveMadDbMissionId(root, {}, readOption(args, '--mission', 'latest')) || await findLatestMission(root);
|
|
85
|
+
const revoked = missionId ? await revokeMadDbCapability(root, missionId, readOption(args, '--reason', 'operator_revoked')) : null;
|
|
86
|
+
await setCurrent(root, { mad_db_active: false, phase: 'MADDB_REVOKED' });
|
|
87
|
+
const result = { schema: 'sks.mad-db-command.v1', ok: Boolean(revoked), action: 'revoke', mission_id: missionId, capability: revoked };
|
|
88
|
+
if (json)
|
|
89
|
+
return console.log(JSON.stringify(result, null, 2));
|
|
90
|
+
if (!revoked)
|
|
91
|
+
console.log('Mad-DB: no capability to revoke.');
|
|
92
|
+
else
|
|
93
|
+
console.log(`Mad-DB capability revoked for ${missionId}.`);
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
function hasFlag(args, flag) {
|
|
97
|
+
return args.includes(flag);
|
|
98
|
+
}
|
|
99
|
+
function readOption(args, name, fallback) {
|
|
100
|
+
const index = args.indexOf(name);
|
|
101
|
+
if (index >= 0 && args[index + 1] && !String(args[index + 1]).startsWith('--'))
|
|
102
|
+
return String(args[index + 1]);
|
|
103
|
+
const prefixed = args.find((arg) => String(arg).startsWith(name + '='));
|
|
104
|
+
return prefixed ? prefixed.slice(name.length + 1) : fallback;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=mad-db-command.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import { spawn } from 'node:child_process';
|
|
4
|
-
import { appendJsonlBounded, exists, nowIso, packageRoot, readJson, sksRoot, writeJsonAtomic } from '../fsx.js';
|
|
4
|
+
import { PACKAGE_VERSION, appendJsonlBounded, exists, nowIso, packageRoot, readJson, sksRoot, writeJsonAtomic } from '../fsx.js';
|
|
5
5
|
import { initProject } from '../init.js';
|
|
6
6
|
import { createMission, setCurrent } from '../mission.js';
|
|
7
7
|
import { buildMadHighLaunchProfileNoWrite, madHighProfileName } from '../auto-review.js';
|
|
@@ -18,6 +18,8 @@ import { applyMadSksRollbackPlan } from '../mad-sks/rollback-apply.js';
|
|
|
18
18
|
import { repairCodexConfigEperm } from '../codex/codex-config-eperm-repair.js';
|
|
19
19
|
import { runCodexLaunchPreflight } from '../preflight/parallel-preflight-engine.js';
|
|
20
20
|
import { diffCodexAppUiSnapshots, writeCodexAppUiSnapshot } from '../codex-app/codex-app-ui-state-snapshot.js';
|
|
21
|
+
import { checkSksUpdateNotice } from '../update/update-notice.js';
|
|
22
|
+
import { createMadDbCapability, MAD_DB_ACK } from '../mad-db/mad-db-capability.js';
|
|
21
23
|
export async function madHighCommand(args = [], deps = {}) {
|
|
22
24
|
const subcommand = firstSubcommand(args);
|
|
23
25
|
if (subcommand)
|
|
@@ -27,16 +29,7 @@ export async function madHighCommand(args = [], deps = {}) {
|
|
|
27
29
|
const profile = buildMadHighLaunchProfileNoWrite();
|
|
28
30
|
return console.log(JSON.stringify(profile, null, 2));
|
|
29
31
|
}
|
|
30
|
-
const update =
|
|
31
|
-
if (update.status === 'updated') {
|
|
32
|
-
console.log(`SKS updated from ${deps.packageVersion} to ${update.latest}. Rerun: sks --mad`);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (update.status === 'failed') {
|
|
36
|
-
console.error(`SKS update failed: ${update.error}`);
|
|
37
|
-
process.exitCode = 1;
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
32
|
+
const update = { status: 'notice_only', non_blocking: true };
|
|
40
33
|
const codexUpdate = deps.maybePromptCodexUpdateForLaunch ? await deps.maybePromptCodexUpdateForLaunch(args, { label: 'MAD launch' }) : { status: 'skipped' };
|
|
41
34
|
if (codexUpdate.status === 'failed' || codexUpdate.status === 'updated_not_reflected') {
|
|
42
35
|
console.error(`Codex CLI update failed: ${codexUpdate.error || 'updated version was not visible on PATH'}`);
|
|
@@ -68,6 +61,13 @@ export async function madHighCommand(args = [], deps = {}) {
|
|
|
68
61
|
// readability + repair checks still run. SKS_LAUNCH_FULL_CODEX_PROBE=1 restores the
|
|
69
62
|
// old behavior.
|
|
70
63
|
const rawArgs = (args || []).map((arg) => String(arg));
|
|
64
|
+
const madDbRequested = rawArgs.includes('--mad-db');
|
|
65
|
+
const madDbAck = readOption(rawArgs, '--ack', '');
|
|
66
|
+
if (madDbRequested && madDbAck !== MAD_DB_ACK) {
|
|
67
|
+
console.error(`SKS MAD-DB launch blocked. Required --ack ${JSON.stringify(MAD_DB_ACK)}`);
|
|
68
|
+
process.exitCode = 2;
|
|
69
|
+
return { ok: false, status: 'blocked', reason: 'mad_db_ack_phrase_required', required_ack: MAD_DB_ACK };
|
|
70
|
+
}
|
|
71
71
|
const allowMadRepair = rawArgs.includes('--repair-config') || rawArgs.includes('--fix') || rawArgs.includes('--yes-repair');
|
|
72
72
|
const launchPreflight = await runCodexLaunchPreflight(launchRoot, { fix: allowMadRepair, launchFast: process.env.SKS_LAUNCH_FULL_CODEX_PROBE !== '1', profile: profile.profile_name, sandbox: 'danger-full-access', serviceTier: 'fast' });
|
|
73
73
|
const afterPreflightUi = beforeUi ? await writeCodexAppUiSnapshot(launchRoot, `mad-after-preflight-${uiSnapshotId}`).catch(() => null) : null;
|
|
@@ -88,7 +88,41 @@ export async function madHighCommand(args = [], deps = {}) {
|
|
|
88
88
|
return launchPreflight;
|
|
89
89
|
}
|
|
90
90
|
const madLaunch = await activateMadZellijPermissionState(process.cwd(), args);
|
|
91
|
+
const madDbCapability = madDbRequested
|
|
92
|
+
? await createMadDbCapability(madLaunch.root, { missionId: madLaunch.mission_id, ack: madDbAck, cwd: process.cwd() })
|
|
93
|
+
: null;
|
|
94
|
+
if (madDbCapability) {
|
|
95
|
+
await setCurrent(madLaunch.root, {
|
|
96
|
+
mission_id: madLaunch.mission_id,
|
|
97
|
+
mad_db_active: true,
|
|
98
|
+
mad_db_cycle_id: madDbCapability.cycle_id,
|
|
99
|
+
mad_db_capability_file: 'mad-db-capability.json',
|
|
100
|
+
mad_db_break_glass: true
|
|
101
|
+
});
|
|
102
|
+
await appendJsonlBounded(path.join(madLaunch.dir, 'events.jsonl'), { ts: nowIso(), type: 'mad_db.capability_created', cycle_id: madDbCapability.cycle_id, expires_at: madDbCapability.expires_at });
|
|
103
|
+
}
|
|
104
|
+
const updateNotice = await checkSksUpdateNotice({
|
|
105
|
+
packageName: deps.packageName || 'sneakoscope',
|
|
106
|
+
currentVersion: deps.packageVersion || PACKAGE_VERSION,
|
|
107
|
+
missionDir: madLaunch.dir
|
|
108
|
+
}).catch((err) => ({
|
|
109
|
+
schema: 'sks.update-notice.v1',
|
|
110
|
+
checked_at: nowIso(),
|
|
111
|
+
package_name: deps.packageName || 'sneakoscope',
|
|
112
|
+
current_version: deps.packageVersion || PACKAGE_VERSION,
|
|
113
|
+
latest_version: null,
|
|
114
|
+
update_available: false,
|
|
115
|
+
source: 'error',
|
|
116
|
+
cache_ttl_ms: 0,
|
|
117
|
+
message: 'SKS update notice check failed; MAD launch continues.',
|
|
118
|
+
error: err?.message || String(err)
|
|
119
|
+
}));
|
|
120
|
+
await appendJsonlBounded(path.join(madLaunch.dir, 'events.jsonl'), { ts: nowIso(), type: 'mad_sks.update_notice_checked', non_blocking: true, update_available: updateNotice.update_available === true, source: updateNotice.source });
|
|
91
121
|
console.log(`SKS MAD ready: ${madHighProfileName()} | gate ${madLaunch.mission_id}`);
|
|
122
|
+
if (madDbCapability)
|
|
123
|
+
console.log(`MAD-DB one-cycle capability active; expires ${madDbCapability.expires_at}.`);
|
|
124
|
+
if (updateNotice.update_available === true)
|
|
125
|
+
console.log(`SKS update notice: ${updateNotice.latest_version} available (non-blocking).`);
|
|
92
126
|
console.log('Scoped high-power maintenance authority active; add explicit --allow-* flags for packages, services, network, browser/Computer Use, generated assets, file permissions, DB writes, or system/admin scopes. Catastrophic guards remain.');
|
|
93
127
|
const launchLb = lb.status === 'present' ? { ...lb, status: 'configured' } : lb;
|
|
94
128
|
const madSksEnv = {
|
|
@@ -445,6 +479,7 @@ function madLaunchOnlyFlags() {
|
|
|
445
479
|
'--allow-file-permissions',
|
|
446
480
|
'--allow-chmod',
|
|
447
481
|
'--allow-delete',
|
|
482
|
+
'--mad-db',
|
|
448
483
|
'--confirm-delete',
|
|
449
484
|
'--confirm-destructive-delete',
|
|
450
485
|
'--no-swarm',
|
|
@@ -460,7 +495,8 @@ function madLaunchOnlyFlags() {
|
|
|
460
495
|
'--yes',
|
|
461
496
|
'-y',
|
|
462
497
|
'--dry-run',
|
|
463
|
-
'--plan-only'
|
|
498
|
+
'--plan-only',
|
|
499
|
+
'--ack'
|
|
464
500
|
]);
|
|
465
501
|
}
|
|
466
502
|
function madLaunchValueFlags() {
|
|
@@ -469,7 +505,8 @@ function madLaunchValueFlags() {
|
|
|
469
505
|
'--mad-swarm-agents',
|
|
470
506
|
'--mad-swarm-work-items',
|
|
471
507
|
'--mad-swarm-backend',
|
|
472
|
-
'--mad-swarm-prompt'
|
|
508
|
+
'--mad-swarm-prompt',
|
|
509
|
+
'--ack'
|
|
473
510
|
]);
|
|
474
511
|
}
|
|
475
512
|
export function defaultMadSwarmBackend(args = [], opts = {}) {
|