sneakoscope 6.0.3 → 6.1.2

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 (378) hide show
  1. package/README.md +29 -12
  2. package/config/codex-releases/{rust-v0.142.0.json → rust-v0.144.1.json} +6 -6
  3. package/crates/sks-core/Cargo.lock +1 -1
  4. package/crates/sks-core/Cargo.toml +1 -1
  5. package/dist/bin/fast-inline.js +18 -14
  6. package/dist/bin/sks-dispatch.js +2 -4
  7. package/dist/cli/args.js +2 -0
  8. package/dist/cli/command-manifest-lite.js +2 -3
  9. package/dist/cli/command-registry.js +3 -4
  10. package/dist/cli/help-fast.js +1 -1
  11. package/dist/cli/install-helpers.js +348 -763
  12. package/dist/cli/install-tool-helpers.js +287 -0
  13. package/dist/cli/router.js +91 -6
  14. package/dist/commands/codex-lb.js +188 -53
  15. package/dist/commands/codex.js +44 -5
  16. package/dist/commands/doctor.js +302 -46
  17. package/dist/commands/tmux.js +5 -1
  18. package/dist/commands/versioning.js +7 -0
  19. package/dist/commands/zellij-monitor-pane.js +2 -0
  20. package/dist/commands/zellij-viewport-pane.js +3 -1
  21. package/dist/commands/zellij.js +1 -1
  22. package/dist/config/skills-manifest.json +59 -59
  23. package/dist/core/agent-bridge/agent-manifest.js +48 -0
  24. package/dist/core/agents/agent-central-ledger.js +9 -0
  25. package/dist/core/agents/agent-cleanup-executor.js +334 -41
  26. package/dist/core/agents/agent-cleanup.js +20 -1
  27. package/dist/core/agents/agent-command-surface.js +3 -1
  28. package/dist/core/agents/agent-effort-policy.js +30 -38
  29. package/dist/core/agents/agent-janitor.js +9 -10
  30. package/dist/core/agents/agent-namespace-safety.js +56 -0
  31. package/dist/core/agents/agent-orchestrator.js +25 -3
  32. package/dist/core/agents/agent-output-validator.js +1 -1
  33. package/dist/core/agents/agent-plan.js +100 -21
  34. package/dist/core/agents/agent-role-config.js +43 -49
  35. package/dist/core/agents/agent-runner-codex-exec.js +18 -3
  36. package/dist/core/agents/agent-runner-process.js +1 -0
  37. package/dist/core/agents/agent-schema.js +3 -2
  38. package/dist/core/agents/fast-mode-policy.js +3 -5
  39. package/dist/core/agents/native-cli-session-swarm.js +1 -1
  40. package/dist/core/agents/native-worker-backend-router.js +2 -1
  41. package/dist/core/agents/work-partition/repo-inventory.js +68 -7
  42. package/dist/core/agents/zellij-right-lane-cockpit.js +2 -2
  43. package/dist/core/code-structure.js +5 -4
  44. package/dist/core/codex/agent-config-file-repair.js +94 -193
  45. package/dist/core/codex/codex-cli-update.js +723 -0
  46. package/dist/core/codex/codex-config-guard.js +38 -11
  47. package/dist/core/codex/codex-project-config-policy.js +3 -6
  48. package/dist/core/codex/codex-startup-config-postcheck.js +52 -42
  49. package/dist/core/codex-adapter.js +35 -22
  50. package/dist/core/codex-app/codex-agent-role-sync.js +13 -54
  51. package/dist/core/codex-app/codex-app-fast-ui-repair.js +51 -20
  52. package/dist/core/codex-app/codex-app-launcher.js +48 -17
  53. package/dist/core/codex-app/codex-app-restart.js +23 -2
  54. package/dist/core/codex-app/codex-app-ui-state-snapshot.js +11 -3
  55. package/dist/core/codex-app/sks-menubar.js +136 -5
  56. package/dist/core/codex-app.js +35 -14
  57. package/dist/core/codex-compat/codex-hook-warning-detector.js +10 -1
  58. package/dist/core/codex-compat/codex-release-manifest.js +6 -6
  59. package/dist/core/codex-control/codex-0139-doctor-real-probe.js +7 -1
  60. package/dist/core/codex-control/codex-0139-image-path-real-probe.js +29 -12
  61. package/dist/core/codex-control/codex-0139-probe-runner.js +103 -28
  62. package/dist/core/codex-control/codex-0139-real-probe-summary.js +7 -3
  63. package/dist/core/codex-control/codex-0139-real-probes.js +21 -6
  64. package/dist/core/codex-control/codex-0139-sandbox-real-probe.js +39 -13
  65. package/dist/core/codex-control/codex-0139-web-search-probe.js +28 -14
  66. package/dist/core/codex-control/{codex-0142-capability.js → codex-0144-capability.js} +22 -22
  67. package/dist/core/codex-control/codex-0144-collab-agent-real-probe.js +63 -0
  68. package/dist/core/codex-control/codex-lb-launch-recovery.js +278 -0
  69. package/dist/core/codex-control/codex-multi-agent-event-normalizer.js +5 -1
  70. package/dist/core/codex-control/codex-reliability-shield.js +93 -30
  71. package/dist/core/codex-control/codex-sdk-adapter.js +96 -13
  72. package/dist/core/codex-control/codex-sdk-config-policy.js +2 -1
  73. package/dist/core/codex-control/codex-sdk-sandbox-policy.js +6 -3
  74. package/dist/core/codex-control/codex-task-runner.js +62 -9
  75. package/dist/core/codex-control/python-codex-sdk-adapter.js +30 -3
  76. package/dist/core/codex-exec-output-schema.js +35 -6
  77. package/dist/core/codex-lb/codex-lb-env.js +30 -1
  78. package/dist/core/codex-lb/codex-lb-tool-catalog.js +478 -0
  79. package/dist/core/codex-lb/codex-lb-tool-output-recovery.js +291 -0
  80. package/dist/core/codex-native/codex-native-feature-broker.js +31 -38
  81. package/dist/core/codex-native/codex-native-feature-matrix.js +2 -2
  82. package/dist/core/codex-native/codex-native-repair-transaction.js +1 -1
  83. package/dist/core/codex-native/core-skill-manifest.js +8 -4
  84. package/dist/core/codex-native/native-capability-postcheck.js +16 -8
  85. package/dist/core/codex-native/native-capability-repair-matrix.js +76 -27
  86. package/dist/core/codex-plugins/codex-plugin-json.js +67 -21
  87. package/dist/core/codex-plugins/codex-plugin-repair.js +118 -0
  88. package/dist/core/codex-runtime/codex-desktop-config-policy.js +305 -0
  89. package/dist/core/commands/agent-bridge-command.js +23 -2
  90. package/dist/core/commands/agent-command.js +38 -5
  91. package/dist/core/commands/basic-cli.js +77 -30
  92. package/dist/core/commands/command-utils.js +1 -1
  93. package/dist/core/commands/gc-command.js +27 -4
  94. package/dist/core/commands/image-ux-review-command.js +55 -24
  95. package/dist/core/commands/mad-sks-command.js +182 -137
  96. package/dist/core/commands/naruto-command.js +643 -1153
  97. package/dist/core/commands/pipeline-command.js +1 -0
  98. package/dist/core/commands/research-command.js +293 -231
  99. package/dist/core/commands/run-command.js +100 -23
  100. package/dist/core/commands/team-command.js +2 -3
  101. package/dist/core/commands/team-legacy-observe-command.js +94 -359
  102. package/dist/core/commands/wiki-command.js +179 -83
  103. package/dist/core/computer-use-live-evidence.js +166 -3
  104. package/dist/core/computer-use-status.js +5 -2
  105. package/dist/core/daemon/sksd-hook-daemon-entrypoint.js +2 -2
  106. package/dist/core/daemon/sksd-hook-daemon.js +171 -28
  107. package/dist/core/daemon/sksd-hook-dispatch.js +2 -2
  108. package/dist/core/db-safety.js +2 -2
  109. package/dist/core/decision-lattice.js +6 -6
  110. package/dist/core/dfix/verification-selector.js +6 -4
  111. package/dist/core/doctor/browser-use-repair.js +54 -13
  112. package/dist/core/doctor/codex-0139-doctor.js +3 -2
  113. package/dist/core/doctor/codex-startup-config-repair.js +8 -3
  114. package/dist/core/doctor/computer-use-repair.js +28 -39
  115. package/dist/core/doctor/doctor-codex-startup-repair.js +24 -149
  116. package/dist/core/doctor/doctor-context7-repair.js +1 -1
  117. package/dist/core/doctor/doctor-dirty-planner.js +1 -1
  118. package/dist/core/doctor/doctor-native-capability-repair.js +74 -3
  119. package/dist/core/doctor/imagegen-repair.js +47 -12
  120. package/dist/core/doctor/legacy-global-hook-cleanup.js +179 -0
  121. package/dist/core/feature-fixture-executor.js +71 -7
  122. package/dist/core/feature-fixture-runner.js +53 -12
  123. package/dist/core/feature-fixtures.js +47 -14
  124. package/dist/core/feature-registry.js +53 -58
  125. package/dist/core/fsx.js +54 -6
  126. package/dist/core/harness-conflicts.js +19 -10
  127. package/dist/core/hooks-runtime/code-pack-freshness-preflight.js +5 -4
  128. package/dist/core/hooks-runtime/hook-invocation-dedupe.js +147 -0
  129. package/dist/core/hooks-runtime/hook-io.js +14 -4
  130. package/dist/core/hooks-runtime/light-turn.js +70 -0
  131. package/dist/core/hooks-runtime/payload-signals.js +270 -0
  132. package/dist/core/hooks-runtime/team-digest.js +0 -1
  133. package/dist/core/hooks-runtime/tool-output-quarantine.js +93 -0
  134. package/dist/core/hooks-runtime.js +418 -250
  135. package/dist/core/image/image-artifact-path-contract.js +8 -6
  136. package/dist/core/image/image-artifact-registry.js +5 -1
  137. package/dist/core/image-ux-review/imagegen-adapter.js +5 -2
  138. package/dist/core/imagegen/imagegen-capability.js +10 -13
  139. package/dist/core/imagegen/require-imagegen.js +37 -11
  140. package/dist/core/init/skills.js +16 -30
  141. package/dist/core/init.js +144 -36
  142. package/dist/core/managed-assets/managed-assets-manifest.js +417 -14
  143. package/dist/core/mission.js +24 -1
  144. package/dist/core/naruto/naruto-work-graph.js +70 -4
  145. package/dist/core/ops/reporting.js +3 -0
  146. package/dist/core/pipeline-internals/runtime-core.js +578 -180
  147. package/dist/core/pipeline-internals/runtime-gates.js +191 -49
  148. package/dist/core/ppt/style-tokens.js +1 -1
  149. package/dist/core/ppt-review/index.js +1 -1
  150. package/dist/core/ppt-review/slide-exporter.js +23 -17
  151. package/dist/core/ppt-review/slide-imagegen-review.js +1 -1
  152. package/dist/core/ppt-review/slide-issue-extraction.js +4 -2
  153. package/dist/core/preflight/parallel-preflight-engine.js +50 -1
  154. package/dist/core/product-design-plugin.js +2 -2
  155. package/dist/core/proof/route-finalizer.js +1 -1
  156. package/dist/core/proof/route-proof-gate.js +7 -2
  157. package/dist/core/proof-field.js +3 -3
  158. package/dist/core/provider/model-router.js +38 -32
  159. package/dist/core/recallpulse/policy.js +12 -28
  160. package/dist/core/recallpulse.js +11 -6
  161. package/dist/core/release/gate-manifest.js +18 -12
  162. package/dist/core/release/gate-pack-manifest.js +1 -1
  163. package/dist/core/release/npm-pack-proof.js +247 -0
  164. package/dist/core/release/package-dist-snapshot.js +151 -0
  165. package/dist/core/release/package-size-budget.js +5 -0
  166. package/dist/core/release/release-authorization-snapshot.js +115 -0
  167. package/dist/core/release/release-gate-affected-selector.js +15 -3
  168. package/dist/core/release/release-gate-cache-v2.js +30 -0
  169. package/dist/core/release/release-gate-contract.js +161 -0
  170. package/dist/core/release/release-gate-dag.js +44 -3
  171. package/dist/core/release/release-gate-hermetic-env.js +28 -17
  172. package/dist/core/release/release-real-contract.js +496 -0
  173. package/dist/core/release-parallel-full-coverage.js +31 -143
  174. package/dist/core/research/claim-evidence-matrix.js +41 -6
  175. package/dist/core/research/experiment-plan.js +14 -10
  176. package/dist/core/research/falsification.js +9 -2
  177. package/dist/core/research/implementation-blueprint-densifier.js +82 -60
  178. package/dist/core/research/implementation-blueprint.js +32 -26
  179. package/dist/core/research/mock-result.js +122 -11
  180. package/dist/core/research/replication-pack.js +15 -8
  181. package/dist/core/research/research-adversarial-review.js +1068 -0
  182. package/dist/core/research/research-claim-builder.js +69 -17
  183. package/dist/core/research/research-claim-synthesizer.js +343 -0
  184. package/dist/core/research/research-cycle-runner.js +53 -3
  185. package/dist/core/research/research-falsification-runner.js +176 -0
  186. package/dist/core/research/research-final-reviewer.js +44 -125
  187. package/dist/core/research/research-realistic-report.js +14 -6
  188. package/dist/core/research/research-review-artifact-digest.js +66 -0
  189. package/dist/core/research/research-source-evidence.js +144 -0
  190. package/dist/core/research/research-source-layer-catalog.js +68 -0
  191. package/dist/core/research/research-source-ledger-merge.js +250 -12
  192. package/dist/core/research/research-source-shards.js +26 -70
  193. package/dist/core/research/research-stage-runner.js +237 -247
  194. package/dist/core/research/research-super-search.js +184 -0
  195. package/dist/core/research/research-synthesis-prompt.js +20 -1
  196. package/dist/core/research/research-synthesis-writer.js +86 -5
  197. package/dist/core/research/research-work-graph.js +25 -18
  198. package/dist/core/research/source-quality-report.js +21 -0
  199. package/dist/core/research.js +429 -280
  200. package/dist/core/retention/retention-budget.js +25 -6
  201. package/dist/core/retention.js +980 -101
  202. package/dist/core/routes/constants.js +1 -1
  203. package/dist/core/routes/dollar-manifest-lite.js +11 -11
  204. package/dist/core/routes/evidence.js +4 -4
  205. package/dist/core/routes/ppt-policy.js +1 -1
  206. package/dist/core/routes.js +92 -64
  207. package/dist/core/runtime/task-profile.js +66 -0
  208. package/dist/core/runtime/verification-budget.js +12 -0
  209. package/dist/core/secret-redaction.js +4 -0
  210. package/dist/core/security/high-risk-contracts.js +6 -6
  211. package/dist/core/stop-gate/stop-gate-check.js +49 -12
  212. package/dist/core/subagents/agent-catalog.js +215 -0
  213. package/dist/core/subagents/model-policy.js +118 -0
  214. package/dist/core/subagents/naruto-help-contract.js +40 -0
  215. package/dist/core/subagents/official-subagent-config.js +488 -0
  216. package/dist/core/subagents/official-subagent-preparation.js +251 -0
  217. package/dist/core/subagents/official-subagent-prompt.js +137 -0
  218. package/dist/core/subagents/official-subagent-runner.js +129 -0
  219. package/dist/core/subagents/subagent-evidence.js +663 -0
  220. package/dist/core/subagents/terminology.js +16 -0
  221. package/dist/core/subagents/thread-budget.js +21 -0
  222. package/dist/core/subagents/triwiki-attention.js +65 -0
  223. package/dist/core/super-search/runtime-helpers.js +173 -19
  224. package/dist/core/super-search/runtime.js +140 -15
  225. package/dist/core/super-search/source-records.js +49 -8
  226. package/dist/core/team-review-policy.js +15 -0
  227. package/dist/core/triwiki/code-pack.js +8 -2
  228. package/dist/core/triwiki/triwiki-cache-key.js +108 -29
  229. package/dist/core/triwiki/triwiki-module-card.js +1 -1
  230. package/dist/core/triwiki-attention.js +13 -6
  231. package/dist/core/triwiki-provenance.js +274 -0
  232. package/dist/core/triwiki-runtime.js +21 -7
  233. package/dist/core/triwiki-wrongness/wrongness-ledger.js +187 -61
  234. package/dist/core/triwiki-wrongness/wrongness-retrieval.js +11 -2
  235. package/dist/core/triwiki-wrongness/wrongness-trust-policy.js +2 -0
  236. package/dist/core/update-check.js +23 -15
  237. package/dist/core/version-manager.js +51 -1
  238. package/dist/core/version.js +1 -1
  239. package/dist/core/wiki-coordinate.js +128 -12
  240. package/dist/core/work-order-ledger.js +208 -10
  241. package/dist/core/zellij/zellij-command.js +12 -1
  242. package/dist/core/zellij/zellij-dashboard-pane.js +3 -3
  243. package/dist/core/zellij/zellij-fake-adapter.js +3 -1
  244. package/dist/core/zellij/zellij-launcher.js +51 -21
  245. package/dist/core/zellij/zellij-layout-builder.js +14 -5
  246. package/dist/core/zellij/zellij-official-subagent-activity.js +477 -0
  247. package/dist/core/zellij/zellij-official-subagent-telemetry.js +264 -0
  248. package/dist/core/zellij/zellij-pane-proof.js +32 -6
  249. package/dist/core/zellij/zellij-slot-pane-renderer.js +17 -5
  250. package/dist/core/zellij/zellij-slot-telemetry.js +15 -3
  251. package/dist/core/zellij/zellij-ui-mode.js +1 -1
  252. package/dist/core/zellij/zellij-viewport-binder.js +3 -0
  253. package/dist/core/zellij/zellij-worker-pane-manager.js +5 -3
  254. package/dist/scripts/agent-fast-mode-default-check.js +48 -29
  255. package/dist/scripts/agent-role-config-repair-check.js +34 -15
  256. package/dist/scripts/agent-wiki-context-proof-check.js +16 -2
  257. package/dist/scripts/all-feature-deep-completion-check.js +14 -4
  258. package/dist/scripts/architecture-guard-check.js +8 -1
  259. package/dist/scripts/build-dist.js +17 -5
  260. package/dist/scripts/canonical-test-runner.js +188 -0
  261. package/dist/scripts/check-command-module-budget.js +38 -16
  262. package/dist/scripts/check-legacy-free.js +1 -1
  263. package/dist/scripts/check-route-modularity.js +0 -1
  264. package/dist/scripts/check-ts-contracts.js +1 -1
  265. package/dist/scripts/codex-0139-interrupt-agent-check.js +5 -1
  266. package/dist/scripts/{codex-0142-app-server-v2-check.js → codex-0144-app-server-v2-check.js} +11 -10
  267. package/dist/scripts/{codex-0142-binary-identity-check.js → codex-0144-binary-identity-check.js} +4 -4
  268. package/dist/scripts/codex-0144-capability-check.js +21 -0
  269. package/dist/scripts/{codex-0139-real-probes-check.js → codex-0144-core-real-probes-check.js} +19 -5
  270. package/dist/scripts/{codex-0142-doctor-wiring-check.js → codex-0144-doctor-wiring-check.js} +6 -6
  271. package/dist/scripts/{codex-0142-manifest-check.js → codex-0144-manifest-check.js} +11 -3
  272. package/dist/scripts/{codex-0142-policy-check.js → codex-0144-policy-check.js} +2 -2
  273. package/dist/scripts/{codex-0142-thread-store-check.js → codex-0144-thread-store-check.js} +3 -3
  274. package/dist/scripts/codex-app-provider-model-ui-check.js +53 -19
  275. package/dist/scripts/codex-app-ui-preservation-check.js +35 -4
  276. package/dist/scripts/codex-control-all-pipelines-check.js +7 -3
  277. package/dist/scripts/codex-control-side-effect-scope-check.js +2 -2
  278. package/dist/scripts/codex-control-tool-output-continuity-audit-check.js +27 -0
  279. package/dist/scripts/codex-effort-auto-discovery-check.js +1 -1
  280. package/dist/scripts/codex-lb-fast-mode-truth-check.js +1 -0
  281. package/dist/scripts/{codex-lb-gpt55-fast-profile-check.js → codex-lb-gpt56-fast-profile-check.js} +56 -5
  282. package/dist/scripts/codex-model-metadata-check.js +1 -1
  283. package/dist/scripts/codex-native-agent-role-content-check.js +15 -7
  284. package/dist/scripts/codex-native-repair-transaction-check.js +3 -1
  285. package/dist/scripts/codex-sdk-all-pipelines-check.js +7 -4
  286. package/dist/scripts/codex-sdk-research-pipeline-check.js +30 -8
  287. package/dist/scripts/codex-sdk-sandbox-policy-check.js +5 -1
  288. package/dist/scripts/codex-sdk-version-compat-check.js +2 -1
  289. package/dist/scripts/db-route-materialization-check.js +33 -0
  290. package/dist/scripts/dfix-fixture-check.js +1 -1
  291. package/dist/scripts/docs-truthfulness-check.js +4 -2
  292. package/dist/scripts/doctor-codex-startup-repair-check.js +47 -25
  293. package/dist/scripts/doctor-context7-repair-check.js +2 -1
  294. package/dist/scripts/doctor-fix-production-blackbox.js +12 -2
  295. package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +34 -7
  296. package/dist/scripts/doctor-imagegen-repair-check.js +14 -4
  297. package/dist/scripts/doctor-startup-config-repair-blackbox.js +9 -3
  298. package/dist/scripts/doctor-startup-config-repair-check.js +13 -3
  299. package/dist/scripts/install-update-preserves-config-check.js +7 -2
  300. package/dist/scripts/legacy-gate-inventory-check.js +7 -5
  301. package/dist/scripts/legacy-strong-inventory-check.js +7 -5
  302. package/dist/scripts/legacy-upgrade-matrix-check.js +4 -4
  303. package/dist/scripts/lib/native-cli-session-swarm-check-lib.js +173 -13
  304. package/dist/scripts/mad-sks-app-ui-no-mutation-check.js +165 -6
  305. package/dist/scripts/managed-role-manifest-parity-check.js +5 -4
  306. package/dist/scripts/mutation-callsite-coverage-check.js +0 -11
  307. package/dist/scripts/naruto-codex-e2e-check.js +14 -7
  308. package/dist/scripts/naruto-shadow-clone-swarm-check.js +4 -201
  309. package/dist/scripts/npm-publish-performance-check.js +20 -12
  310. package/dist/scripts/official-subagent-workflow-check.js +145 -0
  311. package/dist/scripts/package-published-contract-check.js +6 -20
  312. package/dist/scripts/packlist-performance-check.js +17 -3
  313. package/dist/scripts/parallel-verification-engine-check.js +2 -2
  314. package/dist/scripts/postinstall-safe-side-effects-check.js +8 -3
  315. package/dist/scripts/ppt-no-mock-as-real-check.js +3 -1
  316. package/dist/scripts/prepublish-release-check-or-fast.js +23 -86
  317. package/dist/scripts/product-design-plugin-routing-check.js +1 -1
  318. package/dist/scripts/release-affected-selector-check.js +74 -1
  319. package/dist/scripts/release-check-stamp.js +324 -239
  320. package/dist/scripts/release-dag-full-coverage-check.js +7 -15
  321. package/dist/scripts/release-dynamic-presets-check.js +10 -1
  322. package/dist/scripts/release-gate-dag-runner-check.js +3 -3
  323. package/dist/scripts/release-gate-dag-runner.js +35 -11
  324. package/dist/scripts/release-gate-existence-audit.js +1 -2
  325. package/dist/scripts/release-gate-script-parity-check.js +1 -1
  326. package/dist/scripts/release-parallel-full-coverage-check.js +12 -6
  327. package/dist/scripts/release-parallel-speed-budget-check.js +18 -2
  328. package/dist/scripts/release-real-check.js +390 -157
  329. package/dist/scripts/release-registry-check.js +61 -16
  330. package/dist/scripts/release-runtime-truth-matrix-check.js +22 -0
  331. package/dist/scripts/research-blueprint-densifier-check.js +2 -2
  332. package/dist/scripts/research-real-cycle-no-legacy-final-md-check.js +11 -7
  333. package/dist/scripts/route-proof-artifact-structure-check.js +1 -0
  334. package/dist/scripts/search-visibility-gate-lib.js +1 -1
  335. package/dist/scripts/seo-geo-route-identity-check.js +30 -4
  336. package/dist/scripts/sizecheck.js +4 -4
  337. package/dist/scripts/sks-1-11-gate-lib.js +53 -6
  338. package/dist/scripts/sks-3-1-4-directive-check-lib.js +8 -2
  339. package/dist/scripts/sks-3-1-5-directive-check-lib.js +3 -2
  340. package/dist/scripts/sks-3-1-6-directive-check-lib.js +5 -3
  341. package/dist/scripts/sks-menubar-install-check.js +8 -0
  342. package/dist/scripts/sks-uninstall-regression-check.js +1 -1
  343. package/dist/scripts/sksd-daemon-check.js +16 -6
  344. package/dist/scripts/trust-fixture-check.js +32 -10
  345. package/dist/scripts/write-build-manifest.js +2 -1
  346. package/dist/scripts/wrongness-fixture-check.js +1 -1
  347. package/dist/scripts/zellij-layout-valid-check.js +36 -11
  348. package/dist/scripts/zellij-pane-proof-check.js +33 -2
  349. package/dist/scripts/zellij-real-session-cleanup-check.js +122 -2
  350. package/dist/scripts/zellij-real-session-launch-check.js +76 -5
  351. package/dist/scripts/zellij-slot-pane-renderer-check.js +4 -4
  352. package/dist/scripts/zellij-spawn-on-demand-layout-check.js +3 -3
  353. package/docs/demo.tape +1 -1
  354. package/infra-harness-gates.json +1486 -0
  355. package/package.json +32 -19
  356. package/release-gates.v2.json +4060 -0
  357. package/runtime-required-scripts.json +9 -0
  358. package/schemas/codex/{app-server-0.142 → app-server-0.144}/codex_app_server_protocol.v2.schemas.json +1146 -781
  359. package/schemas/codex/codex-0139-real-probe-result.schema.json +39 -5
  360. package/schemas/codex/ppt-slide-issue-ledger.schema.json +2 -1
  361. package/dist/commands/db.js +0 -6
  362. package/dist/core/codex-control/codex-0139-multi-agent-real-probe.js +0 -107
  363. package/dist/core/commands/db-command.js +0 -146
  364. package/dist/core/research/prompt.js +0 -15
  365. package/dist/scripts/agent-native-release-gate.js +0 -274
  366. package/dist/scripts/codex-0142-capability-check.js +0 -21
  367. package/dist/scripts/codex-control-tool-call-sequence-repair-check.js +0 -14
  368. package/dist/scripts/command-performance-scorecard-check.js +0 -204
  369. package/dist/scripts/config-managed-merge-callsite-coverage-check.js +0 -212
  370. package/dist/scripts/dollar-performance-scorecard-check.js +0 -257
  371. package/dist/scripts/gate-timing-check.js +0 -16
  372. package/dist/scripts/ops-maturity-scorecard-check.js +0 -12
  373. package/dist/scripts/performance-baseline-check.js +0 -12
  374. package/dist/scripts/performance-improvement-report-check.js +0 -58
  375. package/dist/scripts/release-parallel-check.js +0 -389
  376. package/dist/scripts/release-runner-efficiency-check.js +0 -15
  377. package/dist/scripts/retention-long-run-smoke-check.js +0 -299
  378. package/docs/assets/sneakoscope-architecture-pipeline.jpg +0 -0
