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
@@ -1,143 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import os from 'node:os';
5
- import path from 'node:path';
6
- import { spawnSync } from 'node:child_process';
7
- import { pathToFileURL } from 'node:url';
8
- import { currentDistFreshness } from './lib/ensure-dist-fresh.js';
9
- const root = process.cwd();
10
- const npmBin = process.platform === 'win32' ? 'npm.cmd' : 'npm';
11
- const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'sks-command-import-smoke-'));
12
- const cache = path.join(tmp, 'npm-cache');
13
- const consumer = path.join(tmp, 'consumer');
14
- const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
15
- const failures = [];
16
- const rows = [];
17
- fs.mkdirSync(consumer, { recursive: true });
18
- fs.writeFileSync(path.join(consumer, 'package.json'), `${JSON.stringify({ name: 'sks-command-smoke-consumer', private: true }, null, 2)}\n`);
19
- try {
20
- if (process.env.SKS_ENSURE_DIST_NO_REBUILD === '1' || process.env.SKS_RELEASE_DIST_FRESHNESS_NO_REBUILD === '1') {
21
- const freshness = currentDistFreshness();
22
- rows.push({ label: 'dist_freshness', ok: freshness.ok, status: freshness.ok ? 0 : 1, issues: freshness.issues });
23
- if (!freshness.ok)
24
- failures.push(`dist_not_fresh:${freshness.issues.join(',')}`);
25
- }
26
- else {
27
- run('build', npmBin, ['run', 'build'], { cwd: root });
28
- }
29
- const pack = run('npm_pack', npmBin, ['pack', '--json', '--ignore-scripts', '--pack-destination', tmp, '--registry', 'https://registry.npmjs.org/'], { cwd: root });
30
- const info = pack.ok ? JSON.parse(pack.stdout || '[]')[0] : null;
31
- const tarball = info ? path.join(tmp, info.filename) : null;
32
- if (tarball)
33
- extractPackedTarball(tarball);
34
- const pkgRoot = path.join(consumer, 'node_modules', 'sneakoscope');
35
- if (!fs.existsSync(pkgRoot))
36
- failures.push('installed_package_missing');
37
- else
38
- await smokeCommands(pkgRoot);
39
- }
40
- finally {
41
- if (failures.length && process.argv.includes('--keep')) {
42
- // Keep temp root for debugging only when explicitly requested.
43
- }
44
- else if (!process.argv.includes('--keep')) {
45
- fs.rmSync(tmp, { recursive: true, force: true });
46
- }
47
- }
48
- const result = {
49
- schema: 'sks.blackbox-command-import-smoke.v1',
50
- ok: failures.length === 0,
51
- temp_root: failures.length && process.argv.includes('--keep') ? tmp : null,
52
- rows,
53
- failures
54
- };
55
- console.log(JSON.stringify(result, null, 2));
56
- if (!result.ok)
57
- process.exitCode = 1;
58
- function run(label, cmd, args, options = {}) {
59
- const result = spawnSync(cmd, args, {
60
- cwd: options.cwd || root,
61
- encoding: 'utf8',
62
- timeout: options.timeout || 120_000,
63
- env: childNpmEnv(options.env)
64
- });
65
- const row = {
66
- label,
67
- command: [cmd, ...args].join(' '),
68
- status: result.status,
69
- ok: result.status === 0,
70
- stdout: result.stdout || '',
71
- stderr_tail: String(result.stderr || '').slice(-800)
72
- };
73
- rows.push({ ...row, stdout: undefined });
74
- if (!row.ok)
75
- failures.push(`${label}:${row.stderr_tail || result.stdout}`);
76
- return row;
77
- }
78
- function childNpmEnv(extra = {}) {
79
- const env = { ...process.env, npm_config_cache: cache, SKS_SKIP_NPM_FRESHNESS_CHECK: '1', CI: 'true', ...extra };
80
- delete env.npm_config_dry_run;
81
- delete env.NPM_CONFIG_DRY_RUN;
82
- return env;
83
- }
84
- function extractPackedTarball(tarball) {
85
- const pkgRoot = path.join(consumer, 'node_modules', 'sneakoscope');
86
- fs.mkdirSync(pkgRoot, { recursive: true });
87
- const stripFlag = process.platform === 'win32' ? '--strip-components=1' : '--strip-components';
88
- const args = process.platform === 'win32'
89
- ? ['-xzf', tarball, '-C', pkgRoot, stripFlag]
90
- : ['-xzf', tarball, '-C', pkgRoot, stripFlag, '1'];
91
- const extracted = run('extract_pack_tarball', 'tar', args, { cwd: consumer });
92
- if (!extracted.ok)
93
- return;
94
- linkRuntimeDependencies(pkgRoot);
95
- }
96
- function linkRuntimeDependencies(pkgRoot) {
97
- const deps = Object.keys(pkg.dependencies || {});
98
- if (!deps.length)
99
- return;
100
- const nodeModules = path.join(pkgRoot, 'node_modules');
101
- fs.mkdirSync(nodeModules, { recursive: true });
102
- for (const dep of deps) {
103
- const source = path.join(root, 'node_modules', dep);
104
- const target = path.join(nodeModules, dep);
105
- if (!fs.existsSync(source)) {
106
- failures.push(`dependency_missing:${dep}`);
107
- continue;
108
- }
109
- fs.mkdirSync(path.dirname(target), { recursive: true });
110
- try {
111
- fs.symlinkSync(source, target, process.platform === 'win32' ? 'junction' : 'dir');
112
- rows.push({ label: `link_dependency:${dep}`, ok: true, status: 0 });
113
- }
114
- catch (err) {
115
- failures.push(`dependency_link_failed:${dep}:${err.message}`);
116
- rows.push({ label: `link_dependency:${dep}`, ok: false, status: 1, stderr_tail: String(err.message).slice(-800) });
117
- }
118
- }
119
- }
120
- async function smokeCommands(pkgRoot) {
121
- const registryPath = path.join(pkgRoot, 'dist', 'cli', 'command-registry.js');
122
- if (!fs.existsSync(registryPath)) {
123
- failures.push('dist_cli_command_registry_missing');
124
- return;
125
- }
126
- const registry = await import(pathToFileURL(registryPath));
127
- const names = registry.commandNames();
128
- for (const name of names) {
129
- const entry = registry.COMMANDS[name];
130
- try {
131
- const mod = await entry.lazy();
132
- const runner = mod.run || mod.main || mod.default;
133
- if (typeof runner !== 'function')
134
- failures.push(`${name}:runner_missing`);
135
- rows.push({ label: `lazy_import:${name}`, ok: typeof runner === 'function', status: typeof runner === 'function' ? 0 : 1 });
136
- }
137
- catch (err) {
138
- failures.push(`${name}:${err.stack || err.message}`);
139
- rows.push({ label: `lazy_import:${name}`, ok: false, status: 1, stderr_tail: String(err.stack || err.message).slice(-800) });
140
- }
141
- }
142
- }
143
- //# sourceMappingURL=blackbox-command-import-smoke.js.map
@@ -1,77 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import os from 'node:os';
5
- import path from 'node:path';
6
- import { spawnSync } from 'node:child_process';
7
- import { fileURLToPath } from 'node:url';
8
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
9
- const json = process.argv.includes('--json');
10
- const dryRun = process.argv.includes('--dry-run');
11
- const keep = process.argv.includes('--keep');
12
- const npmBin = process.platform === 'win32' ? 'npm.cmd' : 'npm';
13
- const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'sks-blackbox-global-'));
14
- const prefix = path.join(tmp, 'prefix');
15
- const cache = path.join(tmp, 'npm-cache');
16
- const binDir = process.platform === 'win32' ? prefix : path.join(prefix, 'bin');
17
- const shim = path.join(binDir, process.platform === 'win32' ? 'sks.cmd' : 'sks');
18
- const sneakoscopeShim = path.join(binDir, process.platform === 'win32' ? 'sneakoscope.cmd' : 'sneakoscope');
19
- const steps = [];
20
- function run(label, cmd, args, options = {}) {
21
- const result = dryRun
22
- ? { status: 0, signal: null, stdout: '', stderr: '' }
23
- : spawnSync(cmd, args, {
24
- cwd: options.cwd || root,
25
- encoding: 'utf8',
26
- timeout: options.timeout || 120_000,
27
- env: childNpmEnv(options.env)
28
- });
29
- const row = {
30
- label,
31
- command: [cmd, ...args].join(' '),
32
- cwd: options.cwd || root,
33
- status: result.status,
34
- ok: result.status === 0,
35
- stdout_bytes: Buffer.byteLength(result.stdout || ''),
36
- stderr_bytes: Buffer.byteLength(result.stderr || ''),
37
- stderr_tail: String(result.stderr || '').slice(-800)
38
- };
39
- steps.push(row);
40
- return { ...row, stdout: result.stdout || '', stderr: result.stderr || '' };
41
- }
42
- function childNpmEnv(extra = {}) {
43
- const env = { ...process.env, npm_config_cache: cache, npm_config_prefix: prefix, SKS_SKIP_NPM_FRESHNESS_CHECK: '1', CI: 'true', ...extra };
44
- delete env.npm_config_dry_run;
45
- delete env.NPM_CONFIG_DRY_RUN;
46
- return env;
47
- }
48
- let tarball = dryRun ? path.join(tmp, 'sneakoscope-0.0.0.tgz') : null;
49
- const pack = run('npm_pack', npmBin, ['pack', '--json', '--ignore-scripts', '--pack-destination', tmp, '--registry', 'https://registry.npmjs.org/']);
50
- if (pack.ok && !dryRun) {
51
- const info = JSON.parse(pack.stdout)[0];
52
- tarball = path.join(tmp, info.filename);
53
- }
54
- if (pack.ok)
55
- run('npm_install_global_prefix', npmBin, ['install', '--global', '--prefix', prefix, '--no-audit', '--no-fund', tarball]);
56
- if (steps.at(-1)?.ok)
57
- run('global_shim_version', shim, ['--version'], { cwd: tmp, env: pathEnv() });
58
- if (steps.at(-1)?.ok)
59
- run('global_sneakoscope_version', sneakoscopeShim, ['--version'], { cwd: tmp, env: pathEnv() });
60
- if (steps.at(-1)?.ok)
61
- run('global_sks_root_json', shim, ['root', '--json'], { cwd: tmp, env: pathEnv() });
62
- if (!keep)
63
- fs.rmSync(tmp, { recursive: true, force: true });
64
- const result = { schema: 'sks.blackbox-global-shim.v1', ok: steps.every((step) => step.ok), dry_run: dryRun, temp_root: keep ? tmp : null, steps };
65
- if (json)
66
- console.log(JSON.stringify(result, null, 2));
67
- else {
68
- console.log(`Blackbox global shim: ${result.ok ? 'ok' : 'blocked'}${dryRun ? ' (dry-run)' : ''}`);
69
- for (const step of steps)
70
- console.log(`- ${step.ok ? 'ok' : 'blocked'} ${step.label}`);
71
- }
72
- if (!result.ok)
73
- process.exitCode = 1;
74
- function pathEnv() {
75
- return { PATH: `${binDir}${path.delimiter}${process.env.PATH || ''}` };
76
- }
77
- //# sourceMappingURL=blackbox-global-shim.js.map
@@ -1,70 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import path from 'node:path';
5
- import { spawnSync } from 'node:child_process';
6
- const contract = process.argv.includes('--contract') || process.env.SKS_REAL_BLACKBOX_MATRIX === '0';
7
- const real = !contract;
8
- const root = process.cwd();
9
- const rows = [
10
- row('npm_pack_local_tarball', 'blackbox:pack-install', ['npm_pack']),
11
- row('temp_npm_install', 'blackbox:pack-install', ['npm_install_tarball']),
12
- row('npx_one_shot', 'blackbox:npx', ['npm_exec_one_shot_version', 'npm_exec_one_shot_root']),
13
- row('global_shim_temp_prefix', 'blackbox:global-shim', ['npm_install_global_prefix', 'global_shim_version']),
14
- row('fresh_home', 'blackbox:pack-install', ['npx_sks_root_json']),
15
- row('project_local_install', 'blackbox:pack-install', ['npx_sks_setup_local_only']),
16
- row('packed_run_execute', 'blackbox:pack-install', ['npx_sks_run_execute_mock']),
17
- row('no_git_repo_directory', 'blackbox:pack-install', ['npx_sks_root_json']),
18
- row('read_only_project_directory', 'blackbox:pack-install', ['npx_sks_root_json'], { optional: true }),
19
- row('path_with_spaces', 'blackbox:pack-install', ['npx_sks_root_json']),
20
- row('korean_unicode_path', 'blackbox:pack-install', ['npx_sks_root_json'])
21
- ];
22
- if (real) {
23
- for (const script of ['blackbox:pack-install', 'blackbox:npx', 'blackbox:global-shim']) {
24
- const result = spawnSync('npm', ['run', script, '--', '--json'], { cwd: root, encoding: 'utf8', stdio: 'pipe' });
25
- const parsed = parseJsonFromStdout(result.stdout);
26
- for (const item of rows.filter((entry) => entry.script === script)) {
27
- const labelsOk = item.required_step_labels.length
28
- ? item.required_step_labels.every((label) => parsed?.steps?.some((step) => step.label === label && step.ok))
29
- : result.status === 0;
30
- item.ok = item.optional ? true : (result.status === 0 && labelsOk);
31
- item.status = item.ok ? (item.optional && !labelsOk ? 'verified_partial' : 'verified') : 'blocked';
32
- item.stderr_tail = String(result.stderr || '').slice(-500);
33
- item.duration_ms = parsed?.steps?.filter((step) => item.required_step_labels.includes(step.label)).reduce((sum, step) => sum + Number(step.duration_ms || 0), 0) || null;
34
- }
35
- }
36
- }
37
- const report = {
38
- schema: 'sks.blackbox-matrix.v2',
39
- ok: rows.every((entry) => entry.ok),
40
- mode: real ? 'real' : 'contract',
41
- rows
42
- };
43
- const out = path.join(root, '.sneakoscope', 'reports', 'blackbox-matrix.json');
44
- fs.mkdirSync(path.dirname(out), { recursive: true });
45
- fs.writeFileSync(out, `${JSON.stringify(report, null, 2)}\n`);
46
- console.log(JSON.stringify({ ...report, report_path: out }, null, 2));
47
- if (!report.ok)
48
- process.exitCode = 1;
49
- function row(id, script, requiredStepLabels = [], extra = {}) {
50
- return {
51
- id,
52
- script,
53
- required_step_labels: requiredStepLabels,
54
- ok: !real,
55
- status: real ? 'pending' : 'verified_partial',
56
- command: script,
57
- note: real ? 'runs the selected package blackbox script in real mode' : 'contract quick mode; release gate uses real mode',
58
- ...extra
59
- };
60
- }
61
- function parseJsonFromStdout(stdout = '') {
62
- try {
63
- const start = String(stdout).indexOf('{');
64
- return start >= 0 ? JSON.parse(String(stdout).slice(start)) : null;
65
- }
66
- catch {
67
- return null;
68
- }
69
- }
70
- //# sourceMappingURL=blackbox-matrix.js.map
@@ -1,69 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import os from 'node:os';
5
- import path from 'node:path';
6
- import { spawnSync } from 'node:child_process';
7
- import { fileURLToPath } from 'node:url';
8
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
9
- const json = process.argv.includes('--json');
10
- const dryRun = process.argv.includes('--dry-run');
11
- const keep = process.argv.includes('--keep');
12
- const npmBin = process.platform === 'win32' ? 'npm.cmd' : 'npm';
13
- const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'sks-blackbox-npx-'));
14
- const cache = path.join(tmp, 'npm-cache');
15
- const prefix = path.join(tmp, 'prefix');
16
- const steps = [];
17
- function run(label, cmd, args, options = {}) {
18
- const result = dryRun
19
- ? { status: 0, signal: null, stdout: '', stderr: '' }
20
- : spawnSync(cmd, args, {
21
- cwd: options.cwd || root,
22
- encoding: 'utf8',
23
- timeout: options.timeout || 120_000,
24
- env: childNpmEnv(options.env)
25
- });
26
- const row = {
27
- label,
28
- command: [cmd, ...args].join(' '),
29
- cwd: options.cwd || root,
30
- status: result.status,
31
- ok: result.status === 0,
32
- stdout_bytes: Buffer.byteLength(result.stdout || ''),
33
- stderr_bytes: Buffer.byteLength(result.stderr || ''),
34
- stderr_tail: String(result.stderr || '').slice(-800)
35
- };
36
- steps.push(row);
37
- return { ...row, stdout: result.stdout || '', stderr: result.stderr || '' };
38
- }
39
- function childNpmEnv(extra = {}) {
40
- const env = { ...process.env, npm_config_cache: cache, npm_config_prefix: prefix, SKS_SKIP_NPM_FRESHNESS_CHECK: '1', CI: 'true', ...extra };
41
- delete env.npm_config_dry_run;
42
- delete env.NPM_CONFIG_DRY_RUN;
43
- return env;
44
- }
45
- let tarball = dryRun ? path.join(tmp, 'sneakoscope-0.0.0.tgz') : null;
46
- const pack = run('npm_pack', npmBin, ['pack', '--json', '--ignore-scripts', '--pack-destination', tmp, '--registry', 'https://registry.npmjs.org/']);
47
- if (pack.ok && !dryRun) {
48
- const info = JSON.parse(pack.stdout)[0];
49
- tarball = path.join(tmp, info.filename);
50
- }
51
- if (pack.ok)
52
- run('npm_exec_one_shot_version', npmBin, ['exec', '--yes', '--package', tarball, '--', 'sks', '--version'], { cwd: tmp });
53
- if (steps.at(-1)?.ok)
54
- run('npm_exec_one_shot_root', npmBin, ['exec', '--yes', '--package', tarball, '--', 'sks', 'root', '--json'], { cwd: tmp });
55
- if (steps.at(-1)?.ok)
56
- run('npm_exec_one_shot_selftest', npmBin, ['exec', '--yes', '--package', tarball, '--', 'sks', 'selftest', '--mock'], { cwd: tmp, timeout: 180_000 });
57
- if (!keep)
58
- fs.rmSync(tmp, { recursive: true, force: true });
59
- const result = { schema: 'sks.blackbox-npx-one-shot.v1', ok: steps.every((step) => step.ok), dry_run: dryRun, temp_root: keep ? tmp : null, steps };
60
- if (json)
61
- console.log(JSON.stringify(result, null, 2));
62
- else {
63
- console.log(`Blackbox npx one-shot: ${result.ok ? 'ok' : 'blocked'}${dryRun ? ' (dry-run)' : ''}`);
64
- for (const step of steps)
65
- console.log(`- ${step.ok ? 'ok' : 'blocked'} ${step.label}`);
66
- }
67
- if (!result.ok)
68
- process.exitCode = 1;
69
- //# sourceMappingURL=blackbox-npx-one-shot.js.map
@@ -1,174 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import os from 'node:os';
5
- import path from 'node:path';
6
- import { spawnSync } from 'node:child_process';
7
- import { fileURLToPath } from 'node:url';
8
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
9
- const json = process.argv.includes('--json');
10
- const dryRun = process.argv.includes('--dry-run');
11
- const keep = process.argv.includes('--keep');
12
- const npmBin = process.platform === 'win32' ? 'npm.cmd' : 'npm';
13
- const npxBin = process.platform === 'win32' ? 'npx.cmd' : 'npx';
14
- const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'sks-blackbox-pack-install-'));
15
- const cache = path.join(tmp, 'npm-cache');
16
- const prefix = path.join(tmp, 'prefix');
17
- const consumer = path.join(tmp, 'consumer');
18
- fs.mkdirSync(consumer, { recursive: true });
19
- fs.writeFileSync(path.join(consumer, 'package.json'), `${JSON.stringify({ name: 'sks-blackbox-consumer', private: true, version: '0.0.0' }, null, 2)}\n`);
20
- const steps = [];
21
- function spawnStep(label, cmd, args, options = {}) {
22
- const result = dryRun
23
- ? { status: 0, signal: null, stdout: '', stderr: '' }
24
- : spawnSync(cmd, args, {
25
- cwd: options.cwd || root,
26
- encoding: 'utf8',
27
- timeout: options.timeout || 120_000,
28
- env: childNpmEnv(options.env)
29
- });
30
- return {
31
- label,
32
- command: [cmd, ...args].join(' '),
33
- cwd: options.cwd || root,
34
- status: result.status,
35
- ok: result.status === 0,
36
- stdout_bytes: Buffer.byteLength(result.stdout || ''),
37
- stderr_bytes: Buffer.byteLength(result.stderr || ''),
38
- stdout_tail: String(result.stdout || '').slice(-800),
39
- stderr_tail: String(result.stderr || '').slice(-800),
40
- stdout: result.stdout || '',
41
- stderr: result.stderr || ''
42
- };
43
- }
44
- function childNpmEnv(extra = {}) {
45
- const env = { ...process.env, npm_config_cache: cache, npm_config_prefix: prefix, SKS_SKIP_NPM_FRESHNESS_CHECK: '1', CI: 'true', ...extra };
46
- delete env.npm_config_dry_run;
47
- delete env.NPM_CONFIG_DRY_RUN;
48
- return env;
49
- }
50
- function run(label, cmd, args, options = {}) {
51
- const row = spawnStep(label, cmd, args, options);
52
- steps.push(recordStep(row));
53
- return row;
54
- }
55
- function runWithRetry(label, cmd, args, options = {}) {
56
- const attempts = Math.max(1, Number(options.attempts || 2));
57
- const attemptRows = [];
58
- for (let index = 0; index < attempts; index += 1) {
59
- if (index > 0)
60
- cleanupInstallAttempt(options.cwd || root);
61
- const row = spawnStep(label, cmd, args, options);
62
- attemptRows.push(row);
63
- if (row.ok || dryRun) {
64
- const final = { ...row, label, attempts: index + 1, retry_count: index, attempts_log: attemptRows.map(compactAttempt) };
65
- steps.push(recordStep(final));
66
- return final;
67
- }
68
- }
69
- const last = attemptRows.at(-1);
70
- const final = { ...last, label, attempts, retry_count: attempts - 1, attempts_log: attemptRows.map(compactAttempt) };
71
- steps.push(recordStep(final));
72
- return final;
73
- }
74
- function recordStep(row) {
75
- const { stdout, stderr, ...recorded } = row;
76
- return recorded;
77
- }
78
- function compactAttempt(row) {
79
- return {
80
- status: row.status,
81
- ok: row.ok,
82
- stdout_bytes: row.stdout_bytes,
83
- stderr_bytes: row.stderr_bytes,
84
- stdout_tail: row.stdout_tail,
85
- stderr_tail: row.stderr_tail
86
- };
87
- }
88
- function cleanupInstallAttempt(cwd) {
89
- if (dryRun)
90
- return;
91
- for (const rel of ['node_modules', 'package-lock.json']) {
92
- fs.rmSync(path.join(cwd, rel), { recursive: true, force: true });
93
- }
94
- }
95
- let tarball = dryRun ? path.join(tmp, 'sneakoscope-0.0.0.tgz') : null;
96
- const pack = run('npm_pack', npmBin, ['pack', '--json', '--ignore-scripts', '--pack-destination', tmp, '--registry', 'https://registry.npmjs.org/']);
97
- if (pack.ok && !dryRun) {
98
- const info = JSON.parse(pack.stdout || '[]')[0];
99
- tarball = path.join(tmp, info.filename);
100
- }
101
- if (pack.ok)
102
- runWithRetry('npm_install_tarball', npmBin, ['install', '--no-audit', '--no-fund', tarball], { cwd: consumer, attempts: 2 });
103
- if (steps.at(-1)?.ok)
104
- run('npx_sks_version', npxBin, ['sks', '--version'], { cwd: consumer });
105
- if (steps.at(-1)?.ok)
106
- run('npx_sks_root_json', npxBin, ['sks', 'root', '--json'], { cwd: consumer });
107
- if (steps.at(-1)?.ok)
108
- run('npx_sks_setup_local_only', npxBin, ['sks', 'setup', '--local-only', '--json'], { cwd: consumer });
109
- if (steps.at(-1)?.ok)
110
- run('npx_sks_selftest_mock', npxBin, ['sks', 'selftest', '--mock'], { cwd: consumer, timeout: 180_000 });
111
- if (steps.at(-1)?.ok)
112
- run('npx_sks_run_execute_mock', npxBin, ['sks', 'run', 'blackbox execute fixture', '--execute', '--mock', '--json'], { cwd: consumer, timeout: 180_000 });
113
- if (steps.at(-1)?.ok)
114
- run('npx_sks_agent_mock', npxBin, ['sks', 'agent', 'run', 'blackbox native agent fixture', '--mock', '--json'], { cwd: consumer, timeout: 180_000 });
115
- let qaMissionId = null;
116
- if (steps.at(-1)?.ok) {
117
- const qaPrepare = run('npx_sks_qa_loop_prepare', npxBin, ['sks', 'qa-loop', 'prepare', 'blackbox API QA', '--json'], { cwd: consumer, timeout: 180_000 });
118
- try {
119
- qaMissionId = JSON.parse(qaPrepare.stdout).mission_id || null;
120
- }
121
- catch { }
122
- }
123
- if (steps.at(-1)?.ok)
124
- run('npx_sks_qa_loop_run_mock', npxBin, ['sks', 'qa-loop', 'run', qaMissionId || 'latest', '--mock', '--json'], { cwd: consumer, timeout: 180_000 });
125
- if (steps.at(-1)?.ok) {
126
- const proofFile = dryRun ? '<dry-run>' : latestCompletionProof(consumer);
127
- steps.push({
128
- label: 'verify_completion_proof_exists',
129
- command: 'fs.existsSync(.sneakoscope/missions/<latest>/completion-proof.json)',
130
- cwd: consumer,
131
- status: proofFile ? 0 : 1,
132
- ok: Boolean(proofFile),
133
- stdout_bytes: 0,
134
- stderr_bytes: 0,
135
- stderr_tail: proofFile || 'completion-proof.json missing'
136
- });
137
- }
138
- const result = { schema: 'sks.blackbox-pack-install.v1', ok: steps.every((step) => step.ok), dry_run: dryRun, temp_root: keep ? tmp : null, steps };
139
- if (!result.ok)
140
- result.temp_root = tmp;
141
- if (!keep && result.ok)
142
- fs.rmSync(tmp, { recursive: true, force: true });
143
- if (json)
144
- console.log(JSON.stringify(result, null, 2));
145
- else {
146
- console.log(`Blackbox pack install: ${result.ok ? 'ok' : 'blocked'}${dryRun ? ' (dry-run)' : ''}`);
147
- for (const step of steps) {
148
- console.log(`- ${step.ok ? 'ok' : 'blocked'} ${step.label}${step.attempts ? ` attempts=${step.attempts}` : ''}`);
149
- if (!step.ok && step.stderr_tail)
150
- console.log(` stderr_tail: ${step.stderr_tail.replace(/\n/g, '\\n')}`);
151
- if (!step.ok && step.stdout_tail)
152
- console.log(` stdout_tail: ${step.stdout_tail.replace(/\n/g, '\\n')}`);
153
- }
154
- if (!result.ok)
155
- console.log(`temp_root: ${tmp}`);
156
- }
157
- if (!result.ok)
158
- process.exitCode = 1;
159
- function latestCompletionProof(rootDir) {
160
- const missions = path.join(rootDir, '.sneakoscope', 'missions');
161
- if (!fs.existsSync(missions))
162
- return null;
163
- const ids = fs.readdirSync(missions, { withFileTypes: true })
164
- .filter((entry) => entry.isDirectory() && entry.name.startsWith('M-'))
165
- .map((entry) => entry.name)
166
- .sort();
167
- for (const id of ids.reverse()) {
168
- const proof = path.join(missions, id, 'completion-proof.json');
169
- if (fs.existsSync(proof))
170
- return proof;
171
- }
172
- return null;
173
- }
174
- //# sourceMappingURL=blackbox-pack-install.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective316Gate } from './sks-3-1-6-directive-check-lib.js';
3
- await runDirective316Gate('brand-neutrality:zero-leakage-blackbox');
4
- //# sourceMappingURL=brand-neutrality-zero-leakage-blackbox.js.map
@@ -1,34 +0,0 @@
1
- import fs from 'node:fs/promises';
2
- import path from 'node:path';
3
- import { assertGate, emitGate, makeTempRoot, writeText } from './sks-3-1-8-check-lib.js';
4
- import { importDist } from './sks-1-18-gate-lib.js';
5
- const tmp = await makeTempRoot('sks-build-once-');
6
- await writeText(path.join(tmp, 'package.json'), JSON.stringify({
7
- version: '4.0.2',
8
- scripts: {
9
- 'build:clean': 'node build.mjs',
10
- 'build:incremental': 'node build.mjs'
11
- }
12
- }, null, 2));
13
- await writeText(path.join(tmp, 'package-lock.json'), JSON.stringify({ name: 'fixture', version: '4.0.2', lockfileVersion: 3, packages: { '': { version: '4.0.2' } } }, null, 2));
14
- await writeText(path.join(tmp, 'tsconfig.json'), JSON.stringify({ compilerOptions: { outDir: 'dist' } }, null, 2));
15
- await writeText(path.join(tmp, 'src/index.ts'), 'export const value = 1;\n');
16
- await writeText(path.join(tmp, 'build.mjs'), "import fs from 'node:fs'; fs.mkdirSync('dist/bin',{recursive:true}); fs.writeFileSync('dist/bin/sks.js','#!/usr/bin/env node\\n');\n");
17
- const mod = await importDist('core/build/build-once-runner.js');
18
- const first = mod.runBuildOnce({ root: tmp, mode: 'clean', force: true });
19
- const second = mod.runBuildOnce({ root: tmp, mode: 'incremental' });
20
- await writeText(path.join(tmp, 'src/index.ts'), 'export const value = 2;\n');
21
- const third = mod.runBuildOnce({ root: tmp, mode: 'incremental' });
22
- await writeText(path.join(tmp, 'build.mjs'), "import fs from 'node:fs'; fs.mkdirSync('dist/bin',{recursive:true});\n");
23
- await fs.rm(path.join(tmp, 'dist', 'bin', 'sks.js'), { force: true });
24
- const broken = mod.runBuildOnce({ root: tmp, mode: 'incremental', force: true });
25
- await writeText(path.join(tmp, 'build.mjs'), "import fs from 'node:fs'; fs.mkdirSync('dist/bin',{recursive:true}); fs.writeFileSync('dist/bin/sks.js','#!/usr/bin/env node\\n');\n");
26
- await writeText(path.join(tmp, 'package-lock.json'), JSON.stringify({ name: 'fixture', version: '4.0.2', lockfileVersion: 3, packages: { '': { version: '4.0.2' } }, changed: true }, null, 2));
27
- const lockChanged = mod.runBuildOnce({ root: tmp, mode: 'incremental' });
28
- assertGate(first.ok === true && first.reused === false, 'clean build must write an initial proof', first);
29
- assertGate(second.ok === true && second.reused === true, 'second unchanged incremental run must reuse proof', second);
30
- assertGate(third.ok === true && third.reused === false && third.source_hash !== first.source_hash, 'source edit must invalidate proof', { first, third });
31
- assertGate(broken.ok === false && broken.blockers.some((item) => item.includes('dist_target_missing:dist/bin/sks.js')), 'missing dist/bin/sks.js must fail proof', broken);
32
- assertGate(lockChanged.ok === true && lockChanged.package_lock_hash !== third.package_lock_hash, 'package-lock change must invalidate proof', { third, lockChanged });
33
- emitGate('build-once:runner-blackbox', { first: first.ok, reused: second.reused, broken: broken.ok });
34
- //# sourceMappingURL=build-once-runner-blackbox.js.map
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
- import { assertGate, emitGate } from './sks-1-18-gate-lib.js';
3
- import { detectCodex0140Capability } from '../core/codex-control/codex-0140-capability.js';
4
- process.env.SKS_CODEX_0140_FAKE = '1';
5
- process.env.SKS_CODEX_VERSION_FAKE = 'codex-cli 0.140.0';
6
- process.env.SKS_CODEX_0140_PROBE = '1';
7
- const report = await detectCodex0140Capability({ codexBin: 'codex' });
8
- assertGate(report.ok === true && Object.values(report.features).every(Boolean), 'Codex 0.140 integration blackbox requires every fixture feature', report);
9
- assertGate(Object.values(report.feature_states).every((state) => state.supported === true && state.certainty === 'fixture'), 'Codex 0.140 integration blackbox requires explicit fixture feature states', report);
10
- assertGate(Object.keys(report.feature_certainty).length === Object.keys(report.features).length, 'Codex 0.140 integration blackbox requires per-feature certainty coverage', report);
11
- assertGate(JSON.stringify(report).includes('SUPABASE_ACCESS_TOKEN') === false, 'Codex 0.140 blackbox must not serialize secret env values', report);
12
- emitGate('codex:0140-integration-blackbox', { feature_count: Object.keys(report.features).length });
13
- //# sourceMappingURL=codex-0140-integration-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective315Gate } from './sks-3-1-5-directive-check-lib.js';
3
- await runDirective315Gate('codex-app:agent-type-blackbox');
4
- //# sourceMappingURL=codex-agent-type-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective314Gate } from './sks-3-1-4-directive-check-lib.js';
3
- await runDirective314Gate('codex-app:harness-blackbox');
4
- //# sourceMappingURL=codex-app-harness-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective314Gate } from './sks-3-1-4-directive-check-lib.js';
3
- await runDirective314Gate('codex-app:skill-agent-blackbox');
4
- //# sourceMappingURL=codex-app-skill-agent-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective315Gate } from './sks-3-1-5-directive-check-lib.js';
3
- await runDirective315Gate('codex-app:hook-approval-blackbox');
4
- //# sourceMappingURL=codex-hook-approval-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective315Gate } from './sks-3-1-5-directive-check-lib.js';
3
- await runDirective315Gate('codex-app:init-deep-directory-local-blackbox');
4
- //# sourceMappingURL=codex-init-deep-directory-local-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective316Gate } from './sks-3-1-6-directive-check-lib.js';
3
- await runDirective316Gate('codex-native:feature-broker-blackbox');
4
- //# sourceMappingURL=codex-native-feature-broker-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective316Gate } from './sks-3-1-6-directive-check-lib.js';
3
- await runDirective316Gate('codex-native:pattern-analysis-blackbox');
4
- //# sourceMappingURL=codex-native-pattern-analysis-blackbox.js.map