sneakoscope 7.1.0 → 7.3.0

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 (534) hide show
  1. package/README.md +9 -1
  2. package/config/architecture-budgets.v1.json +1 -8
  3. package/crates/sks-core/Cargo.lock +225 -1
  4. package/crates/sks-core/Cargo.toml +8 -1
  5. package/crates/sks-core/src/main.rs +7 -1
  6. package/crates/sks-core/src/search/files.rs +114 -0
  7. package/crates/sks-core/src/search/mod.rs +274 -0
  8. package/crates/sks-core/src/search/text.rs +175 -0
  9. package/dist/bin/sks-dispatch.js +4 -3
  10. package/dist/cli/command-manifest-lite.js +177 -6
  11. package/dist/cli/command-registry.js +42 -8
  12. package/dist/cli/help.js +30 -0
  13. package/dist/cli/install-helpers-codex-lb-config.js +9 -6
  14. package/dist/cli/install-helpers-codex-lb-selftest-chain.js +1 -1
  15. package/dist/cli/install-helpers-install-support.js +1 -1
  16. package/dist/cli/install-helpers.js +19 -9
  17. package/dist/cli/router.js +16 -3
  18. package/dist/commands/codex-app.js +40 -5
  19. package/dist/commands/doctor-profile.js +78 -0
  20. package/dist/commands/doctor.js +29 -69
  21. package/dist/commands/search.js +4 -0
  22. package/dist/config/skills-manifest.json +53 -60
  23. package/dist/core/agent-bridge/agent-manifest.js +22 -26
  24. package/dist/core/agent-bridge/host-capability-policy.js +109 -8
  25. package/dist/core/agent-bridge/host-capability-runtime.js +178 -50
  26. package/dist/core/agent-guidance/directive-registry.js +123 -0
  27. package/dist/core/agents/agent-effort-policy.js +45 -6
  28. package/dist/core/agents/agent-worker-pipeline.js +1 -3
  29. package/dist/core/agents/native-worker-backend-router.js +43 -19
  30. package/dist/core/auto-review.js +1 -3
  31. package/dist/core/code-structure.js +282 -19
  32. package/dist/core/codex/codex-config-guard.js +14 -4
  33. package/dist/core/codex/codex-config-toml.js +1 -3
  34. package/dist/core/codex-app/codex-agent-role-sync.js +1 -3
  35. package/dist/core/codex-app/codex-app-fast-ui-repair.js +14 -1
  36. package/dist/core/codex-app/codex-app-types.js +2 -3
  37. package/dist/core/codex-app/codex-desktop-routing-ownership.js +91 -0
  38. package/dist/core/codex-app/codex-hook-approval-probe.js +1 -3
  39. package/dist/core/codex-app/codex-hook-lifecycle.js +1 -3
  40. package/dist/core/codex-app/codex-init-deep.js +22 -10
  41. package/dist/core/codex-app/codex-model-catalog.js +384 -0
  42. package/dist/core/codex-app/codex-models-cache.js +160 -0
  43. package/dist/core/codex-app/desktop-routing-snapshot.js +233 -0
  44. package/dist/core/codex-app/glm-profile-installer.js +1 -3
  45. package/dist/core/codex-app/mcp-manager.js +1 -3
  46. package/dist/core/codex-app/menubar/constants.js +3 -0
  47. package/dist/core/codex-app/menubar/installer.js +11 -1
  48. package/dist/core/codex-app/multi-provider-router-support.js +202 -0
  49. package/dist/core/codex-app/multi-provider-router.js +379 -0
  50. package/dist/core/codex-app/openrouter-activate.js +189 -26
  51. package/dist/core/codex-app/openrouter-base-instructions.js +1 -0
  52. package/dist/core/codex-app/openrouter-model-catalog.js +217 -0
  53. package/dist/core/codex-app/role-model-catalog-priority.js +61 -0
  54. package/dist/core/codex-app.js +30 -6
  55. package/dist/core/codex-compat/codex-hook-semantic-validator.js +1 -3
  56. package/dist/core/codex-control/codex-app-server-v2-client.js +39 -2
  57. package/dist/core/codex-lb/codex-lb-env.js +1 -3
  58. package/dist/core/codex-lb/codex-lb-tool-catalog.js +6 -1
  59. package/dist/core/codex-native/codex-native-feature-broker.js +2 -6
  60. package/dist/core/codex-native/codex-native-interop-policy.js +1 -3
  61. package/dist/core/codex-native/codex-native-reference-cache.js +1 -3
  62. package/dist/core/codex-native/codex-native-reference-source.js +1 -3
  63. package/dist/core/codex-native/codex-native-repair-transaction.js +1 -3
  64. package/dist/core/codex-native/core-skill-manifest.js +3 -2
  65. package/dist/core/codex-native/native-capability-repair-matrix.js +1 -3
  66. package/dist/core/codex-plugins/codex-plugin-repair.js +1 -3
  67. package/dist/core/codex-runtime/codex-desktop-config-policy.js +4 -4
  68. package/dist/core/commands/agent-bridge-command.js +24 -3
  69. package/dist/core/commands/image-ux-review-command.js +5 -11
  70. package/dist/core/commands/menubar-command.js +1 -1
  71. package/dist/core/commands/naruto-command.js +40 -13
  72. package/dist/core/commands/pipeline-command.js +5 -2
  73. package/dist/core/commands/release-command.js +63 -1
  74. package/dist/core/commands/remote-command.js +18 -0
  75. package/dist/core/commands/search-command.js +151 -0
  76. package/dist/core/commands/telegram-command.js +251 -108
  77. package/dist/core/commands/uninstall-command.js +1 -1
  78. package/dist/core/config/secret-preservation.js +1 -3
  79. package/dist/core/context7-client.js +2 -1
  80. package/dist/core/db-review.js +704 -0
  81. package/dist/core/db-safety.js +17 -23
  82. package/dist/core/doctor/browser-use-repair.js +1 -3
  83. package/dist/core/doctor/codex-startup-config-repair.js +1 -3
  84. package/dist/core/doctor/computer-use-repair.js +1 -3
  85. package/dist/core/doctor/context7-mcp-repair.js +1 -3
  86. package/dist/core/doctor/current-project-guidance.js +1 -3
  87. package/dist/core/doctor/doctor-codex-startup-repair.js +1 -3
  88. package/dist/core/doctor/doctor-dirty-planner.js +2 -2
  89. package/dist/core/doctor/doctor-native-capability-repair.js +1 -3
  90. package/dist/core/doctor/doctor-transaction.js +1 -3
  91. package/dist/core/doctor/imagegen-repair.js +1 -3
  92. package/dist/core/doctor/legacy-global-hook-cleanup.js +1 -3
  93. package/dist/core/doctor/mcp-transport-collision-repair.js +1 -3
  94. package/dist/core/doctor/retired-managed-residue-private.js +1 -3
  95. package/dist/core/doctor/supabase-mcp-repair.js +1 -3
  96. package/dist/core/engineering-sanity-review.js +186 -0
  97. package/dist/core/errors/message.js +3 -0
  98. package/dist/core/evidence/evidence-schema.js +1 -3
  99. package/dist/core/feature-fixtures.js +1 -0
  100. package/dist/core/feature-registry.js +1 -3
  101. package/dist/core/fsx.js +13 -0
  102. package/dist/core/git-hygiene/shared-memory-publish.js +1 -3
  103. package/dist/core/git-hygiene/validators.js +1 -3
  104. package/dist/core/harness-guard.js +21 -3
  105. package/dist/core/hooks-runtime/hook-context.js +2 -2
  106. package/dist/core/image-ux-review/imagegen-adapter.js +52 -56
  107. package/dist/core/image-ux-review/real-callout-extractor.js +6 -1
  108. package/dist/core/image-ux-review.js +3 -5
  109. package/dist/core/imagegen/codex-lb-imagegen-target.js +70 -0
  110. package/dist/core/imagegen/imagegen-capability.js +11 -11
  111. package/dist/core/imagegen/imagegen-evidence.js +32 -0
  112. package/dist/core/init/skills.js +9 -11
  113. package/dist/core/init.js +4 -6
  114. package/dist/core/json/records.js +9 -0
  115. package/dist/core/json-schema-validator.js +1 -3
  116. package/dist/core/lean-engineering-policy.js +54 -0
  117. package/dist/core/loops/loop-continuation-enforcer.js +1 -3
  118. package/dist/core/mad-sks/sql-plane/mcp-executor.js +2 -1
  119. package/dist/core/mad-sks/sql-plane/policy.js +2 -1
  120. package/dist/core/managed-assets/managed-assets-manifest.js +4 -3
  121. package/dist/core/mcp-config/codex-cli-adapter.js +1 -3
  122. package/dist/core/mcp-config/config-reader.js +2 -3
  123. package/dist/core/mcp-config/guarded-patch.js +1 -1
  124. package/dist/core/mcp-config/health-check.js +2 -1
  125. package/dist/core/mcp-config/mutation.js +1 -1
  126. package/dist/core/mcp-config/restore.js +1 -1
  127. package/dist/core/mcp-config/secret-policy.js +1 -3
  128. package/dist/core/migration/migration-transaction-journal.js +3 -3
  129. package/dist/core/naruto/naruto-concurrency-governor.js +2 -2
  130. package/dist/core/perf/import-graph-budget.js +91 -1
  131. package/dist/core/pipeline/pipeline-plan-writer.js +1 -1
  132. package/dist/core/pipeline-internals/runtime-core.js +121 -23
  133. package/dist/core/pipeline-internals/runtime-gates.js +193 -4
  134. package/dist/core/pipeline.js +1 -1
  135. package/dist/core/ppt-review/slide-imagegen-review.js +7 -7
  136. package/dist/core/ppt.js +3 -3
  137. package/dist/core/product-design-app-server.js +2 -1
  138. package/dist/core/proof/fake-real-proof-policy.js +1 -3
  139. package/dist/core/proof/root-cause-policy.js +1 -3
  140. package/dist/core/proof/validation.js +1 -3
  141. package/dist/core/provider/model-router.js +4 -0
  142. package/dist/core/provider/provider-context.js +1 -3
  143. package/dist/core/providers/openrouter/openrouter-account.js +1 -3
  144. package/dist/core/quality/helper-dedup.js +0 -0
  145. package/dist/core/recallpulse.js +1 -1
  146. package/dist/core/release/file-ownership.js +26 -17
  147. package/dist/core/release/macos-menubar-proof.js +59 -1
  148. package/dist/core/release/main-push-guard.js +288 -24
  149. package/dist/core/release/main-push-receipt.js +10 -45
  150. package/dist/core/release/package-size-budget.js +1 -1
  151. package/dist/core/release/release-gate-contract.js +2 -0
  152. package/dist/core/release/release-pack-receipt.js +1 -1
  153. package/dist/core/release/release-proof-io.js +33 -0
  154. package/dist/core/release/release-upgrade-baseline.js +9 -0
  155. package/dist/core/release/runtime-script-pack-closure.js +153 -4
  156. package/dist/core/release/stage-publish.js +194 -0
  157. package/dist/core/remote/index.js +2 -0
  158. package/dist/core/remote/local-worker-client.js +35 -0
  159. package/dist/core/remote/machine-registry.js +18 -13
  160. package/dist/core/remote/owner-proof.js +1 -3
  161. package/dist/core/remote/protocol.js +1 -3
  162. package/dist/core/remote/readiness.js +1 -3
  163. package/dist/core/remote/session-binding.js +153 -0
  164. package/dist/core/remote/session-index.js +1 -3
  165. package/dist/core/remote/types.js +1 -0
  166. package/dist/core/remote/worker.js +228 -14
  167. package/dist/core/responses-stream.js +151 -0
  168. package/dist/core/routes/dollar-manifest-lite.js +1 -1
  169. package/dist/core/routes.js +8 -8
  170. package/dist/core/rust-accelerator.js +12 -2
  171. package/dist/core/safety/ssot-guard.js +1 -3
  172. package/dist/core/search/benchmark.js +358 -0
  173. package/dist/core/search/cache.js +65 -0
  174. package/dist/core/search/context.js +144 -0
  175. package/dist/core/search/doctor.js +74 -0
  176. package/dist/core/search/files.js +192 -0
  177. package/dist/core/search/index.js +5 -0
  178. package/dist/core/search/ipc.js +64 -0
  179. package/dist/core/search/provider.js +142 -0
  180. package/dist/core/search/rust-bridge.js +24 -0
  181. package/dist/core/search/structure.js +230 -0
  182. package/dist/core/search/symbol.js +272 -0
  183. package/dist/core/search/text.js +146 -0
  184. package/dist/core/search/types.js +22 -0
  185. package/dist/core/search/typescript-ls.js +215 -0
  186. package/dist/core/search-visibility/discovery.js +1 -3
  187. package/dist/core/skill-forge.js +1 -1
  188. package/dist/core/stop-gate/gate-evaluator.js +3 -3
  189. package/dist/core/stop-gate/stop-gate-check.js +1 -3
  190. package/dist/core/structured-output-adapter.js +62 -2
  191. package/dist/core/subagents/agent-catalog.js +56 -43
  192. package/dist/core/subagents/model-policy.js +17 -7
  193. package/dist/core/subagents/naruto-proof-projection.js +2 -6
  194. package/dist/core/subagents/official-subagent-config.js +1 -3
  195. package/dist/core/subagents/official-subagent-preparation.js +73 -10
  196. package/dist/core/subagents/official-subagent-prompt.js +85 -18
  197. package/dist/core/subagents/official-subagent-runner.js +10 -5
  198. package/dist/core/subagents/role-model-preferences.js +202 -44
  199. package/dist/core/subagents/subagent-evidence.js +1 -3
  200. package/dist/core/subagents/thread-budget.js +1 -1
  201. package/dist/core/subagents/triwiki-attention.js +1 -5
  202. package/dist/core/telegram/config.js +29 -12
  203. package/dist/core/telegram/hub.js +8 -2
  204. package/dist/core/telegram/index.js +2 -0
  205. package/dist/core/telegram/messages.js +8 -2
  206. package/dist/core/telegram/runtime-projection.js +8 -5
  207. package/dist/core/telegram/runtime.js +19 -9
  208. package/dist/core/telegram/service.js +181 -0
  209. package/dist/core/telegram/setup.js +220 -0
  210. package/dist/core/text/regex.js +3 -0
  211. package/dist/core/text/strings.js +6 -0
  212. package/dist/core/triwiki-wrongness/image-wrongness.js +1 -3
  213. package/dist/core/triwiki-wrongness/wrongness-ledger.js +1 -3
  214. package/dist/core/triwiki-wrongness/wrongness-proof-linker.js +1 -3
  215. package/dist/core/triwiki-wrongness/wrongness-retrieval.js +1 -3
  216. package/dist/core/triwiki-wrongness/wrongness-schema.js +1 -3
  217. package/dist/core/triwiki-wrongness/wrongness-trust-policy.js +1 -3
  218. package/dist/core/trust-kernel/completion-contract.js +1 -3
  219. package/dist/core/trust-kernel/route-contract.js +1 -3
  220. package/dist/core/update/update-migration-state.js +1 -3
  221. package/dist/core/update-check.js +20 -6
  222. package/dist/core/verification/diff-quality.js +3 -4
  223. package/dist/core/verification/impact-scan.js +36 -89
  224. package/dist/core/verification/mistake-rule-compiler.js +17 -4
  225. package/dist/core/version-manager.js +3 -20
  226. package/dist/core/version.js +1 -1
  227. package/dist/native/sks-menubar/Sources/ControlCenterWindowController.swift +23 -3
  228. package/dist/native/sks-menubar/Sources/ControlKit.swift +102 -0
  229. package/dist/native/sks-menubar/Sources/DiagnosticsViewController.swift +23 -11
  230. package/dist/native/sks-menubar/Sources/MCPServersViewController.swift +7 -3
  231. package/dist/native/sks-menubar/Sources/OperationCoordinator.swift +17 -1
  232. package/dist/native/sks-menubar/Sources/OverviewViewController.swift +22 -15
  233. package/dist/native/sks-menubar/Sources/ProcessClient.swift +15 -5
  234. package/dist/native/sks-menubar/Sources/ProvidersMultiProvider.swift +324 -0
  235. package/dist/native/sks-menubar/Sources/ProvidersOpenRouter.swift +154 -214
  236. package/dist/native/sks-menubar/Sources/ProvidersRoleModels.swift +252 -0
  237. package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +77 -71
  238. package/dist/native/sks-menubar/Sources/RemoteTelegramViewController.swift +167 -51
  239. package/dist/native/sks-menubar/Sources/SettingsViewController.swift +14 -5
  240. package/dist/native/sks-menubar/Sources/SidebarItem.swift +15 -1
  241. package/dist/native/sks-menubar/Sources/StatusItemController.swift +2 -2
  242. package/dist/native/sks-menubar/Sources/UpdatesViewController.swift +16 -12
  243. package/dist/scripts/agent-guidance-dedup-check.js +23 -0
  244. package/dist/scripts/agent-message-bus-reader-check.js +1 -1
  245. package/dist/scripts/all-feature-deep-completion-check.js +1 -1
  246. package/dist/scripts/appshots-thread-attachment-discovery-check.js +1 -1
  247. package/dist/scripts/architecture-guard-check.js +1 -2
  248. package/dist/scripts/certificate-sla-check.js +1 -1
  249. package/dist/scripts/cli-output-consistency-check.js +1 -1
  250. package/dist/scripts/codex-0-134-runner-truth-check.js +1 -1
  251. package/dist/scripts/codex-0138-capability-artifact-check.js +1 -1
  252. package/dist/scripts/codex-0138-capability-check.js +1 -1
  253. package/dist/scripts/codex-0138-doctor-check.js +1 -1
  254. package/dist/scripts/codex-0138-feature-probes-check.js +1 -1
  255. package/dist/scripts/codex-0144-app-server-v2-check.js +1 -1
  256. package/dist/scripts/codex-0144-binary-identity-check.js +1 -1
  257. package/dist/scripts/codex-0144-capability-check.js +1 -1
  258. package/dist/scripts/codex-0144-core-real-probes-check.js +1 -1
  259. package/dist/scripts/codex-0144-manifest-check.js +1 -1
  260. package/dist/scripts/codex-0144-policy-check.js +1 -1
  261. package/dist/scripts/codex-0144-thread-store-check.js +1 -1
  262. package/dist/scripts/codex-agent-role-rich-content-check.js +2 -2
  263. package/dist/scripts/codex-agent-role-sync-check.js +2 -2
  264. package/dist/scripts/codex-agent-type-routing-check.js +2 -2
  265. package/dist/scripts/codex-app-execution-profile-check.js +2 -2
  266. package/dist/scripts/codex-app-handoff-check.js +1 -1
  267. package/dist/scripts/codex-app-handoff-launch-check.js +1 -1
  268. package/dist/scripts/codex-control-tool-output-continuity-audit-check.js +1 -1
  269. package/dist/scripts/codex-lb-fast-ui-preservation-check.js +1 -3
  270. package/dist/scripts/codex-native-feature-broker-blackbox.js +2 -2
  271. package/dist/scripts/codex-native-feature-broker-check.js +2 -2
  272. package/dist/scripts/{sks-3-1-6-directive-check-lib.js → codex-native-gate-lib.js} +5 -5
  273. package/dist/scripts/codex-native-harness-compat-check.js +2 -2
  274. package/dist/scripts/codex-native-hook-lifecycle-proof-check.js +2 -2
  275. package/dist/scripts/codex-plugin-app-template-policy-check.js +1 -1
  276. package/dist/scripts/codex-sdk-backend-router-check.js +1 -1
  277. package/dist/scripts/codex-sdk-capability-check.js +1 -1
  278. package/dist/scripts/context7-evidence-dedupe-check.js +1 -1
  279. package/dist/scripts/core-skill-card-schema-check.js +1 -1
  280. package/dist/scripts/core-skill-deployment-snapshot-check.js +1 -1
  281. package/dist/scripts/core-skill-heldout-validation-check.js +1 -1
  282. package/dist/scripts/core-skill-no-inference-optimizer-check.js +1 -1
  283. package/dist/scripts/core-skill-patch-check.js +1 -1
  284. package/dist/scripts/core-skill-route-runtime-integration-check.js +1 -1
  285. package/dist/scripts/current-command-surface-check.js +1 -1
  286. package/dist/scripts/current-surface-update-e2e-check.js +4 -1
  287. package/dist/scripts/current-upgrade-matrix-check.js +1 -1
  288. package/dist/scripts/dfix-fixture-check.js +1 -1
  289. package/dist/scripts/dfix-patch-handoff-check.js +1 -1
  290. package/dist/scripts/dfix-verification-check.js +1 -1
  291. package/dist/scripts/dfix-verification-recommendation-check.js +1 -1
  292. package/dist/scripts/docs-truthfulness-check.js +16 -3
  293. package/dist/scripts/doctor-codex-app-harness-check.js +2 -2
  294. package/dist/scripts/evidence-flagship-coverage-check.js +1 -1
  295. package/dist/scripts/{sks-1-18-gate-lib.js → gate-lib.js} +1 -1
  296. package/dist/scripts/gate-policy-audit-check.js +4 -1
  297. package/dist/scripts/git-worktree-checkpoint-check.js +1 -1
  298. package/dist/scripts/git-worktree-cross-rebase-check.js +1 -1
  299. package/dist/scripts/git-worktree-diff-envelope-check.js +1 -1
  300. package/dist/scripts/git-worktree-dirty-lock-check.js +1 -1
  301. package/dist/scripts/git-worktree-dirty-main-detection-check.js +1 -1
  302. package/dist/scripts/git-worktree-integration-primary-check.js +1 -1
  303. package/dist/scripts/git-worktree-manifest-append-check.js +1 -1
  304. package/dist/scripts/git-worktree-untracked-diff-check.js +1 -1
  305. package/dist/scripts/harness-benchmark-check.js +1 -1
  306. package/dist/scripts/helper-dedup-check.js +62 -0
  307. package/dist/scripts/hook-latency-budget-check.js +1 -1
  308. package/dist/scripts/image-artifact-path-contract-check.js +1 -1
  309. package/dist/scripts/imagegen-real-smoke-check.js +2 -5
  310. package/dist/scripts/installed-package-smoke-check.js +1 -1
  311. package/dist/scripts/legacy-gate-inventory-check.js +1 -1
  312. package/dist/scripts/legacy-gate-purge-check.js +1 -1
  313. package/dist/scripts/legacy-strong-inventory-check.js +1 -1
  314. package/dist/scripts/lib/codex-sdk-gate-lib.js +1 -1
  315. package/dist/scripts/mad-sks-launch-sql-plane-boundary-check.js +1 -1
  316. package/dist/scripts/mad-sks-sql-plane-capability-check.js +1 -1
  317. package/dist/scripts/mad-sks-sql-plane-lifecycle-hook-decision-check.js +1 -1
  318. package/dist/scripts/mad-sks-sql-plane-result-lifecycle-check.js +1 -1
  319. package/dist/scripts/managed-config-merge-check.js +1 -1
  320. package/dist/scripts/mcp-plugin-inventory-check.js +1 -1
  321. package/dist/scripts/model-call-concurrency-check.js +1 -1
  322. package/dist/scripts/mutation-callsite-coverage-check.js +1 -1
  323. package/dist/scripts/naruto-ssot-gate-aliases-check.js +1 -1
  324. package/dist/scripts/naruto-ssot-pipeline-default-check.js +1 -1
  325. package/dist/scripts/naruto-ssot-route-normalization-check.js +1 -1
  326. package/dist/scripts/naruto-ssot-routing-check.js +1 -1
  327. package/dist/scripts/naruto-worktree-coding-blackbox.js +1 -1
  328. package/dist/scripts/native-capability-repair-matrix-check.js +1 -1
  329. package/dist/scripts/native-image-generation-repair-check.js +1 -1
  330. package/dist/scripts/official-subagent-workflow-check.js +3 -3
  331. package/dist/scripts/package-published-contract-check.js +37 -4
  332. package/dist/scripts/packlist-performance-check.js +17 -1
  333. package/dist/scripts/pipeline-codex-native-doctor-mad-routing-real-blackbox.js +1 -3
  334. package/dist/scripts/ppt-real-export-adapter-check.js +1 -1
  335. package/dist/scripts/ppt-real-imagegen-wiring-check.js +1 -1
  336. package/dist/scripts/ppt-reexport-rereview-check.js +1 -1
  337. package/dist/scripts/prepublish-fast-check.js +1 -1
  338. package/dist/scripts/probe-memoization-check.js +2 -2
  339. package/dist/scripts/prompt-placeholder-guard-check.js +1 -1
  340. package/dist/scripts/qa-loop-app-handoff-capability-check.js +1 -1
  341. package/dist/scripts/qa-loop-app-handoff-check.js +1 -1
  342. package/dist/scripts/qa-loop-app-handoff-cli-check.js +1 -1
  343. package/dist/scripts/qa-loop-app-handoff-confirmation-check.js +1 -1
  344. package/dist/scripts/qa-loop-app-handoff-gate-lifecycle-check.js +1 -1
  345. package/dist/scripts/qa-loop-app-handoff-launch-check.js +1 -1
  346. package/dist/scripts/qa-loop-app-handoff-status-lifecycle-check.js +1 -1
  347. package/dist/scripts/qa-loop-budget-policy-check.js +1 -1
  348. package/dist/scripts/qa-loop-effort-escalation-check.js +1 -1
  349. package/dist/scripts/qa-loop-execution-profile-routing-check.js +2 -2
  350. package/dist/scripts/qa-loop-image-path-exposure-check.js +1 -1
  351. package/dist/scripts/qa-loop-image-path-prompt-injection-check.js +1 -1
  352. package/dist/scripts/{sks-1-12-real-execution-check-lib.js → real-execution-check-lib.js} +1 -1
  353. package/dist/scripts/release-affected-selector-check.js +1 -1
  354. package/dist/scripts/release-aggressive-resource-governor-check.js +1 -1
  355. package/dist/scripts/release-cache-glob-hashing-check.js +1 -1
  356. package/dist/scripts/release-cache-input-classifier-check.js +1 -1
  357. package/dist/scripts/release-cache-neutralization-report-check.js +1 -1
  358. package/dist/scripts/release-cache-version-neutral-fixture-check.js +1 -1
  359. package/dist/scripts/release-dynamic-presets-check.js +2 -2
  360. package/dist/scripts/release-full-parallelism-blackbox.js +1 -1
  361. package/dist/scripts/release-gate-batch-runner-check.js +1 -1
  362. package/dist/scripts/release-gate-budget-check.js +1 -1
  363. package/dist/scripts/release-gate-dag-runner-check.js +1 -1
  364. package/dist/scripts/release-latency-slo-check.js +1 -1
  365. package/dist/scripts/release-metadata-check.js +256 -2
  366. package/dist/scripts/release-parallel-speed-budget-check.js +1 -1
  367. package/dist/scripts/release-proof-truth-check.js +1 -1
  368. package/dist/scripts/release-provenance-check.js +4 -2
  369. package/dist/scripts/release-runtime-truth-matrix-check.js +1 -1
  370. package/dist/scripts/research-blueprint-densifier-check.js +1 -1
  371. package/dist/scripts/research-claim-builder-check.js +1 -1
  372. package/dist/scripts/research-complete-package-fixture-check.js +1 -1
  373. package/dist/scripts/research-execution-profile-routing-check.js +2 -2
  374. package/dist/scripts/research-final-reviewer-blackbox.js +1 -1
  375. package/dist/scripts/{sks-3-1-4-directive-check-lib.js → runtime-domain-gate-lib.js} +2 -2
  376. package/dist/scripts/runtime-proof-summary-check.js +1 -1
  377. package/dist/scripts/runtime-script-pack-closure-check.js +7 -1
  378. package/dist/scripts/scheduler-batch-dispatch-check.js +1 -1
  379. package/dist/scripts/scheduler-parallel-proof-consistency-check.js +1 -1
  380. package/dist/scripts/scheduler-utilization-integral-check.js +1 -1
  381. package/dist/scripts/search-visibility-gate-lib.js +1 -1
  382. package/dist/scripts/secret-preservation-check.js +1 -1
  383. package/dist/scripts/seo-geo-geo-disambiguation-check.js +1 -1
  384. package/dist/scripts/seo-geo-skill-rich-content-check.js +1 -1
  385. package/dist/scripts/side-effect-runtime-report-check.js +1 -1
  386. package/dist/scripts/{sks-3-1-8-check-lib.js → skill-fixture-check-lib.js} +1 -1
  387. package/dist/scripts/skill-name-canonicalizer-check.js +1 -1
  388. package/dist/scripts/skills-manifest-continuity-check.js +1 -1
  389. package/dist/scripts/sks-uninstall-regression-check.js +1 -1
  390. package/dist/scripts/sksd-daemon-check.js +1 -1
  391. package/dist/scripts/super-search-provider-interface-check.js +1 -1
  392. package/dist/scripts/triwiki-cache-key-check.js +1 -1
  393. package/dist/scripts/triwiki-proof-bank-blackbox.js +2 -2
  394. package/dist/scripts/triwiki-proof-bank-check.js +1 -1
  395. package/dist/scripts/triwiki-proof-card-check.js +1 -1
  396. package/dist/scripts/type-surface-codex-app-check.js +2 -2
  397. package/dist/scripts/{sks-3-1-5-directive-check-lib.js → typed-routing-gate-lib.js} +2 -2
  398. package/dist/scripts/ultra-router-auto-router-check.js +1 -1
  399. package/dist/scripts/ux-review-extract-wires-real-extractor-check.js +1 -1
  400. package/dist/scripts/ux-review-patch-diff-recheck-check.js +1 -1
  401. package/dist/scripts/ux-review-run-wires-imagegen-check.js +9 -2
  402. package/package.json +5 -7
  403. package/release-gates.v2.json +66 -11
  404. package/runtime-required-scripts.json +138 -14
  405. package/config/bench-baseline.json +0 -7
  406. package/dist/core/codex-app/sks-menubar.js +0 -1
  407. package/dist/core/release/release-closure-contract.js +0 -30
  408. package/dist/core/release/release-closure-helpers.js +0 -293
  409. package/dist/core/release/release-closure-validation.js +0 -284
  410. package/dist/core/release/release-closure.js +0 -163
  411. package/dist/scripts/build-dist.js +0 -124
  412. package/dist/scripts/build-once-runner-check.js +0 -6
  413. package/dist/scripts/canonical-test-runner.js +0 -234
  414. package/dist/scripts/changelog-check.js +0 -45
  415. package/dist/scripts/check-architecture.js +0 -295
  416. package/dist/scripts/check-cli-entrypoint.js +0 -41
  417. package/dist/scripts/check-command-module-budget.js +0 -77
  418. package/dist/scripts/check-feature-quality.js +0 -51
  419. package/dist/scripts/check-legacy-free.js +0 -64
  420. package/dist/scripts/check-pipeline-budget.js +0 -49
  421. package/dist/scripts/check-pipeline-runtime.js +0 -16
  422. package/dist/scripts/check-publish-tag.js +0 -56
  423. package/dist/scripts/check-route-modularity.js +0 -72
  424. package/dist/scripts/codex-0140-capability-check.js +0 -14
  425. package/dist/scripts/codex-0140-feature-probes-check.js +0 -23
  426. package/dist/scripts/codex-permission-profiles-check.js +0 -34
  427. package/dist/scripts/codex-project-config-policy-splitter-check.js +0 -49
  428. package/dist/scripts/competitor-scorecard-check.js +0 -24
  429. package/dist/scripts/core-skill-no-drift-check.js +0 -23
  430. package/dist/scripts/db-route-materialization-check.js +0 -32
  431. package/dist/scripts/doctor-context7-mcp-repair-blackbox.js +0 -15
  432. package/dist/scripts/doctor-fastpath-check.js +0 -25
  433. package/dist/scripts/doctor-fix-production-blackbox.js +0 -35
  434. package/dist/scripts/doctor-idempotence-check.js +0 -6
  435. package/dist/scripts/doctor-ops-semantics-check.js +0 -83
  436. package/dist/scripts/doctor-startup-config-repair-blackbox.js +0 -18
  437. package/dist/scripts/doctor-supabase-mcp-repair-blackbox.js +0 -13
  438. package/dist/scripts/ensure-bin-executable.js +0 -16
  439. package/dist/scripts/fsx-hotpath-check.js +0 -9
  440. package/dist/scripts/high-risk-contracts-check.js +0 -183
  441. package/dist/scripts/hook-latency-quantum-check.js +0 -120
  442. package/dist/scripts/import-graph-budget-check.js +0 -9
  443. package/dist/scripts/mcp-tool-naming-parity-check.js +0 -14
  444. package/dist/scripts/naruto-codex-e2e-check.js +0 -105
  445. package/dist/scripts/naruto-write-e2e-check.js +0 -31
  446. package/dist/scripts/native-capability-postcheck-check.js +0 -16
  447. package/dist/scripts/ops-diagnostics-bundle-check.js +0 -11
  448. package/dist/scripts/parallel-production-smoke-check.js +0 -20
  449. package/dist/scripts/perf-budget-check.js +0 -12
  450. package/dist/scripts/project-skill-dedupe-blackbox.js +0 -62
  451. package/dist/scripts/release-dag-full-coverage-check.js +0 -98
  452. package/dist/scripts/release-dist-freshness-check.js +0 -6
  453. package/dist/scripts/release-file-ownership-check.js +0 -35
  454. package/dist/scripts/release-gate-script-parity-check.js +0 -148
  455. package/dist/scripts/release-macos-menubar-proof.js +0 -167
  456. package/dist/scripts/release-main-push-guard.js +0 -37
  457. package/dist/scripts/release-main-push-receipt.js +0 -43
  458. package/dist/scripts/release-metadata-1-19-check.js +0 -257
  459. package/dist/scripts/release-version-truth-check.js +0 -138
  460. package/dist/scripts/retention-apply-smoke-check.js +0 -19
  461. package/dist/scripts/retention-budget-check.js +0 -6
  462. package/dist/scripts/retention-dry-run-check.js +0 -8
  463. package/dist/scripts/rollback-recovery-smoke-check.js +0 -70
  464. package/dist/scripts/route-intent-regression-check.js +0 -42
  465. package/dist/scripts/runtime-current-terminal-check.js +0 -108
  466. package/dist/scripts/runtime-dist-parity-check.js +0 -76
  467. package/dist/scripts/runtime-no-src-mjs-check.js +0 -30
  468. package/dist/scripts/runtime-ts-rust-boundary-check.js +0 -58
  469. package/dist/scripts/runtime-ts-source-of-truth-check.js +0 -53
  470. package/dist/scripts/secret-preservation-guard-check.js +0 -36
  471. package/dist/scripts/seo-marketing-truthfulness-check.js +0 -98
  472. package/dist/scripts/seo-metadata-sync-check.js +0 -60
  473. package/dist/scripts/sizecheck.js +0 -148
  474. package/dist/scripts/sks-menubar-install-check.js +0 -333
  475. package/dist/scripts/supabase-secret-preservation-blackbox.js +0 -28
  476. package/dist/scripts/super-search-live-smoke-check.js +0 -115
  477. package/dist/scripts/super-search-local-http-smoke-check.js +0 -16
  478. package/dist/scripts/super-search-offline-contract-check.js +0 -43
  479. package/dist/scripts/update-fastpath-check.js +0 -28
  480. package/dist/scripts/update-preserves-supabase-keys-blackbox.js +0 -26
  481. package/dist/scripts/upgrade-migration-matrix-check.js +0 -351
  482. package/dist/scripts/write-build-manifest.js +0 -70
  483. package/dist/scripts/zellij-capability-check.js +0 -13
  484. package/dist/scripts/zellij-developer-controls-check.js +0 -16
  485. package/dist/scripts/zellij-doctor-readiness-check.js +0 -49
  486. package/dist/scripts/zellij-dynamic-pane-lifecycle-check.js +0 -19
  487. package/dist/scripts/zellij-fake-adapter-check.js +0 -31
  488. package/dist/scripts/zellij-first-slot-down-stack-check.js +0 -20
  489. package/dist/scripts/zellij-first-slot-down-stack-real-check.js +0 -348
  490. package/dist/scripts/zellij-homebrew-policy-check.js +0 -3
  491. package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -21
  492. package/dist/scripts/zellij-lane-renderer-check.js +0 -78
  493. package/dist/scripts/zellij-launch-command-truth-check.js +0 -62
  494. package/dist/scripts/zellij-layout-valid-check.js +0 -120
  495. package/dist/scripts/zellij-pane-creation-lock-metrics-check.js +0 -10
  496. package/dist/scripts/zellij-pane-lock-concurrency-blackbox.js +0 -78
  497. package/dist/scripts/zellij-pane-lock-does-not-block-worker-check.js +0 -12
  498. package/dist/scripts/zellij-pane-lock-open-worker-integration-blackbox.js +0 -134
  499. package/dist/scripts/zellij-qa-app-handoff-status-check.js +0 -7
  500. package/dist/scripts/zellij-right-column-geometry-proof.js +0 -158
  501. package/dist/scripts/zellij-right-column-headless-overflow-check.js +0 -20
  502. package/dist/scripts/zellij-right-column-manager-check.js +0 -24
  503. package/dist/scripts/zellij-self-heal-check.js +0 -3
  504. package/dist/scripts/zellij-self-heal-dry-run-check.js +0 -3
  505. package/dist/scripts/zellij-self-heal-status-contract-check.js +0 -3
  506. package/dist/scripts/zellij-self-heal-typed-blackbox.js +0 -3
  507. package/dist/scripts/zellij-slot-column-anchor-check.js +0 -65
  508. package/dist/scripts/zellij-slot-column-anchor-telemetry-check.js +0 -8
  509. package/dist/scripts/zellij-slot-only-ui-check.js +0 -29
  510. package/dist/scripts/zellij-slot-pane-renderer-check.js +0 -149
  511. package/dist/scripts/zellij-slot-pane-stale-detection-check.js +0 -65
  512. package/dist/scripts/zellij-slot-pane-telemetry-renderer-check.js +0 -11
  513. package/dist/scripts/zellij-slot-renderer-proof-semantics-check.js +0 -58
  514. package/dist/scripts/zellij-slot-telemetry-check.js +0 -38
  515. package/dist/scripts/zellij-slot-telemetry-incremental-check.js +0 -46
  516. package/dist/scripts/zellij-slot-telemetry-live-flush-check.js +0 -55
  517. package/dist/scripts/zellij-slot-telemetry-performance-check.js +0 -32
  518. package/dist/scripts/zellij-slot-telemetry-real-blackbox.js +0 -19
  519. package/dist/scripts/zellij-slot-telemetry-renderer-check.js +0 -11
  520. package/dist/scripts/zellij-slot-telemetry-runtime-check.js +0 -23
  521. package/dist/scripts/zellij-spawn-on-demand-layout-check.js +0 -45
  522. package/dist/scripts/zellij-stacked-capability-routing-check.js +0 -9
  523. package/dist/scripts/zellij-stacked-fallback-integration-blackbox.js +0 -78
  524. package/dist/scripts/zellij-stacked-version-matrix-check.js +0 -29
  525. package/dist/scripts/zellij-stacked-version-parser-check.js +0 -19
  526. package/dist/scripts/zellij-ui-design-check.js +0 -92
  527. package/dist/scripts/zellij-update-missing-self-heal-check.js +0 -3
  528. package/dist/scripts/zellij-update-prompt-matrix-check.js +0 -16
  529. package/dist/scripts/zellij-update-prompt-mode-check.js +0 -18
  530. package/dist/scripts/zellij-update-prompt-safety-check.js +0 -8
  531. package/dist/scripts/zellij-worker-pane-manager-check.js +0 -108
  532. package/dist/scripts/zellij-worker-pane-manager-single-owner-check.js +0 -47
  533. package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -199
  534. /package/dist/scripts/{sks-1-11-gate-lib.js → sks-cli-gate-lib.js} +0 -0
