sneakoscope 7.0.2 → 7.0.3

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 (468) hide show
  1. package/README.md +7 -5
  2. package/crates/sks-core/Cargo.lock +1 -1
  3. package/crates/sks-core/Cargo.toml +1 -1
  4. package/dist/bin/sks-dispatch.js +0 -3
  5. package/dist/cli/command-registry.js +0 -2
  6. package/dist/cli/install-helpers-codex-lb-chain.js +24 -2
  7. package/dist/cli/install-helpers-codex-lb-config.js +0 -7
  8. package/dist/cli/install-helpers-codex-lb-selftest-chain.js +0 -3
  9. package/dist/cli/install-helpers-codex-lb-selftest.js +0 -17
  10. package/dist/cli/install-helpers.js +81 -96
  11. package/dist/cli/router.js +0 -22
  12. package/dist/commands/codex-lb.js +176 -22
  13. package/dist/commands/codex.js +3 -8
  14. package/dist/commands/doctor.js +4 -14
  15. package/dist/commands/perf.js +5 -1
  16. package/dist/commands/zellij-slot-column-anchor.js +0 -2
  17. package/dist/commands/zellij-slot-pane.js +0 -7
  18. package/dist/commands/zellij.js +0 -2
  19. package/dist/config/skills-manifest.json +52 -52
  20. package/dist/core/agent-bridge/agent-manifest.js +192 -1
  21. package/dist/core/agent-bridge/agent-mode.js +0 -5
  22. package/dist/core/agent-bridge/host-capability-policy.js +189 -0
  23. package/dist/core/agent-bridge/host-capability-runtime.js +1395 -0
  24. package/dist/core/agent-bridge/mcp-server.js +1 -11
  25. package/dist/core/agents/agent-effort-policy.js +0 -3
  26. package/dist/core/agents/agent-orchestrator.js +0 -4
  27. package/dist/core/agents/agent-proof-evidence.js +0 -2
  28. package/dist/core/agents/agent-runner-ollama.js +0 -3
  29. package/dist/core/agents/agent-scheduler.js +0 -5
  30. package/dist/core/agents/native-cli-worker-runtime.js +5 -17
  31. package/dist/core/agents/work-partition/repo-inventory.js +0 -2
  32. package/dist/core/auto-review.js +0 -13
  33. package/dist/core/bench.js +0 -14
  34. package/dist/core/code-structure.js +0 -3
  35. package/dist/core/codex/agent-config-file-repair.js +0 -8
  36. package/dist/core/codex/codex-cli-update.js +122 -20
  37. package/dist/core/codex/codex-config-eperm-repair.js +0 -4
  38. package/dist/core/codex/codex-config-guard.js +0 -3
  39. package/dist/core/codex/codex-config-readability.js +0 -13
  40. package/dist/core/codex/codex-project-config-policy.js +0 -33
  41. package/dist/core/codex/official-goal-mode.js +0 -2
  42. package/dist/core/codex-app/codex-app-fast-ui-repair.js +5 -7
  43. package/dist/core/codex-app/codex-app-ui-state-snapshot.js +44 -7
  44. package/dist/core/codex-app/sks-menubar.js +0 -1
  45. package/dist/core/codex-app.js +0 -9
  46. package/dist/core/codex-compat/codex-hook-output-builders.js +9 -1
  47. package/dist/core/codex-compat/codex-hook-output-normalizer.js +1 -1
  48. package/dist/core/codex-compat/codex-hook-semantic-validator.js +3 -2
  49. package/dist/core/codex-compat/codex-hook-warning-detector.js +10 -2
  50. package/dist/core/codex-control/codex-lb-launch-recovery.js +0 -3
  51. package/dist/core/codex-control/codex-reliability-shield.js +0 -8
  52. package/dist/core/codex-control/codex-sdk-adapter.js +0 -3
  53. package/dist/core/codex-control/codex-sdk-config-policy.js +0 -2
  54. package/dist/core/codex-control/codex-sdk-env-policy.js +61 -16
  55. package/dist/core/codex-control/codex-task-runner.js +0 -7
  56. package/dist/core/codex-control/codex-thread-registry.js +0 -4
  57. package/dist/core/codex-lb/codex-lb-env.js +118 -20
  58. package/dist/core/codex-lb/codex-lb-tool-catalog.js +0 -4
  59. package/dist/core/codex-lb/codex-lb-tool-output-recovery.js +1 -1
  60. package/dist/core/codex-model-guard.js +0 -14
  61. package/dist/core/codex-native/codex-native-feature-broker.js +67 -22
  62. package/dist/core/codex-native/codex-native-interop-policy.js +81 -9
  63. package/dist/core/codex-native/confined-report-writer.js +21 -0
  64. package/dist/core/codex-native/core-skill-integrity.js +169 -20
  65. package/dist/core/codex-native/project-skill-dedupe.js +55 -13
  66. package/dist/core/codex-native/skill-registry-ledger.js +137 -16
  67. package/dist/core/codex-native/sks-skill-paths.js +185 -0
  68. package/dist/core/codex-runtime/codex-desktop-config-policy.js +0 -2
  69. package/dist/core/commands/agent-bridge-command.js +28 -8
  70. package/dist/core/commands/basic-cli.js +67 -26
  71. package/dist/core/commands/bench-command.js +5 -1
  72. package/dist/core/commands/command-utils.js +0 -5
  73. package/dist/core/commands/image-ux-review-command.js +0 -9
  74. package/dist/core/commands/mad-sks-command.js +0 -38
  75. package/dist/core/commands/naruto-command.js +46 -12
  76. package/dist/core/commands/ppt-command.js +0 -9
  77. package/dist/core/commands/run-command.js +8 -2
  78. package/dist/core/commands/seo-command.js +0 -6
  79. package/dist/core/commands/wiki-command.js +0 -14
  80. package/dist/core/computer-use-live-evidence.js +0 -5
  81. package/dist/core/config/secret-preservation.js +0 -11
  82. package/dist/core/daemon/sksd-hook-daemon-entrypoint.js +0 -2
  83. package/dist/core/daemon/sksd-hook-daemon.js +1 -29
  84. package/dist/core/daemon/sksd-hook-dispatch.js +0 -17
  85. package/dist/core/db-safety.js +0 -7
  86. package/dist/core/doctor/browser-use-repair.js +0 -2
  87. package/dist/core/doctor/doctor-codex-startup-repair.js +0 -3
  88. package/dist/core/doctor/doctor-readiness-matrix.js +12 -0
  89. package/dist/core/doctor/doctor-skill-reconcile.js +32 -0
  90. package/dist/core/doctor/imagegen-repair.js +0 -2
  91. package/dist/core/doctor/mcp-transport-collision-repair.js +0 -3
  92. package/dist/core/doctor/retired-managed-residue-private.js +0 -1
  93. package/dist/core/doctor/supabase-mcp-repair.js +0 -11
  94. package/dist/core/feature-fixture-executor.js +0 -48
  95. package/dist/core/feature-fixtures.js +0 -5
  96. package/dist/core/fsx.js +11 -12
  97. package/dist/core/hooks-runtime/code-pack-freshness-preflight.js +0 -5
  98. package/dist/core/hooks-runtime/hook-context.js +202 -0
  99. package/dist/core/hooks-runtime/hook-io.js +1 -12
  100. package/dist/core/hooks-runtime/light-turn.js +0 -2
  101. package/dist/core/hooks-runtime/naruto-decision-gate.js +4 -1
  102. package/dist/core/hooks-runtime/naruto-terminal-finalization.js +91 -0
  103. package/dist/core/hooks-runtime/official-subagent-lifecycle.js +370 -0
  104. package/dist/core/hooks-runtime/standalone-parent-host-capability.js +98 -0
  105. package/dist/core/hooks-runtime/subagent-context.js +59 -0
  106. package/dist/core/hooks-runtime/subagent-skill-availability-contract.js +29 -0
  107. package/dist/core/hooks-runtime/subagent-skill-availability-evidence.js +195 -0
  108. package/dist/core/hooks-runtime/subagent-skill-availability-guards.js +316 -0
  109. package/dist/core/hooks-runtime/subagent-skill-availability.js +217 -0
  110. package/dist/core/hooks-runtime.js +259 -535
  111. package/dist/core/image-ux-review/codex-app-generated-image-discovery.js +0 -17
  112. package/dist/core/image-ux-review/imagegen-adapter.js +0 -14
  113. package/dist/core/imagegen/imagegen-auth-readiness.js +0 -9
  114. package/dist/core/imagegen/imagegen-capability.js +0 -3
  115. package/dist/core/init/managed-skill-install.js +42 -0
  116. package/dist/core/init/skills.js +247 -74
  117. package/dist/core/init.js +15 -40
  118. package/dist/core/lean-engineering-policy.js +0 -2
  119. package/dist/core/locks/file-lock.js +0 -21
  120. package/dist/core/loops/loop-planner.js +0 -6
  121. package/dist/core/loops/loop-runtime.js +0 -1
  122. package/dist/core/loops/loop-worker-runtime.js +0 -19
  123. package/dist/core/mad-sks/executors/db-write-executor.js +0 -4
  124. package/dist/core/mad-sks/executors/executor-base.js +0 -10
  125. package/dist/core/mad-sks/immutable-harness-guard.js +0 -5
  126. package/dist/core/mad-sks/sql-plane/coordinator.js +0 -5
  127. package/dist/core/mad-sks/sql-plane/ledger.js +0 -4
  128. package/dist/core/mad-sks/sql-plane/lock.js +0 -4
  129. package/dist/core/mad-sks/sql-plane/mcp-executor.js +0 -9
  130. package/dist/core/mad-sks/sql-plane/policy-resolver.js +0 -2
  131. package/dist/core/mad-sks/sql-plane/postconditions.js +0 -4
  132. package/dist/core/mad-sks/sql-plane/recovery.js +0 -2
  133. package/dist/core/mad-sks/sql-plane/runtime-profile.js +0 -8
  134. package/dist/core/managed-assets/managed-assets-manifest.js +1 -7
  135. package/dist/core/mcp-config/health-check.js +10 -3
  136. package/dist/core/migration/migration-transaction-journal.js +0 -8
  137. package/dist/core/mission.js +0 -2
  138. package/dist/core/naruto/naruto-active-pool.js +0 -2
  139. package/dist/core/naruto/naruto-concurrency-governor.js +0 -1
  140. package/dist/core/naruto/naruto-real-write-proof.js +0 -4
  141. package/dist/core/naruto/naruto-write-e2e.js +0 -1
  142. package/dist/core/perf/perf-budget.js +0 -5
  143. package/dist/core/permission-gates.js +0 -2
  144. package/dist/core/pipeline-internals/runtime-core.js +15 -5
  145. package/dist/core/pipeline-internals/runtime-gates.js +0 -12
  146. package/dist/core/preflight/parallel-preflight-engine.js +0 -11
  147. package/dist/core/proof/evidence-collector.js +0 -2
  148. package/dist/core/proof/route-finalizer.js +0 -1
  149. package/dist/core/proof/selftest-proof-fixtures.js +0 -5
  150. package/dist/core/providers/glm/bench/glm-benchmark-runner.js +0 -2
  151. package/dist/core/providers/glm/glm-request-cache.js +0 -3
  152. package/dist/core/providers/glm/naruto/glm-naruto-command.js +0 -1
  153. package/dist/core/providers/glm/naruto/glm-naruto-decomposer.js +0 -1
  154. package/dist/core/providers/glm/naruto/glm-naruto-orchestrator.js +0 -6
  155. package/dist/core/providers/glm/naruto/glm-naruto-trace.js +0 -1
  156. package/dist/core/providers/glm/naruto/glm-naruto-worker-pool.js +0 -1
  157. package/dist/core/providers/glm/naruto/glm-naruto-worktree.js +0 -1
  158. package/dist/core/providers/openrouter/openrouter-secret-store.js +0 -1
  159. package/dist/core/providers/openrouter/openrouter-stream.js +0 -2
  160. package/dist/core/questions.js +3 -3
  161. package/dist/core/release/gate-manifest.js +0 -5
  162. package/dist/core/release/package-size-budget.js +1 -1
  163. package/dist/core/release/release-gate-batch-runner.js +11 -2
  164. package/dist/core/release/release-gate-cache-v2.js +0 -4
  165. package/dist/core/release/release-gate-hermetic-env.js +0 -5
  166. package/dist/core/release-parallel-full-coverage.js +0 -2
  167. package/dist/core/remote/ssh-worker-client.js +0 -3
  168. package/dist/core/research/research-adversarial-review.js +6 -2
  169. package/dist/core/responses-retry-policy.js +0 -10
  170. package/dist/core/retention.js +0 -7
  171. package/dist/core/routes/constants.js +0 -3
  172. package/dist/core/routes.js +89 -15
  173. package/dist/core/safety/command-contract/contracts.js +2 -0
  174. package/dist/core/safety/mutation-guard.js +0 -25
  175. package/dist/core/safety/mutation-ledger.js +0 -9
  176. package/dist/core/safety/requested-scope-contract.js +0 -0
  177. package/dist/core/security/high-risk-contracts.js +0 -1
  178. package/dist/core/skills/core-skill-card.js +0 -0
  179. package/dist/core/skills/core-skill-deployment.js +0 -13
  180. package/dist/core/skills/core-skill-epoch.js +0 -11
  181. package/dist/core/skills/core-skill-meta-update.js +0 -6
  182. package/dist/core/skills/core-skill-patch-apply.js +0 -7
  183. package/dist/core/skills/core-skill-patch.js +0 -8
  184. package/dist/core/skills/core-skill-reflection.js +0 -16
  185. package/dist/core/skills/core-skill-runtime.js +0 -6
  186. package/dist/core/skills/core-skill-scorer.js +0 -7
  187. package/dist/core/skills/core-skill-trainer.js +0 -11
  188. package/dist/core/skills/core-skill-types.js +0 -9
  189. package/dist/core/skills/core-skill-validation.js +0 -5
  190. package/dist/core/skills/rejected-skill-patch-buffer.js +0 -2
  191. package/dist/core/stop-gate/stop-gate-check.js +0 -8
  192. package/dist/core/stop-gate/stop-gate-resolver.js +0 -7
  193. package/dist/core/stop-gate/stop-gate-writer.js +0 -5
  194. package/dist/core/subagents/model-policy.js +0 -7
  195. package/dist/core/subagents/naruto-help-contract.js +1 -1
  196. package/dist/core/subagents/naruto-proof-projection.js +580 -12
  197. package/dist/core/subagents/official-subagent-config.js +0 -8
  198. package/dist/core/subagents/official-subagent-preparation.js +6 -5
  199. package/dist/core/subagents/official-subagent-prompt.js +29 -0
  200. package/dist/core/subagents/official-subagent-runner.js +343 -37
  201. package/dist/core/subagents/subagent-evidence.js +378 -9
  202. package/dist/core/subagents/thread-budget.js +5 -2
  203. package/dist/core/subagents/triwiki-attention.js +0 -4
  204. package/dist/core/subagents/wave-parent-guidance.js +54 -9
  205. package/dist/core/telegram/runtime.js +0 -1
  206. package/dist/core/triwiki/code-index-scanner.js +0 -3
  207. package/dist/core/triwiki/code-pack-head-freshness.js +0 -10
  208. package/dist/core/triwiki/code-pack.js +0 -2
  209. package/dist/core/triwiki/triwiki-cache-key.js +0 -1
  210. package/dist/core/triwiki/triwiki-proof-bank.js +0 -1
  211. package/dist/core/triwiki-attention.js +0 -10
  212. package/dist/core/triwiki-provenance.js +0 -5
  213. package/dist/core/triwiki-runtime.js +0 -12
  214. package/dist/core/triwiki-wrongness/wrongness-ledger.js +0 -7
  215. package/dist/core/triwiki-wrongness/wrongness-schema.js +0 -3
  216. package/dist/core/trust-kernel/trust-report.js +0 -7
  217. package/dist/core/update/update-migration-state.js +21 -39
  218. package/dist/core/update-check.js +2 -14
  219. package/dist/core/version-manager.js +2 -0
  220. package/dist/core/version.js +1 -1
  221. package/dist/core/work-order-ledger.js +0 -17
  222. package/dist/core/zellij/zellij-clipboard-config.js +0 -18
  223. package/dist/core/zellij/zellij-lane-renderer.js +5 -46
  224. package/dist/core/zellij/zellij-lane-runtime.js +0 -1
  225. package/dist/core/zellij/zellij-launcher.js +0 -26
  226. package/dist/core/zellij/zellij-official-subagent-activity.js +0 -5
  227. package/dist/core/zellij/zellij-official-subagent-telemetry.js +0 -5
  228. package/dist/core/zellij/zellij-screen-proof.js +0 -7
  229. package/dist/core/zellij/zellij-slot-column-anchor.js +0 -1
  230. package/dist/core/zellij/zellij-slot-pane-renderer.js +0 -9
  231. package/dist/core/zellij/zellij-slot-telemetry.js +0 -12
  232. package/dist/core/zellij/zellij-ui-mode.js +0 -7
  233. package/dist/core/zellij/zellij-update.js +0 -29
  234. package/dist/core/zellij/zellij-worker-pane-manager.js +0 -39
  235. package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +213 -27
  236. package/dist/native/sks-menubar/Sources/UpdatesViewController.swift +95 -12
  237. package/dist/scripts/agent-message-bus-reader-check.js +0 -1
  238. package/dist/scripts/all-feature-deep-completion-check.js +0 -1
  239. package/dist/scripts/appshots-thread-attachment-discovery-check.js +0 -1
  240. package/dist/scripts/architecture-guard-check.js +0 -1
  241. package/dist/scripts/build-dist.js +0 -1
  242. package/dist/scripts/build-once-runner-check.js +0 -1
  243. package/dist/scripts/canonical-test-runner.js +0 -2
  244. package/dist/scripts/certificate-sla-check.js +0 -1
  245. package/dist/scripts/changelog-check.js +0 -1
  246. package/dist/scripts/check-cli-entrypoint.js +0 -1
  247. package/dist/scripts/check-command-module-budget.js +0 -7
  248. package/dist/scripts/check-feature-quality.js +0 -1
  249. package/dist/scripts/check-legacy-free.js +0 -1
  250. package/dist/scripts/check-pipeline-runtime.js +0 -1
  251. package/dist/scripts/check-runtime-schemas.js +0 -1
  252. package/dist/scripts/codex-0-134-runner-truth-check.js +0 -1
  253. package/dist/scripts/codex-0-137-compat-check.js +0 -1
  254. package/dist/scripts/codex-0138-capability-artifact-check.js +0 -1
  255. package/dist/scripts/codex-0138-capability-check.js +0 -1
  256. package/dist/scripts/codex-0138-doctor-check.js +0 -1
  257. package/dist/scripts/codex-0138-feature-probes-check.js +0 -1
  258. package/dist/scripts/codex-0144-core-real-probes-check.js +0 -1
  259. package/dist/scripts/codex-app-handoff-check.js +0 -1
  260. package/dist/scripts/codex-app-handoff-launch-check.js +0 -1
  261. package/dist/scripts/codex-config-load-probe.js +0 -5
  262. package/dist/scripts/codex-control-all-pipelines-check.js +0 -1
  263. package/dist/scripts/codex-control-event-stream-ledger-check.js +0 -1
  264. package/dist/scripts/codex-control-tool-output-continuity-audit-check.js +0 -1
  265. package/dist/scripts/codex-permission-profiles-check.js +0 -1
  266. package/dist/scripts/codex-plugin-app-template-policy-check.js +0 -1
  267. package/dist/scripts/codex-project-config-policy-splitter-check.js +0 -1
  268. package/dist/scripts/codex-sdk-all-pipelines-check.js +0 -1
  269. package/dist/scripts/codex-sdk-backend-router-check.js +0 -1
  270. package/dist/scripts/codex-sdk-capability-check.js +0 -1
  271. package/dist/scripts/codex-sdk-event-stream-ledger-check.js +0 -1
  272. package/dist/scripts/codex-sdk-real-smoke-check.js +0 -1
  273. package/dist/scripts/concurrent-session-collision-check.js +9 -0
  274. package/dist/scripts/context7-evidence-dedupe-check.js +0 -1
  275. package/dist/scripts/core-skill-card-schema-check.js +0 -11
  276. package/dist/scripts/core-skill-deployment-snapshot-check.js +0 -10
  277. package/dist/scripts/core-skill-heldout-validation-check.js +0 -11
  278. package/dist/scripts/core-skill-no-inference-optimizer-check.js +0 -11
  279. package/dist/scripts/core-skill-patch-check.js +0 -11
  280. package/dist/scripts/core-skill-route-runtime-integration-check.js +0 -11
  281. package/dist/scripts/current-surface-update-e2e-check.js +0 -4
  282. package/dist/scripts/current-upgrade-matrix-check.js +0 -1
  283. package/dist/scripts/dfix-fixture-check.js +0 -1
  284. package/dist/scripts/dfix-patch-handoff-check.js +0 -1
  285. package/dist/scripts/dfix-verification-check.js +0 -1
  286. package/dist/scripts/dfix-verification-recommendation-check.js +0 -1
  287. package/dist/scripts/docs-truthfulness-check.js +3 -3
  288. package/dist/scripts/doctor-fastpath-check.js +0 -1
  289. package/dist/scripts/doctor-fix-proves-codex-read-check.js +0 -11
  290. package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +0 -4
  291. package/dist/scripts/doctor-idempotence-check.js +0 -1
  292. package/dist/scripts/doctor-ops-semantics-check.js +0 -1
  293. package/dist/scripts/ensure-bin-executable.js +0 -1
  294. package/dist/scripts/evidence-flagship-coverage-check.js +0 -1
  295. package/dist/scripts/fast-codex-service-tier-proof-check.js +0 -1
  296. package/dist/scripts/fixtures/fake-codex-config-loader.js +0 -5
  297. package/dist/scripts/fsx-hotpath-check.js +0 -1
  298. package/dist/scripts/gate-policy-audit-check.js +1 -1
  299. package/dist/scripts/geo-claim-evidence-check.js +0 -1
  300. package/dist/scripts/geo-cli-blackbox-check.js +0 -1
  301. package/dist/scripts/geo-crawler-policy-check.js +0 -1
  302. package/dist/scripts/git-worktree-diff-envelope-check.js +0 -1
  303. package/dist/scripts/git-worktree-dirty-lock-check.js +0 -1
  304. package/dist/scripts/git-worktree-dirty-main-detection-check.js +0 -1
  305. package/dist/scripts/git-worktree-integration-primary-check.js +0 -1
  306. package/dist/scripts/git-worktree-manifest-append-check.js +0 -1
  307. package/dist/scripts/git-worktree-untracked-diff-check.js +0 -1
  308. package/dist/scripts/high-risk-contracts-check.js +0 -1
  309. package/dist/scripts/hook-latency-budget-check.js +0 -1
  310. package/dist/scripts/hook-latency-quantum-check.js +0 -1
  311. package/dist/scripts/image-artifact-path-contract-check.js +0 -1
  312. package/dist/scripts/imagegen-real-smoke-check.js +0 -1
  313. package/dist/scripts/import-graph-budget-check.js +0 -1
  314. package/dist/scripts/installed-package-smoke-check.js +0 -1
  315. package/dist/scripts/legacy-gate-purge-check.js +0 -1
  316. package/dist/scripts/lib/codex-sdk-gate-lib.js +0 -3
  317. package/dist/scripts/lib/ensure-dist-fresh.js +0 -1
  318. package/dist/scripts/lib/valid-png-fixture.js +0 -1
  319. package/dist/scripts/local-collab-all-pipelines-final-gpt-check.js +0 -1
  320. package/dist/scripts/loop-directive-check-lib.js +0 -1
  321. package/dist/scripts/loop-worker-fixture-child.js +0 -1
  322. package/dist/scripts/mad-preflight-blocks-unreadable-config-check.js +0 -10
  323. package/dist/scripts/mad-sks-sql-plane-lifecycle-hook-decision-check.js +0 -1
  324. package/dist/scripts/mad-sks-sql-plane-result-lifecycle-check.js +0 -1
  325. package/dist/scripts/mcp-plugin-inventory-check.js +0 -1
  326. package/dist/scripts/mcp-tool-naming-parity-check.js +0 -1
  327. package/dist/scripts/model-call-concurrency-check.js +0 -1
  328. package/dist/scripts/mutation-callsite-coverage-check.js +0 -5
  329. package/dist/scripts/naruto-codex-e2e-check.js +0 -1
  330. package/dist/scripts/naruto-worktree-coding-blackbox.js +0 -1
  331. package/dist/scripts/official-subagent-workflow-check.js +3 -1
  332. package/dist/scripts/ops-diagnostics-bundle-check.js +0 -1
  333. package/dist/scripts/packlist-performance-check.js +1 -3
  334. package/dist/scripts/perf-budget-check.js +0 -1
  335. package/dist/scripts/ppt-full-e2e-blackbox-check.js +0 -1
  336. package/dist/scripts/ppt-real-export-adapter-check.js +0 -1
  337. package/dist/scripts/ppt-real-imagegen-smoke-check.js +0 -1
  338. package/dist/scripts/ppt-real-imagegen-wiring-check.js +0 -1
  339. package/dist/scripts/ppt-reexport-rereview-check.js +0 -1
  340. package/dist/scripts/prepublish-fast-check.js +0 -23
  341. package/dist/scripts/prepublish-release-check-or-fast.js +0 -7
  342. package/dist/scripts/probe-memoization-check.js +0 -1
  343. package/dist/scripts/product-design-plugin-routing-check.js +0 -1
  344. package/dist/scripts/project-skill-dedupe-blackbox.js +36 -9
  345. package/dist/scripts/prompt-placeholder-guard-check.js +0 -1
  346. package/dist/scripts/python-codex-sdk-all-pipelines-check.js +0 -3
  347. package/dist/scripts/qa-loop-app-handoff-capability-check.js +0 -1
  348. package/dist/scripts/qa-loop-app-handoff-check.js +0 -1
  349. package/dist/scripts/qa-loop-app-handoff-cli-check.js +0 -1
  350. package/dist/scripts/qa-loop-app-handoff-confirmation-check.js +0 -1
  351. package/dist/scripts/qa-loop-app-handoff-gate-lifecycle-check.js +0 -1
  352. package/dist/scripts/qa-loop-app-handoff-launch-check.js +0 -1
  353. package/dist/scripts/qa-loop-app-handoff-status-lifecycle-check.js +0 -1
  354. package/dist/scripts/qa-loop-budget-policy-check.js +0 -1
  355. package/dist/scripts/qa-loop-effort-escalation-check.js +0 -1
  356. package/dist/scripts/qa-loop-image-path-exposure-check.js +0 -1
  357. package/dist/scripts/qa-loop-image-path-prompt-injection-check.js +0 -1
  358. package/dist/scripts/release-cache-glob-hashing-check.js +0 -1
  359. package/dist/scripts/release-cache-input-classifier-check.js +0 -1
  360. package/dist/scripts/release-cache-neutralization-report-check.js +0 -1
  361. package/dist/scripts/release-cache-version-neutral-fixture-check.js +0 -1
  362. package/dist/scripts/release-check-stamp.js +0 -4
  363. package/dist/scripts/release-dist-freshness-check.js +0 -1
  364. package/dist/scripts/release-full-parallelism-blackbox.js +3 -3
  365. package/dist/scripts/release-gate-batch-runner-check.js +22 -0
  366. package/dist/scripts/release-gate-budget-check.js +0 -6
  367. package/dist/scripts/release-gate-dag-runner-check.js +0 -1
  368. package/dist/scripts/release-latency-slo-check.js +0 -1
  369. package/dist/scripts/release-metadata-1-19-check.js +0 -1
  370. package/dist/scripts/release-metadata-check.js +0 -3
  371. package/dist/scripts/release-parallel-speed-budget-check.js +0 -5
  372. package/dist/scripts/release-proof-truth-check.js +0 -1
  373. package/dist/scripts/release-provenance-check.js +0 -1
  374. package/dist/scripts/release-real-check.js +0 -1
  375. package/dist/scripts/release-runtime-truth-matrix-check.js +0 -1
  376. package/dist/scripts/release-version-truth-check.js +0 -1
  377. package/dist/scripts/research-blueprint-densifier-check.js +0 -1
  378. package/dist/scripts/research-claim-builder-check.js +0 -1
  379. package/dist/scripts/research-complete-package-fixture-check.js +0 -1
  380. package/dist/scripts/research-final-reviewer-blackbox.js +0 -1
  381. package/dist/scripts/responses-retry-policy-centralized-check.js +0 -1
  382. package/dist/scripts/retention-apply-smoke-check.js +0 -1
  383. package/dist/scripts/retention-budget-check.js +0 -1
  384. package/dist/scripts/retention-dry-run-check.js +0 -1
  385. package/dist/scripts/rollback-recovery-smoke-check.js +0 -1
  386. package/dist/scripts/route-intent-regression-check.js +0 -1
  387. package/dist/scripts/runtime-current-terminal-check.js +0 -1
  388. package/dist/scripts/runtime-dist-parity-check.js +0 -1
  389. package/dist/scripts/runtime-no-src-mjs-check.js +0 -1
  390. package/dist/scripts/runtime-proof-summary-check.js +0 -1
  391. package/dist/scripts/runtime-ts-rust-boundary-check.js +0 -15
  392. package/dist/scripts/runtime-ts-source-of-truth-check.js +0 -1
  393. package/dist/scripts/scheduler-batch-dispatch-check.js +0 -1
  394. package/dist/scripts/scheduler-parallel-proof-consistency-check.js +0 -1
  395. package/dist/scripts/scheduler-utilization-integral-check.js +0 -1
  396. package/dist/scripts/search-visibility-gate-lib.js +0 -1
  397. package/dist/scripts/seo-audit-fixture-check.js +0 -1
  398. package/dist/scripts/seo-cli-blackbox-check.js +0 -1
  399. package/dist/scripts/seo-geo-geo-disambiguation-check.js +0 -1
  400. package/dist/scripts/seo-geo-route-identity-check.js +0 -1
  401. package/dist/scripts/seo-geo-skill-rich-content-check.js +0 -1
  402. package/dist/scripts/seo-marketing-truthfulness-check.js +0 -1
  403. package/dist/scripts/seo-metadata-sync-check.js +0 -1
  404. package/dist/scripts/seo-no-mutation-by-default-check.js +0 -1
  405. package/dist/scripts/shared-memory-fixture-check.js +0 -1
  406. package/dist/scripts/side-effect-runtime-report-check.js +0 -1
  407. package/dist/scripts/sizecheck.js +0 -1
  408. package/dist/scripts/sks-1-11-gate-lib.js +0 -1
  409. package/dist/scripts/sks-1-12-real-execution-check-lib.js +0 -1
  410. package/dist/scripts/sks-1-18-gate-lib.js +0 -1
  411. package/dist/scripts/sks-menubar-install-check.js +0 -3
  412. package/dist/scripts/sksd-daemon-check.js +0 -1
  413. package/dist/scripts/super-search-live-smoke-check.js +0 -1
  414. package/dist/scripts/super-search-local-http-smoke-check.js +0 -1
  415. package/dist/scripts/super-search-offline-contract-check.js +0 -1
  416. package/dist/scripts/super-search-provider-interface-check.js +0 -1
  417. package/dist/scripts/triwiki-cache-key-check.js +0 -1
  418. package/dist/scripts/triwiki-proof-bank-blackbox.js +0 -1
  419. package/dist/scripts/triwiki-proof-bank-check.js +0 -1
  420. package/dist/scripts/triwiki-proof-card-check.js +0 -1
  421. package/dist/scripts/trust-fixture-check.js +0 -1
  422. package/dist/scripts/ultra-router-auto-router-check.js +0 -1
  423. package/dist/scripts/update-fastpath-check.js +0 -1
  424. package/dist/scripts/upgrade-migration-matrix-check.js +0 -1
  425. package/dist/scripts/ux-review-extract-wires-real-extractor-check.js +0 -1
  426. package/dist/scripts/ux-review-imagegen-blackbox-check.js +0 -1
  427. package/dist/scripts/ux-review-patch-diff-recheck-check.js +0 -1
  428. package/dist/scripts/ux-review-real-imagegen-smoke-check.js +0 -1
  429. package/dist/scripts/ux-review-run-wires-imagegen-check.js +0 -1
  430. package/dist/scripts/write-build-manifest.js +0 -1
  431. package/dist/scripts/wrongness-fixture-check.js +0 -1
  432. package/dist/scripts/zellij-capability-check.js +0 -1
  433. package/dist/scripts/zellij-developer-controls-check.js +0 -1
  434. package/dist/scripts/zellij-doctor-readiness-check.js +0 -13
  435. package/dist/scripts/zellij-dynamic-pane-lifecycle-check.js +0 -1
  436. package/dist/scripts/zellij-fake-adapter-check.js +0 -1
  437. package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -1
  438. package/dist/scripts/zellij-lane-renderer-check.js +0 -1
  439. package/dist/scripts/zellij-launch-command-truth-check.js +0 -12
  440. package/dist/scripts/zellij-layout-valid-check.js +0 -1
  441. package/dist/scripts/zellij-pane-creation-lock-metrics-check.js +0 -1
  442. package/dist/scripts/zellij-pane-lock-concurrency-blackbox.js +0 -1
  443. package/dist/scripts/zellij-pane-lock-does-not-block-worker-check.js +0 -1
  444. package/dist/scripts/zellij-pane-lock-open-worker-integration-blackbox.js +0 -1
  445. package/dist/scripts/zellij-pane-proof-check.js +0 -1
  446. package/dist/scripts/zellij-qa-app-handoff-status-check.js +0 -1
  447. package/dist/scripts/zellij-real-session-cleanup-check.js +0 -1
  448. package/dist/scripts/zellij-real-session-launch-check.js +0 -1
  449. package/dist/scripts/zellij-right-column-geometry-proof.js +0 -1
  450. package/dist/scripts/zellij-right-column-headless-overflow-check.js +0 -1
  451. package/dist/scripts/zellij-right-column-manager-check.js +0 -1
  452. package/dist/scripts/zellij-screen-proof-check.js +0 -1
  453. package/dist/scripts/zellij-slot-only-ui-check.js +0 -1
  454. package/dist/scripts/zellij-slot-pane-renderer-check.js +0 -1
  455. package/dist/scripts/zellij-slot-pane-stale-detection-check.js +0 -7
  456. package/dist/scripts/zellij-slot-telemetry-incremental-check.js +0 -1
  457. package/dist/scripts/zellij-slot-telemetry-live-flush-check.js +0 -1
  458. package/dist/scripts/zellij-slot-telemetry-performance-check.js +0 -1
  459. package/dist/scripts/zellij-stacked-capability-routing-check.js +0 -1
  460. package/dist/scripts/zellij-stacked-fallback-integration-blackbox.js +0 -1
  461. package/dist/scripts/zellij-stacked-version-matrix-check.js +0 -1
  462. package/dist/scripts/zellij-stacked-version-parser-check.js +0 -1
  463. package/dist/scripts/zellij-ui-design-check.js +0 -12
  464. package/dist/scripts/zellij-update-prompt-matrix-check.js +0 -1
  465. package/dist/scripts/zellij-update-prompt-mode-check.js +0 -1
  466. package/dist/scripts/zellij-update-prompt-safety-check.js +0 -1
  467. package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -2
  468. package/package.json +1 -1
