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.
Files changed (491) hide show
  1. package/README.md +6 -3
  2. package/crates/sks-core/Cargo.lock +1 -1
  3. package/crates/sks-core/Cargo.toml +1 -1
  4. package/crates/sks-core/src/main.rs +1 -1
  5. package/dist/.sks-build-stamp.json +4 -4
  6. package/dist/bin/sks.js +1 -1
  7. package/dist/cli/command-registry.js +2 -1
  8. package/dist/commands/mad-db.js +5 -0
  9. package/dist/commands/zellij-slot-pane.js +3 -1
  10. package/dist/core/agents/agent-orchestrator.js +66 -3
  11. package/dist/core/agents/agent-plan.js +3 -2
  12. package/dist/core/agents/agent-scheduler.js +204 -86
  13. package/dist/core/agents/agent-schema.js +1 -1
  14. package/dist/core/agents/native-cli-session-swarm.js +199 -15
  15. package/dist/core/agents/native-cli-worker.js +85 -0
  16. package/dist/core/agents/parallel-runtime-proof.js +217 -0
  17. package/dist/core/codex-control/codex-task-runner.js +32 -4
  18. package/dist/core/codex-control/model-call-concurrency.js +106 -0
  19. package/dist/core/commands/basic-cli.js +1 -1
  20. package/dist/core/commands/command-suggestions.js +1 -1
  21. package/dist/core/commands/mad-db-command.js +106 -0
  22. package/dist/core/commands/mad-sks-command.js +50 -13
  23. package/dist/core/commands/naruto-command.js +128 -5
  24. package/dist/core/commands/research-command.js +13 -1
  25. package/dist/core/commands/team-command.js +23 -175
  26. package/dist/core/db-safety.js +55 -1
  27. package/dist/core/fsx.js +1 -1
  28. package/dist/core/git/git-worktree-capability.js +18 -0
  29. package/dist/core/git/git-worktree-manager.js +80 -0
  30. package/dist/core/git/git-worktree-pool.js +4 -0
  31. package/dist/core/mad-db/mad-db-capability.js +116 -0
  32. package/dist/core/mad-db/mad-db-ledger.js +31 -0
  33. package/dist/core/mad-db/mad-db-policy-resolver.js +48 -0
  34. package/dist/core/naruto/naruto-concurrency-governor.js +14 -1
  35. package/dist/core/pipeline-internals/runtime-core.js +74 -8
  36. package/dist/core/pipeline-internals/runtime-gates.js +44 -0
  37. package/dist/core/proof/route-proof-gate.js +5 -3
  38. package/dist/core/proof/route-proof-policy.js +9 -1
  39. package/dist/core/release/release-gate-affected-selector.js +113 -0
  40. package/dist/core/release/release-gate-batch-runner.js +67 -0
  41. package/dist/core/release/release-gate-dag.js +22 -3
  42. package/dist/core/release/release-gate-resource-governor.js +23 -11
  43. package/dist/core/research/implementation-blueprint-densifier.js +1 -1
  44. package/dist/core/research/implementation-blueprint-markdown.js +1 -1
  45. package/dist/core/research/implementation-blueprint.js +68 -7
  46. package/dist/core/research/research-final-reviewer.js +27 -1
  47. package/dist/core/research/research-handoff.js +69 -5
  48. package/dist/core/research/research-realistic-report.js +162 -0
  49. package/dist/core/research/research-repetition-detector.js +75 -0
  50. package/dist/core/research/research-report-quality.js +27 -5
  51. package/dist/core/research/research-stage-runner.js +40 -13
  52. package/dist/core/research/research-synthesis-prompt.js +52 -0
  53. package/dist/core/research/research-synthesis-writer.js +208 -0
  54. package/dist/core/research.js +60 -48
  55. package/dist/core/routes.js +23 -19
  56. package/dist/core/update/update-notice.js +120 -0
  57. package/dist/core/version.js +1 -1
  58. package/dist/core/zellij/zellij-dashboard-renderer.js +2 -0
  59. package/dist/core/zellij/zellij-slot-column-anchor.js +35 -1
  60. package/dist/core/zellij/zellij-slot-pane-renderer.js +57 -0
  61. package/dist/core/zellij/zellij-slot-telemetry.js +237 -0
  62. package/dist/scripts/release-gate-dag-runner.js +5 -0
  63. package/dist/scripts/release-speed-summary.js +27 -0
  64. package/package.json +76 -5
  65. package/schemas/agents/parallel-runtime-proof.schema.json +48 -0
  66. package/schemas/mad-db/mad-db-capability.schema.json +31 -0
  67. package/schemas/mad-db/mad-db-ledger.schema.json +14 -0
  68. package/schemas/research/implementation-blueprint.schema.json +6 -1
  69. package/schemas/research/research-final-review.schema.json +10 -0
  70. package/schemas/research/research-synthesis-output.schema.json +62 -0
  71. package/schemas/update/update-notice.schema.json +19 -0
  72. package/schemas/zellij/zellij-slot-telemetry.schema.json +89 -0
  73. package/dist/scripts/agent-ast-aware-work-graph-check.js +0 -25
  74. package/dist/scripts/agent-backfill-replenishment-check.js +0 -13
  75. package/dist/scripts/agent-backfill-route-blackbox.js +0 -5
  76. package/dist/scripts/agent-background-terminals-check.js +0 -16
  77. package/dist/scripts/agent-cleanup-command-ux-check.js +0 -12
  78. package/dist/scripts/agent-cleanup-executor-check.js +0 -53
  79. package/dist/scripts/agent-cleanup-executor-v2-check.js +0 -39
  80. package/dist/scripts/agent-cli-options-to-task-graph-check.js +0 -5
  81. package/dist/scripts/agent-codex-app-cockpit-check.js +0 -91
  82. package/dist/scripts/agent-codex-child-overlap-check.js +0 -21
  83. package/dist/scripts/agent-dynamic-cockpit-check.js +0 -10
  84. package/dist/scripts/agent-dynamic-pool-check.js +0 -13
  85. package/dist/scripts/agent-dynamic-pool-route-blackbox.js +0 -5
  86. package/dist/scripts/agent-fast-mode-default-check.js +0 -62
  87. package/dist/scripts/agent-fast-mode-worker-propagation-check.js +0 -7
  88. package/dist/scripts/agent-follow-up-work-schema-check.js +0 -80
  89. package/dist/scripts/agent-goal-mode-propagation-check.js +0 -9
  90. package/dist/scripts/agent-intelligent-work-graph-check.js +0 -25
  91. package/dist/scripts/agent-janitor-check.js +0 -76
  92. package/dist/scripts/agent-main-no-scout-check.js +0 -11
  93. package/dist/scripts/agent-model-authored-patch-envelope-check.js +0 -15
  94. package/dist/scripts/agent-multi-project-isolation-check.js +0 -86
  95. package/dist/scripts/agent-native-cli-session-proof-check.js +0 -7
  96. package/dist/scripts/agent-native-cli-session-swarm-10-check.js +0 -7
  97. package/dist/scripts/agent-native-cli-session-swarm-20-check.js +0 -7
  98. package/dist/scripts/agent-native-cli-session-swarm-check.js +0 -7
  99. package/dist/scripts/agent-no-subagent-scaling-check.js +0 -7
  100. package/dist/scripts/agent-parallel-write-blackbox.js +0 -56
  101. package/dist/scripts/agent-parallel-write-kernel-check.js +0 -103
  102. package/dist/scripts/agent-patch-conflict-rebase-check.js +0 -198
  103. package/dist/scripts/agent-patch-envelope-extraction-check.js +0 -17
  104. package/dist/scripts/agent-patch-proof-check.js +0 -41
  105. package/dist/scripts/agent-patch-proof-runtime-check.js +0 -63
  106. package/dist/scripts/agent-patch-queue-runtime-check.js +0 -36
  107. package/dist/scripts/agent-patch-rollback-check.js +0 -38
  108. package/dist/scripts/agent-patch-rollback-dag-check.js +0 -14
  109. package/dist/scripts/agent-patch-swarm-route-blackbox.js +0 -10
  110. package/dist/scripts/agent-patch-swarm-runtime-check.js +0 -10
  111. package/dist/scripts/agent-patch-swarm-runtime-truth-check.js +0 -76
  112. package/dist/scripts/agent-patch-transaction-journal-check.js +0 -57
  113. package/dist/scripts/agent-patch-verification-dag-check.js +0 -14
  114. package/dist/scripts/agent-proof-contract-reconciled-check.js +0 -5
  115. package/dist/scripts/agent-real-codex-dynamic-smoke-check.js +0 -166
  116. package/dist/scripts/agent-real-codex-dynamic-smoke-v2-check.js +0 -14
  117. package/dist/scripts/agent-real-codex-in-zellij-worker-pane-check.js +0 -229
  118. package/dist/scripts/agent-real-codex-parallel-workers-10-check.js +0 -5
  119. package/dist/scripts/agent-real-codex-parallel-workers-20-check.js +0 -5
  120. package/dist/scripts/agent-real-codex-parallel-workers-5-check.js +0 -5
  121. package/dist/scripts/agent-real-codex-parallel-workers-check.js +0 -5
  122. package/dist/scripts/agent-role-config-repair-check.js +0 -33
  123. package/dist/scripts/agent-rollback-command-check.js +0 -86
  124. package/dist/scripts/agent-route-truth-backfill-check.js +0 -5
  125. package/dist/scripts/agent-scheduler-proof-check.js +0 -13
  126. package/dist/scripts/agent-scheduler-proof-hardening-check.js +0 -22
  127. package/dist/scripts/agent-session-generation-check.js +0 -21
  128. package/dist/scripts/agent-slot-pane-binding-proof-check.js +0 -64
  129. package/dist/scripts/agent-source-intelligence-propagation-check.js +0 -9
  130. package/dist/scripts/agent-strategy-to-lease-wiring-check.js +0 -32
  131. package/dist/scripts/agent-strategy-to-patch-strict-check.js +0 -54
  132. package/dist/scripts/agent-task-graph-expansion-check.js +0 -14
  133. package/dist/scripts/agent-terminal-generations-check.js +0 -23
  134. package/dist/scripts/agent-visual-consistency-check.js +0 -9
  135. package/dist/scripts/agent-wiki-context-proof-check.js +0 -62
  136. package/dist/scripts/agent-worker-backend-router-check.js +0 -63
  137. package/dist/scripts/agent-worker-scout-limited-check.js +0 -17
  138. package/dist/scripts/agent-zellij-dynamic-backfill-panes-check.js +0 -34
  139. package/dist/scripts/agent-zellij-runtime-check.js +0 -84
  140. package/dist/scripts/all-feature-deep-completion-check.js +0 -31
  141. package/dist/scripts/appshots-capability-check.js +0 -18
  142. package/dist/scripts/appshots-evidence-check.js +0 -48
  143. package/dist/scripts/appshots-operator-policy-check.js +0 -25
  144. package/dist/scripts/appshots-privacy-safety-check.js +0 -48
  145. package/dist/scripts/appshots-source-intelligence-check.js +0 -53
  146. package/dist/scripts/appshots-thread-attachment-discovery-check.js +0 -87
  147. package/dist/scripts/appshots-triwiki-voxel-check.js +0 -46
  148. package/dist/scripts/architecture-guard-check.js +0 -55
  149. package/dist/scripts/changelog-check.js +0 -47
  150. package/dist/scripts/codex-0-133-official-compat-report.js +0 -53
  151. package/dist/scripts/codex-0-134-official-compat-report.js +0 -110
  152. package/dist/scripts/codex-0-134-runner-truth-check.js +0 -66
  153. package/dist/scripts/codex-0-135-compat-check.js +0 -57
  154. package/dist/scripts/codex-0-136-compat-check.js +0 -30
  155. package/dist/scripts/codex-0-137-compat-check.js +0 -27
  156. package/dist/scripts/codex-app-fast-ui-preservation-check.js +0 -32
  157. package/dist/scripts/codex-app-provider-badge-check.js +0 -37
  158. package/dist/scripts/codex-app-ui-clobber-guard-check.js +0 -22
  159. package/dist/scripts/codex-app-ui-preservation-check.js +0 -96
  160. package/dist/scripts/codex-control-all-pipelines-check.js +0 -36
  161. package/dist/scripts/codex-control-capability-check.js +0 -10
  162. package/dist/scripts/codex-control-empty-result-retry-check.js +0 -43
  163. package/dist/scripts/codex-control-event-stream-ledger-check.js +0 -10
  164. package/dist/scripts/codex-control-keepalive-no-cot-leak-check.js +0 -14
  165. package/dist/scripts/codex-control-no-legacy-fallback-check.js +0 -31
  166. package/dist/scripts/codex-control-side-effect-scope-check.js +0 -26
  167. package/dist/scripts/codex-control-stream-idle-watchdog-check.js +0 -18
  168. package/dist/scripts/codex-control-structured-output-check.js +0 -11
  169. package/dist/scripts/codex-control-thread-registry-check.js +0 -11
  170. package/dist/scripts/codex-control-tool-call-sequence-repair-check.js +0 -14
  171. package/dist/scripts/codex-environment-scoped-approvals-check.js +0 -10
  172. package/dist/scripts/codex-exec-output-schema-actual-syntax-check.js +0 -33
  173. package/dist/scripts/codex-fast-mode-profile-propagation-check.js +0 -12
  174. package/dist/scripts/codex-history-search-check.js +0 -19
  175. package/dist/scripts/codex-hook-semantic-check.js +0 -15
  176. package/dist/scripts/codex-hook-strict-subset-check.js +0 -61
  177. package/dist/scripts/codex-lb-config-toml-safety-check.js +0 -85
  178. package/dist/scripts/codex-lb-persistence-truth-check.js +0 -96
  179. package/dist/scripts/codex-lb-setup-fixture-check.js +0 -91
  180. package/dist/scripts/codex-lb-setup-truthfulness-check.js +0 -84
  181. package/dist/scripts/codex-legacy-profile-consumers-removed-check.js +0 -24
  182. package/dist/scripts/codex-managed-proxy-env-check.js +0 -17
  183. package/dist/scripts/codex-output-schema-fixture-check.js +0 -25
  184. package/dist/scripts/codex-permission-profiles-check.js +0 -36
  185. package/dist/scripts/codex-plugin-list-json-check.js +0 -8
  186. package/dist/scripts/codex-profile-primary-check.js +0 -13
  187. package/dist/scripts/codex-project-config-policy-splitter-check.js +0 -51
  188. package/dist/scripts/codex-resume-cwd-truth-check.js +0 -17
  189. package/dist/scripts/codex-sdk-all-pipelines-check.js +0 -32
  190. package/dist/scripts/codex-sdk-backend-router-check.js +0 -65
  191. package/dist/scripts/codex-sdk-capability-check.js +0 -11
  192. package/dist/scripts/codex-sdk-core-skill-pipeline-check.js +0 -9
  193. package/dist/scripts/codex-sdk-dfix-pipeline-check.js +0 -9
  194. package/dist/scripts/codex-sdk-event-stream-ledger-check.js +0 -9
  195. package/dist/scripts/codex-sdk-no-legacy-fallback-check.js +0 -33
  196. package/dist/scripts/codex-sdk-qa-pipeline-check.js +0 -8
  197. package/dist/scripts/codex-sdk-real-smoke-check.js +0 -39
  198. package/dist/scripts/codex-sdk-release-review-pipeline-check.js +0 -13
  199. package/dist/scripts/codex-sdk-research-pipeline-check.js +0 -47
  200. package/dist/scripts/codex-sdk-sandbox-policy-check.js +0 -21
  201. package/dist/scripts/codex-sdk-structured-output-check.js +0 -10
  202. package/dist/scripts/codex-sdk-team-naruto-agent-pipeline-check.js +0 -12
  203. package/dist/scripts/codex-sdk-thread-registry-check.js +0 -11
  204. package/dist/scripts/codex-sdk-ux-ppt-review-pipeline-check.js +0 -9
  205. package/dist/scripts/codex-sdk-zellij-pane-binding-check.js +0 -13
  206. package/dist/scripts/codex-thread-runtime-choice-check.js +0 -10
  207. package/dist/scripts/codex-web-adapter-check.js +0 -12
  208. package/dist/scripts/computer-use-live-evidence-check.js +0 -55
  209. package/dist/scripts/computer-use-live-optional-check.js +0 -32
  210. package/dist/scripts/computer-use-policy-check.js +0 -69
  211. package/dist/scripts/computer-use-visual-route-fixture-check.js +0 -37
  212. package/dist/scripts/core-skill-card-schema-check.js +0 -61
  213. package/dist/scripts/core-skill-deployment-snapshot-check.js +0 -54
  214. package/dist/scripts/core-skill-heldout-validation-check.js +0 -49
  215. package/dist/scripts/core-skill-no-inference-optimizer-check.js +0 -75
  216. package/dist/scripts/core-skill-patch-check.js +0 -79
  217. package/dist/scripts/core-skill-promotion-side-effect-ledger-check.js +0 -64
  218. package/dist/scripts/core-skill-rollout-scoring-check.js +0 -72
  219. package/dist/scripts/core-skill-route-runtime-integration-check.js +0 -49
  220. package/dist/scripts/dfix-fast-blackbox-check.js +0 -37
  221. package/dist/scripts/dfix-fast-kernel-check.js +0 -26
  222. package/dist/scripts/dfix-fixture-check.js +0 -6
  223. package/dist/scripts/dfix-parallel-write-blackbox.js +0 -48
  224. package/dist/scripts/dfix-patch-handoff-check.js +0 -13
  225. package/dist/scripts/dfix-patch-swarm-route-blackbox.js +0 -10
  226. package/dist/scripts/dfix-performance-check.js +0 -15
  227. package/dist/scripts/dfix-verification-check.js +0 -9
  228. package/dist/scripts/dfix-verification-recommendation-check.js +0 -15
  229. package/dist/scripts/docs-truthfulness-check.js +0 -61
  230. package/dist/scripts/doctor-codex-doctor-parity-check.js +0 -17
  231. package/dist/scripts/doctor-fix-proves-codex-read-check.js +0 -64
  232. package/dist/scripts/doctor-fix-recovers-corrupted-config-check.js +0 -122
  233. package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +0 -39
  234. package/dist/scripts/evidence-fixture-check.js +0 -26
  235. package/dist/scripts/evidence-flagship-coverage-check.js +0 -55
  236. package/dist/scripts/fake-real-proof-policy-v2-check.js +0 -27
  237. package/dist/scripts/fake-vs-real-proof-policy-check.js +0 -14
  238. package/dist/scripts/fast-codex-service-tier-proof-check.js +0 -42
  239. package/dist/scripts/flagship-proof-graph-v2-check.js +0 -48
  240. package/dist/scripts/flagship-proof-graph-v3-check.js +0 -67
  241. package/dist/scripts/flagship-proof-graph-v4-check.js +0 -61
  242. package/dist/scripts/git-precommit-fixture-check.js +0 -41
  243. package/dist/scripts/git-worktree-cache-performance-check.js +0 -25
  244. package/dist/scripts/git-worktree-capability-check.js +0 -27
  245. package/dist/scripts/git-worktree-checkpoint-check.js +0 -20
  246. package/dist/scripts/git-worktree-cleanup-check.js +0 -27
  247. package/dist/scripts/git-worktree-cross-rebase-check.js +0 -39
  248. package/dist/scripts/git-worktree-diff-envelope-check.js +0 -17
  249. package/dist/scripts/git-worktree-diff-export-check.js +0 -43
  250. package/dist/scripts/git-worktree-dirty-lock-check.js +0 -17
  251. package/dist/scripts/git-worktree-dirty-main-detection-check.js +0 -14
  252. package/dist/scripts/git-worktree-integration-primary-check.js +0 -24
  253. package/dist/scripts/git-worktree-integration-primary-runtime-check.js +0 -20
  254. package/dist/scripts/git-worktree-manager-check.js +0 -37
  255. package/dist/scripts/git-worktree-manifest-append-check.js +0 -18
  256. package/dist/scripts/git-worktree-merge-queue-check.js +0 -31
  257. package/dist/scripts/git-worktree-pool-performance-check.js +0 -20
  258. package/dist/scripts/git-worktree-untracked-diff-check.js +0 -18
  259. package/dist/scripts/goal-mode-official-default-check.js +0 -12
  260. package/dist/scripts/gpt-final-arbiter-check.js +0 -63
  261. package/dist/scripts/gpt-final-arbiter-performance-check.js +0 -36
  262. package/dist/scripts/gpt-image-2-request-validator-check.js +0 -35
  263. package/dist/scripts/hooks-0.134-context-parity-check.js +0 -20
  264. package/dist/scripts/hooks-actual-parity-check.js +0 -17
  265. package/dist/scripts/hooks-actual-parity-v2-check.js +0 -21
  266. package/dist/scripts/hooks-latest-schema-check.js +0 -20
  267. package/dist/scripts/hooks-managed-install-fixture-check.js +0 -21
  268. package/dist/scripts/hooks-official-hash-oracle-check.js +0 -35
  269. package/dist/scripts/hooks-official-hash-parity-check.js +0 -17
  270. package/dist/scripts/hooks-subagent-events-check.js +0 -17
  271. package/dist/scripts/hooks-trust-state-check.js +0 -14
  272. package/dist/scripts/image-fidelity-fixture-check.js +0 -24
  273. package/dist/scripts/imagegen-capability-check.js +0 -30
  274. package/dist/scripts/imagegen-real-smoke-check.js +0 -155
  275. package/dist/scripts/install-update-preserves-config-check.js +0 -87
  276. package/dist/scripts/json-schema-recursive-check.js +0 -78
  277. package/dist/scripts/legacy-multiagent-removal-check.js +0 -85
  278. package/dist/scripts/legacy-upgrade-matrix-check.js +0 -300
  279. package/dist/scripts/local-collab-all-pipelines-final-gpt-check.js +0 -21
  280. package/dist/scripts/local-collab-gpt-final-availability-check.js +0 -58
  281. package/dist/scripts/local-collab-no-local-only-final-check.js +0 -27
  282. package/dist/scripts/local-collab-policy-check.js +0 -17
  283. package/dist/scripts/local-collab-worktree-gpt-final-apply-policy-check.js +0 -63
  284. package/dist/scripts/local-llm-all-pipelines-check.js +0 -11
  285. package/dist/scripts/local-llm-cache-performance-check.js +0 -10
  286. package/dist/scripts/local-llm-capability-check.js +0 -14
  287. package/dist/scripts/local-llm-smoke-check.js +0 -23
  288. package/dist/scripts/local-llm-structured-output-check.js +0 -11
  289. package/dist/scripts/local-llm-throughput-check.js +0 -10
  290. package/dist/scripts/local-llm-tool-call-repair-check.js +0 -10
  291. package/dist/scripts/local-llm-warmup-check.js +0 -11
  292. package/dist/scripts/loop-blocker-check.js +0 -15
  293. package/dist/scripts/mad-preflight-blocks-unreadable-config-check.js +0 -35
  294. package/dist/scripts/mad-sks-actual-executor-blackbox.js +0 -5
  295. package/dist/scripts/mad-sks-app-ui-no-mutation-check.js +0 -92
  296. package/dist/scripts/mad-sks-audit-proof-check.js +0 -34
  297. package/dist/scripts/mad-sks-db-executor-check.js +0 -5
  298. package/dist/scripts/mad-sks-executor-proof-graph-check.js +0 -5
  299. package/dist/scripts/mad-sks-fast-mode-propagation-check.js +0 -24
  300. package/dist/scripts/mad-sks-file-write-executor-check.js +0 -5
  301. package/dist/scripts/mad-sks-immutable-harness-check.js +0 -36
  302. package/dist/scripts/mad-sks-no-harness-modification-check.js +0 -25
  303. package/dist/scripts/mad-sks-package-executor-check.js +0 -5
  304. package/dist/scripts/mad-sks-permission-model-check.js +0 -22
  305. package/dist/scripts/mad-sks-rollback-apply-check.js +0 -5
  306. package/dist/scripts/mad-sks-service-executor-check.js +0 -5
  307. package/dist/scripts/mad-sks-shell-executor-check.js +0 -5
  308. package/dist/scripts/mad-sks-write-guard-check.js +0 -28
  309. package/dist/scripts/mad-sks-zellij-default-pane-worker-check.js +0 -37
  310. package/dist/scripts/mad-sks-zellij-launch-check.js +0 -102
  311. package/dist/scripts/mcp-0-134-modernization-check.js +0 -55
  312. package/dist/scripts/mcp-readonly-concurrency-check.js +0 -17
  313. package/dist/scripts/mcp-readonly-runtime-scheduler-check.js +0 -20
  314. package/dist/scripts/mcp-tool-naming-parity-check.js +0 -16
  315. package/dist/scripts/memory-summary-rebuild-check.js +0 -22
  316. package/dist/scripts/mutation-callsite-coverage-check.js +0 -180
  317. package/dist/scripts/naruto-active-pool-check.js +0 -39
  318. package/dist/scripts/naruto-actual-worker-control-plane-check.js +0 -56
  319. package/dist/scripts/naruto-allocation-policy-check.js +0 -33
  320. package/dist/scripts/naruto-allocation-runtime-wiring-check.js +0 -92
  321. package/dist/scripts/naruto-concurrency-governor-check.js +0 -53
  322. package/dist/scripts/naruto-extreme-parallelism-check.js +0 -22
  323. package/dist/scripts/naruto-extreme-parallelism-real-check.js +0 -43
  324. package/dist/scripts/naruto-gpt-final-pack-check.js +0 -34
  325. package/dist/scripts/naruto-orchestrator-runtime-source-check.js +0 -70
  326. package/dist/scripts/naruto-parallel-patch-apply-check.js +0 -41
  327. package/dist/scripts/naruto-readonly-routing-check.js +0 -116
  328. package/dist/scripts/naruto-real-active-pool-check.js +0 -39
  329. package/dist/scripts/naruto-real-active-pool-runtime-check.js +0 -55
  330. package/dist/scripts/naruto-rebalance-policy-check.js +0 -41
  331. package/dist/scripts/naruto-role-distribution-check.js +0 -23
  332. package/dist/scripts/naruto-shadow-clone-swarm-check.js +0 -153
  333. package/dist/scripts/naruto-verification-pool-check.js +0 -36
  334. package/dist/scripts/naruto-work-graph-check.js +0 -24
  335. package/dist/scripts/naruto-worktree-coding-blackbox.js +0 -29
  336. package/dist/scripts/naruto-worktree-coding-check.js +0 -44
  337. package/dist/scripts/naruto-worktree-gpt-final-check.js +0 -45
  338. package/dist/scripts/naruto-worktree-zellij-ui-check.js +0 -28
  339. package/dist/scripts/naruto-zellij-dynamic-right-column-check.js +0 -48
  340. package/dist/scripts/naruto-zellij-massive-ui-check.js +0 -23
  341. package/dist/scripts/non-recursive-pipeline-check.js +0 -68
  342. package/dist/scripts/npm-publish-performance-check.js +0 -65
  343. package/dist/scripts/official-docs-compat-report.js +0 -304
  344. package/dist/scripts/packlist-performance-check.js +0 -83
  345. package/dist/scripts/parallel-verification-engine-check.js +0 -85
  346. package/dist/scripts/postinstall-safe-side-effects-check.js +0 -65
  347. package/dist/scripts/ppt-full-e2e-artifact-graph-check.js +0 -40
  348. package/dist/scripts/ppt-full-e2e-blackbox-check.js +0 -109
  349. package/dist/scripts/ppt-image-voxel-relations-check.js +0 -9
  350. package/dist/scripts/ppt-imagegen-blackbox-check.js +0 -46
  351. package/dist/scripts/ppt-imagegen-review-fixture-check.js +0 -6
  352. package/dist/scripts/ppt-issue-extraction-fixture-check.js +0 -7
  353. package/dist/scripts/ppt-no-mock-as-real-check.js +0 -8
  354. package/dist/scripts/ppt-no-text-fallback-check.js +0 -7
  355. package/dist/scripts/ppt-proof-trust-fixture-check.js +0 -10
  356. package/dist/scripts/ppt-real-export-adapter-check.js +0 -13
  357. package/dist/scripts/ppt-real-imagegen-smoke-check.js +0 -42
  358. package/dist/scripts/ppt-real-imagegen-wiring-check.js +0 -16
  359. package/dist/scripts/ppt-reexport-rereview-check.js +0 -19
  360. package/dist/scripts/ppt-slide-export-fixture-check.js +0 -7
  361. package/dist/scripts/prepublish-fast-check.js +0 -128
  362. package/dist/scripts/priority-full-closure-check.js +0 -12
  363. package/dist/scripts/product-design-auto-install-check.js +0 -119
  364. package/dist/scripts/product-design-plugin-routing-check.js +0 -101
  365. package/dist/scripts/prompt-placeholder-guard-check.js +0 -33
  366. package/dist/scripts/provider-badge-context-check.js +0 -26
  367. package/dist/scripts/provider-context-config-toml-check.js +0 -63
  368. package/dist/scripts/python-codex-sdk-all-pipelines-check.js +0 -47
  369. package/dist/scripts/python-codex-sdk-capability-check.js +0 -75
  370. package/dist/scripts/python-codex-sdk-sandbox-policy-check.js +0 -10
  371. package/dist/scripts/python-codex-sdk-stream-bridge-check.js +0 -12
  372. package/dist/scripts/python-tools-smoke-check.js +0 -71
  373. package/dist/scripts/qa-actual-route-backfill-check.js +0 -5
  374. package/dist/scripts/qa-backfill-route-blackbox.js +0 -5
  375. package/dist/scripts/qa-patch-swarm-route-blackbox.js +0 -10
  376. package/dist/scripts/readme-architecture-imagegen-official-check.js +0 -448
  377. package/dist/scripts/release-cache-glob-hashing-check.js +0 -42
  378. package/dist/scripts/release-dag-full-coverage-check.js +0 -66
  379. package/dist/scripts/release-dist-freshness-check.js +0 -8
  380. package/dist/scripts/release-dynamic-performance-check.js +0 -103
  381. package/dist/scripts/release-gate-budget-check.js +0 -36
  382. package/dist/scripts/release-gate-dag-runner-check.js +0 -17
  383. package/dist/scripts/release-metadata-1-11-check.js +0 -37
  384. package/dist/scripts/release-metadata-1-12-check.js +0 -48
  385. package/dist/scripts/release-metadata-1-13-check.js +0 -53
  386. package/dist/scripts/release-metadata-1-14-check.js +0 -63
  387. package/dist/scripts/release-metadata-1-16-check.js +0 -81
  388. package/dist/scripts/release-metadata-1-17-check.js +0 -51
  389. package/dist/scripts/release-metadata-1-19-check.js +0 -371
  390. package/dist/scripts/release-metadata-check.js +0 -7
  391. package/dist/scripts/release-native-agent-fixture-check.js +0 -41
  392. package/dist/scripts/release-parallel-check.js +0 -374
  393. package/dist/scripts/release-parallel-full-coverage-check.js +0 -13
  394. package/dist/scripts/release-parallel-speed-budget-check.js +0 -84
  395. package/dist/scripts/release-provenance-check.js +0 -150
  396. package/dist/scripts/release-real-check.js +0 -330
  397. package/dist/scripts/release-registry-check.js +0 -344
  398. package/dist/scripts/release-runtime-truth-matrix-check.js +0 -47
  399. package/dist/scripts/release-stability-report-check.js +0 -99
  400. package/dist/scripts/release-version-truth-check.js +0 -134
  401. package/dist/scripts/research-actual-route-backfill-check.js +0 -5
  402. package/dist/scripts/research-backfill-route-blackbox.js +0 -5
  403. package/dist/scripts/research-blueprint-densifier-check.js +0 -21
  404. package/dist/scripts/research-claim-builder-check.js +0 -19
  405. package/dist/scripts/research-complete-package-fixture-check.js +0 -23
  406. package/dist/scripts/research-final-reviewer-blackbox.js +0 -22
  407. package/dist/scripts/research-parallel-source-shards-check.js +0 -22
  408. package/dist/scripts/research-quality-gate-check.js +0 -111
  409. package/dist/scripts/research-real-cycle-no-legacy-final-md-check.js +0 -14
  410. package/dist/scripts/research-short-report-rejection-check.js +0 -46
  411. package/dist/scripts/research-source-ledger-merge-check.js +0 -26
  412. package/dist/scripts/research-stage-cycle-runtime-blackbox.js +0 -24
  413. package/dist/scripts/responses-retry-policy-centralized-check.js +0 -19
  414. package/dist/scripts/retention-cleanup-safety-check.js +0 -155
  415. package/dist/scripts/route-blackbox-realism-check.js +0 -21
  416. package/dist/scripts/route-proof-artifact-structure-check.js +0 -145
  417. package/dist/scripts/runtime-dist-parity-check.js +0 -78
  418. package/dist/scripts/runtime-no-mjs-scripts-check.js +0 -45
  419. package/dist/scripts/runtime-no-src-mjs-check.js +0 -32
  420. package/dist/scripts/runtime-no-tmux-check.js +0 -113
  421. package/dist/scripts/runtime-ts-python-boundary-check.js +0 -59
  422. package/dist/scripts/runtime-ts-rust-boundary-check.js +0 -74
  423. package/dist/scripts/runtime-ts-source-of-truth-check.js +0 -55
  424. package/dist/scripts/safety-check.js +0 -23
  425. package/dist/scripts/shared-memory-fixture-check.js +0 -27
  426. package/dist/scripts/side-effect-runtime-report-check.js +0 -19
  427. package/dist/scripts/side-effect-zero-gate-check.js +0 -226
  428. package/dist/scripts/sks-1-11-fixture-check.js +0 -130
  429. package/dist/scripts/source-intelligence-all-modes-check.js +0 -32
  430. package/dist/scripts/source-intelligence-policy-check.js +0 -13
  431. package/dist/scripts/strategy-adhd-orchestrating-gate-check.js +0 -22
  432. package/dist/scripts/strategy-file-ownership-plan-check.js +0 -18
  433. package/dist/scripts/strategy-parallel-modification-plan-check.js +0 -19
  434. package/dist/scripts/strategy-verification-rollback-dag-check.js +0 -19
  435. package/dist/scripts/team-actual-route-backfill-check.js +0 -5
  436. package/dist/scripts/team-backfill-route-blackbox.js +0 -5
  437. package/dist/scripts/team-parallel-write-blackbox.js +0 -55
  438. package/dist/scripts/team-patch-swarm-route-blackbox.js +0 -10
  439. package/dist/scripts/terminal-keyboard-enhancement-safety-check.js +0 -12
  440. package/dist/scripts/terminal-tui-output-stability-check.js +0 -35
  441. package/dist/scripts/test-no-orphan-dist-imports-check.js +0 -73
  442. package/dist/scripts/trust-fixture-check.js +0 -33
  443. package/dist/scripts/typescript-migration-report.js +0 -78
  444. package/dist/scripts/ultra-router-auto-router-check.js +0 -33
  445. package/dist/scripts/ultra-router-classification-check.js +0 -28
  446. package/dist/scripts/ux-patch-swarm-route-blackbox.js +0 -10
  447. package/dist/scripts/ux-ppt-structured-extraction-check.js +0 -21
  448. package/dist/scripts/ux-review-extract-real-callouts-fixture-check.js +0 -8
  449. package/dist/scripts/ux-review-extract-wires-real-extractor-check.js +0 -15
  450. package/dist/scripts/ux-review-generate-callouts-fixture-check.js +0 -9
  451. package/dist/scripts/ux-review-image-voxel-relations-check.js +0 -31
  452. package/dist/scripts/ux-review-imagegen-blackbox-check.js +0 -67
  453. package/dist/scripts/ux-review-no-fake-callouts-check.js +0 -8
  454. package/dist/scripts/ux-review-no-text-fallback-check.js +0 -25
  455. package/dist/scripts/ux-review-patch-diff-recheck-check.js +0 -20
  456. package/dist/scripts/ux-review-patch-handoff-fixture-check.js +0 -8
  457. package/dist/scripts/ux-review-real-imagegen-smoke-check.js +0 -31
  458. package/dist/scripts/ux-review-real-loop-fixture-check.js +0 -24
  459. package/dist/scripts/ux-review-recapture-recheck-fixture-check.js +0 -8
  460. package/dist/scripts/ux-review-run-wires-imagegen-check.js +0 -11
  461. package/dist/scripts/worker-pane-communication-contract-check.js +0 -54
  462. package/dist/scripts/wrongness-fixture-check.js +0 -65
  463. package/dist/scripts/xai-mcp-capability-check.js +0 -14
  464. package/dist/scripts/zellij-capability-check.js +0 -15
  465. package/dist/scripts/zellij-dashboard-pane-check.js +0 -70
  466. package/dist/scripts/zellij-developer-controls-check.js +0 -20
  467. package/dist/scripts/zellij-doctor-readiness-check.js +0 -63
  468. package/dist/scripts/zellij-dynamic-pane-lifecycle-check.js +0 -21
  469. package/dist/scripts/zellij-first-slot-down-stack-check.js +0 -20
  470. package/dist/scripts/zellij-first-slot-down-stack-real-check.js +0 -356
  471. package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -28
  472. package/dist/scripts/zellij-lane-renderer-check.js +0 -65
  473. package/dist/scripts/zellij-launch-command-truth-check.js +0 -75
  474. package/dist/scripts/zellij-layout-valid-check.js +0 -90
  475. package/dist/scripts/zellij-pane-proof-check.js +0 -59
  476. package/dist/scripts/zellij-real-session-cleanup-check.js +0 -21
  477. package/dist/scripts/zellij-real-session-heartbeat-check.js +0 -49
  478. package/dist/scripts/zellij-real-session-launch-check.js +0 -57
  479. package/dist/scripts/zellij-right-column-headless-overflow-check.js +0 -22
  480. package/dist/scripts/zellij-right-column-manager-check.js +0 -27
  481. package/dist/scripts/zellij-screen-proof-check.js +0 -45
  482. package/dist/scripts/zellij-slot-column-anchor-check.js +0 -66
  483. package/dist/scripts/zellij-slot-only-ui-check.js +0 -26
  484. package/dist/scripts/zellij-slot-pane-renderer-check.js +0 -106
  485. package/dist/scripts/zellij-slot-renderer-proof-semantics-check.js +0 -59
  486. package/dist/scripts/zellij-spawn-on-demand-layout-check.js +0 -40
  487. package/dist/scripts/zellij-ui-design-check.js +0 -105
  488. package/dist/scripts/zellij-worker-pane-manager-check.js +0 -109
  489. package/dist/scripts/zellij-worker-pane-manager-single-owner-check.js +0 -47
  490. package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -202
  491. package/dist/scripts/zellij-worker-pane-spawn-order-check.js +0 -35