@@ -1,148 +0,0 @@
1
- #!/usr/bin/env node
2
- import { spawnSync } from 'node:child_process';
3
- import fs from 'node:fs';
4
- import os from 'node:os';
5
- import path from 'node:path';
6
- import { fileURLToPath } from 'node:url';
7
- import { DEFAULT_MAX_PACK_BYTES, DEFAULT_MAX_UNPACKED_BYTES } from '../core/release/package-size-budget.js';
8
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
9
- const limits = {
10
- packedBytes: Number(process.env.SKS_MAX_PACK_BYTES || DEFAULT_MAX_PACK_BYTES),
11
- unpackedBytes: Number(process.env.SKS_MAX_UNPACKED_BYTES || DEFAULT_MAX_UNPACKED_BYTES),
12
- packFiles: Number(process.env.SKS_MAX_PACK_FILES || 2100),
13
- trackedFileBytes: Number(process.env.SKS_MAX_TRACKED_FILE_BYTES || 384 * 1024)
14
- };
15
- const trackedFileSizeAllowlist = new Set([
16
- 'docs/sks-local-llm-mode/exports/sks-local-llm-mode-deck.pdf',
17
- 'release-gates.v2.json',
18
- 'schemas/codex/app-server-0.145/codex_app_server_protocol.schemas.json',
19
- 'schemas/codex/app-server-0.145/codex_app_server_protocol.v2.schemas.json'
20
- ]);
21
- const npmBin = process.platform === 'win32' ? 'npm.cmd' : 'npm';
22
- function fail(message, detail = '') {
23
- console.error(`Size check failed: ${message}`);
24
- if (detail)
25
- console.error(detail.trim());
26
- process.exit(2);
27
- }
28
- function fmt(bytes) {
29
- if (bytes < 1024)
30
- return `${bytes} B`;
31
- if (bytes < 1024 * 1024)
32
- return `${(bytes / 1024).toFixed(1)} KiB`;
33
- return `${(bytes / 1024 / 1024).toFixed(2)} MiB`;
34
- }
35
- function run(cmd, args, options = {}) {
36
- return spawnSync(cmd, args, {
37
- cwd: root,
38
- encoding: 'utf8',
39
- ...options
40
- });
41
- }
42
- function checkTrackedFiles() {
43
- const result = run('git', ['ls-files', '-z'], { encoding: 'buffer' });
44
- if (result.status !== 0)
45
- fail('unable to list tracked files', result.stderr?.toString('utf8') || '');
46
- const files = result.stdout.toString('utf8').split('\0').filter(Boolean);
47
- const oversized = [];
48
- for (const file of files) {
49
- if (trackedFileSizeAllowlist.has(file))
50
- continue;
51
- let stat;
52
- try {
53
- stat = fs.statSync(path.join(root, file));
54
- }
55
- catch (err) {
56
- if (err?.code === 'ENOENT')
57
- continue;
58
- throw err;
59
- }
60
- if (stat.size > limits.trackedFileBytes)
61
- oversized.push(`${file} (${fmt(stat.size)})`);
62
- }
63
- if (oversized.length) {
64
- fail(`tracked file exceeds ${fmt(limits.trackedFileBytes)}`, oversized.join('\n'));
65
- }
66
- }
67
- function checkVersionSync() {
68
- const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
69
- const lock = JSON.parse(fs.readFileSync(path.join(root, 'package-lock.json'), 'utf8'));
70
- const source = fs.readFileSync(path.join(root, 'src', 'core', 'version.ts'), 'utf8');
71
- const fsx = fs.readFileSync(path.join(root, 'src', 'core', 'fsx.ts'), 'utf8');
72
- const tsBin = fs.readFileSync(path.join(root, 'src', 'bin', 'sks.ts'), 'utf8');
73
- const cargoToml = fs.readFileSync(path.join(root, 'crates', 'sks-core', 'Cargo.toml'), 'utf8');
74
- const cargoLock = fs.readFileSync(path.join(root, 'crates', 'sks-core', 'Cargo.lock'), 'utf8');
75
- const cargoMain = fs.readFileSync(path.join(root, 'crates', 'sks-core', 'src', 'main.rs'), 'utf8');
76
- const sourceVersion = source.match(/export const PACKAGE_VERSION = ['"]([^'"]+)['"];/)?.[1];
77
- const fsxReExportsVersion = /PACKAGE_VERSION\s*}\s*from\s*['"]\.\/version(?:\.js)?['"]/.test(fsx);
78
- const fsxVersion = fsxReExportsVersion ? sourceVersion : fsx.match(/export const PACKAGE_VERSION = ['"]([^'"]+)['"];/)?.[1];
79
- const tsBinReExportsVersion = /PACKAGE_VERSION\s*}\s*from\s*['"]\.\.\/core\/version(?:\.js)?['"]/.test(tsBin);
80
- const tsBinVersion = tsBinReExportsVersion ? sourceVersion : tsBin.match(/const FAST_PACKAGE_VERSION = ['"]([^'"]+)['"];/)?.[1];
81
- const cargoTomlVersion = cargoToml.match(/^version = "([^"]+)"/m)?.[1];
82
- const cargoLockVersion = cargoLock.match(/\[\[package\]\]\nname = "sks-core"\nversion = "([^"]+)"/)?.[1];
83
- const cargoMainUsesCargoPkgVersion = /env!\(\s*"CARGO_PKG_VERSION"\s*\)/.test(cargoMain);
84
- const cargoMainVersion = cargoMainUsesCargoPkgVersion ? cargoTomlVersion : cargoMain.match(/println!\("sks-rs ([^"]+)"\)/)?.[1];
85
- const lockRootVersion = lock.packages?.['']?.version;
86
- const mismatches = [
87
- ['package-lock.json version', lock.version],
88
- ['package-lock root package version', lockRootVersion],
89
- ['src/core/version.ts PACKAGE_VERSION', sourceVersion],
90
- ['src/core/fsx.ts PACKAGE_VERSION', fsxVersion],
91
- ['src/bin/sks.ts FAST_PACKAGE_VERSION', tsBinVersion],
92
- ['crates/sks-core/Cargo.toml version', cargoTomlVersion],
93
- ['crates/sks-core/Cargo.lock sks-core version', cargoLockVersion],
94
- ['crates/sks-core/src/main.rs sks-rs version', cargoMainVersion]
95
- ].filter(([, version]) => version !== pkg.version);
96
- if (mismatches.length) {
97
- fail('package version metadata is not synchronized', [
98
- `package.json version: ${pkg.version}`,
99
- ...mismatches.map(([label, version]) => `${label}: ${version || 'missing'}`)
100
- ].join('\n'));
101
- }
102
- }
103
- function checkPackageFootprint() {
104
- const env = {
105
- ...process.env,
106
- npm_config_cache: process.env.SKS_SIZECHECK_NPM_CACHE || path.join(os.tmpdir(), 'sneakoscope-npm-cache')
107
- };
108
- const result = run(npmBin, ['pack', '--dry-run', '--json', '--ignore-scripts'], { env });
109
- if (result.status !== 0)
110
- fail('npm pack dry-run failed', `${result.stdout || ''}\n${result.stderr || ''}`);
111
- let info;
112
- try {
113
- info = JSON.parse(result.stdout)[0];
114
- }
115
- catch {
116
- fail('npm pack dry-run returned non-json output', result.stdout || '');
117
- }
118
- if (!info)
119
- fail('npm pack dry-run returned no package metadata');
120
- const forbiddenPatterns = [
121
- /^\.agents\//,
122
- /^\.codex\//,
123
- /^\.dcodex\//,
124
- /^\.omx\//,
125
- /^\.sneakoscope\//,
126
- /^native\//,
127
- /^node_modules\//,
128
- /^scripts\//,
129
- /^tmp\//,
130
- /^logs\//,
131
- /\.(tgz|zip|tar|tar\.gz|log)$/i
132
- ];
133
- const forbidden = (info.files || [])
134
- .map((file) => file.path)
135
- .filter((file) => forbiddenPatterns.some((pattern) => pattern.test(file)));
136
- if (forbidden.length)
137
- fail('npm package includes forbidden files', forbidden.join('\n'));
138
- if (info.size > limits.packedBytes)
139
- fail(`npm tarball exceeds ${fmt(limits.packedBytes)}`, `${info.filename}: ${fmt(info.size)}`);
140
- if (info.unpackedSize > limits.unpackedBytes)
141
- fail(`npm unpacked size exceeds ${fmt(limits.unpackedBytes)}`, `${info.filename}: ${fmt(info.unpackedSize)}`);
142
- if (info.entryCount > limits.packFiles)
143
- fail(`npm package file count exceeds ${limits.packFiles}`, `${info.entryCount} files`);
144
- console.log(`Size check passed: ${fmt(info.size)} packed, ${fmt(info.unpackedSize)} unpacked, ${info.entryCount} files.`);
145
- }
146
- checkTrackedFiles();
147
- checkVersionSync();
148
- checkPackageFootprint();
@@ -1,333 +0,0 @@
1
- import fs from 'node:fs/promises';
2
- import os from 'node:os';
3
- import path from 'node:path';
4
- import { PACKAGE_VERSION, runProcess, sha256, which } from '../core/fsx.js';
5
- import { aggregateFileHashes, installSksMenuBar, NATIVE_RESOURCE_FILES, NATIVE_SOURCE_FILES, rollbackSksMenuBar } from '../core/codex-app/sks-menubar.js';
6
- const temp = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-menubar-check-'));
7
- const fakeRoot = path.join(temp, 'project-root');
8
- await fs.mkdir(fakeRoot, { recursive: true });
9
- const firstEntry = await writeProbeEntry(path.join(fakeRoot, 'first', 'dist', 'bin', 'sks.js'));
10
- const replacementEntry = await writeProbeEntry(path.join(fakeRoot, 'replacement', 'dist', 'bin', 'sks.js'));
11
- const env = { ...process.env, SKS_SKIP_SKS_MENUBAR_LAUNCH: '1' };
12
- const initialResult = await installSksMenuBar({
13
- apply: true, launch: false, home: temp, root: fakeRoot, sksEntry: firstEntry, env, quiet: true
14
- });
15
- if (process.platform !== 'darwin') {
16
- const ok = initialResult.ok && initialResult.status === 'unsupported_platform';
17
- console.log(JSON.stringify({
18
- schema: 'sks.sks-menubar-install-check.v2', ok, temp, result: initialResult,
19
- is_idempotent: false, previous_app_rollback_verified: false, actual_rollback_verified: false,
20
- resource_sha256: null, resources_sha256: null,
21
- blockers: ok ? [] : ['sks_menubar_install_check_failed']
22
- }, null, 2));
23
- if (!ok)
24
- process.exit(1);
25
- process.exit(0);
26
- }
27
- const initialAppPath = required(initialResult.app_path, 'initial app path');
28
- const initialExecutable = required(initialResult.executable_path, 'initial executable path');
29
- const initialStamp = required(initialResult.build_stamp, 'initial build stamp');
30
- const installDir = path.dirname(initialAppPath);
31
- const initialExecutableSha256 = sha256(await fs.readFile(initialExecutable));
32
- const initialInfoPlistSha256 = sha256(await fs.readFile(path.join(initialAppPath, 'Contents', 'Info.plist')));
33
- const initialActionScript = await fs.readFile(required(initialResult.action_script_path, 'initial action script path'), 'utf8');
34
- const initialLaunchAgent = await fs.readFile(required(initialResult.launch_agent_path, 'initial launch agent path'), 'utf8');
35
- const secondResult = await installSksMenuBar({
36
- apply: true, launch: false, home: temp, root: fakeRoot, sksEntry: firstEntry, env, quiet: true
37
- });
38
- const secondExecutableSha256 = sha256(await fs.readFile(required(secondResult.executable_path, 'second executable path')));
39
- const isIdempotent = secondResult.ok
40
- && secondResult.actions.includes('menubar_up_to_date')
41
- && secondExecutableSha256 === initialExecutableSha256
42
- && secondResult.build_stamp?.source_sha256 === initialStamp.source_sha256
43
- && secondResult.build_stamp?.resources_sha256 === initialStamp.resources_sha256;
44
- const result = await installSksMenuBar({
45
- apply: true, launch: false, home: temp, root: fakeRoot, sksEntry: replacementEntry, env, quiet: true
46
- });
47
- const appPath = required(result.app_path, 'final app path');
48
- const executablePath = required(result.executable_path, 'final executable path');
49
- const buildStamp = required(result.build_stamp, 'final build stamp');
50
- const resourcesDir = path.join(appPath, 'Contents', 'Resources');
51
- const sourcesDir = path.join(installDir, 'Sources');
52
- const previousAppPath = `${appPath}.previous`;
53
- const previousExecutablePath = path.join(previousAppPath, 'Contents', 'MacOS', 'SKSMenuBar');
54
- const previousBuildStampPath = path.join(installDir, 'build-stamp.json.previous');
55
- const previousActionScriptPath = path.join(installDir, 'sks-menubar-action.sh.previous');
56
- const previousLaunchAgentPath = path.join(installDir, 'com.sneakoscope.sks-menubar.plist.previous');
57
- const installedSourceNames = (await fs.readdir(sourcesDir)).sort();
58
- const installedResourceNames = (await fs.readdir(resourcesDir)).sort();
59
- const sourceHashes = await hashNamedFiles(sourcesDir, [...NATIVE_SOURCE_FILES]);
60
- const resourceHashes = await hashNamedFiles(resourcesDir, [...NATIVE_RESOURCE_FILES]);
61
- const sourceSha256 = aggregateFileHashes(sourceHashes);
62
- const resourcesSha256 = aggregateFileHashes(resourceHashes);
63
- const sourceBindingVerified = sourceSha256 === buildStamp.source_sha256
64
- && recordsEqual(sourceHashes, buildStamp.source_files_sha256);
65
- const resourceBindingVerified = resourcesSha256 === buildStamp.resources_sha256
66
- && recordsEqual(resourceHashes, buildStamp.resource_files_sha256);
67
- const infoPlistPath = path.join(appPath, 'Contents', 'Info.plist');
68
- const infoPlist = await fs.readFile(infoPlistPath, 'utf8');
69
- const infoPlistIconVerified = /<key>CFBundleIconFile<\/key>\s*<string>AppIcon<\/string>/.test(infoPlist)
70
- && /<key>CFBundleDisplayName<\/key>\s*<string>SKS<\/string>/.test(infoPlist)
71
- && /<key>LSUIElement<\/key>\s*<true\/>/.test(infoPlist)
72
- && sha256(infoPlist) === buildStamp.info_plist_sha256;
73
- const appIconPath = path.join(resourcesDir, 'AppIcon.icns');
74
- const iconLoadSmoke = await imageLoadSmoke(appIconPath);
75
- const signature = await strictCodesign(appPath);
76
- const previousSignature = await strictCodesign(previousAppPath);
77
- const swiftCompile = result.actions.includes(`compiled ${NATIVE_SOURCE_FILES.length} Swift sources`);
78
- const swiftParse = await swiftParseSmoke(sourcesDir);
79
- const actionScriptExecutable = await isExecutable(required(result.action_script_path, 'final action script path'));
80
- const launchAgent = await fs.readFile(required(result.launch_agent_path, 'launch agent path'), 'utf8');
81
- const launchAgentSafe = !launchAgent.includes('<key>KeepAlive</key>')
82
- && !launchAgent.includes('EnvironmentVariables')
83
- && launchAgent.includes('<key>ProcessType</key>')
84
- && launchAgent.includes('<string>Interactive</string>');
85
- const nativeSources = await Promise.all(NATIVE_SOURCE_FILES.map((name) => fs.readFile(path.join(sourcesDir, name), 'utf8')));
86
- const nativeSource = nativeSources.join('\n');
87
- const notificationContract = ['SKS_OPERATION_RESULT', 'SKS_UPDATE_AVAILABLE', 'SKS_ACTION_REQUIRED',
88
- 'OPEN_CONTROL_CENTER', 'OPEN_LOG', 'RETRY_OPERATION']
89
- .every((token) => nativeSource.includes(token))
90
- && !nativeSource.includes('OPEN_DASHBOARD')
91
- && !nativeSource.includes('onOpenDashboard')
92
- && nativeSource.includes('UNUserNotificationCenterDelegate')
93
- && nativeSource.includes('didReceive response: UNNotificationResponse')
94
- && !nativeSource.includes('display notification')
95
- && !nativeSource.includes('runModal(');
96
- const notificationRuntime = await notificationRuntimeSmoke(sourcesDir);
97
- const notificationActionTest = notificationContract && notificationRuntime.ok;
98
- const accessibilitySmoke = nativeSource.includes('setAccessibilityLabel("Control Center sections")')
99
- && nativeSource.includes('setAccessibilityLabel("Effective MCP servers")')
100
- && nativeSource.includes('button.setAccessibilityLabel(title)');
101
- const reducedMotionSmoke = nativeSource.includes('accessibilityDisplayShouldReduceMotion')
102
- && !nativeSource.includes('NSAnimationContext')
103
- && !nativeSource.includes('animator()');
104
- const upgradedActionScriptSha256 = sha256(await fs.readFile(required(result.action_script_path, 'final action script path')));
105
- const previousBuildStamp = await readJson(previousBuildStampPath);
106
- const previousActionScript = await fs.readFile(previousActionScriptPath, 'utf8').catch(() => '');
107
- const previousLaunchAgent = await fs.readFile(previousLaunchAgentPath, 'utf8').catch(() => '');
108
- const previousResources = await hashNamedFiles(path.join(previousAppPath, 'Contents', 'Resources'), [...NATIVE_RESOURCE_FILES]).catch(() => ({}));
109
- const committedInstallGeneration = result.transaction?.status === 'committed'
110
- && result.transaction.pairs.length === 4
111
- && result.transaction.pairs.every((pair) => pair.active_exists
112
- && pair.backup_exists
113
- && !pair.staged_exists
114
- && !pair.temporary_exists
115
- && !pair.displaced_exists);
116
- const previousAppRollbackVerified = await exists(previousExecutablePath)
117
- && sha256(await fs.readFile(previousExecutablePath)) === initialExecutableSha256
118
- && previousSignature.ok
119
- && previousBuildStamp?.source_sha256 === initialStamp.source_sha256
120
- && previousBuildStamp?.resources_sha256 === initialStamp.resources_sha256
121
- && recordsEqual(previousResources, initialStamp.resource_files_sha256)
122
- && sha256(await fs.readFile(path.join(previousAppPath, 'Contents', 'Info.plist'))) === initialInfoPlistSha256
123
- && previousActionScript === initialActionScript
124
- && previousLaunchAgent === initialLaunchAgent
125
- && committedInstallGeneration
126
- && result.actions.includes(`preserved complete previous generation at ${previousAppPath}`);
127
- const rollbackResult = previousAppRollbackVerified
128
- ? await rollbackSksMenuBar({ home: temp, root: fakeRoot, env, launch: false })
129
- : null;
130
- const restoredStamp = await readJson(path.join(installDir, 'build-stamp.json'));
131
- const restoredResources = await hashNamedFiles(path.join(appPath, 'Contents', 'Resources'), [...NATIVE_RESOURCE_FILES]).catch(() => ({}));
132
- const committedRollbackGeneration = rollbackResult?.transaction?.status === 'committed'
133
- && rollbackResult.transaction.pairs.length === 4
134
- && rollbackResult.transaction.pairs.every((pair) => pair.active_exists
135
- && pair.backup_exists
136
- && !pair.temporary_exists
137
- && !pair.displaced_exists);
138
- const actualRollbackVerified = rollbackResult?.ok === true
139
- && rollbackResult.status === 'rolled_back_launch_skipped'
140
- && rollbackResult.verification_before?.ok === true
141
- && rollbackResult.verification_after?.ok === true
142
- && sha256(await fs.readFile(executablePath)) === initialExecutableSha256
143
- && restoredStamp?.source_sha256 === initialStamp.source_sha256
144
- && restoredStamp?.resources_sha256 === initialStamp.resources_sha256
145
- && recordsEqual(restoredResources, initialStamp.resource_files_sha256)
146
- && await fs.readFile(required(result.action_script_path, 'final action script path'), 'utf8') === initialActionScript
147
- && await fs.readFile(required(result.launch_agent_path, 'final launch agent path'), 'utf8') === initialLaunchAgent
148
- && committedRollbackGeneration;
149
- const expectedResourcesPresent = [
150
- 'AppIcon.icns', 'SKSStatusTemplate.pdf', 'SKSStatusUpdateTemplate.pdf',
151
- 'SKSStatusWarningTemplate.pdf', 'SKSStatusAttentionTemplate.pdf'
152
- ].every((name) => installedResourceNames.includes(name));
153
- const buildStampVersionSourceBinding = buildStamp.package_version === PACKAGE_VERSION
154
- && buildStamp.codesign_identifier === 'com.sneakoscope.sks-menubar'
155
- && buildStamp.action_script_sha256 === upgradedActionScriptSha256
156
- && sourceBindingVerified
157
- && resourceBindingVerified;
158
- const checks = {
159
- install_ok: result.ok && result.status === 'installed_launch_skipped',
160
- app_bundle_exists: await exists(appPath) && await exists(executablePath),
161
- swift_compile: swiftCompile,
162
- swift_parse: swiftParse.ok,
163
- source_inventory: recordsEqual(Object.fromEntries(installedSourceNames.map((name) => [name, 'present'])), Object.fromEntries([...NATIVE_SOURCE_FILES].sort().map((name) => [name, 'present']))),
164
- resources_inventory: recordsEqual(Object.fromEntries(installedResourceNames.map((name) => [name, 'present'])), Object.fromEntries([...NATIVE_RESOURCE_FILES].sort().map((name) => [name, 'present']))),
165
- expected_resources_present: expectedResourcesPresent,
166
- info_plist_icon_verified: infoPlistIconVerified,
167
- app_icon_load_smoke: iconLoadSmoke.ok,
168
- codesign_strict_verified: signature.ok,
169
- codesign_identifier_verified: signature.identifier === 'com.sneakoscope.sks-menubar',
170
- action_script_executable: actionScriptExecutable,
171
- launch_agent_safe: launchAgentSafe,
172
- notification_action_test: notificationActionTest,
173
- accessibility_smoke: accessibilitySmoke,
174
- reduced_motion_smoke: reducedMotionSmoke,
175
- build_stamp_version_source_binding: buildStampVersionSourceBinding,
176
- is_idempotent: isIdempotent,
177
- previous_app_rollback_verified: previousAppRollbackVerified,
178
- actual_rollback_verified: actualRollbackVerified
179
- };
180
- const failedChecks = Object.entries(checks).filter(([, value]) => !value).map(([name]) => name);
181
- const ok = failedChecks.length === 0;
182
- const report = {
183
- schema: 'sks.sks-menubar-install-check.v2',
184
- ok,
185
- temp,
186
- result,
187
- initial_result: initialResult,
188
- second_result: secondResult,
189
- checks,
190
- is_idempotent: isIdempotent,
191
- previous_app_path: previousAppPath,
192
- previous_app_rollback_verified: previousAppRollbackVerified,
193
- actual_rollback_verified: actualRollbackVerified,
194
- rollback_result: rollbackResult,
195
- resource_sha256: resourcesSha256,
196
- resources_sha256: resourcesSha256,
197
- resource_files_sha256: resourceHashes,
198
- source_sha256: sourceSha256,
199
- source_files_sha256: sourceHashes,
200
- build_stamp_version_source_binding: buildStampVersionSourceBinding,
201
- signature,
202
- previous_signature: previousSignature,
203
- icon_load_smoke: iconLoadSmoke,
204
- notification_runtime: notificationRuntime,
205
- swift_parse: swiftParse,
206
- installed_source_names: installedSourceNames,
207
- installed_resource_names: installedResourceNames,
208
- failed_checks: failedChecks,
209
- blockers: ok ? [] : ['sks_menubar_install_check_failed']
210
- };
211
- console.log(JSON.stringify(report, null, 2));
212
- if (!ok)
213
- process.exit(1);
214
- async function writeProbeEntry(file) {
215
- await fs.mkdir(path.dirname(file), { recursive: true });
216
- await fs.writeFile(file, [
217
- '#!/usr/bin/env node',
218
- `console.log('sks ${PACKAGE_VERSION}');`,
219
- ''
220
- ].join('\n'), { mode: 0o755 });
221
- return file;
222
- }
223
- async function hashNamedFiles(directory, names) {
224
- const output = {};
225
- for (const name of names)
226
- output[name] = sha256(await fs.readFile(path.join(directory, name)));
227
- return output;
228
- }
229
- function recordsEqual(left, right) {
230
- return JSON.stringify(Object.entries(left).sort()) === JSON.stringify(Object.entries(right).sort());
231
- }
232
- async function strictCodesign(appPath) {
233
- const codesign = await which('codesign').catch(() => null) || '/usr/bin/codesign';
234
- const verify = await runProcess(codesign, ['--verify', '--deep', '--strict', appPath], { timeoutMs: 20_000, maxOutputBytes: 32 * 1024 })
235
- .catch((error) => ({ code: 1, stdout: '', stderr: error instanceof Error ? error.message : String(error) }));
236
- const detail = await runProcess(codesign, ['-dv', '--verbose=4', appPath], { timeoutMs: 10_000, maxOutputBytes: 32 * 1024 })
237
- .catch((error) => ({ code: 1, stdout: '', stderr: error instanceof Error ? error.message : String(error) }));
238
- const detailText = `${detail.stdout || ''}\n${detail.stderr || ''}`;
239
- const identifier = detailText.match(/\bIdentifier=([^\n]+)/)?.[1]?.trim() || null;
240
- return {
241
- ok: verify.code === 0 && detail.code === 0,
242
- identifier,
243
- verify_code: verify.code,
244
- detail_code: detail.code,
245
- error: verify.code === 0 && detail.code === 0 ? null : String(verify.stderr || detail.stderr || detail.stdout).trim()
246
- };
247
- }
248
- async function imageLoadSmoke(iconPath) {
249
- const sips = await which('sips').catch(() => null) || '/usr/bin/sips';
250
- const result = await runProcess(sips, ['-g', 'pixelWidth', '-g', 'pixelHeight', iconPath], { timeoutMs: 10_000, maxOutputBytes: 16 * 1024 })
251
- .catch((error) => ({ code: 1, stdout: '', stderr: error instanceof Error ? error.message : String(error) }));
252
- const text = `${result.stdout || ''}\n${result.stderr || ''}`;
253
- const width = Number(text.match(/pixelWidth:\s*(\d+)/)?.[1] || '') || null;
254
- const height = Number(text.match(/pixelHeight:\s*(\d+)/)?.[1] || '') || null;
255
- return { ok: result.code === 0 && Boolean(width && height), width, height, code: result.code, error: result.code === 0 ? null : text.trim() };
256
- }
257
- async function swiftParseSmoke(sourcesDir) {
258
- const swiftc = await which('swiftc').catch(() => null) || '/usr/bin/swiftc';
259
- const files = NATIVE_SOURCE_FILES.map((name) => path.join(sourcesDir, name));
260
- const result = await runProcess(swiftc, ['-parse', ...files], { timeoutMs: 30_000, maxOutputBytes: 64 * 1024 })
261
- .catch((error) => ({ code: 1, stdout: '', stderr: error instanceof Error ? error.message : String(error) }));
262
- return { ok: result.code === 0, code: result.code, error: result.code === 0 ? null : String(result.stderr || result.stdout).trim() };
263
- }
264
- async function notificationRuntimeSmoke(sourcesDir) {
265
- const swiftc = await which('swiftc').catch(() => null) || '/usr/bin/swiftc';
266
- const harness = path.join(temp, 'NotificationHarness.swift');
267
- const binary = path.join(temp, 'notification-runtime');
268
- await fs.writeFile(harness, `
269
- import Foundation
270
- import UserNotifications
271
-
272
- @main
273
- struct NotificationHarness {
274
- static func main() {
275
- let coordinator = NotificationCoordinator()
276
- var calls: [String] = []
277
- coordinator.onOpenControlCenter = { calls.append("center") }
278
- coordinator.onOpenLog = { calls.append("log") }
279
- coordinator.onRetryOperation = { calls.append("retry") }
280
- let routes = [
281
- coordinator.dispatchActionIdentifier("OPEN_LOG"),
282
- coordinator.dispatchActionIdentifier("RETRY_OPERATION"),
283
- coordinator.dispatchActionIdentifier("OPEN_CONTROL_CENTER"),
284
- coordinator.dispatchActionIdentifier(UNNotificationDismissActionIdentifier)
285
- ]
286
- precondition(routes == ["open_log", "retry_operation", "open_control_center", "dismissed"])
287
- precondition(calls == ["log", "retry", "center"])
288
- precondition(NotificationCoordinator.authorizationIsDenied(.denied))
289
- precondition(!NotificationCoordinator.authorizationIsDenied(.authorized))
290
- precondition(!NotificationCoordinator.authorizationIsDenied(.notDetermined))
291
- precondition(NotificationCoordinator.categoryIdentifier() == "SKS_OPERATION_RESULT")
292
- precondition(NotificationCoordinator.categoryIdentifier(failed: true) == "SKS_ACTION_REQUIRED")
293
- let available = #"{"schema":"sks.update-status.v3","update_count":1}"#
294
- precondition(NotificationCoordinator.updateIsAvailable(in: available))
295
- precondition(NotificationCoordinator.categoryIdentifier(updateStatusOutput: available) == "SKS_UPDATE_AVAILABLE")
296
- }
297
- }
298
- `);
299
- const compiled = await runProcess(swiftc, [path.join(sourcesDir, 'NotificationCoordinator.swift'), harness, '-o', binary], {
300
- timeoutMs: 30_000,
301
- maxOutputBytes: 64 * 1024
302
- }).catch((error) => ({ code: 1, stdout: '', stderr: error instanceof Error ? error.message : String(error) }));
303
- if (compiled.code !== 0) {
304
- return { ok: false, compile_code: compiled.code, run_code: null, error: String(compiled.stderr || compiled.stdout).trim() };
305
- }
306
- const executed = await runProcess(binary, [], { timeoutMs: 10_000, maxOutputBytes: 16 * 1024 })
307
- .catch((error) => ({ code: 1, stdout: '', stderr: error instanceof Error ? error.message : String(error) }));
308
- return {
309
- ok: executed.code === 0,
310
- compile_code: compiled.code,
311
- run_code: executed.code,
312
- error: executed.code === 0 ? null : String(executed.stderr || executed.stdout).trim()
313
- };
314
- }
315
- async function readJson(file) {
316
- try {
317
- return JSON.parse(await fs.readFile(file, 'utf8'));
318
- }
319
- catch {
320
- return null;
321
- }
322
- }
323
- async function isExecutable(file) {
324
- return fs.access(file, fs.constants.X_OK).then(() => true).catch(() => false);
325
- }
326
- async function exists(file) {
327
- return fs.access(file).then(() => true).catch(() => false);
328
- }
329
- function required(value, label) {
330
- if (value === null || value === undefined)
331
- throw new Error(`missing ${label}`);
332
- return value;
333
- }
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env node
2
- import fs from 'node:fs/promises';
3
- import path from 'node:path';
4
- import { assertGate, emitGate, makeTempRoot, writeText } from './sks-3-1-8-check-lib.js';
5
- import { captureSecretPreservationSnapshot, withSecretPreservationGuard } from '../core/config/secret-preservation.js';
6
- const root = await makeTempRoot('sks-supabase-blackbox-');
7
- const envFile = path.join(root, '.env.local');
8
- await writeText(envFile, 'NEXT_PUBLIC_SUPABASE_URL=https://example.supabase.co\nNEXT_PUBLIC_SUPABASE_ANON_KEY=super-secret-anon\n');
9
- const before = await captureSecretPreservationSnapshot({ root });
10
- await withSecretPreservationGuard(root, 'blackbox-preserve', async () => {
11
- await fs.appendFile(envFile, 'SKS_MANAGED=true\n', 'utf8');
12
- });
13
- const after = await captureSecretPreservationSnapshot({ root });
14
- assertGate(JSON.stringify(before.fingerprints.map((fp) => fp.value_sha256).sort()) === JSON.stringify(after.fingerprints.map((fp) => fp.value_sha256).sort()), 'Supabase secret fingerprints must remain stable across guarded update', { before, after });
15
- assertGate(!JSON.stringify(after).includes('super-secret-anon'), 'reports must not include raw Supabase values', after);
16
- let blocked = false;
17
- try {
18
- await withSecretPreservationGuard(root, 'blackbox-change', async () => {
19
- await fs.writeFile(envFile, 'NEXT_PUBLIC_SUPABASE_URL=https://example.supabase.co\nNEXT_PUBLIC_SUPABASE_ANON_KEY=mutated-secret\n', 'utf8');
20
- });
21
- }
22
- catch {
23
- blocked = true;
24
- }
25
- const restored = await fs.readFile(envFile, 'utf8');
26
- assertGate(blocked, 'Supabase value mutation must be blocked after rollback');
27
- assertGate(restored.includes('super-secret-anon') && !restored.includes('mutated-secret'), 'Supabase value mutation must be rolled back');
28
- emitGate('secret:supabase-preservation-blackbox');
@@ -1,115 +0,0 @@
1
- #!/usr/bin/env node
2
- import { spawnSync } from 'node:child_process';
3
- import fs from 'node:fs';
4
- import path from 'node:path';
5
- import { assertGate, emitGate, root } from './sks-1-18-gate-lib.js';
6
- const bin = path.join(root, 'dist', 'bin', 'sks.js');
7
- assertGate(fs.existsSync(bin), 'dist bin missing for live smoke', { bin, hint: 'run npm run build first' });
8
- const targetGroups = [
9
- {
10
- id: 'repo_metadata',
11
- urls: [
12
- 'https://raw.githubusercontent.com/mandarange/Sneakoscope-Codex/main/package.json',
13
- 'https://github.com/mandarange/Sneakoscope-Codex',
14
- 'https://api.github.com/repos/mandarange/Sneakoscope-Codex'
15
- ]
16
- },
17
- {
18
- id: 'npm_package',
19
- urls: [
20
- 'https://registry.npmjs.org/sneakoscope',
21
- 'https://www.npmjs.com/package/sneakoscope'
22
- ]
23
- }
24
- ];
25
- const fetchResults = targetGroups.map((group) => fetchWithFallback(group));
26
- const doctor = runJson(['super-search', 'doctor', '--json']);
27
- for (const row of fetchResults) {
28
- assertGate(row.status === 0, 'super-search live fetch command failed', row);
29
- const result = row.json;
30
- const directSources = result.sources.filter((source) => source.provider_id === 'direct_url');
31
- assertGate(directSources.some((source) => source.acquisition_verdict === 'verified_content'), 'direct_url source must have verified_content', { target: row.target, sources: result.sources });
32
- assertGate(directSources.some((source) => source.content_artifact), 'direct_url source must have content artifact', { target: row.target, sources: result.sources });
33
- assertGate(directSources.some((source) => source.content_sha256), 'direct_url source must have content sha256', { target: row.target, sources: result.sources });
34
- assertGate(result.proof.source_count > 0, 'live smoke must record source count > 0', result.proof);
35
- assertGate(result.proof.verified_source_count > 0, 'live smoke must record verified source count > 0', result.proof);
36
- assertGate(!result.blockers.includes('source_acquisition_unavailable'), 'live smoke must not report source_acquisition_unavailable', result);
37
- assertGate(result.claims.every((claim) => claim.status !== 'supported' || claim.source_ids?.length > 0), 'supported claims must be source-backed', result.claims);
38
- }
39
- assertGate(doctor.status === 0, 'super-search doctor command failed', doctor);
40
- assertGate(['sks.super-search-doctor.v2', 'sks.super-search-doctor.v3'].includes(doctor.json.schema), 'doctor must emit a supported schema', doctor.json);
41
- assertGate(doctor.json.ok === (doctor.json.status === 'usable' || doctor.json.status === 'offline_usable'), 'doctor ok must match usable status', doctor.json);
42
- const report = {
43
- schema: 'sks.super-search-live-smoke.v1',
44
- ok: true,
45
- generated_at: new Date().toISOString(),
46
- checked_urls: fetchResults.map((row) => row.url),
47
- attempts: fetchResults.map((row) => ({
48
- group_id: row.group_id,
49
- selected_url: row.url,
50
- attempts: row.attempts.map((attempt) => ({
51
- url: attempt.url,
52
- status: attempt.status,
53
- verified_source_count: Number(attempt.json?.proof?.verified_source_count || 0),
54
- blockers: attempt.json?.blockers || []
55
- }))
56
- })),
57
- doctor_status: doctor.json.status,
58
- verified_sources: fetchResults.reduce((sum, row) => sum + Number(row.json?.proof?.verified_source_count || 0), 0),
59
- blockers: [],
60
- evidence_paths: fetchResults.map((row) => row.json?.artifact_dir).filter(Boolean)
61
- };
62
- fs.mkdirSync(path.join(root, '.sneakoscope', 'reports'), { recursive: true });
63
- fs.writeFileSync(path.join(root, '.sneakoscope', 'reports', 'super-search-live-smoke.json'), `${JSON.stringify(report, null, 2)}\n`);
64
- emitGate('super-search:live-smoke', {
65
- checked_urls: fetchResults.length,
66
- doctor_status: doctor.json.status,
67
- verified_sources: fetchResults.reduce((sum, row) => sum + Number(row.json?.proof?.verified_source_count || 0), 0)
68
- });
69
- function fetchWithFallback(group) {
70
- const attempts = [];
71
- for (const url of group.urls) {
72
- const row = runJson(['super-search', 'fetch', url, '--json']);
73
- attempts.push({ ...row, url });
74
- if (isVerifiedFetch(row)) {
75
- return { ...row, group_id: group.id, url, attempts };
76
- }
77
- }
78
- return { ...attempts[attempts.length - 1], group_id: group.id, url: attempts[attempts.length - 1]?.url || null, attempts };
79
- }
80
- function isVerifiedFetch(row) {
81
- if (row.status !== 0 || !row.json)
82
- return false;
83
- const result = row.json;
84
- const directSources = Array.isArray(result.sources) ? result.sources.filter((source) => source.provider_id === 'direct_url') : [];
85
- const hasNoSourceAcquisitionBlocker = !Array.isArray(result.blockers) || !result.blockers.includes('source_acquisition_unavailable');
86
- return directSources.some((source) => source.acquisition_verdict === 'verified_content') &&
87
- directSources.some((source) => source.content_artifact) &&
88
- directSources.some((source) => source.content_sha256) &&
89
- Number(result.proof?.source_count || 0) > 0 &&
90
- Number(result.proof?.verified_source_count || 0) > 0 &&
91
- hasNoSourceAcquisitionBlocker;
92
- }
93
- function runJson(args) {
94
- const proc = spawnSync(process.execPath, [bin, ...args], {
95
- cwd: root,
96
- encoding: 'utf8',
97
- env: { ...process.env, SKS_RELEASE_LIVE: '1' },
98
- timeout: 30000
99
- });
100
- let json = null;
101
- try {
102
- json = JSON.parse(proc.stdout || proc.stderr || '{}');
103
- }
104
- catch {
105
- json = null;
106
- }
107
- return {
108
- target: args.join(' '),
109
- status: proc.status,
110
- signal: proc.signal,
111
- stdout: proc.stdout,
112
- stderr: proc.stderr,
113
- json
114
- };
115
- }
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- import { assertGate, emitGate, importDist, root } from './sks-1-18-gate-lib.js';
3
- const { runSuperSearchLocalHttpSmoke } = await importDist('core/super-search/local-http-smoke.js');
4
- const report = await runSuperSearchLocalHttpSmoke({ root });
5
- assertGate(report.ok === true, 'Super-Search local HTTP smoke must pass', report);
6
- assertGate(report.verified_content === true, 'local smoke must produce verified_content', report);
7
- assertGate(Boolean(report.content_artifact), 'local smoke must write a content artifact', report);
8
- assertGate(Boolean(report.content_sha256), 'local smoke must record content_sha256', report);
9
- assertGate(report.content_length > 0, 'local smoke content_length must be positive', report);
10
- assertGate(report.source_backed_claim === true, 'local smoke must produce a source-backed claim', report);
11
- assertGate(report.server_closed === true, 'local smoke server must close', report);
12
- emitGate('super-search:local-http-smoke', {
13
- content_length: report.content_length,
14
- content_sha256: report.content_sha256,
15
- report: '.sneakoscope/reports/super-search-local-http-smoke.json'
16
- });