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
@@ -0,0 +1,102 @@
1
+ import path from 'node:path';
2
+ import { exists, readJson } from '../fsx.js';
3
+ import { imageDimensions, sha256File } from '../wiki-image/image-hash.js';
4
+ export async function evaluateGate(root, missionId, gateFile) {
5
+ const gatePath = path.isAbsolute(gateFile)
6
+ ? gateFile
7
+ : path.join(root, '.sneakoscope', 'missions', missionId, gateFile);
8
+ if (!(await exists(gatePath))) {
9
+ return { pass: false, verdict: 'missing', reasons: ['gate_file_missing'], gate_path: gatePath, gate: null };
10
+ }
11
+ const gate = await readJson(gatePath, null);
12
+ if (!gate || typeof gate !== 'object' || Array.isArray(gate)) {
13
+ return { pass: false, verdict: 'invalid', reasons: ['gate_json_invalid'], gate_path: gatePath, gate: null };
14
+ }
15
+ const blockers = Array.isArray(gate.blockers) ? gate.blockers : null;
16
+ const reasons = [];
17
+ if (gate.execution_class === 'mock_fixture') {
18
+ if (gate.passed !== true)
19
+ reasons.push('gate_not_passed');
20
+ if (gate.ok === false)
21
+ reasons.push('gate_ok_false');
22
+ if (!blockers)
23
+ reasons.push('gate_blockers_not_array');
24
+ else if (blockers.length > 0)
25
+ reasons.push('gate_blockers_present');
26
+ return { pass: false, verdict: 'mock_only', reasons: reasons.length ? reasons : ['gate_execution_class_mock_fixture'], gate_path: gatePath, gate };
27
+ }
28
+ if (gate.passed !== true)
29
+ reasons.push('gate_not_passed');
30
+ if (gate.ok === false)
31
+ reasons.push('gate_ok_false');
32
+ if (!blockers)
33
+ reasons.push('gate_blockers_not_array');
34
+ else if (blockers.length > 0)
35
+ reasons.push('gate_blockers_present');
36
+ if (gateFile === 'mad-sks-gate.json' || /mad-sks-gate\.json$/.test(gatePath)) {
37
+ const sqlPlane = gate.sql_plane;
38
+ if (sqlPlane?.requested === true) {
39
+ if (sqlPlane.read_back_passed !== true)
40
+ reasons.push('mad_sks_sql_plane_read_back_not_passed');
41
+ if (sqlPlane.profile_closed !== true)
42
+ reasons.push('mad_sks_sql_plane_profile_not_closed');
43
+ }
44
+ }
45
+ if (gateFile === 'image-ux-review-gate.json' || /image-ux-review-gate\.json$/.test(gatePath)) {
46
+ const needsFullImagegenEvidence = gate.full_review_passed === true
47
+ || gate.gpt_image_2_callout_generated === true
48
+ || (gate.passed === true && gate.reference_only !== true);
49
+ if (needsFullImagegenEvidence) {
50
+ reasons.push(...await imagegenResponseGateReasons(root, path.dirname(gatePath)));
51
+ }
52
+ }
53
+ if (gateFile === 'ppt-gate.json' || /ppt-gate\.json$/.test(gatePath)) {
54
+ const imagegenEvidence = gate.imagegen_evidence;
55
+ if (imagegenEvidence?.required === true && imagegenEvidence.passed !== true) {
56
+ reasons.push('ppt_imagegen_evidence_not_passed');
57
+ }
58
+ }
59
+ if (reasons.length > 0) {
60
+ return { pass: false, verdict: 'fail', reasons, gate_path: gatePath, gate };
61
+ }
62
+ return { pass: true, verdict: 'pass', reasons: [], gate_path: gatePath, gate };
63
+ }
64
+ async function imagegenResponseGateReasons(root, missionDir) {
65
+ const reasons = [];
66
+ const response = await readJson(path.join(missionDir, 'image-ux-gpt-image-2-response.json'), null);
67
+ if (!response || typeof response !== 'object')
68
+ return ['imagegen_response_artifact_missing'];
69
+ if (response.schema !== 'sks.image-ux-gpt-image-2-response.v1')
70
+ reasons.push('imagegen_response_schema_invalid');
71
+ if (response.ok !== true || response.status !== 'generated')
72
+ reasons.push(response.blocker || 'imagegen_response_not_generated');
73
+ const evidenceClass = String(response.evidence_class || '');
74
+ if (evidenceClass !== 'codex_app_imagegen')
75
+ reasons.push(evidenceClass ? `imagegen_response_evidence_class_not_codex_app:${evidenceClass}` : 'imagegen_response_evidence_class_missing');
76
+ const outputSource = String(response.output_source || '');
77
+ if (!['manual_attach', 'auto_discovered_generated_images'].includes(outputSource))
78
+ reasons.push('imagegen_response_output_source_invalid');
79
+ const outputPath = String(response.output_image_path || '');
80
+ const expectedSha = String(response.output_sha256 || response.output_image_sha256 || '');
81
+ if (!outputPath)
82
+ reasons.push('imagegen_response_output_path_missing');
83
+ if (!expectedSha)
84
+ reasons.push('imagegen_response_output_sha256_missing');
85
+ if (outputPath) {
86
+ const absolute = path.isAbsolute(outputPath) ? outputPath : path.resolve(root, outputPath);
87
+ try {
88
+ const actualSha = await sha256File(absolute);
89
+ if (expectedSha && actualSha !== expectedSha)
90
+ reasons.push('imagegen_response_output_sha256_mismatch');
91
+ const dims = await imageDimensions(absolute);
92
+ if (!Number.isFinite(Number(dims.width)) || !Number.isFinite(Number(dims.height)) || Number(dims.width) <= 0 || Number(dims.height) <= 0) {
93
+ reasons.push('imagegen_response_output_dimensions_invalid');
94
+ }
95
+ }
96
+ catch {
97
+ reasons.push('imagegen_response_output_file_unreadable');
98
+ }
99
+ }
100
+ return [...new Set(reasons)];
101
+ }
102
+ //# sourceMappingURL=gate-evaluator.js.map
@@ -49,10 +49,13 @@ async function checkHardBlocker(root, missionId) {
49
49
  const blocker = await readJson(file, null);
50
50
  if (!blocker)
51
51
  return { hardBlocked: false, file, reason: null, evidence: [] };
52
+ const evidence = blocker.evidence || [];
52
53
  const hardBlocked = String(blocker.status || '') === 'hard_blocked'
53
54
  && blocker.passed !== true
54
- && String(blocker.reason || '').trim().length > 0;
55
- return { hardBlocked, file, reason: String(blocker.reason || ''), evidence: blocker.evidence || [] };
55
+ && String(blocker.reason || '').trim().length > 0
56
+ && Array.isArray(evidence)
57
+ && evidence.length > 0;
58
+ return { hardBlocked, file, reason: String(blocker.reason || ''), evidence };
56
59
  }
