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,208 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { readJson, writeJsonAtomic, writeTextAtomic, nowIso } from '../fsx.js';
|
|
3
|
+
import { runCodexTask } from '../codex-control/codex-task-runner.js';
|
|
4
|
+
import { researchPaperArtifactForPlan } from '../research.js';
|
|
5
|
+
import { analyzeResearchReportQuality, countWords } from './research-report-quality.js';
|
|
6
|
+
import { analyzeResearchRepetition } from './research-repetition-detector.js';
|
|
7
|
+
import { buildRealisticResearchPaper, buildRealisticResearchReport } from './research-realistic-report.js';
|
|
8
|
+
import { buildResearchSynthesisPrompt } from './research-synthesis-prompt.js';
|
|
9
|
+
export const researchSynthesisOutputSchema = {
|
|
10
|
+
type: 'object',
|
|
11
|
+
required: ['schema', 'mission_id', 'generated_at', 'report_markdown', 'paper_markdown', 'synthesis_summary', 'quality_signals', 'blockers'],
|
|
12
|
+
properties: {
|
|
13
|
+
schema: { const: 'sks.research-synthesis-output.v1' },
|
|
14
|
+
mission_id: { type: 'string' },
|
|
15
|
+
generated_at: { type: 'string' },
|
|
16
|
+
report_markdown: { type: 'string' },
|
|
17
|
+
paper_markdown: { type: 'string' },
|
|
18
|
+
synthesis_summary: {
|
|
19
|
+
type: 'object',
|
|
20
|
+
required: ['key_claim_ids', 'source_ids_used', 'counterevidence_ids_used', 'blueprint_sections_used', 'experiment_steps_used'],
|
|
21
|
+
properties: {
|
|
22
|
+
key_claim_ids: { type: 'array', items: { type: 'string' } },
|
|
23
|
+
source_ids_used: { type: 'array', items: { type: 'string' } },
|
|
24
|
+
counterevidence_ids_used: { type: 'array', items: { type: 'string' } },
|
|
25
|
+
blueprint_sections_used: { type: 'array', items: { type: 'string' } },
|
|
26
|
+
experiment_steps_used: { type: 'array', items: { type: 'string' } }
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
quality_signals: {
|
|
30
|
+
type: 'object',
|
|
31
|
+
required: ['report_word_count', 'source_citation_count', 'unique_source_ids_cited', 'key_claims_covered', 'repeated_paragraph_ratio', 'template_phrase_hits'],
|
|
32
|
+
properties: {
|
|
33
|
+
report_word_count: { type: 'number' },
|
|
34
|
+
source_citation_count: { type: 'number' },
|
|
35
|
+
unique_source_ids_cited: { type: 'number' },
|
|
36
|
+
key_claims_covered: { type: 'number' },
|
|
37
|
+
repeated_paragraph_ratio: { type: 'number' },
|
|
38
|
+
template_phrase_hits: { type: 'array', items: { type: 'string' } }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
blockers: { type: 'array', items: { type: 'string' } }
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
export async function runResearchCodexSynthesisWriter(input) {
|
|
45
|
+
const artifacts = await readSynthesisInputs(input.dir);
|
|
46
|
+
if (input.mock === true || input.plan?.backend === 'mock' || input.plan?.backend === 'deterministic') {
|
|
47
|
+
const output = normalizeResearchSynthesisOutput(mockResearchSynthesisOutput(input.plan, artifacts));
|
|
48
|
+
const validation = validateResearchSynthesisOutput(output, artifacts.contract, artifacts.claimMatrix, artifacts.sourceLedger);
|
|
49
|
+
const merged = { ...output, blockers: [...new Set([...output.blockers, ...validation.blockers])] };
|
|
50
|
+
await writeSynthesisArtifacts(input.dir, input.plan, merged);
|
|
51
|
+
return merged;
|
|
52
|
+
}
|
|
53
|
+
const result = await runCodexTask({
|
|
54
|
+
route: '$Research',
|
|
55
|
+
tier: 'worker',
|
|
56
|
+
missionId: String(input.plan?.mission_id || 'research-synthesis'),
|
|
57
|
+
workItemId: 'research_synthesis',
|
|
58
|
+
cwd: input.root,
|
|
59
|
+
prompt: buildResearchSynthesisPrompt({ ...artifacts, plan: input.plan, cycle: input.cycle }),
|
|
60
|
+
outputSchema: researchSynthesisOutputSchema,
|
|
61
|
+
outputSchemaId: 'sks.research-synthesis-output.v1',
|
|
62
|
+
sandboxPolicy: 'read-only',
|
|
63
|
+
requestedScopeContract: {
|
|
64
|
+
id: 'research-synthesis',
|
|
65
|
+
route: '$Research',
|
|
66
|
+
read_only: true,
|
|
67
|
+
allowed_paths: [`.sneakoscope/missions/${input.plan?.mission_id || ''}/`],
|
|
68
|
+
write_paths: [],
|
|
69
|
+
allowed_write_prefixes: [`.sneakoscope/missions/${input.plan?.mission_id || ''}/`],
|
|
70
|
+
source_mutation_allowed: false
|
|
71
|
+
},
|
|
72
|
+
backendPreference: input.backendPreference || ['codex-sdk', 'python-codex-sdk'],
|
|
73
|
+
allowLocalLlm: false,
|
|
74
|
+
localLlmPolicy: { mode: 'disabled', requiresGptFinal: true },
|
|
75
|
+
mutationLedgerRoot: path.join(input.dir, 'research', 'synthesis-codex-control'),
|
|
76
|
+
reliabilityPolicy: { timeoutClass: 'standard', idleTimeoutMs: input.timeoutMs || 120000 }
|
|
77
|
+
});
|
|
78
|
+
const worker = await readJson(result.workerResultPath, null);
|
|
79
|
+
const output = normalizeResearchSynthesisOutput(worker);
|
|
80
|
+
const validation = validateResearchSynthesisOutput(output, artifacts.contract, artifacts.claimMatrix, artifacts.sourceLedger);
|
|
81
|
+
const patchEnvelopeBlocker = Array.isArray(worker?.patch_envelopes) && worker.patch_envelopes.length ? ['research_synthesis_patch_envelope_forbidden'] : [];
|
|
82
|
+
const blockers = [...new Set([
|
|
83
|
+
...output.blockers,
|
|
84
|
+
...(Array.isArray(result.blockers) ? result.blockers.map(String) : []),
|
|
85
|
+
...validation.blockers,
|
|
86
|
+
...patchEnvelopeBlocker
|
|
87
|
+
])];
|
|
88
|
+
const merged = { ...output, blockers };
|
|
89
|
+
await writeSynthesisArtifacts(input.dir, input.plan, merged);
|
|
90
|
+
return merged;
|
|
91
|
+
}
|
|
92
|
+
export function normalizeResearchSynthesisOutput(value) {
|
|
93
|
+
const reportMarkdown = String(value?.report_markdown || '');
|
|
94
|
+
const paperMarkdown = String(value?.paper_markdown || '');
|
|
95
|
+
const repetition = analyzeResearchRepetition(reportMarkdown);
|
|
96
|
+
const sourceIdsUsed = normalizeStringList(value?.synthesis_summary?.source_ids_used || value?.source_ids_used);
|
|
97
|
+
const keyClaimIds = normalizeStringList(value?.synthesis_summary?.key_claim_ids || value?.key_claim_ids);
|
|
98
|
+
return {
|
|
99
|
+
schema: 'sks.research-synthesis-output.v1',
|
|
100
|
+
mission_id: String(value?.mission_id || ''),
|
|
101
|
+
generated_at: String(value?.generated_at || nowIso()),
|
|
102
|
+
report_markdown: reportMarkdown,
|
|
103
|
+
paper_markdown: paperMarkdown,
|
|
104
|
+
synthesis_summary: {
|
|
105
|
+
key_claim_ids: keyClaimIds,
|
|
106
|
+
source_ids_used: sourceIdsUsed,
|
|
107
|
+
counterevidence_ids_used: normalizeStringList(value?.synthesis_summary?.counterevidence_ids_used || value?.counterevidence_ids_used),
|
|
108
|
+
blueprint_sections_used: normalizeStringList(value?.synthesis_summary?.blueprint_sections_used || value?.blueprint_sections_used),
|
|
109
|
+
experiment_steps_used: normalizeStringList(value?.synthesis_summary?.experiment_steps_used || value?.experiment_steps_used)
|
|
110
|
+
},
|
|
111
|
+
quality_signals: {
|
|
112
|
+
report_word_count: Number(value?.quality_signals?.report_word_count || countWords(reportMarkdown)),
|
|
113
|
+
source_citation_count: Number(value?.quality_signals?.source_citation_count || sourceCitationCount(reportMarkdown)),
|
|
114
|
+
unique_source_ids_cited: Number(value?.quality_signals?.unique_source_ids_cited || sourceIdsUsed.filter((id) => reportMarkdown.includes(id)).length),
|
|
115
|
+
key_claims_covered: Number(value?.quality_signals?.key_claims_covered || keyClaimIds.filter((id) => reportMarkdown.includes(id)).length),
|
|
116
|
+
repeated_paragraph_ratio: Number(value?.quality_signals?.repeated_paragraph_ratio ?? repetition.repeated_paragraph_ratio),
|
|
117
|
+
template_phrase_hits: normalizeStringList(value?.quality_signals?.template_phrase_hits || repetition.template_phrase_hits)
|
|
118
|
+
},
|
|
119
|
+
blockers: normalizeStringList(value?.blockers)
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export function validateResearchSynthesisOutput(output, contract = null, claimMatrix = null, sourceLedger = null) {
|
|
123
|
+
const reportQuality = analyzeResearchReportQuality(output.report_markdown);
|
|
124
|
+
const repetition = analyzeResearchRepetition(output.report_markdown);
|
|
125
|
+
const sourceIds = sourceIdsFromLedger(sourceLedger);
|
|
126
|
+
const keyClaims = Array.isArray(claimMatrix?.key_claim_ids) ? claimMatrix.key_claim_ids.map(String) : [];
|
|
127
|
+
const report = output.report_markdown;
|
|
128
|
+
const paper = output.paper_markdown;
|
|
129
|
+
const sourceIdsCited = sourceIds.filter((id) => report.includes(id));
|
|
130
|
+
const keyClaimsCovered = keyClaims.filter((id) => report.includes(id) || claimSourceIds(claimMatrix, id).some((sourceId) => report.includes(sourceId)));
|
|
131
|
+
const paperSections = ['Abstract', 'Introduction', 'Methodology', 'Findings', 'Discussion', 'Limitations', 'Conclusion', 'References'];
|
|
132
|
+
const blockers = [
|
|
133
|
+
...(output.schema === 'sks.research-synthesis-output.v1' ? [] : ['research_synthesis_schema_invalid']),
|
|
134
|
+
...(output.mission_id ? [] : ['research_synthesis_mission_missing']),
|
|
135
|
+
...(output.report_markdown.trim() ? [] : ['research_synthesis_report_missing']),
|
|
136
|
+
...(output.paper_markdown.trim() ? [] : ['research_synthesis_paper_missing']),
|
|
137
|
+
...(countWords(report) >= Number(contract?.min_report_words || 2200) ? [] : ['research_synthesis_report_too_short']),
|
|
138
|
+
...reportQuality.blockers,
|
|
139
|
+
...repetition.blockers,
|
|
140
|
+
...(sourceIdsCited.length >= Math.min(8, sourceIds.length) ? [] : ['research_synthesis_unique_sources_below_contract']),
|
|
141
|
+
...(keyClaimsCovered.length >= Number(contract?.min_key_claims || 8) ? [] : ['research_synthesis_key_claims_below_contract']),
|
|
142
|
+
...(repetition.repeated_paragraph_ratio <= 0.18 ? [] : ['research_synthesis_repeated_paragraph_ratio_high']),
|
|
143
|
+
...(repetition.template_phrase_hits.length ? ['research_synthesis_template_phrase_hits'] : []),
|
|
144
|
+
...(paperSections.every((heading) => paper.toLowerCase().includes(heading.toLowerCase())) ? [] : ['research_synthesis_paper_sections_missing']),
|
|
145
|
+
...output.blockers
|
|
146
|
+
];
|
|
147
|
+
return { ok: blockers.length === 0, blockers: [...new Set(blockers)] };
|
|
148
|
+
}
|
|
149
|
+
async function readSynthesisInputs(dir) {
|
|
150
|
+
return {
|
|
151
|
+
sourceLedger: await readJson(path.join(dir, 'source-ledger.json'), null),
|
|
152
|
+
claimMatrix: await readJson(path.join(dir, 'claim-evidence-matrix.json'), null),
|
|
153
|
+
falsificationLedger: await readJson(path.join(dir, 'falsification-ledger.json'), null),
|
|
154
|
+
implementationBlueprint: await readJson(path.join(dir, 'implementation-blueprint.json'), null),
|
|
155
|
+
experimentPlan: await readJson(path.join(dir, 'experiment-plan.json'), null),
|
|
156
|
+
replicationPack: await readJson(path.join(dir, 'replication-pack.json'), null),
|
|
157
|
+
contract: await readJson(path.join(dir, 'research-quality-contract.json'), null)
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function mockResearchSynthesisOutput(plan, artifacts) {
|
|
161
|
+
const claims = Array.isArray(artifacts.claimMatrix?.claims) ? artifacts.claimMatrix.claims : [];
|
|
162
|
+
const sourceIds = sourceIdsFromLedger(artifacts.sourceLedger);
|
|
163
|
+
const counterIds = counterevidenceIdsFromLedger(artifacts.sourceLedger);
|
|
164
|
+
const report = buildRealisticResearchReport({ plan, claims, sourceIds, counterevidenceIds: counterIds, blueprint: artifacts.implementationBlueprint, falsificationLedger: artifacts.falsificationLedger, experimentPlan: artifacts.experimentPlan, replicationPack: artifacts.replicationPack });
|
|
165
|
+
const paper = buildRealisticResearchPaper({ plan, claims, sourceIds, counterevidenceIds: counterIds });
|
|
166
|
+
return normalizeResearchSynthesisOutput({
|
|
167
|
+
schema: 'sks.research-synthesis-output.v1',
|
|
168
|
+
mission_id: String(plan?.mission_id || ''),
|
|
169
|
+
generated_at: nowIso(),
|
|
170
|
+
report_markdown: report,
|
|
171
|
+
paper_markdown: paper,
|
|
172
|
+
synthesis_summary: {
|
|
173
|
+
key_claim_ids: (Array.isArray(artifacts.claimMatrix?.key_claim_ids) ? artifacts.claimMatrix.key_claim_ids : claims.slice(0, 8).map((claim) => claim.id)).map(String),
|
|
174
|
+
source_ids_used: sourceIds,
|
|
175
|
+
counterevidence_ids_used: counterIds,
|
|
176
|
+
blueprint_sections_used: (Array.isArray(artifacts.implementationBlueprint?.sections) ? artifacts.implementationBlueprint.sections : []).map((section) => String(section.id || section.title || '')).filter(Boolean),
|
|
177
|
+
experiment_steps_used: (Array.isArray(artifacts.experimentPlan?.steps) ? artifacts.experimentPlan.steps : []).map((step) => String(step.id || '')).filter(Boolean)
|
|
178
|
+
},
|
|
179
|
+
blockers: []
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
async function writeSynthesisArtifacts(dir, plan, output) {
|
|
183
|
+
await writeJsonAtomic(path.join(dir, 'research-synthesis-output.json'), output);
|
|
184
|
+
if (output.report_markdown.trim())
|
|
185
|
+
await writeTextAtomic(path.join(dir, 'research-report.md'), `${output.report_markdown.trim()}\n`);
|
|
186
|
+
if (output.paper_markdown.trim())
|
|
187
|
+
await writeTextAtomic(path.join(dir, researchPaperArtifactForPlan(plan)), `${output.paper_markdown.trim()}\n`);
|
|
188
|
+
}
|
|
189
|
+
function sourceIdsFromLedger(sourceLedger) {
|
|
190
|
+
return normalizeStringList([
|
|
191
|
+
...(Array.isArray(sourceLedger?.sources) ? sourceLedger.sources : []),
|
|
192
|
+
...(Array.isArray(sourceLedger?.counterevidence_sources) ? sourceLedger.counterevidence_sources : [])
|
|
193
|
+
].map((row) => row?.id));
|
|
194
|
+
}
|
|
195
|
+
function counterevidenceIdsFromLedger(sourceLedger) {
|
|
196
|
+
return normalizeStringList((Array.isArray(sourceLedger?.counterevidence_sources) ? sourceLedger.counterevidence_sources : []).map((row) => row?.id));
|
|
197
|
+
}
|
|
198
|
+
function claimSourceIds(claimMatrix, claimId) {
|
|
199
|
+
const claim = (Array.isArray(claimMatrix?.claims) ? claimMatrix.claims : []).find((row) => String(row?.id || '') === claimId);
|
|
200
|
+
return normalizeStringList([...(Array.isArray(claim?.source_ids) ? claim.source_ids : []), ...(Array.isArray(claim?.counterevidence_ids) ? claim.counterevidence_ids : [])]);
|
|
201
|
+
}
|
|
202
|
+
function sourceCitationCount(text) {
|
|
203
|
+
return [...String(text || '').matchAll(/\b(?:source|src|mock-source|shard-[A-Za-z0-9_-]+|counter|mock-counter)-[A-Za-z0-9_.:-]+\b/g)].length;
|
|
204
|
+
}
|
|
205
|
+
function normalizeStringList(value) {
|
|
206
|
+
return [...new Set((Array.isArray(value) ? value : value == null ? [] : [value]).flat().map((item) => String(item || '').trim()).filter(Boolean))];
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=research-synthesis-writer.js.map
|
package/dist/core/research.js
CHANGED
|
@@ -16,6 +16,7 @@ import { validateFalsificationCoverage } from './research/falsification.js';
|
|
|
16
16
|
import { writeResearchHandoffArtifacts } from './research/research-handoff.js';
|
|
17
17
|
import { RESEARCH_WORK_GRAPH_ARTIFACT, writeResearchWorkGraph } from './research/research-work-graph.js';
|
|
18
18
|
import { researchPromptContractText, validateResearchPromptContract } from './research/research-prompt-contract.js';
|
|
19
|
+
import { buildRealisticResearchPaper, buildRealisticResearchReport } from './research/research-realistic-report.js';
|
|
19
20
|
export const RESEARCH_PAPER_ARTIFACT = 'research-paper.md';
|
|
20
21
|
export const RESEARCH_SOURCE_SKILL_ARTIFACT = 'research-source-skill.md';
|
|
21
22
|
export const RESEARCH_GENIUS_SUMMARY_ARTIFACT = 'genius-opinion-summary.md';
|
|
@@ -904,6 +905,7 @@ export async function evaluateResearchGate(dir) {
|
|
|
904
905
|
const reportPresent = await exists(path.join(dir, 'research-report.md'));
|
|
905
906
|
const reportText = reportPresent ? await readText(path.join(dir, 'research-report.md'), '') : '';
|
|
906
907
|
const reportQuality = analyzeResearchReportQuality(reportText);
|
|
908
|
+
const synthesisOutput = await readJson(path.join(dir, 'research-synthesis-output.json'), null);
|
|
907
909
|
const reportWordCount = countWords(reportText);
|
|
908
910
|
const paperArtifact = await findResearchPaperArtifact(dir, plan);
|
|
909
911
|
const paperPresent = paperArtifact.exists;
|
|
@@ -1095,6 +1097,18 @@ export async function evaluateResearchGate(dir) {
|
|
|
1095
1097
|
report_word_count: reportWordCount,
|
|
1096
1098
|
report_min_words: contract.min_report_words,
|
|
1097
1099
|
report_quality: reportQuality,
|
|
1100
|
+
report_repetition: reportQuality.repetition,
|
|
1101
|
+
source_density_per_1000_words: reportQuality.source_density_per_1000_words,
|
|
1102
|
+
claim_density_per_1000_words: reportQuality.claim_density_per_1000_words,
|
|
1103
|
+
template_phrase_hits: reportQuality.repetition?.template_phrase_hits || [],
|
|
1104
|
+
synthesis: {
|
|
1105
|
+
writer: synthesisOutput ? (sourceLedger?.mode === 'selftest_mock' ? 'mock' : 'codex-sdk evidence-bound writer') : 'missing',
|
|
1106
|
+
repetition_ratio: reportQuality.repetition?.repeated_paragraph_ratio ?? null,
|
|
1107
|
+
source_density_per_1000_words: reportQuality.source_density_per_1000_words,
|
|
1108
|
+
claim_density_per_1000_words: reportQuality.claim_density_per_1000_words,
|
|
1109
|
+
template_phrase_hits: reportQuality.repetition?.template_phrase_hits || [],
|
|
1110
|
+
codex_final_review_verdict: finalReview?.codex_review?.verdict || null
|
|
1111
|
+
},
|
|
1098
1112
|
web_search_passes: webSearchPasses,
|
|
1099
1113
|
paper_sections: Math.max(Number(gate.paper_sections || 0), paperSections),
|
|
1100
1114
|
genius_opinion_summary_present: geniusSummaryPresent || gate.genius_opinion_summary_present === true,
|
|
@@ -1441,56 +1455,50 @@ export async function writeMockResearchResult(dir, plan) {
|
|
|
1441
1455
|
await writeJsonAtomic(path.join(dir, 'falsification-ledger.json'), falsificationLedger);
|
|
1442
1456
|
await writeJsonAtomic(path.join(dir, 'novelty-ledger.json'), ledger);
|
|
1443
1457
|
await writeTextAtomic(path.join(dir, RESEARCH_GENIUS_SUMMARY_ARTIFACT), `${geniusSummary}\n`);
|
|
1444
|
-
const
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1458
|
+
const mockSourceIds = [...mockLayerSources.map((source) => source.id), 'mock-counter-1', 'mock-counter-2'];
|
|
1459
|
+
const mockCounterIds = ['mock-counter-1', 'mock-counter-2'];
|
|
1460
|
+
const researchReportText = buildRealisticResearchReport({
|
|
1461
|
+
plan,
|
|
1462
|
+
claims: claimMatrix.claims,
|
|
1463
|
+
sourceIds: mockSourceIds,
|
|
1464
|
+
counterevidenceIds: mockCounterIds,
|
|
1465
|
+
blueprint,
|
|
1466
|
+
falsificationLedger,
|
|
1467
|
+
experimentPlan,
|
|
1468
|
+
replicationPack
|
|
1469
|
+
});
|
|
1470
|
+
const researchPaperText = buildRealisticResearchPaper({
|
|
1471
|
+
plan,
|
|
1472
|
+
claims: claimMatrix.claims,
|
|
1473
|
+
sourceIds: mockSourceIds,
|
|
1474
|
+
counterevidenceIds: mockCounterIds
|
|
1475
|
+
});
|
|
1476
|
+
const reportQuality = analyzeResearchReportQuality(researchReportText);
|
|
1477
|
+
await writeJsonAtomic(path.join(dir, 'research-synthesis-output.json'), {
|
|
1478
|
+
schema: 'sks.research-synthesis-output.v1',
|
|
1479
|
+
mission_id: plan?.mission_id || '',
|
|
1480
|
+
generated_at: nowIso(),
|
|
1481
|
+
report_markdown: researchReportText,
|
|
1482
|
+
paper_markdown: researchPaperText,
|
|
1483
|
+
synthesis_summary: {
|
|
1484
|
+
key_claim_ids: claimMatrix.key_claim_ids,
|
|
1485
|
+
source_ids_used: mockSourceIds,
|
|
1486
|
+
counterevidence_ids_used: mockCounterIds,
|
|
1487
|
+
blueprint_sections_used: blueprint.sections.map((section) => section.id),
|
|
1488
|
+
experiment_steps_used: experimentPlan.steps.map((step) => step.id)
|
|
1489
|
+
},
|
|
1490
|
+
quality_signals: {
|
|
1491
|
+
report_word_count: reportQuality.word_count,
|
|
1492
|
+
source_citation_count: reportQuality.source_id_mentions.length,
|
|
1493
|
+
unique_source_ids_cited: mockSourceIds.filter((id) => researchReportText.includes(id)).length,
|
|
1494
|
+
key_claims_covered: claimMatrix.key_claim_ids.filter((id) => researchReportText.includes(id)).length,
|
|
1495
|
+
repeated_paragraph_ratio: reportQuality.repetition.repeated_paragraph_ratio,
|
|
1496
|
+
template_phrase_hits: reportQuality.repetition.template_phrase_hits
|
|
1497
|
+
},
|
|
1498
|
+
blockers: reportQuality.blockers
|
|
1450
1499
|
});
|
|
1451
|
-
const researchReportText = [
|
|
1452
|
-
'# SKS Research Report',
|
|
1453
|
-
'',
|
|
1454
|
-
`Prompt: ${plan.prompt}`,
|
|
1455
|
-
'',
|
|
1456
|
-
'## Question',
|
|
1457
|
-
'Can SKS Research Mode close a research mission only when it has enough sourced claims, counterevidence, falsification, implementation handoff material, and replication evidence to support a downstream execution route?',
|
|
1458
|
-
'',
|
|
1459
|
-
'## Methodology',
|
|
1460
|
-
'This mock run is a selftest fixture, so it does not claim live web retrieval. It exercises the same artifact contract that real research must satisfy: layered source ledger entries, source quality fields, claim-evidence matrix rows, falsification cases, a blueprint, an experiment plan, a replication pack, and a final reviewer decision.',
|
|
1461
|
-
'',
|
|
1462
|
-
'## Source Map',
|
|
1463
|
-
'The source ledger contains two mock sources per source layer plus two counterevidence records. The source ids include mock-source-1 through mock-source-14, and the counterevidence ids include mock-counter-1 and mock-counter-2. Each source row includes layer, kind, locator, publisher_or_author, accessed_at, reliability, credibility, stance, and claim_ids.',
|
|
1464
|
-
'',
|
|
1465
|
-
'## Key Claims',
|
|
1466
|
-
...ledger.entries.map((entry) => `- ${entry.id}: ${entry.claim} Sources: ${(entry.source_ids || []).join(', ')}. Counterevidence: ${(entry.counterevidence_ids || entry.falsifiers || []).join(', ')}.`),
|
|
1467
|
-
'',
|
|
1468
|
-
'## Evidence Matrix Summary',
|
|
1469
|
-
`The claim-evidence matrix records ${claimMatrix.key_claim_ids.length} key claims and ${claimMatrix.triangulated_claim_count} triangulated claims. Each critical or high-importance claim has at least one source id and one counterevidence id, and each hypothesis has a test_or_probe field for follow-up validation.`,
|
|
1470
|
-
'',
|
|
1471
|
-
'## Counterevidence',
|
|
1472
|
-
'The first counterexample, mock-counter-1, attacks overclaiming without decisive tests. The second counterexample, mock-counter-2, attacks missing replication and thin experiment plans. Both are intentionally simple but give the gate two independent counterevidence entries to verify.',
|
|
1473
|
-
'',
|
|
1474
|
-
'## Falsification',
|
|
1475
|
-
'The falsification ledger includes four cases. They attack summary-only output, missing independent confirmation, absent counterevidence, and absent replication. The cases survive only as gate-backed requirements, not as proof that the mock topic was researched on the live web.',
|
|
1476
|
-
'',
|
|
1477
|
-
'## Implementation Blueprint',
|
|
1478
|
-
'The implementation blueprint has eight sections: problem, decision, architecture, interfaces, data contracts, execution plan, verification plan, and risks and rollbacks. The key point is that Research does not change repository source. It creates a handoff for a later $Team route that can validate the research and then decide what to implement.',
|
|
1479
|
-
'',
|
|
1480
|
-
'## Experiment / Validation Plan',
|
|
1481
|
-
'The experiment plan contains five steps: compare a baseline and research output, score cited key claims, run the smallest implementation probe, compare falsification outcomes, and record replication commands. The replication pack lists the commands and expected artifacts needed to reproduce the gate.',
|
|
1482
|
-
'',
|
|
1483
|
-
'## Limitations',
|
|
1484
|
-
'This is mock evidence for harness verification. It proves the local artifact contract and gate behavior, not live research accuracy. A normal non-mock run must still collect real sources and must keep the gate blocked if source access is unavailable.',
|
|
1485
|
-
'',
|
|
1486
|
-
'## References',
|
|
1487
|
-
'- mock-source-1 through mock-source-14: layered mock sources generated by writeMockResearchResult.',
|
|
1488
|
-
'- mock-counter-1 and mock-counter-2: counterevidence fixtures generated by writeMockResearchResult.',
|
|
1489
|
-
'',
|
|
1490
|
-
...evidenceParagraphs
|
|
1491
|
-
].join('\n\n');
|
|
1492
1500
|
await writeTextAtomic(path.join(dir, 'research-report.md'), `${researchReportText}\n`);
|
|
1493
|
-
await writeTextAtomic(path.join(dir, paperArtifact),
|
|
1501
|
+
await writeTextAtomic(path.join(dir, paperArtifact), `${researchPaperText}\n`);
|
|
1494
1502
|
await writeJsonAtomic(path.join(dir, 'research-gate.json'), {
|
|
1495
1503
|
...defaultResearchGate(),
|
|
1496
1504
|
passed: true,
|
|
@@ -1536,6 +1544,10 @@ export async function writeMockResearchResult(dir, plan) {
|
|
|
1536
1544
|
missing_evidence: [],
|
|
1537
1545
|
blueprint_findings: ['mock complete package fixture has implementation blueprint sections'],
|
|
1538
1546
|
falsification_findings: ['mock complete package fixture has counterevidence and falsification cases'],
|
|
1547
|
+
template_like_prose: false,
|
|
1548
|
+
source_density_ok: true,
|
|
1549
|
+
implementation_concreteness_ok: true,
|
|
1550
|
+
evidence_bound_synthesis_ok: true,
|
|
1539
1551
|
required_revisions: [],
|
|
1540
1552
|
confidence: 'high',
|
|
1541
1553
|
mock: true
|
package/dist/core/routes.js
CHANGED
|
@@ -355,11 +355,15 @@ export const ROUTES = [
|
|
|
355
355
|
id: 'Team',
|
|
356
356
|
command: '$Team',
|
|
357
357
|
mode: 'TEAM',
|
|
358
|
-
route: '
|
|
359
|
-
description: '
|
|
358
|
+
route: 'deprecated alias to Naruto',
|
|
359
|
+
description: 'Deprecated compatibility alias. New substantial work is routed to $Naruto, the native shadow-clone swarm SSOT.',
|
|
360
360
|
requiredSkills: ['team', 'pipeline-runner', 'context7-docs', 'prompt-pipeline', REFLECTION_SKILL_NAME, 'honest-mode'],
|
|
361
361
|
dollarAliases: ['$From-Chat-IMG'],
|
|
362
362
|
appSkillAliases: ['from-chat-img'],
|
|
363
|
+
deprecated: true,
|
|
364
|
+
hidden: true,
|
|
365
|
+
aliasTo: '$Naruto',
|
|
366
|
+
deprecationMessage: '$Team is deprecated and redirects new execution missions to $Naruto. Existing Team observation commands remain available for old missions.',
|
|
363
367
|
lifecycle: ['native_agent_intake', 'triwiki_refresh', 'planning_debate', 'live_transcript', 'consensus_artifact', 'fresh_implementation_team', 'review_artifact', 'integration_evidence', 'session_cleanup', 'post_route_reflection', 'honest_mode'],
|
|
364
368
|
context7Policy: 'optional',
|
|
365
369
|
reasoningPolicy: 'high',
|
|
@@ -373,13 +377,13 @@ export const ROUTES = [
|
|
|
373
377
|
mode: 'NARUTO',
|
|
374
378
|
route: 'hardware-safe massive parallel work swarm',
|
|
375
379
|
description: '$Naruto mode launches a hardware-safe massive parallel work swarm. Clones may implement, modify, verify, test, research, document, and resolve conflicts according to role and lease policy; write-capable output is accepted only through patch envelopes, verification DAG, mutation guard, and GPT final arbiter.',
|
|
376
|
-
requiredSkills: ['
|
|
380
|
+
requiredSkills: ['naruto', 'pipeline-runner', 'prompt-pipeline', 'honest-mode'],
|
|
377
381
|
dollarAliases: ['$ShadowClone', '$Kagebunshin'],
|
|
378
382
|
appSkillAliases: ['shadow-clone', 'kage-bunshin'],
|
|
379
383
|
lifecycle: ['clone_roster_build', 'massive_work_graph', 'hardware_safe_governor', 'dynamic_active_pool', 'lease_based_write_swarm', 'parallel_verification_dag', 'gpt_final_arbiter_pack', 'per_clone_proof', 'session_cleanup', 'honest_mode'],
|
|
380
384
|
context7Policy: 'optional',
|
|
381
385
|
reasoningPolicy: 'high',
|
|
382
|
-
stopGate: '
|
|
386
|
+
stopGate: 'naruto-gate.json',
|
|
383
387
|
cliEntrypoint: 'sks naruto run "task" [--clones N] [--backend codex-sdk|fake|ollama] [--parallel-write] | sks naruto status',
|
|
384
388
|
examples: ['$Naruto run sweep the codebase for TODO comments with 50 clones', '$ShadowClone --clones 100 fan out and draft tests for every module']
|
|
385
389
|
},
|
|
@@ -598,7 +602,7 @@ export const ROUTES = [
|
|
|
598
602
|
examples: ['$Help show available SKS commands']
|
|
599
603
|
}
|
|
600
604
|
];
|
|
601
|
-
export const DOLLAR_COMMANDS = ROUTES.flatMap(({ command, route, description, dollarAliases = [] }) => [
|
|
605
|
+
export const DOLLAR_COMMANDS = ROUTES.filter((route) => route.hidden !== true).flatMap(({ command, route, description, dollarAliases = [] }) => [
|
|
602
606
|
{ command, route, description },
|
|
603
607
|
...dollarAliases.map((alias) => ({ command: alias, route, description }))
|
|
604
608
|
]);
|
|
@@ -632,11 +636,11 @@ export const COMMAND_CATALOG = [
|
|
|
632
636
|
{ name: 'auth', usage: 'sks auth status|health|repair|setup --host <domain> --api-key <key>', description: 'Shortcut for codex-lb provider auth status, health, repair, and setup commands.' },
|
|
633
637
|
{ name: 'openclaw', usage: 'sks openclaw install|path|print [--dir path] [--force] [--json]', description: 'Generate an OpenClaw skill package so OpenClaw agents can discover and use local SKS workflows.' },
|
|
634
638
|
{ name: 'hermes', usage: 'sks hermes install|status|path|print [--dir path] [--force] [--json]', description: 'Generate a Hermes Agent skill package so Hermes agents can discover and use local SKS workflows.' },
|
|
635
|
-
{ name: 'zellij', usage: 'sks zellij status|repair [--json] | sks
|
|
639
|
+
{ name: 'zellij', usage: 'sks zellij status|repair [--json] | sks naruto dashboard latest | sks --mad', description: 'Inspect Zellij runtime status, explain repair (no auto-install), and open the SKS Zellij runtime used by MAD and Naruto lane UI.' },
|
|
636
640
|
{ name: 'tmux', usage: 'sks tmux [--json]', description: 'Show the removed-runtime migration notice and point operators to Zellij.' },
|
|
637
641
|
{ name: 'mad', usage: 'sks --mad [--high]', description: 'Open a one-shot Zellij Codex CLI workspace with the SKS MAD full-access auto-review profile.' },
|
|
638
642
|
{ name: 'auto-review', usage: 'sks auto-review status|enable|start [--high] | sks --Auto-review --high', description: 'Enable Codex automatic approval review and launch SKS Zellij with the auto-review profile.' },
|
|
639
|
-
{ name: 'dollar-commands', usage: 'sks dollar-commands [--json]', description: 'List Codex App $ commands such as $DFix and $
|
|
643
|
+
{ name: 'dollar-commands', usage: 'sks dollar-commands [--json]', description: 'List Codex App $ commands such as $DFix and $Naruto.' },
|
|
640
644
|
{ name: 'fast-mode', usage: 'sks fast-mode on|off|status|clear [--json]', description: 'Toggle the project-local Fast mode default used by $Fast-On, $Fast-Off, and native-agent routes.' },
|
|
641
645
|
{ name: 'with-local-llm', usage: 'sks with-local-llm on|off|status|set-model [--json]', description: 'Toggle the optional local Ollama worker backend used by $with-local-llm-on/$with-local-llm-off and eligible simple worker slices.' },
|
|
642
646
|
{ name: 'commit', usage: 'sks commit [--message "msg"] [--json]', description: 'Stage current changes, summarize them, and create a simple git commit without the full SKS pipeline.' },
|
|
@@ -681,7 +685,7 @@ export const COMMAND_CATALOG = [
|
|
|
681
685
|
{ name: 'wiki', usage: 'sks wiki coords|pack|refresh|publish|rebuild-index|validate|validate-shared|wrongness ...', description: 'Build, refresh, publish shared shards, rebuild ignored indexes, validate, and attach wrongness-memory context to RGBA/trig LLM Wiki packs with attention.use_first and attention.hydrate_first for compact recall plus source hydration.' },
|
|
682
686
|
{ name: 'hproof', usage: 'sks hproof check [mission-id|latest]', description: 'Evaluate the H-Proof done gate for a mission.' },
|
|
683
687
|
{ name: 'agent', usage: 'sks agent run|status|close|cleanup <mission-id|latest> [--agents N] [--work-items N] [--target-active-slots N] [--mock] [--apply|--dry-run] [--drain] [--stale-ms N] [--json] | sks agent rollback-patches [mission-id|latest] [--patch-entry-id id] [--dry-run|--apply] [--json]', description: 'Run, inspect, close, clean, or rollback native multi-session agent missions with agents as target active slots, work items as the route queue size, cleanup executor proof for stale runtime resources, and patch rollback proof for applied patch entries.' },
|
|
684
|
-
{ name: 'team', usage: 'sks team "task"
|
|
688
|
+
{ name: 'team', usage: 'sks team \"task\" | sks team log|tail|watch|lane|status|dashboard|event|message|open-zellij|attach-zellij|cleanup-zellij ...', description: 'Deprecated compatibility command: new tasks redirect to Naruto; observation subcommands remain for old Team missions.' },
|
|
685
689
|
{ name: 'reasoning', usage: 'sks reasoning ["prompt"] [--json]', description: 'Show SKS temporary reasoning-effort routing: medium for simple tasks, high for logic, xhigh for research.' },
|
|
686
690
|
{ name: 'gx', usage: 'sks gx init|render|validate|drift|snapshot [name]', description: 'Create and verify deterministic SVG/HTML visual context cartridges.' },
|
|
687
691
|
{ name: 'profile', usage: 'sks profile show|set <model>', description: 'Inspect or set the current SKS model profile metadata.' },
|
|
@@ -819,14 +823,14 @@ export function routePrompt(prompt) {
|
|
|
819
823
|
if (looksLikeAnswerOnlyRequest(afterModifier))
|
|
820
824
|
return routeById('Answer');
|
|
821
825
|
if (looksLikeCodeChangingWork(afterModifier) || looksLikeDirectWorkRequest(afterModifier))
|
|
822
|
-
return routeById('
|
|
826
|
+
return routeById('Naruto');
|
|
823
827
|
return routeById('MadSKS');
|
|
824
828
|
}
|
|
825
829
|
const route = routeByDollarCommand(command) || routeById('SKS');
|
|
826
830
|
if (route?.id === 'SKS' && looksLikeTeamDefaultWork(stripDollarCommand(text)))
|
|
827
|
-
return routeById('
|
|
828
|
-
if (route?.id === 'Team')
|
|
829
|
-
return
|
|
831
|
+
return routeById('Naruto');
|
|
832
|
+
if (route?.id === 'Team' && command === 'TEAM')
|
|
833
|
+
return routeById('Naruto');
|
|
830
834
|
return route;
|
|
831
835
|
}
|
|
832
836
|
if (hasFromChatImgSignal(text))
|
|
@@ -843,13 +847,13 @@ export function routePrompt(prompt) {
|
|
|
843
847
|
if (looksLikeTinyDirectFix(text))
|
|
844
848
|
return routeById('DFix');
|
|
845
849
|
if (looksLikeQuestionShapedDirective(text))
|
|
846
|
-
return routeById('
|
|
850
|
+
return routeById('Naruto');
|
|
847
851
|
if (looksLikeAnswerOnlyRequest(text))
|
|
848
852
|
return routeById('Answer');
|
|
849
853
|
if (/\b(SQL|Supabase|Postgres|migration|RLS|Prisma|Drizzle|Knex|database|DB|execute_sql)\b/i.test(text))
|
|
850
854
|
return routeById('DB');
|
|
851
855
|
if (/\b(team|multi-agent|subagent|parallel agents|agent team)\b|병렬|팀/i.test(text))
|
|
852
|
-
return routeById('
|
|
856
|
+
return routeById('Naruto');
|
|
853
857
|
if (looksLikeChatCaptureRequest(text) && !looksLikeAnswerOnlyRequest(text))
|
|
854
858
|
return routeById('Team');
|
|
855
859
|
if (/\b(qa[-\s]?loop|qaloop|e2e\s+qa|qa\s+e2e)\b/i.test(text))
|
|
@@ -863,7 +867,7 @@ export function routePrompt(prompt) {
|
|
|
863
867
|
if (/\b(GX|vgraph|visual context|render cartridge|wiki coordinate|rgba|trig|llm wiki)\b/i.test(text))
|
|
864
868
|
return routeById('GX');
|
|
865
869
|
if (looksLikeTeamDefaultWork(text))
|
|
866
|
-
return routeById('
|
|
870
|
+
return routeById('Naruto');
|
|
867
871
|
return routeById('SKS');
|
|
868
872
|
}
|
|
869
873
|
export function looksLikeComputerUseFastLane(prompt = '') {
|
|
@@ -941,7 +945,7 @@ export function routeNeedsContext7(route, prompt = '') {
|
|
|
941
945
|
export function routeRequiresSubagents(route, prompt = '') {
|
|
942
946
|
if (!route)
|
|
943
947
|
return false;
|
|
944
|
-
if (route.id === 'Team')
|
|
948
|
+
if (route.id === 'Team' || route.id === 'Naruto')
|
|
945
949
|
return true;
|
|
946
950
|
if (route.id === 'SKS')
|
|
947
951
|
return looksLikeTeamDefaultWork(prompt);
|
|
@@ -983,7 +987,7 @@ export function simpleGitOnlyRouteId(prompt = '') {
|
|
|
983
987
|
}
|
|
984
988
|
export function reflectionRequiredForRoute(route) {
|
|
985
989
|
const id = String(route?.id || route?.mode || route?.route || route || '').replace(/^\$/, '');
|
|
986
|
-
return /^(team|qaloop|qa-loop|ppt|imageuxreview|image-ux-review|research|autoresearch|db|database|madsks|mad-sks|gx)$/i.test(id);
|
|
990
|
+
return /^(team|naruto|shadowclone|shadow-clone|kagebunshin|kage-bunshin|qaloop|qa-loop|ppt|imageuxreview|image-ux-review|research|autoresearch|db|database|madsks|mad-sks|gx)$/i.test(id);
|
|
987
991
|
}
|
|
988
992
|
export function looksLikeCodeChangingWork(prompt = '') {
|
|
989
993
|
const text = String(prompt || '');
|
|
@@ -1012,7 +1016,7 @@ export function subagentExecutionPolicyText(route, prompt = '') {
|
|
|
1012
1016
|
}
|
|
1013
1017
|
return [
|
|
1014
1018
|
'Native multi-session policy: REQUIRED for code-changing or execution work in this route.',
|
|
1015
|
-
'The selected SKS route itself authorizes route-owned worker/reviewer native sessions; the user does not need to separately ask for helper sessions when the default
|
|
1019
|
+
'The selected SKS route itself authorizes route-owned worker/reviewer native sessions; the user does not need to separately ask for helper sessions when the default Naruto pipeline is active.',
|
|
1016
1020
|
'Before editing, the parent orchestrator must visibly state the SKS route, split independent write scopes, and run worker/reviewer native sessions whenever the route can be split safely.',
|
|
1017
1021
|
'Run workers in parallel only with disjoint ownership. The parent owns integration, verification, and final evidence.',
|
|
1018
1022
|
'If native sessions are unavailable or the work cannot be safely split, record explicit unavailable/unsplittable native-session evidence before editing.',
|
|
@@ -1027,7 +1031,7 @@ export function routeReasoning(route, prompt = '') {
|
|
|
1027
1031
|
return reasoning('xhigh', 'from_chat_img_image_work_order_analysis');
|
|
1028
1032
|
if (/(?:^|\s)sks\s+--mad\b|(?:^|\s)--mad\b|\$MAD-SKS\b|\bmad-sks\b|\bmadsks\b/i.test(text))
|
|
1029
1033
|
return reasoning('xhigh', 'mad_sks_or_mad_launch_default');
|
|
1030
|
-
if (route?.id === 'Team')
|
|
1034
|
+
if (route?.id === 'Team' || route?.id === 'Naruto')
|
|
1031
1035
|
return teamRouteReasoning(text);
|
|
1032
1036
|
if (route?.id === 'Research' || route?.id === 'AutoResearch')
|
|
1033
1037
|
return reasoning('xhigh', 'research_or_experiment_route');
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import https from 'node:https';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { ensureDir, nowIso, readJson, writeJsonAtomic } from '../fsx.js';
|
|
5
|
+
export const SKS_UPDATE_NOTICE_SCHEMA = 'sks.update-notice.v1';
|
|
6
|
+
export async function checkSksUpdateNotice(input = {}) {
|
|
7
|
+
const env = input.env || process.env;
|
|
8
|
+
const packageName = input.packageName || env.SKS_UPDATE_NOTICE_PACKAGE || 'sneakoscope';
|
|
9
|
+
const currentVersion = input.currentVersion || env.SKS_PACKAGE_VERSION || '0.0.0';
|
|
10
|
+
const ttlMs = normalizePositiveInt(env.SKS_UPDATE_NOTICE_TTL_MS, 6 * 60 * 60 * 1000);
|
|
11
|
+
const cachePath = path.join(os.homedir(), '.sneakoscope', 'cache', 'update-notice.json');
|
|
12
|
+
if (env.SKS_DISABLE_UPDATE_NOTICE === '1' || env.SKS_UPDATE_NOTICE_DISABLE === '1' || env.SKS_UPDATE_NOTICE === '0') {
|
|
13
|
+
return persistNotice(input.missionDir, {
|
|
14
|
+
schema: SKS_UPDATE_NOTICE_SCHEMA,
|
|
15
|
+
checked_at: nowIso(),
|
|
16
|
+
package_name: packageName,
|
|
17
|
+
current_version: currentVersion,
|
|
18
|
+
latest_version: null,
|
|
19
|
+
update_available: false,
|
|
20
|
+
source: 'disabled',
|
|
21
|
+
cache_ttl_ms: ttlMs,
|
|
22
|
+
message: 'SKS update notice disabled by environment.'
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const cached = await readJson(cachePath, null);
|
|
26
|
+
if (cached?.schema === SKS_UPDATE_NOTICE_SCHEMA && Date.now() - Date.parse(cached.checked_at || '') < ttlMs) {
|
|
27
|
+
return persistNotice(input.missionDir, { ...cached, source: 'cache', cache_ttl_ms: ttlMs });
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const latest = await npmLatest(packageName, input.timeoutMs || normalizePositiveInt(env.SKS_UPDATE_NOTICE_TIMEOUT_MS, 1500));
|
|
31
|
+
const updateAvailable = compareVersions(latest, currentVersion) > 0;
|
|
32
|
+
const notice = {
|
|
33
|
+
schema: SKS_UPDATE_NOTICE_SCHEMA,
|
|
34
|
+
checked_at: nowIso(),
|
|
35
|
+
package_name: packageName,
|
|
36
|
+
current_version: currentVersion,
|
|
37
|
+
latest_version: latest,
|
|
38
|
+
update_available: updateAvailable,
|
|
39
|
+
source: 'npm-registry',
|
|
40
|
+
cache_ttl_ms: ttlMs,
|
|
41
|
+
message: updateAvailable
|
|
42
|
+
? `SKS ${latest} is available; current ${currentVersion}. This notice is informational and does not block launch or release gates.`
|
|
43
|
+
: `SKS ${currentVersion} is current enough; update notice is informational.`
|
|
44
|
+
};
|
|
45
|
+
await ensureDir(path.dirname(cachePath));
|
|
46
|
+
await writeJsonAtomic(cachePath, notice).catch(() => undefined);
|
|
47
|
+
return persistNotice(input.missionDir, notice);
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
const notice = {
|
|
51
|
+
schema: SKS_UPDATE_NOTICE_SCHEMA,
|
|
52
|
+
checked_at: nowIso(),
|
|
53
|
+
package_name: packageName,
|
|
54
|
+
current_version: currentVersion,
|
|
55
|
+
latest_version: cached?.latest_version || null,
|
|
56
|
+
update_available: false,
|
|
57
|
+
source: 'error',
|
|
58
|
+
cache_ttl_ms: ttlMs,
|
|
59
|
+
message: 'SKS update notice could not reach npm; launch continues without blocking.',
|
|
60
|
+
error: err?.message || String(err)
|
|
61
|
+
};
|
|
62
|
+
return persistNotice(input.missionDir, notice);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async function persistNotice(missionDir, notice) {
|
|
66
|
+
if (missionDir)
|
|
67
|
+
await writeJsonAtomic(path.join(missionDir, 'update-notice.json'), notice).catch(() => undefined);
|
|
68
|
+
return notice;
|
|
69
|
+
}
|
|
70
|
+
function npmLatest(packageName, timeoutMs) {
|
|
71
|
+
return new Promise((resolve, reject) => {
|
|
72
|
+
const req = https.request({
|
|
73
|
+
hostname: 'registry.npmjs.org',
|
|
74
|
+
path: `/${encodeURIComponent(packageName).replace(/^%40/, '@')}/latest`,
|
|
75
|
+
method: 'GET',
|
|
76
|
+
timeout: timeoutMs,
|
|
77
|
+
headers: { Accept: 'application/json' }
|
|
78
|
+
}, (res) => {
|
|
79
|
+
let body = '';
|
|
80
|
+
res.setEncoding('utf8');
|
|
81
|
+
res.on('data', (chunk) => { body += chunk; });
|
|
82
|
+
res.on('end', () => {
|
|
83
|
+
try {
|
|
84
|
+
if ((res.statusCode || 0) < 200 || (res.statusCode || 0) >= 300)
|
|
85
|
+
throw new Error(`npm_status_${res.statusCode}`);
|
|
86
|
+
const parsed = JSON.parse(body);
|
|
87
|
+
if (!parsed?.version)
|
|
88
|
+
throw new Error('npm_latest_version_missing');
|
|
89
|
+
resolve(String(parsed.version));
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
reject(err);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
req.on('timeout', () => {
|
|
97
|
+
req.destroy(new Error('update_notice_timeout'));
|
|
98
|
+
});
|
|
99
|
+
req.on('error', reject);
|
|
100
|
+
req.end();
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function compareVersions(left, right) {
|
|
104
|
+
const a = parseVersion(left);
|
|
105
|
+
const b = parseVersion(right);
|
|
106
|
+
for (let i = 0; i < Math.max(a.length, b.length); i += 1) {
|
|
107
|
+
const delta = (a[i] || 0) - (b[i] || 0);
|
|
108
|
+
if (delta !== 0)
|
|
109
|
+
return delta;
|
|
110
|
+
}
|
|
111
|
+
return 0;
|
|
112
|
+
}
|
|
113
|
+
function parseVersion(value) {
|
|
114
|
+
return String(value || '').split(/[.-]/).map((part) => Number(part)).map((part) => Number.isFinite(part) ? part : 0);
|
|
115
|
+
}
|
|
116
|
+
function normalizePositiveInt(value, fallback) {
|
|
117
|
+
const parsed = Number(value);
|
|
118
|
+
return Number.isFinite(parsed) && parsed > 0 ? Math.floor(parsed) : fallback;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=update-notice.js.map
|
package/dist/core/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const PACKAGE_VERSION = '2.0.
|
|
1
|
+
export const PACKAGE_VERSION = '2.0.16';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|