sneakoscope 4.8.6 → 5.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 (390) hide show
  1. package/README.md +51 -726
  2. package/bench/tasks/t01-off-by-one/repo/package.json +9 -0
  3. package/bench/tasks/t01-off-by-one/repo/src/pagination.js +5 -0
  4. package/bench/tasks/t01-off-by-one/repo/test.js +5 -0
  5. package/bench/tasks/t01-off-by-one/task.json +13 -0
  6. package/bench/tasks/t02-signature-cochange/repo/package.json +9 -0
  7. package/bench/tasks/t02-signature-cochange/repo/src/admin.js +5 -0
  8. package/bench/tasks/t02-signature-cochange/repo/src/audit.js +5 -0
  9. package/bench/tasks/t02-signature-cochange/repo/src/labels.js +3 -0
  10. package/bench/tasks/t02-signature-cochange/repo/src/profile.js +5 -0
  11. package/bench/tasks/t02-signature-cochange/repo/test.js +9 -0
  12. package/bench/tasks/t02-signature-cochange/task.json +12 -0
  13. package/bench/tasks/t03-type-puzzle/repo/package.json +9 -0
  14. package/bench/tasks/t03-type-puzzle/repo/src/config.js +4 -0
  15. package/bench/tasks/t03-type-puzzle/repo/test.js +6 -0
  16. package/bench/tasks/t03-type-puzzle/task.json +13 -0
  17. package/bench/tasks/t04-refactor-preserve/repo/package.json +9 -0
  18. package/bench/tasks/t04-refactor-preserve/repo/src/cart.js +8 -0
  19. package/bench/tasks/t04-refactor-preserve/repo/test.js +4 -0
  20. package/bench/tasks/t04-refactor-preserve/task.json +12 -0
  21. package/bench/tasks/t05-performance/repo/package.json +9 -0
  22. package/bench/tasks/t05-performance/repo/src/pairs.js +9 -0
  23. package/bench/tasks/t05-performance/repo/test.js +11 -0
  24. package/bench/tasks/t05-performance/task.json +12 -0
  25. package/bench/tasks/t06-mistake-rule/repo/package.json +9 -0
  26. package/bench/tasks/t06-mistake-rule/repo/src/loader.js +6 -0
  27. package/bench/tasks/t06-mistake-rule/repo/test.js +7 -0
  28. package/bench/tasks/t06-mistake-rule/task.json +12 -0
  29. package/config/bench-baseline.json +7 -0
  30. package/crates/sks-core/Cargo.lock +1 -1
  31. package/crates/sks-core/Cargo.toml +1 -1
  32. package/crates/sks-core/src/main.rs +1 -1
  33. package/dist/bin/install.js +35 -0
  34. package/dist/bin/sks.js +1 -1
  35. package/dist/cli/cli-theme.js +51 -0
  36. package/dist/cli/command-registry.js +75 -42
  37. package/dist/cli/help-fast.js +18 -8
  38. package/dist/cli/insane-search-command.js +36 -8
  39. package/dist/cli/install-helpers.js +147 -47
  40. package/dist/cli/router.js +58 -2
  41. package/dist/commands/codex-lb.js +6 -4
  42. package/dist/commands/doctor.js +146 -8
  43. package/dist/commands/proof.js +6 -3
  44. package/dist/commands/zellij-monitor-pane.js +25 -0
  45. package/dist/commands/zellij-slot-pane.js +39 -2
  46. package/dist/commands/zellij-viewport-pane.js +56 -0
  47. package/dist/commands/zellij.js +55 -2
  48. package/dist/config/skills-manifest.json +493 -0
  49. package/dist/core/agents/agent-conflict-graph.js +5 -0
  50. package/dist/core/agents/agent-lease.js +5 -0
  51. package/dist/core/agents/agent-ledger-schemas.js +1 -0
  52. package/dist/core/agents/agent-lifecycle.js +86 -35
  53. package/dist/core/agents/agent-orchestrator.js +287 -72
  54. package/dist/core/agents/agent-output-validator.js +14 -3
  55. package/dist/core/agents/agent-patch-queue-store.js +108 -4
  56. package/dist/core/agents/agent-patch-queue.js +10 -3
  57. package/dist/core/agents/agent-patch-schema.js +13 -0
  58. package/dist/core/agents/agent-proof-evidence.js +6 -1
  59. package/dist/core/agents/agent-runner-fake.js +40 -0
  60. package/dist/core/agents/agent-scheduler.js +2 -3
  61. package/dist/core/agents/agent-worker-pipeline.js +36 -2
  62. package/dist/core/agents/codex-exec-worker-adapter.js +2 -0
  63. package/dist/core/agents/native-cli-session-swarm.js +30 -13
  64. package/dist/core/agents/native-cli-worker.js +2 -1
  65. package/dist/core/agents/native-worker-backend-router.js +58 -1
  66. package/dist/core/auto-review.js +25 -4
  67. package/dist/core/codex/agent-config-file-repair.js +15 -2
  68. package/dist/core/codex/codex-config-eperm-repair.js +8 -2
  69. package/dist/core/codex/codex-config-guard.js +289 -0
  70. package/dist/core/codex/codex-config-toml.js +122 -0
  71. package/dist/core/codex/codex-project-config-policy.js +59 -7
  72. package/dist/core/codex-app/sks-menubar.js +780 -122
  73. package/dist/core/codex-app.js +1 -0
  74. package/dist/core/codex-control/codex-fake-sdk-adapter.js +6 -4
  75. package/dist/core/codex-control/codex-sdk-config-policy.js +2 -1
  76. package/dist/core/codex-control/codex-sdk-env-policy.js +1 -1
  77. package/dist/core/codex-control/codex-task-runner.js +32 -14
  78. package/dist/core/codex-control/python-codex-sdk-adapter.js +4 -1
  79. package/dist/core/codex-control/schemas/agent-worker-result.schema.js +12 -3
  80. package/dist/core/codex-hooks/codex-hook-managed-install.js +5 -0
  81. package/dist/core/codex-hooks/codex-hook-state-writer.js +70 -11
  82. package/dist/core/codex-hooks/codex-hook-trust-doctor.js +2 -2
  83. package/dist/core/codex-lb/codex-lb-env.js +20 -1
  84. package/dist/core/codex-lb/codex-lb-setup.js +2 -5
  85. package/dist/core/codex-native/skill-registry-ledger.js +24 -5
  86. package/dist/core/commands/basic-cli.js +21 -2
  87. package/dist/core/commands/check-command.js +37 -5
  88. package/dist/core/commands/command-utils.js +22 -2
  89. package/dist/core/commands/computer-use-command.js +62 -7
  90. package/dist/core/commands/db-command.js +31 -5
  91. package/dist/core/commands/fast-mode-command.js +39 -11
  92. package/dist/core/commands/gate-result-contract.js +43 -0
  93. package/dist/core/commands/gates-command.js +6 -1
  94. package/dist/core/commands/gc-command.js +29 -2
  95. package/dist/core/commands/goal-command.js +9 -2
  96. package/dist/core/commands/gx-command.js +79 -7
  97. package/dist/core/commands/image-ux-review-command.js +188 -13
  98. package/dist/core/commands/mad-db-command.js +85 -176
  99. package/dist/core/commands/mad-sks-command.js +248 -34
  100. package/dist/core/commands/menubar-command.js +146 -0
  101. package/dist/core/commands/naruto-command.js +64 -10
  102. package/dist/core/commands/pipeline-command.js +21 -2
  103. package/dist/core/commands/plan-command.js +76 -0
  104. package/dist/core/commands/ppt-command.js +159 -24
  105. package/dist/core/commands/qa-loop-command.js +6 -2
  106. package/dist/core/commands/release-command.js +55 -2
  107. package/dist/core/commands/research-command.js +1 -1
  108. package/dist/core/commands/review-command.js +217 -0
  109. package/dist/core/commands/route-command.js +62 -0
  110. package/dist/core/commands/route-success-helpers.js +59 -0
  111. package/dist/core/commands/run-command.js +19 -7
  112. package/dist/core/commands/seo-command.js +49 -1
  113. package/dist/core/commands/status-command.js +21 -1
  114. package/dist/core/commands/team-legacy-observe-command.js +221 -3
  115. package/dist/core/commands/ui-command.js +161 -0
  116. package/dist/core/commands/uninstall-command.js +312 -0
  117. package/dist/core/db-safety.js +7 -3
  118. package/dist/core/doctor/codex-startup-config-repair.js +14 -3
  119. package/dist/core/doctor/confirm-repair.js +27 -0
  120. package/dist/core/doctor/context7-mcp-repair.js +35 -7
  121. package/dist/core/doctor/doctor-codex-startup-repair.js +10 -3
  122. package/dist/core/doctor/doctor-context7-repair.js +17 -4
  123. package/dist/core/doctor/doctor-dirty-planner.js +27 -9
  124. package/dist/core/doctor/doctor-native-capability-repair.js +12 -2
  125. package/dist/core/doctor/doctor-readiness-matrix.js +27 -2
  126. package/dist/core/doctor/doctor-repair-postcheck.js +4 -0
  127. package/dist/core/doctor/doctor-transaction.js +21 -5
  128. package/dist/core/doctor/doctor-zellij-repair.js +1 -0
  129. package/dist/core/doctor/imagegen-repair.js +161 -0
  130. package/dist/core/doctor/supabase-mcp-repair.js +23 -5
  131. package/dist/core/feature-fixture-runner.js +2 -2
  132. package/dist/core/feature-fixtures.js +65 -37
  133. package/dist/core/feature-registry.js +106 -3
  134. package/dist/core/fsx.js +91 -2
  135. package/dist/core/hooks-runtime/skill-reconcile-preflight.js +43 -0
  136. package/dist/core/hooks-runtime.js +86 -46
  137. package/dist/core/image-ux-review/imagegen-adapter.js +48 -11
  138. package/dist/core/image-ux-review.js +16 -0
  139. package/dist/core/imagegen/imagegen-capability.js +11 -5
  140. package/dist/core/imagegen/require-imagegen.js +57 -0
  141. package/dist/core/init/skills.js +271 -14
  142. package/dist/core/init.js +13 -10
  143. package/dist/core/mad-db/mad-db-coordinator.js +96 -20
  144. package/dist/core/mad-db/mad-db-policy.js +12 -10
  145. package/dist/core/mad-sks/executors/executor-base.js +8 -2
  146. package/dist/core/mad-sks/executors/index.js +4 -0
  147. package/dist/core/mad-sks/executors/sql-plane-executor.js +194 -0
  148. package/dist/core/mission.js +138 -5
  149. package/dist/core/naruto/naruto-active-pool.js +84 -30
  150. package/dist/core/naruto/naruto-backpressure.js +5 -1
  151. package/dist/core/naruto/naruto-real-worker-child.js +10 -0
  152. package/dist/core/naruto/naruto-real-worker-runtime.js +9 -7
  153. package/dist/core/naruto/naruto-role-policy.js +3 -0
  154. package/dist/core/naruto/naruto-task-hints.js +10 -0
  155. package/dist/core/naruto/naruto-work-graph.js +8 -2
  156. package/dist/core/naruto/naruto-work-item.js +6 -0
  157. package/dist/core/naruto/resource-pressure-monitor.js +33 -15
  158. package/dist/core/naruto/solution-tournament.js +101 -0
  159. package/dist/core/permission-gates.js +30 -0
  160. package/dist/core/pipeline-internals/runtime-core.js +72 -222
  161. package/dist/core/pipeline-internals/runtime-gates.js +140 -24
  162. package/dist/core/ppt-review/index.js +6 -1
  163. package/dist/core/ppt-review/slide-imagegen-review.js +75 -10
  164. package/dist/core/ppt.js +70 -2
  165. package/dist/core/proof/auto-finalize.js +70 -11
  166. package/dist/core/proof/proof-schema.js +2 -0
  167. package/dist/core/proof/route-adapter.js +5 -1
  168. package/dist/core/proof/route-finalizer.js +8 -5
  169. package/dist/core/proof/selftest-proof-fixtures.js +18 -5
  170. package/dist/core/proof/validation.js +2 -0
  171. package/dist/core/provider/model-router.js +53 -0
  172. package/dist/core/questions.js +1 -1
  173. package/dist/core/recallpulse.js +1 -1
  174. package/dist/core/release/gate-manifest.js +2 -2
  175. package/dist/core/release/release-gate-affected-selector.js +3 -10
  176. package/dist/core/release/release-gate-batch-runner.js +4 -2
  177. package/dist/core/release/release-gate-cache-v2.js +27 -14
  178. package/dist/core/release/release-gate-dag.js +6 -1
  179. package/dist/core/release/release-gate-hermetic-env.js +10 -0
  180. package/dist/core/release/release-gate-node.js +3 -0
  181. package/dist/core/release/release-gate-resource-governor.js +1 -0
  182. package/dist/core/retention.js +89 -4
  183. package/dist/core/routes/constants.js +1 -1
  184. package/dist/core/routes/diagnostic-allowlist.js +55 -0
  185. package/dist/core/routes.js +83 -33
  186. package/dist/core/safety/mutation-guard.js +5 -1
  187. package/dist/core/skill-forge.js +9 -4
  188. package/dist/core/stop-gate/gate-evaluator.js +102 -0
  189. package/dist/core/stop-gate/stop-gate-check.js +26 -4
  190. package/dist/core/stop-gate/stop-gate-resolver.js +19 -3
  191. package/dist/core/stop-gate/stop-gate-writer.js +20 -1
  192. package/dist/core/team-dag.js +12 -465
  193. package/dist/core/team-dashboard-renderer.js +13 -94
  194. package/dist/core/team-live.js +68 -804
  195. package/dist/core/triwiki/agents-md-projector.js +184 -0
  196. package/dist/core/triwiki-wrongness/wrongness-schema.js +3 -1
  197. package/dist/core/trust-kernel/trust-kernel-schema.js +1 -0
  198. package/dist/core/trust-kernel/trust-report.js +1 -1
  199. package/dist/core/trust-kernel/trust-status.js +2 -0
  200. package/dist/core/ui/dashboard-html.js +111 -0
  201. package/dist/core/update/update-migration-state.js +383 -42
  202. package/dist/core/update-check.js +201 -78
  203. package/dist/core/verification/diff-quality.js +100 -0
  204. package/dist/core/verification/impact-scan.js +164 -0
  205. package/dist/core/verification/machine-feedback.js +146 -0
  206. package/dist/core/verification/mistake-rule-compiler.js +195 -0
  207. package/dist/core/version.js +1 -1
  208. package/dist/core/zellij/zellij-layout-builder.js +44 -16
  209. package/dist/core/zellij/zellij-monitor-renderer.js +53 -0
  210. package/dist/core/zellij/zellij-self-heal.js +27 -32
  211. package/dist/core/zellij/zellij-slot-pane-renderer.js +162 -153
  212. package/dist/core/zellij/zellij-slot-telemetry.js +2 -0
  213. package/dist/core/zellij/zellij-theme.js +67 -0
  214. package/dist/core/zellij/zellij-ui-mode.js +16 -0
  215. package/dist/core/zellij/zellij-viewport-binder.js +59 -0
  216. package/dist/core/zellij/zellij-worker-pane-manager.js +53 -5
  217. package/dist/scripts/agent-patch-swarm-gate-lib.js +2 -2
  218. package/dist/scripts/build-dist.js +8 -0
  219. package/dist/scripts/check-feature-quality.js +2 -2
  220. package/dist/scripts/cli-output-consistency-check.js +57 -0
  221. package/dist/scripts/codex-lb-fast-ui-preservation-check.js +106 -0
  222. package/dist/scripts/codex-lb-gpt55-fast-profile-check.js +105 -0
  223. package/dist/scripts/codex-lb-missing-env-regression.js +2 -3
  224. package/dist/scripts/codex-project-config-policy-merge-regression.js +3 -3
  225. package/dist/scripts/coding-bench-check.js +136 -0
  226. package/dist/scripts/concurrent-session-collision-check.js +67 -0
  227. package/dist/scripts/docs-truthfulness-check.js +1 -1
  228. package/dist/scripts/doctor-imagegen-repair-check.js +62 -0
  229. package/dist/scripts/ensure-bin-executable.js +11 -3
  230. package/dist/scripts/gate-policy-audit-check.js +130 -0
  231. package/dist/scripts/harness-benchmark-check.js +104 -0
  232. package/dist/scripts/hook-latency-budget-check.js +45 -0
  233. package/dist/scripts/legacy-update-e2e-check.js +228 -0
  234. package/dist/scripts/lib/codex-sdk-gate-lib.js +2 -2
  235. package/dist/scripts/lib/real-codex-parallel-gate.js +2 -2
  236. package/dist/scripts/loop-directive-check-lib.js +1 -1
  237. package/dist/scripts/mad-db-command-check.js +11 -8
  238. package/dist/scripts/mad-db-real-supabase-e2e.js +2 -2
  239. package/dist/scripts/mad-db-route-identity-check.js +8 -6
  240. package/dist/scripts/mad-db-safety-conflict-matrix-check.js +31 -8
  241. package/dist/scripts/mad-db-skill-policy-snapshot-check.js +4 -5
  242. package/dist/scripts/mad-sks-zellij-default-pane-worker-check.js +3 -2
  243. package/dist/scripts/mad-sks-zellij-launch-check.js +1 -1
  244. package/dist/scripts/naruto-zellij-dynamic-right-column-check.js +7 -7
  245. package/dist/scripts/parallel-claim-enforcement-check.js +14 -5
  246. package/dist/scripts/ppt-real-imagegen-wiring-check.js +5 -1
  247. package/dist/scripts/project-skill-dedupe-check.js +23 -5
  248. package/dist/scripts/proof-root-cause-policy-check.js +2 -0
  249. package/dist/scripts/release-affected-selector-check.js +2 -2
  250. package/dist/scripts/release-cache-glob-hashing-check.js +1 -0
  251. package/dist/scripts/release-dag-full-coverage-check.js +13 -4
  252. package/dist/scripts/release-gate-dag-runner-check.js +10 -2
  253. package/dist/scripts/release-gate-dag-runner.js +22 -0
  254. package/dist/scripts/release-gate-existence-audit.js +2 -1
  255. package/dist/scripts/release-gate-planner.js +2 -1
  256. package/dist/scripts/release-gate-script-parity-check.js +1 -1
  257. package/dist/scripts/release-metadata-1-19-check.js +2 -1
  258. package/dist/scripts/release-readiness-report.js +38 -7
  259. package/dist/scripts/release-stability-report-check.js +12 -8
  260. package/dist/scripts/search-visibility-gate-lib.js +2 -2
  261. package/dist/scripts/seo-geo-feature-fixture-quality-check.js +1 -1
  262. package/dist/scripts/skills-manifest-continuity-check.js +46 -0
  263. package/dist/scripts/sks-1-11-gate-lib.js +8 -6
  264. package/dist/scripts/sks-menubar-install-check.js +87 -21
  265. package/dist/scripts/sks-uninstall-regression-check.js +54 -0
  266. package/dist/scripts/uninstall-inventory-check.js +3 -0
  267. package/dist/scripts/ux-review-real-loop-fixture-check.js +9 -4
  268. package/dist/scripts/ux-review-run-wires-imagegen-check.js +4 -0
  269. package/dist/scripts/zellij-layout-valid-check.js +18 -11
  270. package/dist/scripts/zellij-right-column-geometry-proof.js +2 -4
  271. package/dist/scripts/zellij-slot-pane-renderer-check.js +9 -9
  272. package/dist/scripts/zellij-slot-pane-stale-detection-check.js +3 -4
  273. package/dist/scripts/zellij-slot-pane-telemetry-renderer-check.js +3 -2
  274. package/dist/scripts/zellij-slot-telemetry-renderer-check.js +4 -2
  275. package/dist/scripts/zellij-spawn-on-demand-layout-check.js +8 -2
  276. package/dist/scripts/zellij-viewport-binder-check.js +9 -0
  277. package/docs/assets/sneakoscope-architecture-pipeline.jpg +0 -0
  278. package/docs/demo.tape +28 -0
  279. package/package.json +70 -3
  280. package/schemas/codex/completion-proof.schema.json +3 -2
  281. package/schemas/release/release-gate-node.schema.json +2 -1
  282. package/dist/scripts/agent-backfill-route-blackbox.js +0 -5
  283. package/dist/scripts/agent-dynamic-pool-route-blackbox.js +0 -5
  284. package/dist/scripts/agent-parallel-write-blackbox.js +0 -56
  285. package/dist/scripts/agent-patch-swarm-route-blackbox.js +0 -10
  286. package/dist/scripts/agent-route-blackbox-lib.js +0 -132
  287. package/dist/scripts/blackbox-command-import-smoke.js +0 -143
  288. package/dist/scripts/blackbox-global-shim.js +0 -77
  289. package/dist/scripts/blackbox-matrix.js +0 -70
  290. package/dist/scripts/blackbox-npx-one-shot.js +0 -69
  291. package/dist/scripts/blackbox-pack-install.js +0 -174
  292. package/dist/scripts/brand-neutrality-zero-leakage-blackbox.js +0 -4
  293. package/dist/scripts/build-once-runner-blackbox.js +0 -34
  294. package/dist/scripts/codex-0140-integration-blackbox.js +0 -13
  295. package/dist/scripts/codex-agent-type-blackbox.js +0 -4
  296. package/dist/scripts/codex-app-harness-blackbox.js +0 -4
  297. package/dist/scripts/codex-app-skill-agent-blackbox.js +0 -4
  298. package/dist/scripts/codex-hook-approval-blackbox.js +0 -4
  299. package/dist/scripts/codex-init-deep-directory-local-blackbox.js +0 -4
  300. package/dist/scripts/codex-native-feature-broker-blackbox.js +0 -4
  301. package/dist/scripts/codex-native-pattern-analysis-blackbox.js +0 -4
  302. package/dist/scripts/codex-native-read-repair-split-blackbox.js +0 -55
  303. package/dist/scripts/codex-native-reference-cache-blackbox.js +0 -41
  304. package/dist/scripts/core-skill-integrity-blackbox.js +0 -33
  305. package/dist/scripts/dfix-fast-blackbox-check.js +0 -37
  306. package/dist/scripts/dfix-parallel-write-blackbox.js +0 -48
  307. package/dist/scripts/dfix-patch-swarm-route-blackbox.js +0 -10
  308. package/dist/scripts/doctor-context7-mcp-repair-blackbox.js +0 -16
  309. package/dist/scripts/doctor-dirty-repair-blackbox.js +0 -22
  310. package/dist/scripts/doctor-dirty-semantic-blackbox.js +0 -8
  311. package/dist/scripts/doctor-fix-production-blackbox.js +0 -26
  312. package/dist/scripts/doctor-native-capability-repair-blackbox.js +0 -39
  313. package/dist/scripts/doctor-startup-config-repair-blackbox.js +0 -13
  314. package/dist/scripts/doctor-supabase-mcp-repair-blackbox.js +0 -14
  315. package/dist/scripts/doctor-transaction-engine-blackbox.js +0 -28
  316. package/dist/scripts/doctor-zellij-fix-blackbox.js +0 -4
  317. package/dist/scripts/doctor-zellij-no-homebrew-blackbox.js +0 -4
  318. package/dist/scripts/doctor-zellij-upgrade-blackbox.js +0 -4
  319. package/dist/scripts/gate-pack-runner-blackbox.js +0 -27
  320. package/dist/scripts/gate-pack-v2-blackbox.js +0 -18
  321. package/dist/scripts/geo-cli-blackbox-check.js +0 -18
  322. package/dist/scripts/loop-collision-blackbox.js +0 -3
  323. package/dist/scripts/loop-concurrency-oversubscription-blackbox.js +0 -3
  324. package/dist/scripts/loop-fixture-production-misuse-blackbox.js +0 -3
  325. package/dist/scripts/loop-kill-interrupt-real-blackbox.js +0 -3
  326. package/dist/scripts/loop-merge-strategy-blackbox.js +0 -3
  327. package/dist/scripts/loop-mesh-production-e2e-blackbox.js +0 -3
  328. package/dist/scripts/loop-side-effect-blackbox.js +0 -3
  329. package/dist/scripts/mad-db-operation-lifecycle-blackbox.js +0 -29
  330. package/dist/scripts/mad-sks-actual-executor-blackbox.js +0 -5
  331. package/dist/scripts/mad-zellij-headless-fallback-blackbox.js +0 -4
  332. package/dist/scripts/mad-zellij-self-heal-blackbox.js +0 -4
  333. package/dist/scripts/naruto-loop-mesh-blackbox.js +0 -3
  334. package/dist/scripts/naruto-real-parallelism-blackbox.js +0 -307
  335. package/dist/scripts/naruto-worktree-coding-blackbox.js +0 -29
  336. package/dist/scripts/parallel-runtime-real-blackbox.js +0 -44
  337. package/dist/scripts/pipeline-codex-native-doctor-mad-routing-real-blackbox.js +0 -77
  338. package/dist/scripts/pipeline-codex-native-e2e-blackbox.js +0 -13
  339. package/dist/scripts/pipeline-codex-native-image-routing-real-blackbox.js +0 -50
  340. package/dist/scripts/pipeline-codex-native-loop-routing-real-blackbox.js +0 -74
  341. package/dist/scripts/pipeline-codex-native-qa-routing-real-blackbox.js +0 -51
  342. package/dist/scripts/pipeline-codex-native-research-routing-real-blackbox.js +0 -45
  343. package/dist/scripts/pipeline-execution-profile-routing-blackbox.js +0 -4
  344. package/dist/scripts/postinstall-global-doctor-blackbox.js +0 -12
  345. package/dist/scripts/ppt-full-e2e-blackbox-check.js +0 -109
  346. package/dist/scripts/ppt-imagegen-blackbox-check.js +0 -46
  347. package/dist/scripts/project-skill-dedupe-blackbox.js +0 -36
  348. package/dist/scripts/qa-backfill-route-blackbox.js +0 -5
  349. package/dist/scripts/qa-patch-swarm-route-blackbox.js +0 -10
  350. package/dist/scripts/release-full-parallelism-blackbox.js +0 -41
  351. package/dist/scripts/release-triwiki-first-runner-blackbox.js +0 -48
  352. package/dist/scripts/release-wiring-3110-blackbox.js +0 -27
  353. package/dist/scripts/release-wiring-3112-blackbox.js +0 -17
  354. package/dist/scripts/release-wiring-3113-blackbox.js +0 -17
  355. package/dist/scripts/research-backfill-route-blackbox.js +0 -5
  356. package/dist/scripts/research-final-reviewer-blackbox.js +0 -70
  357. package/dist/scripts/research-stage-cycle-runtime-blackbox.js +0 -40
  358. package/dist/scripts/research-synthesis-writer-blackbox.js +0 -24
  359. package/dist/scripts/route-blackbox-realism-check.js +0 -21
  360. package/dist/scripts/scheduler-resource-claim-blackbox.js +0 -24
  361. package/dist/scripts/seo-cli-blackbox-check.js +0 -18
  362. package/dist/scripts/sks-3110-all-feature-regression-blackbox.js +0 -116
  363. package/dist/scripts/sks-3112-all-feature-regression-blackbox.js +0 -29
  364. package/dist/scripts/sks-3113-all-feature-regression-blackbox.js +0 -17
  365. package/dist/scripts/sks-400-all-feature-regression-blackbox.js +0 -21
  366. package/dist/scripts/sks-400-extreme-parallel-blackbox.js +0 -8
  367. package/dist/scripts/sks-400-five-minute-blackbox.js +0 -9
  368. package/dist/scripts/sks-400-legacy-purge-blackbox.js +0 -8
  369. package/dist/scripts/sks-401-all-feature-regression-blackbox.js +0 -46
  370. package/dist/scripts/sks-401-five-minute-actual-blackbox.js +0 -23
  371. package/dist/scripts/sks-402-all-feature-regression-blackbox.js +0 -9
  372. package/dist/scripts/sks-402-five-minute-real-blackbox.js +0 -22
  373. package/dist/scripts/sksd-warm-cache-blackbox.js +0 -12
  374. package/dist/scripts/supabase-secret-preservation-blackbox.js +0 -29
  375. package/dist/scripts/team-backfill-route-blackbox.js +0 -5
  376. package/dist/scripts/team-parallel-write-blackbox.js +0 -55
  377. package/dist/scripts/team-patch-swarm-route-blackbox.js +0 -10
  378. package/dist/scripts/triwiki-affected-graph-blackbox.js +0 -28
  379. package/dist/scripts/triwiki-proof-bank-blackbox.js +0 -30
  380. package/dist/scripts/triwiki-proof-bank-lock-blackbox.js +0 -7
  381. package/dist/scripts/update-preserves-supabase-keys-blackbox.js +0 -27
  382. package/dist/scripts/ux-patch-swarm-route-blackbox.js +0 -10
  383. package/dist/scripts/ux-review-imagegen-blackbox-check.js +0 -67
  384. package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -28
  385. package/dist/scripts/zellij-pane-lock-concurrency-blackbox.js +0 -80
  386. package/dist/scripts/zellij-pane-lock-open-worker-integration-blackbox.js +0 -137
  387. package/dist/scripts/zellij-self-heal-typed-blackbox.js +0 -4
  388. package/dist/scripts/zellij-slot-telemetry-real-blackbox.js +0 -20
  389. package/dist/scripts/zellij-stacked-fallback-integration-blackbox.js +0 -81
  390. package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -202
