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
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
const ALWAYS_KEEP = new Set([
|
|
3
|
+
'release:version-truth',
|
|
4
|
+
'release:dag-full-coverage',
|
|
5
|
+
'runtime:ts-source-of-truth',
|
|
6
|
+
'typecheck',
|
|
7
|
+
'schema:check'
|
|
8
|
+
]);
|
|
9
|
+
export function selectAffectedReleaseGates(root, manifest, gates, input = {}) {
|
|
10
|
+
if (input.full) {
|
|
11
|
+
return selectionResult(gates, gates, [], 'full', {}, []);
|
|
12
|
+
}
|
|
13
|
+
const changedFiles = resolveChangedFiles(root, input.changedSince || 'auto');
|
|
14
|
+
const selected = [];
|
|
15
|
+
const reasons = {};
|
|
16
|
+
for (const gate of gates) {
|
|
17
|
+
const reason = gateSelectionReason(gate, changedFiles, input.preset || 'affected');
|
|
18
|
+
if (reason) {
|
|
19
|
+
selected.push(gate);
|
|
20
|
+
reasons[gate.id] = reason;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const byId = new Map(gates.map((gate) => [gate.id, gate]));
|
|
24
|
+
for (const id of ALWAYS_KEEP) {
|
|
25
|
+
const gate = byId.get(id) || manifest.gates.find((candidate) => candidate.id === id);
|
|
26
|
+
if (gate && !selected.some((row) => row.id === gate.id)) {
|
|
27
|
+
selected.push(gate);
|
|
28
|
+
reasons[gate.id] = 'always_keep_core_release_safety';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const expanded = expandWithDependencies(selected, manifest);
|
|
32
|
+
const ordered = manifest.gates.filter((gate) => expanded.some((row) => row.id === gate.id));
|
|
33
|
+
return selectionResult(gates, ordered, changedFiles, 'affected', reasons, gates.filter((gate) => !ordered.some((row) => row.id === gate.id)).map((gate) => gate.id));
|
|
34
|
+
}
|
|
35
|
+
function expandWithDependencies(selected, manifest) {
|
|
36
|
+
const byId = new Map(manifest.gates.map((gate) => [gate.id, gate]));
|
|
37
|
+
const out = new Map(selected.map((gate) => [gate.id, gate]));
|
|
38
|
+
const visit = (gate) => {
|
|
39
|
+
for (const dep of gate.deps || []) {
|
|
40
|
+
const depGate = byId.get(dep);
|
|
41
|
+
if (depGate && !out.has(depGate.id)) {
|
|
42
|
+
out.set(depGate.id, depGate);
|
|
43
|
+
visit(depGate);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
for (const gate of selected)
|
|
48
|
+
visit(gate);
|
|
49
|
+
return [...out.values()];
|
|
50
|
+
}
|
|
51
|
+
function gateSelectionReason(gate, changedFiles, preset) {
|
|
52
|
+
if (ALWAYS_KEEP.has(gate.id))
|
|
53
|
+
return 'always_keep_core_release_safety';
|
|
54
|
+
if (!changedFiles.length)
|
|
55
|
+
return preset === 'fast' ? 'fast_no_diff_core_only_skip' : 'no_changed_files';
|
|
56
|
+
if (changedFiles.some((file) => file === 'package.json' || file === 'package-lock.json')) {
|
|
57
|
+
if (/^(release:|publish:|prepublish|runtime:|typecheck|schema:check)/.test(gate.id))
|
|
58
|
+
return 'package_metadata_changed';
|
|
59
|
+
}
|
|
60
|
+
if (changedFiles.some((file) => file === 'release-gates.v2.json' || file.startsWith('src/core/release/') || file.startsWith('src/scripts/release-')))
|
|
61
|
+
return 'release_gate_system_changed';
|
|
62
|
+
if (changedFiles.some((file) => file.startsWith('src/core/research/')))
|
|
63
|
+
return gate.id.startsWith('research:') ? 'research_source_changed' : null;
|
|
64
|
+
if (changedFiles.some((file) => file.startsWith('src/core/zellij/') || file.startsWith('src/commands/zellij')))
|
|
65
|
+
return gate.id.startsWith('zellij:') || gate.id.startsWith('agent:zellij') || gate.id.startsWith('naruto:zellij') ? 'zellij_source_changed' : null;
|
|
66
|
+
if (changedFiles.some((file) => file.includes('/db') || file.includes('mad-db') || file.includes('mcp')))
|
|
67
|
+
return /db|mcp|mad-db|mad-sks/.test(gate.id) ? 'db_mcp_or_mad_db_changed' : null;
|
|
68
|
+
const inputs = gate.cache?.inputs || [];
|
|
69
|
+
if (inputs.some((pattern) => changedFiles.some((file) => matchesGlobish(file, pattern))))
|
|
70
|
+
return 'cache_input_changed';
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
function selectionResult(all, selected, changedFiles, mode, reasons, skipped) {
|
|
74
|
+
return {
|
|
75
|
+
gates: selected,
|
|
76
|
+
selection: {
|
|
77
|
+
schema: 'sks.release-gate-affected-selection.v1',
|
|
78
|
+
mode,
|
|
79
|
+
changed_files: changedFiles,
|
|
80
|
+
selected_gate_ids: selected.map((gate) => gate.id),
|
|
81
|
+
skipped_gate_ids: skipped.length ? skipped : all.filter((gate) => !selected.some((row) => row.id === gate.id)).map((gate) => gate.id),
|
|
82
|
+
reasons
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function resolveChangedFiles(root, changedSince) {
|
|
87
|
+
const base = changedSince === 'auto' ? 'HEAD' : changedSince;
|
|
88
|
+
const args = base === 'HEAD'
|
|
89
|
+
? ['diff', '--name-only', 'HEAD']
|
|
90
|
+
: ['diff', '--name-only', String(base)];
|
|
91
|
+
const diff = spawnSync('git', args, { cwd: root, encoding: 'utf8' });
|
|
92
|
+
const status = spawnSync('git', ['status', '--short'], { cwd: root, encoding: 'utf8' });
|
|
93
|
+
const files = [
|
|
94
|
+
...String(diff.stdout || '').split(/\n/),
|
|
95
|
+
...String(status.stdout || '').split(/\n/).map((line) => line.slice(3))
|
|
96
|
+
].map((file) => file.trim()).filter(Boolean);
|
|
97
|
+
return [...new Set(files)].sort();
|
|
98
|
+
}
|
|
99
|
+
function matchesGlobish(file, pattern) {
|
|
100
|
+
const normalized = pattern.replace(/\\/g, '/');
|
|
101
|
+
if (normalized === file)
|
|
102
|
+
return true;
|
|
103
|
+
if (normalized.endsWith('/**'))
|
|
104
|
+
return file.startsWith(normalized.slice(0, -3));
|
|
105
|
+
if (normalized.endsWith('/**/*'))
|
|
106
|
+
return file.startsWith(normalized.slice(0, -5));
|
|
107
|
+
if (normalized.includes('**'))
|
|
108
|
+
return file.startsWith(normalized.split('**')[0] || '');
|
|
109
|
+
if (normalized.endsWith('*'))
|
|
110
|
+
return file.startsWith(normalized.slice(0, -1));
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=release-gate-affected-selector.js.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { writeReleaseGateJson } from './release-gate-report.js';
|
|
4
|
+
const DISALLOWED_BATCH_RESOURCES = new Set(['zellij-real', 'git-worktree', 'local-llm-real', 'remote-model-real', 'publish', 'global-config']);
|
|
5
|
+
export function isReleaseGateBatchable(gate) {
|
|
6
|
+
if (gate.side_effect !== 'hermetic')
|
|
7
|
+
return false;
|
|
8
|
+
if (!gate.resource.includes('cpu-light') || !gate.resource.includes('fs-read'))
|
|
9
|
+
return false;
|
|
10
|
+
return gate.resource.every((resource) => resource === 'cpu-light' || resource === 'fs-read') && !gate.resource.some((resource) => DISALLOWED_BATCH_RESOURCES.has(resource));
|
|
11
|
+
}
|
|
12
|
+
export async function runReleaseGateBatch(root, gates, input = {}) {
|
|
13
|
+
const concurrency = Math.max(1, Math.floor(Number(input.concurrency || process.env.SKS_RELEASE_BATCH_CONCURRENCY || 4)));
|
|
14
|
+
const nonBatchable = gates.filter((gate) => !isReleaseGateBatchable(gate));
|
|
15
|
+
if (nonBatchable.length) {
|
|
16
|
+
return {
|
|
17
|
+
schema: 'sks.release-gate-batch-result.v1',
|
|
18
|
+
ok: false,
|
|
19
|
+
batch_size: gates.length,
|
|
20
|
+
completed: 0,
|
|
21
|
+
failed: nonBatchable.length,
|
|
22
|
+
results: nonBatchable.map((gate) => ({ id: gate.id, ok: false, exit_code: null, duration_ms: 0 }))
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const queue = [...gates];
|
|
26
|
+
const results = [];
|
|
27
|
+
const workers = Array.from({ length: Math.min(concurrency, queue.length) }, async () => {
|
|
28
|
+
while (queue.length) {
|
|
29
|
+
const gate = queue.shift();
|
|
30
|
+
if (!gate)
|
|
31
|
+
continue;
|
|
32
|
+
const result = await runOne(root, gate);
|
|
33
|
+
results.push(result);
|
|
34
|
+
if (input.reportRoot)
|
|
35
|
+
writeChildResult(input.reportRoot, result);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
await Promise.all(workers);
|
|
39
|
+
const failed = results.filter((row) => !row.ok).length;
|
|
40
|
+
return {
|
|
41
|
+
schema: 'sks.release-gate-batch-result.v1',
|
|
42
|
+
ok: failed === 0,
|
|
43
|
+
batch_size: gates.length,
|
|
44
|
+
completed: results.length - failed,
|
|
45
|
+
failed,
|
|
46
|
+
results
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function runOne(root, gate) {
|
|
50
|
+
const started = Date.now();
|
|
51
|
+
return new Promise((resolve) => {
|
|
52
|
+
const child = spawn(gate.command, { cwd: root, shell: true, stdio: ['ignore', 'ignore', 'ignore'] });
|
|
53
|
+
const timer = setTimeout(() => child.kill('SIGTERM'), gate.timeout_ms);
|
|
54
|
+
child.on('close', (code) => {
|
|
55
|
+
clearTimeout(timer);
|
|
56
|
+
resolve({ id: gate.id, ok: code === 0, exit_code: code, duration_ms: Date.now() - started });
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function writeChildResult(reportRoot, result) {
|
|
61
|
+
const dir = path.join(reportRoot, result.id.replace(/[^A-Za-z0-9_.:-]/g, '_'));
|
|
62
|
+
writeReleaseGateJson(path.join(dir, 'result.json'), {
|
|
63
|
+
schema: 'sks.release-gate-batch-child-result.v1',
|
|
64
|
+
...result
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=release-gate-batch-runner.js.map
|
|
@@ -7,6 +7,7 @@ import { findReadyReleaseGateNodes, findReleaseGatesBlockedByFailedDeps, pickRea
|
|
|
7
7
|
import { readReleaseGateCacheHit, writeReleaseGateCacheHit } from './release-gate-cache-v2.js';
|
|
8
8
|
import { RELEASE_GATE_NODE_SCHEMA, validateReleaseGateManifest } from './release-gate-node.js';
|
|
9
9
|
import { countReleaseGateResources, defaultReleaseGateBudget, summarizeReleaseGateBudget } from './release-gate-resource-governor.js';
|
|
10
|
+
import { selectAffectedReleaseGates } from './release-gate-affected-selector.js';
|
|
10
11
|
export function loadReleaseGateManifest(root, file = 'release-gates.v2.json') {
|
|
11
12
|
const manifestPath = path.join(root, file);
|
|
12
13
|
const parsed = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
@@ -20,7 +21,11 @@ export async function runReleaseGateDag(input) {
|
|
|
20
21
|
const root = path.resolve(input.root);
|
|
21
22
|
const preset = input.preset || 'release';
|
|
22
23
|
const manifest = loadReleaseGateManifest(root);
|
|
23
|
-
const
|
|
24
|
+
const presetGates = selectReleaseGatePreset(manifest, preset);
|
|
25
|
+
const affected = (preset === 'affected' || preset === 'fast') && input.full !== true
|
|
26
|
+
? selectAffectedReleaseGates(root, manifest, presetGates, { changedSince: input.changedSince || 'auto', preset })
|
|
27
|
+
: selectAffectedReleaseGates(root, manifest, presetGates, { full: true, preset });
|
|
28
|
+
const selected = affected.gates;
|
|
24
29
|
const runId = `rg-${new Date().toISOString().replace(/[:.]/g, '-')}-${process.pid}`;
|
|
25
30
|
const reportDir = path.join(root, '.sneakoscope', 'reports', 'release-gates', runId);
|
|
26
31
|
fs.mkdirSync(reportDir, { recursive: true });
|
|
@@ -33,6 +38,8 @@ export async function runReleaseGateDag(input) {
|
|
|
33
38
|
const budget = defaultReleaseGateBudget();
|
|
34
39
|
const peakResources = {};
|
|
35
40
|
let cached = 0;
|
|
41
|
+
const cachedGates = [];
|
|
42
|
+
const executedGates = [];
|
|
36
43
|
let sumGateMs = 0;
|
|
37
44
|
let peakRunning = 0;
|
|
38
45
|
const writeSummarySnapshot = (finished = false) => {
|
|
@@ -45,6 +52,9 @@ export async function runReleaseGateDag(input) {
|
|
|
45
52
|
selected_preset: preset,
|
|
46
53
|
total_gates: manifest.gates.length,
|
|
47
54
|
selected_gates: selected.length,
|
|
55
|
+
selected_gate_ids: selected.map((gate) => gate.id),
|
|
56
|
+
skipped_by_affected: affected.selection.mode === 'affected' ? affected.selection.skipped_gate_ids : [],
|
|
57
|
+
affected_selection: affected.selection,
|
|
48
58
|
completed: completed.size,
|
|
49
59
|
failed: failed.size,
|
|
50
60
|
cached,
|
|
@@ -55,6 +65,12 @@ export async function runReleaseGateDag(input) {
|
|
|
55
65
|
critical_path_ms: estimateCriticalPath(selected, completed),
|
|
56
66
|
peak_running: peakRunning,
|
|
57
67
|
peak_resources: peakResources,
|
|
68
|
+
cached_gates: cachedGates,
|
|
69
|
+
executed_gates: executedGates,
|
|
70
|
+
slowest_gates: [...completed.values(), ...failed.values()]
|
|
71
|
+
.sort((a, b) => b.duration_ms - a.duration_ms)
|
|
72
|
+
.slice(0, 10)
|
|
73
|
+
.map((row) => ({ id: row.id, duration_ms: row.duration_ms, cached: row.cached })),
|
|
58
74
|
budget_snapshot: budget,
|
|
59
75
|
budget_summary: summarizeReleaseGateBudget(budget),
|
|
60
76
|
report_dir: reportDir,
|
|
@@ -82,12 +98,14 @@ export async function runReleaseGateDag(input) {
|
|
|
82
98
|
const result = { id: gate.id, ok: true, exit_code: 0, duration_ms: 0, cached: true, stderr_tail: '' };
|
|
83
99
|
completed.set(gate.id, result);
|
|
84
100
|
cached += 1;
|
|
101
|
+
cachedGates.push(gate.id);
|
|
85
102
|
progressed = true;
|
|
86
103
|
appendReleaseGateJsonl(timeline, { event: 'cache_hit', gate_id: gate.id, at: new Date().toISOString() });
|
|
87
104
|
writeSummarySnapshot(false);
|
|
88
105
|
continue;
|
|
89
106
|
}
|
|
90
107
|
appendReleaseGateJsonl(timeline, { event: 'start', gate_id: gate.id, resource: gate.resource, at: new Date().toISOString() });
|
|
108
|
+
executedGates.push(gate.id);
|
|
91
109
|
running.set(gate.id, { gate, promise: runGate(root, runId, reportDir, gate) });
|
|
92
110
|
peakRunning = Math.max(peakRunning, running.size);
|
|
93
111
|
const used = countReleaseGateResources([...running.values()].map((row) => row.gate));
|
|
@@ -141,8 +159,9 @@ export async function runReleaseGateDag(input) {
|
|
|
141
159
|
const result = writeSummarySnapshot(true);
|
|
142
160
|
return result;
|
|
143
161
|
}
|
|
144
|
-
function
|
|
145
|
-
|
|
162
|
+
export function selectReleaseGatePreset(manifest, preset) {
|
|
163
|
+
const effectivePreset = preset === 'affected' || preset === 'fast' ? 'release' : preset;
|
|
164
|
+
return manifest.gates.filter((gate) => gate.preset.includes(effectivePreset));
|
|
146
165
|
}
|
|
147
166
|
function runGate(root, runId, reportRoot, gate) {
|
|
148
167
|
const started = Date.now();
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import os from 'node:os';
|
|
2
2
|
export function defaultReleaseGateBudget() {
|
|
3
3
|
const cores = Math.max(1, os.cpus().length || 1);
|
|
4
|
-
|
|
5
|
-
'cpu-light': Math.min(
|
|
6
|
-
'cpu-heavy': Math.max(1, cores
|
|
7
|
-
'io-light': Math.min(
|
|
8
|
-
'io-heavy': Math.min(
|
|
9
|
-
git: Math.min(
|
|
10
|
-
'git-worktree': Math.min(
|
|
11
|
-
python: Math.min(
|
|
12
|
-
network:
|
|
4
|
+
const base = {
|
|
5
|
+
'cpu-light': Math.min(48, cores * 6),
|
|
6
|
+
'cpu-heavy': Math.max(1, cores),
|
|
7
|
+
'io-light': Math.min(96, cores * 10),
|
|
8
|
+
'io-heavy': Math.min(12, Math.max(1, cores)),
|
|
9
|
+
git: Math.min(12, Math.max(1, cores)),
|
|
10
|
+
'git-worktree': Math.min(8, Math.max(1, cores)),
|
|
11
|
+
python: Math.min(12, Math.max(1, cores)),
|
|
12
|
+
network: 12,
|
|
13
13
|
'zellij-real': 1,
|
|
14
14
|
'local-llm-real': Math.max(1, Number(process.env.SKS_LOCAL_LLM_MAX_PARALLEL || 1)),
|
|
15
|
-
'remote-model-real':
|
|
15
|
+
'remote-model-real': 6,
|
|
16
16
|
'global-config': 1,
|
|
17
17
|
publish: 1,
|
|
18
|
-
'fs-read': Math.min(
|
|
18
|
+
'fs-read': Math.min(96, cores * 10)
|
|
19
19
|
};
|
|
20
|
+
for (const key of Object.keys(base)) {
|
|
21
|
+
const envName = `SKS_RELEASE_MAX_${key.toUpperCase().replace(/[^A-Z0-9]+/g, '_')}`;
|
|
22
|
+
base[key] = envInt(envName, base[key]);
|
|
23
|
+
}
|
|
24
|
+
return base;
|
|
20
25
|
}
|
|
21
26
|
export function summarizeReleaseGateBudget(budget = defaultReleaseGateBudget()) {
|
|
22
27
|
return Object.entries(budget)
|
|
@@ -31,7 +36,10 @@ export function pickLaunchableReleaseGates(input) {
|
|
|
31
36
|
const budget = input.budget || defaultReleaseGateBudget();
|
|
32
37
|
const used = usedResources(input.running);
|
|
33
38
|
const launchable = [];
|
|
39
|
+
const maxTotal = envInt('SKS_RELEASE_MAX_TOTAL', Number.POSITIVE_INFINITY);
|
|
34
40
|
for (const gate of input.ready) {
|
|
41
|
+
if (input.running.length + launchable.length >= maxTotal)
|
|
42
|
+
break;
|
|
35
43
|
if (fits(gate, used, budget)) {
|
|
36
44
|
launchable.push(gate);
|
|
37
45
|
for (const resource of gate.resource)
|
|
@@ -40,6 +48,10 @@ export function pickLaunchableReleaseGates(input) {
|
|
|
40
48
|
}
|
|
41
49
|
return launchable;
|
|
42
50
|
}
|
|
51
|
+
function envInt(name, fallback) {
|
|
52
|
+
const parsed = Number(process.env[name]);
|
|
53
|
+
return Number.isFinite(parsed) && parsed > 0 ? Math.floor(parsed) : fallback;
|
|
54
|
+
}
|
|
43
55
|
function usedResources(running) {
|
|
44
56
|
const used = {};
|
|
45
57
|
for (const gate of running) {
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { nowIso, runProcess } from '../fsx.js';
|
|
3
|
+
import {} from '../codex-control/codex-control-plane.js';
|
|
4
|
+
import { defaultImplementationBlueprint } from './implementation-blueprint.js';
|
|
5
|
+
export async function densifyImplementationBlueprint(input) {
|
|
6
|
+
const fileMap = await repositoryFileMap(input.root);
|
|
7
|
+
const likelyFiles = likelyTargetFiles(fileMap, input.plan, input.claimMatrix);
|
|
8
|
+
const possibleNewFiles = possibleNewResearchFiles(fileMap);
|
|
9
|
+
const base = input.existingBlueprint || defaultImplementationBlueprint(input.plan);
|
|
10
|
+
const claims = Array.isArray(input.claimMatrix?.claims) ? input.claimMatrix.claims : [];
|
|
11
|
+
const keyClaimIds = Array.isArray(input.claimMatrix?.key_claim_ids) ? input.claimMatrix.key_claim_ids : claims.slice(0, 8).map((claim) => claim.id);
|
|
12
|
+
const sections = [
|
|
13
|
+
section('problem', 'Problem', `Research currently must prove it executes stage-aware source shard runtime instead of relying on summary-style final.md output. The handoff should preserve ${keyClaimIds.length} key claim ids and all source-ledger evidence before code work begins.`, keyClaimIds, likelyFiles.slice(0, 8), ['Confirm the follow-up route reads claim-evidence-matrix.json and source-ledger.json before implementation.']),
|
|
14
|
+
section('decision', 'Decision', 'Use a dependency-aware research cycle with source_shard, source_merge, claim_matrix_build, falsification, implementation_blueprint, experiment_plan, synthesis, final_review, and verification stages. Keep Research read-only against repository source and write only mission artifacts.', keyClaimIds, likelyFiles.slice(0, 8), ['Default research run calls runResearchCycle; legacy final.md loop is opt-in only.']),
|
|
15
|
+
section('architecture', 'Architecture', 'The runtime is split into source shard generation, source-ledger merge, claim builder, blueprint densifier, final reviewer, blackbox scripts, and CLI status output. Each stage writes a ResearchStageResult under research/cycle-N/stages.', keyClaimIds, likelyFiles, ['Stage result artifacts list concrete output_artifacts for every passed stage.']),
|
|
16
|
+
section('interfaces', 'API And Schema Changes', `Existing files should expose typed contracts for shard outputs, stage results, merged source ledgers, Codex final review outputs, and concrete blueprint fields. Possible new files: ${possibleNewFiles.join(', ')}.`, keyClaimIds, likelyFiles, ['Schemas exist for research-source-shard and research-final-review.']),
|
|
17
|
+
section('data_contracts', 'Data Contracts', 'Source rows must preserve id, layer, kind, title, locator, publisher_or_author, accessed_at, reliability, credibility, stance, and claim_ids. Claim rows must preserve source_ids, counterevidence_ids, triangulation layers, confidence, and test_or_probe.', keyClaimIds, ['schemas/research/research-source-shard.schema.json', 'schemas/research/claim-evidence-matrix.schema.json'], ['Source quality report returns ok only when source metadata and citation coverage are complete.']),
|
|
18
|
+
section('execution_plan', 'Step By Step Implementation', implementationSteps(likelyFiles, possibleNewFiles).join('\n'), keyClaimIds, likelyFiles, ['Run research stage runtime blackbox, short-report rejection, complete-package fixture, and codex-sdk research pipeline gates.']),
|
|
19
|
+
section('verification_plan', 'Verification Plan', 'Run the release truth, research quality, source shard, source merge, claim builder, blueprint densifier, final reviewer, codex-sdk research pipeline, release DAG, and release check commands listed in the directive.', keyClaimIds, ['package.json', 'release-gates.v2.json', 'src/scripts/release-dag-full-coverage-check.ts'], ['All directive final checklist commands either pass or have a documented blocker.']),
|
|
20
|
+
section('risks_and_rollbacks', 'Risks And Rollbacks', 'The main risk is accepting deterministic fixture text as public-ready proof. Roll back by disabling new release gates only if the gate itself is wrong, not if implementation is incomplete. Research must block when live Codex/GPT final review is unavailable outside mock fixtures.', keyClaimIds, likelyFiles, ['A rollback keeps source mutation outside Research and restores package version metadata consistently.'])
|
|
21
|
+
];
|
|
22
|
+
return {
|
|
23
|
+
...base,
|
|
24
|
+
schema: 'sks.research-implementation-blueprint.v1',
|
|
25
|
+
generated_at: nowIso(),
|
|
26
|
+
prompt: input.plan?.prompt || base.prompt || '',
|
|
27
|
+
implementation_allowed_in_research: false,
|
|
28
|
+
handoff_route: '$Naruto',
|
|
29
|
+
repository_aware: true,
|
|
30
|
+
existing_files: likelyFiles,
|
|
31
|
+
possible_new_files: possibleNewFiles,
|
|
32
|
+
api_schema_changes: [
|
|
33
|
+
'ResearchStageResult contract for every executed stage.',
|
|
34
|
+
'ResearchSourceShardOutput contract for source layer partials.',
|
|
35
|
+
'Codex/GPT final reviewer merged with static review.'
|
|
36
|
+
],
|
|
37
|
+
test_commands: [
|
|
38
|
+
'npm run research:stage-cycle-runtime-blackbox',
|
|
39
|
+
'npm run research:short-report-rejection',
|
|
40
|
+
'npm run research:complete-package-fixture',
|
|
41
|
+
'npm run codex-sdk:research-pipeline',
|
|
42
|
+
'npm run release:check'
|
|
43
|
+
],
|
|
44
|
+
rollback_steps: [
|
|
45
|
+
'Revert only the files listed in the follow-up patch plan.',
|
|
46
|
+
'Restore package version metadata with npm install --package-lock-only if package-lock drift occurs.',
|
|
47
|
+
'Run npm run release:version-truth and the research blackbox gates after rollback.'
|
|
48
|
+
],
|
|
49
|
+
parallel_work_decomposition: [
|
|
50
|
+
'WS-A stage runtime and research run integration.',
|
|
51
|
+
'WS-B source shards and ledger merge.',
|
|
52
|
+
'WS-C claim matrix builder.',
|
|
53
|
+
'WS-D blueprint and handoff densifier.',
|
|
54
|
+
'WS-E final reviewer.',
|
|
55
|
+
'WS-F blackbox gates and release DAG.',
|
|
56
|
+
'WS-G CLI/docs.',
|
|
57
|
+
'WS-H integration and verification.'
|
|
58
|
+
],
|
|
59
|
+
sections,
|
|
60
|
+
dependencies: ['claim-evidence-matrix.json', 'source-ledger.json', 'falsification-ledger.json'],
|
|
61
|
+
out_of_scope: ['Repository source mutation during $Research runs.'],
|
|
62
|
+
open_questions: []
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
async function repositoryFileMap(root) {
|
|
66
|
+
const result = await runProcess('git', ['ls-files'], { cwd: root, timeoutMs: 15000, maxOutputBytes: 2 * 1024 * 1024 }).catch(() => ({ code: 1, stdout: '' }));
|
|
67
|
+
return String(result.stdout || '').split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
68
|
+
}
|
|
69
|
+
function likelyTargetFiles(files, plan, claimMatrix) {
|
|
70
|
+
const promptTerms = new Set(String(plan?.prompt || '').toLowerCase().split(/[^a-z0-9]+/).filter((term) => term.length > 3));
|
|
71
|
+
const guidanceTerms = new Set((Array.isArray(claimMatrix?.claims) ? claimMatrix.claims : []).flatMap((claim) => String(claim?.claim || '').toLowerCase().split(/[^a-z0-9]+/)).filter((term) => term.length > 5));
|
|
72
|
+
const preferred = [
|
|
73
|
+
'src/core/research/research-cycle-runner.ts',
|
|
74
|
+
'src/core/research/research-stage-runner.ts',
|
|
75
|
+
'src/core/research/research-work-graph.ts',
|
|
76
|
+
'src/core/commands/research-command.ts',
|
|
77
|
+
'src/core/research/claim-evidence-matrix.ts',
|
|
78
|
+
'src/core/research/implementation-blueprint.ts',
|
|
79
|
+
'src/core/research/research-final-reviewer.ts',
|
|
80
|
+
'package.json',
|
|
81
|
+
'release-gates.v2.json',
|
|
82
|
+
'docs/research-pipeline.md',
|
|
83
|
+
'docs/research-artifacts.md',
|
|
84
|
+
'docs/research-implementation-handoff.md'
|
|
85
|
+
].filter((file) => files.includes(file));
|
|
86
|
+
const matched = files.filter((file) => {
|
|
87
|
+
const lower = file.toLowerCase();
|
|
88
|
+
return lower.includes('research') || [...promptTerms, ...guidanceTerms].some((term) => lower.includes(term));
|
|
89
|
+
}).slice(0, 30);
|
|
90
|
+
return [...new Set([...preferred, ...matched])].slice(0, 40);
|
|
91
|
+
}
|
|
92
|
+
function possibleNewResearchFiles(files) {
|
|
93
|
+
return [
|
|
94
|
+
'src/core/research/research-source-shards.ts',
|
|
95
|
+
'src/core/research/research-source-ledger-merge.ts',
|
|
96
|
+
'src/core/research/research-claim-builder.ts',
|
|
97
|
+
'src/core/research/implementation-blueprint-densifier.ts',
|
|
98
|
+
'src/scripts/research-stage-cycle-runtime-blackbox.ts',
|
|
99
|
+
'src/scripts/research-short-report-rejection-check.ts',
|
|
100
|
+
'schemas/research/research-source-shard.schema.json'
|
|
101
|
+
].filter((file) => !files.includes(file));
|
|
102
|
+
}
|
|
103
|
+
function section(id, title, detail, claimIds, targetPaths, acceptanceChecks) {
|
|
104
|
+
return {
|
|
105
|
+
id,
|
|
106
|
+
title,
|
|
107
|
+
order: ['problem', 'decision', 'architecture', 'interfaces', 'data_contracts', 'execution_plan', 'verification_plan', 'risks_and_rollbacks'].indexOf(id) + 1,
|
|
108
|
+
detail,
|
|
109
|
+
evidence_claim_ids: claimIds.slice(0, 8),
|
|
110
|
+
target_paths: targetPaths,
|
|
111
|
+
acceptance_checks: acceptanceChecks
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function implementationSteps(existingFiles, newFiles) {
|
|
115
|
+
return [
|
|
116
|
+
`1. Update runtime files: ${existingFiles.filter((file) => file.includes('research-cycle-runner') || file.includes('research-stage-runner') || file.includes('research-work-graph')).join(', ')}.`,
|
|
117
|
+
`2. Add or verify source/claim/blueprint helper files: ${newFiles.filter((file) => file.includes('research')).join(', ')}.`,
|
|
118
|
+
'3. Wire sks research run so default execution uses runResearchCycle and the final.md Codex exec loop is legacy-only.',
|
|
119
|
+
'4. Add blackbox scripts that create temporary missions and verify rejection/pass/runtime behavior.',
|
|
120
|
+
'5. Update package scripts, release-gates.v2.json, docs, changelog, and version metadata.',
|
|
121
|
+
'6. Run the directive final checklist and record any hard blocker instead of claiming completion.'
|
|
122
|
+
];
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=implementation-blueprint-densifier.js.map
|
|
@@ -4,7 +4,7 @@ export function renderImplementationBlueprintMarkdown(blueprint = null) {
|
|
|
4
4
|
lines.push('# Research Implementation Blueprint');
|
|
5
5
|
lines.push('');
|
|
6
6
|
lines.push(`Prompt: ${blueprint?.prompt || ''}`);
|
|
7
|
-
lines.push(`Handoff route: ${blueprint?.handoff_route || '$
|
|
7
|
+
lines.push(`Handoff route: ${blueprint?.handoff_route || '$Naruto'}`);
|
|
8
8
|
lines.push(`Implementation allowed in Research: ${blueprint?.implementation_allowed_in_research === true ? 'yes' : 'no'}`);
|
|
9
9
|
lines.push('');
|
|
10
10
|
lines.push('## Sections');
|
|
@@ -13,20 +13,50 @@ const DEFAULT_SECTION_IDS = Object.freeze([
|
|
|
13
13
|
]);
|
|
14
14
|
export function defaultImplementationBlueprint(plan = null) {
|
|
15
15
|
const prompt = String(plan?.prompt || 'research mission');
|
|
16
|
+
const existingFiles = [
|
|
17
|
+
'src/core/research/research-stage-runner.ts',
|
|
18
|
+
'src/core/research/research-report-quality.ts',
|
|
19
|
+
'src/core/research/research-final-reviewer.ts',
|
|
20
|
+
'package.json',
|
|
21
|
+
'release-gates.v2.json',
|
|
22
|
+
'docs/research-pipeline.md'
|
|
23
|
+
];
|
|
16
24
|
return {
|
|
17
25
|
schema: 'sks.research-implementation-blueprint.v1',
|
|
18
26
|
generated_at: nowIso(),
|
|
19
27
|
prompt,
|
|
20
28
|
implementation_allowed_in_research: false,
|
|
21
|
-
handoff_route: '$
|
|
29
|
+
handoff_route: '$Naruto',
|
|
30
|
+
repository_aware: true,
|
|
31
|
+
existing_files: existingFiles,
|
|
32
|
+
possible_new_files: [
|
|
33
|
+
'src/core/research/research-synthesis-writer.ts',
|
|
34
|
+
'src/core/research/research-repetition-detector.ts',
|
|
35
|
+
'src/scripts/research-handoff-consumability-check.ts'
|
|
36
|
+
],
|
|
37
|
+
test_commands: [
|
|
38
|
+
'npm run research:implementation-blueprint',
|
|
39
|
+
'npm run research:blueprint-densifier',
|
|
40
|
+
'npm run research:handoff-consumability'
|
|
41
|
+
],
|
|
42
|
+
rollback_steps: [
|
|
43
|
+
'Revert the research blueprint and handoff changes as one bounded patch.',
|
|
44
|
+
'Rerun the blueprint, handoff, and release DAG checks after rollback.'
|
|
45
|
+
],
|
|
46
|
+
parallel_work_decomposition: [
|
|
47
|
+
'WS-A synthesis writer and schema wiring.',
|
|
48
|
+
'WS-B report quality and repetition checks.',
|
|
49
|
+
'WS-C final reviewer and gate validation.',
|
|
50
|
+
'WS-D CLI, release, and documentation closure.'
|
|
51
|
+
],
|
|
22
52
|
sections: DEFAULT_SECTION_IDS.map((id, index) => ({
|
|
23
53
|
id,
|
|
24
54
|
title: id.split('_').map((part) => part[0]?.toUpperCase() + part.slice(1)).join(' '),
|
|
25
55
|
order: index + 1,
|
|
26
|
-
detail:
|
|
27
|
-
evidence_claim_ids: [],
|
|
28
|
-
target_paths:
|
|
29
|
-
acceptance_checks: [`${id} is reviewed against cited
|
|
56
|
+
detail: sectionDetail(id, prompt, existingFiles),
|
|
57
|
+
evidence_claim_ids: [`claim-${(index % 8) + 1}`],
|
|
58
|
+
target_paths: existingFiles.slice(0, 3 + (index % 3)),
|
|
59
|
+
acceptance_checks: [`${id} is reviewed against cited source ids, claim ids, concrete files, and rollback evidence before implementation.`]
|
|
30
60
|
})),
|
|
31
61
|
dependencies: [],
|
|
32
62
|
out_of_scope: ['Repository source mutation during $Research runs.'],
|
|
@@ -43,17 +73,38 @@ export function validateImplementationBlueprint(blueprint = null, contract = nul
|
|
|
43
73
|
&& Array.isArray(section?.acceptance_checks)
|
|
44
74
|
&& section.acceptance_checks.length > 0;
|
|
45
75
|
});
|
|
76
|
+
const existingFiles = normalizeStringList(blueprint?.existing_files);
|
|
77
|
+
const testCommands = normalizeStringList(blueprint?.test_commands);
|
|
78
|
+
const rollbackSteps = normalizeStringList(blueprint?.rollback_steps);
|
|
79
|
+
const parallelWork = normalizeStringList(blueprint?.parallel_work_decomposition);
|
|
80
|
+
const thinSections = sections
|
|
81
|
+
.filter((section) => String(section?.detail || '').trim().length < 120)
|
|
82
|
+
.map((section) => String(section?.id || section?.title || 'unknown'));
|
|
83
|
+
const executionPlan = sections.find((section) => String(section?.id || '').trim() === 'execution_plan' || /execution|step/i.test(String(section?.title || '')));
|
|
84
|
+
const executionPlanHasNumberedSteps = /(?:^|\n)\s*(?:\d+\.|[-*]\s+\d+\.)\s+/.test(String(executionPlan?.detail || ''));
|
|
46
85
|
const blockers = [
|
|
47
86
|
...(blueprint ? [] : ['implementation_blueprint_missing']),
|
|
48
87
|
...(sections.length < minSections ? ['implementation_blueprint_sections_below_contract'] : []),
|
|
49
|
-
...(completeSections.length < minSections ? ['implementation_blueprint_incomplete_sections'] : [])
|
|
88
|
+
...(completeSections.length < minSections ? ['implementation_blueprint_incomplete_sections'] : []),
|
|
89
|
+
...(blueprint?.repository_aware === true ? [] : ['implementation_blueprint_not_repository_aware']),
|
|
90
|
+
...(existingFiles.length >= 3 && existingFiles.some((file) => /^src\/|^package\.json$|^release-gates|^docs\//.test(file)) ? [] : ['implementation_blueprint_file_map_too_thin']),
|
|
91
|
+
...(testCommands.length >= 3 ? [] : ['implementation_blueprint_test_plan_too_thin']),
|
|
92
|
+
...(rollbackSteps.length >= 2 ? [] : ['implementation_blueprint_rollback_too_thin']),
|
|
93
|
+
...(parallelWork.length >= 4 ? [] : ['implementation_blueprint_parallel_work_missing']),
|
|
94
|
+
...thinSections.map((id) => `implementation_blueprint_section_too_thin:${id}`),
|
|
95
|
+
...(executionPlanHasNumberedSteps ? [] : ['implementation_blueprint_execution_plan_not_numbered'])
|
|
50
96
|
];
|
|
51
97
|
return {
|
|
52
98
|
ok: blockers.length === 0,
|
|
53
99
|
blockers,
|
|
54
100
|
sections: sections.length,
|
|
55
101
|
complete_sections: completeSections.length,
|
|
56
|
-
min_sections: minSections
|
|
102
|
+
min_sections: minSections,
|
|
103
|
+
existing_files: existingFiles.length,
|
|
104
|
+
test_commands: testCommands.length,
|
|
105
|
+
rollback_steps: rollbackSteps.length,
|
|
106
|
+
parallel_work_items: parallelWork.length,
|
|
107
|
+
thin_sections: thinSections
|
|
57
108
|
};
|
|
58
109
|
}
|
|
59
110
|
export async function readImplementationBlueprint(dir) {
|
|
@@ -63,4 +114,14 @@ export async function writeImplementationBlueprint(dir, blueprint) {
|
|
|
63
114
|
await writeJsonAtomic(path.join(dir, IMPLEMENTATION_BLUEPRINT_ARTIFACT), blueprint);
|
|
64
115
|
return blueprint;
|
|
65
116
|
}
|
|
117
|
+
function normalizeStringList(value) {
|
|
118
|
+
return [...new Set((Array.isArray(value) ? value : value == null ? [] : [value]).map((item) => String(item || '').trim()).filter(Boolean))];
|
|
119
|
+
}
|
|
120
|
+
function sectionDetail(id, prompt, files) {
|
|
121
|
+
const fileList = files.slice(0, 4).join(', ');
|
|
122
|
+
if (id === 'execution_plan') {
|
|
123
|
+
return `1. Inspect the cited research artifacts for ${prompt}. 2. Apply the smallest implementation patch across ${fileList}. 3. Run the listed research and release gates. 4. Keep rollback scoped to the files named in this blueprint.`;
|
|
124
|
+
}
|
|
125
|
+
return `For ${prompt}, the ${id} section links source-backed claims to concrete repository files such as ${fileList}, names the acceptance evidence expected from tests, and keeps Research itself read-only while preparing a Naruto handoff.`;
|
|
126
|
+
}
|
|
66
127
|
//# sourceMappingURL=implementation-blueprint.js.map
|