@@ -1,5 +1,5 @@
1
1
  import path from 'node:path';
2
- import { createMission, findLatestMission, loadMission } from '../mission.js';
2
+ import { createMission, findLatestMission, loadMission, setCurrent } from '../mission.js';
3
3
  import { nowIso, readJson, sksRoot, writeJsonAtomic } from '../fsx.js';
4
4
  import { runNativeAgentOrchestrator } from '../agents/agent-orchestrator.js';
5
5
  import { classifyOllamaWorkerSlice } from '../agents/agent-runner-ollama.js';
@@ -165,10 +165,12 @@ async function narutoRun(parsed) {
165
165
  requestedClones: roster.agent_count,
166
166
  totalWorkItems: workGraph.total_work_items,
167
167
  pendingWorkQueueSize: workGraph.total_work_items,
168
- backend: schedulerBackend
168
+ backend: schedulerBackend,
169
+ parallelismMode: parsed.parallelism
169
170
  });
170
171
  const backendMinimum = schedulerBackend === 'fake' ? roster.agent_count : Math.min(roster.agent_count, 2);
171
- const activeSlots = Math.max(1, Math.min(roster.agent_count, parsed.concurrency || Math.max(governor.safe_active_workers, backendMinimum), safe.cap));
172
+ const activeCap = parsed.parallelism === 'safe' ? safe.cap : MAX_NARUTO_AGENT_COUNT;
173
+ const activeSlots = Math.max(1, Math.min(roster.agent_count, parsed.concurrency || Math.max(governor.safe_active_workers, backendMinimum), activeCap));
172
174
  const zellijVisiblePanes = Math.max(1, Math.min(activeSlots, governor.safe_zellij_visible_panes));
