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
@@ -7,11 +7,13 @@ import { CODEX_CHROME_EXTENSION_DOC_URL, DEFAULT_CODEX_APP_PLUGINS as DEFAULT_CO
7
7
  import { PRODUCT_DESIGN_PLUGIN, normalizeProductDesignPluginEvidence } from './product-design-plugin.js';
8
8
  import { PRODUCT_DESIGN_AUTO_INSTALL_ENV, ensureProductDesignPluginInstalled, productDesignAutoInstallRequested } from './product-design-app-server.js';
9
9
  import { GLM_CODEX_CONFIG_PROVIDER_ID, GLM_52_OPENROUTER_MODEL, RETIRED_GLM_DESKTOP_CONFIG_PROFILE_IDS } from './codex-app/openrouter-provider.js';
10
+ import { sksOpenRouterCatalogPath } from './codex-app/codex-model-catalog.js';
10
11
  import { resolveOpenRouterApiKey } from './providers/openrouter/openrouter-secret-store.js';
11
12
  import { codexLbEnvPath, loadCodexLbEnv, parseShellEnvValue, readCodexLbModelCatalog } from './codex-lb/codex-lb-env.js';
12
13
  import { codexLbToolCatalogPath, inspectCodexLbToolCatalog } from './codex-lb/codex-lb-tool-catalog.js';
13
14
  import { isSksOwnedGlobalUiLock } from './codex-app/codex-app-ui-state-snapshot.js';
14
15
  import { redactString } from './secret-redaction.js';
16
+ import { escapeRegExp } from './text/regex.js';
15
17
  export const CODEX_APP_DOCS_URL = 'https://developers.openai.com/codex/app/features';
16
18
  export const CODEX_CHANGELOG_URL = 'https://developers.openai.com/codex/changelog';
17
19
  export const CODEX_ACCESS_TOKENS_DOCS_URL = 'https://developers.openai.com/codex/enterprise/access-tokens';
@@ -944,6 +946,8 @@ export async function codexProviderModelUiStatus(opts = {}) {
944
946
  && hasTomlBoolean(codexLbProvider, 'supports_websockets', true)
945
947
  && hasTomlBoolean(codexLbProvider, 'requires_openai_auth', true);
946
948
  const codexLbSelectedDefault = /(?:^|\n)\s*model_provider\s*=\s*"codex-lb"\s*(?:#.*)?(?=\n|$)/.test(topLevelToml(globalConfig));
949
+ const selectedProviderValue = topLevelToml(globalConfig)
950
+ .match(/(?:^|\n)\s*model_provider\s*=\s*"([^"]+)"\s*(?:#.*)?(?=\n|$)/)?.[1] || null;
947
951
  const managedCatalogPath = codexLbToolCatalogPath(path.join(home || '', '.codex'));
948
952
  const configuredCatalogPath = topLevelToml(globalConfig).match(/(?:^|\n)\s*model_catalog_json\s*=\s*"([^"]+)"\s*(?:#.*)?(?=\n|$)/)?.[1] || '';
949
953
  const managedCatalogConfigured = Boolean(configuredCatalogPath)
@@ -995,10 +999,30 @@ export async function codexProviderModelUiStatus(opts = {}) {
995
999
  ? ['codex_lb_gpt_5_6_catalog_unverified']
996
1000
  : [])
997
1001
  ];
998
- const selectedProviderBlockers = codexLbSelectedDefault ? codexLbBlockers : [];
1002
+ const openRouterSelectedDefault = selectedProviderValue === GLM_CODEX_CONFIG_PROVIDER_ID;
1003
+ const openRouterManagedCatalogPath = sksOpenRouterCatalogPath({ home });
1004
+ const openRouterCatalogBound = Boolean(configuredCatalogPath)
1005
+ && path.resolve(configuredCatalogPath) === path.resolve(openRouterManagedCatalogPath);
1006
+ const openRouterCatalogDangling = openRouterCatalogBound && !openRouterSelectedDefault;
1007
+ const openRouterSelectedBlockers = openRouterSelectedDefault
1008
+ ? [
1009
+ ...glmBlockers,
1010
+ ...(openRouterCatalogBound ? [] : ['openrouter_model_catalog_json_unselected'])
1011
+ ]
1012
+ : [];
1013
+ const selectedProviderBlockers = [
1014
+ ...(codexLbSelectedDefault
1015
+ ? codexLbBlockers
1016
+ : openRouterSelectedDefault
1017
+ ? openRouterSelectedBlockers
1018
+ : []),
1019
+ ...(openRouterCatalogDangling ? ['openrouter_model_catalog_json_dangling'] : [])
1020
+ ];
999
1021
  const optionalProviderBlockers = codexLbSelectedDefault
1000
1022
  ? glmBlockers
1001
- : [...glmBlockers, ...codexLbBlockers];
1023
+ : openRouterSelectedDefault
1024
+ ? codexLbBlockers
1025
+ : [...glmBlockers, ...codexLbBlockers];
1002
1026
  const keyCommand = 'sks codex-app set-openrouter-key --api-key-stdin';
1003
1027
  const installCommand = 'sks codex-app use-openrouter --model z-ai/glm-5.2';
1004
1028
  const setupCommand = 'sks codex-lb setup --host <domain> --api-key-stdin --yes';
