sneakoscope 2.0.13 → 2.0.15
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 +1 -0
- package/dist/commands/mad-db.js +5 -0
- package/dist/commands/zellij-slot-pane.js +3 -1
- package/dist/core/agents/agent-orchestrator.js +11 -4
- package/dist/core/agents/agent-output-validator.js +1 -1
- package/dist/core/agents/agent-plan.js +3 -2
- package/dist/core/agents/native-cli-session-swarm.js +118 -0
- package/dist/core/agents/native-cli-worker.js +85 -0
- package/dist/core/codex-control/codex-fake-sdk-adapter.js +3 -3
- package/dist/core/codex-control/gpt-final-review-schema.js +61 -14
- 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 +82 -1
- package/dist/core/commands/research-command.js +83 -17
- package/dist/core/commands/team-command.js +25 -1
- package/dist/core/db-safety.js +26 -0
- package/dist/core/fsx.js +1 -1
- package/dist/core/mad-db/mad-db-capability.js +84 -0
- package/dist/core/mad-db/mad-db-ledger.js +17 -0
- package/dist/core/mad-db/mad-db-policy-resolver.js +46 -0
- package/dist/core/naruto/naruto-real-worker-child.js +11 -3
- package/dist/core/naruto/naruto-real-worker-runtime.js +4 -0
- package/dist/core/pipeline/final-gpt-patch-stage.js +20 -3
- 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 +124 -0
- package/dist/core/research/implementation-blueprint-markdown.js +1 -1
- package/dist/core/research/implementation-blueprint.js +68 -7
- package/dist/core/research/research-claim-builder.js +114 -0
- package/dist/core/research/research-cycle-runner.js +115 -11
- package/dist/core/research/research-final-reviewer.js +181 -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-source-ledger-merge.js +186 -0
- package/dist/core/research/research-source-shards.js +176 -0
- package/dist/core/research/research-stage-runner.js +537 -11
- package/dist/core/research/research-synthesis-prompt.js +52 -0
- package/dist/core/research/research-synthesis-writer.js +208 -0
- package/dist/core/research/research-work-graph.js +114 -23
- package/dist/core/research.js +72 -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 +182 -0
- package/dist/scripts/release-gate-dag-runner.js +5 -0
- package/dist/scripts/release-speed-summary.js +25 -0
- package/package.json +67 -5
- package/schemas/codex/agent-result.schema.json +1 -1
- 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-source-shard.schema.json +46 -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/build-manifest.json +0 -1184
- 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 -15
- 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 -53
- 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 -79
- package/dist/scripts/release-provenance-check.js +0 -150
- package/dist/scripts/release-readiness-report.js +0 -1146
- 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-quality-gate-check.js +0 -86
- 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
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/permission-request.command.input.schema.json +0 -61
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/permission-request.command.output.schema.json +0 -103
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/post-compact.command.input.schema.json +0 -52
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/post-compact.command.output.schema.json +0 -24
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/post-tool-use.command.input.schema.json +0 -67
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/post-tool-use.command.output.schema.json +0 -84
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/pre-compact.command.input.schema.json +0 -52
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/pre-compact.command.output.schema.json +0 -24
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/pre-tool-use.command.input.schema.json +0 -65
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/pre-tool-use.command.output.schema.json +0 -105
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/session-start.command.input.schema.json +0 -59
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/session-start.command.output.schema.json +0 -63
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/snapshot-metadata.json +0 -31
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/stop.command.input.schema.json +0 -63
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/stop.command.output.schema.json +0 -45
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/user-prompt-submit.command.input.schema.json +0 -59
- package/dist/vendor/openai-codex/rust-v0.131.0/hooks/user-prompt-submit.command.output.schema.json +0 -81
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { appendJsonlBounded, exists, nowIso, readJson, sksRoot, writeJsonAtomic, writeTextAtomic } from '../fsx.js';
|
|
3
3
|
import { initProject } from '../init.js';
|
|
4
|
-
import { createMission, loadMission, setCurrent } from '../mission.js';
|
|
4
|
+
import { createMission, findLatestMission, loadMission, setCurrent } from '../mission.js';
|
|
5
5
|
import { buildQuestionSchema, writeQuestions } from '../questions.js';
|
|
6
6
|
import { CODEX_COMPUTER_USE_ONLY_POLICY, CODEX_WEB_VERIFICATION_POLICY, FROM_CHAT_IMG_CHECKLIST_ARTIFACT, FROM_CHAT_IMG_COVERAGE_ARTIFACT, FROM_CHAT_IMG_QA_LOOP_ARTIFACT, FROM_CHAT_IMG_SOURCE_INVENTORY_ARTIFACT, FROM_CHAT_IMG_TEMP_TRIWIKI_ARTIFACT, FROM_CHAT_IMG_VISUAL_MAP_ARTIFACT, FROM_CHAT_IMG_WORK_ORDER_ARTIFACT, ROUTES, hasFromChatImgSignal, routePrompt, routeReasoning, triwikiContextTracking } from '../routes.js';
|
|
7
7
|
import { TEAM_DECOMPOSITION_ARTIFACT, TEAM_GRAPH_ARTIFACT, TEAM_INBOX_DIR, TEAM_RUNTIME_TASKS_ARTIFACT, teamRuntimePlanMetadata, teamRuntimeRequiredArtifacts, writeTeamRuntimeArtifacts } from '../team-dag.js';
|
|
@@ -18,11 +18,13 @@ import { attachZellijSessionInteractive, launchTeamZellijView } from '../zellij/
|
|
|
18
18
|
import { maybeFinalizeRoute } from '../proof/auto-finalize.js';
|
|
19
19
|
import { runNativeAgentOrchestrator } from '../agents/agent-orchestrator.js';
|
|
20
20
|
import { ambientGoalContinuation, flag, readBoundedIntegerFlag, readFlagValue } from './command-utils.js';
|
|
21
|
+
import { narutoCommand } from './naruto-command.js';
|
|
21
22
|
const TEAM_SESSION_CLEANUP_ARTIFACT = 'team-session-cleanup.json';
|
|
22
23
|
export async function team(args = []) {
|
|
23
24
|
const teamSubcommands = new Set(['log', 'tail', 'watch', 'lane', 'status', 'dashboard', 'event', 'message', 'open-zellij', 'attach-zellij', 'cleanup-zellij', 'open-tmux', 'attach-tmux', 'cleanup-tmux']);
|
|
24
25
|
if (teamSubcommands.has(args[0]))
|
|
25
26
|
return teamCommand(args[0], args.slice(1));
|
|
27
|
+
return redirectTeamCreateToNaruto(args);
|
|
26
28
|
const jsonOutput = flag(args, '--json');
|
|
27
29
|
const mock = flag(args, '--mock');
|
|
28
30
|
const openZellij = !mock && !jsonOutput && !flag(args, '--no-open-zellij') && !flag(args, '--no-zellij');
|
|
@@ -200,6 +202,28 @@ export async function team(args = []) {
|
|
|
200
202
|
console.log(`Watch: sks team watch ${id}`);
|
|
201
203
|
console.log(`Artifacts: .sneakoscope/missions/${id}`);
|
|
202
204
|
}
|
|
205
|
+
async function redirectTeamCreateToNaruto(args = []) {
|
|
206
|
+
const root = await sksRoot();
|
|
207
|
+
const list = (args || []).map((arg) => String(arg));
|
|
208
|
+
const narutoArgs = list[0] === 'run' ? list : ['run', ...list];
|
|
209
|
+
console.warn('SKS Team is deprecated for new execution missions; redirecting to $Naruto.');
|
|
210
|
+
const result = await narutoCommand(narutoArgs);
|
|
211
|
+
const missionId = result?.mission_id || await findLatestMission(root);
|
|
212
|
+
if (missionId) {
|
|
213
|
+
await writeJsonAtomic(path.join(root, '.sneakoscope', 'missions', missionId, 'team-alias-to-naruto.json'), {
|
|
214
|
+
schema: 'sks.team-alias-to-naruto.v1',
|
|
215
|
+
ok: true,
|
|
216
|
+
mission_id: missionId,
|
|
217
|
+
source_command: 'sks team',
|
|
218
|
+
redirected_to: 'sks naruto run',
|
|
219
|
+
route_command: '$Naruto',
|
|
220
|
+
deprecated_route: '$Team',
|
|
221
|
+
created_at: nowIso(),
|
|
222
|
+
args: list
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
return result;
|
|
226
|
+
}
|
|
203
227
|
export function parseTeamCreateArgs(args) {
|
|
204
228
|
const spec = parseTeamSpecArgs(args);
|
|
205
229
|
const prompt = spec.cleanArgs.join(' ').trim();
|
package/dist/core/db-safety.js
CHANGED
|
@@ -2,6 +2,9 @@ import path from 'node:path';
|
|
|
2
2
|
import { exists, readJson, writeJsonAtomic, readText, nowIso, appendJsonlBounded } from './fsx.js';
|
|
3
3
|
import { missionDir, setCurrent } from './mission.js';
|
|
4
4
|
import { evaluateMadSksPermissionGate, isMadSksRouteState } from './permission-gates.js';
|
|
5
|
+
import { resolveMadDbMutationPolicy } from './mad-db/mad-db-policy-resolver.js';
|
|
6
|
+
import { consumeMadDbCapability } from './mad-db/mad-db-capability.js';
|
|
7
|
+
import { appendMadDbLedgerEvent } from './mad-db/mad-db-ledger.js';
|
|
5
8
|
export const DEFAULT_DB_SAFETY_POLICY = Object.freeze({
|
|
6
9
|
schema_version: 1,
|
|
7
10
|
mode: 'read_only_default',
|
|
@@ -504,6 +507,29 @@ export async function checkDbOperation(root, state, payload, { duringNoQuestion
|
|
|
504
507
|
const policy = await loadDbSafetyPolicy(root);
|
|
505
508
|
const contract = await loadMissionContract(root, state);
|
|
506
509
|
const classification = classifyToolPayload(payload);
|
|
510
|
+
const madDb = await resolveMadDbMutationPolicy(root, state, classification);
|
|
511
|
+
if (madDb.allowed === true && state?.mission_id) {
|
|
512
|
+
const madDbDecision = madDb;
|
|
513
|
+
const decision = {
|
|
514
|
+
allowed: true,
|
|
515
|
+
action: 'allow',
|
|
516
|
+
reasons: madDb.reasons,
|
|
517
|
+
classification,
|
|
518
|
+
effective: { mode: 'mad-db-break-glass', env: 'operator_authorized_one_cycle', destructive: true, migrationApply: 'yes' },
|
|
519
|
+
mad_db: {
|
|
520
|
+
active: true,
|
|
521
|
+
priority: 'highest',
|
|
522
|
+
one_cycle_only: true,
|
|
523
|
+
cycle_id: madDbDecision.cycle_id,
|
|
524
|
+
capability_file: 'mad-db-capability.json',
|
|
525
|
+
consumed: true
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
await appendMadDbLedgerEvent(root, state.mission_id, { type: 'db_mutation.allowed', cycle_id: madDbDecision.cycle_id, mode: madDbDecision.mode, classification });
|
|
529
|
+
await consumeMadDbCapability(root, state.mission_id, { consumedBy: 'db-safety-checkDbOperation', reason: 'db_mutation_allowed' });
|
|
530
|
+
await appendJsonlBounded(path.join(missionDir(root, state.mission_id), 'db-safety.jsonl'), { ts: nowIso(), decision });
|
|
531
|
+
return decision;
|
|
532
|
+
}
|
|
507
533
|
const madSks = await madSksOverrideState(root, state);
|
|
508
534
|
const decision = evaluateDbSafety({ classification, policy, contract, duringNoQuestion, madSks });
|
|
509
535
|
if (decision.action === 'confirm')
|
package/dist/core/fsx.js
CHANGED
|
@@ -5,7 +5,7 @@ import os from 'node:os';
|
|
|
5
5
|
import crypto from 'node:crypto';
|
|
6
6
|
import { spawn } from 'node:child_process';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
|
-
export const PACKAGE_VERSION = '2.0.
|
|
8
|
+
export const PACKAGE_VERSION = '2.0.15';
|
|
9
9
|
export const DEFAULT_PROCESS_TAIL_BYTES = 256 * 1024;
|
|
10
10
|
export const DEFAULT_PROCESS_TIMEOUT_MS = 30 * 60 * 1000;
|
|
11
11
|
export function nowIso() {
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { appendJsonlBounded, nowIso, readJson, writeJsonAtomic } from '../fsx.js';
|
|
3
|
+
import { findLatestMission, missionDir } from '../mission.js';
|
|
4
|
+
export const MAD_DB_CAPABILITY_SCHEMA = 'sks.mad-db-capability.v1';
|
|
5
|
+
export const MAD_DB_CAPABILITY_FILE = 'mad-db-capability.json';
|
|
6
|
+
export const MAD_DB_ACK = 'I AUTHORIZE ONE-CYCLE DB BREAK-GLASS';
|
|
7
|
+
export const MAD_DB_MAX_TTL_MS = 2 * 60 * 60 * 1000;
|
|
8
|
+
export async function createMadDbCapability(root, input) {
|
|
9
|
+
if (input.ack !== MAD_DB_ACK)
|
|
10
|
+
throw new Error('mad_db_ack_phrase_mismatch');
|
|
11
|
+
const createdAt = nowIso();
|
|
12
|
+
const ttlMs = Math.min(MAD_DB_MAX_TTL_MS, Math.max(1, Math.floor(Number(input.ttlMs || MAD_DB_MAX_TTL_MS))));
|
|
13
|
+
const capability = {
|
|
14
|
+
schema: MAD_DB_CAPABILITY_SCHEMA,
|
|
15
|
+
mission_id: input.missionId,
|
|
16
|
+
cycle_id: input.cycleId || `mad-db-${Date.now().toString(36)}`,
|
|
17
|
+
enabled: true,
|
|
18
|
+
created_at: createdAt,
|
|
19
|
+
expires_at: new Date(Date.now() + ttlMs).toISOString(),
|
|
20
|
+
one_cycle_only: true,
|
|
21
|
+
priority: 'highest',
|
|
22
|
+
scope: 'all_database_mutations',
|
|
23
|
+
operator_ack: {
|
|
24
|
+
phrase: MAD_DB_ACK,
|
|
25
|
+
accepted_at: createdAt,
|
|
26
|
+
cwd: path.resolve(input.cwd || process.cwd())
|
|
27
|
+
},
|
|
28
|
+
consumed: false,
|
|
29
|
+
consumed_at: null,
|
|
30
|
+
consumed_by: null
|
|
31
|
+
};
|
|
32
|
+
const dir = missionDir(root, input.missionId);
|
|
33
|
+
await writeJsonAtomic(path.join(dir, MAD_DB_CAPABILITY_FILE), capability);
|
|
34
|
+
await appendJsonlBounded(path.join(dir, 'mad-db-ledger.jsonl'), { ts: nowIso(), type: 'capability.created', mission_id: capability.mission_id, cycle_id: capability.cycle_id, expires_at: capability.expires_at });
|
|
35
|
+
return capability;
|
|
36
|
+
}
|
|
37
|
+
export async function readMadDbCapability(root, missionId) {
|
|
38
|
+
const capability = await readJson(path.join(missionDir(root, missionId), MAD_DB_CAPABILITY_FILE), null);
|
|
39
|
+
return capability?.schema === MAD_DB_CAPABILITY_SCHEMA ? capability : null;
|
|
40
|
+
}
|
|
41
|
+
export async function resolveMadDbMissionId(root, state = {}, explicitMissionId = null) {
|
|
42
|
+
if (explicitMissionId && explicitMissionId !== 'latest')
|
|
43
|
+
return explicitMissionId;
|
|
44
|
+
if (state?.mission_id)
|
|
45
|
+
return String(state.mission_id);
|
|
46
|
+
return findLatestMission(root);
|
|
47
|
+
}
|
|
48
|
+
export function isMadDbCapabilityActive(capability, nowMs = Date.now()) {
|
|
49
|
+
if (!capability)
|
|
50
|
+
return false;
|
|
51
|
+
const expires = Date.parse(capability.expires_at || '');
|
|
52
|
+
return capability.enabled === true
|
|
53
|
+
&& capability.consumed !== true
|
|
54
|
+
&& capability.one_cycle_only === true
|
|
55
|
+
&& Number.isFinite(expires)
|
|
56
|
+
&& expires > nowMs;
|
|
57
|
+
}
|
|
58
|
+
export async function consumeMadDbCapability(root, missionId, input = {}) {
|
|
59
|
+
const capability = await readMadDbCapability(root, missionId);
|
|
60
|
+
if (!isMadDbCapabilityActive(capability))
|
|
61
|
+
return capability;
|
|
62
|
+
const consumed = {
|
|
63
|
+
...capability,
|
|
64
|
+
consumed: true,
|
|
65
|
+
consumed_at: nowIso(),
|
|
66
|
+
consumed_by: input.consumedBy || input.reason || 'db-safety-policy-resolver'
|
|
67
|
+
};
|
|
68
|
+
const dir = missionDir(root, missionId);
|
|
69
|
+
await writeJsonAtomic(path.join(dir, MAD_DB_CAPABILITY_FILE), consumed);
|
|
70
|
+
await writeJsonAtomic(path.join(dir, 'mad-db-capability.consumed.json'), consumed);
|
|
71
|
+
await appendJsonlBounded(path.join(dir, 'mad-db-ledger.jsonl'), { ts: nowIso(), type: 'capability.consumed', mission_id: missionId, cycle_id: consumed.cycle_id, consumed_by: consumed.consumed_by });
|
|
72
|
+
return consumed;
|
|
73
|
+
}
|
|
74
|
+
export async function revokeMadDbCapability(root, missionId, reason = 'operator_revoked') {
|
|
75
|
+
const capability = await readMadDbCapability(root, missionId);
|
|
76
|
+
if (!capability)
|
|
77
|
+
return null;
|
|
78
|
+
const revoked = { ...capability, enabled: false, revoked_at: nowIso(), revoke_reason: reason };
|
|
79
|
+
const dir = missionDir(root, missionId);
|
|
80
|
+
await writeJsonAtomic(path.join(dir, MAD_DB_CAPABILITY_FILE), revoked);
|
|
81
|
+
await appendJsonlBounded(path.join(dir, 'mad-db-ledger.jsonl'), { ts: nowIso(), type: 'capability.revoked', mission_id: missionId, cycle_id: capability.cycle_id, reason });
|
|
82
|
+
return revoked;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=mad-db-capability.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { appendJsonlBounded, nowIso, writeJsonAtomic } from '../fsx.js';
|
|
3
|
+
import { missionDir } from '../mission.js';
|
|
4
|
+
export const MAD_DB_LEDGER_EVENT_SCHEMA = 'sks.mad-db-ledger-event.v1';
|
|
5
|
+
export async function appendMadDbLedgerEvent(root, missionId, event) {
|
|
6
|
+
const row = {
|
|
7
|
+
schema: MAD_DB_LEDGER_EVENT_SCHEMA,
|
|
8
|
+
ts: nowIso(),
|
|
9
|
+
mission_id: missionId,
|
|
10
|
+
...event
|
|
11
|
+
};
|
|
12
|
+
const dir = missionDir(root, missionId);
|
|
13
|
+
await appendJsonlBounded(path.join(dir, 'mad-db-ledger.jsonl'), row);
|
|
14
|
+
await writeJsonAtomic(path.join(dir, 'mad-db-ledger.latest.json'), row).catch(() => undefined);
|
|
15
|
+
return row;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=mad-db-ledger.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { readMadDbCapability, isMadDbCapabilityActive } from './mad-db-capability.js';
|
|
2
|
+
export const MAD_DB_POLICY_DECISION_SCHEMA = 'sks.mad-db-policy-decision.v1';
|
|
3
|
+
export async function resolveMadDbMutationPolicy(root, state = {}, classification = {}) {
|
|
4
|
+
const missionId = state?.mission_id ? String(state.mission_id) : null;
|
|
5
|
+
if (!missionId)
|
|
6
|
+
return inactive('mission_id_missing');
|
|
7
|
+
const capability = await readMadDbCapability(root, missionId);
|
|
8
|
+
if (!isMadDbCapabilityActive(capability))
|
|
9
|
+
return inactive(capability?.consumed ? 'mad_db_capability_consumed' : 'mad_db_capability_inactive');
|
|
10
|
+
if (!isDbMutationOrDbTool(classification))
|
|
11
|
+
return inactive('not_a_database_mutation');
|
|
12
|
+
return {
|
|
13
|
+
schema: MAD_DB_POLICY_DECISION_SCHEMA,
|
|
14
|
+
allowed: true,
|
|
15
|
+
action: 'allow',
|
|
16
|
+
mode: 'mad-db-break-glass',
|
|
17
|
+
priority: 0,
|
|
18
|
+
priority_order: ['mad-db', 'mad-sks', 'sealed-contract', 'default-db-safety'],
|
|
19
|
+
reasons: ['mad_db_one_cycle_break_glass_capability_active'],
|
|
20
|
+
audit_required: true,
|
|
21
|
+
mission_id: missionId,
|
|
22
|
+
cycle_id: capability.cycle_id,
|
|
23
|
+
capability
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function inactive(reason) {
|
|
27
|
+
return {
|
|
28
|
+
schema: MAD_DB_POLICY_DECISION_SCHEMA,
|
|
29
|
+
allowed: false,
|
|
30
|
+
action: 'defer',
|
|
31
|
+
mode: 'default-db-safety',
|
|
32
|
+
priority: 99,
|
|
33
|
+
reasons: [reason],
|
|
34
|
+
audit_required: false
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function isDbMutationOrDbTool(classification = {}) {
|
|
38
|
+
if (classification.level === 'write' || classification.level === 'destructive')
|
|
39
|
+
return true;
|
|
40
|
+
if (classification.toolReasons?.includes?.('database_tool'))
|
|
41
|
+
return true;
|
|
42
|
+
if (classification.toolReasons?.includes?.('migration_apply_tool'))
|
|
43
|
+
return true;
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=mad-db-policy-resolver.js.map
|
|
@@ -32,7 +32,7 @@ async function main() {
|
|
|
32
32
|
generationIndex: 1,
|
|
33
33
|
sessionId: String(intake.item.id || ''),
|
|
34
34
|
cwd: String(intake.worktree_path || process.cwd()),
|
|
35
|
-
prompt: buildNarutoWorkerPrompt(intake.item),
|
|
35
|
+
prompt: buildNarutoWorkerPrompt(intake.item, intake.parent_prompt),
|
|
36
36
|
outputSchemaId: CODEX_AGENT_WORKER_RESULT_SCHEMA_ID,
|
|
37
37
|
outputSchema: codexAgentWorkerResultSchema,
|
|
38
38
|
sandboxPolicy: intake.item.write_allowed === true ? 'workspace-write' : 'read-only',
|
|
@@ -109,10 +109,12 @@ function backendPreference(value) {
|
|
|
109
109
|
return ['local-llm', 'codex-sdk'];
|
|
110
110
|
return ['codex-sdk'];
|
|
111
111
|
}
|
|
112
|
-
function buildNarutoWorkerPrompt(item) {
|
|
112
|
+
function buildNarutoWorkerPrompt(item, parentPrompt) {
|
|
113
113
|
const writeAllowed = item?.write_allowed === true;
|
|
114
|
+
const parentObjective = normalizeWorkerPromptText(parentPrompt);
|
|
114
115
|
return [
|
|
115
116
|
'You are a Naruto route worker. Complete only this assigned work item and return JSON matching the required schema.',
|
|
117
|
+
parentObjective ? `Parent Naruto objective:\n${parentObjective}` : null,
|
|
116
118
|
`Work item: ${String(item?.id || '')} ${String(item?.title || item?.kind || '')}`,
|
|
117
119
|
`Role: ${String(item?.required_role || 'worker')}`,
|
|
118
120
|
`Kind: ${String(item?.kind || 'verification')}`,
|
|
@@ -122,8 +124,14 @@ function buildNarutoWorkerPrompt(item) {
|
|
|
122
124
|
writeAllowed
|
|
123
125
|
? 'If changes are needed, return model-authored patch_envelopes scoped to write paths.'
|
|
124
126
|
: 'This is read-only work. Do not mutate files and return an empty patch_envelopes array.',
|
|
127
|
+
writeAllowed
|
|
128
|
+
? null
|
|
129
|
+
: 'For read-only work, inspect requested files/artifacts only; do not run package scripts, build commands, tests, or temp-file-creating checks unless the parent objective explicitly requires them.',
|
|
125
130
|
'Include verification checks, rollback notes, blockers, findings, and changed_files.'
|
|
126
|
-
].join('\n');
|
|
131
|
+
].filter(Boolean).join('\n');
|
|
132
|
+
}
|
|
133
|
+
function normalizeWorkerPromptText(value) {
|
|
134
|
+
return String(value || '').replace(/\s+/g, ' ').trim().slice(0, 4000);
|
|
127
135
|
}
|
|
128
136
|
main().then(() => {
|
|
129
137
|
process.exit(0);
|
|
@@ -29,6 +29,7 @@ export async function spawnActualNarutoWorker(input) {
|
|
|
29
29
|
generated_at: nowIso(),
|
|
30
30
|
mission_id: input.missionId,
|
|
31
31
|
item: input.item,
|
|
32
|
+
parent_prompt: normalizeWorkerPromptText(input.parentPrompt),
|
|
32
33
|
placement: input.placement,
|
|
33
34
|
backend: input.backend,
|
|
34
35
|
result_path: resultPath,
|
|
@@ -85,6 +86,9 @@ export async function collectActualNarutoWorker(handle) {
|
|
|
85
86
|
blockers
|
|
86
87
|
};
|
|
87
88
|
}
|
|
89
|
+
function normalizeWorkerPromptText(value) {
|
|
90
|
+
return String(value || '').replace(/\s+/g, ' ').trim().slice(0, 4000);
|
|
91
|
+
}
|
|
88
92
|
function actualWorkerEntrypoint() {
|
|
89
93
|
return fileURLToPath(new URL('./naruto-real-worker-child.js', import.meta.url));
|
|
90
94
|
}
|
|
@@ -5,17 +5,18 @@ export function selectFinalGptPatchSource(gptFinal, localPatchEnvelopes = []) {
|
|
|
5
5
|
schema: 'sks.final-gpt-patch-stage.v1',
|
|
6
6
|
ok: true,
|
|
7
7
|
final_patch_source: 'gpt_final_arbiter',
|
|
8
|
-
patch_envelopes:
|
|
8
|
+
patch_envelopes: decodePatchDecisionItems(gptFinal?.result?.modified_patch_envelopes),
|
|
9
9
|
blockers: []
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
if (status === 'approved') {
|
|
13
|
+
const accepted = decodePatchDecisionItems(gptFinal?.result?.accepted_patch_envelopes);
|
|
13
14
|
return {
|
|
14
15
|
schema: 'sks.final-gpt-patch-stage.v1',
|
|
15
16
|
ok: true,
|
|
16
17
|
final_patch_source: 'gpt_final_arbiter',
|
|
17
|
-
patch_envelopes:
|
|
18
|
-
?
|
|
18
|
+
patch_envelopes: accepted.length
|
|
19
|
+
? accepted
|
|
19
20
|
: localPatchEnvelopes,
|
|
20
21
|
blockers: []
|
|
21
22
|
};
|
|
@@ -28,4 +29,20 @@ export function selectFinalGptPatchSource(gptFinal, localPatchEnvelopes = []) {
|
|
|
28
29
|
blockers: ['gpt_final_not_approved']
|
|
29
30
|
};
|
|
30
31
|
}
|
|
32
|
+
function decodePatchDecisionItems(value) {
|
|
33
|
+
if (!Array.isArray(value))
|
|
34
|
+
return [];
|
|
35
|
+
return value.flatMap((entry) => {
|
|
36
|
+
if (entry && typeof entry === 'object' && typeof entry.patch_envelope_json === 'string') {
|
|
37
|
+
try {
|
|
38
|
+
const parsed = JSON.parse(entry.patch_envelope_json);
|
|
39
|
+
return parsed && typeof parsed === 'object' && Object.keys(parsed).length ? [parsed] : [];
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return entry && typeof entry === 'object' ? [entry] : [];
|
|
46
|
+
});
|
|
47
|
+
}
|
|
31
48
|
//# sourceMappingURL=final-gpt-patch-stage.js.map
|
|
@@ -39,7 +39,7 @@ function ambientGoalContinuation() {
|
|
|
39
39
|
mode: 'ambient_codex_native_goal_overlay',
|
|
40
40
|
native_slash_command: '/goal',
|
|
41
41
|
non_disruptive: true,
|
|
42
|
-
rule: 'Use Codex native goal persistence when available to keep work resumable until completion; it never replaces the selected SKS route,
|
|
42
|
+
rule: 'Use Codex native goal persistence when available to keep work resumable until completion; it never replaces the selected SKS route, Naruto, TriWiki, verification, reflection, or Honest Mode gates.'
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
const REFLECTION_ARTIFACT = 'reflection.md';
|
|
@@ -279,7 +279,7 @@ function selectPipelineLane(route, task, proof) {
|
|
|
279
279
|
if (LIGHTWEIGHT_ROUTES.has(route?.id))
|
|
280
280
|
return { lane: `${String(route.id).toLowerCase()}_lightweight_lane`, source: 'route_policy', fast_lane_allowed: true, reason: 'Lightweight route bypasses full mission orchestration by design.', blockers: [], skip_when_fast: SPEED_LANE_POLICY.skip_when_fast, keep: ['focused_implementation', 'listed_verification', 'honest_mode'] };
|
|
281
281
|
if (routeRequiresSubagents(route, task))
|
|
282
|
-
return { lane: SPEED_LANE_POLICY.full_lane, source: 'route_policy', fast_lane_allowed: false, reason: 'No Proof Field attached and this route normally requires full
|
|
282
|
+
return { lane: SPEED_LANE_POLICY.full_lane, source: 'route_policy', fast_lane_allowed: false, reason: 'No Proof Field attached and this route normally requires full Naruto evidence.', blockers: ['proof_field_not_attached'], skip_when_fast: [], keep: SPEED_LANE_POLICY.always_keep };
|
|
283
283
|
return { lane: SPEED_LANE_POLICY.balanced_lane, source: 'route_policy', fast_lane_allowed: false, reason: 'Balanced parent-owned route until Proof Field proves a narrower lane.', blockers: ['proof_field_not_attached'], skip_when_fast: [], keep: SPEED_LANE_POLICY.always_keep };
|
|
284
284
|
}
|
|
285
285
|
function buildPipelineStages(route, task, ambiguity, lane, context7Required, agentPolicy = normalizeAgentPolicy(route, task, {})) {
|
|
@@ -343,8 +343,11 @@ function planNextActions(route, task, ambiguity, lane, agentPolicy = normalizeAg
|
|
|
343
343
|
const actions = ['read pipeline-plan.json before work', 'execute kept stages only', 'run listed verification'];
|
|
344
344
|
if (agentPolicy.required)
|
|
345
345
|
actions.splice(1, 0, 'run sks agents run latest --json before implementation');
|
|
346
|
-
if (!lane.fast_lane_allowed && routeRequiresSubagents(route, task))
|
|
347
|
-
actions.splice(1, 0,
|
|
346
|
+
if (!lane.fast_lane_allowed && routeRequiresSubagents(route, task)) {
|
|
347
|
+
actions.splice(1, 0, route?.id === 'Naruto'
|
|
348
|
+
? 'materialize Naruto clone roster, work graph, worker proof, and naruto-gate.json before implementation'
|
|
349
|
+
: 'materialize full Team artifacts before implementation');
|
|
350
|
+
}
|
|
348
351
|
if (looksLikeProblemSolvingRequest(task))
|
|
349
352
|
actions.splice(1, 0, 'run Solution Scout web search for similar fixes before editing');
|
|
350
353
|
actions.push('refresh/validate TriWiki when required', 'finish with completion summary and Honest Mode');
|
|
@@ -372,10 +375,10 @@ export function promptPipelineContext(prompt, route = null) {
|
|
|
372
375
|
'Ambient Goal continuation: even without an explicit $Goal keyword, use Codex native /goal persistence when it helps keep long work resumable and complete; do not let it replace or skip the selected SKS route gates.',
|
|
373
376
|
'Route contract: execution routes infer contract answers from the prompt, TriWiki/current-code defaults, and conservative SKS policy. DFix and Answer bypass stateful execution because they do not start implementation.',
|
|
374
377
|
'Plan-first interaction: when ambiguity questions are truly required, show the user only the missing human decision(s), then seal the decision contract internally and execute/verify.',
|
|
375
|
-
'Question-shaped directive policy: before using Answer, decide whether a question is a real information request or an implicit instruction/complaint about broken behavior. Rhetorical bug reports, mandatory-policy statements, and "why is this not happening?" execution complaints must route to
|
|
378
|
+
'Question-shaped directive policy: before using Answer, decide whether a question is a real information request or an implicit instruction/complaint about broken behavior. Rhetorical bug reports, mandatory-policy statements, and "why is this not happening?" execution complaints must route to Naruto, not Answer.',
|
|
376
379
|
'Best-practice prompt shape: extract Goal, Context, Constraints, and Done-when before implementation; keep questions compact and only ask for answers that can change scope, safety, user-facing behavior, or acceptance criteria.',
|
|
377
380
|
chatCaptureIntakeText(),
|
|
378
|
-
'Default execution routing: general implementation/code-changing prompts promote to
|
|
381
|
+
'Default execution routing: general implementation/code-changing prompts promote to Naruto so the normal path is shadow-clone fan-out, hardware-safe concurrency, patch envelopes, verification DAG, and GPT final arbitration. Answer, DFix, Help, Wiki maintenance, and safety-specific routes are intentional exceptions.',
|
|
379
382
|
'Stance: infer the user intent aggressively from rough wording, local context, TriWiki, and conservative defaults; do not surface prequestion sheets before work.',
|
|
380
383
|
subagentExecutionPolicyText(route, cleanPrompt),
|
|
381
384
|
solutionScoutPolicyText(cleanPrompt),
|
|
@@ -397,8 +400,10 @@ export function promptPipelineContext(prompt, route = null) {
|
|
|
397
400
|
];
|
|
398
401
|
if (reflectionRequiredForRoute(route))
|
|
399
402
|
lines.push(reflectionInstructionText());
|
|
403
|
+
if (route?.id === 'Naruto')
|
|
404
|
+
lines.push(`Naruto route: build clone roster, massive work graph, hardware-safe governor, active pool, allocation/rebalance policy, parallel verification DAG, GPT final pack, per-clone proof, session cleanup, reflection, and Honest Mode. $Team is deprecated for new execution missions.`);
|
|
400
405
|
if (route?.id === 'Team')
|
|
401
|
-
lines.push(`Team route
|
|
406
|
+
lines.push(`Team route is a deprecated compatibility surface; use $Naruto for new execution missions. Existing Team mission observation commands remain available.`);
|
|
402
407
|
if (route?.id === 'Goal')
|
|
403
408
|
lines.push('Goal route: write SKS goal bridge artifacts, then use Codex native /goal persistence for create, pause, resume, and clear continuation controls.');
|
|
404
409
|
if (route?.id === 'PPT')
|
|
@@ -473,8 +478,10 @@ export async function prepareRoute(root, prompt, state = {}) {
|
|
|
473
478
|
const nativeSessionsRequired = routeRequiresSubagents(route, cleanPrompt);
|
|
474
479
|
if (QUESTION_GATE_ROUTES.has(route.id) || route.id === 'MadSKS')
|
|
475
480
|
return withSkillDreamContext(await prepareClarificationGate(root, route, task, required, { madSksAuthorization }), dreamContext);
|
|
481
|
+
if (route.id === 'Naruto')
|
|
482
|
+
return withSkillDreamContext(await prepareNaruto(root, route, task, required, { madSksAuthorization }), dreamContext);
|
|
476
483
|
if (route.id === 'Team')
|
|
477
|
-
return withSkillDreamContext(await
|
|
484
|
+
return withSkillDreamContext(await prepareNaruto(root, { ...route, id: 'Naruto', command: '$Naruto', mode: 'NARUTO', stopGate: 'naruto-gate.json', requiredSkills: ['naruto', 'pipeline-runner', 'prompt-pipeline', 'honest-mode'] }, task, required, { madSksAuthorization, teamAlias: true }), dreamContext);
|
|
478
485
|
if (route.id === 'Research')
|
|
479
486
|
return withSkillDreamContext(await prepareResearch(root, route, task, required), dreamContext);
|
|
480
487
|
if (route.id === 'AutoResearch')
|
|
@@ -626,6 +633,10 @@ export async function activeRouteContext(root, state) {
|
|
|
626
633
|
const roles = state.role_counts ? ` Role counts: ${formatRoleCounts(state.role_counts)}.` : '';
|
|
627
634
|
return `Active Team mission ${state.mission_id || 'latest'} must keep the user-visible live transcript updated. Native session budget: ${state.agent_sessions || MIN_TEAM_REVIEWER_LANES}.${roles} Run native sessions, TriWiki refresh, debate, consensus, fresh development, minimum ${MIN_TEAM_REVIEWER_LANES}-lane review/integration, then close or account for every Team native session and write ${TEAM_SESSION_CLEANUP_ARTIFACT} before reflection/final. ${MIN_TEAM_REVIEW_POLICY_TEXT} After each native-session status/result/handoff, run: sks team event ${state.mission_id || 'latest'} --agent <name> --phase <phase> --message "...". Inspect with sks team log/watch ${state.mission_id || 'latest'}.${reasoningNote}${context7}${planNote}`;
|
|
628
635
|
}
|
|
636
|
+
if (state.mode === 'NARUTO') {
|
|
637
|
+
const clones = state.clone_count ? ` Clone count: ${state.clone_count}.` : '';
|
|
638
|
+
return `Active Naruto mission ${state.mission_id || 'latest'} must keep clone/worker evidence current.${clones} Use sks naruto status ${state.mission_id || 'latest'} --json, inspect .sneakoscope/missions/${state.mission_id || 'latest'}/naruto-gate.json and agents/agent-proof-evidence.json, then continue until the Naruto gate passes or a hard blocker is recorded.${reasoningNote}${planNote}`;
|
|
639
|
+
}
|
|
629
640
|
if (state.subagents_required && !(await hasSubagentEvidence(root, state))) {
|
|
630
641
|
return `Active SKS route ${id} requires native multi-session evidence before code-changing work can be considered complete. Run worker/reviewer native sessions for disjoint write scopes, or record explicit unavailable/unsplittable native-session evidence before editing.${reasoningNote}${planNote}`;
|
|
631
642
|
}
|
|
@@ -1069,6 +1080,61 @@ async function prepareLightRoute(root, route, task, required) {
|
|
|
1069
1080
|
await setCurrent(root, routeState(id, route, 'ROUTE_CONTEXT_READY', required, { prompt: task, stop_gate: 'none', pipeline_plan_ready: validatePipelinePlan(pipelinePlan).ok, pipeline_plan_path: PIPELINE_PLAN_ARTIFACT }));
|
|
1070
1081
|
return routeContext(route, id, task, required, 'Load the route skill context, execute the smallest matching action, and finish with Honest Mode.');
|
|
1071
1082
|
}
|
|
1083
|
+
async function prepareNaruto(root, route, task, required, opts = {}) {
|
|
1084
|
+
const cleanTask = stripDollarCommand(task) || String(task || '').trim();
|
|
1085
|
+
const { id, dir } = await createMission(root, { mode: 'naruto', prompt: cleanTask });
|
|
1086
|
+
const routeContextPayload = {
|
|
1087
|
+
route: 'Naruto',
|
|
1088
|
+
command: '$Naruto',
|
|
1089
|
+
mode: 'NARUTO',
|
|
1090
|
+
task: cleanTask,
|
|
1091
|
+
required_skills: route.requiredSkills || ['naruto', 'pipeline-runner', 'prompt-pipeline', 'honest-mode'],
|
|
1092
|
+
context7_required: required,
|
|
1093
|
+
context_tracking: triwikiContextTracking(),
|
|
1094
|
+
stop_gate: 'naruto-gate.json',
|
|
1095
|
+
team_alias: opts.teamAlias === true,
|
|
1096
|
+
mad_sks_authorization: Boolean(opts.madSksAuthorization)
|
|
1097
|
+
};
|
|
1098
|
+
await writeJsonAtomic(path.join(dir, 'route-context.json'), routeContextPayload);
|
|
1099
|
+
await writeJsonAtomic(path.join(dir, 'naruto-gate.json'), {
|
|
1100
|
+
schema: 'sks.naruto-gate.v1',
|
|
1101
|
+
passed: false,
|
|
1102
|
+
mission_id: id,
|
|
1103
|
+
clone_roster_built: false,
|
|
1104
|
+
work_graph_ready: false,
|
|
1105
|
+
role_distribution_ready: false,
|
|
1106
|
+
allocation_ready: false,
|
|
1107
|
+
rebalance_ready: false,
|
|
1108
|
+
concurrency_governor_ready: false,
|
|
1109
|
+
active_pool_simulated: false,
|
|
1110
|
+
verification_dag_ready: false,
|
|
1111
|
+
gpt_final_pack_ready: false,
|
|
1112
|
+
zellij_dashboard_ready: false,
|
|
1113
|
+
native_agent_proof: false,
|
|
1114
|
+
final_arbiter_accepted: false,
|
|
1115
|
+
session_cleanup: false,
|
|
1116
|
+
blockers: ['naruto_run_not_started'],
|
|
1117
|
+
updated_at: nowIso()
|
|
1118
|
+
});
|
|
1119
|
+
const pipelinePlan = await writePipelinePlan(dir, { missionId: id, route, task: cleanTask, required, ambiguity: { required: false, status: opts.teamAlias ? 'team_alias_to_naruto' : 'direct_naruto' } });
|
|
1120
|
+
await setCurrent(root, routeState(id, route, 'NARUTO_READY', required, {
|
|
1121
|
+
prompt: cleanTask,
|
|
1122
|
+
route: 'Naruto',
|
|
1123
|
+
route_command: '$Naruto',
|
|
1124
|
+
mode: 'NARUTO',
|
|
1125
|
+
implementation_allowed: true,
|
|
1126
|
+
ambiguity_gate_required: false,
|
|
1127
|
+
ambiguity_gate_passed: true,
|
|
1128
|
+
stop_gate: 'naruto-gate.json',
|
|
1129
|
+
required_skills: routeContextPayload.required_skills,
|
|
1130
|
+
subagents_required: true,
|
|
1131
|
+
native_sessions_required: true,
|
|
1132
|
+
naruto_gate_file: 'naruto-gate.json',
|
|
1133
|
+
pipeline_plan_ready: validatePipelinePlan(pipelinePlan).ok,
|
|
1134
|
+
pipeline_plan_path: PIPELINE_PLAN_ARTIFACT
|
|
1135
|
+
}));
|
|
1136
|
+
return routeContext(route, id, cleanTask, required, `Run sks naruto run ${JSON.stringify(cleanTask)} --json (or continue with Codex native workers for the same mission), then update naruto-gate.json from the worker proof and verification DAG.`);
|
|
1137
|
+
}
|
|
1072
1138
|
function routeState(id, route, phase, context7Required, extra = {}) {
|
|
1073
1139
|
const reasoning = routeReasoning(route, extra.prompt || '');
|
|
1074
1140
|
const nativeSessionsRequired = routeRequiresSubagents(route, extra.prompt || '');
|
|
@@ -371,6 +371,24 @@ function missingRequiredGateFields(file, state, gate = {}) {
|
|
|
371
371
|
return required
|
|
372
372
|
.filter((key) => gate[key] !== true);
|
|
373
373
|
}
|
|
374
|
+
if (file === 'naruto-gate.json' || mode === 'NARUTO') {
|
|
375
|
+
const required = [
|
|
376
|
+
'clone_roster_built',
|
|
377
|
+
'work_graph_ready',
|
|
378
|
+
'role_distribution_ready',
|
|
379
|
+
'allocation_ready',
|
|
380
|
+
'rebalance_ready',
|
|
381
|
+
'concurrency_governor_ready',
|
|
382
|
+
'active_pool_simulated',
|
|
383
|
+
'verification_dag_ready',
|
|
384
|
+
'gpt_final_pack_ready',
|
|
385
|
+
'zellij_dashboard_ready',
|
|
386
|
+
'native_agent_proof',
|
|
387
|
+
'final_arbiter_accepted',
|
|
388
|
+
'session_cleanup'
|
|
389
|
+
];
|
|
390
|
+
return required.filter((key) => gate[key] !== true);
|
|
391
|
+
}
|
|
374
392
|
if (file === 'qa-gate.json' || mode === 'QALOOP') {
|
|
375
393
|
const required = ['clarification_contract_sealed', 'qa_report_written', 'qa_ledger_complete', 'checklist_completed', 'safety_reviewed', 'deployed_destructive_tests_blocked', 'credentials_not_persisted', 'honest_mode_complete'];
|
|
376
394
|
if (gate.ui_e2e_required === true)
|
|
@@ -405,6 +423,8 @@ async function missingRequiredGateArtifacts(root, file, state, gate = {}) {
|
|
|
405
423
|
}
|
|
406
424
|
if (file === IMAGE_UX_REVIEW_GATE_ARTIFACT || mode === 'IMAGE_UX_REVIEW')
|
|
407
425
|
return missingImageUxReviewArtifacts(root, state, gate);
|
|
426
|
+
if (file === 'naruto-gate.json' || mode === 'NARUTO')
|
|
427
|
+
return missingNarutoArtifacts(root, state, gate);
|
|
408
428
|
if (file !== 'team-gate.json' && mode !== 'TEAM')
|
|
409
429
|
return [];
|
|
410
430
|
const missing = [];
|
|
@@ -611,6 +631,8 @@ function gateFilesForState(state) {
|
|
|
611
631
|
return ['goal-workflow.json'];
|
|
612
632
|
if (state.mode === 'RESEARCH')
|
|
613
633
|
return ['research-gate.json', 'research-gate.evaluated.json'];
|
|
634
|
+
if (state.mode === 'NARUTO')
|
|
635
|
+
return ['naruto-gate.json'];
|
|
614
636
|
if (state.mode === 'TEAM')
|
|
615
637
|
return ['team-gate.json'];
|
|
616
638
|
if (state.mode === 'AUTORESEARCH')
|
|
@@ -627,6 +649,28 @@ function gateFilesForState(state) {
|
|
|
627
649
|
return [IMAGE_UX_REVIEW_GATE_ARTIFACT];
|
|
628
650
|
return ['done-gate.json'];
|
|
629
651
|
}
|
|
652
|
+
async function missingNarutoArtifacts(root, state = {}, gate = {}) {
|
|
653
|
+
const id = state?.mission_id;
|
|
654
|
+
if (!id)
|
|
655
|
+
return ['mission_id'];
|
|
656
|
+
const dir = missionDir(root, id);
|
|
657
|
+
const required = [
|
|
658
|
+
'naruto-gate.json',
|
|
659
|
+
'agents/naruto-work-graph.json',
|
|
660
|
+
'agents/naruto-role-distribution.json',
|
|
661
|
+
'agents/naruto-concurrency-governor.json',
|
|
662
|
+
'agents/naruto-verification-dag.json',
|
|
663
|
+
'agents/naruto-gpt-final-pack.json'
|
|
664
|
+
];
|
|
665
|
+
const missing = [];
|
|
666
|
+
for (const file of required) {
|
|
667
|
+
if (!(await exists(path.join(dir, file))))
|
|
668
|
+
missing.push(file);
|
|
669
|
+
}
|
|
670
|
+
if (gate.native_agent_proof === true && !(await exists(path.join(dir, 'agents', 'agent-proof-evidence.json'))))
|
|
671
|
+
missing.push('agents/agent-proof-evidence.json');
|
|
672
|
+
return missing;
|
|
673
|
+
}
|
|
630
674
|
function extractLastMessage(payload) {
|
|
631
675
|
return payload.last_assistant_message || payload.assistant_message || payload.message || payload.response || payload.raw || '';
|
|
632
676
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { containsPlaintextSecret } from '../secret-redaction.js';
|
|
2
2
|
import { readRouteProof } from './proof-reader.js';
|
|
3
3
|
import { validateCompletionProof } from './validation.js';
|
|
4
|
-
import { proofStatusBlocks, routeRequiresCompletionProof, routeRequiresImageVoxelAnchors } from './route-proof-policy.js';
|
|
4
|
+
import { normalizeProofRoute, proofStatusBlocks, routeRequiresCompletionProof, routeRequiresImageVoxelAnchors } from './route-proof-policy.js';
|
|
5
5
|
import { routeRequiresAgentIntake } from '../agents/agent-plan.js';
|
|
6
6
|
export async function validateRouteCompletionProof(root, { missionId = null, route = null, state = {}, visualClaim = undefined } = {}) {
|
|
7
7
|
const proofRequired = state.proof_required === true || routeRequiresCompletionProof(route);
|
|
@@ -34,11 +34,13 @@ export async function validateRouteCompletionProof(root, { missionId = null, rou
|
|
|
34
34
|
else {
|
|
35
35
|
if (agents.status !== 'passed' || agents.ok !== true)
|
|
36
36
|
issues.push('agent_gate_not_passed');
|
|
37
|
+
const normalizedRoute = normalizeProofRoute(route || proof.route);
|
|
38
|
+
const maxAgentCount = normalizedRoute === '$Naruto' ? 100 : 20;
|
|
37
39
|
const agentCount = Number(agents.agent_count || 0);
|
|
38
40
|
if (agentCount < 5)
|
|
39
41
|
issues.push('agent_count_below_5');
|
|
40
|
-
if (agentCount >
|
|
41
|
-
issues.push(
|
|
42
|
+
if (agentCount > maxAgentCount)
|
|
43
|
+
issues.push(`agent_count_above_${maxAgentCount}`);
|
|
42
44
|
if (agents.all_sessions_closed !== true)
|
|
43
45
|
issues.push('agent_sessions_not_closed');
|
|
44
46
|
if (agents.no_overlap_ok !== true)
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export const SERIOUS_ROUTE_ALIASES = Object.freeze([
|
|
2
2
|
'$Team',
|
|
3
|
+
'$Naruto',
|
|
4
|
+
'$ShadowClone',
|
|
5
|
+
'$Kagebunshin',
|
|
3
6
|
'$DFix',
|
|
4
7
|
'$QA-LOOP',
|
|
5
8
|
'$Research',
|
|
@@ -35,7 +38,12 @@ export const VISUAL_ROUTE_ALIASES = Object.freeze([
|
|
|
35
38
|
'$GX'
|
|
36
39
|
]);
|
|
37
40
|
const ROUTE_NORMALIZATION = Object.freeze({
|
|
38
|
-
team: '$
|
|
41
|
+
team: '$Naruto',
|
|
42
|
+
naruto: '$Naruto',
|
|
43
|
+
shadowclone: '$Naruto',
|
|
44
|
+
'shadow-clone': '$Naruto',
|
|
45
|
+
kagebunshin: '$Naruto',
|
|
46
|
+
'kage-bunshin': '$Naruto',
|
|
39
47
|
dfix: '$DFix',
|
|
40
48
|
qaloop: '$QA-LOOP',
|
|
41
49
|
'qa-loop': '$QA-LOOP',
|