@@ -4,6 +4,7 @@ import { finalizeRouteWithProof } from './route-finalizer.js';
4
4
  import { routeRequiresAgentIntake } from '../agents/agent-plan.js';
5
5
  import { readAgentGateStatus } from '../agents/agent-gate.js';
6
6
  import { DEFAULT_AGENT_COUNT } from '../agents/agent-schema.js';
7
+ import { evaluateGate } from '../stop-gate/gate-evaluator.js';
7
8
  const AGENT_ARTIFACTS = [
8
9
  'agents/agent-proof-evidence.json',
9
10
  'agents/agent-sessions.json',
@@ -18,10 +19,13 @@ export async function maybeFinalizeRoute(root, { missionId, route, gateFile = nu
18
19
  return { ok: false, skipped: true, reason: 'mission_id_or_route_missing' };
19
20
  }
20
21
  const missionDir = path.join(root, '.sneakoscope', 'missions', missionId);
21
- const gateObject = gate || (gateFile && await exists(path.join(missionDir, gateFile))
22
+ const diskGateObject = gateFile && await exists(path.join(missionDir, gateFile))
22
23
  ? await readJson(path.join(missionDir, gateFile), null)
23
- : null);
24
- const passed = gateObject?.passed === true || gateObject?.ok === true || gateObject?.status === 'pass';
24
+ : null;
25
+ const gateObject = diskGateObject || gate || null;
26
+ const gateVerdict = gateFile ? await evaluateGate(root, missionId, gateFile) : null;
27
+ const callerGateMismatch = Boolean(gate && diskGateObject && stableJson(gate) !== stableJson(diskGateObject));
28
+ const passed = gateVerdict ? gateVerdict.pass && !callerGateMismatch : gateObject?.passed === true || gateObject?.ok === true || gateObject?.status === 'pass';
25
29
  const mission = await readJson(path.join(missionDir, 'mission.json'), {});
26
30
  const prompt = mission.prompt || '';
27
31
  const agentRequired = agents !== false && routeRequiresAgentIntake(route, { task: prompt, noAgents: agents === false });
@@ -30,8 +34,18 @@ export async function maybeFinalizeRoute(root, { missionId, route, gateFile = nu
30
34
  const agentGate = agentRequired ? await readAgentGateStatus(root, missionId) : null;
31
35
  const agentArtifacts = agentGate ? await existingAgentArtifacts(root, missionId) : [];
32
36
  const agentBlockers = agentRequired && agentGate?.ok !== true ? ['agent_gate_not_passed'] : [];
33
- const effectiveAgentBlockers = mock ? [] : agentBlockers;
34
- const finalStatus = statusHint || (blockers.length || effectiveAgentBlockers.length ? 'blocked' : (passed ? (mock ? 'verified_partial' : 'verified') : (mock ? 'verified_partial' : 'blocked')));
37
+ const gateBlockers = gateVerdict && !gateVerdict.pass
38
+ ? [`route_gate_${gateVerdict.verdict}`, ...gateVerdict.reasons.map((item) => `route_gate_${item}`)]
39
+ : [];
40
+ if (callerGateMismatch)
41
+ gateBlockers.push('route_gate_caller_disk_mismatch');
42
+ const computedStatus = computeAutoFinalizeStatus({
43
+ mock,
44
+ passed,
45
+ blockers: [...blockers, ...agentBlockers, ...gateBlockers]
46
+ });
47
+ const statusResolution = applyStatusHint(computedStatus, statusHint);
48
+ const finalStatus = statusResolution.status;
35
49
  const proof = await finalizeRouteWithProof(root, {
36
50
  missionId,
37
51
  route,
@@ -48,14 +62,18 @@ export async function maybeFinalizeRoute(root, { missionId, route, gateFile = nu
48
62
  ...(agentGate?.proof?.fake_backend_disclaimer ? [agentGate.proof.fake_backend_disclaimer] : []),
49
63
  ...(mock && agentBlockers.length ? [`Mock agent intake does not satisfy full production gate: ${agentBlockers.join(', ')}`] : []),
50
64
  ...(mock ? ['Route was finalized from an explicit mock/fixture command path.'] : []),
65
+ ...(gateVerdict?.verdict === 'mock_only' ? ['Route gate is mock fixture evidence and cannot satisfy a real completion gate.'] : []),
66
+ ...(statusResolution.rejected ? [`statusHint rejected: requested ${statusResolution.rejected.requested}, computed ${statusResolution.rejected.computed}.`] : []),
51
67
  ...(!passed && !mock ? ['Route gate did not pass' + (reason ? ': ' + reason : '') + '.'] : [])
52
68
  ],
53
69
  blockers: [
54
70
  ...blockers,
55
- ...effectiveAgentBlockers,
56
- ...(!passed && !mock ? ['route_gate_not_passed'] : [])
71
+ ...agentBlockers,
72
+ ...gateBlockers,
73
+ ...(!passed && !mock && !gateBlockers.length ? ['route_gate_not_passed'] : [])
57
74
  ],
58
75
  statusHint: finalStatus,
76
+ statusHintRejected: statusResolution.rejected,
59
77
  mock,
60
78
  fixClaim,
61
79
  requireRelation,
@@ -65,7 +83,7 @@ export async function maybeFinalizeRoute(root, { missionId, route, gateFile = nu
65
83
  failureAnalysis,
66
84
  lightweightEvidence
67
85
  });
68
- return { ...proof, auto_finalized: true, gate_passed: passed, status_hint: finalStatus };
86
+ return { ...proof, auto_finalized: true, gate_passed: passed, gate_verdict: gateVerdict, status_hint: finalStatus, status_hint_rejected: statusResolution.rejected };
69
87
  }
70
88
  async function existingAgentArtifacts(root, missionId) {
71
89
  const dir = path.join(root, '.sneakoscope', 'missions', missionId);
@@ -94,8 +112,9 @@ async function ensureMockAgentEvidence(root, missionId, route, prompt) {
94
112
  if (!(await exists(path.join(dir, 'agent-proof-evidence.json')))) {
95
113
  await writeJsonAtomic(path.join(dir, 'agent-proof-evidence.json'), {
96
114
  schema: 'sks.agent-proof-evidence.v1',
97
- ok: true,
98
- status: 'passed',
115
+ ok: false,
116
+ status: 'mock_fixture',
117
+ execution_class: 'mock_fixture',
99
118
  mission_id: missionId,
100
119
  route,
101
120
  backend: 'fake',
@@ -109,8 +128,48 @@ async function ensureMockAgentEvidence(root, missionId, route, prompt) {
109
128
  consensus_ok: true,
110
129
  janitor_report: 'agents/agent-janitor-report.json',
111
130
  janitor_ok: true,
112
- blockers: []
131
+ blockers: ['mock_fixture_cannot_satisfy_real_agent_gate']
113
132
  });
114
133
  }
115
134
  }
135
+ const STATUS_RANK = {
136
+ blocked: 0,
137
+ failed: 0,
138
+ not_verified: 0,
139
+ mock_only: 1,
140
+ verified_partial: 2,
141
+ verified: 3
142
+ };
143
+ function computeAutoFinalizeStatus({ mock, passed, blockers }) {
144
+ if (mock)
145
+ return 'mock_only';
146
+ if (blockers.length > 0)
147
+ return 'blocked';
148
+ return passed ? 'verified' : 'blocked';
149
+ }
150
+ function applyStatusHint(computed, requested) {
151
+ if (!requested)
152
+ return { status: computed, rejected: null };
153
+ const requestedRank = STATUS_RANK[requested];
154
+ const computedRank = STATUS_RANK[computed];
155
+ if (requestedRank === undefined || computedRank === undefined) {
156
+ return { status: computed, rejected: { requested, computed, reason: 'unknown_status_hint' } };
157
+ }
158
+ if (computed === 'mock_only' && requested !== 'mock_only') {
159
+ return { status: computed, rejected: { requested, computed, reason: 'mock_fixture_status_cap' } };
160
+ }
161
+ if (requestedRank > computedRank) {
162
+ return { status: computed, rejected: { requested, computed, reason: 'status_hint_upgrade_rejected' } };
163
+ }
164
+ return { status: requested, rejected: null };
165
+ }
166
+ function stableJson(value) {
167
+ if (Array.isArray(value))
168
+ return `[${value.map(stableJson).join(',')}]`;
169
+ if (value && typeof value === 'object') {
170
+ const record = value;
171
+ return `{${Object.keys(record).sort().map((key) => `${JSON.stringify(key)}:${stableJson(record[key])}`).join(',')}}`;
172
+ }
173
+ return JSON.stringify(value);
174
+ }
116
175
  //# sourceMappingURL=auto-finalize.js.map
@@ -3,6 +3,7 @@ export const COMPLETION_PROOF_SCHEMA = 'sks.completion-proof.v1';
3
3
  export const COMPLETION_PROOF_STATUSES = Object.freeze([
4
4
  'verified',
5
5
  'verified_partial',
6
+ 'mock_only',
6
7
  'blocked',
7
8
  'not_verified',
8
9
  'failed'
@@ -12,6 +13,7 @@ export function emptyCompletionProof(overrides = {}) {
12
13
  schema: COMPLETION_PROOF_SCHEMA,
13
14
  version: PACKAGE_VERSION,
14
15
  generated_at: nowIso(),
16
+ execution_class: null,
15
17
  mission_id: null,
16
18
  route: null,
17
19
  status: 'not_verified',
@@ -5,7 +5,7 @@ import { normalizeProofRoute, routeRequiresImageVoxelAnchors } from './route-pro
5
5
  import { linkProofClaimsToEvidence, proofEvidenceSummary } from '../evidence/evidence-proof-linker.js';
6
6
  import { writeTrustArtifactsForProof } from '../trust-kernel/trust-report.js';
7
7
  import { enforceRetention } from '../retention.js';
8
- export async function writeRouteCompletionProof(root, { missionId = null, route = null, status = 'verified_partial', gate = null, summary = {}, artifacts = [], evidence = {}, claims = [], unverified = [], blockers = [], failureAnalysis = null, nextHumanActions = [], lightweightEvidence = false } = {}) {
8
+ export async function writeRouteCompletionProof(root, { missionId = null, route = null, status = 'verified_partial', gate = null, summary = {}, artifacts = [], evidence = {}, claims = [], unverified = [], blockers = [], failureAnalysis = null, nextHumanActions = [], lightweightEvidence = false, executionClass = null, statusHintRejected = null } = {}) {
9
9
  const collected = lightweightEvidence ? { files: [] } : await collectProofEvidence(root);
10
10
  const normalizedRoute = normalizeProofRoute(route);
11
11
  const mergedEvidence = {
@@ -21,6 +21,7 @@ export async function writeRouteCompletionProof(root, { missionId = null, route
21
21
  unverified
22
22
  });
23
23
  const written = await writeCompletionProof(root, {
24
+ execution_class: executionClass,
24
25
  mission_id: missionId,
25
26
  route: normalizedRoute,
26
27
  status: normalizedStatus,
@@ -36,6 +37,7 @@ export async function writeRouteCompletionProof(root, { missionId = null, route
36
37
  claims,
37
38
  unverified,
38
39
  blockers,
40
+ ...(statusHintRejected ? { status_hint_rejected: statusHintRejected } : {}),
39
41
  failure_analysis: normalizeFailureAnalysis(failureAnalysis || evidence.failure_analysis || evidence.root_cause_analysis),
40
42
  next_human_actions: nextHumanActions
41
43
  }, {
@@ -88,6 +90,8 @@ function normalizeFailureAnalysis(value) {
88
90
  };
89
91
  }
90
92
  function normalizeRouteProofStatus(status, { route, evidence, blockers, unverified }) {
93
+ if (status === 'mock_only')
94
+ return 'mock_only';
91
95
  if (blockers?.length)
92
96
  return status === 'failed' ? 'failed' : 'blocked';
93
97
  if (status === 'verified' && unverified?.length)
@@ -7,7 +7,7 @@ import { wrongnessProofEvidence } from '../triwiki-wrongness/wrongness-proof-lin
7
7
  import { computerUseStatusReport } from '../computer-use-status.js';
8
8
  import { readComputerUseLiveEvidence } from '../computer-use-live-evidence.js';
9
9
  import { leanChangeEvidenceFromReport, scanCodeStructure } from '../code-structure.js';
10
- export async function finalizeRouteWithProof(root, { missionId, route, gateFile = null, gate = null, artifacts = [], visualEvidence = null, dbEvidence = null, madSksEvidence = null, testEvidence = null, commandEvidence = null, claims = [], unverified = [], blockers = [], statusHint = 'verified_partial', strict = false, mock = false, fixClaim = false, requireRelation = false, visualClaim = undefined, agents = undefined, allowActiveWrongnessPartial = false, failureAnalysis = null, lightweightEvidence = false } = {}) {
10
+ export async function finalizeRouteWithProof(root, { missionId, route, gateFile = null, gate = null, artifacts = [], visualEvidence = null, dbEvidence = null, madSksEvidence = null, testEvidence = null, commandEvidence = null, claims = [], unverified = [], blockers = [], statusHint = 'verified_partial', strict = false, mock = false, fixClaim = false, requireRelation = false, visualClaim = undefined, agents = undefined, allowActiveWrongnessPartial = false, failureAnalysis = null, lightweightEvidence = false, statusHintRejected = null } = {}) {
11
11
  const policy = routeFinalizerPolicy(route, { strict, fixClaim, requireRelation, visualClaim });
12
12
  const localBlockers = [...blockers];
13
13
  const providedVisualEvidence = visualEvidence;
@@ -68,10 +68,11 @@ export async function finalizeRouteWithProof(root, { missionId, route, gateFile
68
68
  || !computerUseLive?.evidence
69
69
  || computerUseLive.evidence.mode !== 'live_capture_success'
70
70
  || computerUseLive.evidence.image_voxel?.linked !== true));
71
- const status = localBlockers.length
72
- ? (strict ? 'blocked' : statusHint === 'verified' ? 'verified_partial' : statusHint)
73
- : visualComputerUseDowngrade ? 'verified_partial'
74
- : statusHint;
71
+ const status = mock ? 'mock_only'
72
+ : localBlockers.length
73
+ ? (strict ? 'blocked' : statusHint === 'verified' ? 'verified_partial' : statusHint)
74
+ : visualComputerUseDowngrade ? 'verified_partial'
75
+ : statusHint;
75
76
  const finalUnverified = [
76
77
  ...unverified,
77
78
  ...(imageEvidence?.mock ? ['Image voxel evidence is mock fixture evidence and does not claim a real visual run.'] : []),
@@ -138,6 +139,8 @@ export async function finalizeRouteWithProof(root, { missionId, route, gateFile
138
139
  blockers: localBlockers,
139
140
  failureAnalysis: resolvedFailureAnalysis,
140
141
  lightweightEvidence,
142
+ executionClass: mock ? 'mock_fixture' : 'real',
143
+ statusHintRejected,
141
144
  summary: {
142
145
  files_changed: collected.files?.length || 0,
143
146
  commands_run: evidence.commands?.length || 0,
@@ -26,20 +26,33 @@ export async function writeSelftestRouteProof(root, { missionId, route = '$Team'
26
26
  return writeRouteCompletionProof(root, {
27
27
  missionId,
28
28
  route,
29
- status: 'verified_partial',
30
- gate: { passed: true, source: gateSource || defaults.gateSource },
29
+ status: 'mock_only',
30
+ executionClass: 'mock_fixture',
31
+ gate: {
32
+ passed: false,
33
+ ok: false,
34
+ execution_class: 'mock_fixture',
35
+ source: gateSource || defaults.gateSource,
36
+ blockers: ['selftest_fixture_cannot_claim_real_route_completion']
37
+ },
31
38
  summary: { selftest: true, tests_passed: 1, manual_review_required: true },
32
39
  artifacts: artifacts || defaults.artifacts,
33
40
  evidence: {
34
- route_gate: { passed: true },
35
- commands: [{ cmd: 'sks selftest --mock', status: 'verified_partial' }]
41
+ route_gate: {
42
+ passed: false,
43
+ ok: false,
44
+ execution_class: 'mock_fixture',
45
+ blockers: ['selftest_fixture_cannot_claim_real_route_completion']
46
+ },
47
+ commands: [{ cmd: 'sks selftest --mock', status: 'mock_only' }]
36
48
  },
37
49
  claims: [{
38
50
  id: `selftest-${kind.replaceAll('_', '-')}-proof`,
39
51
  text: CLAIM_TEXT[kind] || CLAIM_TEXT.team_gate,
40
52
  status: 'verified_partial'
41
53
  }],
42
- unverified: unverified || defaults.unverified
54
+ unverified: unverified || defaults.unverified,
55
+ blockers: ['selftest_fixture_cannot_claim_real_route_completion']
43
56
  });
44
57
  }
45
58
  //# sourceMappingURL=selftest-proof-fixtures.js.map
@@ -10,6 +10,8 @@ export function validateCompletionProof(proof = {}) {
10
10
  issues.push('schema');
11
11
  if (!COMPLETION_PROOF_STATUSES.includes(String(record.status)))
12
12
  issues.push('status');
13
+ if (!['real', 'mock_fixture'].includes(String(record.execution_class)))
14
+ issues.push('execution_class');
13
15
  if (!record.summary || typeof record.summary !== 'object')
14
16
  issues.push('summary');
15
17
  if (!record.evidence || typeof record.evidence !== 'object')
@@ -0,0 +1,53 @@
1
+ const CHAINS = {
2
+ quick: [
3
+ { model: 'gpt-5.4-mini', reasoning: 'low', serviceTier: 'fast' },
4
+ { model: 'gpt-5.5', reasoning: 'low', serviceTier: 'fast' }
5
+ ],
6
+ standard: [
7
+ { model: 'gpt-5.5', reasoning: 'medium', serviceTier: 'fast' }
8
+ ],
9
+ agentic: [
10
+ { model: 'gpt-5.3-codex', reasoning: 'high', serviceTier: 'fast' },
11
+ { model: 'gpt-5.5', reasoning: 'high', serviceTier: 'fast' }
12
+ ],
13
+ ultrabrain: [
14
+ { model: 'gpt-5.5', reasoning: 'xhigh', serviceTier: 'standard' }
15
+ ],
16
+ verify: [
17
+ { model: 'gpt-5.4-mini', reasoning: 'medium', serviceTier: 'fast' }
18
+ ],
19
+ review: [
20
+ { model: 'gpt-5.5', reasoning: 'high', serviceTier: 'fast' }
21
+ ]
22
+ };
23
+ export async function routeModel(category, opts = {}) {
24
+ const chain = CHAINS[category] || CHAINS.standard;
25
+ const degraded = new Set((opts.lbHealth?.degraded_models || []).map((model) => String(model)));
26
+ for (const choice of chain) {
27
+ if (degraded.has(choice.model))
28
+ continue;
29
+ if (opts.lbHealth?.quota_low && choice.reasoning === 'xhigh')
30
+ return { ...choice, reasoning: 'high' };
31
+ return choice;
32
+ }
33
+ return chain[chain.length - 1] ?? CHAINS.standard[0];
34
+ }
35
+ export function categoryForWorkerRole(role) {
36
+ const text = String(role || '').toLowerCase();
37
+ if (/verif|test|qa/.test(text))
38
+ return 'verify';
39
+ if (/review|critic|judge/.test(text))
40
+ return 'review';
41
+ if (/research|explore|read|scout/.test(text))
42
+ return 'quick';
43
+ if (/plan|architect|strategy/.test(text))
44
+ return 'ultrabrain';
45
+ return 'agentic';
46
+ }
47
+ export function modelRouteReason(category, choice, opts = {}) {
48
+ if (opts.explicit)
49
+ return `${category}->${choice.model} (explicit env override)`;
50
+ const suffix = opts.quotaLow ? 'quota discipline' : opts.degraded?.length ? 'lb degraded fallback' : 'quota discipline';
51
+ return `${category}->${choice.model} (${suffix})`;
52
+ }
53
+ //# sourceMappingURL=model-router.js.map
@@ -263,7 +263,7 @@ export function inferAnswersForPrompt(prompt, explicitAnswers = {}) {
263
263
  };
264
264
  const criteria = {
265
265
  version: [version ? `version refs are ${version}` : 'version refs advance consistently', 'publish:dry gate passes', 'npm publish is not run'],
266
- chat_capture: ['From-Chat-IMG activates chat-image intake only here', 'all visible chat requirements are listed before implementation', `${FROM_CHAT_IMG_COVERAGE_ARTIFACT} maps every customer request, screenshot region, and attachment to work-order item(s)`, `${FROM_CHAT_IMG_CHECKLIST_ARTIFACT} is updated as each request, image match, work item, scoped QA-LOOP, and verification step is completed`, `${FROM_CHAT_IMG_TEMP_TRIWIKI_ARTIFACT} records temporary TriWiki-backed session context with retention metadata`, `${FROM_CHAT_IMG_QA_LOOP_ARTIFACT} proves QA-LOOP ran over the exact customer-request work-order range after implementation`, 'unresolved_items is empty before Team completion', 'scoped_qa_loop_completed is true with zero unresolved QA findings', 'Web/browser visual inspection uses Codex Chrome Extension readiness first; native Mac/non-web visual inspection uses Codex Computer Use when available', CODEX_WEB_VERIFICATION_POLICY, CODEX_COMPUTER_USE_ONLY_POLICY, 'client requests follow normal SKS gates and verification'],
266
+ chat_capture: ['From-Chat-IMG activates chat-image intake only here', 'all visible chat requirements are listed before implementation', `${FROM_CHAT_IMG_COVERAGE_ARTIFACT} maps every customer request, screenshot region, and attachment to work-order item(s)`, `${FROM_CHAT_IMG_CHECKLIST_ARTIFACT} is updated as each request, image match, work item, scoped QA-LOOP, and verification step is completed`, `${FROM_CHAT_IMG_TEMP_TRIWIKI_ARTIFACT} records temporary TriWiki-backed session context with retention metadata`, `${FROM_CHAT_IMG_QA_LOOP_ARTIFACT} proves QA-LOOP ran over the exact customer-request work-order range after implementation`, 'unresolved_items is empty before Naruto completion', 'scoped_qa_loop_completed is true with zero unresolved QA findings', 'Web/browser visual inspection uses Codex Chrome Extension readiness first; native Mac/non-web visual inspection uses Codex Computer Use when available', CODEX_WEB_VERIFICATION_POLICY, CODEX_COMPUTER_USE_ONLY_POLICY, 'client requests follow normal SKS gates and verification'],
267
267
  triwiki_audit: ['TriWiki ingestion, voxel attention, and contract consumption paths are inspected against current code', 'repeat-mistake prevention gaps are fixed in the relevant code path or blocked with evidence', 'regression coverage proves fresh/high-weight mistake memory can influence future missions', 'final status separates supported behavior from anything still unverified'],
268
268
  priority: ['strong feedback raises required_weight', 'request topics are counted in wiki packs', 'future inference uses priority signals'],
269
269
  request_intake: ['request-intake.json records original prompt, interpreted intent, source-order requirements, wiki context used, and transformed prompt', 'pipeline-plan.json attaches request_intake metadata and execution_prompt from request-intake.transformed_prompt', 'decision-contract.json preserves the same request-intake artifact when a contract is sealed'],
@@ -598,7 +598,7 @@ async function buildL2(root, dir) {
598
598
  const pipelinePlan = await readJson(path.join(dir, 'pipeline-plan.json'), null);
599
599
  const contract = await readJson(path.join(dir, 'decision-contract.json'), null);
600
600
  const statusLedger = await readJson(path.join(dir, MISSION_STATUS_LEDGER_ARTIFACT), null);
601
- const gateFiles = ['team-gate.json', 'research-gate.evaluated.json', 'research-gate.json', 'db-review.json', 'qa-gate.json', 'ppt-gate.json', 'image-ux-review-gate.json', 'gx-gate.json', 'hard-blocker.json'];
601
+ const gateFiles = ['naruto-gate.json', 'research-gate.evaluated.json', 'research-gate.json', 'db-review.json', 'qa-gate.json', 'ppt-gate.json', 'image-ux-review-gate.json', 'gx-gate.json', 'hard-blocker.json', 'team-gate.json']; // team-gate is legacy read-only recall for old missions.
602
602
  const gates = [];
603
603
  for (const file of gateFiles) {
604
604
  const gate = await readJson(path.join(dir, file), null);
@@ -32,7 +32,7 @@ export const ALWAYS_ON_GATES = new Set([
32
32
  'postinstall:safe-side-effects',
33
33
  'publish:packlist-performance',
34
34
  'legacy:upgrade-zero-break',
35
- 'release:version-truth',
35
+ 'release:proof-truth',
36
36
  'release:dynamic-performance',
37
37
  'release:provenance',
38
38
  'changelog:check'
@@ -46,7 +46,7 @@ export const REQUIRED_FOR_PUBLISH = new Set([
46
46
  'safety:side-effect-zero',
47
47
  'safety:mutation-callsite-coverage:repo-wide',
48
48
  'side-effect:runtime-report',
49
- 'release:version-truth',
49
+ 'release:proof-truth',
50
50
  'release:provenance',
51
51
  'release:codex-current',
52
52
  'codex:0142:manifest',
@@ -1,15 +1,8 @@
1
1
  import { spawnSync } from 'node:child_process';
2
2
  const ALWAYS_KEEP = new Set([
3
- 'release:version-truth',
3
+ 'release:proof-truth',
4
4
  'release:dag-full-coverage',
5
- 'release:codex-current',
6
- 'codex:0142:manifest',
7
- 'codex:0142:binary-identity',
8
- 'codex:0142:policy',
9
- 'codex:0142:app-server-v2',
10
- 'codex:0142:thread-store',
11
- 'codex:0142:capability',
12
- 'runtime:ts-source-of-truth',
5
+ 'release:runtime-truth-matrix',
13
6
  'typecheck',
14
7
  'schema:check'
15
8
  ]);
@@ -79,7 +72,7 @@ function gateSelectionReason(gate, changedFiles, preset) {
79
72
  if (matchingReleaseScript)
80
73
  return 'release_script_changed';
81
74
  if (changedFiles.some((file) => file.startsWith('src/scripts/prepublish-') || file.startsWith('src/scripts/publish-'))) {
82
- if (releaseGate && gate.id === 'release:version-truth')
75
+ if (releaseGate && gate.id === 'release:proof-truth')
83
76
  return 'publish_or_prepublish_script_changed';
84
77
  }
85
78
  if (changedFiles.some((file) => file.startsWith('src/scripts/scheduler-') || file.startsWith('src/core/scheduler/'))) {
@@ -1,6 +1,6 @@
1
1
  import { spawn } from 'node:child_process';
2
2
  import path from 'node:path';
3
- import { createReleaseGateHermeticEnv } from './release-gate-hermetic-env.js';
3
+ import { cleanupReleaseGateHermeticEnv, createReleaseGateHermeticEnv } from './release-gate-hermetic-env.js';
4
4
  import { writeReleaseGateJson } from './release-gate-report.js';
5
5
  import { guardedProcessKill, guardContextForRoute } from '../safety/mutation-guard.js';
6
6
  import { createRequestedScopeContract } from '../safety/requested-scope-contract.js';
@@ -69,7 +69,9 @@ function runOne(root, runId, reportRoot, gate) {
69
69
  if (timeoutCleanup)
70
70
  await timeoutCleanup;
71
71
  const exitCode = timedOut ? 124 : code;
72
- resolve({ id: gate.id, ok: exitCode === 0, exit_code: exitCode, signal, timed_out: timedOut, duration_ms: Date.now() - started, report_dir: hermetic.report_dir });
72
+ const result = { id: gate.id, ok: exitCode === 0, exit_code: exitCode, signal, timed_out: timedOut, duration_ms: Date.now() - started, report_dir: hermetic.report_dir };
73
+ cleanupReleaseGateHermeticEnv(hermetic);
74
+ resolve(result);
73
75
  })();
74
76
  });
75
77
  });
@@ -19,7 +19,7 @@ export function releaseGateProofBankFile(root) {
19
19
  // sources, which are inputs of ~280 gates (via `package.json` and `src/**`).
20
20
  // Before this normalization every publish re-ran the entire DAG from zero
21
21
  // (test:blackbox alone is ~11 minutes) even when no behavior changed.
22
- // Version-CORRECTNESS gates (release:version-truth, release:metadata, ...)
22
+ // Version/proof-correctness gates (release:proof-truth, release:metadata, ...)
23
23
  // are declared with `cache.enabled: false`, so they always re-run and still
24
24
  // catch version drift. Set SKS_RELEASE_CACHE_VERSION_SENSITIVE=1 to restore
25
25
  // the old fully version-sensitive hashing.
@@ -31,6 +31,7 @@ const VERSION_NEUTRAL_CACHE_FILES = new Set([
31
31
  'src/bin/sks.ts',
32
32
  'dist/build-manifest.json'
33
33
  ]);
34
+ const INPUT_DIGEST_MEMO = new Map();
34
35
  export function releaseGateCacheKey(root, gate) {
35
36
  const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
36
37
  const releaseVersion = String(pkg.version || '');
@@ -52,23 +53,35 @@ export function releaseGateCacheKey(root, gate) {
52
53
  hashFileIfPresent(hash, path.join(root, 'dist', 'build-manifest.json'));
53
54
  }
54
55
  for (const input of gate.cache.inputs) {
55
- const expanded = expandGlob(root, input);
56
56
  hash.update(`input:${input}`);
57
- if (!expanded.length) {
58
- hash.update(`missing_or_empty:${input}`);
59
- continue;
60
- }
61
- for (const file of expanded) {
62
- const rel = path.relative(root, file);
63
- hash.update(rel);
64
- if (!versionSensitive && VERSION_NEUTRAL_CACHE_FILES.has(rel))
65
- hashVersionNeutralFile(hash, rel, file, releaseVersion);
66
- else
67
- hashFileIfPresent(hash, file);
68
- }
57
+ hash.update(releaseGateInputDigest(root, input, { versionSensitive, releaseVersion }));
69
58
  }
70
59
  return hash.digest('hex');
71
60
  }
61
+ function releaseGateInputDigest(root, input, opts) {
62
+ const memoKey = `${path.resolve(root)}\0${input}\0${opts.versionSensitive ? 'sensitive' : 'neutral'}\0${opts.releaseVersion}`;
63
+ if (process.env.SKS_RELEASE_GATE_CACHE_MEMOIZE === '1') {
64
+ const cached = INPUT_DIGEST_MEMO.get(memoKey);
65
+ if (cached)
66
+ return cached;
67
+ }
68
+ const hash = crypto.createHash('sha256');
69
+ const expanded = expandGlob(root, input);
70
+ if (!expanded.length)
71
+ hash.update(`missing_or_empty:${input}`);
72
+ for (const file of expanded) {
73
+ const rel = path.relative(root, file);
74
+ hash.update(rel);
75
+ if (!opts.versionSensitive && VERSION_NEUTRAL_CACHE_FILES.has(rel))
76
+ hashVersionNeutralFile(hash, rel, file, opts.releaseVersion);
77
+ else
78
+ hashFileIfPresent(hash, file);
79
+ }
80
+ const digest = hash.digest('hex');
81
+ if (process.env.SKS_RELEASE_GATE_CACHE_MEMOIZE === '1')
82
+ INPUT_DIGEST_MEMO.set(memoKey, digest);
83
+ return digest;
84
+ }
72
85
  function hashVersionNeutralFile(hash, rel, file, releaseVersion) {
73
86
  if (!fs.existsSync(file) || !fs.statSync(file).isFile())
74
87
  return;
@@ -1,7 +1,7 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { spawn } from 'node:child_process';
4
- import { createReleaseGateHermeticEnv } from './release-gate-hermetic-env.js';
4
+ import { cleanupReleaseGateHermeticEnv, cleanupReleaseGateRunTemp, createReleaseGateHermeticEnv } from './release-gate-hermetic-env.js';
5
5
  import { appendReleaseGateJsonl, writeReleaseGateJson } from './release-gate-report.js';
6
6
  import { findReadyReleaseGateNodes, findReleaseGatesBlockedByFailedDeps, pickReadyLaunchableReleaseGates } from './release-gate-scheduler.js';
7
7
  import { readReleaseGateCacheRecord, releaseGateProofBankFile, writeReleaseGateCacheHit } from './release-gate-cache-v2.js';
@@ -14,6 +14,7 @@ import { computeResourceClassBudget } from './resource-class-budget.js';
14
14
  import { guardedProcessKill, guardContextForRoute } from '../safety/mutation-guard.js';
15
15
  import { createRequestedScopeContract } from '../safety/requested-scope-contract.js';
16
16
  import { rmrf } from '../fsx.js';
17
+ import { sweepSksTempDirs } from '../retention.js';
17
18
  export function loadReleaseGateManifest(root, file = 'release-gates.v2.json') {
18
19
  const manifestPath = path.join(root, file);
19
20
  const parsed = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
@@ -58,6 +59,7 @@ export async function runReleaseGateDag(input) {
58
59
  : new Set();
59
60
  const runId = `rg-${new Date().toISOString().replace(/[:.]/g, '-')}-${process.pid}`;
60
61
  const retentionBefore = await pruneOldReleaseGateRunDirs(root);
62
+ await sweepSksTempDirs(root, { maxAgeHours: 24 }).catch(() => null);
61
63
  const reportDir = path.join(root, '.sneakoscope', 'reports', 'release-gates', runId);
62
64
  fs.mkdirSync(reportDir, { recursive: true });
63
65
  const timeline = path.join(reportDir, 'timeline.jsonl');
@@ -167,6 +169,7 @@ export async function runReleaseGateDag(input) {
167
169
  sumGateMs += report.critical_path_ms || 0;
168
170
  }
169
171
  const packed = writeSummarySnapshot(true);
172
+ cleanupReleaseGateRunTemp(runId);
170
173
  return {
171
174
  ...packed,
172
175
  ok: packed.ok && packRun.ok,
@@ -258,6 +261,7 @@ export async function runReleaseGateDag(input) {
258
261
  const finalResult = { ...result, retention: mergeReleaseGateRetention(retentionBefore, retentionAfter) };
259
262
  appendReleaseGateJsonl(timeline, { event: 'retention', phase: 'after_run', ...retentionAfter, at: new Date().toISOString() });
260
263
  writeReleaseGateJson(path.join(reportDir, 'summary.json'), finalResult);
264
+ cleanupReleaseGateRunTemp(runId);
261
265
  return finalResult;
262
266
  }
263
267
  export function selectReleaseGatePreset(manifest, preset) {
@@ -348,6 +352,7 @@ function runGate(root, runId, reportRoot, gate) {
348
352
  const exitCode = timedOut ? 124 : code;
349
353
  const result = { id: gate.id, ok: exitCode === 0, exit_code: exitCode, signal, timed_out: timedOut, duration_ms: durationMs, cached: false, stderr_tail: stderrTail };
350
354
  writeReleaseGateJson(path.join(hermetic.report_dir, 'result.json'), { schema: 'sks.release-gate-result.v1', ...result, stdout_log: stdoutFile, stderr_log: stderrFile });
355
+ cleanupReleaseGateHermeticEnv(hermetic);
351
356
  resolve(result);
352
357
  })();
353
358
  });
@@ -32,4 +32,14 @@ export function createReleaseGateHermeticEnv(input) {
32
32
  }
33
33
  };
34
34
  }
35
+ export function cleanupReleaseGateHermeticEnv(env) {
36
+ if (process.env.SKS_KEEP_GATE_ENV === '1')
37
+ return;
38
+ fs.rmSync(env.tmp_dir, { recursive: true, force: true });
39
+ }
40
+ export function cleanupReleaseGateRunTemp(runId) {
41
+ if (process.env.SKS_KEEP_GATE_ENV === '1')
42
+ return;
43
+ fs.rmSync(path.join(os.tmpdir(), 'sks-gate', runId), { recursive: true, force: true });
44
+ }
35
45
  //# sourceMappingURL=release-gate-hermetic-env.js.map
@@ -16,6 +16,7 @@ export const RELEASE_GATE_RESOURCE_CLASSES = [
16
16
  'global-config',
17
17
  'publish',
18
18
  'fs-read',
19
+ 'fs-write',
19
20
  'timing-sensitive'
20
21
  ];
21
22
  export function validateReleaseGateManifest(input) {
@@ -47,6 +48,8 @@ export function validateReleaseGateManifest(input) {
47
48
  errors.push(`gate_side_effect_invalid:${gate?.id || 'unknown'}`);
48
49
  if (!Number.isFinite(Number(gate?.timeout_ms)) || Number(gate.timeout_ms) <= 0)
49
50
  errors.push(`gate_timeout_missing:${gate?.id || 'unknown'}`);
51
+ if (gate?.output_contract !== undefined && gate.output_contract !== 'sks.gate-result.v1')
52
+ errors.push(`gate_output_contract_invalid:${gate?.id || 'unknown'}`);
50
53
  if (!gate?.cache || typeof gate.cache.enabled !== 'boolean' || !Array.isArray(gate.cache.inputs))
51
54
  errors.push(`gate_cache_missing:${gate?.id || 'unknown'}`);
52
55
  if (!gate?.isolation || gate.isolation.report_dir !== 'per-gate')
@@ -19,6 +19,7 @@ export function defaultReleaseGateBudget() {
19
19
  'global-config': 1,
20
20
  publish: 1,
21
21
  'fs-read': Math.min(96, cores * 10),
22
+ 'fs-write': Math.min(12, Math.max(1, cores)),
22
23
  'timing-sensitive': 1
23
24
  };
24
25
  for (const key of Object.keys(base)) {