173
175
  const activePool = await runNarutoActivePool({ graph: workGraph, governor: { ...governor, safe_active_workers: activeSlots } });
174
176
  const runPreRunSmoke = parsed.smoke === true || process.env.SKS_NARUTO_PRE_RUN_SMOKE === '1';
@@ -235,7 +237,66 @@ async function narutoRun(parsed) {
235
237
  placeholderGuard,
236
238
  gitWorktreeCapability
237
239
  });
240
+ await writeJsonAtomic(path.join(mission.dir, 'naruto-gate.json'), {
241
+ schema: 'sks.naruto-gate.v1',
242
+ passed: false,
243
+ mission_id: mission.id,
244
+ clone_roster_built: true,
245
+ clone_count: roster.agent_count,
246
+ work_graph_ready: workGraph.ok === true,
247
+ role_distribution_ready: roleDistribution.ok === true,
248
+ allocation_ready: allocationPolicy.ok === true,
249
+ rebalance_ready: rebalancePolicy.ok === true,
250
+ concurrency_governor_ready: true,
251
+ active_pool_simulated: activePool.ok === true,
252
+ verification_dag_ready: true,
253
+ gpt_final_pack_ready: true,
254
+ zellij_dashboard_ready: zellijDashboard.ok === true,
255
+ native_agent_proof: false,
256
+ final_arbiter_accepted: false,
257
+ session_cleanup: false,
258
+ blockers: [],
259
+ updated_at: nowIso()
260
+ });
261
+ await setCurrent(root, {
262
+ mission_id: mission.id,
263
+ route: 'Naruto',
264
+ route_command: '$Naruto',
265
+ mode: 'NARUTO',
266
+ phase: 'NARUTO_NATIVE_AGENT_INTAKE',
267
+ questions_allowed: false,
268
+ implementation_allowed: true,
269
+ context7_required: false,
270
+ context7_verified: parsed.mock,
271
+ subagents_required: true,
272
+ subagents_verified: false,
273
+ native_sessions_required: true,
274
+ native_sessions_verified: false,
275
+ reflection_required: true,
276
+ visible_progress_required: true,
277
+ required_skills: ['naruto', 'pipeline-runner', 'prompt-pipeline', 'honest-mode'],
278
+ stop_gate: 'naruto-gate.json',
279
+ clone_count: roster.agent_count,
280
+ target_active_slots: activeSlots,
281
+ work_graph_ready: workGraph.ok === true,
282
+ naruto_gate_file: 'naruto-gate.json',
283
+ prompt: parsed.prompt
284
+ });
238
285
  let liveZellij = null;