57
60
  export async function checkStopGate(input) {
58
61
  const root = path.resolve(input.root);
@@ -61,6 +64,7 @@ export async function checkStopGate(input) {
61
64
  ...(input.route ? { route: input.route } : {}),
62
65
  ...(input.missionId ? { missionId: input.missionId } : {}),
63
66
  ...(input.explicitGatePath ? { explicitGatePath: input.explicitGatePath } : {}),
67
+ ...(input.allowLatestFallback === false ? { allowLatestFallback: false } : {}),
64
68
  });
65
69
  const route = normalizeRoute(resolution.route) ?? normalizeRoute(input.route ?? null) ?? 'Naruto';
66
70
  const missionId = resolution.mission_id;
@@ -128,15 +132,24 @@ export async function checkStopGate(input) {
128
132
  };
129
133
  }
130
134
  const missingFields = [];
135
+ if (normalizedGate.status !== 'passed')
136
+ missingFields.push('status');
131
137
  if (normalizedGate.passed !== true)
132
138
  missingFields.push('passed');
133
139
  if (normalizedGate.blockers.length > 0)
134
140
  missingFields.push('blockers');
135
141
  if (normalizedGate.missing_fields.length > 0)
136
142
  missingFields.push(...normalizedGate.missing_fields.map((field) => `missing_fields:${field}`));
