sneakoscope 10.3.7 → 10.3.9

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 (388) hide show
  1. package/README.md +17 -183
  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 +1 -1
  5. package/dist/cli/command-registry.js +0 -9
  6. package/dist/cli/feature-commands.js +18 -52
  7. package/dist/cli/global-mode-router.js +0 -1
  8. package/dist/cli/install-helpers-codex-lb-shared.js +0 -3
  9. package/dist/cli/install-helpers-install-support.js +1 -20
  10. package/dist/cli/install-helpers.js +3 -3
  11. package/dist/cli/install-tool-helpers.js +0 -76
  12. package/dist/cli/router.js +0 -3
  13. package/dist/commands/bridge.js +61 -1
  14. package/dist/commands/codex-app.js +4 -1
  15. package/dist/commands/decision.js +1 -1
  16. package/dist/commands/doctor-helpers.js +1 -20
  17. package/dist/commands/doctor.js +9 -21
  18. package/dist/commands/hook.js +3 -2
  19. package/dist/config/skills-manifest.json +1 -1
  20. package/dist/core/agent-bridge/host-capability-runtime.js +0 -3
  21. package/dist/core/agents/agent-codex-cockpit.js +0 -1
  22. package/dist/core/agents/agent-orchestrator.js +1 -1
  23. package/dist/core/agents/agent-patch-transaction-journal.js +1 -16
  24. package/dist/core/agents/agent-plan.js +0 -4
  25. package/dist/core/agents/agent-recursion-guard.js +0 -369
  26. package/dist/core/agents/agent-role-config.js +1 -15
  27. package/dist/core/agents/agent-runner-fake.js +0 -53
  28. package/dist/core/agents/agent-schema.js +0 -4
  29. package/dist/core/agents/agent-work-queue.js +1 -11
  30. package/dist/core/agents/agent-worker-pipeline.js +1 -19
  31. package/dist/core/agents/agent-worker-slot.js +1 -10
  32. package/dist/core/agents/native-worker-backend-router.js +55 -0
  33. package/dist/core/agents/runtime-proof-summary.js +0 -1
  34. package/dist/core/align/align-route.js +0 -3
  35. package/dist/core/align/code-navigation-align.js +1 -1
  36. package/dist/core/architecture-hardening/contracts/contracts.js +0 -4
  37. package/dist/core/architecture-map-pipeline.js +0 -25
  38. package/dist/core/architecture-map-review.js +2 -18
  39. package/dist/core/artifact-schemas.js +0 -1
  40. package/dist/core/auto-review.js +0 -22
  41. package/dist/core/code-structure.js +0 -5
  42. package/dist/core/codex/agent-config-file-repair.js +0 -3
  43. package/dist/core/codex/codex-config-guard.js +0 -40
  44. package/dist/core/codex-app/codex-app-fast-ui-preservation.js +1 -7
  45. package/dist/core/codex-app/codex-app-restart-policy.js +20 -0
  46. package/dist/core/codex-app/codex-app-types.js +0 -3
  47. package/dist/core/codex-app/codex-context-window.js +61 -24
  48. package/dist/core/codex-app/codex-desktop-routing-ownership.js +0 -1
  49. package/dist/core/codex-app/codex-hook-lifecycle.js +2 -2
  50. package/dist/core/codex-app/codex-model-catalog.js +0 -11
  51. package/dist/core/codex-app/codex-models-cache.js +0 -8
  52. package/dist/core/codex-app/mcp-manager.js +1 -2
  53. package/dist/core/codex-app/menubar/constants.js +4 -0
  54. package/dist/core/codex-app/multi-provider-router-support.js +1 -178
  55. package/dist/core/codex-app.js +0 -4
  56. package/dist/core/codex-compat/codex-hook-output-builders.js +3 -1
  57. package/dist/core/codex-compat/codex-hook-semantic-validator.js +0 -15
  58. package/dist/core/codex-control/codex-current-feature-capability.js +2 -14
  59. package/dist/core/codex-control/codex-current-feature-probes.js +0 -4
  60. package/dist/core/codex-control/codex-output-schemas.js +0 -10
  61. package/dist/core/codex-control/codex-reliability-shield.js +0 -3
  62. package/dist/core/codex-control/codex-sdk-env-policy.js +0 -3
  63. package/dist/core/codex-control/gpt-final-arbiter.js +1 -1
  64. package/dist/core/codex-control/model-call-concurrency.js +0 -1
  65. package/dist/core/codex-hooks/codex-dead-managed-hooks.js +116 -0
  66. package/dist/core/codex-hooks/codex-global-hooks.js +387 -0
  67. package/dist/core/codex-hooks/codex-hook-actual-discovery.js +36 -106
  68. package/dist/core/codex-hooks/codex-hook-hash.js +4 -7
  69. package/dist/core/codex-hooks/codex-hook-official-parity.js +32 -125
  70. package/dist/core/codex-hooks/codex-hook-state-writer.js +0 -139
  71. package/dist/core/codex-hooks/codex-hook-trust-doctor.js +16 -30
  72. package/dist/core/codex-hooks/codex-hook-trust-state.js +8 -7
  73. package/dist/core/codex-hooks/codex-hooks-list.js +106 -0
  74. package/dist/core/codex-hooks/codex-project-hooks.js +108 -0
  75. package/dist/core/codex-hooks/sks-hook-entries.js +104 -0
  76. package/dist/core/codex-lb/bridge-cli-contract.js +2 -0
  77. package/dist/core/codex-lb/codex-lb-env.js +0 -2
  78. package/dist/core/codex-lb/desktop-auth-invariant.js +1 -44
  79. package/dist/core/codex-lb/desktop-bridge/exclusive-provider-guard.js +59 -0
  80. package/dist/core/codex-lb/desktop-bridge/http-forward.js +23 -15
  81. package/dist/core/codex-lb/desktop-bridge/index.js +1 -0
  82. package/dist/core/codex-lb/desktop-bridge/responses-websocket.js +10 -3
  83. package/dist/core/codex-lb/desktop-bridge/security.js +63 -1
  84. package/dist/core/codex-lb/desktop-bridge/server.js +5 -0
  85. package/dist/core/codex-lb/desktop-bridge/state.js +3 -0
  86. package/dist/core/codex-lb/desktop-bridge/websocket-forward.js +5 -1
  87. package/dist/core/codex-lb/desktop-bridge-migration.js +0 -1
  88. package/dist/core/codex-lb/desktop-controller-v3/catalog.js +31 -5
  89. package/dist/core/codex-lb/desktop-controller-v3/lifecycle-commands.js +23 -4
  90. package/dist/core/codex-lb/desktop-controller-v3/openrouter-only-catalog.js +39 -0
  91. package/dist/core/codex-lb/desktop-controller-v3/openrouter-only-commands.js +286 -0
  92. package/dist/core/codex-lb/desktop-controller-v3/openrouter-only-main-model.js +101 -0
  93. package/dist/core/codex-lb/desktop-controller-v3/openrouter-only-status.js +61 -0
  94. package/dist/core/codex-lb/desktop-controller-v3/status.js +8 -5
  95. package/dist/core/codex-lb/desktop-controller-v3.js +26 -2
  96. package/dist/core/codex-lb/desktop-service.js +13 -2
  97. package/dist/core/codex-lb/route-index.js +0 -3
  98. package/dist/core/codex-lb/trusted-deep-evidence.js +0 -3
  99. package/dist/core/codex-lb-circuit.js +0 -20
  100. package/dist/core/codex-native/codex-native-feature-matrix.js +0 -3
  101. package/dist/core/codex-native/core-skill-integrity.js +1 -4
  102. package/dist/core/codex-native/core-skill-manifest.js +0 -4
  103. package/dist/core/commands/basic-cli.js +16 -4
  104. package/dist/core/commands/mad-sks-command.js +0 -22
  105. package/dist/core/commands/naruto-command.js +5 -5
  106. package/dist/core/commands/ppt-command.js +1 -1
  107. package/dist/core/commands/seo-command.js +0 -3
  108. package/dist/core/commands/triwiki-atlas-command.js +1 -1
  109. package/dist/core/commands/uninstall-command.js +10 -0
  110. package/dist/core/commands/wiki-command.js +1 -1
  111. package/dist/core/config/config-migration-journal.js +1 -27
  112. package/dist/core/config/managed-config-merge.js +1 -1
  113. package/dist/core/config/secret-preservation.js +0 -5
  114. package/dist/core/config-adopt/config-adopt.js +0 -1
  115. package/dist/core/context7-client.js +0 -3
  116. package/dist/core/daemon/sksd-client.js +1 -2
  117. package/dist/core/daemon/sksd-hook-dispatch.js +26 -9
  118. package/dist/core/daemon/sksd-ipc.js +0 -6
  119. package/dist/core/daemon/sksd.js +0 -28
  120. package/dist/core/db-review.js +0 -10
  121. package/dist/core/db-safety.js +0 -36
  122. package/dist/core/decisions/child-model-choice.js +107 -0
  123. package/dist/core/decisions/cli.js +19 -2
  124. package/dist/core/decisions/integration.js +1 -25
  125. package/dist/core/decisions/openrouter.js +1 -4
  126. package/dist/core/decisions/policy.js +1 -2
  127. package/dist/core/decisions/questions.js +1 -2
  128. package/dist/core/decisions/receipt.js +0 -11
  129. package/dist/core/decisions/routing.js +5 -4
  130. package/dist/core/decisions/types.js +0 -1
  131. package/dist/core/dfix.js +0 -12
  132. package/dist/core/doctor/doctor-codex-startup-repair.js +0 -1
  133. package/dist/core/doctor/doctor-native-capability-repair.js +14 -15
  134. package/dist/core/doctor/doctor-readiness-matrix.js +12 -11
  135. package/dist/core/doctor/global-sks-install-cleanup.js +1 -15
  136. package/dist/core/evidence/evidence-router.js +1 -1
  137. package/dist/core/feature-fixture-runner.js +0 -12
  138. package/dist/core/feature-registry.js +1 -25
  139. package/dist/core/fsx.js +0 -19
  140. package/dist/core/git/git-worktree-cleanup.js +0 -27
  141. package/dist/core/git-hygiene/git-status.js +1 -7
  142. package/dist/core/git-hygiene/shared-memory-publish.js +2 -23
  143. package/dist/core/git-simple.js +2 -7
  144. package/dist/core/harness-conflicts.js +0 -1
  145. package/dist/core/hooks-runtime/context-graph-freshness-preflight.js +0 -22
  146. package/dist/core/hooks-runtime/hook-context.js +21 -7
  147. package/dist/core/hooks-runtime/hook-io.js +3 -2
  148. package/dist/core/hooks-runtime/hook-layer.js +101 -0
  149. package/dist/core/hooks-runtime/jev-spawn-routing.js +83 -5
  150. package/dist/core/hooks-runtime/official-subagent-lifecycle.js +5 -4
  151. package/dist/core/hooks-runtime/parent-orchestration-gate.js +18 -1
  152. package/dist/core/hooks-runtime/subagent-context.js +13 -2
  153. package/dist/core/hooks-runtime/subagent-spawn-policy.js +49 -6
  154. package/dist/core/hooks-runtime.js +31 -38
  155. package/dist/core/hproof.js +0 -18
  156. package/dist/core/image-ux-review/callout-extraction.js +0 -9
  157. package/dist/core/image-ux-review/imagegen-adapter.js +1 -1
  158. package/dist/core/image-ux-review/recapture.js +0 -14
  159. package/dist/core/image-ux-review.js +0 -1
  160. package/dist/core/imagegen/imagegen-model-policy.js +0 -1
  161. package/dist/core/imagegen/imagegen-request-validator.js +1 -6
  162. package/dist/core/init/skills.js +2 -5
  163. package/dist/core/init.js +35 -120
  164. package/dist/core/loop-blocker.js +0 -20
  165. package/dist/core/loops/loop-artifacts.js +0 -6
  166. package/dist/core/loops/loop-checkpoint.js +1 -4
  167. package/dist/core/loops/loop-gate-ladder.js +0 -4
  168. package/dist/core/loops/loop-lease.js +0 -3
  169. package/dist/core/loops/loop-owner-inference.js +0 -22
  170. package/dist/core/loops/loop-owner-ledger.js +1 -1
  171. package/dist/core/loops/loop-risk-classifier.js +0 -8
  172. package/dist/core/loops/loop-side-effect-scanner.js +1 -4
  173. package/dist/core/mad-sks/executors/executor-base.js +0 -20
  174. package/dist/core/mad-sks/executors/index.js +0 -3
  175. package/dist/core/mad-sks/sql-plane/capability.js +0 -45
  176. package/dist/core/mad-sks/sql-plane/coordinator.js +3 -30
  177. package/dist/core/mad-sks/sql-plane/ledger.js +0 -14
  178. package/dist/core/mad-sks/sql-plane/mcp-executor.js +0 -3
  179. package/dist/core/mad-sks/sql-plane/policy.js +0 -3
  180. package/dist/core/mad-sks/sql-plane/result-lifecycle.js +0 -10
  181. package/dist/core/mad-sks/sql-plane/target.js +0 -3
  182. package/dist/core/managed-assets/managed-assets-manifest.js +9 -36
  183. package/dist/core/managed-path-safety.js +0 -3
  184. package/dist/core/mcp/mcp-config-preservation.js +0 -3
  185. package/dist/core/mcp/modern-protocol.js +0 -11
  186. package/dist/core/mcp-config/guarded-patch.js +0 -4
  187. package/dist/core/mcp-config/health-check.js +1 -1
  188. package/dist/core/memory-governor.js +0 -4
  189. package/dist/core/mistake-memory.js +1 -49
  190. package/dist/core/naruto/naruto-active-pool.js +0 -240
  191. package/dist/core/naruto/naruto-parallel-patch-apply.js +0 -16
  192. package/dist/core/naruto/naruto-real-write-proof.js +0 -29
  193. package/dist/core/naruto/naruto-role-policy.js +0 -76
  194. package/dist/core/naruto/naruto-task-hints.js +0 -57
  195. package/dist/core/naruto/naruto-work-graph.js +0 -20
  196. package/dist/core/naruto/naruto-work-item.js +0 -25
  197. package/dist/core/naruto/solution-tournament.js +0 -26
  198. package/dist/core/ops/ops-maturity-scorecard.js +1 -5
  199. package/dist/core/perf/release-latency-slo.js +4 -1
  200. package/dist/core/pipeline-internals/runtime-core.js +6 -80
  201. package/dist/core/policy/latest-version-guidance.js +0 -1
  202. package/dist/core/ppt/style-tokens.js +1 -1
  203. package/dist/core/ppt-imagegen-review.js +1 -2
  204. package/dist/core/ppt-review/slide-issue-extraction.js +0 -1
  205. package/dist/core/ppt.js +3 -3
  206. package/dist/core/probes/probe-memoization.js +0 -31
  207. package/dist/core/proof/proof-writer.js +0 -18
  208. package/dist/core/proof-field.js +0 -27
  209. package/dist/core/provider/provider-badge.js +0 -11
  210. package/dist/core/provider/provider-context.js +1 -7
  211. package/dist/core/providers/openrouter/openrouter-request-cache.js +0 -2
  212. package/dist/core/providers/openrouter/openrouter-secret-store.js +0 -32
  213. package/dist/core/python-tools/python-tool-runner.js +1 -6
  214. package/dist/core/qa-loop/qa-types.js +0 -3
  215. package/dist/core/qa-loop.js +0 -24
  216. package/dist/core/questions.js +0 -5
  217. package/dist/core/recallpulse.js +1 -18
  218. package/dist/core/release/content-digest-cache.js +0 -3
  219. package/dist/core/release/gate-manifest.js +0 -7
  220. package/dist/core/release/gate-pack-assertion.js +0 -19
  221. package/dist/core/release/gate-pack-runner.js +0 -4
  222. package/dist/core/release/release-gate-cache-v2.js +0 -3
  223. package/dist/core/remote/index.js +0 -1
  224. package/dist/core/remote/owner-proof.js +1 -7
  225. package/dist/core/remote/protocol.js +0 -12
  226. package/dist/core/remote/session-index.js +0 -13
  227. package/dist/core/research/claim-evidence-matrix.js +1 -1
  228. package/dist/core/research/implementation-blueprint-densifier.js +0 -1
  229. package/dist/core/research/mock-result.js +2 -2
  230. package/dist/core/research/research-realistic-report.js +0 -4
  231. package/dist/core/research/research-source-evidence.js +0 -8
  232. package/dist/core/research/research-source-ledger-merge.js +0 -1
  233. package/dist/core/research/research-synthesis-writer.js +0 -4
  234. package/dist/core/research.js +0 -5
  235. package/dist/core/responses-stream.js +0 -13
  236. package/dist/core/retention.js +0 -6
  237. package/dist/core/routes/constants.js +0 -1
  238. package/dist/core/routes/design-policy.js +0 -3
  239. package/dist/core/routes/evidence.js +1 -13
  240. package/dist/core/routes/model-mode-router.js +0 -4
  241. package/dist/core/routes.js +2 -83
  242. package/dist/core/safety/mutation-guard.js +0 -1
  243. package/dist/core/search/cache.js +0 -3
  244. package/dist/core/search/context-graph-seeds.js +0 -7
  245. package/dist/core/search/index.js +0 -1
  246. package/dist/core/search/rust-bridge.js +1 -5
  247. package/dist/core/search-visibility/adapter-registry.js +0 -3
  248. package/dist/core/search-visibility/analyzers.js +0 -2
  249. package/dist/core/search-visibility/artifacts.js +0 -1
  250. package/dist/core/search-visibility/index.js +1 -2
  251. package/dist/core/search-visibility/marketing.js +0 -3
  252. package/dist/core/search-visibility/mission.js +1 -4
  253. package/dist/core/search-visibility/verifier.js +1 -6
  254. package/dist/core/security/private-credential-file.js +0 -61
  255. package/dist/core/skill-forge.js +0 -35
  256. package/dist/core/skills/core-rollout-trace.js +1 -11
  257. package/dist/core/skills/core-skill-card.js +0 -0
  258. package/dist/core/skills/core-skill-deployment.js +0 -6
  259. package/dist/core/stop-gate/stop-gate-resolver.js +1 -1
  260. package/dist/core/strategy/adhd-orchestrating-gate.js +1 -1
  261. package/dist/core/subagents/child-model-allowlist.js +176 -0
  262. package/dist/core/subagents/child-model-plan.js +117 -0
  263. package/dist/core/subagents/model-policy.js +0 -4
  264. package/dist/core/subagents/model-tiers.js +0 -9
  265. package/dist/core/subagents/naruto-host-credentials.js +82 -13
  266. package/dist/core/subagents/official-subagent-config.js +67 -17
  267. package/dist/core/subagents/official-subagent-preparation.js +45 -12
  268. package/dist/core/subagents/official-subagent-prompt.js +82 -11
  269. package/dist/core/subagents/official-subagent-runner.js +3 -0
  270. package/dist/core/subagents/read-only-list-role.js +73 -0
  271. package/dist/core/subagents/role-model-preferences.js +54 -17
  272. package/dist/core/subagents/subagent-evidence.js +0 -2
  273. package/dist/core/super-search/runtime-helpers.js +1 -19
  274. package/dist/core/super-search/types.js +0 -1
  275. package/dist/core/triwiki/agents-md-projector.js +0 -3
  276. package/dist/core/triwiki/code-navigation-context-pack.js +1 -11
  277. package/dist/core/triwiki/code-pack.js +0 -17
  278. package/dist/core/triwiki/context-graph/architecture/fingerprint.js +0 -7
  279. package/dist/core/triwiki/context-graph/architecture/input-bundle.js +0 -14
  280. package/dist/core/triwiki/context-graph/architecture/policy.js +0 -7
  281. package/dist/core/triwiki/context-graph/architecture/slice.js +0 -90
  282. package/dist/core/triwiki/context-graph/architecture/validation.js +1 -73
  283. package/dist/core/triwiki/context-graph/architecture/voxel-context.js +0 -22
  284. package/dist/core/triwiki/context-graph/compiler/fragment-manifest-store.js +0 -6
  285. package/dist/core/triwiki/context-graph/compiler/fragment-manifest.js +0 -12
  286. package/dist/core/triwiki/context-graph/compiler/serialize.js +0 -3
  287. package/dist/core/triwiki/context-graph/graph-index.js +0 -10
  288. package/dist/core/triwiki/context-graph/paths.js +0 -3
  289. package/dist/core/triwiki/context-graph/projections/mermaid/index.js +0 -3
  290. package/dist/core/triwiki/context-graph/projections/mermaid/serializer.js +0 -12
  291. package/dist/core/triwiki/context-graph/projections/mermaid/view-specs.js +0 -15
  292. package/dist/core/triwiki/context-graph/query/changed-path-seeds.js +0 -8
  293. package/dist/core/triwiki/context-graph/query/index.js +1 -1
  294. package/dist/core/triwiki/context-graph/query/kernel-types.js +0 -3
  295. package/dist/core/triwiki/context-graph/runtime-index/writer-contract.js +0 -1
  296. package/dist/core/triwiki/context-graph/runtime-index/writer-tables.js +0 -1
  297. package/dist/core/triwiki/triwiki-proof-bank-index.js +1 -10
  298. package/dist/core/triwiki/triwiki-sla-certificate.js +0 -8
  299. package/dist/core/triwiki-attention.js +0 -7
  300. package/dist/core/triwiki-wrongness/avoidance-rules.js +0 -5
  301. package/dist/core/triwiki-wrongness/wrongness-cli.js +1 -1
  302. package/dist/core/triwiki-wrongness/wrongness-ledger.js +2 -32
  303. package/dist/core/triwiki-wrongness/wrongness-proof-linker.js +0 -12
  304. package/dist/core/triwiki-wrongness/wrongness-retrieval.js +0 -21
  305. package/dist/core/triwiki-wrongness/wrongness-schema.js +0 -3
  306. package/dist/core/trust-kernel/route-contract.js +0 -1
  307. package/dist/core/trust-kernel/trust-kernel-schema.js +0 -1
  308. package/dist/core/trust-kernel/trust-report.js +1 -1
  309. package/dist/core/trust-kernel/trust-status.js +0 -7
  310. package/dist/core/update/update-migration-state/simple-stages.js +17 -23
  311. package/dist/core/update/update-migration-state.js +1 -24
  312. package/dist/core/update-check.js +5 -27
  313. package/dist/core/verification/diff-quality.js +0 -1
  314. package/dist/core/verification/impact-scan.js +0 -3
  315. package/dist/core/verification-profile.js +0 -1
  316. package/dist/core/version-manager.js +0 -98
  317. package/dist/core/version.js +1 -1
  318. package/dist/native/sks-menubar/Sources/ControlCenterWindowController.swift +2 -0
  319. package/dist/native/sks-menubar/Sources/OpenRouterOnlyState.swift +314 -0
  320. package/dist/native/sks-menubar/Sources/ProcessClient.swift +2 -1
  321. package/dist/native/sks-menubar/Sources/ProvidersModelExposure.swift +15 -3
  322. package/dist/native/sks-menubar/Sources/ProvidersOpenRouterOnly.swift +162 -0
  323. package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +36 -18
  324. package/dist/native/sks-menubar/Sources/SettingsViewController.swift +10 -4
  325. package/dist/native/sks-menubar/Sources/SidebarItem.swift +2 -0
  326. package/dist/native/sks-menubar/Sources/SubagentModelsModels.swift +201 -0
  327. package/dist/native/sks-menubar/Sources/SubagentModelsViewController.swift +373 -0
  328. package/dist/scripts/canonical-test-runner.js +2 -1
  329. package/dist/scripts/codex-native-gate-lib.js +0 -43
  330. package/dist/scripts/gate-lib.js +0 -17
  331. package/dist/scripts/lib/codex-sdk-gate-lib.js +0 -17
  332. package/dist/scripts/lib/git-worktree-fixture.js +0 -5
  333. package/dist/scripts/lib/valid-png-fixture.js +0 -7
  334. package/dist/scripts/official-subagent-workflow-check.js +1 -1
  335. package/dist/scripts/real-execution-check-lib.js +0 -5
  336. package/dist/scripts/skill-surface-modernization-check.js +0 -7
  337. package/dist/scripts/sks-cli-gate-lib.js +0 -30
  338. package/package.json +1 -2
  339. package/release-gates.v2.json +0 -1
  340. package/runtime-required-scripts.json +0 -10
  341. package/dist/core/agents/agent-task-slicer.js +0 -1
  342. package/dist/core/codex-app/provider-operation-stages.js +0 -20
  343. package/dist/core/codex-control/codex-current-core-probe-summary.js +0 -40
  344. package/dist/core/codex-control/codex-current-feature-real-probes.js +0 -68
  345. package/dist/core/codex-hooks/codex-hook-managed-install.js +0 -162
  346. package/dist/core/codex-hooks/codex-hook-official-hash-oracle.js +0 -95
  347. package/dist/core/codex-lb/probes/catalog-probe.js +0 -39
  348. package/dist/core/doctor/codex-current-core-probe-doctor.js +0 -16
  349. package/dist/core/doctor/confirm-repair.js +0 -26
  350. package/dist/core/doctor/legacy-global-hook-cleanup.js +0 -176
  351. package/dist/core/features/feature-completion.js +0 -1
  352. package/dist/core/features/feature-fixtures.js +0 -9
  353. package/dist/core/features/feature-registry.js +0 -2
  354. package/dist/core/hooks-runtime/codex-commit-hooks-selftest.js +0 -82
  355. package/dist/core/mad-sks/sql-plane/recovery.js +0 -27
  356. package/dist/core/naruto/naruto-verification-dag.js +0 -52
  357. package/dist/core/official-subagent-review-policy.js +0 -17
  358. package/dist/core/perf/performance-profiler.js +0 -108
  359. package/dist/core/ppt-review/deck-issue-ledger.js +0 -49
  360. package/dist/core/ppt-review/reexport-rereview.js +0 -84
  361. package/dist/core/prompt-context-builder.js +0 -36
  362. package/dist/core/proof/claim-ledger.js +0 -9
  363. package/dist/core/proof/command-ledger.js +0 -20
  364. package/dist/core/proof/file-change-ledger.js +0 -5
  365. package/dist/core/providers/openrouter/openrouter-client.js +0 -63
  366. package/dist/core/providers/openrouter/openrouter-provider-health.js +0 -46
  367. package/dist/core/qa-loop/qa-app-server-driver.js +0 -133
  368. package/dist/core/remote/local-worker-client.js +0 -35
  369. package/dist/core/reporting/markdown-table.js +0 -12
  370. package/dist/core/search-visibility/adapters/next-app.js +0 -5
  371. package/dist/core/search-visibility/adapters/next-pages.js +0 -5
  372. package/dist/core/search-visibility/adapters/static-site.js +0 -5
  373. package/dist/core/stop-gate/stop-gate-diagnostics.js +0 -3
  374. package/dist/core/triwiki/context-graph/projections/mermaid/architecture-delta.js +0 -68
  375. package/dist/core/triwiki/context-graph/projections/mermaid/change-impact.js +0 -43
  376. package/dist/core/triwiki/context-graph/projections/mermaid/ownership-workstream.js +0 -21
  377. package/dist/core/triwiki/triwiki-invalidation.js +0 -80
  378. package/dist/core/validators/feature-fixture-validator.js +0 -7
  379. package/dist/core/validators/route-contract-validator.js +0 -15
  380. package/dist/core/validators/trust-report-validator.js +0 -15
  381. package/dist/core/verification/verification-proof.js +0 -26
  382. package/dist/core/wiki-image/before-after-relation.js +0 -1
  383. package/dist/core/wiki-image/callout-parser.js +0 -16
  384. package/dist/core/wiki-image/computer-use-ledger.js +0 -38
  385. package/dist/core/wiki-image/generated-review-parser.js +0 -1
  386. package/dist/core/wiki-image/image-relation.js +0 -2
  387. package/dist/core/wiki-image/image-ux-evidence.js +0 -1
  388. package/dist/core/wiki-image/ppt-image-evidence.js +0 -1