286
+ if (!parsed.json) {
287
+ console.log('$Naruto starting:');
288
+ console.log(' clones requested: ' + roster.agent_count);
289
+ console.log(' work items: ' + workGraph.total_work_items);
290
+ console.log(' target active workers: ' + activeSlots);
291
+ console.log(' visible panes: ' + zellijVisiblePanes);
292
+ console.log(' headless workers: ' + Math.max(0, activeSlots - zellijVisiblePanes));
293
+ console.log(' backend: ' + schedulerBackend);
294
+ console.log(' parallelism mode: ' + parsed.parallelism);
295
+ if (activeSlots < roster.agent_count)
296
+ console.log(' cap reasons: ' + (governor.reasons.join(', ') || 'host safety cap'));
297
+ if (parsed.parallelism !== 'safe' && activeSlots < 10)
298
+ console.log(' warning: active workers below 10 in non-safe mode');
299
+ }
239
300
  if (!parsed.json && !parsed.mock && !parsed.noOpenZellij) {
240
301
  liveZellij = await launchZellijLayout({
241
302
  root,
@@ -311,6 +372,45 @@ async function narutoRun(parsed) {
311
372
  narutoRebalancePolicy: rebalancePolicy,
312
373
  json: parsed.json
313
374
  });
375
+ const parallelRuntime = result.parallel_runtime_proof || null;
376
+ const nativeProofOk = result.proof?.ok === true || result.proof?.status === 'passed';
377
+ const finalAccepted = result.proof?.status === 'passed' || result.proof?.gpt_final_status === 'approved';
378
+ const parallelRuntimeOk = !parsed.mock || roster.agent_count < 16 || (parallelRuntime?.passed === true
379
+ && Number(parallelRuntime.max_observed_active_workers || 0) >= Math.min(16, activeSlots));
380
+ await writeJsonAtomic(path.join(mission.dir, 'naruto-gate.json'), {
381
+ schema: 'sks.naruto-gate.v1',
382
+ passed: result.ok === true && nativeProofOk && finalAccepted,
383
+ mission_id: mission.id,
384
+ clone_roster_built: true,
385
+ clone_count: roster.agent_count,
386
+ work_graph_ready: workGraph.ok === true,
387
+ role_distribution_ready: roleDistribution.ok === true,
388
+ allocation_ready: allocationPolicy.ok === true,
389
+ rebalance_ready: rebalancePolicy.ok === true,
390
+ concurrency_governor_ready: true,
391
+ active_pool_simulated: activePool.ok === true,
392
+ verification_dag_ready: true,
393
+ gpt_final_pack_ready: true,
394
+ zellij_dashboard_ready: zellijDashboard.ok === true,
395
+ native_agent_proof: nativeProofOk,
396
+ parallel_runtime_proof: parallelRuntimeOk,
397
+ final_arbiter_accepted: finalAccepted,
398
+ session_cleanup: result.proof?.all_sessions_closed === true || nativeProofOk,
399
+ blockers: [...(result.proof?.blockers || []), ...(parallelRuntimeOk ? [] : ['naruto_parallel_runtime_proof_below_gate'])],
400
+ updated_at: nowIso()
401
+ });
402
+ await setCurrent(root, {
403
+ mission_id: mission.id,
404
+ route: 'Naruto',
405
+ route_command: '$Naruto',
406
+ mode: 'NARUTO',
407
+ phase: result.ok === true ? 'NARUTO_COMPLETE_OR_REVIEW' : 'NARUTO_BLOCKED',
408
+ native_sessions_verified: nativeProofOk,
409
+ subagents_verified: nativeProofOk,
410
+ naruto_gate_file: 'naruto-gate.json',
411
+ stop_gate: 'naruto-gate.json',
412
+ prompt: parsed.prompt
413
+ });
314
414
  const clones = result.roster?.agent_count ?? roster.agent_count;
315
415
  const localWorkerSummary = summarizeNarutoLocalWorkerResult(localWorker, result);
316
416
  const summary = {
@@ -362,6 +462,15 @@ async function narutoRun(parsed) {
362
462
  worker_lifecycle_sample: realActivePoolSmoke.worker_lifecycle.slice(0, 5)
363
463
  }
364
464
  },
465
+ parallel_runtime: parallelRuntime ? {
466
+ proof_path: path.join(result.ledger_root || '', 'parallel-runtime-proof.json'),
467
+ max_observed_active_workers: parallelRuntime.max_observed_active_workers,
468
+ unique_worker_pids: parallelRuntime.unique_worker_pids,
469
+ speedup_ratio: parallelRuntime.speedup_ratio,
470
+ visible_panes: parallelRuntime.visible_panes,
471
+ headless_workers: parallelRuntime.headless_workers,
472
+ passed: parallelRuntime.passed
473
+ } : null,
365
474
  local_worker: localWorkerSummary,
366
475
  proof: result.proof?.status || 'missing',
367
476
  run: compactNarutoRunResult(result),
@@ -375,6 +484,13 @@ async function narutoRun(parsed) {
375
484
  console.log('Backend: ' + result.backend);
376
485
  console.log('Roles: ' + roleDistribution.entries.map((entry) => `${entry.role}:${entry.count}`).join(', '));
377
486
  console.log('Proof: ' + summary.proof);
487
+ if (summary.parallel_runtime) {
488
+ console.log('$Naruto parallel proof:');
489
+ console.log(' max active workers: ' + summary.parallel_runtime.max_observed_active_workers);
490
+ console.log(' unique PIDs: ' + summary.parallel_runtime.unique_worker_pids);
491
+ console.log(' speedup: ' + summary.parallel_runtime.speedup_ratio + 'x');
492
+ console.log(' result: ' + (summary.parallel_runtime.passed ? 'passed' : 'blocked'));
493
+ }
378
494
  if (summary.zellij?.ok && summary.zellij.capability?.status === 'ok')
379
495
  console.log('Zellij: prepared ' + zellijVisiblePanes + ' visible active clone lane(s) in ' + summary.zellij.session_name + '; dashboard tracks ' + Math.max(0, activeSlots - zellijVisiblePanes) + ' headless active worker(s)');
380
496
  else if (summary.zellij?.ok)
@@ -636,9 +752,16 @@ function parseNarutoArgs(args = []) {
636
752
  const noOpenZellij = hasFlag(args, '--no-open-zellij') || hasFlag(args, '--no-zellij');
637
753
  const attach = hasFlag(args, '--attach');
638
754
  const smoke = hasFlag(args, '--smoke');
639
- const valueFlags = new Set(['--clones', '--agents', '--work-items', '--concurrency', '--target-active-slots', '--backend', '--write-mode', '--mission', '--mission-id', '--ollama-model', '--local-model-model', '--ollama-base-url', '--local-model-base-url']);
755
+ const parallelism = normalizeParallelism(readOption(args, '--parallelism', 'extreme'));
756
+ const valueFlags = new Set(['--clones', '--agents', '--work-items', '--concurrency', '--target-active-slots', '--backend', '--write-mode', '--mission', '--mission-id', '--ollama-model', '--local-model-model', '--ollama-base-url', '--local-model-base-url', '--parallelism']);
640
757
  const prompt = positionalArgs(rest, valueFlags).join(' ').trim() || 'Naruto shadow clone swarm run';
641
- return { action, prompt, clones, workItems, concurrency, backend, backendExplicit, mock, real, readonly, ollamaEnabled: useOllama && !noOllama, noOllama, ollamaModel, ollamaBaseUrl, writeMode, json, missionId, noOpenZellij, attach, smoke };
758
+ return { action, prompt, clones, workItems, concurrency, backend, backendExplicit, mock, real, readonly, ollamaEnabled: useOllama && !noOllama, noOllama, ollamaModel, ollamaBaseUrl, writeMode, json, missionId, noOpenZellij, attach, smoke, parallelism };
759
+ }
760
+ function normalizeParallelism(value) {
761
+ const text = String(value || 'extreme').toLowerCase();
762
+ if (text === 'safe' || text === 'balanced' || text === 'extreme')
763
+ return text;
764
+ return 'extreme';
642
765
  }
643
766
  async function writeNarutoArtifacts(ledgerRoot, artifacts) {
644
767
  await writeJsonAtomic(path.join(ledgerRoot, 'naruto-work-graph.json'), artifacts.workGraph);
@@ -277,8 +277,10 @@ async function researchRun(args) {
277
277
  }
278
278
  function printResearchCompletion(id, root, dir, plan, gate) {
279
279
  const metrics = gate?.metrics || {};
280
+ const synthesis = metrics.synthesis || {};
280
281
  const rel = (artifact) => path.relative(root, path.join(dir, artifact));
281
282
  console.log(`Research done: ${id}`);
283
+ console.log(`Synthesis: ${synthesis.writer || 'missing'}`);
282
284
  console.log(`Report: ${rel('research-report.md')}`);
283
285
  console.log(`Paper: ${rel(researchPaperArtifactForPlan(plan))}`);
284
286
  console.log(`Implementation blueprint: ${rel('implementation-blueprint.json')}`);
@@ -286,7 +288,8 @@ function printResearchCompletion(id, root, dir, plan, gate) {
286
288
  console.log(`Experiment plan: ${rel('experiment-plan.json')}`);
287
289
  console.log(`Replication pack: ${rel('replication-pack.json')}`);
288
290
  console.log(`Gate: ${gate?.passed ? 'passed' : 'blocked'}`);
289
- console.log(`Quality: ${metrics.source_entries_total_with_counterevidence ?? metrics.source_entries ?? 0} sources / ${metrics.source_layers_covered ?? 0} layers / ${metrics.key_claims ?? 0} key claims / ${metrics.falsification_cases ?? 0} falsification cases`);
291
+ console.log(`Quality: ${metrics.report_word_count ?? 0} words / ${metrics.source_entries_total_with_counterevidence ?? metrics.source_entries ?? 0} sources / ${metrics.key_claims ?? 0} key claims / repetition ${synthesis.repetition_ratio ?? metrics.report_repetition?.repeated_paragraph_ratio ?? 'n/a'}`);
292
+ console.log(`Final review: static ${metrics.final_review_blockers?.length ? 'block' : 'pass'} / codex ${synthesis.codex_final_review_verdict || 'missing'}`);
290
293
  console.log(`Handoff: ${rel('team-handoff-goal.md')}`);
291
294
  }
292
295
  async function researchStatus(args) {
@@ -320,6 +323,7 @@ async function researchStatus(args) {
320
323
  const experimentPlan = await readExperimentPlan(dir);
321
324
  const replicationPack = await readReplicationPack(dir);
322
325
  const finalReview = await readResearchFinalReview(dir);
326
+ const synthesisOutput = await readJson(path.join(dir, 'research-synthesis-output.json'), null);
323
327
  const blueprintValidation = validateImplementationBlueprint(implementationBlueprint, qualityContract);
324
328
  const experimentValidation = validateExperimentPlan(experimentPlan, qualityContract);
325
329
  const replicationValidation = validateReplicationPack(replicationPack);
@@ -356,6 +360,14 @@ async function researchStatus(args) {
356
360
  research_quality: {
357
361
  contract: qualityContract,
358
362
  report_word_count: gate?.metrics?.report_word_count ?? null,
363
+ synthesis: {
364
+ writer: gate?.metrics?.synthesis?.writer ?? (synthesisOutput ? 'evidence-bound writer artifact present' : null),
365
+ repetition_ratio: gate?.metrics?.synthesis?.repetition_ratio ?? gate?.metrics?.report_repetition?.repeated_paragraph_ratio ?? null,
366
+ source_density_per_1000_words: gate?.metrics?.synthesis?.source_density_per_1000_words ?? gate?.metrics?.source_density_per_1000_words ?? null,
367
+ claim_density_per_1000_words: gate?.metrics?.synthesis?.claim_density_per_1000_words ?? gate?.metrics?.claim_density_per_1000_words ?? null,
368
+ template_phrase_hits: gate?.metrics?.synthesis?.template_phrase_hits ?? gate?.metrics?.template_phrase_hits ?? [],
369
+ codex_final_review_verdict: finalReview?.codex_review?.verdict || null
370
+ },
359
371
  claim_evidence_matrix_present: claimMatrix.present,
360
372
  key_claims: claimMatrix.key_claim_ids.length,
361
373
  triangulated_claims: claimMatrix.triangulated_claim_count,
@@ -1,7 +1,7 @@
1
1
  import path from 'node:path';
2
2
  import { appendJsonlBounded, exists, nowIso, readJson, sksRoot, writeJsonAtomic, writeTextAtomic } from '../fsx.js';
3
3
  import { initProject } from '../init.js';
4
- import { createMission, loadMission, setCurrent } from '../mission.js';
4
+ import { createMission, findLatestMission, loadMission, setCurrent } from '../mission.js';
5
5
  import { buildQuestionSchema, writeQuestions } from '../questions.js';
6
6
  import { CODEX_COMPUTER_USE_ONLY_POLICY, CODEX_WEB_VERIFICATION_POLICY, FROM_CHAT_IMG_CHECKLIST_ARTIFACT, FROM_CHAT_IMG_COVERAGE_ARTIFACT, FROM_CHAT_IMG_QA_LOOP_ARTIFACT, FROM_CHAT_IMG_SOURCE_INVENTORY_ARTIFACT, FROM_CHAT_IMG_TEMP_TRIWIKI_ARTIFACT, FROM_CHAT_IMG_VISUAL_MAP_ARTIFACT, FROM_CHAT_IMG_WORK_ORDER_ARTIFACT, ROUTES, hasFromChatImgSignal, routePrompt, routeReasoning, triwikiContextTracking } from '../routes.js';
7
7
  import { TEAM_DECOMPOSITION_ARTIFACT, TEAM_GRAPH_ARTIFACT, TEAM_INBOX_DIR, TEAM_RUNTIME_TASKS_ARTIFACT, teamRuntimePlanMetadata, teamRuntimeRequiredArtifacts, writeTeamRuntimeArtifacts } from '../team-dag.js';
@@ -18,187 +18,35 @@ import { attachZellijSessionInteractive, launchTeamZellijView } from '../zellij/
18
18
  import { maybeFinalizeRoute } from '../proof/auto-finalize.js';
19
19
  import { runNativeAgentOrchestrator } from '../agents/agent-orchestrator.js';
20
20
  import { ambientGoalContinuation, flag, readBoundedIntegerFlag, readFlagValue } from './command-utils.js';
21
+ import { narutoCommand } from './naruto-command.js';
21
22
  const TEAM_SESSION_CLEANUP_ARTIFACT = 'team-session-cleanup.json';
22
23
  export async function team(args = []) {
23
24
  const teamSubcommands = new Set(['log', 'tail', 'watch', 'lane', 'status', 'dashboard', 'event', 'message', 'open-zellij', 'attach-zellij', 'cleanup-zellij', 'open-tmux', 'attach-tmux', 'cleanup-tmux']);
24
25
  if (teamSubcommands.has(args[0]))
25
26
  return teamCommand(args[0], args.slice(1));
26
- const jsonOutput = flag(args, '--json');
27
- const mock = flag(args, '--mock');
28
- const openZellij = !mock && !jsonOutput && !flag(args, '--no-open-zellij') && !flag(args, '--no-zellij');
29
- const useOllama = flag(args, '--ollama') || flag(args, '--local-model');
30
- const noOllama = flag(args, '--no-ollama') || flag(args, '--no-local-model');
31
- const ollamaModel = readFlagValue(args, '--ollama-model', readFlagValue(args, '--local-model-model', '')) || null;
32
- const ollamaBaseUrl = readFlagValue(args, '--ollama-base-url', readFlagValue(args, '--local-model-base-url', '')) || null;
33
- const cleanCreateArgs = stripTeamCreateControlArgs(args);
34
- const opts = parseTeamCreateArgs(cleanCreateArgs);
35
- const { prompt, agentSessions, roleCounts, roster } = opts;
36
- const targetActiveSlots = readBoundedIntegerFlag(args, '--target-active-slots', roster.bundle_size, 1, 20);
37
- const visualLaneCount = roster.bundle_size;
38
- const desiredWorkItemCount = readBoundedIntegerFlag(args, '--work-items', targetActiveSlots, 1, 200);
39
- const minimumWorkItems = readBoundedIntegerFlag(args, '--minimum-work-items', targetActiveSlots, 1, 200);
40
- const maxQueueExpansion = readBoundedIntegerFlag(args, '--max-queue-expansion', 10, 0, 200);
41
- const profile = readFlagValue(args, '--profile', '') || null;
42
- const writeMode = readFlagValue(args, '--write-mode', flag(args, '--parallel-write') ? 'parallel' : 'off');
43
- const applyPatches = flag(args, '--apply-patches');
44
- const dryRunPatches = flag(args, '--dry-run-patches') || flag(args, '--dryrun-patches');
45
- const maxWriteAgents = readBoundedIntegerFlag(args, '--max-write-agents', Math.min(roster.bundle_size, 5), 1, 20);
46
- if (!prompt) {
47
- console.error('Usage: sks team "task" [20:agents] [executor:5 reviewer:6 user:1] [--agents N] [--work-items N] [--target-active-slots N] [--profile NAME] [--write-mode off|proof-safe|parallel|serial] [--apply-patches] [--ollama|--no-ollama] [--no-open-zellij] [--json] [--mock]');
48
- process.exitCode = 1;
49
- return;
50
- }
27
+ return redirectTeamCreateToNaruto(args);
28
+ }
29
+ async function redirectTeamCreateToNaruto(args = []) {
51
30
  const root = await sksRoot();
52
- if (!(await exists(path.join(root, '.sneakoscope'))))
53
- await initProject(root, {});
54
- const { id, dir } = await createMission(root, { mode: 'team', prompt });
55
- const schema = buildQuestionSchema(prompt);
56
- await writeQuestions(dir, schema);
57
- const plan = buildTeamPlan(id, prompt, { agentSessions, roleCounts, roster, targetActiveSlots });
58
- await writeJsonAtomic(path.join(dir, 'team-plan.json'), plan);
59
- await writeJsonAtomic(path.join(dir, SSOT_GUARD_ARTIFACT), plan.ssot_guard);
60
- await writeTextAtomic(path.join(dir, 'team-workflow.md'), teamWorkflowMarkdown(plan));
61
- const liveFiles = await initTeamLive(id, dir, prompt, { agentSessions, roleCounts, roster });
62
- await writeJsonAtomic(path.join(dir, 'team-roster.json'), { schema_version: 1, mission_id: id, role_counts: roleCounts, agent_sessions: agentSessions, bundle_size: roster.bundle_size, roster, confirmed: true, source: 'default_or_prompt_team_spec' });
63
- const fromChatImgRequired = hasFromChatImgSignal(prompt);
64
- const teamReasoning = teamReasoningPolicy(prompt, roster);
65
- const promptEffort = teamReasoning.prompt_policy?.effort || 'medium';
66
- const runtime = await writeTeamRuntimeArtifacts(dir, plan, {});
67
- const effortDecision = await writeEffortDecision(dir, {
68
- mission_id: id,
69
- task_id: 'TEAM-INTAKE',
70
- route: fromChatImgRequired ? 'from-chat-img' : 'team',
71
- prompt,
72
- tool_use: promptEffort === 'medium',
73
- multi_step_decision: promptEffort !== 'low',
74
- spans_many_files: promptEffort === 'high' || promptEffort === 'xhigh',
75
- is_deterministic: promptEffort === 'low',
76
- has_verified_skill: true,
77
- high_risk: promptEffort === 'high' || promptEffort === 'xhigh',
78
- risk_scores: {
79
- security: /security|auth|permission|database|supabase|sql|보안|권한|데이터베이스/i.test(prompt) ? 0.8 : 0.1,
80
- destructive_action: /delete|drop|reset|remove|삭제|초기화/i.test(prompt) ? 0.8 : 0.1,
81
- user_impact: /release|publish|deploy|commit|push|production|배포|커밋|푸쉬|운영/i.test(prompt) ? 0.8 : 0.3
82
- }
83
- });
84
- const workOrder = createWorkOrderLedger({ missionId: id, route: fromChatImgRequired ? 'from-chat-img' : 'team', sourcesComplete: !fromChatImgRequired, requests: [{ verbatim: prompt, normalized_requirement: prompt, implementation_tasks: ['TASK-001'], status: 'pending' }] });
85
- await writeWorkOrderLedger(dir, workOrder);
86
- if (fromChatImgRequired)
87
- await writeFromChatImgArtifacts(dir, { missionId: id, requests: [{ verbatim: prompt }], ambiguities: ['image source inventory must be completed before implementation'] });
88
- let liveZellij = null;
89
- if (!mock && openZellij) {
90
- liveZellij = await launchTeamZellijView({ root, missionId: id, ledgerRoot: path.join(dir, 'agents'), slotCount: visualLaneCount, dryRun: false, attach: false });
91
- if (liveZellij?.ok && liveZellij.capability?.status === 'ok')
92
- console.log(`Zellij: prepared ${visualLaneCount} native agent lane(s) in ${liveZellij.session_name}. Attach with: ${liveZellij.attach_command_with_env || liveZellij.attach_command}`);
93
- else if (liveZellij?.ok)
94
- console.log(`Zellij: optional live panes unavailable (${(liveZellij.warnings || []).join('; ') || liveZellij.capability?.status || 'unknown'}).`);
95
- else
96
- console.log(`Zellij: blocked (${Array.from(new Set(liveZellij?.blockers || [])).join('; ')})`);
97
- }
98
- const nativeAgentRun = await runNativeAgentOrchestrator({
99
- root,
100
- missionId: id,
101
- route: '$Team',
102
- prompt,
103
- backend: mock ? 'fake' : 'codex-sdk',
104
- mock,
105
- agents: roster.bundle_size,
106
- targetActiveSlots,
107
- visualLaneCount,
108
- desiredWorkItemCount,
109
- minimumWorkItems,
110
- maxQueueExpansion,
111
- concurrency: Math.min(agentSessions, roster.bundle_size),
112
- readonly: !applyPatches && writeMode === 'off',
113
- profile,
114
- writeMode: writeMode,
115
- applyPatches,
116
- dryRunPatches,
117
- maxWriteAgents,
118
- ollamaEnabled: useOllama && !noOllama,
119
- noOllama,
120
- ollamaModel,
121
- ollamaBaseUrl,
122
- routeCommand: 'sks team',
123
- routeBlackboxKind: 'actual_team_command'
124
- });
125
- await appendTeamEvent(dir, {
126
- agent: 'native_agent_orchestrator',
127
- phase: 'native_agent_intake',
128
- type: nativeAgentRun.ok ? 'complete' : 'blocked',
129
- artifact: 'agents/agent-proof-evidence.json',
130
- message: 'Native agent orchestrator completed with ' + nativeAgentRun.backend + ' backend; proof ' + (nativeAgentRun.proof?.status || 'unknown') + '.'
131
- });
132
- let dashboardState = await writeTeamDashboardState(dir, { missionId: id, mission: { id, mode: 'team' }, effort: effortDecision.selected_effort, phase: 'intake', next_action: fromChatImgRequired ? 'complete visual source inventory and work-order mapping' : 'run Team native agent intake agents' });
133
- await writeJsonAtomic(path.join(dir, 'team-gate.json'), { passed: false, team_roster_confirmed: true, native_agent_proof: nativeAgentRun.proof?.ok === true, agent_central_ledger: true, analysis_artifact: false, triwiki_refreshed: false, triwiki_validated: false, ssot_guard: false, consensus_artifact: false, ...runtime.gate_fields, implementation_team_fresh: false, review_artifact: false, integration_evidence: false, session_cleanup: false, context7_evidence: false, ...(fromChatImgRequired ? { from_chat_img_required: true, from_chat_img_request_coverage: false } : {}) });
134
- dashboardState = await writeTeamDashboardState(dir, { missionId: id, mission: { id, mode: 'team' }, effort: effortDecision.selected_effort, phase: 'intake', next_action: fromChatImgRequired ? 'complete visual source inventory and work-order mapping' : 'run Team native agent intake agents' });
135
- const route = routePrompt(`$Team ${prompt}`) || ROUTES.find((candidate) => candidate.id === 'Team');
136
- const routeReason = routeReasoning(route, prompt);
137
- const pipelinePlan = await writePipelinePlan(dir, { missionId: id, route, task: prompt, required: false, ambiguity: { required: false, status: 'team_cli_direct' } });
138
- await setCurrent(root, { mission_id: id, route: 'Team', route_command: '$Team', mode: 'TEAM', phase: mock ? 'TEAM_FIXTURE_DONE' : 'TEAM_NATIVE_AGENT_INTAKE', questions_allowed: false, implementation_allowed: true, context7_required: false, context7_verified: mock, subagents_required: false, subagents_verified: true, native_sessions_required: true, native_sessions_verified: nativeAgentRun.proof?.ok === true, reflection_required: true, visible_progress_required: true, context_tracking: 'triwiki', required_skills: route?.requiredSkills || ['team'], stop_gate: 'team-gate.json', reasoning_effort: routeReason.effort, reasoning_profile: routeReason.profile, reasoning_temporary: true, team_agent_reasoning_policy: teamReasoning, goal_continuation: pipelinePlan.goal_continuation, agent_sessions: agentSessions, target_active_slots: targetActiveSlots, role_counts: roleCounts, team_roster_confirmed: true, team_graph_ready: runtime.ok, team_live_ready: true, from_chat_img_required: fromChatImgRequired, pipeline_plan_ready: validatePipelinePlan(pipelinePlan).ok, pipeline_plan_path: PIPELINE_PLAN_ARTIFACT, native_agent_backend: nativeAgentRun.backend, native_agent_proof: 'agents/agent-proof-evidence.json', prompt });
139
- const result = {
140
- mission_id: id,
141
- mission_dir: dir,
142
- plan: path.join(dir, 'team-plan.json'),
143
- workflow: path.join(dir, 'team-workflow.md'),
144
- team_graph: path.join(dir, TEAM_GRAPH_ARTIFACT),
145
- runtime_tasks: path.join(dir, TEAM_RUNTIME_TASKS_ARTIFACT),
146
- decomposition_report: path.join(dir, TEAM_DECOMPOSITION_ARTIFACT),
147
- worker_inbox_dir: path.join(dir, TEAM_INBOX_DIR),
148
- live: liveFiles.live,
149
- transcript: liveFiles.transcript,
150
- dashboard: liveFiles.dashboard,
151
- dashboard_state: path.join(dir, ARTIFACT_FILES.team_dashboard_state),
152
- effort_decision: path.join(dir, ARTIFACT_FILES.effort_decision),
153
- work_order_ledger: path.join(dir, ARTIFACT_FILES.work_order_ledger),
154
- pipeline_plan: path.join(dir, PIPELINE_PLAN_ARTIFACT),
155
- dashboard_state_valid: dashboardState.ok,
156
- context_pack: path.join(root, '.sneakoscope', 'wiki', 'context-pack.json'),
157
- agent_sessions: agentSessions,
158
- bundle_size: roster.bundle_size,
159
- target_active_slots: targetActiveSlots,
160
- visual_lane_count: visualLaneCount,
161
- desired_work_items: desiredWorkItemCount,
162
- minimum_work_items: minimumWorkItems,
163
- max_queue_expansion: maxQueueExpansion,
164
- role_counts: roleCounts,
165
- questions: path.join(dir, 'questions.md'),
166
- native_agent_run: nativeAgentRun,
167
- codex_agents: ['native_agent_orchestrator', 'agent_central_ledger', 'agent_proof_evidence', 'agent_review_lane', 'agent_integration_lane']
168
- };
169
- if (mock) {
170
- await writeTextAtomic(path.join(dir, 'team-analysis.md'), `# Team Native Agent Analysis\n\nMock Team fixture completed native agent intake for ${id}.\n`);
171
- await writeTextAtomic(path.join(dir, 'team-consensus.md'), `# Team Consensus\n\nMock Team fixture consensus reached for ${id}.\n`);
172
- await writeTextAtomic(path.join(dir, 'team-review.md'), `# Team Review\n\nMock Team fixture review completed with ${MIN_TEAM_REVIEWER_LANES} validation lanes for ${id}.\n`);
173
- await writeTextAtomic(path.join(dir, 'context7-evidence.jsonl'), `${JSON.stringify({ schema: 'sks.context7-evidence.v1', mission_id: id, route: '$Team', status: 'mock_not_required', generated_at: nowIso() })}\n`);
174
- const cleanup = { schema_version: 1, mission_id: id, status: 'clean', passed: true, all_sessions_closed: true, outstanding_sessions: 0, live_transcript_finalized: true, mock: true, generated_at: nowIso() };
175
- await writeJsonAtomic(path.join(dir, TEAM_SESSION_CLEANUP_ARTIFACT), cleanup);
176
- const gate = { passed: true, team_roster_confirmed: true, native_agent_proof: nativeAgentRun.proof?.ok === true, agent_central_ledger: true, analysis_artifact: true, triwiki_refreshed: true, triwiki_validated: true, ssot_guard: true, consensus_artifact: true, ...runtime.gate_fields, implementation_team_fresh: true, review_artifact: true, review_lanes: MIN_TEAM_REVIEWER_LANES, integration_evidence: true, session_cleanup: true, context7_evidence: true, mock: true };
177
- await writeJsonAtomic(path.join(dir, 'team-gate.json'), gate);
178
- const proof = await maybeFinalizeRoute(root, { missionId: id, route: '$Team', gateFile: 'team-gate.json', gate, mock: true, statusHint: 'verified_partial', artifacts: ['agents/agent-proof-evidence.json', SSOT_GUARD_ARTIFACT, 'team-gate.json', TEAM_SESSION_CLEANUP_ARTIFACT, 'team-plan.json', 'team-runtime-tasks.json', 'completion-proof.json'], claims: [{ id: 'team-fixture-complete', status: 'verified_partial' }], command: { cmd: `sks team "${prompt}" --mock`, status: 0 } });
179
- result.mock = true;
180
- result.proof = proof.validation;
181
- }
182
- else {
183
- result.zellij = liveZellij || await launchTeamZellijView({ root, missionId: id, ledgerRoot: path.join(dir, 'agents'), slotCount: visualLaneCount, dryRun: jsonOutput || !openZellij, attach: false });
184
- if (openZellij && result.zellij?.ok && result.zellij.capability?.status === 'ok' && shouldAutoAttachTeamZellij(args)) {
185
- attachZellijSessionInteractive(result.zellij.session_name, { cwd: root, configPath: result.zellij.clipboard_config_path });
186
- }
31
+ const list = (args || []).map((arg) => String(arg));
32
+ const narutoArgs = list[0] === 'run' ? list : ['run', ...list];
33
+ console.warn('SKS Team is deprecated for new execution missions; redirecting to $Naruto.');
34
+ const result = await narutoCommand(narutoArgs);
35
+ const missionId = result?.mission_id || await findLatestMission(root);
36
+ if (missionId) {
37
+ await writeJsonAtomic(path.join(root, '.sneakoscope', 'missions', missionId, 'team-alias-to-naruto.json'), {
38
+ schema: 'sks.team-alias-to-naruto.v1',
39
+ ok: true,
40
+ mission_id: missionId,
41
+ source_command: 'sks team',
42
+ redirected_to: 'sks naruto run',
43
+ route_command: '$Naruto',
44
+ deprecated_route: '$Team',
45
+ created_at: nowIso(),
46
+ args: list
47
+ });
187
48
  }
188
- if (jsonOutput)
189
- return console.log(JSON.stringify(result, null, 2));
190
- console.log(`Team mission created: ${id}`);
191
- console.log(`Agent sessions: ${agentSessions}`);
192
- console.log(`Role counts: ${formatRoleCounts(roleCounts)}`);
193
- console.log(`Review policy: minimum ${MIN_TEAM_REVIEWER_LANES} reviewer/QA validation lanes`);
194
- if (result.zellij?.ok && result.zellij.capability?.status === 'ok')
195
- console.log(`Zellij: prepared ${visualLaneCount} native agent lane(s) in ${result.zellij.session_name}`);
196
- else if (result.zellij?.ok)
197
- console.log(`Zellij: optional live panes unavailable (${(result.zellij.warnings || []).join('; ') || result.zellij.capability?.status || 'unknown'})`);
198
- else if (!mock)
199
- console.log(`Zellij: blocked (${Array.from(new Set(result.zellij?.blockers || [])).join('; ')})`);
200
- console.log(`Watch: sks team watch ${id}`);
201
- console.log(`Artifacts: .sneakoscope/missions/${id}`);
49
+ return result;
202
50
  }
203
51
  export function parseTeamCreateArgs(args) {
204
52
  const spec = parseTeamSpecArgs(args);
@@ -1,7 +1,10 @@
1
1
  import path from 'node:path';
2
- import { exists, readJson, writeJsonAtomic, readText, nowIso, appendJsonlBounded } from './fsx.js';
2
+ import { exists, readJson, writeJsonAtomic, readText, nowIso, appendJsonlBounded, sha256 } from './fsx.js';
3
3
  import { missionDir, setCurrent } from './mission.js';
4
4
  import { evaluateMadSksPermissionGate, isMadSksRouteState } from './permission-gates.js';
5
+ import { resolveMadDbMutationPolicy } from './mad-db/mad-db-policy-resolver.js';
6
+ import { recordMadDbOperation } from './mad-db/mad-db-capability.js';
7
+ import { appendMadDbLedgerEvent, appendMadDbOperationLifecycle } from './mad-db/mad-db-ledger.js';
5
8
  export const DEFAULT_DB_SAFETY_POLICY = Object.freeze({
6
9
  schema_version: 1,
7
10
  mode: 'read_only_default',
@@ -504,6 +507,57 @@ export async function checkDbOperation(root, state, payload, { duringNoQuestion
504
507
  const policy = await loadDbSafetyPolicy(root);
505
508
  const contract = await loadMissionContract(root, state);
506
509
  const classification = classifyToolPayload(payload);
510
+ const madDb = await resolveMadDbMutationPolicy(root, state, classification);
511
+ if (madDb.allowed === true && state?.mission_id) {
512
+ const madDbDecision = madDb;
513
+ const operationId = `mad-db-op-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
514
+ const sqlHash = classification.sql?.statements?.length ? sha256(String(classification.sql.statements.join('\n'))) : null;
515
+ await appendMadDbOperationLifecycle(root, state.mission_id, {
516
+ type: 'db_operation.started',
517
+ operationId,
518
+ cycleId: madDbDecision.cycle_id,
519
+ toolName: classification.toolName || null,
520
+ sqlHash,
521
+ destructive: classification.level === 'destructive'
522
+ });
523
+ const decision = {
524
+ allowed: true,
525
+ action: 'allow',
526
+ reasons: madDb.reasons,
527
+ classification,
528
+ effective: { mode: 'mad-db-break-glass', env: 'operator_authorized_one_cycle', destructive: true, migrationApply: 'yes' },
529
+ mad_db: {
530
+ active: true,
531
+ priority: 'highest',
532
+ one_cycle_only: true,
533
+ cycle_id: madDbDecision.cycle_id,
534
+ capability_file: 'mad-db-capability.json',
535
+ consumed: false,
536
+ operation_id: operationId,
537
+ operation_count: Number(madDbDecision.operation_count || 0) + 1,
538
+ max_operations: madDbDecision.max_operations || 20
539
+ }
540
+ };
541
+ await appendMadDbLedgerEvent(root, state.mission_id, { type: 'db_mutation.allowed', cycle_id: madDbDecision.cycle_id, mode: madDbDecision.mode, classification, operation_id: operationId });
542
+ await appendMadDbOperationLifecycle(root, state.mission_id, {
543
+ type: 'db_operation.allowed',
544
+ operationId,
545
+ cycleId: madDbDecision.cycle_id,
546
+ toolName: classification.toolName || null,
547
+ sqlHash,
548
+ destructive: classification.level === 'destructive',
549
+ resultStatus: 'unknown_pending_tool_result'
550
+ });
551
+ const updatedCapability = await recordMadDbOperation(root, state.mission_id, {
552
+ operationId,
553
+ ...(classification.toolName ? { toolName: classification.toolName } : {}),
554
+ ...(sqlHash ? { sqlHash } : {})
555
+ });
556
+ decision.mad_db.consumed = updatedCapability?.consumed === true;
557
+ decision.mad_db.operation_count = updatedCapability?.operation_count ?? decision.mad_db.operation_count;
558
+ await appendJsonlBounded(path.join(missionDir(root, state.mission_id), 'db-safety.jsonl'), { ts: nowIso(), decision });
559
+ return decision;
560
+ }
507
561
  const madSks = await madSksOverrideState(root, state);
508
562
  const decision = evaluateDbSafety({ classification, policy, contract, duringNoQuestion, madSks });
509
563
  if (decision.action === 'confirm')
package/dist/core/fsx.js CHANGED
@@ -5,7 +5,7 @@ import os from 'node:os';
5
5
  import crypto from 'node:crypto';
6
6
  import { spawn } from 'node:child_process';
7
7
  import { fileURLToPath } from 'node:url';
8
- export const PACKAGE_VERSION = '2.0.14';
8
+ export const PACKAGE_VERSION = '2.0.16';
9
9
  export const DEFAULT_PROCESS_TAIL_BYTES = 256 * 1024;
10
10
  export const DEFAULT_PROCESS_TIMEOUT_MS = 30 * 60 * 1000;
11
11
  export function nowIso() {
@@ -4,6 +4,7 @@ import { gitBlocker, runGitCommand } from './git-worktree-runner.js';
4
4
  import { resolveGitWorktreeRoot } from './git-worktree-root.js';
5
5
  export async function evaluateGitWorktreeCapability(input = {}) {
6
6
  const requireGitWorktree = input.requireGitWorktree === true || process.env.SKS_REQUIRE_GIT_WORKTREE === '1';
7
+ const disabledByEnv = process.env.SKS_DISABLE_GIT_WORKTREE === '1';
7
8
  const detection = await detectGitRepo(input.root || process.cwd());
8
9
  const blockers = [...detection.blockers];
9
10
  const gitAvailable = Boolean(detection.git_binary);
@@ -24,6 +25,23 @@ export async function evaluateGitWorktreeCapability(input = {}) {
24
25
  blockers
25
26
  };
26
27
  }
28
+ if (disabledByEnv) {
29
+ if (requireGitWorktree)
30
+ blockers.push('git_worktree_disabled_by_env');
31
+ return {
32
+ schema: 'sks.git-worktree-capability.v1',
33
+ ok: blockers.length === 0,
34
+ mode: 'patch-envelope-only',
35
+ require_git_worktree: requireGitWorktree,
36
+ git_available: gitAvailable,
37
+ is_git_repo: true,
38
+ worktree_supported: false,
39
+ worktree_probe_attempted: false,
40
+ detection,
41
+ root_resolution: null,
42
+ blockers: [...new Set(blockers)]
43
+ };
44
+ }
27
45
  const rootResolution = resolveGitWorktreeRoot({
28
46
  repoRoot: detection.root,
29
47
  missionId: input.missionId || 'capability'