@@ -1007,7 +1031,7 @@ export async function codexProviderModelUiStatus(opts = {}) {
1007
1031
  schema: 'sks.codex-app-provider-model-ui.v1',
1008
1032
  ok: selectedProviderBlockers.length === 0,
1009
1033
  selected_provider_ok: selectedProviderBlockers.length === 0,
1010
- selected_provider: codexLbSelectedDefault ? 'codex-lb' : 'oauth',
1034
+ selected_provider: codexLbSelectedDefault ? 'codex-lb' : (selectedProviderValue || 'oauth'),
1011
1035
  selected_provider_blockers: selectedProviderBlockers,
1012
1036
  optional_provider_blockers: optionalProviderBlockers,
1013
1037
  checked: true,
@@ -1030,6 +1054,9 @@ export async function codexProviderModelUiStatus(opts = {}) {
1030
1054
  openrouter_key_present: Boolean(openRouterKey.key),
1031
1055
  openrouter_key_source: openRouterKey.source || null,
1032
1056
  openrouter_key_preview: openRouterKey.key_preview || null,
1057
+ openrouter_selected: openRouterSelectedDefault,
1058
+ model_catalog_json_configured: openRouterCatalogBound,
1059
+ model_catalog_json_path: openRouterManagedCatalogPath,
1033
1060
  key_command: keyCommand,
1034
1061
  install_command: installCommand,
1035
1062
  doctor_command: 'sks codex-app openrouter-status',
@@ -1197,9 +1224,6 @@ function hasTomlBoolean(text = '', key = '', value) {
1197
1224
  const re = new RegExp(`(?:^|\\n)\\s*${escapeRegExp(key)}\\s*=\\s*${expected}\\s*(?:#.*)?(?=\\n|$)`);
1198
1225
  return re.test(String(text || ''));
1199
1226
  }
1200
- function escapeRegExp(text = '') {
1201
- return String(text).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1202
- }
1203
1227
  function remoteControlGuidance(status = {}) {
1204
1228
  if (!status.codex_cli?.ok)
1205
1229
  return 'Codex remote-control requires Codex CLI 0.130.0+. Install with: npm i -g @openai/codex@latest';
@@ -1,5 +1,6 @@
1
1
  import { codexHookEventName } from './codex-schema-snapshot.js';
2
2
  import { codexHookIssuesByCategory, dedupeCodexHookIssues, makeCodexHookIssue } from './codex-hook-issues.js';
3
+ import { asRecordOrNull as asRecord } from '../json/records.js';
3
4
  const LEGACY_TOP_LEVEL_KEYS = new Set([
4
5
  'permissionDecision',
5
6
  'permissionDecisionReason',
@@ -215,9 +216,6 @@ function result(event, issues) {
215
216
  reason: uniqueFatal[0] || null
216
217
  };
217
218
  }
218
- function asRecord(value) {
219
- return value && typeof value === 'object' && !Array.isArray(value) ? value : null;
220
- }
221
219
  function nonEmpty(value) {
222
220
  return typeof value === 'string' && value.trim().length > 0;
223
221
  }
@@ -88,8 +88,33 @@ export class CodexAppServerV2Client {
88
88
  });
89
89
  }
90
90
  async waitForTurnCompletion(threadId, turnId, timeoutMs = this.timeoutMs) {
91
- const expected = turnId ? ['turn/completed', 'thread/closed', 'thread/status/changed'] : ['turn/completed', 'thread/closed'];
92
- return await this.waitForNotification(expected, timeoutMs);
91
+ const buffered = this.notifications.find((event) => isTurnCompletionEvent(event, threadId, turnId));
92
+ if (buffered)
93
+ return buffered;
94
+ return new Promise((resolve, reject) => {
95
+ const timer = setTimeout(() => {
96
+ dispose();
97
+ reject(new Error(`Timed out waiting for app-server turn completion: ${threadId}:${turnId ?? '*'}`));
98
+ }, timeoutMs);
99
+ timer.unref?.();
100
+ const dispose = this.onEvent((event) => {
101
+ const method = String(event.method || '');
102
+ const params = event.params && typeof event.params === 'object'
103
+ ? event.params
104
+ : {};
105
+ if (method === 'thread/closed' && String(params.threadId || '') === threadId) {
106
+ clearTimeout(timer);
107
+ dispose();
108
+ reject(new Error(`Codex thread closed before turn completion: ${threadId}`));
109
+ return;
110
+ }
111
+ if (!isTurnCompletionEvent(event, threadId, turnId))
112
+ return;
113
+ clearTimeout(timer);
114
+ dispose();
115
+ resolve(event);
116
+ });
117
+ });
93
118
  }
94
119
  start() {
95
120
  if (this.child)
@@ -292,3 +317,15 @@ function jsonRpcErrorMessage(method, error) {
292
317
  return `${method}: ${String(error.message)}`;
293
318
  return `${method}: ${JSON.stringify(error)}`;
294
319
  }
320
+ function isTurnCompletionEvent(event, threadId, turnId) {
321
+ if (String(event.method || '') !== 'turn/completed')
322
+ return false;
323
+ const params = event.params && typeof event.params === 'object'
324
+ ? event.params
325
+ : {};
326
+ const completedTurn = params.turn && typeof params.turn === 'object'
327
+ ? params.turn
328
+ : {};
329
+ return String(params.threadId || '') === threadId
330
+ && (!turnId || String(completedTurn.id || params.turnId || '') === turnId);
331
+ }
@@ -1,6 +1,7 @@
1
1
  import path from 'node:path';
2
2
  import os from 'node:os';
3
3
  import { exists, readJson, readText, runProcess, which } from '../fsx.js';
4
+ import { escapeRegExp } from '../text/regex.js';
4
5
  const KEYCHAIN_WRITER_SWIFT = `import Foundation
5
6
  import Security
6
7
  let a=CommandLine.arguments[1],s=CommandLine.arguments[2]
@@ -389,6 +390,3 @@ async function sha256Full(value) {
389
390
  function redactSecret(text, secret) {
390
391
  return String(text || '').split(String(secret || '')).join('[redacted]');
391
392
  }
392
- function escapeRegExp(value) {
393
- return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
394
- }
@@ -20,14 +20,16 @@ const REQUIRED_CODEX_0144_MODEL_FIELDS = {
20
20
  supported_in_api: ['boolean'],
21
21
  priority: ['number'],
22
22
  base_instructions: ['string'],
23
- supports_reasoning_summaries: ['boolean'],
24
23
  support_verbosity: ['boolean'],
25
24
  truncation_policy: ['object'],
26
25
  supports_parallel_tool_calls: ['boolean'],
27
26
  experimental_supported_tools: ['array']
28
27
  };
28
+ const REASONING_SUMMARY_FIELD_NAMES = ['supports_reasoning_summaries', 'supports_reasoning_summary_parameter'];
29
29
  const CODEX_0144_MODEL_FIELD_TYPES = {
30
30
  ...REQUIRED_CODEX_0144_MODEL_FIELDS,
31
+ supports_reasoning_summaries: ['boolean'],
32
+ supports_reasoning_summary_parameter: ['boolean'],
31
33
  description: ['string'],
32
34
  default_reasoning_level: ['string'],
33
35
  additional_speed_tiers: ['array'],
@@ -357,6 +359,9 @@ function validateCodex0144Model(row, index) {
357
359
  if (!allowedTypes.includes(valueType(row[field])))
358
360
  issues.push(`codex_lb_model_catalog_field_type_invalid:${index}:${field}`);
359
361
  }
362
+ if (!REASONING_SUMMARY_FIELD_NAMES.some((field) => Object.prototype.hasOwnProperty.call(row, field))) {
363
+ issues.push(`codex_lb_model_catalog_required_field_missing:${index}:supports_reasoning_summaries`);
364
+ }
360
365
  for (const [field, value] of Object.entries(row)) {
361
366
  if (!(CODEX_0144_MODEL_FIELD_TYPES[field] || []).includes(valueType(value)))
362
367
  issues.push(`codex_lb_model_catalog_field_type_invalid:${index}:${field}`);
@@ -16,6 +16,8 @@ import { MANAGED_OFFICIAL_SUBAGENT_ROLES, MANAGED_SKILLS, managedOfficialSubagen
16
16
  import { buildMcpPluginServerCandidates } from '../mcp/mcp-plugin-inventory.js';
17
17
  import { codexNativeFeatureState, computeCodexNativeInvocationDefaults } from './codex-native-feature-matrix.js';
18
18
  import { currentCodexSkillRoots, currentSksSkillName, resolveAuthoritativeSksSkillSources } from './sks-skill-paths.js';
19
+ import { messageOf } from '../errors/message.js';
20
+ import { isRecord } from '../json/records.js';
19
21
  const REPORT_PATH = '.sneakoscope/reports/codex-native-feature-matrix.json';
20
22
  const REQUIRED_SKILL_NAMES = MANAGED_SKILLS.map((skill) => currentSksSkillName(skill.id));
21
23
  const REQUIRED_AGENT_ROLES = MANAGED_OFFICIAL_SUBAGENT_ROLES.map((role) => role.id);
@@ -396,9 +398,3 @@ function codex0144State(capability, key) {
396
398
  input.unavailableStatus = 'fallback';
397
399
  return codexNativeFeatureState(input);
398
400
  }
399
- function isRecord(value) {
400
- return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
401
- }
402
- function messageOf(err) {
403
- return err instanceof Error ? err.message : String(err);
404
- }
@@ -6,6 +6,7 @@ import { buildCodexPluginInventory } from '../codex-plugins/codex-plugin-json.js
6
6
  import { inspectConfinedPath, isLexicallyConfined } from '../managed-path-safety.js';
7
7
  import { currentCodexSkillRoots } from './sks-skill-paths.js';
8
8
  import { writeRootConfinedJsonReport } from './confined-report-writer.js';
9
+ import { messageOf } from '../errors/message.js';
9
10
  const RESERVED_EXTERNAL_ROUTE_SKILLS = ['ulw-loop', 'ulw-plan', 'start-work'];
10
11
  export async function buildCodexNativeInteropPolicy(input) {
11
12
  const root = path.resolve(input.root);
@@ -64,9 +65,6 @@ function normalizeInventory(value) {
64
65
  blockers: Array.isArray(record.blockers) ? record.blockers.map(String) : []
65
66
  };
66
67
  }
67
- function messageOf(err) {
68
- return err instanceof Error ? err.message : String(err);
69
- }
70
68
  async function discoverSkillNames(roots) {
71
69
  const names = new Set();
72
70
  const blockers = new Set();
@@ -1,6 +1,7 @@
1
1
  import fs from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
  import { exists, nowIso, runProcess, sha256, writeJsonAtomic } from '../fsx.js';
4
+ import { messageOf } from '../errors/message.js';
4
5
  export async function ensureCodexNativeReferenceSnapshot(input) {
5
6
  const root = path.resolve(input.root);
6
7
  const cacheDir = path.join(root, '.sneakoscope', 'cache', 'codex-native-reference');
@@ -92,6 +93,3 @@ async function gitSha(sourceDir) {
92
93
  const sha = run?.code === 0 ? `${run.stdout || ''}`.trim() : '';
93
94
  return /^[0-9a-f]{40}$/i.test(sha) ? sha : null;
94
95
  }
95
- function messageOf(err) {
96
- return err instanceof Error ? err.message : String(err);
97
- }
@@ -3,6 +3,7 @@ import path from 'node:path';
3
3
  import { createHash } from 'node:crypto';
4
4
  import { nowIso, writeJsonAtomic, writeTextAtomic } from '../fsx.js';
5
5
  import { ensureCodexNativeReferenceSnapshot } from './codex-native-reference-cache.js';
6
+ import { messageOf } from '../errors/message.js';
6
7
  const PATTERNS = [
7
8
  { id: 'no-global-optional-tooling', claim: 'optional tooling avoids mandatory global install', re: /\bnpx\b|no[- ]global|global install/i },
8
9
  { id: 'plugin-lifecycle-state-separation', claim: 'plugin install state is separated from approval/readiness', re: /\bplugin\b.+\b(install|enable|marketplace|lifecycle)\b/i },
@@ -143,6 +144,3 @@ async function gitSha(sourceDir) {
143
144
  return (await fs.readFile(path.join(sourceDir, '.git', ref), 'utf8').catch(() => '')).trim() || null;
144
145
  return /^[0-9a-f]{40}$/i.test(head.trim()) ? head.trim() : null;
145
146
  }
146
- function messageOf(err) {
147
- return err instanceof Error ? err.message : String(err);
148
- }
@@ -6,6 +6,7 @@ import { syncCodexSksSkills } from '../codex-app/codex-skill-sync.js';
6
6
  import { nowIso, writeJsonAtomic } from '../fsx.js';
7
7
  import { createRequestedScopeContract } from '../safety/requested-scope-contract.js';
8
8
  import { evaluateMutation, mutationLedgerPath, recordMutation } from '../safety/mutation-ledger.js';
9
+ import { messageOf } from '../errors/message.js';
9
10
  export async function repairCodexNativeManagedAssets(input) {
10
11
  const root = path.resolve(input.root);
11
12
  const requested = {
@@ -144,6 +145,3 @@ function listLength(value, key) {
144
145
  }
145
146
  return Array.isArray(current) ? current.length : 0;
146
147
  }
147
- function messageOf(err) {
148
- return err instanceof Error ? err.message : String(err);
149
- }
@@ -23,7 +23,7 @@ const CORE_SKILL_DEFINITIONS = [
23
23
  route: '$Naruto',
24
24
  purpose: 'run a Codex official subagent workflow with official agent threads while parent integration remains owner.',
25
25
  when: 'Use when the user explicitly invokes $Naruto or the selected route requires bounded parallel delegation.',
26
- workflow: 'Run sks naruto run "<task>" [--agents N] [--max-threads N] [--json] with Codex official subagent threads only. The parent owns decomposition, per-wave capacity, later root-owned waves, integration, and final verification. Automatic targets begin at 2/4/6 by task size and may expand to 10 only for independent useful slices; max_threads is a cap, never a target, and max_depth=1 blocks nested delegation. Route each slice to the narrowest matching Codex role and wait for every planned thread before final.',
26
+ workflow: 'Run sks naruto run "<task>" [--agents N] [--max-threads N] [--json] with Codex official subagent threads only. The parent owns decomposition, per-wave capacity, later root-owned waves, integration, and final verification. Automatic targets begin at 4/6/8 by task size and may expand to 12 when independent useful slices and healthy host capacity remain positive; max_threads is a cap, never a target, and max_depth=1 blocks nested delegation. Route each slice to the narrowest matching Codex role and wait for every planned thread before final.',
27
27
  safety: 'Preserve user-authored content, inherit the parent permission mode, do not spawn nested subagents, do not inject the full pack or the full TriWiki context into every child, and do not fall back to another model, process runtime, custom scheduler, or worker pool. The historical Naruto process runtime is removed; stop with explicit blocker evidence when the official path is unavailable.',
28
28
  cli: 'sks naruto run "<task>" [--agents N] [--max-threads N] [--json]; sks naruto status|subagents|proof [--mission <id>] [--json]',
29
29
  evidence: 'subagent-plan.json, subagent-events.jsonl, subagent-parent-summary.json, subagent-evidence.json, naruto-summary.json, and naruto-gate.json.',
@@ -47,7 +47,8 @@ const CORE_SKILL_DEFINITIONS = [
47
47
  route: '$Research',
48
48
  purpose: 'run evidence-bound discovery, source ledgers, and synthesis cycles.',
49
49
  when: 'Use for discovery, evaluation, external-source claims, or frontier-style research.',
50
- workflow: 'Run layered Super Search first and accept only source rows correlated to verified proof, source-ledger, and hydrated-content artifacts. Then run exactly three independent official research_reviewer threads on GPT-5.6 Sol Max using Einstein, von Neumann, and Skeptic composite lenses. Any objection triggers a mission-local research_synthesizer revision and a fresh three-thread review cycle. agent-ledger.json and debate-ledger.json are compatibility projections only; do not launch a removed legacy scheduler or a custom debate pool.',
50
+ workflow: 'Frame the research criteria and map assumptions before retrieval. Run layered Super Search first and accept only source rows correlated to verified proof, source-ledger, and hydrated-content artifacts. Then run exactly three independent official research_reviewer threads on GPT-5.6 Sol Max using Einstein, von Neumann, and Skeptic composite lenses. Each reviewer must return one literal "Eureka!" idea, source ids, falsifiers, cheap probes, and zero unresolved objections before approval. Any objection triggers a mission-local research_synthesizer revision and a fresh three-thread review cycle. agent-ledger.json and debate-ledger.json are compatibility projections only; do not launch a removed legacy scheduler or a custom debate pool.',
51
+ safety: 'Preserve user-authored content, keep research route state bounded, and do not edit repository source. Do not overclaim genius, novelty, breakthrough, publication acceptance, or experimental support beyond recorded evidence.',
51
52
  evidence: 'research plan, source ledger, cycle record, synthesis, and final review.',
52
53
  fallback: 'State source/tool unavailability and avoid unsupported live-accuracy claims.'
53
54
  },
@@ -3,6 +3,7 @@ import path from 'node:path';
3
3
  import { ensureDir, nowIso, writeJsonAtomic } from '../fsx.js';
4
4
  import { detectImagegenCapability } from '../imagegen/imagegen-capability.js';
5
5
  import { buildCodexNativeFeatureMatrix } from './codex-native-feature-broker.js';
6
+ import { messageOf } from '../errors/message.js';
6
7
  export const NATIVE_CAPABILITY_IDS = [
7
8
  'image_generation',
8
9
  'image_followup_edit',
@@ -317,6 +318,3 @@ function fixtureNativeFeatureMatrix(mode) {
317
318
  blockers: ok ? [] : ['fixture_manual_required']
318
319
  };
319
320
  }
320
- function messageOf(err) {
321
- return err instanceof Error ? err.message : String(err);
322
- }
@@ -2,6 +2,7 @@ import { findCodexBinary } from '../codex-adapter.js';
2
2
  import { nowIso, runProcess } from '../fsx.js';
3
3
  import { redactSecrets, redactString } from '../secret-redaction.js';
4
4
  import { buildCodexPluginInventory } from './codex-plugin-json.js';
5
+ import { messageOf } from '../errors/message.js';
5
6
  export const CODEX_PLUGIN_REPAIR_SCHEMA = 'sks.codex-plugin-repair.v1';
6
7
  export async function ensureCodexPlugins(input) {
7
8
  const pluginIds = [...new Set((input.pluginIds || []).map(String))];
@@ -112,6 +113,3 @@ function tail(value, max = 2000) {
112
113
  const text = redactString(String(value || ''));
113
114
  return text.length > max ? text.slice(-max) : text;
114
115
  }
115
- function messageOf(err) {
116
- return err instanceof Error ? err.message : String(err);
117
- }
@@ -4,6 +4,7 @@ import { DEFAULT_CODEX_APP_PLUGINS } from '../routes.js';
4
4
  import { ensureDir, PACKAGE_VERSION, readText, writeTextAtomic } from '../fsx.js';
5
5
  import { removeLegacyTopLevelCodexModeLocks, writeCodexConfigGuarded } from '../codex/codex-config-guard.js';
6
6
  import { cleanupCodexConfigBackups, validateCodexConfigRoundTrip } from '../codex/codex-config-toml.js';
7
+ import { escapeRegExp } from '../text/regex.js';
7
8
  export async function ensureGlobalCodexFastModeDuringInstall(opts = {}) {
8
9
  if (process.env.SKS_SKIP_CODEX_FAST_MODE_REPAIR === '1')
9
10
  return { status: 'skipped', reason: 'SKS_SKIP_CODEX_FAST_MODE_REPAIR=1' };
@@ -61,6 +62,7 @@ function normalizeCodexFastModeUiConfigOnce(text = '', opts = {}) {
61
62
  for (const legacyFlag of ['codex_hooks', 'remote_control', 'fast_mode_ui', 'codex_git_commit']) {
62
63
  next = removeTomlTableKey(next, 'features', legacyFlag, 'true');
63
64
  }
65
+ next = removeTomlTableKey(next, 'features', 'multi_agent');
64
66
  if (opts.forceFastMode === true) {
65
67
  next = upsertTopLevelTomlString(next, 'service_tier', 'fast');
66
68
  }
@@ -70,7 +72,6 @@ function normalizeCodexFastModeUiConfigOnce(text = '', opts = {}) {
70
72
  next = upsertTopLevelTomlBooleanIfAbsent(next, 'suppress_unstable_features_warning', true);
71
73
  for (const featureLine of [
72
74
  'hooks = true',
73
- 'multi_agent = true',
74
75
  'fast_mode = true',
75
76
  'apps = true',
76
77
  'computer_use = true',
@@ -239,6 +240,8 @@ export async function safeWriteCodexConfigToml(configPath, current, next, tag =
239
240
  cause: tag,
240
241
  removeTopLevelModeLocks: true,
241
242
  ...(opts.preserveFastUiKeys === undefined ? {} : { preserveFastUiKeys: opts.preserveFastUiKeys }),
243
+ ...(opts.verifyUnchangedBeforeWrite === undefined ? {} : { verifyUnchangedBeforeWrite: opts.verifyUnchangedBeforeWrite }),
244
+ ...(opts.expectedBeforeExists === undefined ? {} : { expectedBeforeExists: opts.expectedBeforeExists }),
242
245
  mutate: () => String(next || '')
243
246
  });
244
247
  }
@@ -299,6 +302,3 @@ export function upsertTomlTable(text, table, block) {
299
302
  lines.splice(start, end - start, ...blockLines);
300
303
  return lines.join('\n').replace(/\n{3,}/g, '\n\n');
301
304
  }
302
- function escapeRegExp(value) {
303
- return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
304
- }
@@ -3,7 +3,8 @@ import { fileURLToPath } from 'node:url';
3
3
  import { ensureDir, exists, nowIso, projectRoot, runProcess, writeJsonAtomic } from '../fsx.js';
4
4
  import { agentManifestDigest, buildAgentManifest, validateAgentManifest } from '../agent-bridge/agent-manifest.js';
5
5
  import { inspectHostCapabilityRuntime } from '../agent-bridge/host-capability-runtime.js';
6
- import { flag } from './command-utils.js';
6
+ import { renderHostCapabilityBlockedLines } from '../agent-bridge/host-capability-policy.js';
7
+ const flag = (args = [], name) => args.includes(name);
7
8
  async function resolveSksEntrypoint() {
8
9
  const packedBin = fileURLToPath(new URL('../../bin/sks.js', import.meta.url));
9
10
  const sourceBin = fileURLToPath(new URL('../../../bin/sks.js', import.meta.url));
@@ -93,7 +94,8 @@ export async function agentBridgeCommand(subcommand, args = []) {
93
94
  if (flag(args, '--json'))
94
95
  console.log(JSON.stringify(result, null, 2));
95
96
  else
96
- console.log(`Unknown agent-bridge subcommand "${sub}". Supported: setup`);
97
+ for (const line of renderAgentBridgeBlockedLines([result.error]))
98
+ console.error(line);
97
99
  return result;
98
100
  }
99
101
  const root = await projectRoot();
@@ -115,7 +117,8 @@ export async function agentBridgeCommand(subcommand, args = []) {
115
117
  if (flag(args, '--json'))
116
118
  console.log(JSON.stringify(result, null, 2));
117
119
  else
118
- console.error(`Agent bridge manifest validation failed: ${manifestValidation.issues.join(', ')}`);
120
+ for (const line of renderAgentBridgeBlockedLines([result.status, ...manifestValidation.issues]))
121
+ console.error(line);
119
122
  return result;
120
123
  }
121
124
  await ensureDir(path.dirname(manifestPath));
@@ -144,6 +147,11 @@ export async function agentBridgeCommand(subcommand, args = []) {
144
147
  console.log(JSON.stringify(result, null, 2));
145
148
  }
146
149
  else {
150
+ if (!result.ok) {
151
+ for (const line of renderAgentBridgeBlockedLines(agentBridgeBlockers(result)))
152
+ console.error(line);
153
+ return result;
154
+ }
147
155
  console.log(`Agent bridge manifest written: ${manifestPath} (${manifest.tools.length} tools)`);
148
156
  console.log('Register with a generic MCP host:');
149
157
  console.log(` ${JSON.stringify(registrationSnippets().generic_mcp_host)}`);
@@ -155,3 +163,16 @@ export async function agentBridgeCommand(subcommand, args = []) {
155
163
  }
156
164
  return result;
157
165
  }
166
+ export function renderAgentBridgeBlockedLines(blockers) {
167
+ return renderHostCapabilityBlockedLines(blockers, {
168
+ reason: 'Agent Bridge 설정이 완료 조건을 충족하지 못했습니다.',
169
+ action: '세부 코드를 확인해 가장 먼저 표시된 원인을 해결한 뒤 다시 실행하세요.'
170
+ });
171
+ }
172
+ function agentBridgeBlockers(result) {
173
+ return [
174
+ ...(!result.non_interactive_smoke?.ok ? ['agent_bridge_status_smoke_failed', ...(result.non_interactive_smoke?.issues || [])] : []),
175
+ ...(!result.naruto_help_smoke?.ok ? ['agent_bridge_naruto_help_smoke_failed', ...(result.naruto_help_smoke?.issues || [])] : []),
176
+ ...(result.host_capability_inventory?.blockers || [])
177
+ ];
178
+ }
@@ -13,6 +13,7 @@ import { sha256File, imageDimensions } from '../wiki-image/image-hash.js';
13
13
  import { writeRouteCollaborationArtifacts } from '../agents/route-collaboration-ledger.js';
14
14
  import { codexChromeExtensionStatus } from '../codex-app.js';
15
15
  import { requireCodexImagegen } from '../imagegen/require-imagegen.js';
16
+ import { imagegenEvidenceClassBlockers, isFullImagegenEvidenceClass, isFullImagegenOutputSource } from '../imagegen/imagegen-evidence.js';
16
17
  import { evaluateGate } from '../stop-gate/gate-evaluator.js';
17
18
  const ONE_BY_ONE_PNG_BASE64 = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMB/axX7V8AAAAASUVORK5CYII=';
18
19
  const IMAGE_UX_REVIEW_ARTIFACT_PATHS = {
@@ -160,7 +161,7 @@ async function runImageUxReview(root, command, args = []) {
160
161
  const response = await readImagegenResponse(dir);
161
162
  const evidenceClass = String(response?.evidence_class || '');
162
163
  const fakeGenerated = evidenceClass === 'mock_fixture' || result.provider === 'fake_imagegen_adapter';
163
- const realGenerated = evidenceClass === 'codex_app_imagegen';
164
+ const realGenerated = isFullImagegenEvidenceClass(evidenceClass);
164
165
  await attachGeneratedReviewImage(root, dir, contract, result.generated_image_path, {
165
166
  realGenerated,
166
167
  mock: fakeGenerated,
@@ -509,7 +510,7 @@ async function attachGeneratedReviewImage(root, dir, contract, imagePath, opts =
509
510
  evidence_class: evidenceClass,
510
511
  output_source: outputSource,
511
512
  output_sha256: outputSha256 || undefined,
512
- real_generated: opts.realGenerated === true && evidenceClass === 'codex_app_imagegen',
513
+ real_generated: opts.realGenerated === true && isFullImagegenEvidenceClass(evidenceClass),
513
514
  mock: opts.mock === true
514
515
  });
515
516
  if (!response && opts.realGenerated === true) {
@@ -631,16 +632,9 @@ async function validateImagegenResponseEvidence(response = null, dir = process.c
631
632
  if (response.ok !== true || response.status !== 'generated')
632
633
  blockers.push(response.blocker || 'imagegen_response_not_generated');
633
634
  const evidenceClass = String(response.evidence_class || '');
634
- if (!evidenceClass)
635
- blockers.push('imagegen_response_evidence_class_missing');
636
- if (evidenceClass === 'mock_fixture')
637
- blockers.push('imagegen_response_mock_fixture_not_full_evidence');
638
- if (evidenceClass === 'non_codex_api_fallback')
639
- blockers.push('imagegen_response_non_codex_api_fallback_not_full_evidence');
640
- if (evidenceClass && evidenceClass !== 'codex_app_imagegen')
641
- blockers.push(`imagegen_response_evidence_class_not_codex_app:${evidenceClass}`);
635
+ blockers.push(...imagegenEvidenceClassBlockers('imagegen_response', evidenceClass));
642
636
  const source = String(response.output_source || '');
643
- if (!['manual_attach', 'auto_discovered_generated_images'].includes(source))
637
+ if (!isFullImagegenOutputSource(source))
644
638
  blockers.push('imagegen_response_output_source_invalid');
645
639
  const outputPath = String(response.output_image_path || '');
646
640
  const expectedSha = String(response.output_sha256 || response.output_image_sha256 || '');
@@ -1,7 +1,7 @@
1
1
  import path from 'node:path';
2
2
  import { ui as cliUi } from '../../cli/cli-theme.js';
3
3
  import { projectRoot } from '../fsx.js';
4
- import { inspectSksMenuBarStatus, installSksMenuBar, rollbackSksMenuBar, restartSksMenuBar, uninstallSksMenuBar } from '../codex-app/sks-menubar.js';
4
+ import { inspectSksMenuBarStatus, installSksMenuBar, rollbackSksMenuBar, restartSksMenuBar, uninstallSksMenuBar } from '../codex-app/menubar/index.js';
5
5
  export async function menubarCommand(subcommand = 'status', args = []) {
6
6
  const action = normalizeAction(subcommand);
7
7
  if (action === 'help') {
@@ -12,6 +12,8 @@ import { NARUTO_GATE_FILENAME, NARUTO_RESULT_SCHEMA, NARUTO_SUMMARY_FILENAME, SU
12
12
  import { recordOfficialSubagentParentOutcomesTelemetry } from '../zellij/zellij-official-subagent-telemetry.js';
13
13
  import { effectiveSubagentTarget, refreshSubagentWaveLifecycle } from '../subagents/wave-lifecycle.js';
14
14
  import { HOST_CAPABILITY_HOOK_RUNTIME_FILENAME, bindParentSummaryToHostCapabilityEvidence, createHostCapabilityHookRuntimeBinding, resolveHostCapabilityHookRuntimeBinding } from '../agent-bridge/host-capability-runtime.js';
15
+ import { renderHostCapabilityBlockedLines } from '../agent-bridge/host-capability-policy.js';
16
+ import { uniqueStrings } from '../text/strings.js';
15
17
  export { buildNarutoGateResult } from '../subagents/official-subagent-preparation.js';
16
18
  let nextNarutoPreparationFailureInjectionForTest = null;
17
19
  export function injectNextNarutoPreparationFailureForTest(value) {
@@ -23,8 +25,10 @@ export async function narutoCommand(commandOrArgs = 'naruto', maybeArgs = []) {
23
25
  return blockGlmOverride(args.includes('--json'));
24
26
  const parsed = parseNarutoArgs(args);
25
27
  if (parsed.argumentErrors.length) {
26
- return emit(parsed, argumentBlock(parsed.argumentErrors), () => {
27
- console.error(`$sks-naruto argument error: ${parsed.argumentErrors.join(', ')}`);
28
+ const result = argumentBlock(parsed.argumentErrors);
29
+ return emit(parsed, result, () => {
30
+ for (const line of renderNarutoBlockedLines(result.blockers))
31
+ console.error(line);
28
32
  }, true);
29
33
  }
30
34
  if (!parsed.json)
@@ -451,9 +455,12 @@ async function narutoProof(parsed) {
451
455
  return missingMission(parsed, 'proof');
452
456
  const result = await buildNarutoProofProjection({ artifactDir: resolved.dir, missionId: resolved.id });
453
457
  return emit(parsed, result, () => {
458
+ if (result.status !== 'completed' && result.blockers?.length) {
459
+ for (const line of renderNarutoBlockedLines(result.blockers))
460
+ console.log(line);
461
+ return;
462
+ }
454
463
  console.log(`Naruto proof ${resolved.id}: ${result.status}`);
455
- if (result.blockers?.length)
456
- console.log(`Blockers: ${result.blockers.join(', ')}`);
457
464
  });
458
465
  }
459
466
  function narutoHelp(parsed) {
@@ -711,7 +718,8 @@ function blockGlmOverride(json) {
711
718
  if (json)
712
719
  console.log(JSON.stringify(result, null, 2));
713
720
  else
714
- console.error(`$sks-naruto blocked: ${result.reason}. ${result.hint}`);
721
+ for (const line of renderNarutoBlockedLines(result.blockers))
722
+ console.error(line);
715
723
  return result;
716
724
  }
717
725
  function argumentBlock(errors) {
@@ -733,20 +741,28 @@ function missingMission(parsed, action) {
733
741
  }, () => console.log('No Naruto mission found.'));
734
742
  }
735
743
  function missingRunMission(parsed) {
736
- return emit(parsed, {
744
+ const result = {
737
745
  schema: NARUTO_RESULT_SCHEMA,
738
746
  ok: false,
739
747
  status: 'blocked',
740
748
  blockers: [`naruto_mission_not_found:${parsed.missionId}`]
741
- }, () => console.error(`Naruto mission not found: ${parsed.missionId}`), true);
749
+ };
750
+ return emit(parsed, result, () => {
751
+ for (const line of renderNarutoBlockedLines(result.blockers))
752
+ console.error(line);
753
+ }, true);
742
754
  }
743
755
  function blockedRunMission(parsed, blockers) {
744
- return emit(parsed, {
756
+ const result = {
745
757
  schema: NARUTO_RESULT_SCHEMA,
746
758
  ok: false,
747
759
  status: 'blocked',
748
760
  blockers
749
- }, () => console.error(`Naruto mission blocked: ${blockers.join(', ')}`), true);
761
+ };
762
+ return emit(parsed, result, () => {
763
+ for (const line of renderNarutoBlockedLines(result.blockers))
764
+ console.error(line);
765
+ }, true);
750
766
  }
751
767
  function emit(parsed, result, human, failed = false) {
752
768
  if (failed)
@@ -758,19 +774,30 @@ function emit(parsed, result, human, failed = false) {
758
774
  return result;
759
775
  }
760
776
  function renderRunResult(result) {
777
+ if (['blocked', 'incomplete'].includes(result.status) && Array.isArray(result.blockers) && result.blockers.length) {
778
+ for (const line of renderNarutoBlockedLines(result.blockers))
779
+ console.log(line);
780
+ return;
781
+ }
761
782
  console.log(`$sks-naruto ${result.status}: ${result.mission_id}`);
762
783
  console.log(`Naruto children: requested ${result.requested_subagents}, target ${result.target_subagents ?? result.requested_subagents}, policy ${result.count_policy || 'exact'}, max threads ${result.max_threads}`);
763
784
  console.log(`Started/completed/failed: ${result.started_subagents}/${result.completed_subagents}/${result.failed_subagents}`);
764
785
  if (result.status === 'delegation_context_ready')
765
786
  console.log('Continue in the current Naruto parent and wait for every requested child before summarizing.');
766
- if (Array.isArray(result.blockers) && result.blockers.length)
767
- console.log(`Blockers: ${result.blockers.join(', ')}`);
768
787
  }
769
788
  function renderStatusResult(result) {
789
+ if (['blocked', 'incomplete'].includes(result.status) && Array.isArray(result.blockers) && result.blockers.length) {
790
+ for (const line of renderNarutoBlockedLines(result.blockers))
791
+ console.log(line);
792
+ return;
793
+ }
770
794
  console.log(`Naruto ${result.action || 'status'}: ${result.mission_id}`);
771
795
  console.log(`Requested/target/policy: ${result.requested_subagents ?? 0}/${result.target_subagents ?? result.requested_subagents ?? 0}/${result.count_policy || 'exact'}`);
772
796
  console.log(`Started/completed/failed: ${result.started_subagents || 0}/${result.completed_subagents || 0}/${result.failed_subagents || 0}`);
773
797
  }
774
- function uniqueStrings(values) {
775
- return [...new Set(values.map((value) => String(value || '').trim()).filter(Boolean))];
798
+ export function renderNarutoBlockedLines(blockers) {
799
+ return renderHostCapabilityBlockedLines(blockers, {
800
+ reason: 'Naruto 실행이 완료 조건을 충족하지 못했습니다.',
801
+ action: '세부 코드를 확인해 가장 먼저 표시된 원인을 해결한 뒤 다시 실행하세요.'
802
+ });
776
803
  }
@@ -1,7 +1,7 @@
1
1
  import path from 'node:path';
2
2
  import { projectRoot, readJson } from '../fsx.js';
3
- import { listSessionStates, missionDir, stateFile } from '../mission.js';
4
- import { PIPELINE_PLAN_ARTIFACT, projectGateStatus, writePipelinePlan } from '../pipeline.js';
3
+ import { listSessionStates, missionDir, setCurrent, stateFile } from '../mission.js';
4
+ import { PIPELINE_PLAN_ARTIFACT, pipelinePlanState, projectGateStatus, writePipelinePlan } from '../pipeline.js';
5
5
  import { routePrompt } from '../routes.js';
6
6
  import { flag, positionalArgs, readFlagValue, resolveMissionId } from './command-utils.js';
7
7
  export async function pipelineCommand(args = []) {
@@ -43,6 +43,9 @@ export async function pipelineCommand(args = []) {
43
43
  ambiguity: { required: true, auto_sealed: true, status: 'auto_sealed' },
44
44
  agents
45
45
  });
46
+ if (id === state.mission_id) {
47
+ await setCurrent(root, { mission_id: id, ...pipelinePlanState(plan) }, { sessionKey: state._session_key });
48
+ }
46
49
  if (flag(args, '--json'))
47
50
  return console.log(JSON.stringify({ schema: 'sks.pipeline-plan.v1', ok: true, mission_id: id, plan }, null, 2));
48
51
  console.log(`Pipeline plan written: .sneakoscope/missions/${id}/${PIPELINE_PLAN_ARTIFACT}`);