@@ -10,6 +10,7 @@ import { buildCodexLbSetupPlan, codexLbPersistenceSummary, renderCodexLbSetupPla
10
10
  import { CODEX_LB_TOOL_OUTPUT_RECOVERY_OVERRIDE_FLAG, codexLbToolOutputRecoveryOverrideAcknowledged } from '../core/codex-lb/codex-lb-tool-output-recovery.js';
11
11
  import { restartCodexApp } from '../core/codex-app/codex-app-restart.js';
12
12
  import { repairCodexAppFastUi } from '../core/codex-app/codex-app-fast-ui-repair.js';
13
+ import { loadCodexLbEnv } from '../core/codex-lb/codex-lb-env.js';
13
14
  export async function run(command, args = []) {
14
15
  const root = await projectRoot();
15
16
  const action = args[0] || 'status';
@@ -48,28 +49,52 @@ export async function run(command, args = []) {
48
49
  if (action === 'health' || action === 'verify-chain' || action === 'chain') {
49
50
  const allowUnverifiedToolOutputRecovery = codexLbToolOutputRecoveryOverrideAcknowledged({ args });
50
51
  const status = await codexLbStatus({ probeToolOutputRecovery: true, allowUnverifiedToolOutputRecovery });
51
- const blocker = !status.env_key_configured ? 'missing_env_key' : !status.base_url ? 'missing_base_url' : 'not_configured';
52
- const result = status.selected && status.tool_output_recovery?.ok !== true
52
+ const modelSelection = await resolveCodexLbHealthModel(status);
53
+ const loadedEnv = await loadCodexLbEnv({ home: path.dirname(path.dirname(status.env_path)), envPath: status.env_path });
54
+ const bindingBlocker = loadedEnv.credential_binding.blockers[0] || null;
55
+ const providerUrlMismatch = status.provider_configured === true && status.provider_base_url_matches_credential !== true;
56
+ const blocker = bindingBlocker
57
+ || (providerUrlMismatch ? 'provider_base_url_mismatch' : null)
58
+ || (!status.env_key_configured
59
+ ? 'missing_env_key'
60
+ : !status.base_url
61
+ ? 'missing_base_url'
62
+ : !modelSelection.model
63
+ ? 'model_unselected'
64
+ : 'not_configured');
65
+ const chain = status.selected && status.tool_output_recovery?.ok !== true
53
66
  ? { ok: false, status: 'tool_output_recovery_blocked', codex_lb: status, tool_output_recovery: status.tool_output_recovery }
54
- : status.ok
55
- ? await checkCodexLbResponseChain(status, { force: true, root, fastMode: flag(args, '--fast') || flag(args, '--priority') })
67
+ : !bindingBlocker && !providerUrlMismatch && status.env_key_configured && loadedEnv.base_url && loadedEnv.secret_api_key && modelSelection.model
68
+ ? await checkCodexLbResponseChain(status, {
69
+ force: true,
70
+ root,
71
+ fastMode: flag(args, '--fast') || flag(args, '--priority'),
72
+ model: modelSelection.model,
73
+ baseUrl: loadedEnv.base_url,
74
+ apiKey: loadedEnv.secret_api_key
75
+ })
56
76
  : { ok: false, status: blocker, codex_lb: status };
77
+ const result = { ...chain, codex_lb: status, model_selection: modelSelection };
78
+ if (!result.ok)
79
+ process.exitCode = 1;
57
80
  if (flag(args, '--json'))
58
81
  return printJson(result);
59
82
  console.log(`codex-lb response chain: ${result.ok ? 'ok' : `failed (${result.status})`}`);
60
- if (!result.ok)
61
- process.exitCode = 1;
62
83
  return;
63
84
  }
64
85
  if (action === 'fast-check' || action === 'fast' || action === 'verify-fast') {
65
86
  const allowUnverifiedToolOutputRecovery = codexLbToolOutputRecoveryOverrideAcknowledged({ args });
66
87
  const status = await codexLbStatus({ probeToolOutputRecovery: true, allowUnverifiedToolOutputRecovery });
67
- const blocker = !status.env_key_configured ? 'missing_env_key' : !status.base_url ? 'missing_base_url' : !status.provider_contract_ok ? 'provider_contract_drift' : 'not_configured';
88
+ const loadedEnv = await loadCodexLbEnv({ home: path.dirname(path.dirname(status.env_path)), envPath: status.env_path });
89
+ const bindingBlocker = loadedEnv.credential_binding.blockers[0] || null;
90
+ const providerUrlMismatch = status.provider_configured === true && status.provider_base_url_matches_credential !== true;
91
+ const blocker = bindingBlocker || (providerUrlMismatch ? 'provider_base_url_mismatch' : null)
92
+ || (!status.env_key_configured ? 'missing_env_key' : !status.base_url ? 'missing_base_url' : !status.provider_contract_ok ? 'provider_contract_drift' : 'not_configured');
68
93
  const modelSelection = await resolveCodexLbFastCheckModel(status);
69
94
  const chain = status.selected && status.tool_output_recovery?.ok !== true
70
95
  ? { ok: false, status: 'tool_output_recovery_blocked', codex_lb: status, tool_output_recovery: status.tool_output_recovery }
71
- : status.env_key_configured && status.base_url && modelSelection.model
72
- ? await checkCodexLbResponseChain(status, { force: true, cache: false, root, fastMode: true, model: modelSelection.model })
96
+ : !bindingBlocker && !providerUrlMismatch && status.env_key_configured && loadedEnv.base_url && loadedEnv.secret_api_key && modelSelection.model
97
+ ? await checkCodexLbResponseChain(status, { force: true, cache: false, root, fastMode: true, model: modelSelection.model, baseUrl: loadedEnv.base_url, apiKey: loadedEnv.secret_api_key })
73
98
  : { ok: false, status: modelSelection.model ? blocker : 'model_unselected', codex_lb: status };
74
99
  const evidence = await fastEvidenceFromChain(chain, readOption(args, '--request-log', readOption(args, '--request-log-json', null)));
75
100
  const providerReady = status.provider_contract_ok === true;
@@ -199,21 +224,41 @@ export async function run(command, args = []) {
199
224
  return;
200
225
  }
201
226
  if (action === 'use-codex-lb' || action === 'use-lb') {
202
- const result = await repairCodexLbAuth({
227
+ const restartRequired = flag(args, '--restart-app') || flag(args, '--restart');
228
+ const repairOptions = {
203
229
  forceCodexLbApiKeyAuth: true,
204
230
  authMode: 'codex-lb',
205
231
  forceFastMode: !flag(args, '--no-fast'),
206
232
  allowUnverifiedToolOutputRecovery: codexLbToolOutputRecoveryOverrideAcknowledged({ args })
207
- });
233
+ };
234
+ const result = await repairCodexLbAuth(repairOptions);
208
235
  const fastUi = await repairCodexAppFastUiAfterMutation(root, Boolean(result.ok));
209
236
  const restart = await maybeRestartCodexAppForAuthSwitch(args, Boolean(result.ok && fastUi.ok));
210
- const ok = Boolean(result.ok && fastUi.ok && restart?.ok !== false);
211
- const shaped = { ...result, ok, mode: 'codex-lb', codex_app_fast_ui: fastUi, restart_app: restart };
237
+ const postRestart = await reconcileCodexLbAfterRestart(restart, repairOptions, Boolean(result.ok && fastUi.ok), restartRequired);
238
+ const finalStatus = postRestart.attempted ? postRestart.stable_status : result.codex_lb;
239
+ const readiness = codexLbActivationReadiness(finalStatus);
240
+ const restartRequirement = codexLbRestartPostcondition(restart, restartRequired);
241
+ const restartPerformed = restartRequirement.performed;
242
+ const restartSatisfied = restartRequirement.satisfied;
243
+ const ok = Boolean(result.ok && fastUi.ok && restart?.ok !== false && restartSatisfied && postRestart.ok && readiness.ok);
244
+ const shaped = {
245
+ ...result,
246
+ ok,
247
+ mode: 'codex-lb',
248
+ codex_lb: finalStatus,
249
+ readiness,
250
+ restart_required: restartRequired,
251
+ restart_performed: restartPerformed,
252
+ codex_app_fast_ui: fastUi,
253
+ restart_app: restart,
254
+ post_restart: postRestart
255
+ };
212
256
  if (!ok)
213
257
  process.exitCode = 1;
214
258
  if (flag(args, '--json'))
215
259
  return printJson(shaped);
216
- console.log(result.ok ? 'Auth mode: codex-lb selected (API key).' : `Switch to codex-lb failed: ${result.status}${result.error ? `: ${result.error}` : ''}`);
260
+ const failureStatus = !restartSatisfied ? 'restart_not_performed' : postRestart.status || result.status;
261
+ console.log(ok ? 'Auth mode: codex-lb selected (API key).' : `Switch to codex-lb failed: ${failureStatus}${result.error ? `: ${result.error}` : ''}`);
217
262
  if (restart?.status === 'restarted')
218
263
  console.log('Codex App restarted for codex-lb auth.');
219
264
  if (!ok)
@@ -221,12 +266,22 @@ export async function run(command, args = []) {
221
266
  return;
222
267
  }
223
268
  if (action === 'use-oauth' || action === 'use-chatgpt') {
269
+ const restartRequired = flag(args, '--restart-app') || flag(args, '--restart');
224
270
  const result = await releaseCodexLbAuthHold({ force: flag(args, '--force') });
225
271
  const authOk = !['no_backup', 'auth_in_use', 'failed'].includes(result.status);
226
272
  const fastUi = await repairCodexAppFastUiAfterMutation(root, authOk);
227
273
  const restart = await maybeRestartCodexAppForAuthSwitch(args, Boolean(authOk && fastUi.ok));
228
- const ok = Boolean(authOk && fastUi.ok && restart?.ok !== false);
229
- const shaped = { ...result, ok, mode: 'oauth', codex_app_fast_ui: fastUi, restart_app: restart };
274
+ const restartRequirement = codexLbRestartPostcondition(restart, restartRequired);
275
+ const ok = Boolean(authOk && fastUi.ok && restart?.ok !== false && restartRequirement.satisfied);
276
+ const shaped = {
277
+ ...result,
278
+ ok,
279
+ mode: 'oauth',
280
+ restart_required: restartRequired,
281
+ restart_performed: restartRequirement.performed,
282
+ codex_app_fast_ui: fastUi,
283
+ restart_app: restart
284
+ };
230
285
  if (!ok)
231
286
  process.exitCode = 1;
232
287
  if (flag(args, '--json'))
@@ -238,7 +293,9 @@ export async function run(command, args = []) {
238
293
  process.exitCode = 1;
239
294
  return;
240
295
  }
241
- console.log(`Auth mode: ${['released', 'oauth_restored'].includes(result.status) ? 'ChatGPT OAuth restored' : result.status}.`);
296
+ console.log(ok
297
+ ? `Auth mode: ${['released', 'oauth_restored'].includes(result.status) ? 'ChatGPT OAuth restored' : result.status}.`
298
+ : `Switch to ChatGPT OAuth failed: ${restartRequirement.satisfied ? result.status : 'restart_not_performed'}.`);
242
299
  if (restart?.status === 'restarted')
243
300
  console.log('Codex App restarted for ChatGPT OAuth.');
244
301
  if (['auth_in_use', 'failed'].includes(result.status))
@@ -421,6 +478,95 @@ async function maybeRestartCodexAppForAuthSwitch(args = [], enabled) {
421
478
  const shouldRestart = requested || (!flag(args, '--json') && !flag(args, '--no-restart-app') && !flag(args, '--no-restart'));
422
479
  return restartCodexApp({ enabled: shouldRestart });
423
480
  }
481
+ export function codexLbRestartPostcondition(restart = {}, required = false) {
482
+ const performed = restart?.status === 'restarted';
483
+ return {
484
+ required: Boolean(required),
485
+ performed,
486
+ satisfied: !required || performed
487
+ };
488
+ }
489
+ async function reconcileCodexLbAfterRestart(restart, repairOptions, enabled, restartRequired = false) {
490
+ if (!enabled || restart?.status !== 'restarted') {
491
+ const restartRequirement = codexLbRestartPostcondition(restart, restartRequired);
492
+ return {
493
+ schema: 'sks.codex-lb-post-restart.v1',
494
+ ok: Boolean(enabled && restart?.ok !== false && restartRequirement.satisfied),
495
+ attempted: false,
496
+ status: restartRequired && !restartRequirement.performed ? 'restart_not_performed' : 'skipped',
497
+ reason: !enabled ? 'previous_step_failed' : restart?.reason || restart?.status || 'restart_not_performed',
498
+ attempts: 0,
499
+ observations: [],
500
+ selected: null,
501
+ provider_ready: null,
502
+ auth_routing_coherent: null,
503
+ shared_openai_routing_safe: null,
504
+ reconcile: null,
505
+ codex_lb: null,
506
+ repair: null,
507
+ stable_status: null,
508
+ readiness: null
509
+ };
510
+ }
511
+ await codexLbRestartSettle(750);
512
+ const repair = await repairCodexLbAuth(repairOptions);
513
+ const observations = [];
514
+ let stableStatus = null;
515
+ for (let attempt = 1; attempt <= 3; attempt += 1) {
516
+ if (attempt > 1)
517
+ await codexLbRestartSettle(750);
518
+ stableStatus = await codexLbStatus({
519
+ probeToolOutputRecovery: false
520
+ });
521
+ observations.push({ attempt, readiness: codexLbActivationReadiness(stableStatus) });
522
+ }
523
+ const readiness = codexLbActivationReadiness(stableStatus);
524
+ const finalTwoReady = observations.slice(-2).every((observation) => observation.readiness.ok === true);
525
+ const regressed = observations.some((observation, index) => index > 0
526
+ && observations[index - 1].readiness.ok === true
527
+ && observation.readiness.ok !== true);
528
+ const stable = finalTwoReady && !regressed;
529
+ return {
530
+ schema: 'sks.codex-lb-post-restart.v1',
531
+ ok: Boolean(repair.ok && readiness.ok && stable),
532
+ attempted: true,
533
+ status: repair.ok && readiness.ok && stable ? 'reconciled_stable' : 'reconcile_failed',
534
+ attempts: observations.length,
535
+ stable,
536
+ observations,
537
+ selected: readiness.selected,
538
+ provider_ready: readiness.provider_ready,
539
+ auth_routing_coherent: readiness.auth_routing_coherent,
540
+ shared_openai_routing_safe: readiness.shared_openai_routing_safe,
541
+ reconcile: repair,
542
+ codex_lb: stableStatus,
543
+ repair,
544
+ stable_status: stableStatus,
545
+ readiness
546
+ };
547
+ }
548
+ function codexLbRestartSettle(ms) {
549
+ return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
550
+ }
551
+ function codexLbActivationReadiness(status = {}) {
552
+ const selected = status?.selected === true;
553
+ const providerReady = status?.provider_ready === true;
554
+ const authRoutingCoherent = status?.auth_routing_coherent === true;
555
+ const sharedOpenAiRoutingSafe = status?.shared_openai_routing?.safe === true;
556
+ return {
557
+ ok: selected && providerReady && authRoutingCoherent && sharedOpenAiRoutingSafe,
558
+ selected,
559
+ provider_ready: providerReady,
560
+ auth_routing_coherent: authRoutingCoherent,
561
+ shared_openai_routing_safe: sharedOpenAiRoutingSafe,
562
+ blockers: [
563
+ ...(selected ? [] : ['codex_lb_not_selected']),
564
+ ...(providerReady ? [] : ['codex_lb_provider_not_ready']),
565
+ ...(authRoutingCoherent ? [] : ['codex_lb_auth_routing_incoherent']),
566
+ ...(sharedOpenAiRoutingSafe ? [] : ['codex_lb_shared_openai_routing_unsafe'])
567
+ ]
568
+ };
569
+ }
424
570
  async function repairCodexAppFastUiAfterMutation(root, enabled) {
425
571
  if (!enabled) {
426
572
  return {
@@ -451,6 +597,12 @@ export function isCodexLbFastChainVerified(chain = {}) {
451
597
  return chain.ok === true && chain.skipped !== true;
452
598
  }
453
599
  export async function resolveCodexLbFastCheckModel(status = {}, env = process.env) {
600
+ return resolveCodexLbModel(status, env, { requirePriority: true, blockerPrefix: 'codex_lb_fast_check' });
601
+ }
602
+ export async function resolveCodexLbHealthModel(status = {}, env = process.env) {
603
+ return resolveCodexLbModel(status, env, { requirePriority: false, blockerPrefix: 'codex_lb_health' });
604
+ }
605
+ async function resolveCodexLbModel(status = {}, env = process.env, opts = {}) {
454
606
  const explicit = String(env.SKS_CODEX_MODEL || env.CODEX_MODEL || '').trim();
455
607
  if (explicit)
456
608
  return { model: explicit, source: env.SKS_CODEX_MODEL ? 'SKS_CODEX_MODEL' : 'CODEX_MODEL', blockers: [] };
@@ -461,7 +613,7 @@ export async function resolveCodexLbFastCheckModel(status = {}, env = process.en
461
613
  return { model: configured, source: 'global_config', blockers: [] };
462
614
  const configuredCatalogPath = topLevelTomlString(config, 'model_catalog_json');
463
615
  if (!configuredCatalogPath)
464
- return { model: null, source: null, blockers: ['codex_lb_fast_check_model_unselected'] };
616
+ return { model: null, source: null, blockers: [`${opts.blockerPrefix}_model_unselected`] };
465
617
  const home = String(env.HOME || '').trim();
466
618
  const expandedCatalogPath = configuredCatalogPath.startsWith('~/') && home
467
619
  ? path.join(home, configuredCatalogPath.slice(2))
@@ -471,13 +623,13 @@ export async function resolveCodexLbFastCheckModel(status = {}, env = process.en
471
623
  : path.resolve(path.dirname(configPath), expandedCatalogPath);
472
624
  try {
473
625
  const payload = JSON.parse(await readText(catalogPath, ''));
474
- const model = selectPriorityCapableCatalogModel(payload);
626
+ const model = selectCatalogModel(payload, opts.requirePriority === true);
475
627
  return model
476
628
  ? { model, source: 'model_catalog_json', blockers: [] }
477
- : { model: null, source: 'model_catalog_json', blockers: ['codex_lb_fast_check_priority_model_unavailable'] };
629
+ : { model: null, source: 'model_catalog_json', blockers: [`${opts.blockerPrefix}_${opts.requirePriority === true ? 'priority_' : ''}model_unavailable`] };
478
630
  }
479
631
  catch {
480
- return { model: null, source: 'model_catalog_json', blockers: ['codex_lb_fast_check_catalog_invalid'] };
632
+ return { model: null, source: 'model_catalog_json', blockers: [`${opts.blockerPrefix}_catalog_invalid`] };
481
633
  }
482
634
  }
483
635
  function topLevelTomlString(text, key) {
@@ -485,12 +637,14 @@ function topLevelTomlString(text, key) {
485
637
  const escaped = key.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
486
638
  return (topLevel.match(new RegExp(`(?:^|\\n)\\s*${escaped}\\s*=\\s*"([^"]+)"`))?.[1] || '').trim();
487
639
  }
488
- function selectPriorityCapableCatalogModel(payload = {}) {
640
+ function selectCatalogModel(payload = {}, requirePriority = false) {
489
641
  const models = Array.isArray(payload?.models) ? payload.models : Array.isArray(payload?.data) ? payload.data : [];
490
642
  return models
491
643
  .filter((row) => {
492
644
  if (!row || typeof row !== 'object' || row.supported_in_api !== true || typeof row.slug !== 'string' || !row.slug.trim())
493
645
  return false;
646
+ if (!requirePriority)
647
+ return true;
494
648
  const serviceTiers = Array.isArray(row.service_tiers) ? row.service_tiers : [];
495
649
  const speedTiers = Array.isArray(row.additional_speed_tiers) ? row.additional_speed_tiers : [];
496
650
  return serviceTiers.some((tier) => normalizeTier(typeof tier === 'string' ? tier : tier?.id) === 'priority')
@@ -6,7 +6,7 @@ import { codexSchemaSnapshotReport } from '../core/codex-compat/codex-schema-sna
6
6
  import { detectCodex0141Capability } from '../core/codex-control/codex-0141-capability.js';
7
7
  import { detectCodex0144Capability } from '../core/codex-control/codex-0144-capability.js';
8
8
  import { CURRENT_CODEX_RELEASE_MANIFEST } from '../core/codex-compat/codex-release-manifest.js';
9
- import { inspectCodexCliUpdate, updateCodexCliNow } from '../core/codex/codex-cli-update.js';
9
+ import { codexCliUpdateConsoleLines, inspectCodexCliUpdate, updateCodexCliNow } from '../core/codex/codex-cli-update.js';
10
10
  export async function run(_command, args = []) {
11
11
  const action = args[0] || 'compatibility';
12
12
  if (action === 'compatibility' || action === 'compat') {
@@ -54,13 +54,8 @@ export async function run(_command, args = []) {
54
54
  process.exitCode = 1;
55
55
  return;
56
56
  }
57
- console.log(`Codex CLI update: ${result.status}${result.after_version ? ` (${result.before_version || 'unknown'} -> ${result.after_version})` : ''}`);
58
- if (result.raw_output)
59
- console.log(result.raw_output);
60
- for (const blocker of result.blockers)
61
- console.log(`- blocker: ${blocker}`);
62
- for (const actionLine of result.guidance)
63
- console.log(`- ${actionLine}`);
57
+ for (const line of codexCliUpdateConsoleLines(result))
58
+ console.log(line);
64
59
  if (!result.ok)
65
60
  process.exitCode = 1;
66
61
  return;
@@ -23,6 +23,7 @@ import { writeMcpPluginInventoryArtifacts } from '../core/mcp/mcp-plugin-invento
23
23
  import { buildCodexAppHarnessMatrix } from '../core/codex-app/codex-app-harness-matrix.js';
24
24
  import { buildCodexNativeFeatureMatrix } from '../core/codex-native/codex-native-feature-broker.js';
25
25
  import { withSecretPreservationGuard } from '../core/config/config-migration-journal.js';
26
+ import { reconcileDoctorSkills } from '../core/doctor/doctor-skill-reconcile.js';
26
27
  import { isUpdateMigrationReceiptCurrent, projectUpdateMigrationReceiptPath, writeProjectUpdateMigrationReceipt } from '../core/update/update-migration-state.js';
27
28
  import { inspectSksMenuBarStatus, installSksMenuBar } from '../core/codex-app/sks-menubar.js';
28
29
  import { sweepSksTempDirs } from '../core/retention.js';
@@ -140,6 +141,7 @@ export async function executeDoctorGlobalOnlyFix(args = [], root, deps = {}) {
140
141
  }));
141
142
  const recoveryReady = codexLbRecoveryStatusReady(providerStatus, true);
142
143
  const globalSkillsReady = !globalSkills?.error
144
+ && globalSkills?.ok !== false
143
145
  && globalSkills?.core_skill_integrity?.ok !== false;
144
146
  const globalFastModeReady = globalFastMode?.status !== 'failed'
145
147
  && globalFastMode?.ok !== false;
@@ -445,20 +447,7 @@ async function runDoctor(args = [], root, doctorFix) {
445
447
  : await (await import('../cli/install-helpers.js')).ensureGlobalCodexFastModeDuringInstall().catch((err) => ({ status: 'failed', error: err?.message || String(err) }))
446
448
  };
447
449
  }
448
- const skillsReconcile = doctorFix
449
- ? {
450
- global: await (await import('../core/init/skills.js')).reconcileSkills({
451
- targetDir: path.join(process.env.HOME || os.homedir(), '.agents', 'skills'),
452
- scope: 'global',
453
- fix: true
454
- }).catch((err) => ({ ok: false, error: err?.message || String(err) })),
455
- project: await (await import('../core/init/skills.js')).reconcileSkills({
456
- targetDir: path.join(root, '.agents', 'skills'),
457
- scope: 'project',
458
- fix: true
459
- }).catch((err) => ({ ok: false, error: err?.message || String(err) }))
460
- }
461
- : { skipped: true, reason: 'doctor_without_fix' };
450
+ const skillsReconcile = await reconcileDoctorSkills(root, doctorFix);
462
451
  const commandAliasCleanup = await runDoctorCommandAliasCleanup({
463
452
  root,
464
453
  fix: doctorFix
@@ -1203,6 +1192,7 @@ async function runDoctor(args = [], root, doctorFix) {
1203
1192
  doctor_dirty_plan: doctorDirtyPlan,
1204
1193
  doctor_fix_postcheck: doctorFixPostcheck,
1205
1194
  doctor_native_capability: doctorNativeCapabilityRepair,
1195
+ skills: skillsReconcile,
1206
1196
  local_model: localModel,
1207
1197
  agent_role_config: agentRoleConfigRepair,
1208
1198
  repair: configRepair,
@@ -1,5 +1,6 @@
1
1
  import { performance } from 'node:perf_hooks';
2
2
  import { spawnSync } from 'node:child_process';
3
+ import { fileURLToPath } from 'node:url';
3
4
  import { PACKAGE_VERSION, projectRoot } from '../core/fsx.js';
4
5
  import { flag } from '../cli/args.js';
5
6
  import { printJson } from '../cli/output.js';
@@ -61,7 +62,7 @@ export async function run(_command, args = []) {
61
62
  return perfCommand(action, args.slice(1));
62
63
  }
63
64
  export function runColdStart({ root = process.cwd(), iterations = DEFAULT_COLD_START_ITERATIONS, tier = 'source-local' } = {}) {
64
- const script = new URL('../bin/sks.js', import.meta.url).pathname;
65
+ const script = coldStartCliEntrypoint();
65
66
  const measuredIterations = resolveColdStartIterations(iterations);
66
67
  const budgets = (COLD_START_TIERS[tier] || COLD_START_TIERS['source-local']);
67
68
  const commands = COLD_START_COMMANDS.map((spec) => measureCommand(root, script, { ...spec, budget_p95_ms: budgets[spec.cmd] }, measuredIterations));
@@ -76,6 +77,9 @@ export function runColdStart({ root = process.cwd(), iterations = DEFAULT_COLD_S
76
77
  ok: commands.every((row) => row.ok)
77
78
  };
78
79
  }
80
+ export function coldStartCliEntrypoint(moduleUrl = import.meta.url) {
81
+ return fileURLToPath(new URL('../bin/sks.js', moduleUrl));
82
+ }
79
83
  export function resolveColdStartIterations(value = DEFAULT_COLD_START_ITERATIONS) {
80
84
  const parsed = Number(value ?? DEFAULT_COLD_START_ITERATIONS);
81
85
  if (!Number.isFinite(parsed) || parsed <= 0)
@@ -7,8 +7,6 @@ export async function run(_command = 'zellij-slot-column-anchor', args = []) {
7
7
  const intervalMs = Math.max(250, Number(readOption(args, '--interval-ms', '1000') || 1000));
8
8
  for (;;) {
9
9
  const text = await renderZellijSlotColumnAnchorFromArtifacts({ artifactRoot, missionId, mode });
10
- // Cursor-home + clear-to-end redraw; `\x1Bc` (RIS) resets the pane's
11
- // scrollback/modes every tick and intermittently breaks scrolling.
12
10
  process.stdout.write('\x1b[H' + text + '\n\x1b[0J');
13
11
  if (!watch)
14
12
  break;
@@ -53,9 +53,6 @@ export async function run(_command = 'zellij-slot-pane', args = []) {
53
53
  process.stdout.write(redrawFrame(text));
54
54
  if (!watch)
55
55
  break;
56
- // Root-cause-3 fix: exit the pane once the worker has reached a terminal state and written its
57
- // result, so the pane closes (or shows the final exited frame) instead of looping forever and
58
- // perpetually re-reporting telemetry staleness.
59
56
  const shouldExit = await resolveZellijSlotPaneExit({ artifactDir, artifactRoot, missionId, slotId, generationIndex }).catch(() => false);
60
57
  if (shouldExit) {
61
58
  await new Promise((resolve) => setTimeout(resolve, 5000));
@@ -75,10 +72,6 @@ function readOption(args, name, fallback) {
75
72
  const index = args.indexOf(name);
76
73
  return index >= 0 && args[index + 1] ? String(args[index + 1]) : fallback;
77
74
  }
78
- // Redraw in place with cursor-home + clear-to-end instead of `\x1Bc` (RIS).
79
- // RIS performs a full terminal reset every tick, which wipes the Zellij pane's
80
- // scrollback and resets scroll position/modes — the cause of intermittent
81
- // "scrolling stops working" while a watch pane is refreshing.
82
75
  function redrawFrame(text) {
83
76
  return '\x1b[H' + text + '\n\x1b[0J';
84
77
  }
@@ -315,8 +315,6 @@ async function zellijDispatch(root, args, json) {
315
315
  process.exitCode = 1;
316
316
  }
317
317
  async function zellijRepair(root, args, json) {
318
- // Explain-only by default: SKS never auto-installs Zellij (no Homebrew/cargo
319
- // side-effects from this command). It surfaces the exact operator steps.
320
318
  const capability = await checkZellijCapability({ root, require: false });
321
319
  const status = capability.status || 'unknown';
322
320
  const autoInstall = false;