package/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
  Sneakoscope Codex (`sks`) is an open-source trust layer for Codex CLI and ChatGPT Desktop. It coordinates bounded AI coding agents, records machine-verifiable evidence, preserves project memory, and blocks release claims that are not supported by current tests or artifacts. Search visibility outcomes are measured separately; SKS does not promise rankings or traffic.
17
17
  <!-- END SKS SEARCH VISIBILITY MARKETING -->
18
18
 
19
- Current package: **SKS 10.3.7**. Install the latest stable release from npm.
19
+ Current package: **SKS 10.3.9**. Install the latest stable release from npm.
20
20
 
21
21
  [Quick start](#install-in-one-command) · [Commands](#everyday-commands) · [SKS Center](#sks-center-macos) · [Documentation](#documentation) · [Changelog](CHANGELOG.md)
22
22
 
@@ -29,7 +29,10 @@ npm exec --yes --package=sneakoscope@latest -- sneakoscope install --yes
29
29
  The installer resolves the latest release, installs it globally, runs setup and
30
30
  Doctor, and checks that `sks` on your PATH points to the installed version.
31
31
 
32
- To set up a project, run this from its root, then open it in Codex:
32
+ SKS turns on in every project you open in Codex. Its hooks live in the
33
+ user-level `~/.codex/hooks.json`, and `sks update` keeps them installed and
34
+ trusted. To add a project's own SKS files (TriWiki context, ignore rules), run
35
+ this from its root:
33
36
 
34
37
  ```sh
35
38
  sks bootstrap --yes
@@ -43,7 +46,7 @@ sks bootstrap --yes
43
46
  | Project context | TriWiki indexes repository code and supplies bounded context that can be checked against source. |
44
47
  | Verification | Tests, diagnostics, and release evidence support completion claims. Security and data-integrity checks stay in place. |
45
48
  | Native controls | SKS Center brings connections, updates, MCP servers, and diagnostics together on macOS. |
46
- | Consistent setup | `sks update` installs the latest release, runs Doctor, and reconciles SKS-managed files and legacy assets. |
49
+ | Consistent setup | `sks update` installs the latest release, runs Doctor, turns SKS hooks on for every Codex project, and reconciles SKS-managed files and legacy assets. |
47
50
 
48
51
  The default `essential` profile avoids repetitive completion rituals. `strict`
49
52
  adds stronger completion requirements. See [Essential Trust](docs/essential-trust.md).
@@ -101,7 +104,8 @@ home directory; set `SKS_POSTINSTALL_MENUBAR=1` to force the build in a script,
101
104
  | Page | Use it to |
102
105
  | --- | --- |
103
106
  | Overview | Check local health and find the next action. |
104
- | Connections | Connect Codex-LB or OpenRouter, choose authentication priority, and manage exposed models. |
107
+ | Connections | Connect Codex-LB or OpenRouter, choose Prefer Codex-LB or OpenRouter Only, and manage exposed models. |
108
+ | Subagent Models | Keep the OpenRouter models subagents may use in OpenRouter Only Mode, with the criteria Jev routes by. |
105
109
  | Updates | Check and update SKS and Codex CLI, with operation progress and recovery details. |
106
110
  | MCP Servers | Manage server configuration, health checks, and authentication. |
107
111
  | Image Generation | Keep Codex's default image generation, or route it through the Desktop Bridge to an OpenRouter image model you pick. |
@@ -123,184 +127,11 @@ connection first for eligible models. The switch distinguishes a saved preferenc
123
127
  from connection readiness: **on but unavailable** means setup needs attention.
124
128
  Turning it off restores the configured official-model routing preference.
125
129
 
126
- The same controls are available from the CLI:
127
-
128
- ```sh
129
- sks bridge auth-priority status --json
130
- sks bridge auth-priority on --json
131
- sks bridge auth-priority off --json
132
- sks bridge status --json
133
- sks bridge route explain gpt-6-astra --json
134
- ```
135
-
136
- Enter credentials through the native connection dialog or the CLI's
137
- `--api-key-stdin` option. See the [provider guide](docs/codex-lb.md) for
138
- configuration, transport checks, and recovery commands.
139
-
140
- ## Image generation
141
-
142
- SKS image routes (image generation, UX-Review callouts, PPT assets, slide
143
- reviews) follow one image mode. By default they use Codex's own image
144
- generation. Turn on a custom image model on the **Image Generation** page to
145
- send every SKS image through the Desktop Bridge to an OpenRouter image model
146
- you pick. SKS pins no image model and records which model made each image.
147
-
148
- ```sh
149
- sks imagegen status --json
150
- sks imagegen models --json
151
- sks imagegen enable --model black-forest-labs/flux.2-klein-4b
152
- sks imagegen generate --prompt "App icon, flat, blue" --out icon.png
153
- sks imagegen disable
154
- ```
155
-
156
- See [Image generation](docs/image-generation.md) for both modes, evidence
157
- sidecars, and the Jev choices.
158
-
159
- ## Naruto workflow
160
-
161
- The parent orchestrates: it decomposes the task, spawns a child for each
162
- disjoint slice, waits, and owns integration and final verification. It does not
163
- implement slices itself. The SKS PreToolUse hook denies parent source edits
164
- until the first child starts and while children are still running. Children
165
- receive bounded tasks and do not spawn children.
166
-
167
- No model family is pinned. Every child runs the newest model of the tier its
168
- work needs, read from the Codex models cache, so a new model family is used as
169
- soon as Codex lists it:
170
-
171
- | Work | Tier | Effort | Today |
172
- | --- | --- | --- | --- |
173
- | Tiny mechanical tasks | fast | low | `gpt-6-luna` |
174
- | Instructed implementation | balanced | low | `gpt-6-sol` |
175
- | Exploration, large-context reads, and direct tool operation | context | medium | `gpt-6-sol` |
176
- | Planning, review, debugging, and focused judgment | deep | max | `gpt-6-astra` |
177
-
178
- With Jev mode on, Jev picks the tier for every spawn, every gated parent edit,
179
- the plan, and the context, so the parent spends no time on those choices. It
180
- also picks the pipeline for each prompt; an explicit SKS `<div align="center">
181
-
182
- <img src="docs/assets/sks-logo.svg" alt="Sneakoscope Codex logo" width="120" height="120" />
183
-
184
- # Sneakoscope Codex
185
-
186
- **Plan, build, and verify with Codex.**
187
-
188
- [![npm version](https://img.shields.io/npm/v/sneakoscope?color=cb3837&logo=npm)](https://www.npmjs.com/package/sneakoscope)
189
- [![node](https://img.shields.io/badge/node-%3E%3D20.11-339933?logo=node.js&logoColor=white)](#requirements)
190
- [![license](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
191
-
192
- </div>
193
-
194
- <!-- BEGIN SKS SEARCH VISIBILITY MARKETING -->
195
- Sneakoscope Codex (`sks`) is an open-source trust layer for Codex CLI and ChatGPT Desktop. It coordinates bounded AI coding agents, records machine-verifiable evidence, preserves project memory, and blocks release claims that are not supported by current tests or artifacts. Search visibility outcomes are measured separately; SKS does not promise rankings or traffic.
196
- <!-- END SKS SEARCH VISIBILITY MARKETING -->
197
-
198
- Current package: **SKS 10.3.7**. Install the latest stable release from npm.
199
-
200
- [Quick start](#install-in-one-command) · [Commands](#everyday-commands) · [SKS Center](#sks-center-macos) · [Documentation](#documentation) · [Changelog](CHANGELOG.md)
201
-
202
- ## Install in one command
203
-
204
- ```sh
205
- npm exec --yes --package=sneakoscope@latest -- sneakoscope install --yes
206
- ```
207
-
208
- The installer resolves the latest release, installs it globally, runs setup and
209
- Doctor, and checks that `sks` on your PATH points to the installed version.
210
-
211
- To set up a project, run this from its root, then open it in Codex:
212
-
213
- ```sh
214
- sks bootstrap --yes
215
- ```
216
-
217
- ## What SKS adds
218
-
219
- | Capability | What you get |
220
- | --- | --- |
221
- | Focused execution | Answers and tiny edits stay lightweight; implementation work runs through official Codex subagents while the parent orchestrates and integrates. |
222
- | Project context | TriWiki indexes repository code and supplies bounded context that can be checked against source. |
223
- | Verification | Tests, diagnostics, and release evidence support completion claims. Security and data-integrity checks stay in place. |
224
- | Native controls | SKS Center brings connections, updates, MCP servers, and diagnostics together on macOS. |
225
- | Consistent setup | `sks update` installs the latest release, runs Doctor, and reconciles SKS-managed files and legacy assets. |
226
-
227
- The default `essential` profile avoids repetitive completion rituals. `strict`
228
- adds stronger completion requirements. See [Essential Trust](docs/essential-trust.md).
229
-
230
- With Codex-LB connected, `sks agent-bridge async --prompt "Check SKS status while
231
- explaining what the check covers" --tools status --json` runs native Astra Async
232
- tool calling with selected read-only SKS tools, using WebSocket first and safe
233
- HTTP fallback. See [Astra guidance](docs/astra-guidance.md)
234
- for setup boundaries and reported execution evidence.
235
-
236
- ## Everyday commands
237
-
238
- SKS enables experimental Astra context management by default during setup and
239
- repair. Turn it off in **SKS Center → Settings → Astra context management**, or
240
- use `sks codex-app context-management off`. Updates preserve an explicit opt-out.
241
- Start a new task after changing the setting. Availability depends on a supported
242
- Codex client and eligible ChatGPT sign-in; API-key and custom-provider sessions
243
- may not activate it. See [OpenAI's context management guidance](https://learn.chatgpt.com/docs/models#experimental-context-management).
244
-
245
- Use these inside a Codex conversation:
246
-
247
- | Command | Purpose |
248
- | --- | --- |
249
- | `$sks-plan "task"` | Create a plan without editing product code. |
250
- | `$sks-work` | Execute the latest plan. |
251
- | `$sks-naruto "task"` | Run an official subagent workflow. |
252
- | `$sks-review` | Review the current changes. |
253
- | `$sks-help` | Explore available SKS workflows. |
254
-
255
- Use these in your terminal:
256
-
257
- ```sh
258
- sks --help
259
- sks status --json
260
- sks review --staged
261
- sks doctor --json
262
- sks update-check
263
- sks update
264
- ```
265
-
266
- `sks update` runs setup reconciliation even when the package is already current.
267
- It preserves user-authored configuration and cleans up recognized SKS-owned
268
- legacy assets. If a check needs attention, follow its reported recovery action
269
- in your terminal.
270
-
271
- ## SKS Center (macOS)
272
-
273
- Open **SKS Control Center** from the SKS menu bar.
274
- The Menu Bar app (with the Control Center) is built from source on macOS when you run
275
- `npm i -g sneakoscope` interactively in a terminal, and by `sks install`, `sks doctor --fix`,
276
- `sks update`, or `sks menubar install`. Dependency, CI, and piped installs never touch your
277
- home directory; set `SKS_POSTINSTALL_MENUBAR=1` to force the build in a script, or
278
- `SKS_POSTINSTALL_NO_MENUBAR=1` to skip it.
279
-
280
- | Page | Use it to |
281
- | --- | --- |
282
- | Overview | Check local health and find the next action. |
283
- | Connections | Connect Codex-LB or OpenRouter, choose authentication priority, and manage exposed models. |
284
- | Updates | Check and update SKS and Codex CLI, with operation progress and recovery details. |
285
- | MCP Servers | Manage server configuration, health checks, and authentication. |
286
- | Image Generation | Keep Codex's default image generation, or route it through the Desktop Bridge to an OpenRouter image model you pick. |
287
- | Diagnostics | Inspect issues and run targeted checks. |
288
- | Settings | Configure lifecycle behavior, notifications, and advanced options. |
289
- | Remote Coding | Find the independent [Paseo companion](https://paseo.sh/docs) and its setup guidance. |
290
-
291
- Connection controls appear first. Model catalogs, bridge diagnostics, and
292
- advanced settings expand when you need them.
293
-
294
- ## Desktop Bridge
295
-
296
- One local bridge manages routing for independent **Codex-LB** and **OpenRouter**
297
- profiles. ChatGPT sign-in remains owned by Codex. Provider choices and existing
298
- session pins remain authoritative; unavailable routes are reported explicitly.
299
-
300
- In **Connections**, turn on **Prefer Codex-LB** to use the saved Codex-LB
301
- connection first for eligible models. The switch distinguishes a saved preference
302
- from connection readiness: **on but unavailable** means setup needs attention.
303
- Turning it off restores the configured official-model routing preference.
130
+ Turn on **OpenRouter Only** instead to run the main thread and every subagent on
131
+ OpenRouter models. The two switches are mutually exclusive: turning one on turns
132
+ the other off. Subagents may use only the models on the **Subagent Models** page,
133
+ and with Jev mode on, Jev picks one for each child from the criteria you wrote.
134
+ See [OpenRouter Only Mode](docs/openrouter-only-mode.md).
304
135
 
305
136
  The same controls are available from the CLI:
306
137
 
@@ -308,6 +139,8 @@ The same controls are available from the CLI:
308
139
  sks bridge auth-priority status --json
309
140
  sks bridge auth-priority on --json
310
141
  sks bridge auth-priority off --json
142
+ sks bridge openrouter-only on --json
143
+ sks bridge subagent-models list --json
311
144
  sks bridge status --json
312
145
  sks bridge route explain gpt-6-astra --json
313
146
  ```
@@ -356,7 +189,7 @@ soon as Codex lists it:
356
189
 
357
190
  With Jev mode on, Jev picks the tier for every spawn, every gated parent edit,
358
191
  the plan, and the context, so the parent spends no time on those choices. It
359
- command always
192
+ also picks the pipeline for each prompt; an explicit SKS dollar command always
360
193
  wins. A stored role-model preference on a current model wins in both modes.
361
194
 
362
195
  An active Codex task keeps the user's selected main model, effort, and service
@@ -393,6 +226,7 @@ freshness semantics.
393
226
  - [Astra guidance](docs/astra-guidance.md) — how SKS applies the official model recommendations.
394
227
  - [Agent Bridge](docs/AGENT-BRIDGE.md) — integrate through the CLI or MCP interface.
395
228
  - [Codex-LB priority](docs/codex-lb-priority.md) — how Codex App WebSockets follow the Center priority setting.
229
+ - [OpenRouter Only Mode](docs/openrouter-only-mode.md) — run everything on OpenRouter with a subagent model list Jev routes by.
396
230
  - [Release readiness](docs/release-readiness.md) — build, verify, and publish a release.
397
231
  - [Release evidence](docs/release-proof-truth.md) — what each verification result proves.
398
232
  - [Changelog](CHANGELOG.md) — changes by version.
@@ -259,7 +259,7 @@ dependencies = [
259
259
 
260
260
  [[package]]
261
261
  name = "sks-core"
262
- version = "10.3.7"
262
+ version = "10.3.9"
263
263
  dependencies = [
264
264
  "globset",
265
265
  "grep-matcher",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "sks-core"
3
- version = "10.3.7"
3
+ version = "10.3.9"
4
4
  edition = "2021"
5
5
 
6
6
  [dependencies]
@@ -29,7 +29,7 @@ async function runSks(args) {
29
29
  }
30
30
  else if (args[0] === 'hook' && args[1] && (await import('../core/verification-profile.js')).hookDaemonEnabled()) {
31
31
  const { hookDaemonInline } = await import('../core/daemon/sksd-hook-dispatch.js');
32
- await hookDaemonInline(args[1]);
32
+ await hookDaemonInline(args[1], args.slice(2));
33
33
  }
34
34
  else if (args.length === 3 && args[0] === 'naruto' && args[1] === 'help' && args[2] === '--json') {
35
35
  const { narutoHelpJsonFastInline } = await import('./fast-inline.js');
@@ -338,7 +338,6 @@ const COMMANDS_WITH_LEGACY_CONTRACT_OVERRIDES = applyCommandContractOverrides(CO
338
338
  }
339
339
  });
340
340
  export const COMMANDS = applyCommandManifestContract(COMMANDS_WITH_LEGACY_CONTRACT_OVERRIDES);
341
- export const TYPED_COMMANDS = COMMANDS;
342
341
  export const LEGACY_COMMAND_ALIASES = {};
343
342
  export const COMMAND_ALIASES = {
344
343
  ...LEGACY_COMMAND_ALIASES,
@@ -356,11 +355,3 @@ export const COMMAND_ALIASES = {
356
355
  export function commandNames() {
357
356
  return Object.keys(COMMANDS).sort();
358
357
  }
359
- export function typedCommandNames() {
360
- return commandNames();
361
- }
362
- export function assertCommandModule(value) {
363
- if (!value || typeof value !== 'object' || typeof value.run !== 'function') {
364
- throw new Error('Command module must expose run(command, args)');
365
- }
366
- }
@@ -11,8 +11,8 @@ import { codexSchemaSnapshotReport } from '../core/codex-compat/codex-schema-sna
11
11
  import { validateCodexFixtureOutputs } from '../core/codex-compat/codex-hook-schema.js';
12
12
  import { codexHookWarningCheck } from '../core/codex-compat/codex-hook-warning-detector.js';
13
13
  import { codexHookTrustDoctor } from '../core/codex-hooks/codex-hook-trust-doctor.js';
14
- import { writeTrustedHashStateForHooksFile } from '../core/codex-hooks/codex-hook-state-writer.js';
15
- import { installManagedCodexHooks } from '../core/codex-hooks/codex-hook-managed-install.js';
14
+ import { activateSksCodexHooks } from '../core/codex-hooks/codex-project-hooks.js';
15
+ import { globalHookPaths, readGlobalSksHookState } from '../core/codex-hooks/codex-global-hooks.js';
16
16
  import { writeCodexHookOfficialParityReport } from '../core/codex-hooks/codex-hook-official-parity.js';
17
17
  const flag = (args, name) => args.includes(name);
18
18
  export async function featuresCommand(sub = 'list', args = []) {
@@ -111,7 +111,7 @@ export async function hooksCommand(sub = 'explain', args = []) {
111
111
  const report = await hooksStatusReport(root);
112
112
  if (flag(args, '--json'))
113
113
  return console.log(JSON.stringify(report, null, 2));
114
- console.log(`Hooks: ${report.ok ? 'ok' : 'missing'}`);
114
+ console.log(`Hooks: ${report.ok ? 'active for every project' : 'not active (run: sks doctor --fix)'}`);
115
115
  for (const file of report.hooks_files)
116
116
  console.log(`- ${file.path}: ${file.exists ? 'present' : 'missing'}`);
117
117
  return;
@@ -153,63 +153,27 @@ export async function hooksCommand(sub = 'explain', args = []) {
153
153
  process.exitCode = 1;
154
154
  return;
155
155
  }
156
- if (action === 'repair') {
157
- if (flag(args, '--trusted')) {
158
- const parity = await writeCodexHookOfficialParityReport(root);
159
- if (!parity.official_hash_available) {
160
- const blocked = {
161
- schema: 'sks.codex-hooks-repair.v1',
162
- ok: false,
163
- mode: 'trusted',
164
- status: 'blocked',
165
- blocker: 'official_hash_oracle_unavailable',
166
- next_command: 'sks hooks repair --managed --json',
167
- parity
168
- };
169
- if (flag(args, '--json'))
170
- return console.log(JSON.stringify(blocked, null, 2));
171
- console.log('Hooks trusted repair blocked: official hash oracle unavailable. Run `sks hooks repair --managed --json`.');
172
- process.exitCode = 1;
173
- return;
174
- }
175
- }
176
- const projectReport = await installManagedCodexHooks(root);
177
- const userReport = await installManagedCodexHooks(root, {
178
- requirementsPath: path.join(os.homedir(), '.codex', 'requirements.toml'),
179
- managedDir: path.join(os.homedir(), '.codex', 'managed-hooks')
180
- });
156
+ if (action === 'repair' || action === 'install') {
157
+ const activation = await activateSksCodexHooks({ root });
181
158
  const actual = await codexHookTrustDoctor(root, { actual: true });
182
159
  const result = {
183
- schema: 'sks.codex-hooks-repair.v1',
184
- ok: Boolean(projectReport.ok && userReport.ok && actual.ok),
185
- mode: 'managed',
160
+ schema: action === 'repair' ? 'sks.codex-hooks-repair.v2' : 'sks.codex-hooks-install.v2',
161
+ ok: activation.ok && activation.active,
162
+ mode: 'user_level',
186
163
  root,
187
- project_install: projectReport,
188
- user_install: userReport,
164
+ activation,
189
165
  actual_trust: actual.trust,
190
- managed_dirs: actual.managed_dirs || [],
191
- blockers: actual.blockers || [],
192
- next_command: 'sks hooks trust-doctor --actual --json',
193
- actions: ['project_requirements_toml_managed_install', 'user_requirements_toml_managed_install']
166
+ blockers: activation.blockers,
167
+ warnings: activation.warnings,
168
+ next_command: 'sks hooks status --json'
194
169
  };
195
170
  if (flag(args, '--json'))
196
171
  return console.log(JSON.stringify(result, null, 2));
197
- console.log(`Hooks managed repair: ${result.ok ? 'ok' : 'blocked'}`);
172
+ console.log(`SKS Codex hooks: ${result.ok ? 'active for every project' : 'blocked'}${result.blockers.length ? ` (${result.blockers.join(', ')})` : ''}`);
198
173
  if (!result.ok)
199
174
  process.exitCode = 1;
200
175
  return;
201
176
  }
202
- if (action === 'install') {
203
- const report = flag(args, '--managed')
204
- ? await installManagedCodexHooks(root)
205
- : await writeTrustedHashStateForHooksFile(root, undefined, undefined, { allowSksHashFallback: flag(args, '--trusted'), reason: 'Use --managed unless you intentionally accept SKS-only trusted_hash fallback with --trusted.' });
206
- if (flag(args, '--json'))
207
- return console.log(JSON.stringify({ ...report, schema: flag(args, '--managed') ? 'sks.codex-hooks-managed-install.v1' : 'sks.codex-hook-install-command.v2', mode: flag(args, '--managed') ? 'managed' : flag(args, '--project') ? 'project' : 'trust-state-only', trusted: flag(args, '--trusted') }, null, 2));
208
- console.log(flag(args, '--managed') ? `Hooks managed install: ${report.ok ? 'ok' : 'blocked'}` : `Hooks install trust state: ${report.ok ? 'ok' : 'blocked'}`);
209
- if (!report.ok)
210
- process.exitCode = 1;
211
- return;
212
- }
213
177
  if (action === 'actual-parity' || action === 'official-parity' || (action === 'parity' && flag(args, '--official'))) {
214
178
  const report = await writeCodexHookOfficialParityReport(root);
215
179
  if (flag(args, '--json'))
@@ -289,8 +253,9 @@ export async function hooksCommand(sub = 'explain', args = []) {
289
253
  console.log(`- ${source.title}: ${source.url}`);
290
254
  }
291
255
  async function hooksStatusReport(root) {
256
+ const global = await readGlobalSksHookState();
292
257
  const files = [
293
- path.join(os.homedir(), '.codex', 'hooks.json'),
258
+ globalHookPaths().hooksPath,
294
259
  path.join(root, '.codex', 'hooks.json')
295
260
  ];
296
261
  const hooksFiles = [];
@@ -298,9 +263,10 @@ async function hooksStatusReport(root) {
298
263
  hooksFiles.push({ path: file, exists: await exists(file) });
299
264
  }
300
265
  return {
301
- schema: 'sks.hooks-status.v1',
266
+ schema: 'sks.hooks-status.v2',
302
267
  hooks_files: hooksFiles,
303
- ok: hooksFiles.some((file) => file.exists)
268
+ global,
269
+ ok: global.active
304
270
  };
305
271
  }
306
272
  async function hooksTrustReport(root) {
@@ -1,4 +1,3 @@
1
- const RESERVED_COMMANDS = new Set(['help', '--help', '-h', 'version', '--version', '-v']);
2
1
  const RETIRED_NARUTO_OPTION = ['--', 'naruto'].join('');
3
2
  const RETIRED_AGENT_OPTION = ['--', 'agent'].join('');
4
3
  const RETIRED_CLONES_OPTION = ['--', 'clones'].join('');
@@ -3,9 +3,6 @@ import os from 'node:os';
3
3
  export function codexLbConfigPath(home = process.env.HOME || os.homedir()) {
4
4
  return path.join(String(home), '.codex', 'config.toml');
5
5
  }
6
- export function codexLbEnvPath(home = process.env.HOME || os.homedir()) {
7
- return path.join(String(home), '.codex', 'sks-codex-lb.env');
8
- }
9
6
  export function codexAuthPath(home = process.env.HOME || os.homedir()) {
10
7
  return path.join(String(home), '.codex', 'auth.json');
11
8
  }
@@ -1,7 +1,7 @@
1
1
  import path from 'node:path';
2
2
  import os from 'node:os';
3
3
  import fsp from 'node:fs/promises';
4
- import { ensureDir, exists, packageRoot, PACKAGE_VERSION, runProcess, tmpdir, writeTextAtomic } from '../core/fsx.js';
4
+ import { ensureDir, exists, packageRoot, PACKAGE_VERSION, runProcess, writeTextAtomic } from '../core/fsx.js';
5
5
  import { EMPTY_CODEX_INFO, getCodexInfo } from '../core/codex-adapter.js';
6
6
  import { installGlobalSkills } from '../core/init.js';
7
7
  import { context7ConfigToml, DOLLAR_SKILL_NAMES, GETDESIGN_REFERENCE, hasContext7ConfigText, RECOMMENDED_SKILLS } from '../core/routes.js';
@@ -51,25 +51,6 @@ export async function ensureSksCommandDuringInstall(opts = {}) {
51
51
  return { status: 'created_not_on_path', command: createdFallback };
52
52
  return { status: 'failed', error: lastError };
53
53
  }
54
- export async function selftestSksShimRepair() {
55
- const staleShimTmp = tmpdir();
56
- const staleBin = path.join(staleShimTmp, 'old-prefix', 'bin');
57
- const stalePkg = path.join(staleShimTmp, 'old-prefix', 'lib', 'node_modules', 'sneakoscope');
58
- const staleEntrypoint = path.join(stalePkg, 'dist', 'bin', 'sks.js');
59
- await ensureDir(path.dirname(staleEntrypoint));
60
- await ensureDir(staleBin);
61
- await writeTextAtomic(path.join(stalePkg, 'package.json'), JSON.stringify({ name: 'sneakoscope', version: '0.0.1' }, null, 2));
62
- await writeTextAtomic(staleEntrypoint, '#!/usr/bin/env node\nconsole.log("sneakoscope 0.0.1");\n');
63
- await fsp.chmod(staleEntrypoint, 0o755).catch(() => { });
64
- await fsp.symlink(staleEntrypoint, path.join(staleBin, 'sks'));
65
- const repair = await ensureSksCommandDuringInstall({ force: true, pathEnv: staleBin, home: path.join(staleShimTmp, 'home') });
66
- if (repair.status !== 'repaired')
67
- throw new Error(`selftest: stale global sks shim was not repaired (${repair.status})`);
68
- const run = await runProcess(path.join(staleBin, 'sks'), ['--version'], { timeoutMs: 10000, maxOutputBytes: 16 * 1024 });
69
- if (run.code !== 0 || !String(run.stdout || '').includes(PACKAGE_VERSION))
70
- throw new Error('selftest: repaired stale sks shim does not run current package version');
71
- return { ok: true, repaired: repair.repaired || [] };
72
- }
73
54
  async function reconcileSksPathShimsDuringInstall(opts = {}) {
74
55
  if (process.env.SKS_SKIP_POSTINSTALL_SHIM_REPAIR === '1' && !opts.force)
75
56
  return { status: 'skipped', reason: 'SKS_SKIP_POSTINSTALL_SHIM_REPAIR=1' };
@@ -237,7 +237,7 @@ async function runPostinstallBootstrap(root, bootstrap, selectedDecision) {
237
237
  process.chdir(previousCwd);
238
238
  }
239
239
  }
240
- export { checkContext7, ensureCodexCliTool, ensureRelatedCliTools, maybePromptCodexUpdateForLaunch, maybePromptSksUpdateForLaunch, shouldAutoApproveInstall } from './install-tool-helpers.js';
240
+ export { checkContext7, ensureCodexCliTool, ensureRelatedCliTools, maybePromptSksUpdateForLaunch, shouldAutoApproveInstall } from './install-tool-helpers.js';
241
241
  export { codexFastModeDesktopStatus, ensureGlobalCodexFastModeDuringInstall, normalizeCodexFastModeUiConfig, safeWriteCodexConfigToml } from '../core/codex-runtime/codex-desktop-config-policy.js';
242
- export { checkRequiredSkills, context7GlobalMcpStatus, ensureCodexImagegenDuringInstall, ensureGlobalCodexSkillsDuringInstall, ensureProjectContext7Config, ensureSksCommandDuringInstall, globalCodexSkillsRoot, selftestSksShimRepair } from './install-helpers-install-support.js';
243
- export { codexLbConfigPath, codexLbEnvPath } from './install-helpers-codex-lb-shared.js';
242
+ export { checkRequiredSkills, context7GlobalMcpStatus, ensureCodexImagegenDuringInstall, ensureGlobalCodexSkillsDuringInstall, ensureProjectContext7Config, ensureSksCommandDuringInstall, globalCodexSkillsRoot } from './install-helpers-install-support.js';
243
+ export { codexLbConfigPath } from './install-helpers-codex-lb-shared.js';
@@ -42,33 +42,6 @@ export async function ensureCodexCliTool({ skip = false, args = [] } = {}) {
42
42
  hint: after.bin ? null : 'npm completed, but codex is not on PATH. Restart the shell or set SKS_CODEX_BIN.'
43
43
  };
44
44
  }
45
- export async function maybePromptCodexUpdateForLaunch(args = [], opts = {}) {
46
- if (hasFlag(args, '--json') || hasFlag(args, '--skip-cli-tools') || hasFlag(args, '--skip-codex-update') || process.env.SKS_SKIP_CODEX_UPDATE === '1')
47
- return { status: 'skipped' };
48
- const latest = await npmPackageVersion('@openai/codex');
49
- const codex = await getCodexInfo().catch(() => EMPTY_CODEX_INFO);
50
- const current = codexCliVersionNumber(codex.version);
51
- const command = 'npm i -g @openai/codex@latest';
52
- const label = opts.label || 'Codex launch';
53
- const missing = !codex.bin;
54
- const updateAvailable = Boolean(latest.version && current && compareVersions(latest.version, current) > 0);
55
- if (!missing && !updateAvailable)
56
- return { status: 'current', latest: latest.version || null, current, bin: codex.bin || null, error: latest.error || null };
57
- const prompt = missing
58
- ? `Codex CLI missing. Install @openai/codex${latest.version ? ` ${latest.version}` : '@latest'} before ${label}? [Y/n] `
59
- : `Codex CLI ${current} -> ${latest.version} update before ${label}? [Y/n] `;
60
- if (shouldAutoApproveInstall(args))
61
- return installCodexLatest(command, latest.version, current);
62
- if (!canAskYesNo()) {
63
- const reason = missing ? 'Codex CLI missing' : `Codex CLI update available: ${current} -> ${latest.version}`;
64
- console.log(`${reason}. Run: ${command}`);
65
- return { status: missing ? 'missing' : 'available', latest: latest.version || null, current, command, bin: codex.bin || null };
66
- }
67
- const answer = (await askQuestion(prompt)).trim();
68
- if (!(answer === '' || /^(y|yes|예|네|응)$/i.test(answer)))
69
- return { status: 'skipped_by_user', latest: latest.version || null, current, command, bin: codex.bin || null };
70
- return installCodexLatest(command, latest.version, current);
71
- }
72
45
  export async function maybePromptSksUpdateForLaunch(args = [], opts = {}) {
73
46
  void args;
74
47
  void opts;
@@ -102,23 +75,6 @@ export async function isProjectSetupCandidate(root) {
102
75
  }
103
76
  return false;
104
77
  }
105
- export function hasTopLevelCodexModeLock(text = '') {
106
- const lines = String(text || '').split('\n');
107
- const firstTable = lines.findIndex((line) => /^\s*\[.+\]\s*$/.test(line));
108
- const top = (firstTable === -1 ? lines : lines.slice(0, firstTable)).join('\n');
109
- return /(^|\n)\s*model_reasoning_effort\s*=/.test(top);
110
- }
111
- export function hasDeprecatedCodexHooksFeatureFlag(text = '') {
112
- const lines = String(text || '').split('\n');
113
- const start = lines.findIndex((line) => line.trim() === '[features]');
114
- if (start === -1)
115
- return false;
116
- const end = lines.findIndex((line, index) => index > start && /^\s*\[.+\]\s*$/.test(line));
117
- return lines.slice(start + 1, end === -1 ? lines.length : end).some((line) => /^\s*codex_hooks\s*=/.test(line));
118
- }
119
- export function hasCodexUnstableFeatureWarningSuppression(text = '') {
120
- return /(^|\n)\s*suppress_unstable_features_warning\s*=\s*true\s*(?:#.*)?(?=\n|$)/.test(String(text || ''));
121
- }
122
78
  export async function checkContext7(root) {
123
79
  const projectPath = path.join(root, '.codex', 'config.toml');
124
80
  const globalPath = path.join(process.env.HOME || '', '.codex', 'config.toml');
@@ -164,38 +120,6 @@ function isAgentRuntime(env = process.env) {
164
120
  return ['SKS_OPENCLAW', 'OPENCLAW', 'OPENCLAW_AGENT', 'OPENCLAW_RUN_ID', 'OPENCLAW_SESSION_ID', 'SKS_HERMES', 'HERMES_AGENT', 'HERMES_RUN_ID', 'HERMES_SESSION_ID']
165
121
  .some((key) => /^(1|true|yes|y)$/i.test(String(env[key] || '').trim()));
166
122
  }
167
- async function installCodexLatest(command, latestVersion, previousVersion = null) {
168
- const npm = await which('npm').catch(() => null);
169
- if (!npm)
170
- return { status: 'failed', latest: latestVersion || null, previous: previousVersion || null, command, error: 'npm not found on PATH' };
171
- const install = await runProcess(npm, ['i', '-g', '@openai/codex@latest'], { timeoutMs: 180000, maxOutputBytes: 128 * 1024 }).catch((err) => ({ code: 1, stdout: '', stderr: err.message }));
172
- if (install.code !== 0)
173
- return { status: 'failed', latest: latestVersion || null, previous: previousVersion || null, command, error: `${install.stderr || install.stdout || command + ' failed'}`.trim() };
174
- const after = await getCodexInfo().catch(() => EMPTY_CODEX_INFO);
175
- const afterVersion = codexCliVersionNumber(after.version);
176
- if (!after.bin)
177
- return { status: 'updated_not_reflected', latest: latestVersion || null, previous: previousVersion || null, version: afterVersion || null, command, error: 'npm completed, but codex is not on PATH. Restart the shell or set SKS_CODEX_BIN.' };
178
- if (latestVersion && afterVersion && compareVersions(afterVersion, latestVersion) < 0) {
179
- return { status: 'updated_not_reflected', latest: latestVersion, previous: previousVersion || null, version: afterVersion, bin: after.bin, command, error: `npm completed, but PATH still resolves Codex CLI ${afterVersion}; expected ${latestVersion}.` };
180
- }
181
- console.log(`Codex CLI ready: ${previousVersion || 'missing'} -> ${after.version || after.bin}`);
182
- return { status: previousVersion ? 'updated' : 'installed', latest: latestVersion || null, previous: previousVersion || null, version: afterVersion || null, raw_version: after.version || null, bin: after.bin || null, command };
183
- }
184
- function codexCliVersionNumber(versionText = '') {
185
- return String(versionText || '').match(/(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)/)?.[1] || null;
186
- }
187
- async function npmPackageVersion(name) {
188
- const envName = `SKS_NPM_VIEW_${String(name || '').replace(/[^A-Za-z0-9]+/g, '_').toUpperCase()}_VERSION`;
189
- if (process.env[envName])
190
- return { version: process.env[envName] };
191
- const npm = await which('npm').catch(() => null);
192
- if (!npm)
193
- return { error: 'npm not found' };
194
- const result = await runProcess(npm, ['view', name, 'version'], { timeoutMs: 5000, maxOutputBytes: 4096 });
195
- if (result.code !== 0)
196
- return { error: `${result.stderr || result.stdout || 'npm view failed'}`.trim() };
197
- return { version: result.stdout.trim().split(/\s+/).pop() };
198
- }
199
123
  async function safeReadText(file) {
200
124
  try {
201
125
  return await fsp.readFile(file, 'utf8');
@@ -6,9 +6,6 @@ import { helpResult, isHelpRequest, renderManifestHelp } from './help.js';
6
6
  import { findRetiredGlobalExecutionArgumentErrors } from './global-mode-router.js';
7
7
  import { normalizeIntentCommand, } from '../core/commands/intent-normalization/normalizer.js';
8
8
  const routerIntentStorage = new AsyncLocalStorage();
9
- export function currentRouterIntentContract() {
10
- return routerIntentStorage.getStore() || null;
11
- }
12
9
  export function prepareRouterExecutionIntent(argv, inheritance = {}) {
13
10
  const effectiveArgv = argv.length ? [...argv] : ['doctor'];
14
11
  const rawCommand = effectiveArgv[0]?.startsWith('$')