sneakoscope 4.8.7 → 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 (288) 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 +15 -4
  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 +32 -0
  40. package/dist/commands/codex-lb.js +2 -0
  41. package/dist/commands/doctor.js +62 -6
  42. package/dist/commands/proof.js +6 -3
  43. package/dist/config/skills-manifest.json +82 -54
  44. package/dist/core/agents/agent-conflict-graph.js +5 -0
  45. package/dist/core/agents/agent-lease.js +5 -0
  46. package/dist/core/agents/agent-ledger-schemas.js +1 -0
  47. package/dist/core/agents/agent-orchestrator.js +268 -62
  48. package/dist/core/agents/agent-output-validator.js +14 -3
  49. package/dist/core/agents/agent-patch-queue-store.js +95 -2
  50. package/dist/core/agents/agent-patch-queue.js +6 -3
  51. package/dist/core/agents/agent-patch-schema.js +13 -0
  52. package/dist/core/agents/agent-proof-evidence.js +6 -1
  53. package/dist/core/agents/agent-runner-fake.js +40 -0
  54. package/dist/core/agents/agent-worker-pipeline.js +36 -2
  55. package/dist/core/agents/codex-exec-worker-adapter.js +2 -0
  56. package/dist/core/agents/native-worker-backend-router.js +58 -1
  57. package/dist/core/codex-app/sks-menubar.js +18 -5
  58. package/dist/core/codex-app.js +1 -0
  59. package/dist/core/codex-control/codex-sdk-config-policy.js +2 -1
  60. package/dist/core/codex-control/codex-sdk-env-policy.js +1 -1
  61. package/dist/core/codex-control/schemas/agent-worker-result.schema.js +12 -3
  62. package/dist/core/codex-hooks/codex-hook-managed-install.js +5 -0
  63. package/dist/core/codex-hooks/codex-hook-state-writer.js +70 -11
  64. package/dist/core/codex-hooks/codex-hook-trust-doctor.js +2 -2
  65. package/dist/core/codex-lb/codex-lb-env.js +20 -1
  66. package/dist/core/commands/basic-cli.js +21 -2
  67. package/dist/core/commands/check-command.js +37 -5
  68. package/dist/core/commands/computer-use-command.js +62 -7
  69. package/dist/core/commands/db-command.js +31 -5
  70. package/dist/core/commands/fast-mode-command.js +3 -0
  71. package/dist/core/commands/gate-result-contract.js +43 -0
  72. package/dist/core/commands/gates-command.js +6 -1
  73. package/dist/core/commands/gc-command.js +29 -2
  74. package/dist/core/commands/goal-command.js +9 -2
  75. package/dist/core/commands/gx-command.js +79 -7
  76. package/dist/core/commands/image-ux-review-command.js +188 -13
  77. package/dist/core/commands/mad-db-command.js +85 -176
  78. package/dist/core/commands/mad-sks-command.js +230 -29
  79. package/dist/core/commands/menubar-command.js +22 -1
  80. package/dist/core/commands/naruto-command.js +64 -10
  81. package/dist/core/commands/plan-command.js +76 -0
  82. package/dist/core/commands/ppt-command.js +159 -24
  83. package/dist/core/commands/qa-loop-command.js +6 -2
  84. package/dist/core/commands/release-command.js +55 -2
  85. package/dist/core/commands/research-command.js +1 -1
  86. package/dist/core/commands/review-command.js +217 -0
  87. package/dist/core/commands/route-success-helpers.js +59 -0
  88. package/dist/core/commands/run-command.js +19 -7
  89. package/dist/core/commands/seo-command.js +49 -1
  90. package/dist/core/commands/ui-command.js +161 -0
  91. package/dist/core/commands/uninstall-command.js +15 -1
  92. package/dist/core/db-safety.js +2 -2
  93. package/dist/core/doctor/doctor-transaction.js +8 -0
  94. package/dist/core/doctor/doctor-zellij-repair.js +1 -0
  95. package/dist/core/doctor/imagegen-repair.js +161 -0
  96. package/dist/core/feature-fixture-runner.js +2 -2
  97. package/dist/core/feature-fixtures.js +58 -37
  98. package/dist/core/feature-registry.js +102 -2
  99. package/dist/core/fsx.js +39 -6
  100. package/dist/core/image-ux-review/imagegen-adapter.js +48 -11
  101. package/dist/core/image-ux-review.js +16 -0
  102. package/dist/core/imagegen/imagegen-capability.js +11 -5
  103. package/dist/core/imagegen/require-imagegen.js +57 -0
  104. package/dist/core/init/skills.js +10 -5
  105. package/dist/core/mad-db/mad-db-coordinator.js +94 -18
  106. package/dist/core/mad-db/mad-db-policy.js +12 -10
  107. package/dist/core/mad-sks/executors/executor-base.js +8 -2
  108. package/dist/core/mad-sks/executors/index.js +4 -0
  109. package/dist/core/mad-sks/executors/sql-plane-executor.js +194 -0
  110. package/dist/core/naruto/naruto-active-pool.js +15 -4
  111. package/dist/core/naruto/naruto-real-worker-child.js +10 -0
  112. package/dist/core/naruto/naruto-role-policy.js +3 -0
  113. package/dist/core/naruto/naruto-task-hints.js +10 -0
  114. package/dist/core/naruto/naruto-work-graph.js +8 -2
  115. package/dist/core/naruto/naruto-work-item.js +6 -0
  116. package/dist/core/naruto/solution-tournament.js +101 -0
  117. package/dist/core/permission-gates.js +30 -0
  118. package/dist/core/pipeline-internals/runtime-core.js +11 -3
  119. package/dist/core/pipeline-internals/runtime-gates.js +27 -0
  120. package/dist/core/ppt-review/index.js +6 -1
  121. package/dist/core/ppt-review/slide-imagegen-review.js +75 -10
  122. package/dist/core/ppt.js +70 -2
  123. package/dist/core/proof/auto-finalize.js +70 -11
  124. package/dist/core/proof/proof-schema.js +2 -0
  125. package/dist/core/proof/route-adapter.js +5 -1
  126. package/dist/core/proof/route-finalizer.js +8 -5
  127. package/dist/core/proof/selftest-proof-fixtures.js +18 -5
  128. package/dist/core/proof/validation.js +2 -0
  129. package/dist/core/provider/model-router.js +53 -0
  130. package/dist/core/release/release-gate-node.js +3 -0
  131. package/dist/core/release/release-gate-resource-governor.js +1 -0
  132. package/dist/core/routes/constants.js +1 -1
  133. package/dist/core/routes.js +65 -18
  134. package/dist/core/safety/mutation-guard.js +5 -1
  135. package/dist/core/stop-gate/gate-evaluator.js +102 -0
  136. package/dist/core/stop-gate/stop-gate-check.js +16 -1
  137. package/dist/core/stop-gate/stop-gate-writer.js +4 -0
  138. package/dist/core/triwiki/agents-md-projector.js +184 -0
  139. package/dist/core/triwiki-wrongness/wrongness-schema.js +3 -1
  140. package/dist/core/trust-kernel/trust-kernel-schema.js +1 -0
  141. package/dist/core/trust-kernel/trust-report.js +1 -1
  142. package/dist/core/trust-kernel/trust-status.js +2 -0
  143. package/dist/core/ui/dashboard-html.js +111 -0
  144. package/dist/core/update/update-migration-state.js +366 -15
  145. package/dist/core/update-check.js +178 -81
  146. package/dist/core/verification/diff-quality.js +100 -0
  147. package/dist/core/verification/impact-scan.js +164 -0
  148. package/dist/core/verification/machine-feedback.js +146 -0
  149. package/dist/core/verification/mistake-rule-compiler.js +195 -0
  150. package/dist/core/version.js +1 -1
  151. package/dist/core/zellij/zellij-self-heal.js +9 -6
  152. package/dist/scripts/check-feature-quality.js +2 -2
  153. package/dist/scripts/cli-output-consistency-check.js +57 -0
  154. package/dist/scripts/coding-bench-check.js +136 -0
  155. package/dist/scripts/doctor-imagegen-repair-check.js +62 -0
  156. package/dist/scripts/ensure-bin-executable.js +11 -3
  157. package/dist/scripts/harness-benchmark-check.js +104 -0
  158. package/dist/scripts/legacy-update-e2e-check.js +228 -0
  159. package/dist/scripts/mad-db-command-check.js +11 -8
  160. package/dist/scripts/mad-db-route-identity-check.js +8 -6
  161. package/dist/scripts/mad-db-safety-conflict-matrix-check.js +31 -8
  162. package/dist/scripts/mad-db-skill-policy-snapshot-check.js +4 -5
  163. package/dist/scripts/ppt-real-imagegen-wiring-check.js +5 -1
  164. package/dist/scripts/proof-root-cause-policy-check.js +2 -0
  165. package/dist/scripts/release-dag-full-coverage-check.js +13 -4
  166. package/dist/scripts/release-gate-dag-runner.js +14 -0
  167. package/dist/scripts/release-gate-existence-audit.js +2 -1
  168. package/dist/scripts/release-gate-planner.js +2 -1
  169. package/dist/scripts/release-gate-script-parity-check.js +1 -1
  170. package/dist/scripts/release-metadata-1-19-check.js +2 -1
  171. package/dist/scripts/seo-geo-feature-fixture-quality-check.js +1 -1
  172. package/dist/scripts/sks-1-11-gate-lib.js +8 -6
  173. package/dist/scripts/ux-review-real-loop-fixture-check.js +9 -4
  174. package/dist/scripts/ux-review-run-wires-imagegen-check.js +4 -0
  175. package/docs/assets/sneakoscope-architecture-pipeline.jpg +0 -0
  176. package/docs/demo.tape +28 -0
  177. package/package.json +67 -3
  178. package/schemas/codex/completion-proof.schema.json +3 -2
  179. package/schemas/release/release-gate-node.schema.json +2 -1
  180. package/dist/scripts/agent-backfill-route-blackbox.js +0 -5
  181. package/dist/scripts/agent-dynamic-pool-route-blackbox.js +0 -5
  182. package/dist/scripts/agent-parallel-write-blackbox.js +0 -56
  183. package/dist/scripts/agent-patch-swarm-route-blackbox.js +0 -10
  184. package/dist/scripts/agent-route-blackbox-lib.js +0 -132
  185. package/dist/scripts/blackbox-command-import-smoke.js +0 -143
  186. package/dist/scripts/blackbox-global-shim.js +0 -77
  187. package/dist/scripts/blackbox-matrix.js +0 -70
  188. package/dist/scripts/blackbox-npx-one-shot.js +0 -69
  189. package/dist/scripts/blackbox-pack-install.js +0 -174
  190. package/dist/scripts/brand-neutrality-zero-leakage-blackbox.js +0 -4
  191. package/dist/scripts/build-once-runner-blackbox.js +0 -34
  192. package/dist/scripts/codex-0140-integration-blackbox.js +0 -13
  193. package/dist/scripts/codex-agent-type-blackbox.js +0 -4
  194. package/dist/scripts/codex-app-harness-blackbox.js +0 -4
  195. package/dist/scripts/codex-app-skill-agent-blackbox.js +0 -4
  196. package/dist/scripts/codex-hook-approval-blackbox.js +0 -4
  197. package/dist/scripts/codex-init-deep-directory-local-blackbox.js +0 -4
  198. package/dist/scripts/codex-native-feature-broker-blackbox.js +0 -4
  199. package/dist/scripts/codex-native-pattern-analysis-blackbox.js +0 -4
  200. package/dist/scripts/codex-native-read-repair-split-blackbox.js +0 -55
  201. package/dist/scripts/codex-native-reference-cache-blackbox.js +0 -41
  202. package/dist/scripts/core-skill-integrity-blackbox.js +0 -32
  203. package/dist/scripts/dfix-fast-blackbox-check.js +0 -37
  204. package/dist/scripts/dfix-parallel-write-blackbox.js +0 -48
  205. package/dist/scripts/dfix-patch-swarm-route-blackbox.js +0 -10
  206. package/dist/scripts/doctor-context7-mcp-repair-blackbox.js +0 -16
  207. package/dist/scripts/doctor-dirty-repair-blackbox.js +0 -22
  208. package/dist/scripts/doctor-dirty-semantic-blackbox.js +0 -8
  209. package/dist/scripts/doctor-fix-production-blackbox.js +0 -26
  210. package/dist/scripts/doctor-native-capability-repair-blackbox.js +0 -39
  211. package/dist/scripts/doctor-startup-config-repair-blackbox.js +0 -13
  212. package/dist/scripts/doctor-supabase-mcp-repair-blackbox.js +0 -14
  213. package/dist/scripts/doctor-transaction-engine-blackbox.js +0 -28
  214. package/dist/scripts/doctor-zellij-fix-blackbox.js +0 -4
  215. package/dist/scripts/doctor-zellij-no-homebrew-blackbox.js +0 -4
  216. package/dist/scripts/doctor-zellij-upgrade-blackbox.js +0 -4
  217. package/dist/scripts/gate-pack-runner-blackbox.js +0 -27
  218. package/dist/scripts/gate-pack-v2-blackbox.js +0 -18
  219. package/dist/scripts/geo-cli-blackbox-check.js +0 -18
  220. package/dist/scripts/loop-collision-blackbox.js +0 -3
  221. package/dist/scripts/loop-concurrency-oversubscription-blackbox.js +0 -3
  222. package/dist/scripts/loop-fixture-production-misuse-blackbox.js +0 -3
  223. package/dist/scripts/loop-kill-interrupt-real-blackbox.js +0 -3
  224. package/dist/scripts/loop-merge-strategy-blackbox.js +0 -3
  225. package/dist/scripts/loop-mesh-production-e2e-blackbox.js +0 -3
  226. package/dist/scripts/loop-side-effect-blackbox.js +0 -3
  227. package/dist/scripts/mad-db-operation-lifecycle-blackbox.js +0 -29
  228. package/dist/scripts/mad-sks-actual-executor-blackbox.js +0 -5
  229. package/dist/scripts/mad-zellij-headless-fallback-blackbox.js +0 -4
  230. package/dist/scripts/mad-zellij-self-heal-blackbox.js +0 -4
  231. package/dist/scripts/naruto-loop-mesh-blackbox.js +0 -3
  232. package/dist/scripts/naruto-real-parallelism-blackbox.js +0 -307
  233. package/dist/scripts/naruto-worktree-coding-blackbox.js +0 -29
  234. package/dist/scripts/parallel-runtime-real-blackbox.js +0 -44
  235. package/dist/scripts/pipeline-codex-native-doctor-mad-routing-real-blackbox.js +0 -77
  236. package/dist/scripts/pipeline-codex-native-e2e-blackbox.js +0 -13
  237. package/dist/scripts/pipeline-codex-native-image-routing-real-blackbox.js +0 -50
  238. package/dist/scripts/pipeline-codex-native-loop-routing-real-blackbox.js +0 -74
  239. package/dist/scripts/pipeline-codex-native-qa-routing-real-blackbox.js +0 -51
  240. package/dist/scripts/pipeline-codex-native-research-routing-real-blackbox.js +0 -45
  241. package/dist/scripts/pipeline-execution-profile-routing-blackbox.js +0 -4
  242. package/dist/scripts/postinstall-global-doctor-blackbox.js +0 -12
  243. package/dist/scripts/ppt-full-e2e-blackbox-check.js +0 -109
  244. package/dist/scripts/ppt-imagegen-blackbox-check.js +0 -46
  245. package/dist/scripts/project-skill-dedupe-blackbox.js +0 -36
  246. package/dist/scripts/qa-backfill-route-blackbox.js +0 -5
  247. package/dist/scripts/qa-patch-swarm-route-blackbox.js +0 -10
  248. package/dist/scripts/release-full-parallelism-blackbox.js +0 -41
  249. package/dist/scripts/release-triwiki-first-runner-blackbox.js +0 -48
  250. package/dist/scripts/release-wiring-3110-blackbox.js +0 -27
  251. package/dist/scripts/release-wiring-3112-blackbox.js +0 -17
  252. package/dist/scripts/release-wiring-3113-blackbox.js +0 -17
  253. package/dist/scripts/research-backfill-route-blackbox.js +0 -5
  254. package/dist/scripts/research-final-reviewer-blackbox.js +0 -70
  255. package/dist/scripts/research-stage-cycle-runtime-blackbox.js +0 -40
  256. package/dist/scripts/research-synthesis-writer-blackbox.js +0 -24
  257. package/dist/scripts/route-blackbox-realism-check.js +0 -21
  258. package/dist/scripts/scheduler-resource-claim-blackbox.js +0 -24
  259. package/dist/scripts/seo-cli-blackbox-check.js +0 -18
  260. package/dist/scripts/sks-3110-all-feature-regression-blackbox.js +0 -116
  261. package/dist/scripts/sks-3112-all-feature-regression-blackbox.js +0 -29
  262. package/dist/scripts/sks-3113-all-feature-regression-blackbox.js +0 -17
  263. package/dist/scripts/sks-400-all-feature-regression-blackbox.js +0 -21
  264. package/dist/scripts/sks-400-extreme-parallel-blackbox.js +0 -8
  265. package/dist/scripts/sks-400-five-minute-blackbox.js +0 -9
  266. package/dist/scripts/sks-400-legacy-purge-blackbox.js +0 -8
  267. package/dist/scripts/sks-401-all-feature-regression-blackbox.js +0 -46
  268. package/dist/scripts/sks-401-five-minute-actual-blackbox.js +0 -23
  269. package/dist/scripts/sks-402-all-feature-regression-blackbox.js +0 -9
  270. package/dist/scripts/sks-402-five-minute-real-blackbox.js +0 -22
  271. package/dist/scripts/sksd-warm-cache-blackbox.js +0 -12
  272. package/dist/scripts/supabase-secret-preservation-blackbox.js +0 -29
  273. package/dist/scripts/team-backfill-route-blackbox.js +0 -5
  274. package/dist/scripts/team-parallel-write-blackbox.js +0 -55
  275. package/dist/scripts/team-patch-swarm-route-blackbox.js +0 -10
  276. package/dist/scripts/triwiki-affected-graph-blackbox.js +0 -28
  277. package/dist/scripts/triwiki-proof-bank-blackbox.js +0 -30
  278. package/dist/scripts/triwiki-proof-bank-lock-blackbox.js +0 -7
  279. package/dist/scripts/update-preserves-supabase-keys-blackbox.js +0 -27
  280. package/dist/scripts/ux-patch-swarm-route-blackbox.js +0 -10
  281. package/dist/scripts/ux-review-imagegen-blackbox-check.js +0 -67
  282. package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -28
  283. package/dist/scripts/zellij-pane-lock-concurrency-blackbox.js +0 -80
  284. package/dist/scripts/zellij-pane-lock-open-worker-integration-blackbox.js +0 -137
  285. package/dist/scripts/zellij-self-heal-typed-blackbox.js +0 -4
  286. package/dist/scripts/zellij-slot-telemetry-real-blackbox.js +0 -20
  287. package/dist/scripts/zellij-stacked-fallback-integration-blackbox.js +0 -81
  288. package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -202
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "bench-t01-off-by-one",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "test": "node test.js"
8
+ }
9
+ }
@@ -0,0 +1,5 @@
1
+ export function paginate(items, page, pageSize) {
2
+ const start = Math.max(0, (page - 1) * pageSize);
3
+ const end = Math.min(items.length - 1, start + pageSize);
4
+ return items.slice(start, end);
5
+ }
@@ -0,0 +1,5 @@
1
+ import assert from 'node:assert/strict';
2
+ import { paginate } from './src/pagination.js';
3
+
4
+ assert.deepEqual(paginate([1, 2, 3, 4, 5], 3, 2), [5]);
5
+ assert.deepEqual(paginate([1, 2, 3, 4], 2, 2), [3, 4]);
@@ -0,0 +1,13 @@
1
+ {
2
+ "schema": "sks.bench-task.v1",
3
+ "id": "t01-off-by-one",
4
+ "kind": "bugfix",
5
+ "prompt": "pagination이 마지막 페이지 항목 1개를 누락한다. 재현 테스트를 먼저 추가하고 고쳐라.",
6
+ "success": {
7
+ "command": "npm test --silent",
8
+ "must_pass": true,
9
+ "must_contain_new_test": true,
10
+ "max_diff_lines": 60,
11
+ "forbidden_patterns": ["catch \\{\\s*\\}"]
12
+ }
13
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "bench-t02-signature-cochange",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "test": "node test.js"
8
+ }
9
+ }
@@ -0,0 +1,5 @@
1
+ import { formatUserLabel } from './labels.js';
2
+
3
+ export function adminLabel(user) {
4
+ return formatUserLabel(user.name);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { formatUserLabel } from './labels.js';
2
+
3
+ export function auditLabel(user) {
4
+ return formatUserLabel(user.name);
5
+ }
@@ -0,0 +1,3 @@
1
+ export function formatUserLabel(name) {
2
+ return name.trim();
3
+ }
@@ -0,0 +1,5 @@
1
+ import { formatUserLabel } from './labels.js';
2
+
3
+ export function profileLabel(user) {
4
+ return formatUserLabel(user.name);
5
+ }
@@ -0,0 +1,9 @@
1
+ import assert from 'node:assert/strict';
2
+ import { adminLabel } from './src/admin.js';
3
+ import { auditLabel } from './src/audit.js';
4
+ import { profileLabel } from './src/profile.js';
5
+
6
+ const user = { name: ' Mina ', role: 'admin' };
7
+ assert.equal(adminLabel(user), 'Mina (admin)');
8
+ assert.equal(auditLabel(user), 'Mina (admin)');
9
+ assert.equal(profileLabel(user), 'Mina (admin)');
@@ -0,0 +1,12 @@
1
+ {
2
+ "schema": "sks.bench-task.v1",
3
+ "id": "t02-signature-cochange",
4
+ "kind": "feature",
5
+ "prompt": "formatUserLabel이 role을 받도록 시그니처를 바꾸고 참조 3곳을 함께 수정하라.",
6
+ "success": {
7
+ "command": "npm test --silent",
8
+ "must_pass": true,
9
+ "max_diff_lines": 90,
10
+ "forbidden_patterns": ["catch \\{\\s*\\}"]
11
+ }
12
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "bench-t03-type-puzzle",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "test": "node test.js"
8
+ }
9
+ }
@@ -0,0 +1,4 @@
1
+ export function parsePort(value, fallback = 3000) {
2
+ const parsed = Number(value);
3
+ return parsed || fallback;
4
+ }
@@ -0,0 +1,6 @@
1
+ import assert from 'node:assert/strict';
2
+ import { parsePort } from './src/config.js';
3
+
4
+ assert.equal(parsePort('0'), 0);
5
+ assert.equal(parsePort('8080'), 8080);
6
+ assert.equal(parsePort(''), 3000);
@@ -0,0 +1,13 @@
1
+ {
2
+ "schema": "sks.bench-task.v1",
3
+ "id": "t03-type-puzzle",
4
+ "kind": "bugfix",
5
+ "prompt": "parsePort가 숫자 0을 유효한 값으로 처리하지 못한다. 회귀 테스트를 추가하고 고쳐라.",
6
+ "success": {
7
+ "command": "npm test --silent",
8
+ "must_pass": true,
9
+ "must_contain_new_test": true,
10
+ "max_diff_lines": 60,
11
+ "forbidden_patterns": ["Number\\([^)]*\\) \\|\\|"]
12
+ }
13
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "bench-t04-refactor-preserve",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "test": "node test.js"
8
+ }
9
+ }
@@ -0,0 +1,8 @@
1
+ export function totalCart(lines) {
2
+ let total = 0;
3
+ for (const line of lines) {
4
+ total += line.price * line.qty;
5
+ if (line.discount) total -= line.price * line.qty * line.discount;
6
+ }
7
+ return Math.round(total * 100) / 100;
8
+ }
@@ -0,0 +1,4 @@
1
+ import assert from 'node:assert/strict';
2
+ import { totalCart } from './src/cart.js';
3
+
4
+ assert.equal(totalCart([{ price: 10, qty: 2 }, { price: 5, qty: 1, discount: 0.2 }]), 24);
@@ -0,0 +1,12 @@
1
+ {
2
+ "schema": "sks.bench-task.v1",
3
+ "id": "t04-refactor-preserve",
4
+ "kind": "refactor",
5
+ "prompt": "cart total 계산을 더 읽기 쉽게 리팩터하되 동작은 보존하라.",
6
+ "success": {
7
+ "command": "npm test --silent",
8
+ "must_pass": true,
9
+ "max_diff_lines": 80,
10
+ "forbidden_patterns": ["TODO", "console\\.log"]
11
+ }
12
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "bench-t05-performance",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "test": "node test.js"
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ export function countPairs(values, target) {
2
+ let count = 0;
3
+ for (let i = 0; i < values.length; i += 1) {
4
+ for (let j = i + 1; j < values.length; j += 1) {
5
+ if (values[i] + values[j] === target) count += 1;
6
+ }
7
+ }
8
+ return count;
9
+ }
@@ -0,0 +1,11 @@
1
+ import assert from 'node:assert/strict';
2
+ import { performance } from 'node:perf_hooks';
3
+ import { countPairs } from './src/pairs.js';
4
+
5
+ assert.equal(countPairs([1, 2, 3, 4], 5), 2);
6
+ const values = Array.from({ length: 6000 }, (_, index) => index % 200);
7
+ const started = performance.now();
8
+ const count = countPairs(values, 199);
9
+ const elapsed = performance.now() - started;
10
+ assert.equal(count, 90000);
11
+ assert.ok(elapsed < 250, `too slow: ${elapsed}ms`);
@@ -0,0 +1,12 @@
1
+ {
2
+ "schema": "sks.bench-task.v1",
3
+ "id": "t05-performance",
4
+ "kind": "bugfix",
5
+ "prompt": "countPairs가 큰 입력에서 시간 초과된다. 동작을 유지하면서 기준 시간 안에 들어오게 고쳐라.",
6
+ "success": {
7
+ "command": "npm test --silent",
8
+ "must_pass": true,
9
+ "max_diff_lines": 80,
10
+ "forbidden_patterns": ["setTimeout", "catch \\{\\s*\\}"]
11
+ }
12
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "bench-t06-mistake-rule",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "test": "node test.js"
8
+ }
9
+ }
@@ -0,0 +1,6 @@
1
+ export async function loadJson(readText) {
2
+ try {
3
+ return JSON.parse(await readText());
4
+ } catch (err) {}
5
+ return null;
6
+ }
@@ -0,0 +1,7 @@
1
+ import assert from 'node:assert/strict';
2
+ import fs from 'node:fs/promises';
3
+ import { loadJson } from './src/loader.js';
4
+
5
+ const source = await fs.readFile(new URL('./src/loader.js', import.meta.url), 'utf8');
6
+ assert.ok(!/catch\s*\([^)]*\)\s*\{\s*\}/.test(source), 'empty catch must be removed');
7
+ await assert.rejects(() => loadJson(async () => '{bad json'));
@@ -0,0 +1,12 @@
1
+ {
2
+ "schema": "sks.bench-task.v1",
3
+ "id": "t06-mistake-rule",
4
+ "kind": "bugfix",
5
+ "prompt": "빈 catch로 오류가 삼켜진다. 과거 실수 규칙에 걸리지 않도록 명시적 처리를 추가하라.",
6
+ "success": {
7
+ "command": "npm test --silent",
8
+ "must_pass": true,
9
+ "max_diff_lines": 50,
10
+ "forbidden_patterns": ["catch \\([^)]*\\) \\{\\s*\\}"]
11
+ }
12
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "schema": "sks.coding-bench-baseline.v1",
3
+ "baseline_version": "5.0.0",
4
+ "pass_rate": 0,
5
+ "min_pass_rate": 0,
6
+ "notes": "Real model coding bench is skipped with no_backend unless SKS_RUN_CODING_BENCH_REAL=1 and a backend credential is present."
7
+ }
@@ -76,7 +76,7 @@ dependencies = [
76
76
 
77
77
  [[package]]
78
78
  name = "sks-core"
79
- version = "4.8.7"
79
+ version = "5.1.2"
80
80
  dependencies = [
81
81
  "serde_json",
82
82
  ]
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "sks-core"
3
- version = "4.8.7"
3
+ version = "5.1.2"
4
4
  edition = "2021"
5
5
 
6
6
  [dependencies]
@@ -4,7 +4,7 @@ use std::io::{self, Read, Seek, SeekFrom};
4
4
  fn main() {
5
5
  let mut args = std::env::args().skip(1);
6
6
  match args.next().as_deref() {
7
- Some("--version") => println!("sks-rs 4.8.7"),
7
+ Some("--version") => println!("sks-rs 5.1.2"),
8
8
  Some("compact-info") => {
9
9
  let mut input = String::new();
10
10
  let _ = io::stdin().read_to_string(&mut input);
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ const args = process.argv.slice(2);
4
+ const command = args.find((arg) => !arg.startsWith('-')) || 'install';
5
+ const autonomous = args.includes('--no-tui') || args.includes('--yes') || args.includes('-y');
6
+ function run(cmd, cmdArgs) {
7
+ const result = spawnSync(cmd, cmdArgs, { stdio: 'inherit' });
8
+ return result.status ?? 1;
9
+ }
10
+ if (!['install', 'setup', 'bootstrap'].includes(command)) {
11
+ console.error('Usage: npx sneakoscope install [--yes|--no-tui]');
12
+ process.exit(2);
13
+ }
14
+ console.log('SKS installer - proof-first Codex harness');
15
+ const already = spawnSync('sks', ['--version'], { encoding: 'utf8' });
16
+ if (already.status !== 0) {
17
+ console.log('> installing global package (npm i -g sneakoscope)...');
18
+ if (run('npm', ['install', '-g', 'sneakoscope']) !== 0) {
19
+ console.error('global install failed - check npm permissions');
20
+ process.exit(1);
21
+ }
22
+ }
23
+ console.log('> repairing/validating environment (sks doctor --fix)...');
24
+ if (run('sks', ['doctor', '--fix', ...(autonomous ? ['--yes'] : [])]) !== 0) {
25
+ console.error('doctor reported blockers - see report above');
26
+ process.exit(1);
27
+ }
28
+ console.log(`
29
+ SKS ready. 다음 3개만 기억하세요 (Codex 입력창에서):
30
+ $Plan "무엇을 만들지" - 계획만 세움 (코드 안 건드림)
31
+ $Work - 계획을 증거 기반으로 실행
32
+ $Swarm "task" - 동적 병렬 스웜 + 기계 검증 루프
33
+ 실시간 화면: sks ui (웹 대시보드) / zellij 세션은 자동
34
+ `);
35
+ //# sourceMappingURL=install.js.map
package/dist/bin/sks.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const FAST_PACKAGE_VERSION = '4.8.7';
2
+ const FAST_PACKAGE_VERSION = '5.1.2';
3
3
  const args = process.argv.slice(2);
4
4
  try {
5
5
  if (args[0] === '--agent' && args[1] === 'worker') {
@@ -0,0 +1,51 @@
1
+ import { PACKAGE_VERSION } from '../core/version.js';
2
+ import { ANSI_CODES, paint, resolveZellijTheme } from '../core/zellij/zellij-theme.js';
3
+ const theme = resolveZellijTheme();
4
+ export const ui = {
5
+ banner(cmd) {
6
+ console.log(paint(theme, ANSI_CODES.dim, `SKS ${PACKAGE_VERSION} · ${cmd}`));
7
+ },
8
+ ok(msg) {
9
+ console.log(`${paint(theme, ANSI_CODES.green, '✔')} ${msg}`);
10
+ },
11
+ warn(msg) {
12
+ console.log(`${paint(theme, ANSI_CODES.yellow, '▲')} ${msg}`);
13
+ },
14
+ fail(msg) {
15
+ console.log(`${paint(theme, ANSI_CODES.red, '✖')} ${msg}`);
16
+ },
17
+ step(msg) {
18
+ console.log(`${paint(theme, ANSI_CODES.dim, '>')} ${msg}`);
19
+ },
20
+ kv(k, v) {
21
+ console.log(` ${paint(theme, ANSI_CODES.dim, k.padEnd(18))} ${v}`);
22
+ },
23
+ table(rows) {
24
+ if (!rows.length)
25
+ return;
26
+ const widths = rows[0]?.map((_cell, index) => Math.max(...rows.map((row) => String(row[index] || '').length))) || [];
27
+ for (const [rowIndex, row] of rows.entries()) {
28
+ const line = row.map((cell, index) => String(cell || '').padEnd(widths[index] || 0)).join(' ').trimEnd();
29
+ console.log(rowIndex === 0 ? paint(theme, ANSI_CODES.dim, line) : line);
30
+ }
31
+ }
32
+ };
33
+ export function withHeartbeat(label, work, opts = {}) {
34
+ if (process.env.SKS_UPDATE_QUIET || !process.stderr.isTTY)
35
+ return work;
36
+ const started = Date.now();
37
+ let index = 0;
38
+ const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
39
+ const timer = setInterval(() => {
40
+ const elapsed = Date.now() - started;
41
+ const seconds = Math.floor(elapsed / 1000);
42
+ const warn = opts.warnAfterMs && elapsed > opts.warnAfterMs ? ' (still working; this can be normal)' : '';
43
+ process.stderr.write(`\r ${frames[index++ % frames.length]} ${label} ... ${seconds}s${warn} `);
44
+ }, 120);
45
+ timer.unref?.();
46
+ return work.finally(() => {
47
+ clearInterval(timer);
48
+ process.stderr.write(`\r${' '.repeat(80)}\r`);
49
+ });
50
+ }
51
+ //# sourceMappingURL=cli-theme.js.map
@@ -96,7 +96,13 @@ export const COMMANDS = {
96
96
  triwiki: skipMigrationGate(entry('stable', 'Inspect TriWiki index, affected graph, and proof bank', 'dist/core/commands/triwiki-command.js', argsCommand(() => import('../core/commands/triwiki-command.js'), 'triwikiCommand', 'dist/core/commands/triwiki-command.js'))),
97
97
  daemon: skipMigrationGate(entry('stable', 'Inspect or warm the local SKS daemon cache', 'dist/core/commands/daemon-command.js', argsCommand(() => import('../core/commands/daemon-command.js'), 'daemonCommand', 'dist/core/commands/daemon-command.js'))),
98
98
  run: entry('beta', 'Classify and execute a task through the SKS trust kernel', 'dist/core/commands/run-command.js', argsCommand(() => import('../core/commands/run-command.js'), 'runCommand', 'dist/core/commands/run-command.js')),
99
+ plan: entry('stable', 'Write a planning-only SKS plan artifact without code edits', 'dist/core/commands/plan-command.js', argsCommand(() => import('../core/commands/plan-command.js'), 'planCommand', 'dist/core/commands/plan-command.js')),
99
100
  status: readOnly(entry('stable', 'Show concise active mission and trust status', 'dist/core/commands/status-command.js', argsCommand(() => import('../core/commands/status-command.js'), 'statusCommand', 'dist/core/commands/status-command.js'))),
101
+ review: entry('stable', 'Review a git diff with machine evidence first', 'dist/core/commands/review-command.js', argsCommand(() => import('../core/commands/review-command.js'), 'reviewCommand', 'dist/core/commands/review-command.js'), {
102
+ allowedDuringActiveRoute: true,
103
+ activeRoutePolicy: 'always'
104
+ }),
105
+ ui: readOnly(entry('stable', 'Open the localhost SKS swarm dashboard', 'dist/core/commands/ui-command.js', argsCommand(() => import('../core/commands/ui-command.js'), 'uiCommand', 'dist/core/commands/ui-command.js'))),
100
106
  root: readOnly(entry('stable', 'Show active SKS root', 'dist/commands/root.js', directCommand(() => import('../commands/root.js'), 'dist/commands/root.js'))),
101
107
  update: skipMigrationGate(entry('stable', 'Update the global SKS npm package', 'dist/core/commands/basic-cli.js', subcommand(() => import(basicModule), 'updateCommand', 'dist/core/commands/basic-cli.js', 'now'))),
102
108
  uninstall: entry('stable', 'Uninstall SKS global skills, hooks, config, menu bar, and optional project residue', 'dist/core/commands/uninstall-command.js', argsCommand(() => import('../core/commands/uninstall-command.js'), 'uninstallCommand', 'dist/core/commands/uninstall-command.js'), {
@@ -132,9 +138,9 @@ export const COMMANDS = {
132
138
  'zellij-viewport-pane': skipMigrationGate(readOnly(entry('beta', 'Render a dynamically bound Zellij worker viewport pane', 'dist/commands/zellij-viewport-pane.js', directCommand(() => import('../commands/zellij-viewport-pane.js'), 'dist/commands/zellij-viewport-pane.js')))),
133
139
  'zellij-slot-column-anchor': entry('beta', 'Render the compact SLOTS anchor pane for first-slot-down Zellij stacks', 'dist/commands/zellij-slot-column-anchor.js', directCommand(() => import('../commands/zellij-slot-column-anchor.js'), 'dist/commands/zellij-slot-column-anchor.js')),
134
140
  zellij: activeRouteDiagnostic(entry('beta', 'Inspect Zellij runtime status and explain repair (no auto-install)', 'dist/commands/zellij.js', directCommand(() => import('../commands/zellij.js'), 'dist/commands/zellij.js'))),
135
- 'mad-sks': routeStateMutator(entry('beta', 'MAD-SKS scoped permission modifier', 'dist/commands/mad-sks.js', directCommand(() => import('../commands/mad-sks.js'), 'dist/commands/mad-sks.js')), ['mad-sks-gate.json']),
141
+ 'mad-sks': routeStateMutator(entry('beta', 'MAD-SKS scoped permission modifier + SQL-plane execution (merged MAD-DB)', 'dist/commands/mad-sks.js', directCommand(() => import('../commands/mad-sks.js'), 'dist/commands/mad-sks.js')), ['mad-sks-gate.json']),
136
142
  glm: entry('beta', 'Run GLM 5.2 MAD mode through OpenRouter', 'dist/core/commands/glm-command.js', argsCommand(() => import('../core/commands/glm-command.js'), 'glmCommand', 'dist/core/commands/glm-command.js')),
137
- 'mad-db': routeStateMutator(entry('beta', 'Run first-class MadDB SQL-plane execution cycles with mission-local Supabase write transport', 'dist/commands/mad-db.js', directCommand(() => import('../commands/mad-db.js'), 'dist/commands/mad-db.js')), ['mad-db-gate.json']),
143
+ 'mad-db': routeStateMutator(entry('beta', 'Deprecated alias for MAD-SKS SQL-plane execution; redirects to sks mad-sks sql|apply-migration', 'dist/commands/mad-db.js', directCommand(() => import('../commands/mad-db.js'), 'dist/commands/mad-db.js')), ['mad-sks-gate.json']),
138
144
  'auto-review': entry('beta', 'Manage auto-review profile', 'dist/commands/auto-review.js', directCommand(() => import('../commands/auto-review.js'), 'dist/commands/auto-review.js')),
139
145
  'dollar-commands': entry('stable', 'List Codex App dollar commands', 'dist/core/commands/basic-cli.js', basicArgs('dollarCommandsCommand')),
140
146
  'fast-mode': entry('stable', 'Toggle SKS Fast mode default for dollar-command routes', 'dist/core/commands/fast-mode-command.js', argsCommand(() => import('../core/commands/fast-mode-command.js'), 'fastModeCommand', 'dist/core/commands/fast-mode-command.js')),
@@ -166,7 +172,7 @@ export const COMMANDS = {
166
172
  reasoning: entry('labs', 'Show reasoning route', 'dist/core/commands/basic-cli.js', basicArgs('reasoningCommand')),
167
173
  aliases: entry('stable', 'Show command aliases', 'dist/core/commands/basic-cli.js', basicNoArgs('aliasesCommand')),
168
174
  selftest: entry('stable', 'Run local mock selftest', 'dist/core/commands/basic-cli.js', basicArgs('selftestCommand')),
169
- goal: routeStateMutator(entry('beta', 'Manage Goal bridge workflow', 'dist/core/commands/goal-command.js', subcommand(() => import('../core/commands/goal-command.js'), 'goalCommand', 'dist/core/commands/goal-command.js')), ['goal-gate.json']),
175
+ goal: routeStateMutator(entry('beta', 'Manage Goal bridge workflow', 'dist/core/commands/goal-command.js', subcommand(() => import('../core/commands/goal-command.js'), 'goalCommand', 'dist/core/commands/goal-command.js')), ['loop-graph-proof.json']),
170
176
  'seo-geo-optimizer': entry('beta', 'Run unified SEO/GEO optimizer audit/plan/apply/verify on the search-visibility kernel', 'dist/core/commands/seo-command.js', argsCommand(() => import('../core/commands/seo-command.js'), 'seoGeoOptimizerCommand', 'dist/core/commands/seo-command.js')),
171
177
  hook: entry('beta', 'Codex hook entrypoint', 'dist/commands/hook.js', directCommand(() => import('../commands/hook.js'), 'dist/commands/hook.js')),
172
178
  profile: entry('labs', 'Inspect/set profile', 'dist/commands/profile.js', directCommand(() => import('../commands/profile.js'), 'dist/commands/profile.js')),
@@ -184,6 +190,7 @@ export const COMMANDS = {
184
190
  eval: entry('labs', 'Run eval reports', 'dist/core/commands/eval-command.js', subcommand(() => import('../core/commands/eval-command.js'), 'evalCommand', 'dist/core/commands/eval-command.js', 'run')),
185
191
  harness: entry('labs', 'Run harness fixtures', 'dist/core/commands/harness-command.js', subcommand(() => import('../core/commands/harness-command.js'), 'harnessCommand', 'dist/core/commands/harness-command.js', 'fixture')),
186
192
  wiki: activeRouteDiagnostic(entry('beta', 'Manage TriWiki and image voxel ledgers', 'dist/commands/wiki.js', directCommand(() => import('../commands/wiki.js'), 'dist/commands/wiki.js'))),
193
+ memory: entry('beta', 'Project TriWiki memory into managed AGENTS.md blocks or run memory GC', 'dist/commands/memory.js', directCommand(() => import('../commands/memory.js'), 'dist/commands/memory.js')),
187
194
  gc: activeRouteDiagnostic(entry('labs', 'Compact/prune runtime state', 'dist/core/commands/gc-command.js', gcArgs('gcCommand'))),
188
195
  stats: readOnly(entry('labs', 'Show storage stats', 'dist/core/commands/gc-command.js', gcArgs('statsCommand'))),
189
196
  features: entry('beta', 'Validate feature registry', 'dist/commands/features.js', directCommand(() => import('../commands/features.js'), 'dist/commands/features.js')),
@@ -202,8 +209,12 @@ export const COMMAND_ALIASES = {
202
209
  '--mad': 'mad-sks',
203
210
  '--MAD': 'mad-sks',
204
211
  '--mad-sks': 'mad-sks',
212
+ 'ux-review': 'image-ux-review',
213
+ 'visual-review': 'image-ux-review',
214
+ 'ui-ux-review': 'image-ux-review',
205
215
  '--agent': 'agent',
206
- '--naruto': 'naruto'
216
+ '--naruto': 'naruto',
217
+ swarm: 'naruto'
207
218
  };
208
219
  export function commandNames() {
209
220
  return Object.keys(COMMANDS).sort();
@@ -5,18 +5,28 @@ export function helpFast() {
5
5
  console.log(`SKS
6
6
  SNEAKOSCOPE CODEX v${PACKAGE_VERSION}
7
7
 
8
- Usage
8
+ 3-pillar frontdoor
9
9
 
10
- sks
11
- sks help [topic]
12
- sks commands [--json]
13
- sks dollar-commands [--json]
14
- sks proof show --json
10
+ $Plan "task" plan only; writes .sneakoscope/plans, no code edits
11
+ $Work execute the latest plan with evidence gates
12
+ $Swarm "task" dynamic Naruto swarm with machine verification
13
+
14
+ Local surfaces
15
+
16
+ sks ui localhost live dashboard
17
+ sks review --staged machine-first diff review
18
+ sks doctor --fix repair/validate the harness
19
+
20
+ Discovery
21
+
22
+ sks commands [--json] all commands
23
+ sks dollar-commands all Codex App $ routes
24
+ sks help [topic] focused help
15
25
  `);
16
- for (const row of commandRows().filter((entry) => entry.maturity !== 'labs')) {
26
+ for (const row of commandRows().filter((entry) => entry.maturity !== 'labs').slice(0, 18)) {
17
27
  console.log(` ${row.usage.padEnd(58)} ${row.description}`);
18
28
  }
19
- console.log('\nThree core promises: Completion Proof for serious routes, Image Voxel TriWiki for visual routes, and release-gated Codex App/codex-lb/hooks/Rust evidence.');
29
+ console.log('\nRun `sks commands` for the full catalog. Core promise: machine-verified completion, not vibes.');
20
30
  }
21
31
  function commandRows() {
22
32
  const registry = new Map(Object.entries(COMMANDS).map(([name, meta]) => [name, meta]));
@@ -2,6 +2,7 @@ import fs from 'node:fs/promises';
2
2
  import os from 'node:os';
3
3
  import path from 'node:path';
4
4
  import { runUltraSearch } from '../core/ultra-search/index.js';
5
+ import { evaluateLocalGate } from '../core/commands/route-success-helpers.js';
5
6
  export async function insaneSearchCommand(sub = 'help', args = []) {
6
7
  const action = sub || 'help';
7
8
  if (action === 'run')
@@ -35,16 +36,25 @@ async function runCommand(args) {
35
36
  query,
36
37
  ...(mode ? { mode } : {})
37
38
  });
39
+ const gate = await evaluateUltraSearchGate(missionDir);
40
+ const finalResult = {
41
+ ...result,
42
+ ok: result.ok === true && gate.ok === true,
43
+ blockers: [...new Set([...(result.blockers || []), ...gate.blockers])],
44
+ gate_evaluation: gate
45
+ };
38
46
  if (json)
39
- console.log(JSON.stringify(result, null, 2));
47
+ console.log(JSON.stringify(finalResult, null, 2));
40
48
  else {
41
- console.log(`InsaneSearch ${result.ok ? 'completed' : 'partial/blocked'}: ${result.mode}`);
49
+ console.log(`InsaneSearch ${finalResult.ok ? 'completed' : 'partial/blocked'}: ${result.mode}`);
42
50
  console.log(`Mission: ${missionDir}`);
43
51
  console.log(`Sources: ${result.sources.length}, verified: ${result.proof.verified_source_count}`);
44
- if (result.blockers.length)
45
- console.log(`Blockers: ${result.blockers.join(', ')}`);
52
+ if (finalResult.blockers.length)
53
+ console.log(`Blockers: ${finalResult.blockers.join(', ')}`);
46
54
  }
47
- return result;
55
+ if (!finalResult.ok)
56
+ process.exitCode = 1;
57
+ return finalResult;
48
58
  }
49
59
  async function doctorCommand(args) {
50
60
  const json = args.includes('--json');
@@ -74,11 +84,16 @@ async function inspectCommand(action, args) {
74
84
  const target = mission === 'latest' ? await latestMissionDir() : mission;
75
85
  const file = path.join(target, 'ultra-search', action === 'sources' ? 'source-ledger.json' : action === 'claims' ? 'claim-ledger.json' : 'ultra-search-result.json');
76
86
  const text = await fs.readFile(file, 'utf8');
87
+ const parsed = JSON.parse(text);
88
+ const gate = await evaluateUltraSearchGate(target);
89
+ const result = { ...parsed, ok: parsed.ok === true && gate.ok === true, gate_evaluation: gate, blockers: [...new Set([...(parsed.blockers || []), ...gate.blockers])] };
90
+ if (!result.ok)
91
+ process.exitCode = 1;
77
92
  if (json)
78
- console.log(text.trim());
93
+ console.log(JSON.stringify(result, null, 2));
79
94
  else
80
- console.log(text);
81
- return JSON.parse(text);
95
+ console.log(JSON.stringify(result, null, 2));
96
+ return result;
82
97
  }
83
98
  async function cacheCommand(args) {
84
99
  const sub = positional(args)[0] || 'status';
@@ -164,4 +179,17 @@ async function latestMissionDir() {
164
179
  function asyncDirLikelyUltra(dir) {
165
180
  return Boolean(dir);
166
181
  }
182
+ async function evaluateUltraSearchGate(missionDir) {
183
+ return evaluateLocalGate({
184
+ root: process.cwd(),
185
+ dir: missionDir,
186
+ gateFile: path.join('ultra-search', 'ultra-search-gate.json'),
187
+ requiredArtifacts: [
188
+ path.join('ultra-search', 'source-ledger.json'),
189
+ path.join('ultra-search', 'claim-ledger.json'),
190
+ path.join('ultra-search', 'ultra-search-proof.json'),
191
+ path.join('ultra-search', 'ultra-search-result.json')
192
+ ]
193
+ });
194
+ }
167
195
  //# sourceMappingURL=insane-search-command.js.map