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,5 +1,5 @@
1
1
  import path from 'node:path';
2
- import { findReferences, pickScanTool } from './impact-scan.js';
2
+ import { findReferences } from './impact-scan.js';
3
3
  const ADDED_EXPORT_RE = /^\+\s*export\s+(?:async\s+)?(?:function|const|class|interface|type)\s+([A-Za-z_$][\w$]*)\b/;
4
4
  export async function analyzeDiffQuality(input) {
5
5
  const planFiles = new Set((input.plannedFiles || []).map(normalizePath).filter(Boolean));
@@ -53,11 +53,10 @@ async function detectDeadAdditions(root, patchText, changedFiles) {
53
53
  const additions = addedExports(patchText, changedFiles);
54
54
  if (!additions.length)
55
55
  return [];
56
- const tool = await pickScanTool();
57
56
  const dead = [];
58
57
  for (const addition of additions) {
59
- const refs = await findReferences(root, addition.name, tool, { excludeFile: addition.file });
60
- if (!refs.length)
58
+ const found = await findReferences(root, addition.name, { excludeFile: addition.file });
59
+ if (!found.refs.length)
61
60
  dead.push(addition.name);
62
61
  }
63
62
  return dead;
@@ -1,13 +1,15 @@
1
- import path from 'node:path';
2
- import { listFilesRecursive, readText, runProcess, which } from '../fsx.js';
1
+ import { search } from '../search/index.js';
2
+ import { SEARCH_SCHEMA_VERSION } from '../search/types.js';
3
3
  const DECL_RE = /^\s*export\s+(?:async\s+)?(?:function|const|class|interface|type)\s+([A-Za-z_$][\w$]*)\b/;
4
- const TEXT_EXT_RE = /\.(?:[cm]?[jt]sx?|json|md|css|scss|html|yml|yaml|toml)$/i;
5
4
  export async function scanImpact(root, changedFiles, patchText) {
6
5
  const symbols = extractChangedExportedSymbols(patchText, changedFiles);
7
- const tool = await pickScanTool();
8
6
  const references = [];
7
+ let tool = 'search-provider-js';
9
8
  for (const sym of symbols) {
10
- references.push(...await findReferences(root, sym.name, tool, { excludeFile: sym.file }));
9
+ const found = await findReferences(root, sym.name, { excludeFile: sym.file });
10
+ if (found.provider === 'sks-rs')
11
+ tool = 'search-provider';
12
+ references.push(...found.refs);
11
13
  }
12
14
  const patchFiles = new Set(changedFiles.map(normalizePath));
13
15
  const cochange = [...new Set(references.map((ref) => ref.file))]
@@ -39,95 +41,43 @@ export function extractChangedExportedSymbols(patchText, changedFiles) {
39
41
  return dedupeSymbols(symbols);
40
42
  }
41
43
  export async function pickScanTool() {
42
- if (await which('ast-grep'))
43
- return 'ast-grep';
44
- if (await which('rg'))
45
- return 'ripgrep';
46
- return 'builtin';
44
+ return 'search-provider-js';
47
45
  }
48
- export async function findReferences(root, symbol, tool, opts = {}) {
46
+ export async function findReferences(root, symbol, opts = {}) {
49
47
  const normalizedExclude = normalizePath(opts.excludeFile || '');
50
48
  if (!symbol || !/^[A-Za-z_$][\w$]*$/.test(symbol))
51
- return [];
52
- if (tool === 'ast-grep') {
53
- const refs = await astGrepReferences(root, symbol, normalizedExclude);
54
- if (refs.length)
55
- return refs;
56
- }
57
- if (tool === 'ast-grep' || tool === 'ripgrep') {
58
- const refs = await ripgrepReferences(root, symbol, normalizedExclude);
59
- if (refs.length || tool === 'ripgrep')
60
- return refs;
61
- }
62
- return builtinReferences(root, symbol, normalizedExclude);
63
- }
64
- async function astGrepReferences(root, symbol, excludeFile) {
65
- const result = await runProcess('ast-grep', ['run', '-p', symbol, '--json', root], {
66
- cwd: root,
67
- timeoutMs: 15_000,
68
- maxOutputBytes: 512 * 1024
69
- }).catch(() => null);
70
- if (!result || result.code !== 0 || !result.stdout.trim())
71
- return [];
72
- const refs = [];
73
- try {
74
- const rows = JSON.parse(result.stdout);
75
- for (const row of Array.isArray(rows) ? rows : []) {
76
- const file = normalizePath(path.relative(root, String(row.file || row.path || '')));
77
- if (!file || file === excludeFile || shouldIgnorePath(file))
78
- continue;
79
- refs.push({
80
- symbol,
81
- file,
82
- line: Number(row.range?.start?.line || row.line || 1),
83
- text: String(row.text || row.lines || '').trim().slice(0, 240)
84
- });
85
- }
86
- }
87
- catch {
88
- return [];
89
- }
90
- return capReferences(refs);
91
- }
92
- async function ripgrepReferences(root, symbol, excludeFile) {
93
- const result = await runProcess('rg', ['-n', '--glob', '!node_modules', '--glob', '!.git', '--glob', '!dist', `\\b${escapeRegex(symbol)}\\b`, '.'], {
94
- cwd: root,
95
- timeoutMs: 15_000,
96
- maxOutputBytes: 512 * 1024
97
- }).catch(() => null);
98
- if (!result || (result.code !== 0 && !result.stdout))
99
- return [];
100
- return capReferences(String(result.stdout || '').split(/\r?\n/).flatMap((line) => {
101
- const match = line.match(/^(.+?):(\d+):(.*)$/);
102
- if (!match)
103
- return [];
104
- const file = normalizePath(match[1] || '');
105
- if (!file || file === excludeFile || shouldIgnorePath(file))
106
- return [];
107
- return [{ symbol, file, line: Number(match[2] || 1), text: String(match[3] || '').trim().slice(0, 240) }];
108
- }));
109
- }
110
- async function builtinReferences(root, symbol, excludeFile) {
111
- const files = await listFilesRecursive(root, { ignore: ['.git', 'node_modules', 'dist', '.sneakoscope/tmp', '.sneakoscope/arenas'], maxFiles: 30_000 });
112
- const word = new RegExp(`\\b${escapeRegex(symbol)}\\b`);
49
+ return { refs: [], provider: 'none' };
50
+ const symbolResp = await search({
51
+ schemaVersion: SEARCH_SCHEMA_VERSION,
52
+ mode: 'symbol',
53
+ root,
54
+ query: symbol,
55
+ include: ['**/*.{ts,tsx,js,jsx,mjs,cjs,json,md}'],
56
+ exclude: ['node_modules/**', 'dist/**', '.git/**'],
57
+ limits: { maxMatches: 500, timeoutMs: 15_000 }
58
+ });
113
59
  const refs = [];
114
- for (const abs of files) {
115
- const file = normalizePath(path.relative(root, abs));
116
- if (!TEXT_EXT_RE.test(file) || file === excludeFile || shouldIgnorePath(file))
60
+ for (const m of symbolResp.matches) {
61
+ const file = normalizePath(m.path);
62
+ if (!file || file === normalizedExclude || shouldIgnorePath(file))
117
63
  continue;
118
- const text = await readText(abs, '').catch(() => '');
119
- if (!word.test(String(text)))
64
+ const confidence = m.confidence;
65
+ if (confidence !== 'exact_definition' &&
66
+ confidence !== 'exact_reference' &&
67
+ confidence !== 'syntactic_reference' &&
68
+ confidence !== 'text_candidate' &&
69
+ confidence !== 'structure_match') {
120
70
  continue;
121
- const lines = String(text).split(/\r?\n/);
122
- let perFile = 0;
123
- for (let index = 0; index < lines.length && perFile < 50; index += 1) {
124
- if (!word.test(lines[index] || ''))
125
- continue;
126
- refs.push({ symbol, file, line: index + 1, text: String(lines[index] || '').trim().slice(0, 240) });
127
- perFile += 1;
128
71
  }
72
+ refs.push({
73
+ symbol,
74
+ file,
75
+ line: m.line || 1,
76
+ text: String(m.text || '').trim().slice(0, 240),
77
+ confidence
78
+ });
129
79
  }
130
- return capReferences(refs);
80
+ return { refs: capReferences(refs), provider: symbolResp.provider };
131
81
  }
132
82
  function capReferences(refs) {
133
83
  const perFile = new Map();
@@ -158,6 +108,3 @@ function shouldIgnorePath(file) {
158
108
  function normalizePath(value) {
159
109
  return String(value || '').replace(/\\/g, '/').replace(/^\.\/+/, '');
160
110
  }
161
- function escapeRegex(value) {
162
- return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
163
- }
@@ -1,6 +1,7 @@
1
1
  import fs from 'node:fs/promises';
2
2
  import path from 'node:path';
3
- import { ensureDir, listFilesRecursive, nowIso, readJson, readText, runProcess, which, writeJsonAtomic } from '../fsx.js';
3
+ import { ensureDir, nowIso, readJson, readText, runProcess, which, writeJsonAtomic } from '../fsx.js';
4
+ import { search, SEARCH_SCHEMA_VERSION } from '../search/index.js';
4
5
  import { readWrongnessLedger, writeWrongnessLedger } from '../triwiki-wrongness/wrongness-ledger.js';
5
6
  export async function compileMistakeRules(root) {
6
7
  const ledger = await readWrongnessLedger(root);
@@ -38,13 +39,24 @@ export async function runCompiledRules(root, changedFiles) {
38
39
  const rules = await readCompiledRules(root);
39
40
  if (!rules.length)
40
41
  return { ok: true, violations: [], rule_count: 0, skipped_reason: 'no_rules' };
41
- const files = changedFiles.length ? changedFiles : (await listFilesRecursive(root, { ignore: ['.git', 'node_modules', 'dist'], maxFiles: 2000 })).map((file) => path.relative(root, file));
42
+ const files = changedFiles.length
43
+ ? changedFiles
44
+ : (await search({
45
+ schemaVersion: SEARCH_SCHEMA_VERSION,
46
+ mode: 'files',
47
+ root,
48
+ exclude: ['.git/**', 'node_modules/**', 'dist/**'],
49
+ limits: { maxMatches: 2000, maxFiles: 2000 }
50
+ })).matches.map((m) => m.path);
42
51
  const astGrep = await which('ast-grep');
43
52
  const violations = [];
53
+ let skippedAstGrep = 0;
44
54
  for (const rule of rules) {
45
55
  if (rule.detector.kind === 'ast-grep') {
46
- if (!astGrep)
56
+ if (!astGrep) {
57
+ skippedAstGrep += 1;
47
58
  continue;
59
+ }
48
60
  violations.push(...await runAstGrepRule(root, rule, files));
49
61
  }
50
62
  else {
@@ -54,7 +66,8 @@ export async function runCompiledRules(root, changedFiles) {
54
66
  return {
55
67
  ok: !violations.some((violation) => violation.severity === 'error'),
56
68
  violations,
57
- rule_count: rules.length
69
+ rule_count: rules.length,
70
+ ...(skippedAstGrep ? { skipped_reason: `ast_grep_unavailable:skipped_rules=${skippedAstGrep}` } : {})
58
71
  };
59
72
  }
60
73
  async function readCompiledRules(root) {
@@ -1,6 +1,8 @@
1
1
  import path from 'node:path';
2
2
  import fsp from 'node:fs/promises';
3
3
  import { exists, nowIso, readJson, runProcess, writeJsonAtomic, writeTextAtomic } from './fsx.js';
4
+ import { escapeRegExp } from './text/regex.js';
5
+ import { RELEASE_UPGRADE_BASELINE_VERSION } from './release/release-upgrade-baseline.js';
4
6
  const VERSION_HOOK_MARKER = 'Sneakoscope Codex Version Guard';
5
7
  const VERSION_STATE_FILE = 'sks-version-state.json';
6
8
  const DEFAULT_BUMP = 'patch';
@@ -317,26 +319,10 @@ async function syncPackageLockVersions(root, version) {
317
319
  async function syncSourcePackageVersion(root, version) {
318
320
  const files = [];
319
321
  const replacements = [
320
- {
321
- rel: 'src/core/fsx.ts',
322
- replace: (text) => text.replace(/export const PACKAGE_VERSION = ['"][^'"]+['"];/, `export const PACKAGE_VERSION = '${version}';`)
323
- },
324
322
  {
325
323
  rel: 'src/core/version.ts',
326
324
  replace: (text) => text.replace(/export const PACKAGE_VERSION = ['"][^'"]+['"];/, `export const PACKAGE_VERSION = '${version}';`)
327
325
  },
328
- {
329
- rel: 'src/bin/sks.ts',
330
- replace: (text) => text.replace(/const FAST_PACKAGE_VERSION = ['"][^'"]+['"];/, `const FAST_PACKAGE_VERSION = '${version}';`)
331
- },
332
- {
333
- rel: 'src/core/managed-assets/managed-assets-manifest.ts',
334
- replace: (text) => text.replace(/export const MANAGED_ASSET_VERSION = ['"][^'"]+['"]/, `export const MANAGED_ASSET_VERSION = '${version}'`)
335
- },
336
- {
337
- rel: 'test/unit/agent-role-config.test.mjs',
338
- replace: (text) => text.replace(/assert\.equal\(manifest\.MANAGED_ASSET_VERSION, ['"][^'"]+['"]\)/, `assert.equal(manifest.MANAGED_ASSET_VERSION, '${version}')`)
339
- },
340
326
  {
341
327
  rel: 'crates/sks-core/Cargo.toml',
342
328
  replace: (text) => text.replace(/^version\s*=\s*"[^"]+"/m, `version = "${version}"`)
@@ -372,7 +358,7 @@ async function syncSourcePackageVersion(root, version) {
372
358
  .replace(/not represented as current \d+\.\d+\.\d+ completion proof\./g, `not represented as current ${version} completion proof.`)
373
359
  .replace(/^For \d+\.\d+\.\d+, a selected codex-lb/m, `For ${version}, a selected codex-lb`)
374
360
  .replace(/^The \d+\.\d+\.\d+ SKS menu bar/m, `The ${version} SKS menu bar`)
375
- .replace(/the 6\.2\.0 to \d+\.\d+\.\d+ upgrade smoke/g, `the 6.2.0 to ${version} upgrade smoke`)
361
+ .replace(/the \d+\.\d+\.\d+ to \d+\.\d+\.\d+ upgrade smoke/g, `the ${RELEASE_UPGRADE_BASELINE_VERSION} to ${version} upgrade smoke`)
376
362
  .replace(/under the \d+\.\d+\.\d+ release evidence root/g, `under the ${version} release evidence root`)
377
363
  .replace(/^Do not cut \d+\.\d+\.\d+ while/m, `Do not cut ${version} while`)
378
364
  .replace(/must agree on \d+\.\d+\.\d+\./g, `must agree on ${version}.`)
@@ -485,9 +471,6 @@ async function stageVersionFiles(root, files) {
485
471
  const result = await git(root, ['add', '--', ...existing]);
486
472
  return { ok: result.code === 0, relative_files: existing, stderr: result.stderr };
487
473
  }
488
- function escapeRegExp(value) {
489
- return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
490
- }
491
474
  function parseSemver(value) {
492
475
  const match = String(value || '').trim().match(/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/);
493
476
  if (!match)
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '7.1.0';
1
+ export const PACKAGE_VERSION = '7.3.0';
@@ -11,12 +11,20 @@ final class ControlCenterWindowController: NSWindowController, NSTableViewDataSo
11
11
  init(processClient: ProcessClient, operations: OperationCoordinator, notifications: NotificationCoordinator) {
12
12
  let overview = OverviewViewController(processClient: processClient, operations: operations)
13
13
  overviewController = overview
14
+ defer {
15
+ // Overview quick navigation: section names only, so the standalone
16
+ // Overview compile harness never needs the SidebarItem type.
17
+ overview.openSection = { [weak self] name in
18
+ guard let item = SidebarItem.allCases.first(where: { $0.rawValue == name }) else { return }
19
+ self?.show(section: item)
20
+ }
21
+ }
14
22
  controllers = [
15
23
  .overview: overview,
16
24
  .updates: UpdatesViewController(processClient: processClient, operations: operations, notifications: notifications),
17
25
  .mcpServers: MCPServersViewController(processClient: processClient, operations: operations, notifications: notifications),
18
26
  .providers: ProvidersViewController(processClient: processClient, operations: operations),
19
- .remoteTelegram: RemoteTelegramViewController(processClient: processClient),
27
+ .remoteTelegram: RemoteTelegramViewController(processClient: processClient, operations: operations),
20
28
  .diagnostics: DiagnosticsViewController(processClient: processClient, operations: operations),
21
29
  .settings: SettingsViewController(notifications: notifications)
22
30
  ]
@@ -86,9 +94,21 @@ final class ControlCenterWindowController: NSWindowController, NSTableViewDataSo
86
94
  func numberOfRows(in tableView: NSTableView) -> Int { SidebarItem.allCases.count }
87
95
 
88
96
  func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
89
- let field = NSTextField(labelWithString: SidebarItem.allCases[row].rawValue)
97
+ let item = SidebarItem.allCases[row]
98
+ let field = NSTextField(labelWithString: item.rawValue)
90
99
  field.font = NSFont.systemFont(ofSize: 13, weight: .medium)
91
- return field
100
+ let icon = NSImageView()
101
+ icon.image = NSImage(systemSymbolName: item.symbolName, accessibilityDescription: nil)
102
+ icon.contentTintColor = .secondaryLabelColor
103
+ icon.setAccessibilityHidden(true)
104
+ icon.widthAnchor.constraint(equalToConstant: 18).isActive = true
105
+ let cell = NSStackView(views: [icon, field])
106
+ cell.orientation = .horizontal
107
+ cell.alignment = .centerY
108
+ cell.spacing = 7
109
+ cell.edgeInsets = NSEdgeInsets(top: 0, left: 6, bottom: 0, right: 0)
110
+ cell.setAccessibilityLabel(item.rawValue)
111
+ return cell
92
112
  }
93
113
 
94
114
  func tableViewSelectionDidChange(_ notification: Notification) {
@@ -0,0 +1,102 @@
1
+ import Cocoa
2
+
3
+ /// Shared visual components for Control Center pages.
4
+ ///
5
+ /// Not referenced from the standalone-compiled units (OverviewViewController,
6
+ /// OperationCoordinator, ProcessClient, NotificationCoordinator) — their swiftc
7
+ /// test harnesses compile without this file.
8
+ enum ControlKitTone {
9
+ case ok, warning, error, neutral, busy
10
+
11
+ var color: NSColor {
12
+ switch self {
13
+ case .ok: return .systemGreen
14
+ case .warning: return .systemOrange
15
+ case .error: return .systemRed
16
+ case .neutral: return .secondaryLabelColor
17
+ case .busy: return .systemBlue
18
+ }
19
+ }
20
+ }
21
+
22
+ enum ControlKit {
23
+ /// Small colored dot + short state text, for scannable card status lines.
24
+ static func badge(_ text: String, tone: ControlKitTone) -> NSView {
25
+ let dot = NSTextField(labelWithString: "●")
26
+ dot.font = NSFont.systemFont(ofSize: 10)
27
+ dot.textColor = tone.color
28
+ dot.setAccessibilityHidden(true)
29
+ let label = NSTextField(labelWithString: text)
30
+ label.font = NSFont.systemFont(ofSize: 12, weight: .medium)
31
+ label.setAccessibilityLabel(text)
32
+ let row = NSStackView(views: [dot, label])
33
+ row.orientation = .horizontal
34
+ row.alignment = .centerY
35
+ row.spacing = 5
36
+ return row
37
+ }
38
+
39
+ /// Update an existing badge row produced by `badge(_:tone:)` in place.
40
+ static func setBadge(_ view: NSView, text: String, tone: ControlKitTone) {
41
+ guard let row = view as? NSStackView, row.arrangedSubviews.count >= 2,
42
+ let dot = row.arrangedSubviews[0] as? NSTextField,
43
+ let label = row.arrangedSubviews[1] as? NSTextField else { return }
44
+ dot.textColor = tone.color
45
+ label.stringValue = text
46
+ label.setAccessibilityLabel(text)
47
+ }
48
+
49
+ /// Fixed-width key + wrapping value row for status details.
50
+ static func keyValueRow(_ key: String, _ value: NSTextField) -> NSStackView {
51
+ let keyLabel = NSTextField(labelWithString: key)
52
+ keyLabel.font = NSFont.systemFont(ofSize: 12, weight: .medium)
53
+ keyLabel.textColor = .secondaryLabelColor
54
+ keyLabel.setContentHuggingPriority(.required, for: .horizontal)
55
+ keyLabel.widthAnchor.constraint(greaterThanOrEqualToConstant: 92).isActive = true
56
+ let row = NSStackView(views: [keyLabel, value])
57
+ row.orientation = .horizontal
58
+ row.alignment = .firstBaseline
59
+ row.spacing = 8
60
+ return row
61
+ }
62
+
63
+ /// The page's single recommended action: default-button prominence (Return key).
64
+ static func primaryButton(_ title: String, target: AnyObject, action: Selector) -> NSButton {
65
+ let button = NSButton(title: title, target: target, action: action)
66
+ button.bezelStyle = .rounded
67
+ button.keyEquivalent = "\r"
68
+ button.setAccessibilityLabel(title)
69
+ return button
70
+ }
71
+
72
+ /// Page header: large title + one-line subtitle, replacing per-page ad hoc stacks.
73
+ static func header(_ title: String, _ subtitle: String) -> NSStackView {
74
+ let heading = NSTextField(labelWithString: title)
75
+ heading.font = NSFont.systemFont(ofSize: 18, weight: .semibold)
76
+ let detail = NSTextField(wrappingLabelWithString: subtitle)
77
+ detail.font = NSFont.systemFont(ofSize: 12)
78
+ detail.textColor = .secondaryLabelColor
79
+ let stack = NSStackView(views: [heading, detail])
80
+ stack.orientation = .vertical
81
+ stack.alignment = .leading
82
+ stack.spacing = 4
83
+ return stack
84
+ }
85
+
86
+ /// Horizontal action row that keeps a visual gap between the primary
87
+ /// action group and trailing (destructive or rarely used) actions.
88
+ static func actionRow(_ leading: [NSView], trailing: [NSView] = []) -> NSStackView {
89
+ let row = NSStackView(views: leading)
90
+ row.orientation = .horizontal
91
+ row.alignment = .centerY
92
+ row.spacing = 8
93
+ if !trailing.isEmpty {
94
+ let spacer = NSView()
95
+ spacer.setContentHuggingPriority(.defaultLow, for: .horizontal)
96
+ spacer.widthAnchor.constraint(greaterThanOrEqualToConstant: 24).isActive = true
97
+ row.addArrangedSubview(spacer)
98
+ for view in trailing { row.addArrangedSubview(view) }
99
+ }
100
+ return row
101
+ }
102
+ }
@@ -15,17 +15,29 @@ final class DiagnosticsViewController: NSViewController, ControlCenterPage {
15
15
  required init?(coder: NSCoder) { nil }
16
16
 
17
17
  override func loadView() {
18
- let buttons = NSStackView(views: [
19
- NativeView.button("Run Doctor", target: self, action: #selector(doctor)),
20
- NativeView.button("Update Codex CLI", target: self, action: #selector(updateCodexCLI)),
21
- NativeView.button("Open Last Log", target: self, action: #selector(openLog)),
22
- NativeView.button("Restart Menu Bar", target: self, action: #selector(restart))
23
- ])
24
- buttons.orientation = .horizontal; buttons.spacing = 8
25
- view = NativeView.stack([
26
- NativeView.title("Diagnostics"),
27
- NativeView.detail("Diagnostic output is bounded, redacted, and written with owner-only permissions. Use this page when another Center action reports a blocker. Feature routes that need newer Codex fail with an update CTA instead of locking all of SKS."),
28
- status, codexGuidance, buttons
18
+ let healthCard = NativeView.card(
19
+ title: "Health checks",
20
+ subtitle: "Doctor verifies and repairs the local SKS, Codex, and provider configuration.",
21
+ views: [status, NativeView.row([
22
+ ControlKit.primaryButton("Run Doctor", target: self, action: #selector(doctor)),
23
+ NativeView.button("Open Last Log", target: self, action: #selector(openLog))
24
+ ])]
25
+ )
26
+ let codexCard = NativeView.card(
27
+ title: "Codex CLI",
28
+ subtitle: "SKS stays version-agnostic; features capability-gate on the installed Codex.",
29
+ views: [codexGuidance, NativeView.row([
30
+ NativeView.button("Update Codex CLI", target: self, action: #selector(updateCodexCLI))
31
+ ])]
32
+ )
33
+ let menuBarCard = NativeView.card(
34
+ title: "Menu Bar app",
35
+ subtitle: "Restart the Control Center process itself when it looks stale.",
36
+ views: [NativeView.row([NativeView.button("Restart Menu Bar", target: self, action: #selector(restart))])]
37
+ )
38
+ view = NativeView.page([
39
+ ControlKit.header("Diagnostics", "Diagnostic output is bounded, redacted, and written with owner-only permissions. Use this page when another Center action reports a blocker. Feature routes that need newer Codex fail with an update CTA instead of locking all of SKS."),
40
+ healthCard, codexCard, menuBarCard
29
41
  ])
30
42
  refreshOnAppear()
31
43
  }
@@ -105,14 +105,18 @@ final class MCPServersViewController: NSViewController, NSTableViewDataSource, N
105
105
  scopePopup.target = self; scopePopup.action = #selector(scopeChanged); scopePopup.setAccessibilityLabel("MCP inventory scope")
106
106
  let scopeRow = NSStackView(views: [NSTextField(labelWithString: "View:"), scopePopup])
107
107
  scopeRow.orientation = .horizontal; scopeRow.spacing = 8
108
- let primary = NSStackView(views: [addButton, editButton, duplicateButton, toggleButton, removeButton])
109
- primary.orientation = .horizontal; primary.spacing = 8
108
+ // Destructive Remove sits apart from routine edit actions; connection
109
+ // and maintenance actions live on their own labeled row.
110
+ let primary = ControlKit.actionRow([addButton, editButton, duplicateButton, toggleButton], trailing: [removeButton])
111
+ let manageLabel = NSTextField(labelWithString: "Manage"); manageLabel.textColor = .secondaryLabelColor
112
+ let connectLabel = NSTextField(labelWithString: "Connection"); connectLabel.textColor = .secondaryLabelColor
113
+ for label in [manageLabel, connectLabel] { label.font = NSFont.systemFont(ofSize: 11, weight: .medium) }
110
114
  let secondary = NSStackView(views: [testButton, oauthButton, legacySecretButton, backupsButton, refreshButton])
111
115
  secondary.orientation = .horizontal; secondary.spacing = 8
112
116
  view = NativeView.stack([
113
117
  NativeView.title("MCP Servers"),
114
118
  NativeView.detail("Inspect global, trusted-project, or effective configuration. Effective and plugin entries are read-only until an exact writable scope is selected. New authentication uses OAuth or environment-variable names only."),
115
- scopeRow, scroll, status, primary, secondary
119
+ scopeRow, scroll, status, manageLabel, primary, connectLabel, secondary
116
120
  ])
117
121
  updateButtons(); refresh()
118
122
  }
@@ -1,5 +1,21 @@
1
1
  import Foundation
2
2
 
3
+ // SKS CLI timestamps come from JavaScript Date.toISOString() and carry
4
+ // fractional seconds ("2026-07-24T00:00:00.000Z"), which the default
5
+ // ISO8601DateFormatter options cannot parse. Try fractional first, then plain.
6
+ enum SKSTimestamp {
7
+ private static let fractional: ISO8601DateFormatter = {
8
+ let formatter = ISO8601DateFormatter()
9
+ formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
10
+ return formatter
11
+ }()
12
+ private static let plain = ISO8601DateFormatter()
13
+
14
+ static func date(from value: String) -> Date? {
15
+ fractional.date(from: value) ?? plain.date(from: value)
16
+ }
17
+ }
18
+
3
19
  enum OperationState: String, Codable {
4
20
  case queued, running, waitingForConfirmation, succeeded, failed, cancelled, terminalUncertain
5
21
  }
@@ -68,7 +84,7 @@ final class OperationCoordinator {
68
84
  static let updateStageOrder = [
69
85
  "preflight", "download_or_registry_check", "temporary_install_smoke", "global_install",
70
86
  "resolve_new_binary", "version_probe", "new_version_doctor", "hook_trust_repair",
71
- "global_skills_reconcile", "native_capability_setup", "menubar_rebuild",
87
+ "project_receipt", "global_skills_reconcile", "native_capability_setup", "menubar_rebuild",
72
88
  "menubar_signature_verify", "final_self_verification", "snapshot_refresh"
73
89
  ]
74
90
  private let directory: URL
@@ -56,21 +56,15 @@ enum NativeView {
56
56
 
57
57
  static func row(_ views: [NSView], spacing: CGFloat = 8) -> NSStackView {
58
58
  let row = NSStackView(views: views)
59
- row.orientation = .horizontal
60
- row.alignment = .centerY
61
- row.spacing = spacing
59
+ row.orientation = .horizontal; row.alignment = .centerY; row.spacing = spacing
62
60
  return row
63
61
  }
64
62
 
65
63
  static func card(title: String, subtitle: String, views: [NSView]) -> NSBox {
66
64
  let box = NSBox()
67
- box.boxType = .custom
68
- box.titlePosition = .noTitle
69
- box.cornerRadius = 10
70
- box.borderWidth = 1
71
- box.borderColor = .separatorColor
72
- box.fillColor = .controlBackgroundColor
73
-
65
+ box.boxType = .custom; box.titlePosition = .noTitle
66
+ box.cornerRadius = 10; box.borderWidth = 1
67
+ box.borderColor = .separatorColor; box.fillColor = .controlBackgroundColor
74
68
  let heading = sectionTitle(title)
75
69
  let help = detail(subtitle)
76
70
  let content = NSStackView(views: [heading, help] + views)
@@ -122,9 +116,7 @@ enum NativeView {
122
116
  }
123
117
 
124
118
  static func redactPreview(_ output: String, limit: Int = 160) -> String {
125
- let compact = output
126
- .replacingOccurrences(of: "\n", with: " ")
127
- .trimmingCharacters(in: .whitespacesAndNewlines)
119
+ let compact = output.replacingOccurrences(of: "\n", with: " ").trimmingCharacters(in: .whitespacesAndNewlines)
128
120
  guard !compact.isEmpty else { return "No public detail was returned." }
129
121
  if compact.count <= limit { return compact }
130
122
  return String(compact.prefix(limit)) + "…"
@@ -301,6 +293,8 @@ final class OverviewViewController: NSViewController, ControlCenterPage {
301
293
  private var doctorButton: NSButton!
302
294
  private var refreshButton: NSButton!
303
295
  private var updateCodexButton: NSButton!
296
+ /// Section navigation by sidebar title, wired by ControlCenterWindowController.
297
+ var openSection: ((String) -> Void)?
304
298
 
305
299
  init(processClient: ProcessClient, operations: OperationCoordinator) {
306
300
  self.processClient = processClient
@@ -317,16 +311,29 @@ final class OverviewViewController: NSViewController, ControlCenterPage {
317
311
  let buttons = NSStackView(views: [doctorButton, refreshButton, updateCodexButton])
318
312
  buttons.orientation = .horizontal
319
313
  buttons.spacing = 8
314
+ let shortcuts = NSStackView(views: [
315
+ NativeView.button("Providers…", target: self, action: #selector(openProviders)),
316
+ NativeView.button("Updates…", target: self, action: #selector(openUpdates)),
317
+ NativeView.button("Diagnostics…", target: self, action: #selector(openDiagnostics))
318
+ ])
319
+ shortcuts.orientation = .horizontal
320
+ shortcuts.spacing = 8
321
+ shortcuts.setAccessibilityLabel("Open Control Center sections")
320
322
  view = NativeView.stack([
321
323
  NativeView.title("Overview"),
322
324
  NativeView.detail("Menu Bar build \(AppRuntime.packageVersion) · Local health for SKS, Codex CLI, MCP, Remote, and operations. Prefer the latest Codex CLI; SKS stays version-agnostic and capability-gates features."),
323
325
  status,
324
326
  notificationInbox,
325
- buttons
327
+ buttons,
328
+ shortcuts
326
329
  ])
327
330
  loadStatus(forceUpdateRefresh: false)
328
331
  }
329
332
 
333
+ @objc private func openProviders() { openSection?("Providers") }
334
+ @objc private func openUpdates() { openSection?("Updates") }
335
+ @objc private func openDiagnostics() { openSection?("Diagnostics") }
336
+
330
337
  func refreshOnAppear() {
331
338
  loadStatus(forceUpdateRefresh: false)
332
339
  }
@@ -466,7 +473,7 @@ final class OverviewViewController: NSViewController, ControlCenterPage {
466
473
 
467
474
  private func recentOperationSummary(_ operation: OperationSnapshot?) -> String {
468
475
  guard let operation = operation else { return "None recorded" }
469
- guard let updatedAt = ISO8601DateFormatter().date(from: operation.updatedAt) else {
476
+ guard let updatedAt = SKSTimestamp.date(from: operation.updatedAt) else {
470
477
  return "\(operation.kind) · \(operation.state.rawValue) · \(operation.publicSummary)"
471
478
  }
472
479
  let age = Date().timeIntervalSince(updatedAt)
@@ -131,7 +131,7 @@ final class ProcessClient {
131
131
  }
132
132
 
133
133
  private func sensitiveStdinValues(arguments: [String], stdin: String?) -> [String] {
134
- guard arguments.contains("--api-key-stdin"), let stdin = stdin else { return [] }
134
+ guard (arguments.contains("--api-key-stdin") || arguments.contains("--bot-token-stdin")), let stdin = stdin else { return [] }
135
135
  let normalized = stdin.trimmingCharacters(in: .whitespacesAndNewlines)
136
136
  guard !normalized.isEmpty else { return [] }
137
137
  return normalized == stdin ? [normalized] : [normalized, stdin]
@@ -139,10 +139,20 @@ final class ProcessClient {
139
139
 
140
140
  private func publicOutput(_ value: String, code: Int32, sensitiveValues: [String]) -> String {
141
141
  let redacted = redact(value, sensitiveValues: sensitiveValues)
142
- guard !sensitiveValues.isEmpty else { return redacted }
143
- return code == 0
144
- ? "Secure input operation completed. Child output was suppressed."
145
- : "Secure input operation failed with exit code \(code). Child output was suppressed."
142
+ guard sensitiveValues.isEmpty else {
143
+ return code == 0
144
+ ? "Secure input operation completed. Child output was suppressed."
145
+ : "Secure input operation failed with exit code \(code). Child output was suppressed."
146
+ }
147
+ return extractJsonPayload(redacted)
148
+ }
149
+
150
+ /// stdout+stderr are merged; keep the JSON object when Node prints warnings first.
151
+ private func extractJsonPayload(_ value: String) -> String {
152
+ let text = value.trimmingCharacters(in: .whitespacesAndNewlines)
153
+ if text.first == "{" || text.first == "[" { return text }
154
+ guard let start = text.firstIndex(of: "{"), let end = text.lastIndex(of: "}") else { return text }
155
+ return String(text[start...end])
146
156
  }
147
157
 
148
158
  private func writeLog(command: [String], output: String, sensitiveValues: [String] = []) {