137
- if (normalizedGate.passed === true
143
+ const bugfixMission = await missionHasBugfixWork(root, missionId, normalizedGate);
144
+ if (bugfixMission && normalizedGate.evidence.regression_test_added !== true)
145
+ missingFields.push('regression_test_added');
146
+ if (bugfixMission && normalizedGate.evidence.regression_test_failed_before_fix !== true)
147
+ missingFields.push('regression_test_failed_before_fix');
148
+ if (normalizedGate.status === 'passed'
149
+ && normalizedGate.passed === true
138
150
  && normalizedGate.blockers.length === 0
139
- && normalizedGate.missing_fields.length === 0) {
151
+ && normalizedGate.missing_fields.length === 0
152
+ && missingFields.length === 0) {
140
153
  const action = 'allow_stop';
141
154
  const diagnostics = {
142
155
  schema: 'sks.stop-gate-diagnostics.v1',
@@ -198,6 +211,15 @@ export async function checkStopGate(input) {
198
211
  feedback: `Stop blocked: gate not passed. Selected: ${resolution.gate_path}. Missing fields: ${missingFields.join(', ') || 'none'}. Checked: ${resolution.checked_paths.join(', ')}`,
199
212
  };
200
213
  }
214
+ async function missionHasBugfixWork(root, missionId, gate) {
215
+ const evidence = gate.evidence;
216
+ if (evidence.regression_test_added !== undefined || evidence.regression_test_failed_before_fix !== undefined)
217
+ return true;
218
+ if (!missionId)
219
+ return false;
220
+ const graph = await readJson(path.join(missionDir(root, missionId), 'agents', 'naruto-work-graph.json'), null);
221
+ return Array.isArray(graph?.work_items) && graph.work_items.some((item) => String(item?.kind || '') === 'bugfix');
222
+ }
201
223
  async function writeDiagnostics(root, missionId, diagnostics) {
202
224
  // Global report
203
225
  const reportsDir = path.join(root, '.sneakoscope', 'reports');
@@ -68,8 +68,9 @@ export async function resolveStopGate(input) {
68
68
  }
69
69
  }
70
70
  }
71
- // 4. latest mission fallback
72
- const latest = await findLatestMission(root);
71
+ // 4. latest mission fallback. Interactive hooks disable this path so a stale
72
+ // mission cannot satisfy the current session's stop gate by accident.
73
+ const latest = input.allowLatestFallback === false ? null : await findLatestMission(root);
73
74
  if (latest) {
74
75
  const dir = missionDir(root, latest);
75
76
  for (const file of GATE_FILE_CANDIDATES) {
@@ -77,12 +78,27 @@ export async function resolveStopGate(input) {
77
78
  checkedPaths.push(p);
78
79
  if (await exists(p)) {
79
80
  const raw = await readJson(p, null);
80
- return makeResolution(root, route, latest, p, raw, checkedPaths, statePath, stateMissionId, 'latest_mission');
81
+ if (!gateMatchesRoute(raw, route))
82
+ continue;
83
+ if (stateMissionId && stateMissionId !== latest) {
84
+ console.error(`SKS stop-gate warning: latest mission fallback selected ${latest}, current state mission is ${stateMissionId}. Pass --mission or --gate to avoid fallback.`);
85
+ }
86
+ return makeResolution(root, route, latest, p, raw, checkedPaths, statePath, stateMissionId, 'latest_mission_fallback_warn');
81
87
  }
82
88
  }
83
89
  }
84
90
  return makeResolution(root, route, missionId, null, null, checkedPaths, statePath, stateMissionId, 'no_gate_found');
85
91
  }
92
+ function gateMatchesRoute(raw, route) {
93
+ if (!route || !raw)
94
+ return true;
95
+ const expected = normalizeRoute(route);
96
+ const actual = normalizeRoute(String(raw.route || raw.route_command || ''));
97
+ return !actual || actual === expected;
98
+ }
99
+ function normalizeRoute(value) {
100
+ return String(value || '').replace(/^\$/, '').replace(/_/g, '-').toLowerCase();
101
+ }
86
102
  function makeResolution(root, route, missionId, gatePath, gateRaw, checkedPaths, statePath, stateMissionId, reason) {
87
103
  let gateSchema = null;
88
104
  if (gateRaw) {
@@ -3,6 +3,9 @@ import { ensureDir, nowIso, readJson, writeJsonAtomic, exists } from '../fsx.js'
3
3
  import { missionDir } from '../mission.js';
4
4
  import { setCurrent } from '../mission.js';
5
5
  export async function writeFinalStopGate(input) {
6
+ return writeGateOwned(input);
7
+ }
8
+ export async function writeGateOwned(input) {
6
9
  const dir = missionDir(input.root, input.missionId);
7
10
  await ensureDir(dir);
8
11
  const evidenceBlockers = input.status === 'passed' ? evidenceMissingBlockers(input.evidence) : [];
@@ -15,6 +18,13 @@ export async function writeFinalStopGate(input) {
15
18
  const canonicalGatePath = path.join(dir, 'stop-gate.json');
16
19
  const latestGatePath = path.join(dir, 'stop-gate.latest.json');
17
20
  const verifyPath = path.join(dir, 'stop-gate-write-verify.json');
21
+ const gateOwner = {
22
+ mission_id: input.missionId,
23
+ route: input.route,
24
+ route_command: input.routeCommand,
25
+ writer_pid: process.pid,
26
+ written_at: nowIso()
27
+ };
18
28
  const gate = {
19
29
  schema: 'sks.stop-gate.v1',
20
30
  route: input.route,
@@ -29,6 +39,7 @@ export async function writeFinalStopGate(input) {
29
39
  evidence: input.evidence,
30
40
  blockers,
31
41
  missing_fields: missingFields,
42
+ gate_owner: gateOwner,
32
43
  created_at: nowIso(),
33
44
  };
34
45
  // 1. Write route-native gate file (backwards compat), preserving detailed native fields by default.
@@ -51,6 +62,7 @@ export async function writeFinalStopGate(input) {
51
62
  },
52
63
  blockers,
53
64
  missing_fields: missingFields,
65
+ gate_owner: gateOwner,
54
66
  updated_at: nowIso()
55
67
  });
56
68
  }
@@ -67,6 +79,7 @@ export async function writeFinalStopGate(input) {
67
79
  evidence: input.evidence,
68
80
  blockers,
69
81
  missing_fields: missingFields,
82
+ gate_owner: gateOwner,
70
83
  updated_at: nowIso(),
71
84
  ...(input.nativeGatePatch ?? {})
72
85
  });
@@ -85,10 +98,12 @@ export async function writeFinalStopGate(input) {
85
98
  stop_gate_abs_path: canonicalGatePath,
86
99
  stop_gate_status: status,
87
100
  stop_gate_passed: passed,
101
+ gate_owner_mission_id: input.missionId,
102
+ gate_owner_route: input.route,
88
103
  route_evidence_passed: input.evidence.route_evidence_passed ?? passed,
89
104
  terminal: gate.terminal,
90
105
  terminal_state: gate.terminal_state,
91
- });
106
+ }, { sessionKey: input.sessionKey || undefined });
92
107
  // 5. Re-read and verify
93
108
  const verifyResult = {
94
109
  schema: 'sks.stop-gate-write-verify.v1',
@@ -121,6 +136,10 @@ function evidenceMissingBlockers(evidence) {
121
136
  blockers.push('proof_not_passed');
122
137
  if (evidence.reflection_required === true && evidence.reflection_passed !== true && evidence.reflection_passed !== 'not_required')
123
138
  blockers.push('reflection_not_passed');
139
+ if (evidence.regression_test_added === false)
140
+ blockers.push('regression_test_not_added');
141
+ if (evidence.regression_test_failed_before_fix === false)
142
+ blockers.push('regression_test_failed_before_fix_missing');
124
143
  return blockers;
125
144
  }
126
145
  //# sourceMappingURL=stop-gate-writer.js.map