@@ -119,6 +119,9 @@ function reflectionStopReason(state = {}, status = {}) {
119
119
  export async function projectGateStatus(root, state = {}) {
120
120
  const gates = [];
121
121
  const id = state?.mission_id || null;
122
+ const hasActiveGate = Boolean(id && state?.stop_gate && !['none', 'honest_mode', 'clarification-gate'].includes(state.stop_gate));
123
+ const activeGate = hasActiveGate ? await passedActiveGate(root, state) : null;
124
+ const activeGateNotApplicable = activeGate?.not_applicable === true;
122
125
  if (clarificationGatePending(state)) {
123
126
  gates.push({
124
127
  id: 'clarification-gate',
@@ -136,16 +139,16 @@ export async function projectGateStatus(root, state = {}) {
136
139
  source: id ? `.sneakoscope/missions/${id}/context7-evidence.jsonl` : '.sneakoscope/state/context7-evidence.jsonl'
137
140
  });
138
141
  }
139
- if (state?.subagents_required) {
142
+ if (state?.subagents_required && !activeGateNotApplicable) {
140
143
  const evidence = await subagentEvidence(root, state);
141
144
  gates.push({
142
- id: 'native-session-evidence',
145
+ id: 'official-subagent-evidence',
143
146
  ok: evidence.ok,
144
- missing: evidence.ok ? [] : ['native_session_or_exception_evidence'],
145
- source: id ? `.sneakoscope/missions/${id}/subagent-evidence.jsonl` : '.sneakoscope/state/subagent-evidence.jsonl'
147
+ missing: evidence.ok ? [] : (evidence.blockers || ['official_subagent_events_and_parent_summary']),
148
+ source: id ? `.sneakoscope/missions/${id}/subagent-evidence.json` : '.sneakoscope/state/subagents/subagent-evidence.json'
146
149
  });
147
150
  }
148
- if (id && routeRequiresAgentIntake(routeFromState(state), { task: state.prompt, force: state.forceAgents === true, noAgents: state.agents_required === false })) {
151
+ if (id && !stateUsesOfficialSubagentWorkflow(state) && routeRequiresAgentIntake(routeFromState(state), { task: state.prompt, force: state.forceAgents === true, noAgents: state.agents_required === false })) {
149
152
  const agentGate = await readAgentGateStatus(root, id);
150
153
  gates.push({
151
154
  id: AGENT_INTAKE_STAGE_ID,
@@ -154,8 +157,8 @@ export async function projectGateStatus(root, state = {}) {
154
157
  source: `.sneakoscope/missions/${id}/agents/agent-proof-evidence.json`
155
158
  });
156
159
  }
157
- if (id && state?.stop_gate && !['none', 'honest_mode', 'clarification-gate'].includes(state.stop_gate)) {
158
- const active = await passedActiveGate(root, state);
160
+ if (hasActiveGate) {
161
+ const active = activeGate;
159
162
  gates.push({
160
163
  id: active.file || state.stop_gate,
161
164
  ok: active.ok,
@@ -194,6 +197,17 @@ export async function projectGateStatus(root, state = {}) {
194
197
  };
195
198
  }
196
199
  export async function evaluateStop(root, state, payload, opts = {}) {
200
+ // `sks route close` is the explicit terminal control for abandoning or
201
+ // superseding a route. Once it has closed the route, stale requirements
202
+ // from that route must not re-open native-agent, reflection, or proof gates
203
+ // on the next Stop hook invocation.
204
+ if (state?.route_closed === true) {
205
+ return {
206
+ continue: true,
207
+ action: 'route_closed',
208
+ systemMessage: `SKS: explicitly closed route accepted${state?.mission_id ? ` (${state.mission_id})` : ''}.`
209
+ };
210
+ }
197
211
  const last = extractLastMessage(payload);
198
212
  const jsonCache = new Map();
199
213
  if (clarificationGatePending(state)) {
@@ -213,9 +227,13 @@ export async function evaluateStop(root, state, payload, opts = {}) {
213
227
  if (!opts.noQuestion && (stopGate === 'none' || stopGate === 'honest_mode') && !state?.context7_required && !state?.subagents_required && !completionProofRequired && !reflectionRequired) {
214
228
  return null;
215
229
  }
216
- const agentIntakeRequired = state?.mission_id && routeRequiresAgentIntake(route, { task: state.prompt, force: state.forceAgents === true, noAgents: state.agents_required === false });
230
+ const activeGatePreview = state?.subagents_required
231
+ ? await passedActiveGate(root, state, jsonCache)
232
+ : null;
233
+ const activeGateNotApplicable = activeGatePreview?.not_applicable === true;
234
+ const agentIntakeRequired = state?.mission_id && !stateUsesOfficialSubagentWorkflow(state) && routeRequiresAgentIntake(route, { task: state.prompt, force: state.forceAgents === true, noAgents: state.agents_required === false });
217
235
  const context7Promise = state?.context7_required ? hasContext7DocsEvidence(root, state) : Promise.resolve(true);
218
- const subagentPromise = state?.subagents_required ? hasSubagentEvidence(root, state) : Promise.resolve(true);
236
+ const subagentPromise = state?.subagents_required && !activeGateNotApplicable ? hasSubagentEvidence(root, state) : Promise.resolve(true);
219
237
  const completionProofPromise = agentIntakeRequired
220
238
  ? exists(path.join(missionDir(root, state.mission_id), 'completion-proof.json'))
221
239
  : Promise.resolve(true);
@@ -231,12 +249,15 @@ export async function evaluateStop(root, state, payload, opts = {}) {
231
249
  if (state?.context7_required && !context7Ok) {
232
250
  return complianceBlock(root, state, `SKS ${state.route_command || state.mode || 'route'} requires Context7 evidence before completion. Use Context7 resolve-library-id, then query-docs (or legacy get-library-docs), so SKS can record context7-evidence.jsonl.`, { gate: 'context7-evidence' });
233
251
  }
234
- if (state?.subagents_required && !subagentOk) {
235
- return complianceBlock(root, state, `SKS ${state.route_command || state.mode || 'route'} requires native multi-session evidence before completion. Run worker/reviewer native sessions for disjoint code-changing work, or record explicit evidence that native sessions were unavailable or unsafe to split.`, { gate: 'native-session-evidence' });
252
+ if (state?.subagents_required && !activeGateNotApplicable && !subagentOk) {
253
+ const evidence = await subagentEvidence(root, state);
254
+ return complianceBlock(root, state, `SKS ${state.route_command || state.mode || 'route'} requires official Codex subagent evidence before completion. Record matched SubagentStart/SubagentStop events for every requested agent thread, wait for all threads, and provide the parent integration summary. Missing: ${(evidence.blockers || ['official_subagent_events_and_parent_summary']).join(', ')}.`, { gate: 'official-subagent-evidence', missing: evidence.blockers });
236
255
  }
237
256
  if (agentIntakeRequired && !completionProofExists) {
238
257
  if (!agentGate.ok) {
239
- return complianceBlock(root, state, `SKS ${state.route_command || state.mode || 'route'} route cannot continue to implementation/finalization: native agent intake gate is missing or blocked. Run: sks agent run latest --mock --json`, { gate: AGENT_INTAKE_STAGE_ID, missing: agentGate.missing || ['agents/agent-proof-evidence.json'] });
258
+ const missionArg = String(state.mission_id || '').trim() || '<mission-id>';
259
+ const routeArg = String(state.route_command || state.route || state.mode || '$Agent');
260
+ return complianceBlock(root, state, `SKS ${routeArg} route cannot continue to implementation/finalization: native agent intake gate is missing or blocked. Run: sks agent run --mission ${shellQuote(missionArg)} --route ${shellQuote(routeArg)} --agents 5 --json`, { gate: AGENT_INTAKE_STAGE_ID, missing: agentGate.missing || ['agents/agent-proof-evidence.json'] });
240
261
  }
241
262
  }
242
263
  if (!mistakeRecall.ok) {
@@ -255,15 +276,16 @@ export async function evaluateStop(root, state, payload, opts = {}) {
255
276
  };
256
277
  }
257
278
  if (gate.ok) {
279
+ const proofGate = await routeProofGateStatus(root, state);
280
+ if (!proofGate.ok) {
281
+ return complianceBlock(root, state, `SKS ${state.route_command || state.mode || 'route'} route cannot finalize without a valid Completion Proof. Missing or invalid proof issues: ${proofGate.issues.join(', ')}.`, { gate: 'completion-proof', missing: proofGate.issues });
282
+ }
258
283
  const coverage = await workOrderCoverageGateStatus(root, state);
259
284
  if (!coverage.ok)
260
285
  return complianceBlock(root, state, `SKS ${state.route_command || state.mode || 'route'} route has unresolved work-order-ledger items (neither verified nor honestly blocked): ${coverage.blockers.join(', ')}.`, { gate: 'work-order-ledger', missing: coverage.blockers });
261
286
  const reflection = await reflectionGateStatus(root, state, jsonCache);
262
287
  if (!reflection.ok) {
263
- const coverageRequiredRoute = routeById(routeFromState(state))?.coverage_required === true;
264
- if (coverageRequiredRoute)
265
- return complianceBlock(root, state, reflectionStopReason(state, reflection), { gate: 'reflection', missing: reflection.missing });
266
- await appendHonestModeNote(root, state, `reflection stale: ${(reflection.missing || []).join(', ')}`);
288
+ return complianceBlock(root, state, reflectionStopReason(state, reflection), { gate: 'reflection', missing: reflection.missing });
267
289
  }
268
290
  return { continue: true };
269
291
  }
@@ -285,10 +307,30 @@ export async function evaluateStop(root, state, payload, opts = {}) {
285
307
  });
286
308
  if (stopCheck.action === 'allow_stop') {
287
309
  if (narutoFamily) {
310
+ const activeGateNotApplicable = stopCheck.diagnostics.reason === 'gate_not_applicable';
311
+ if (!activeGateNotApplicable) {
312
+ const nativeGate = await readJson(path.join(missionDir(root, state.mission_id), 'naruto-gate.json'), null);
313
+ const officialMissing = nativeGate
314
+ ? [
315
+ ...missingRequiredGateFields('naruto-gate.json', state, nativeGate),
316
+ ...await missingNarutoArtifacts(root, state, nativeGate)
317
+ ]
318
+ : ['naruto-gate.json'];
319
+ if (officialMissing.length) {
320
+ return complianceBlock(root, state, `SKS ${state.route_command || state.mode || 'route'} route cannot stop yet. Official subagent evidence and the parent integration summary are incomplete. Missing: ${officialMissing.join(', ')}. Historical legacy artifacts are read only when the mission itself already carries an explicit legacy workflow marker; no environment switch can reactivate that runtime.`, { gate: 'official-subagent-evidence', missing: officialMissing });
321
+ }
322
+ }
288
323
  const coverage = await workOrderCoverageGateStatus(root, state);
289
324
  if (!coverage.ok)
290
325
  return complianceBlock(root, state, `SKS ${state.route_command || state.mode || 'route'} route has unresolved work-order-ledger items (neither verified nor honestly blocked): ${coverage.blockers.join(', ')}.`, { gate: 'work-order-ledger', missing: coverage.blockers });
291
- return { continue: true, systemMessage: `SKS: canonical stop-gate passed at ${stopCheck.gate_path}` };
326
+ const proofGate = await routeProofGateStatus(root, state);
327
+ if (!proofGate.ok) {
328
+ return complianceBlock(root, state, `SKS ${state.route_command || state.mode || 'route'} route cannot finalize without a valid Completion Proof. Missing or invalid proof issues: ${proofGate.issues.join(', ')}.`, { gate: 'completion-proof', missing: proofGate.issues });
329
+ }
330
+ const reflection = await reflectionGateStatus(root, state, jsonCache);
331
+ if (!reflection.ok)
332
+ return complianceBlock(root, state, reflectionStopReason(state, reflection), { gate: 'reflection', missing: reflection.missing });
333
+ return { continue: true, systemMessage: `SKS: canonical stop-gate ${activeGateNotApplicable ? 'was not applicable and independent gates passed' : 'passed'} at ${stopCheck.gate_path}` };
292
334
  }
293
335
  }
294
336
  else if (stopCheck.action === 'hard_blocked') {
@@ -329,6 +371,9 @@ export async function evaluateStop(root, state, payload, opts = {}) {
329
371
  fireAndForgetProjectMemory(root, state);
330
372
  return null;
331
373
  }
374
+ function shellQuote(value) {
375
+ return `'${String(value ?? '').replace(/'/g, `'"'"'`)}'`;
376
+ }
332
377
  function fireAndForgetProjectMemory(root, state = {}) {
333
378
  if (!state?.mission_id)
334
379
  return;
@@ -425,7 +470,7 @@ async function markReflectionInvalidatedForGateFailure(root, state = {}, detail
425
470
  const gate = String(detail.gate || state.stop_gate || '');
426
471
  if (!reflectionRequiredForState(state))
427
472
  return;
428
- if (!gate || /^(reflection|context7-evidence|native-session-evidence|no-question|clarification)$/i.test(gate))
473
+ if (!gate || /^(reflection|context7-evidence|official-subagent-evidence|native-session-evidence|no-question|clarification)$/i.test(gate))
429
474
  return;
430
475
  await setCurrent(root, {
431
476
  mission_id: state.mission_id,
@@ -469,6 +514,23 @@ async function passedActiveGate(root, state, jsonCache) {
469
514
  const p = path.join(missionDir(root, id), file);
470
515
  const gate = await readJsonCached(jsonCache, p, null);
471
516
  if (gate) {
517
+ if (String(gate.status || '').trim().toLowerCase() === 'not_applicable') {
518
+ const reason = String(gate.reason || '').trim();
519
+ const missing = [];
520
+ if (!reason)
521
+ missing.push('reason');
522
+ if (gate.blockers !== undefined && !Array.isArray(gate.blockers))
523
+ missing.push('blockers_invalid');
524
+ else if (Array.isArray(gate.blockers) && gate.blockers.length > 0)
525
+ missing.push('blockers');
526
+ if (gate.missing_fields !== undefined && !Array.isArray(gate.missing_fields))
527
+ missing.push('missing_fields_invalid');
528
+ else if (Array.isArray(gate.missing_fields) && gate.missing_fields.length > 0)
529
+ missing.push('missing_fields');
530
+ return missing.length
531
+ ? { ok: false, file, missing }
532
+ : { ok: true, file, not_applicable: true, reason };
533
+ }
472
534
  const missing = [
473
535
  ...missingRequiredGateFields(file, state, gate),
474
536
  ...await missingRequiredGateArtifacts(root, file, state, gate)
@@ -505,17 +567,6 @@ async function passedHardBlocker(root, state, jsonCache) {
505
567
  }
506
568
  return { ok: blocker.passed === true && hasReason && hasEvidence, file };
507
569
  }
508
- async function appendHonestModeNote(root, state = {}, message) {
509
- if (!state?.mission_id)
510
- return;
511
- const dir = missionDir(root, state.mission_id);
512
- await appendJsonl(path.join(dir, 'honest-mode-notes.jsonl'), {
513
- ts: nowIso(),
514
- type: 'honest_mode_note',
515
- route: state.route_command || state.route || state.mode || null,
516
- message
517
- });
518
- }
519
570
  function missingRequiredGateFields(file, state, gate = {}) {
520
571
  const mode = String(state?.mode || '').toUpperCase();
521
572
  if (file === 'team-gate.json' || mode === 'TEAM') {
@@ -528,24 +579,32 @@ function missingRequiredGateFields(file, state, gate = {}) {
528
579
  .filter((key) => gate[key] !== true);
529
580
  }
530
581
  if (file === 'naruto-gate.json' || mode === 'NARUTO') {
531
- const required = [
532
- 'clone_roster_built',
533
- 'work_graph_ready',
534
- 'role_distribution_ready',
535
- 'allocation_ready',
536
- 'rebalance_ready',
537
- 'concurrency_governor_ready',
538
- 'active_pool_ready',
539
- 'verification_dag_ready',
540
- 'gpt_final_pack_ready',
541
- 'zellij_dashboard_ready',
542
- 'native_agent_proof',
543
- 'final_arbiter_accepted',
544
- 'session_cleanup'
545
- ];
582
+ const required = legacyNarutoWorkflowEnabled(state, gate)
583
+ ? [
584
+ 'clone_roster_built',
585
+ 'work_graph_ready',
586
+ 'role_distribution_ready',
587
+ 'allocation_ready',
588
+ 'rebalance_ready',
589
+ 'concurrency_governor_ready',
590
+ 'active_pool_ready',
591
+ 'verification_dag_ready',
592
+ 'gpt_final_pack_ready',
593
+ 'zellij_dashboard_ready',
594
+ 'native_agent_proof',
595
+ 'final_arbiter_accepted',
596
+ 'session_cleanup'
597
+ ]
598
+ : ['subagent_plan_ready', 'official_subagent_evidence', 'parent_summary_present', 'session_cleanup'];
599
+ if (!legacyNarutoWorkflowEnabled(state, gate) && gate.workflow !== 'official_codex_subagent')
600
+ required.push('workflow');
601
+ if (!legacyNarutoWorkflowEnabled(state, gate) && gate.parent_model_match === false)
602
+ required.push('parent_model_match');
603
+ if (!legacyNarutoWorkflowEnabled(state, gate) && Array.isArray(gate.config_blockers) && gate.config_blockers.length)
604
+ required.push(...gate.config_blockers.map((item) => `config:${String(item)}`));
546
605
  if (fromChatImgCoverageRequired(state, gate))
547
606
  required.push('from_chat_img_request_coverage');
548
- return required.filter((key) => gate[key] !== true);
607
+ return required.filter((key) => key.includes(':') || gate[key] !== true);
549
608
  }
550
609
  if (file === 'qa-gate.json' || mode === 'QALOOP') {
551
610
  const required = ['clarification_contract_sealed', 'qa_report_written', 'qa_ledger_complete', 'checklist_completed', 'safety_reviewed', 'deployed_destructive_tests_blocked', 'credentials_not_persisted', 'honest_mode_complete'];
@@ -816,6 +875,79 @@ function gateFilesForState(state) {
816
875
  return ['done-gate.json'];
817
876
  }
818
877
  async function missingNarutoArtifacts(root, state = {}, gate = {}) {
878
+ const id = state?.mission_id;
879
+ if (!id)
880
+ return ['mission_id'];
881
+ const dir = missionDir(root, id);
882
+ if (legacyNarutoWorkflowEnabled(state, gate))
883
+ return missingLegacyNarutoArtifacts(root, state, gate);
884
+ const required = [
885
+ 'naruto-gate.json',
886
+ 'subagent-plan.json',
887
+ 'subagent-events.jsonl',
888
+ 'subagent-parent-summary.json',
889
+ 'subagent-evidence.json',
890
+ 'naruto-summary.json'
891
+ ];
892
+ const missing = [];
893
+ for (const file of required) {
894
+ if (!(await exists(path.join(dir, file))))
895
+ missing.push(file);
896
+ }
897
+ const [plan, evidenceFile, summary, recomputedEvidence] = await Promise.all([
898
+ readJson(path.join(dir, 'subagent-plan.json'), null),
899
+ readJson(path.join(dir, 'subagent-evidence.json'), null),
900
+ readJson(path.join(dir, 'naruto-summary.json'), null),
901
+ subagentEvidence(root, state)
902
+ ]);
903
+ if (plan?.schema !== 'sks.subagent-plan.v1')
904
+ missing.push('subagent-plan.json:schema');
905
+ if (plan?.workflow !== 'official_codex_subagent')
906
+ missing.push('subagent-plan.json:workflow');
907
+ if (Number(plan?.requested_subagents || 0) < 1)
908
+ missing.push('subagent-plan.json:requested_subagents');
909
+ if (Number(plan?.max_threads || 0) < 1)
910
+ missing.push('subagent-plan.json:max_threads');
911
+ if (Number(plan?.max_depth || 0) !== 1)
912
+ missing.push('subagent-plan.json:max_depth');
913
+ if (!String(plan?.delegation_prompt || '').trim())
914
+ missing.push('subagent-plan.json:delegation_prompt');
915
+ if (plan?.parent_model_match === false)
916
+ missing.push('subagent-plan.json:parent_model_match');
917
+ if (evidenceFile?.schema !== 'sks.subagent-evidence.v1')
918
+ missing.push('subagent-evidence.json:schema');
919
+ if (evidenceFile?.workflow !== 'official_codex_subagent')
920
+ missing.push('subagent-evidence.json:workflow');
921
+ if (recomputedEvidence?.ok !== true)
922
+ missing.push(...(Array.isArray(recomputedEvidence?.blockers) && recomputedEvidence.blockers.length ? recomputedEvidence.blockers.map((item) => `subagent-evidence.json:${String(item)}`) : ['subagent-evidence.json:ok']));
923
+ if (recomputedEvidence?.parent_summary_present !== true || recomputedEvidence?.parent_summary_trustworthy !== true)
924
+ missing.push('subagent-evidence.json:parent_summary_trustworthy');
925
+ if (Number(recomputedEvidence?.requested_subagents || 0) !== Number(plan?.requested_subagents || 0))
926
+ missing.push('subagent-evidence.json:requested_subagents');
927
+ if (Number(recomputedEvidence?.failed_threads || 0) !== 0)
928
+ missing.push('subagent-evidence.json:failed_threads');
929
+ if (Number(recomputedEvidence?.completed_threads || 0) < Number(plan?.requested_subagents || 0))
930
+ missing.push('subagent-evidence.json:completed_threads');
931
+ if (summary?.schema !== 'sks.naruto-subagent-workflow.v1')
932
+ missing.push('naruto-summary.json:schema');
933
+ if (summary?.workflow !== 'official_codex_subagent')
934
+ missing.push('naruto-summary.json:workflow');
935
+ if (summary?.ok !== true || summary?.status !== 'completed')
936
+ missing.push('naruto-summary.json:completed');
937
+ if (summary?.parent_summary_present !== true || !String(summary?.parent_summary || '').trim())
938
+ missing.push('naruto-summary.json:parent_summary');
939
+ if (!String(summary?.verification?.budget || '').trim())
940
+ missing.push('naruto-summary.json:verification.budget');
941
+ if (summary?.legacy_process_swarm_used !== false)
942
+ missing.push('naruto-summary.json:legacy_process_swarm_used');
943
+ if (summary?.parent?.observed_model_match === false)
944
+ missing.push('naruto-summary.json:parent.observed_model_match');
945
+ if (fromChatImgCoverageRequired(state, gate) && gate.from_chat_img_request_coverage === true) {
946
+ missing.push(...await missingFromChatImgCoverageArtifacts(root, state));
947
+ }
948
+ return missing;
949
+ }
950
+ async function missingLegacyNarutoArtifacts(root, state = {}, gate = {}) {
819
951
  const id = state?.mission_id;
820
952
  if (!id)
821
953
  return ['mission_id'];
@@ -829,17 +961,27 @@ async function missingNarutoArtifacts(root, state = {}, gate = {}) {
829
961
  'agents/naruto-gpt-final-pack.json'
830
962
  ];
831
963
  const missing = [];
832
- for (const file of required) {
964
+ for (const file of required)
833
965
  if (!(await exists(path.join(dir, file))))
834
966
  missing.push(file);
835
- }
836
967
  if (gate.native_agent_proof === true && !(await exists(path.join(dir, 'agents', 'agent-proof-evidence.json'))))
837
968
  missing.push('agents/agent-proof-evidence.json');
838
- if (fromChatImgCoverageRequired(state, gate) && gate.from_chat_img_request_coverage === true) {
969
+ if (fromChatImgCoverageRequired(state, gate) && gate.from_chat_img_request_coverage === true)
839
970
  missing.push(...await missingFromChatImgCoverageArtifacts(root, state));
840
- }
841
971
  return missing;
842
972
  }
973
+ function legacyNarutoWorkflowEnabled(state = {}, gate = {}) {
974
+ return state?.legacy_subagent_workflow === true
975
+ || state?.workflow === 'legacy_process_swarm'
976
+ || gate?.legacy_workflow === true
977
+ || gate?.workflow === 'legacy_process_swarm';
978
+ }
979
+ function stateUsesOfficialSubagentWorkflow(state = {}) {
980
+ return state?.subagents_required === true
981
+ && state?.native_sessions_required === false
982
+ && state?.legacy_subagent_workflow !== true
983
+ && state?.workflow !== 'legacy_process_swarm';
984
+ }
843
985
  function extractLastMessage(payload) {
844
986
  return payload.last_assistant_message || payload.assistant_message || payload.message || payload.response || payload.raw || '';
845
987
  }
@@ -199,7 +199,7 @@ export function buildPptStyleTokens(contract = {}) {
199
199
  avoid: ['over-designed decoration', 'ornamental gradients', 'nested cards', 'low-contrast gray body text', 'excessive motion or effects'],
200
200
  detail_strategy: ['precise spacing', 'clear hierarchy', 'thin rules', 'disciplined alignment', 'visible source rails', 'subtle accent color only when it clarifies meaning'],
201
201
  anti_generic_ai_style: 'prevent AI-like design: select and apply a concrete awesome-design-md reference profile before styling; do not default to generic cards, gradients, vague SaaS visuals, oversized decoration, or unsupported image-like flourishes',
202
- image_policy: 'use images only when they improve comprehension; prefer Codex App built-in image generation via https://developers.openai.com/codex/app/features#image-generation when generated assets are needed'
202
+ image_policy: 'use images only when they improve comprehension; prefer Codex App built-in image generation via https://learn.chatgpt.com/docs/image-generation when generated assets are needed'
203
203
  }
204
204
  };
205
205
  }
@@ -136,7 +136,7 @@ function buildPptImagegenReviewGate(parts = {}) {
136
136
  wrongness_checked: true,
137
137
  honest_mode_complete: true,
138
138
  mock_fixture: parts.mock === true,
139
- verified_level: parts.mock === true ? 'verified_partial' : 'blocked_until_real_generation_extraction_recheck',
139
+ verified_level: parts.mock === true ? 'mock_only' : 'blocked_until_real_generation_extraction_recheck',
140
140
  blockers: [...new Set(blockers.filter(Boolean))],
141
141
  passed: false
142
142
  };
@@ -4,6 +4,7 @@ import { exists, nowIso, runProcess, which } from '../fsx.js';
4
4
  import { sha256File, imageDimensions } from '../wiki-image/image-hash.js';
5
5
  export const PPT_DECK_INVENTORY_ARTIFACT = 'ppt-deck-inventory.json';
6
6
  export const PPT_SLIDE_EXPORT_LEDGER_ARTIFACT = 'ppt-slide-export-ledger.json';
7
+ const MAX_MOCK_SLIDE_EXPORTS = 256;
7
8
  export function splitList(value = '') {
8
9
  if (Array.isArray(value))
9
10
  return value.map((item) => String(item || '').trim()).filter(Boolean);
@@ -77,20 +78,27 @@ export async function exportSlidesToImages({ root, dir, deckPath = null, deckInv
77
78
  });
78
79
  }
79
80
  if (mock && exportedSlides.length === 0) {
80
- const fixture = await writeFixturePng(dir, 'slide-1.png');
81
- const rel = path.relative(root, fixture).split(path.sep).join('/');
82
- exportedSlides.push({
83
- slide_id: 'slide-1',
84
- slide_index: 1,
85
- image_path: rel,
86
- sha256: await sha256File(fixture),
87
- width: 1,
88
- height: 1,
89
- format: 'png',
90
- fidelity: 'mock_fixture_one_by_one_png',
91
- source: deckPath ? 'fake_export' : 'mock_fixture',
92
- local_only: true
93
- });
81
+ const inventorySlideCount = Number(inventory?.slide_count);
82
+ const requestedMockSlides = Number.isInteger(inventorySlideCount) && inventorySlideCount > 0 ? inventorySlideCount : 1;
83
+ const mockSlideCount = Math.min(MAX_MOCK_SLIDE_EXPORTS, requestedMockSlides);
84
+ if (requestedMockSlides > MAX_MOCK_SLIDE_EXPORTS)
85
+ blockers.push('mock_slide_export_limit_exceeded');
86
+ for (let index = 0; index < mockSlideCount; index += 1) {
87
+ const fixture = await writeFixturePng(dir, `slide-${index + 1}.png`);
88
+ const rel = path.relative(root, fixture).split(path.sep).join('/');
89
+ exportedSlides.push({
90
+ slide_id: `slide-${index + 1}`,
91
+ slide_index: index + 1,
92
+ image_path: rel,
93
+ sha256: await sha256File(fixture),
94
+ width: 1,
95
+ height: 1,
96
+ format: 'png',
97
+ fidelity: 'mock_fixture_one_by_one_png',
98
+ source: deckPath ? 'fake_export' : 'mock_fixture',
99
+ local_only: true
100
+ });
101
+ }
94
102
  }
95
103
  const exportAdapter = manualImages.length ? 'manual_slide_image_attach' : mock ? (deckPath ? 'fake_export' : 'mock_fixture') : await detectSlideExportAdapter();
96
104
  if (!manualImages.length && !mock && inventory?.passed === true) {
@@ -101,9 +109,7 @@ export async function exportSlidesToImages({ root, dir, deckPath = null, deckInv
101
109
  const deckSlideCount = Number(inventory?.slide_count || 0);
102
110
  if (manualImages.length === 0 && !mock && exportedSlides.length === 0)
103
111
  blockers.push('slide_export_unavailable');
104
- if (manualImages.length > 0 && deckSlideCount > 0 && exportedSlides.length < deckSlideCount)
105
- blockers.push('partial_export');
106
- if (manualImages.length === 0 && !mock && deckSlideCount > 0 && exportedSlides.length > 0 && exportedSlides.length < deckSlideCount)
112
+ if (deckSlideCount > 0 && exportedSlides.length < deckSlideCount)
107
113
  blockers.push('partial_export');
108
114
  if (inventory?.passed !== true)
109
115
  blockers.push(...(inventory?.blockers || []));
@@ -158,7 +158,7 @@ export async function generateSlideCalloutReviews({ root, dir, slideExportLedger
158
158
  extraction_pending_count: generatedReviewImages.filter((image) => image.callout_extraction_status === 'pending').length,
159
159
  blockers: [...new Set(blockers)],
160
160
  passed: slides.length > 0 && generatedReviewImages.length === slides.length && blockers.length === 0 && generatedReviewImages.every((image) => image.callout_extraction_status === 'succeeded'),
161
- verified_level: mock ? 'verified_partial' : generatedReviewImages.length ? 'verified_partial' : 'blocked',
161
+ verified_level: mock ? 'mock_only' : generatedReviewImages.length ? 'verified_partial' : 'blocked',
162
162
  next_action: blockers.includes('imagegen_capability_missing')
163
163
  ? 'Generate slide callout review images with Codex App $imagegen/gpt-image-2, then attach them or rerun extraction.'
164
164
  : null
@@ -60,9 +60,11 @@ export async function extractSlideIssues(input = {}) {
60
60
  validation: { ok: true, issues: [] },
61
61
  passed: blockers.length === 0
62
62
  };
63
+ const validation = validateJsonSchemaRecursive(ledgerBase, jsonSchema);
63
64
  const ledger = {
64
65
  ...ledgerBase,
65
- validation: validateJsonSchemaRecursive(ledgerBase, jsonSchema)
66
+ validation,
67
+ passed: ledgerBase.passed && validation.ok
66
68
  };
67
69
  await writeJsonAtomic(path.join(dir, PPT_SLIDE_ISSUE_LEDGER_ARTIFACT), ledger);
68
70
  const extractionReport = {
@@ -76,7 +78,7 @@ export async function extractSlideIssues(input = {}) {
76
78
  blockers: [...new Set(blockers)],
77
79
  fallback_used: !mock && !input.sessionId,
78
80
  validation_status: ledger.validation.ok ? 'valid' : 'blocked',
79
- passed: blockers.length === 0 && reports.every((report) => report.passed !== false)
81
+ passed: ledger.passed && reports.every((report) => report.passed !== false)
80
82
  };
81
83
  await writeJsonAtomic(path.join(dir, PPT_SLIDE_EXTRACTION_REPORT_ARTIFACT), extractionReport);
82
84
  const deckLedger = buildDeckIssueLedger(ledger, calloutLedger);
@@ -5,6 +5,8 @@ import { inspectCodexConfigReadability } from '../codex/codex-config-readability
5
5
  import { repairCodexConfigEperm } from '../codex/codex-config-eperm-repair.js';
6
6
  import { splitCodexProjectConfigPolicy } from '../codex/codex-project-config-policy.js';
7
7
  import { checkZellijCapability } from '../zellij/zellij-capability.js';
8
+ import { codexLbStatus } from '../../cli/install-helpers.js';
9
+ import { codexLbToolOutputRecoveryOverrideAcknowledged } from '../codex-lb/codex-lb-tool-output-recovery.js';
8
10
  export const PARALLEL_PREFLIGHT_SCHEMA = 'sks.parallel-preflight.v1';
9
11
  export async function runParallelPreflight(checks) {
10
12
  const startedAt = nowIso();
@@ -38,7 +40,8 @@ export async function runCodexLaunchPreflight(rootInput = process.cwd(), opts =
38
40
  const probeCodex = opts.launchFast === true ? false : opts.actualCodex !== false;
39
41
  const readonly = await runParallelPreflight([
40
42
  { id: 'codex_config_readability', run: () => inspectCodexConfigReadability(root, { ...opts, codexProbe: probeCodex, actualCodex: probeCodex, writeReport: false }) },
41
- { id: 'codex_project_config_policy', run: () => splitCodexProjectConfigPolicy(root, { ...opts, writeReport: false }) }
43
+ { id: 'codex_project_config_policy', run: () => splitCodexProjectConfigPolicy(root, { ...opts, writeReport: false }) },
44
+ { id: 'codex_lb_tool_output_recovery', run: () => inspectCodexLbToolOutputRecoveryForLaunch(opts) }
42
45
  ]);
43
46
  const repair = opts.fix === true || readonly.ok === false
44
47
  ? await repairCodexConfigEperm(root, { ...opts, codexProbe: probeCodex, actualCodex: probeCodex, fix: opts.fix !== false, writeReport: false })
@@ -66,6 +69,7 @@ export async function runCodexLaunchPreflight(rootInput = process.cwd(), opts =
66
69
  };
67
70
  const blockers = [...new Set([...(readonly.blockers || []), ...(repair?.blockers || []), ...(zellijCapability?.blockers || []), ...(fastTierProof.ok ? [] : ['service_tier_not_passed_to_codex'])])];
68
71
  const operatorActions = [...new Set([...(readonly.operator_actions || []), ...(repair?.operator_actions || []), ...(zellijCapability?.operator_actions || [])])];
72
+ const codexLbToolOutputRecovery = readonly.results.find((result) => result.id === 'codex_lb_tool_output_recovery')?.value || null;
69
73
  const report = {
70
74
  schema: 'sks.mad-launch-preflight.v1',
71
75
  generated_at: nowIso(),
@@ -74,6 +78,7 @@ export async function runCodexLaunchPreflight(rootInput = process.cwd(), opts =
74
78
  readonly,
75
79
  repair,
76
80
  zellij_capability: zellijCapability,
81
+ codex_lb_tool_output_recovery: codexLbToolOutputRecovery,
77
82
  fast_tier_proof: fastTierProof,
78
83
  blockers,
79
84
  operator_actions: operatorActions
@@ -82,4 +87,48 @@ export async function runCodexLaunchPreflight(rootInput = process.cwd(), opts =
82
87
  await writeJsonAtomic(reportPath, { ...report, report_path: reportPath });
83
88
  return report;
84
89
  }
90
+ export async function inspectCodexLbToolOutputRecoveryForLaunch(opts = {}) {
91
+ if (opts.skipCodexLbToolOutputRecovery === true) {
92
+ return {
93
+ schema: 'sks.codex-lb-launch-recovery-preflight.v1',
94
+ ok: true,
95
+ status: 'not_applicable',
96
+ selected: false,
97
+ blockers: [],
98
+ operator_actions: []
99
+ };
100
+ }
101
+ const allowUnverifiedToolOutputRecovery = opts.allowUnverifiedToolOutputRecovery === true
102
+ || codexLbToolOutputRecoveryOverrideAcknowledged({ env: opts.env || process.env });
103
+ const status = await codexLbStatus({
104
+ ...opts,
105
+ ...(opts.home ? { home: opts.home } : {}),
106
+ ...(opts.codexLbConfigPath ? { configPath: opts.codexLbConfigPath } : {}),
107
+ ...(opts.codexLbEnvPath ? { envPath: opts.codexLbEnvPath } : {}),
108
+ ...(typeof opts.codexLbToolOutputRecoveryFetch === 'function'
109
+ ? { toolOutputRecoveryFetch: opts.codexLbToolOutputRecoveryFetch }
110
+ : {}),
111
+ ...(opts.codexLbToolOutputRecoveryTimeoutMs
112
+ ? { toolOutputRecoveryTimeoutMs: opts.codexLbToolOutputRecoveryTimeoutMs }
113
+ : {}),
114
+ probeToolOutputRecovery: true,
115
+ allowUnverifiedToolOutputRecovery
116
+ });
117
+ const recovery = status.tool_output_recovery;
118
+ const required = status.selected === true;
119
+ const ok = !required || recovery?.ok === true;
120
+ return {
121
+ schema: 'sks.codex-lb-launch-recovery-preflight.v1',
122
+ ok,
123
+ status: !required ? 'not_selected' : recovery?.status || 'version_unverified',
124
+ selected: required,
125
+ provider_ready: status.provider_ready === true,
126
+ base_url: status.base_url || null,
127
+ tool_output_recovery: recovery || null,
128
+ blockers: ok ? [] : recovery?.blockers || ['codex_lb_tool_output_recovery_version_unverified'],
129
+ operator_actions: ok ? [] : recovery?.operator_actions || [
130
+ 'Upgrade codex-lb, or run `sks codex-lb use-oauth`; SKS will not switch providers silently.'
131
+ ]
132
+ };
133
+ }
85
134
  //# sourceMappingURL=parallel-preflight-engine.js.map
@@ -4,7 +4,7 @@ export const PRODUCT_DESIGN_REQUIRED_SKILLS = Object.freeze([
4
4
  'get-context',
5
5
  'ideate',
6
6
  'image-to-code',
7
- 'prototype',
7
+ 'index',
8
8
  'research',
9
9
  'share',
10
10
  'url-to-code',
@@ -56,7 +56,7 @@ export const PRODUCT_DESIGN_PIPELINE_STAGES = Object.freeze([
56
56
  },
57
57
  {
58
58
  stage: 'artifact_generation',
59
- skills: ['prototype', 'image-to-code', 'url-to-code'],
59
+ skills: ['index', 'image-to-code', 'url-to-code'],
60
60
  routes: ['Team', 'PPT'],
61
61
  purpose: 'turn sealed context, screenshots, images, or URLs into prototype/source direction'
62
62
  },
@@ -214,7 +214,7 @@ function inferRouteFailureAnalysis({ missionId, route, status, blockers, unverif
214
214
  return {
215
215
  status: 'complete',
216
216
  root_cause: 'Visual evidence was produced from a mock fixture, which cannot support a real fully verified visual route claim.',
217
- corrective_action: 'Kept the Completion Proof at verified_partial and recorded the mock-evidence caveat in unverified evidence.',
217
+ corrective_action: `Kept the Completion Proof at ${status || 'mock_only'} and recorded the mock-evidence caveat instead of upgrading fixture evidence to a real verification claim.`,
218
218
  evidence
219
219
  };
220
220
  }
@@ -28,14 +28,19 @@ export async function validateRouteCompletionProof(root, { missionId = null, rou
28
28
  if (Number(anchors) <= 0)
29
29
  issues.push('image_voxel_anchors_missing');
30
30
  }
31
- if (routeRequiresAgentIntake(route || proof.route, { task: state.prompt, noAgents: state.agents_required === false })) {
31
+ const normalizedRoute = normalizeProofRoute(route || proof.route);
32
+ const officialSubagentWorkflow = normalizedRoute === '$Naruto' && (state.subagents_required === true
33
+ || state.native_sessions_required === false
34
+ || proof.evidence?.route_gate?.workflow === 'official_codex_subagent');
35
+ const legacyAgentProofRequired = normalizedRoute === '$Release-Review'
36
+ || (!officialSubagentWorkflow && routeRequiresAgentIntake(route || proof.route, { task: state.prompt, noAgents: state.agents_required === false }));
37
+ if (legacyAgentProofRequired) {
32
38
  const agents = proof.evidence?.agents;
33
39
  if (!agents)
34
40
  issues.push('agent_proof_evidence_missing');
35
41
  else {
36
42
  if (agents.status !== 'passed' || agents.ok !== true)
37
43
  issues.push('agent_gate_not_passed');
38
- const normalizedRoute = normalizeProofRoute(route || proof.route);
39
44
  const maxAgentCount = normalizedRoute === '$Naruto' ? 100 : 20;
40
45
  const agentCount = Number(agents.agent_count || 0);
41
46
  if (agentCount < 5)