sneakoscope 6.0.3 → 6.1.2

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 (378) hide show
  1. package/README.md +29 -12
  2. package/config/codex-releases/{rust-v0.142.0.json → rust-v0.144.1.json} +6 -6
  3. package/crates/sks-core/Cargo.lock +1 -1
  4. package/crates/sks-core/Cargo.toml +1 -1
  5. package/dist/bin/fast-inline.js +18 -14
  6. package/dist/bin/sks-dispatch.js +2 -4
  7. package/dist/cli/args.js +2 -0
  8. package/dist/cli/command-manifest-lite.js +2 -3
  9. package/dist/cli/command-registry.js +3 -4
  10. package/dist/cli/help-fast.js +1 -1
  11. package/dist/cli/install-helpers.js +348 -763
  12. package/dist/cli/install-tool-helpers.js +287 -0
  13. package/dist/cli/router.js +91 -6
  14. package/dist/commands/codex-lb.js +188 -53
  15. package/dist/commands/codex.js +44 -5
  16. package/dist/commands/doctor.js +302 -46
  17. package/dist/commands/tmux.js +5 -1
  18. package/dist/commands/versioning.js +7 -0
  19. package/dist/commands/zellij-monitor-pane.js +2 -0
  20. package/dist/commands/zellij-viewport-pane.js +3 -1
  21. package/dist/commands/zellij.js +1 -1
  22. package/dist/config/skills-manifest.json +59 -59
  23. package/dist/core/agent-bridge/agent-manifest.js +48 -0
  24. package/dist/core/agents/agent-central-ledger.js +9 -0
  25. package/dist/core/agents/agent-cleanup-executor.js +334 -41
  26. package/dist/core/agents/agent-cleanup.js +20 -1
  27. package/dist/core/agents/agent-command-surface.js +3 -1
  28. package/dist/core/agents/agent-effort-policy.js +30 -38
  29. package/dist/core/agents/agent-janitor.js +9 -10
  30. package/dist/core/agents/agent-namespace-safety.js +56 -0
  31. package/dist/core/agents/agent-orchestrator.js +25 -3
  32. package/dist/core/agents/agent-output-validator.js +1 -1
  33. package/dist/core/agents/agent-plan.js +100 -21
  34. package/dist/core/agents/agent-role-config.js +43 -49
  35. package/dist/core/agents/agent-runner-codex-exec.js +18 -3
  36. package/dist/core/agents/agent-runner-process.js +1 -0
  37. package/dist/core/agents/agent-schema.js +3 -2
  38. package/dist/core/agents/fast-mode-policy.js +3 -5
  39. package/dist/core/agents/native-cli-session-swarm.js +1 -1
  40. package/dist/core/agents/native-worker-backend-router.js +2 -1
  41. package/dist/core/agents/work-partition/repo-inventory.js +68 -7
  42. package/dist/core/agents/zellij-right-lane-cockpit.js +2 -2
  43. package/dist/core/code-structure.js +5 -4
  44. package/dist/core/codex/agent-config-file-repair.js +94 -193
  45. package/dist/core/codex/codex-cli-update.js +723 -0
  46. package/dist/core/codex/codex-config-guard.js +38 -11
  47. package/dist/core/codex/codex-project-config-policy.js +3 -6
  48. package/dist/core/codex/codex-startup-config-postcheck.js +52 -42
  49. package/dist/core/codex-adapter.js +35 -22
  50. package/dist/core/codex-app/codex-agent-role-sync.js +13 -54
  51. package/dist/core/codex-app/codex-app-fast-ui-repair.js +51 -20
  52. package/dist/core/codex-app/codex-app-launcher.js +48 -17
  53. package/dist/core/codex-app/codex-app-restart.js +23 -2
  54. package/dist/core/codex-app/codex-app-ui-state-snapshot.js +11 -3
  55. package/dist/core/codex-app/sks-menubar.js +136 -5
  56. package/dist/core/codex-app.js +35 -14
  57. package/dist/core/codex-compat/codex-hook-warning-detector.js +10 -1
  58. package/dist/core/codex-compat/codex-release-manifest.js +6 -6
  59. package/dist/core/codex-control/codex-0139-doctor-real-probe.js +7 -1
  60. package/dist/core/codex-control/codex-0139-image-path-real-probe.js +29 -12
  61. package/dist/core/codex-control/codex-0139-probe-runner.js +103 -28
  62. package/dist/core/codex-control/codex-0139-real-probe-summary.js +7 -3
  63. package/dist/core/codex-control/codex-0139-real-probes.js +21 -6
  64. package/dist/core/codex-control/codex-0139-sandbox-real-probe.js +39 -13
  65. package/dist/core/codex-control/codex-0139-web-search-probe.js +28 -14
  66. package/dist/core/codex-control/{codex-0142-capability.js → codex-0144-capability.js} +22 -22
  67. package/dist/core/codex-control/codex-0144-collab-agent-real-probe.js +63 -0
  68. package/dist/core/codex-control/codex-lb-launch-recovery.js +278 -0
  69. package/dist/core/codex-control/codex-multi-agent-event-normalizer.js +5 -1
  70. package/dist/core/codex-control/codex-reliability-shield.js +93 -30
  71. package/dist/core/codex-control/codex-sdk-adapter.js +96 -13
  72. package/dist/core/codex-control/codex-sdk-config-policy.js +2 -1
  73. package/dist/core/codex-control/codex-sdk-sandbox-policy.js +6 -3
  74. package/dist/core/codex-control/codex-task-runner.js +62 -9
  75. package/dist/core/codex-control/python-codex-sdk-adapter.js +30 -3
  76. package/dist/core/codex-exec-output-schema.js +35 -6
  77. package/dist/core/codex-lb/codex-lb-env.js +30 -1
  78. package/dist/core/codex-lb/codex-lb-tool-catalog.js +478 -0
  79. package/dist/core/codex-lb/codex-lb-tool-output-recovery.js +291 -0
  80. package/dist/core/codex-native/codex-native-feature-broker.js +31 -38
  81. package/dist/core/codex-native/codex-native-feature-matrix.js +2 -2
  82. package/dist/core/codex-native/codex-native-repair-transaction.js +1 -1
  83. package/dist/core/codex-native/core-skill-manifest.js +8 -4
  84. package/dist/core/codex-native/native-capability-postcheck.js +16 -8
  85. package/dist/core/codex-native/native-capability-repair-matrix.js +76 -27
  86. package/dist/core/codex-plugins/codex-plugin-json.js +67 -21
  87. package/dist/core/codex-plugins/codex-plugin-repair.js +118 -0
  88. package/dist/core/codex-runtime/codex-desktop-config-policy.js +305 -0
  89. package/dist/core/commands/agent-bridge-command.js +23 -2
  90. package/dist/core/commands/agent-command.js +38 -5
  91. package/dist/core/commands/basic-cli.js +77 -30
  92. package/dist/core/commands/command-utils.js +1 -1
  93. package/dist/core/commands/gc-command.js +27 -4
  94. package/dist/core/commands/image-ux-review-command.js +55 -24
  95. package/dist/core/commands/mad-sks-command.js +182 -137
  96. package/dist/core/commands/naruto-command.js +643 -1153
  97. package/dist/core/commands/pipeline-command.js +1 -0
  98. package/dist/core/commands/research-command.js +293 -231
  99. package/dist/core/commands/run-command.js +100 -23
  100. package/dist/core/commands/team-command.js +2 -3
  101. package/dist/core/commands/team-legacy-observe-command.js +94 -359
  102. package/dist/core/commands/wiki-command.js +179 -83
  103. package/dist/core/computer-use-live-evidence.js +166 -3
  104. package/dist/core/computer-use-status.js +5 -2
  105. package/dist/core/daemon/sksd-hook-daemon-entrypoint.js +2 -2
  106. package/dist/core/daemon/sksd-hook-daemon.js +171 -28
  107. package/dist/core/daemon/sksd-hook-dispatch.js +2 -2
  108. package/dist/core/db-safety.js +2 -2
  109. package/dist/core/decision-lattice.js +6 -6
  110. package/dist/core/dfix/verification-selector.js +6 -4
  111. package/dist/core/doctor/browser-use-repair.js +54 -13
  112. package/dist/core/doctor/codex-0139-doctor.js +3 -2
  113. package/dist/core/doctor/codex-startup-config-repair.js +8 -3
  114. package/dist/core/doctor/computer-use-repair.js +28 -39
  115. package/dist/core/doctor/doctor-codex-startup-repair.js +24 -149
  116. package/dist/core/doctor/doctor-context7-repair.js +1 -1
  117. package/dist/core/doctor/doctor-dirty-planner.js +1 -1
  118. package/dist/core/doctor/doctor-native-capability-repair.js +74 -3
  119. package/dist/core/doctor/imagegen-repair.js +47 -12
  120. package/dist/core/doctor/legacy-global-hook-cleanup.js +179 -0
  121. package/dist/core/feature-fixture-executor.js +71 -7
  122. package/dist/core/feature-fixture-runner.js +53 -12
  123. package/dist/core/feature-fixtures.js +47 -14
  124. package/dist/core/feature-registry.js +53 -58
  125. package/dist/core/fsx.js +54 -6
  126. package/dist/core/harness-conflicts.js +19 -10
  127. package/dist/core/hooks-runtime/code-pack-freshness-preflight.js +5 -4
  128. package/dist/core/hooks-runtime/hook-invocation-dedupe.js +147 -0
  129. package/dist/core/hooks-runtime/hook-io.js +14 -4
  130. package/dist/core/hooks-runtime/light-turn.js +70 -0
  131. package/dist/core/hooks-runtime/payload-signals.js +270 -0
  132. package/dist/core/hooks-runtime/team-digest.js +0 -1
  133. package/dist/core/hooks-runtime/tool-output-quarantine.js +93 -0
  134. package/dist/core/hooks-runtime.js +418 -250
  135. package/dist/core/image/image-artifact-path-contract.js +8 -6
  136. package/dist/core/image/image-artifact-registry.js +5 -1
  137. package/dist/core/image-ux-review/imagegen-adapter.js +5 -2
  138. package/dist/core/imagegen/imagegen-capability.js +10 -13
  139. package/dist/core/imagegen/require-imagegen.js +37 -11
  140. package/dist/core/init/skills.js +16 -30
  141. package/dist/core/init.js +144 -36
  142. package/dist/core/managed-assets/managed-assets-manifest.js +417 -14
  143. package/dist/core/mission.js +24 -1
  144. package/dist/core/naruto/naruto-work-graph.js +70 -4
  145. package/dist/core/ops/reporting.js +3 -0
  146. package/dist/core/pipeline-internals/runtime-core.js +578 -180
  147. package/dist/core/pipeline-internals/runtime-gates.js +191 -49
  148. package/dist/core/ppt/style-tokens.js +1 -1
  149. package/dist/core/ppt-review/index.js +1 -1
  150. package/dist/core/ppt-review/slide-exporter.js +23 -17
  151. package/dist/core/ppt-review/slide-imagegen-review.js +1 -1
  152. package/dist/core/ppt-review/slide-issue-extraction.js +4 -2
  153. package/dist/core/preflight/parallel-preflight-engine.js +50 -1
  154. package/dist/core/product-design-plugin.js +2 -2
  155. package/dist/core/proof/route-finalizer.js +1 -1
  156. package/dist/core/proof/route-proof-gate.js +7 -2
  157. package/dist/core/proof-field.js +3 -3
  158. package/dist/core/provider/model-router.js +38 -32
  159. package/dist/core/recallpulse/policy.js +12 -28
  160. package/dist/core/recallpulse.js +11 -6
  161. package/dist/core/release/gate-manifest.js +18 -12
  162. package/dist/core/release/gate-pack-manifest.js +1 -1
  163. package/dist/core/release/npm-pack-proof.js +247 -0
  164. package/dist/core/release/package-dist-snapshot.js +151 -0
  165. package/dist/core/release/package-size-budget.js +5 -0
  166. package/dist/core/release/release-authorization-snapshot.js +115 -0
  167. package/dist/core/release/release-gate-affected-selector.js +15 -3
  168. package/dist/core/release/release-gate-cache-v2.js +30 -0
  169. package/dist/core/release/release-gate-contract.js +161 -0
  170. package/dist/core/release/release-gate-dag.js +44 -3
  171. package/dist/core/release/release-gate-hermetic-env.js +28 -17
  172. package/dist/core/release/release-real-contract.js +496 -0
  173. package/dist/core/release-parallel-full-coverage.js +31 -143
  174. package/dist/core/research/claim-evidence-matrix.js +41 -6
  175. package/dist/core/research/experiment-plan.js +14 -10
  176. package/dist/core/research/falsification.js +9 -2
  177. package/dist/core/research/implementation-blueprint-densifier.js +82 -60
  178. package/dist/core/research/implementation-blueprint.js +32 -26
  179. package/dist/core/research/mock-result.js +122 -11
  180. package/dist/core/research/replication-pack.js +15 -8
  181. package/dist/core/research/research-adversarial-review.js +1068 -0
  182. package/dist/core/research/research-claim-builder.js +69 -17
  183. package/dist/core/research/research-claim-synthesizer.js +343 -0
  184. package/dist/core/research/research-cycle-runner.js +53 -3
  185. package/dist/core/research/research-falsification-runner.js +176 -0
  186. package/dist/core/research/research-final-reviewer.js +44 -125
  187. package/dist/core/research/research-realistic-report.js +14 -6
  188. package/dist/core/research/research-review-artifact-digest.js +66 -0
  189. package/dist/core/research/research-source-evidence.js +144 -0
  190. package/dist/core/research/research-source-layer-catalog.js +68 -0
  191. package/dist/core/research/research-source-ledger-merge.js +250 -12
  192. package/dist/core/research/research-source-shards.js +26 -70
  193. package/dist/core/research/research-stage-runner.js +237 -247
  194. package/dist/core/research/research-super-search.js +184 -0
  195. package/dist/core/research/research-synthesis-prompt.js +20 -1
  196. package/dist/core/research/research-synthesis-writer.js +86 -5
  197. package/dist/core/research/research-work-graph.js +25 -18
  198. package/dist/core/research/source-quality-report.js +21 -0
  199. package/dist/core/research.js +429 -280
  200. package/dist/core/retention/retention-budget.js +25 -6
  201. package/dist/core/retention.js +980 -101
  202. package/dist/core/routes/constants.js +1 -1
  203. package/dist/core/routes/dollar-manifest-lite.js +11 -11
  204. package/dist/core/routes/evidence.js +4 -4
  205. package/dist/core/routes/ppt-policy.js +1 -1
  206. package/dist/core/routes.js +92 -64
  207. package/dist/core/runtime/task-profile.js +66 -0
  208. package/dist/core/runtime/verification-budget.js +12 -0
  209. package/dist/core/secret-redaction.js +4 -0
  210. package/dist/core/security/high-risk-contracts.js +6 -6
  211. package/dist/core/stop-gate/stop-gate-check.js +49 -12
  212. package/dist/core/subagents/agent-catalog.js +215 -0
  213. package/dist/core/subagents/model-policy.js +118 -0
  214. package/dist/core/subagents/naruto-help-contract.js +40 -0
  215. package/dist/core/subagents/official-subagent-config.js +488 -0
  216. package/dist/core/subagents/official-subagent-preparation.js +251 -0
  217. package/dist/core/subagents/official-subagent-prompt.js +137 -0
  218. package/dist/core/subagents/official-subagent-runner.js +129 -0
  219. package/dist/core/subagents/subagent-evidence.js +663 -0
  220. package/dist/core/subagents/terminology.js +16 -0
  221. package/dist/core/subagents/thread-budget.js +21 -0
  222. package/dist/core/subagents/triwiki-attention.js +65 -0
  223. package/dist/core/super-search/runtime-helpers.js +173 -19
  224. package/dist/core/super-search/runtime.js +140 -15
  225. package/dist/core/super-search/source-records.js +49 -8
  226. package/dist/core/team-review-policy.js +15 -0
  227. package/dist/core/triwiki/code-pack.js +8 -2
  228. package/dist/core/triwiki/triwiki-cache-key.js +108 -29
  229. package/dist/core/triwiki/triwiki-module-card.js +1 -1
  230. package/dist/core/triwiki-attention.js +13 -6
  231. package/dist/core/triwiki-provenance.js +274 -0
  232. package/dist/core/triwiki-runtime.js +21 -7
  233. package/dist/core/triwiki-wrongness/wrongness-ledger.js +187 -61
  234. package/dist/core/triwiki-wrongness/wrongness-retrieval.js +11 -2
  235. package/dist/core/triwiki-wrongness/wrongness-trust-policy.js +2 -0
  236. package/dist/core/update-check.js +23 -15
  237. package/dist/core/version-manager.js +51 -1
  238. package/dist/core/version.js +1 -1
  239. package/dist/core/wiki-coordinate.js +128 -12
  240. package/dist/core/work-order-ledger.js +208 -10
  241. package/dist/core/zellij/zellij-command.js +12 -1
  242. package/dist/core/zellij/zellij-dashboard-pane.js +3 -3
  243. package/dist/core/zellij/zellij-fake-adapter.js +3 -1
  244. package/dist/core/zellij/zellij-launcher.js +51 -21
  245. package/dist/core/zellij/zellij-layout-builder.js +14 -5
  246. package/dist/core/zellij/zellij-official-subagent-activity.js +477 -0
  247. package/dist/core/zellij/zellij-official-subagent-telemetry.js +264 -0
  248. package/dist/core/zellij/zellij-pane-proof.js +32 -6
  249. package/dist/core/zellij/zellij-slot-pane-renderer.js +17 -5
  250. package/dist/core/zellij/zellij-slot-telemetry.js +15 -3
  251. package/dist/core/zellij/zellij-ui-mode.js +1 -1
  252. package/dist/core/zellij/zellij-viewport-binder.js +3 -0
  253. package/dist/core/zellij/zellij-worker-pane-manager.js +5 -3
  254. package/dist/scripts/agent-fast-mode-default-check.js +48 -29
  255. package/dist/scripts/agent-role-config-repair-check.js +34 -15
  256. package/dist/scripts/agent-wiki-context-proof-check.js +16 -2
  257. package/dist/scripts/all-feature-deep-completion-check.js +14 -4
  258. package/dist/scripts/architecture-guard-check.js +8 -1
  259. package/dist/scripts/build-dist.js +17 -5
  260. package/dist/scripts/canonical-test-runner.js +188 -0
  261. package/dist/scripts/check-command-module-budget.js +38 -16
  262. package/dist/scripts/check-legacy-free.js +1 -1
  263. package/dist/scripts/check-route-modularity.js +0 -1
  264. package/dist/scripts/check-ts-contracts.js +1 -1
  265. package/dist/scripts/codex-0139-interrupt-agent-check.js +5 -1
  266. package/dist/scripts/{codex-0142-app-server-v2-check.js → codex-0144-app-server-v2-check.js} +11 -10
  267. package/dist/scripts/{codex-0142-binary-identity-check.js → codex-0144-binary-identity-check.js} +4 -4
  268. package/dist/scripts/codex-0144-capability-check.js +21 -0
  269. package/dist/scripts/{codex-0139-real-probes-check.js → codex-0144-core-real-probes-check.js} +19 -5
  270. package/dist/scripts/{codex-0142-doctor-wiring-check.js → codex-0144-doctor-wiring-check.js} +6 -6
  271. package/dist/scripts/{codex-0142-manifest-check.js → codex-0144-manifest-check.js} +11 -3
  272. package/dist/scripts/{codex-0142-policy-check.js → codex-0144-policy-check.js} +2 -2
  273. package/dist/scripts/{codex-0142-thread-store-check.js → codex-0144-thread-store-check.js} +3 -3
  274. package/dist/scripts/codex-app-provider-model-ui-check.js +53 -19
  275. package/dist/scripts/codex-app-ui-preservation-check.js +35 -4
  276. package/dist/scripts/codex-control-all-pipelines-check.js +7 -3
  277. package/dist/scripts/codex-control-side-effect-scope-check.js +2 -2
  278. package/dist/scripts/codex-control-tool-output-continuity-audit-check.js +27 -0
  279. package/dist/scripts/codex-effort-auto-discovery-check.js +1 -1
  280. package/dist/scripts/codex-lb-fast-mode-truth-check.js +1 -0
  281. package/dist/scripts/{codex-lb-gpt55-fast-profile-check.js → codex-lb-gpt56-fast-profile-check.js} +56 -5
  282. package/dist/scripts/codex-model-metadata-check.js +1 -1
  283. package/dist/scripts/codex-native-agent-role-content-check.js +15 -7
  284. package/dist/scripts/codex-native-repair-transaction-check.js +3 -1
  285. package/dist/scripts/codex-sdk-all-pipelines-check.js +7 -4
  286. package/dist/scripts/codex-sdk-research-pipeline-check.js +30 -8
  287. package/dist/scripts/codex-sdk-sandbox-policy-check.js +5 -1
  288. package/dist/scripts/codex-sdk-version-compat-check.js +2 -1
  289. package/dist/scripts/db-route-materialization-check.js +33 -0
  290. package/dist/scripts/dfix-fixture-check.js +1 -1
  291. package/dist/scripts/docs-truthfulness-check.js +4 -2
  292. package/dist/scripts/doctor-codex-startup-repair-check.js +47 -25
  293. package/dist/scripts/doctor-context7-repair-check.js +2 -1
  294. package/dist/scripts/doctor-fix-production-blackbox.js +12 -2
  295. package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +34 -7
  296. package/dist/scripts/doctor-imagegen-repair-check.js +14 -4
  297. package/dist/scripts/doctor-startup-config-repair-blackbox.js +9 -3
  298. package/dist/scripts/doctor-startup-config-repair-check.js +13 -3
  299. package/dist/scripts/install-update-preserves-config-check.js +7 -2
  300. package/dist/scripts/legacy-gate-inventory-check.js +7 -5
  301. package/dist/scripts/legacy-strong-inventory-check.js +7 -5
  302. package/dist/scripts/legacy-upgrade-matrix-check.js +4 -4
  303. package/dist/scripts/lib/native-cli-session-swarm-check-lib.js +173 -13
  304. package/dist/scripts/mad-sks-app-ui-no-mutation-check.js +165 -6
  305. package/dist/scripts/managed-role-manifest-parity-check.js +5 -4
  306. package/dist/scripts/mutation-callsite-coverage-check.js +0 -11
  307. package/dist/scripts/naruto-codex-e2e-check.js +14 -7
  308. package/dist/scripts/naruto-shadow-clone-swarm-check.js +4 -201
  309. package/dist/scripts/npm-publish-performance-check.js +20 -12
  310. package/dist/scripts/official-subagent-workflow-check.js +145 -0
  311. package/dist/scripts/package-published-contract-check.js +6 -20
  312. package/dist/scripts/packlist-performance-check.js +17 -3
  313. package/dist/scripts/parallel-verification-engine-check.js +2 -2
  314. package/dist/scripts/postinstall-safe-side-effects-check.js +8 -3
  315. package/dist/scripts/ppt-no-mock-as-real-check.js +3 -1
  316. package/dist/scripts/prepublish-release-check-or-fast.js +23 -86
  317. package/dist/scripts/product-design-plugin-routing-check.js +1 -1
  318. package/dist/scripts/release-affected-selector-check.js +74 -1
  319. package/dist/scripts/release-check-stamp.js +324 -239
  320. package/dist/scripts/release-dag-full-coverage-check.js +7 -15
  321. package/dist/scripts/release-dynamic-presets-check.js +10 -1
  322. package/dist/scripts/release-gate-dag-runner-check.js +3 -3
  323. package/dist/scripts/release-gate-dag-runner.js +35 -11
  324. package/dist/scripts/release-gate-existence-audit.js +1 -2
  325. package/dist/scripts/release-gate-script-parity-check.js +1 -1
  326. package/dist/scripts/release-parallel-full-coverage-check.js +12 -6
  327. package/dist/scripts/release-parallel-speed-budget-check.js +18 -2
  328. package/dist/scripts/release-real-check.js +390 -157
  329. package/dist/scripts/release-registry-check.js +61 -16
  330. package/dist/scripts/release-runtime-truth-matrix-check.js +22 -0
  331. package/dist/scripts/research-blueprint-densifier-check.js +2 -2
  332. package/dist/scripts/research-real-cycle-no-legacy-final-md-check.js +11 -7
  333. package/dist/scripts/route-proof-artifact-structure-check.js +1 -0
  334. package/dist/scripts/search-visibility-gate-lib.js +1 -1
  335. package/dist/scripts/seo-geo-route-identity-check.js +30 -4
  336. package/dist/scripts/sizecheck.js +4 -4
  337. package/dist/scripts/sks-1-11-gate-lib.js +53 -6
  338. package/dist/scripts/sks-3-1-4-directive-check-lib.js +8 -2
  339. package/dist/scripts/sks-3-1-5-directive-check-lib.js +3 -2
  340. package/dist/scripts/sks-3-1-6-directive-check-lib.js +5 -3
  341. package/dist/scripts/sks-menubar-install-check.js +8 -0
  342. package/dist/scripts/sks-uninstall-regression-check.js +1 -1
  343. package/dist/scripts/sksd-daemon-check.js +16 -6
  344. package/dist/scripts/trust-fixture-check.js +32 -10
  345. package/dist/scripts/write-build-manifest.js +2 -1
  346. package/dist/scripts/wrongness-fixture-check.js +1 -1
  347. package/dist/scripts/zellij-layout-valid-check.js +36 -11
  348. package/dist/scripts/zellij-pane-proof-check.js +33 -2
  349. package/dist/scripts/zellij-real-session-cleanup-check.js +122 -2
  350. package/dist/scripts/zellij-real-session-launch-check.js +76 -5
  351. package/dist/scripts/zellij-slot-pane-renderer-check.js +4 -4
  352. package/dist/scripts/zellij-spawn-on-demand-layout-check.js +3 -3
  353. package/docs/demo.tape +1 -1
  354. package/infra-harness-gates.json +1486 -0
  355. package/package.json +32 -19
  356. package/release-gates.v2.json +4060 -0
  357. package/runtime-required-scripts.json +9 -0
  358. package/schemas/codex/{app-server-0.142 → app-server-0.144}/codex_app_server_protocol.v2.schemas.json +1146 -781
  359. package/schemas/codex/codex-0139-real-probe-result.schema.json +39 -5
  360. package/schemas/codex/ppt-slide-issue-ledger.schema.json +2 -1
  361. package/dist/commands/db.js +0 -6
  362. package/dist/core/codex-control/codex-0139-multi-agent-real-probe.js +0 -107
  363. package/dist/core/commands/db-command.js +0 -146
  364. package/dist/core/research/prompt.js +0 -15
  365. package/dist/scripts/agent-native-release-gate.js +0 -274
  366. package/dist/scripts/codex-0142-capability-check.js +0 -21
  367. package/dist/scripts/codex-control-tool-call-sequence-repair-check.js +0 -14
  368. package/dist/scripts/command-performance-scorecard-check.js +0 -204
  369. package/dist/scripts/config-managed-merge-callsite-coverage-check.js +0 -212
  370. package/dist/scripts/dollar-performance-scorecard-check.js +0 -257
  371. package/dist/scripts/gate-timing-check.js +0 -16
  372. package/dist/scripts/ops-maturity-scorecard-check.js +0 -12
  373. package/dist/scripts/performance-baseline-check.js +0 -12
  374. package/dist/scripts/performance-improvement-report-check.js +0 -58
  375. package/dist/scripts/release-parallel-check.js +0 -389
  376. package/dist/scripts/release-runner-efficiency-check.js +0 -15
  377. package/dist/scripts/retention-long-run-smoke-check.js +0 -299
  378. package/docs/assets/sneakoscope-architecture-pipeline.jpg +0 -0
@@ -2,6 +2,7 @@ import fs from 'node:fs/promises';
2
2
  import { existsSync } from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { spawnSync } from 'node:child_process';
5
+ import { COMMAND_MANIFEST_LITE } from '../cli/command-manifest-lite.js';
5
6
  import { COMMANDS } from '../cli/command-registry.js';
6
7
  import { COMMAND_CATALOG, DOLLAR_COMMAND_ALIASES, DOLLAR_COMMANDS, ROUTES } from './routes.js';
7
8
  import { FEATURE_QUALITY_LEVELS, fixtureForFeature, fixtureSummary, validateFeatureFixtures } from './feature-fixtures.js';
@@ -27,12 +28,12 @@ const FEATURE_ACCEPTANCE_DEFAULTS = Object.freeze([
27
28
  'release-mapped'
28
29
  ]);
29
30
  export async function buildFeatureRegistry({ root = packageRoot(), generatedAt = nowIso() } = {}) {
30
- const handlerKeys = await parseMainHandlerKeys(root);
31
+ const handlerKeys = actualCommandHandlerKeys();
31
32
  const skillNames = await listProjectSkillNames(root);
32
33
  const docRouteMentions = await collectDocRouteMentions(root);
33
34
  const handlerToFeature = mapHandlerKeysToFeatureIds(handlerKeys);
34
35
  const features = [];
35
- for (const command of COMMAND_CATALOG) {
36
+ for (const command of featureCommandCatalog()) {
36
37
  const handlerAliases = Object.entries(handlerToFeature)
37
38
  .filter(([, featureId]) => featureId === `cli-${command.name}`)
38
39
  .map(([handler]) => handler)
@@ -64,7 +65,7 @@ export async function buildFeatureRegistry({ root = packageRoot(), generatedAt =
64
65
  generated_at: generatedAt,
65
66
  inventory_sources: {
66
67
  commands_json: 'sks commands --json',
67
- main_handlers: 'src/cli/main.js',
68
+ main_handlers: 'src/cli/command-registry.ts COMMANDS',
68
69
  dollar_routes: 'src/core/routes.js',
69
70
  docs: ['README.md', '.codex/SNEAKOSCOPE.md', 'AGENTS.md', '.agents/skills/.sks-generated.json'],
70
71
  skills: '.agents/skills'
@@ -73,7 +74,7 @@ export async function buildFeatureRegistry({ root = packageRoot(), generatedAt =
73
74
  fixture_summary: fixtureSummary(features),
74
75
  feature_quality_summary: featureQualitySummary(features),
75
76
  source_inventory: {
76
- cli_command_names: COMMAND_CATALOG.map((entry) => entry.name),
77
+ cli_command_names: COMMAND_MANIFEST_LITE.map((entry) => entry.name),
77
78
  handler_keys: handlerKeys,
78
79
  dollar_commands: DOLLAR_COMMANDS.map((entry) => entry.command),
79
80
  app_skill_aliases: DOLLAR_COMMAND_ALIASES.map((entry) => entry.app_skill),
@@ -198,7 +199,8 @@ export function buildAllFeaturesSelftest(registry, opts = {}) {
198
199
  checkRow('agent_lease_policy_present', registry.features.some((feature) => feature.id === 'route-native-agent-intake' && /bounded workspace-write/i.test(JSON.stringify(feature.contract || {})) && /lease/i.test(JSON.stringify(feature.contract || {}))), ['route-native-agent-intake']),
199
200
  checkRow('fixture_pass_threshold', (fixturesSummary.counts.pass || 0) >= 90, [`pass=${fixturesSummary.counts.pass || 0}`]),
200
201
  checkRow('fixture_not_required_ceiling', (fixturesSummary.counts.not_required || 0) <= 16, [`not_required=${fixturesSummary.counts.not_required || 0}`]),
201
- checkRow('fixture_mock_blocked_zero', (fixturesSummary.counts.blocked || 0) === 0, [`blocked=${fixturesSummary.counts.blocked || 0}`]),
202
+ checkRow('fixture_blocked_contracts_honest', (registry.features || []).filter((feature) => feature.fixture?.status === 'blocked')
203
+ .every((feature) => String(feature.fixture?.reason || '').trim().length > 0 && feature.fixture?.fallback_removed === true), (registry.features || []).filter((feature) => feature.fixture?.status === 'blocked' && (!String(feature.fixture?.reason || '').trim() || feature.fixture?.fallback_removed !== true)).map((feature) => feature.id)),
202
204
  ...(executable ? [checkRow('executable_fixture_contracts', executable.ok, executable.failures)] : [])
203
205
  ];
204
206
  const ok = checks.every((check) => check.ok);
@@ -219,8 +221,11 @@ export function buildAllFeaturesSelftest(registry, opts = {}) {
219
221
  }
220
222
  export async function writeAllFeatureCompletionReport({ root = packageRoot(), outDir = path.join(root, '.sneakoscope', 'reports') } = {}) {
221
223
  const registry = await buildFeatureRegistry({ root });
222
- const packageJson = await readJson(path.join(root, 'package.json'), {});
223
- const report = buildAllFeatureCompletionReport(registry, { root, packageJson });
224
+ const [packageJson, releaseManifest] = await Promise.all([
225
+ readJson(path.join(root, 'package.json'), {}),
226
+ readJson(path.join(root, 'release-gates.v2.json'), { gates: [] })
227
+ ]);
228
+ const report = buildAllFeatureCompletionReport(registry, { root, packageJson, releaseManifest });
224
229
  const jsonPath = path.join(outDir, `all-feature-completion-${PACKAGE_VERSION}.json`);
225
230
  const markdownPath = path.join(outDir, `all-feature-completion-${PACKAGE_VERSION}.md`);
226
231
  await writeJsonAtomic(jsonPath, report);
@@ -229,15 +234,16 @@ export async function writeAllFeatureCompletionReport({ root = packageRoot(), ou
229
234
  }
230
235
  export function buildAllFeatureCompletionReport(registry, opts = {}) {
231
236
  const packageJson = opts.packageJson || {};
237
+ const releaseGateIds = new Set((Array.isArray(opts.releaseManifest?.gates) ? opts.releaseManifest.gates : []).map((gate) => String(gate.id || '')));
232
238
  const features = [
233
239
  ...(registry.features || []).map((feature) => featureCompletionRow(feature)),
234
- ...derivedReleaseFeatureRows(opts.root || packageRoot(), packageJson)
240
+ ...derivedReleaseFeatureRows(opts.root || packageRoot(), packageJson, releaseGateIds)
235
241
  ];
236
- const missingScripts = SECTION_29_PACKAGE_SCRIPTS.filter((script) => !packageJson.scripts?.[script]);
242
+ const missingGates = FLAGSHIP_RELEASE_GATES.filter((gate) => !releaseGateIds.has(gate));
237
243
  const runtimeStatic = runtimeRoutesNotStaticContract(registry.features || []);
238
244
  const blockers = [
239
245
  ...(registry.coverage?.blockers || []),
240
- ...missingScripts.map((script) => `missing_script:${script}`),
246
+ ...missingGates.map((gate) => `missing_release_gate:${gate}`),
241
247
  ...runtimeStatic.blockers,
242
248
  ...(packageJson.version === PACKAGE_VERSION ? [] : [`package_version:${packageJson.version || 'missing'}`]),
243
249
  ...features.flatMap((feature) => feature.blockers.map((blocker) => `${feature.id}:${blocker}`))
@@ -252,12 +258,12 @@ export function buildAllFeatureCompletionReport(registry, opts = {}) {
252
258
  features: features.length,
253
259
  registry_features: registry.features?.length || 0,
254
260
  derived_release_features: features.length - (registry.features?.length || 0),
255
- package_scripts_required: SECTION_29_PACKAGE_SCRIPTS.length,
256
- package_scripts_missing: missingScripts.length
261
+ release_gates_required: FLAGSHIP_RELEASE_GATES.length,
262
+ release_gates_missing: missingGates.length
257
263
  },
258
264
  blockers,
259
- required_scripts: SECTION_29_PACKAGE_SCRIPTS,
260
- missing_scripts: missingScripts,
265
+ required_gates: FLAGSHIP_RELEASE_GATES,
266
+ missing_gates: missingGates,
261
267
  release_gates: {
262
268
  version_metadata: packageJson.version === PACKAGE_VERSION ? 'present' : 'blocked',
263
269
  feature_registry: registry.coverage?.ok ? 'present' : 'blocked',
@@ -278,7 +284,7 @@ export function renderAllFeatureCompletionMarkdown(report) {
278
284
  '',
279
285
  `- Status: ${report.status}`,
280
286
  `- Features: ${report.counts?.features || 0}`,
281
- `- Missing scripts: ${(report.missing_scripts || []).length ? report.missing_scripts.join(', ') : 'none'}`,
287
+ `- Missing release gates: ${(report.missing_gates || []).length ? report.missing_gates.join(', ') : 'none'}`,
282
288
  `- Blockers: ${(report.blockers || []).length ? report.blockers.join(', ') : 'none'}`,
283
289
  '',
284
290
  '| Feature | Fixture | Evidence | Proof | Trust | Wrongness | Blackbox | Status |',
@@ -288,38 +294,27 @@ export function renderAllFeatureCompletionMarkdown(report) {
288
294
  const c = feature.coverage || {};
289
295
  lines.push(`| \`${feature.id}\` | ${c.fixture?.status || 'missing'} | ${c.evidence_router?.status || 'missing'} | ${c.completion_proof?.status || 'missing'} | ${c.trust_report?.status || 'missing'} | ${c.wrongness?.status || 'missing'} | ${c.blackbox?.status || 'missing'} | ${feature.status} |`);
290
296
  }
291
- lines.push('', '## Required Release Scripts', '');
292
- for (const script of report.required_scripts || [])
293
- lines.push(`- ${script}: ${(report.missing_scripts || []).includes(script) ? 'missing' : 'present'}`);
297
+ lines.push('', '## Required Release Gates', '');
298
+ for (const gate of report.required_gates || [])
299
+ lines.push(`- ${gate}: ${(report.missing_gates || []).includes(gate) ? 'missing' : 'present'}`);
294
300
  return `${lines.join('\n')}\n`;
295
301
  }
296
- const SECTION_29_PACKAGE_SCRIPTS = Object.freeze([
302
+ const FLAGSHIP_RELEASE_GATES = Object.freeze([
297
303
  'ux-review:run-wires-imagegen',
298
304
  'ux-review:extract-wires-real-extractor',
299
305
  'ux-review:patch-diff-recheck',
306
+ 'ux-review:imagegen-blackbox',
300
307
  'ppt:real-export-adapter',
301
308
  'ppt:real-imagegen-wiring',
302
309
  'ppt:reexport-rereview',
310
+ 'ppt:full-e2e-blackbox',
303
311
  'dfix:patch-handoff',
304
312
  'dfix:verification-recommendation',
305
313
  'all-features:deep-completion',
306
314
  'evidence:flagship-coverage',
307
- 'ux-review:generate-callouts-fixture',
308
- 'ux-review:extract-real-callouts-fixture',
309
- 'ux-review:patch-handoff-fixture',
310
- 'ux-review:recapture-recheck-fixture',
311
- 'ux-review:no-fake-callouts',
312
- 'ppt:imagegen-review-fixture',
313
- 'ppt:slide-export-fixture',
314
- 'ppt:no-text-fallback',
315
- 'ppt:no-mock-as-real',
316
- 'ppt:issue-extraction-fixture',
317
- 'ppt:image-voxel-relations',
318
- 'ppt:proof-trust-fixture',
319
315
  'dfix:fixture',
320
316
  'dfix:verification',
321
- 'all-features:completion',
322
- 'json-schema:recursive-check'
317
+ 'schema:check'
323
318
  ]);
324
319
  function featureCompletionRow(feature) {
325
320
  const coverage = {
@@ -354,14 +349,14 @@ function featureCompletionRow(feature) {
354
349
  blockers
355
350
  };
356
351
  }
357
- function derivedReleaseFeatureRows(root, packageJson) {
352
+ function derivedReleaseFeatureRows(root, packageJson, releaseGateIds) {
358
353
  const derived = [
359
354
  { id: 'release-version-1-14', title: `Release version metadata ${PACKAGE_VERSION}`, artifact: 'package.json', ok: packageJson.version === PACKAGE_VERSION },
360
355
  { id: 'all-feature-completion', title: 'All feature completion matrix', artifact: `.sneakoscope/reports/all-feature-completion-${PACKAGE_VERSION}.json`, ok: true },
361
356
  { id: 'ppt-imagegen-review', title: 'PPT imagegen review route', artifact: 'src/core/ppt-review/index.ts', ok: existsSync(path.join(root, 'src', 'core', 'ppt-review', 'index.ts')) },
362
357
  { id: 'dfix-loop', title: 'DFix diagnose/plan/patch/verify loop', artifact: 'src/core/commands/dfix-command.ts', ok: existsSync(path.join(root, 'src', 'core', 'commands', 'dfix-command.ts')) },
363
358
  { id: 'recursive-json-schema-validator', title: 'Recursive JSON schema validator', artifact: 'src/core/json-schema-validator.ts', ok: existsSync(path.join(root, 'src', 'core', 'json-schema-validator.ts')) },
364
- { id: 'release-section-29-scripts', title: 'Section 29 release scripts', artifact: 'package.json', ok: SECTION_29_PACKAGE_SCRIPTS.every((script) => packageJson.scripts?.[script]) },
359
+ { id: 'release-flagship-gates', title: 'Current flagship release gates', artifact: 'release-gates.v2.json', ok: FLAGSHIP_RELEASE_GATES.every((gate) => releaseGateIds.has(gate)) },
365
360
  { id: 'release-blackbox-matrix', title: 'Release blackbox feature matrix', artifact: 'test/blackbox', ok: true }
366
361
  ];
367
362
  return derived.map((feature) => derivedFeatureCompletionRow(feature));
@@ -509,7 +504,6 @@ const SAFE_EXECUTABLE_FIXTURE_ARGS = Object.freeze({
509
504
  'cli-proof': ['proof', 'smoke', '--json'],
510
505
  'cli-trust': { setup: [['run', 'fixture', '--mock', '--json']], command: ['trust', 'report', 'latest', '--json'] },
511
506
  'cli-wrongness': ['wrongness', 'add', '--kind', 'missing_evidence', '--claim', 'fixture wrongness', '--json'],
512
- 'cli-db': ['db', 'policy'],
513
507
  'cli-wiki': ['wiki', 'image-ingest', 'test/fixtures/images/one-by-one.png', '--json'],
514
508
  'cli-codex': ['codex', 'compatibility', '--json'],
515
509
  'cli-codex-lb': ['codex-lb', 'metrics', '--json'],
@@ -530,8 +524,10 @@ const SAFE_EXECUTABLE_FIXTURE_ARGS = Object.freeze({
530
524
  'cli-daemon': ['daemon', 'status', '--json'],
531
525
  'cli-dfix': ['dfix', 'fixture', '--json'],
532
526
  'cli-all-features': ['all-features', 'complete', '--json'],
533
- 'route-team': ['team', 'fixture', '--mock', '--clones', '4', '--backend', 'fake', '--work-items', '4', '--json'],
534
- 'route-naruto': ['naruto', 'run', 'fixture', '--clones', '4', '--backend', 'fake', '--work-items', '4', '--json'],
527
+ 'cli-naruto': ['naruto', 'run', 'fixture', '--agents', '4', '--max-threads', '4', '--json'],
528
+ 'cli-team': ['team', 'fixture', '--agents', '4', '--max-threads', '4', '--json'],
529
+ 'route-team': ['team', 'fixture', '--agents', '4', '--max-threads', '4', '--json'],
530
+ 'route-naruto': ['naruto', 'run', 'fixture', '--agents', '4', '--max-threads', '4', '--json'],
535
531
  'route-qa-loop': { setup: [['qa-loop', 'prepare', 'fixture API QA', '--json']], command: ['qa-loop', 'run', 'latest', '--mock', '--json'] },
536
532
  'route-research': { setup: [['research', 'prepare', 'fixture research topic', '--json']], command: ['research', 'run', 'latest', '--mock', '--json'] },
537
533
  'route-ppt': ['ppt', 'fixture', '--mock', '--json'],
@@ -540,7 +536,6 @@ const SAFE_EXECUTABLE_FIXTURE_ARGS = Object.freeze({
540
536
  'route-dfix': ['dfix', 'fixture', '--json'],
541
537
  'route-seo-geo-optimizer': ['seo-geo-optimizer', 'fixture', '--mode', 'geo', '--json'],
542
538
  'route-fast-mode': ['fast-mode', 'status', '--json'],
543
- 'route-db': ['db', 'check', '--sql', 'SELECT 1', '--json'],
544
539
  'route-wiki': ['wiki', 'image-ingest', 'test/fixtures/images/one-by-one.png', '--json'],
545
540
  'route-gx': ['gx', 'validate', 'fixture', '--mock', '--json']
546
541
  });
@@ -587,15 +582,14 @@ export function renderFeatureInventoryMarkdown(registry) {
587
582
  lines.push(`- doc_route_mentions_without_route: ${coverage.doc_route_mentions_without_route.join(', ')}`);
588
583
  }
589
584
  lines.push('', '## Prompt Checklist Coverage', '');
590
- lines.push('- [x] Collected `sks commands --json` command surface via `COMMAND_CATALOG`.');
591
- lines.push('- [x] Parsed `src/cli/main.js` handler keys, including hidden handlers and aliases.');
585
+ lines.push('- [x] Collected the complete `sks commands --json` command surface via `COMMAND_MANIFEST_LITE`.');
586
+ lines.push('- [x] Collected the actual `src/cli/command-registry.ts` `COMMANDS` handler keys, including hidden handlers.');
592
587
  lines.push('- [x] Collected dollar routes and app skill aliases from `src/core/routes.js`.');
593
588
  lines.push('- [x] Scanned README, Codex quick reference, AGENTS, and generated skill manifest for dollar-route mentions.');
594
589
  lines.push('- [x] Mapped project skills from `.agents/skills` into the registry.');
595
590
  lines.push('- [x] Exposed the registry through `sks features list --json`.');
596
591
  lines.push('- [x] Added a release coverage check through `sks features check --json`.');
597
592
  lines.push('- [x] Documented fixture status for every registry feature.');
598
- lines.push('');
599
593
  return `${lines.join('\n')}\n`;
600
594
  }
601
595
  function commandFeature(command, handlerAliases = []) {
@@ -608,7 +602,7 @@ function commandFeature(command, handlerAliases = []) {
608
602
  commands: [command.usage],
609
603
  aliases,
610
604
  category,
611
- maturity,
605
+ maturity: command.maturity || maturity,
612
606
  intent: command.description,
613
607
  completion_proof_integration: proofContract(category),
614
608
  voxel_triwiki_integration: voxelContract(category),
@@ -669,10 +663,10 @@ function nativeAgentIntakeFeature() {
669
663
  return baseFeature({
670
664
  id: 'route-native-agent-intake',
671
665
  commands: ['sks agent run "task" --route "$Team" --agents 5 --concurrency 4 --mock --json'],
672
- aliases: ['sks team "task" [executor:5 reviewer:6 user:1]'],
666
+ aliases: [],
673
667
  category: 'proof-route',
674
668
  maturity: 'stable',
675
- intent: 'Default bounded workspace-write native multi-session agent intake before serious route implementation.',
669
+ intent: 'Separate bounded workspace-write agent-runtime intake for explicit sks agent missions; it is not the default Naruto workflow.',
676
670
  voxel_triwiki_integration: 'native agent findings are TriWiki-ready and can require image voxel evidence for visual routes',
677
671
  completion_proof_integration: 'Completion Proof evidence.agents records agent_count, route, leases, no-overlap proof, cleanup, proof graph, and dynamic effort policy',
678
672
  known_gaps: ['real speedup claims require runtime timing/eval evidence; mock/static timing is not enough'],
@@ -836,7 +830,7 @@ function baseFeature(feature) {
836
830
  };
837
831
  }
838
832
  function mapHandlerKeysToFeatureIds(handlerKeys = []) {
839
- const catalogNames = new Set(COMMAND_CATALOG.map((entry) => entry.name));
833
+ const catalogNames = new Set(COMMAND_MANIFEST_LITE.map((entry) => entry.name));
840
834
  const out = {};
841
835
  for (const handler of handlerKeys) {
842
836
  const commandName = HANDLER_ALIAS_TO_COMMAND[handler] || handler;
@@ -844,19 +838,19 @@ function mapHandlerKeysToFeatureIds(handlerKeys = []) {
844
838
  }
845
839
  return out;
846
840
  }
847
- async function parseMainHandlerKeys(root) {
848
- const registryText = await readText(path.join(root, 'src', 'cli', 'command-registry.js'), '');
849
- const registryMatch = registryText.match(/export const COMMANDS = \{([\s\S]*?)\n\};/);
850
- if (registryMatch)
851
- return parseObjectKeys(registryMatch[1]);
852
- return [];
841
+ function featureCommandCatalog() {
842
+ const detailed = new Map(COMMAND_CATALOG.map((entry) => [entry.name, entry]));
843
+ return COMMAND_MANIFEST_LITE.map((entry) => {
844
+ const detail = detailed.get(entry.name);
845
+ return {
846
+ ...entry,
847
+ usage: detail?.usage || `sks ${entry.name}`,
848
+ description: detail?.description || entry.summary
849
+ };
850
+ });
853
851
  }
854
- function parseObjectKeys(text = '') {
855
- const keys = [];
856
- for (const keyMatch of text.matchAll(/^\s{2}(?:'([^']+)'|"([^"]+)"|([A-Za-z_$][\w$-]*))\s*:/gm)) {
857
- keys.push(keyMatch[1] || keyMatch[2] || keyMatch[3]);
858
- }
859
- return [...new Set(keys)].sort();
852
+ function actualCommandHandlerKeys() {
853
+ return Object.keys(COMMANDS).sort();
860
854
  }
861
855
  async function listProjectSkillNames(root) {
862
856
  const dir = path.join(root, '.agents', 'skills');
@@ -911,6 +905,7 @@ function isExternalPromptCommandMention(mention) {
911
905
  const normalized = String(mention || '').toUpperCase();
912
906
  return [
913
907
  '$CODEX_HOME',
908
+ '$HOME',
914
909
  '$CODEX_LB_API_KEY',
915
910
  '$SKS_CODEX_APP_IMAGEGEN_OUTPUT',
916
911
  '$SKS_CODEX_APP_IMAGEGEN_OUTPUT_ID',
package/dist/core/fsx.js CHANGED
@@ -5,10 +5,13 @@ import os from 'node:os';
5
5
  import crypto from 'node:crypto';
6
6
  import { spawn } from 'node:child_process';
7
7
  import { fileURLToPath } from 'node:url';
8
+ import { gunzip as gunzipCallback } from 'node:zlib';
9
+ import { promisify } from 'node:util';
8
10
  import { PACKAGE_VERSION } from './version.js';
9
11
  export { PACKAGE_VERSION };
10
12
  export const DEFAULT_PROCESS_TAIL_BYTES = 256 * 1024;
11
13
  export const DEFAULT_PROCESS_TIMEOUT_MS = 30 * 60 * 1000;
14
+ const gunzipAsync = promisify(gunzipCallback);
12
15
  export function nowIso() {
13
16
  return new Date().toISOString();
14
17
  }
@@ -70,16 +73,27 @@ export async function readText(p, fallback) {
70
73
  throw err;
71
74
  }
72
75
  }
73
- export async function writeTextAtomic(p, text) {
76
+ export async function writeTextAtomic(p, text, opts = {}) {
74
77
  await ensureDir(path.dirname(p));
75
78
  try {
76
- if ((await fsp.readFile(p, 'utf8')) === text)
77
- return;
79
+ if ((await fsp.readFile(p, 'utf8')) === text) {
80
+ if (opts.mode === undefined)
81
+ return;
82
+ const existing = await fsp.lstat(p).catch(() => null);
83
+ if (existing?.isFile() && !existing.isSymbolicLink()) {
84
+ await fsp.chmod(p, opts.mode & 0o777);
85
+ return;
86
+ }
87
+ // Replace symlink or non-regular targets atomically below. Never chmod
88
+ // through a link merely because its current contents happen to match.
89
+ }
78
90
  }
79
91
  catch { }
80
92
  const tmp = `${p}.${process.pid}.${randomId(6)}.tmp`;
93
+ const existingMode = await fsp.lstat(p).then((stat) => stat.isFile() && !stat.isSymbolicLink() ? stat.mode & 0o777 : null).catch(() => null);
94
+ const requestedMode = opts.mode === undefined ? existingMode : opts.mode & 0o777;
81
95
  try {
82
- const handle = await fsp.open(tmp, 'w');
96
+ const handle = await fsp.open(tmp, 'w', requestedMode ?? 0o666);
83
97
  try {
84
98
  await handle.writeFile(text, 'utf8');
85
99
  await handle.sync().catch(() => { });
@@ -87,7 +101,11 @@ export async function writeTextAtomic(p, text) {
87
101
  finally {
88
102
  await handle.close().catch(() => { });
89
103
  }
104
+ if (requestedMode !== null)
105
+ await fsp.chmod(tmp, requestedMode);
90
106
  await fsp.rename(tmp, p);
107
+ if (requestedMode !== null)
108
+ await fsp.chmod(p, requestedMode);
91
109
  }
92
110
  catch (err) {
93
111
  await fsp.rm(tmp, { force: true }).catch(() => { });
@@ -95,7 +113,9 @@ export async function writeTextAtomic(p, text) {
95
113
  throw err;
96
114
  try {
97
115
  await ensureDir(path.dirname(p));
98
- await fsp.writeFile(p, text, 'utf8');
116
+ await fsp.writeFile(p, text, { encoding: 'utf8', ...(requestedMode === null ? {} : { mode: requestedMode }) });
117
+ if (requestedMode !== null)
118
+ await fsp.chmod(p, requestedMode);
99
119
  }
100
120
  catch (fallbackErr) {
101
121
  const error = fallbackErr instanceof Error ? fallbackErr : new Error(String(fallbackErr));
@@ -129,7 +149,11 @@ function errorMessage(err) {
129
149
  }
130
150
  export async function readJson(p, fallback) {
131
151
  try {
132
- return JSON.parse(await fsp.readFile(p, 'utf8'));
152
+ const parsed = JSON.parse(await fsp.readFile(p, 'utf8'));
153
+ if (parsed?.retention_archived === true) {
154
+ return await hydrateRetentionArchivedJson(p, parsed);
155
+ }
156
+ return parsed;
133
157
  }
134
158
  catch (err) {
135
159
  if (fallback !== undefined)
@@ -137,6 +161,30 @@ export async function readJson(p, fallback) {
137
161
  throw err;
138
162
  }
139
163
  }
164
+ async function hydrateRetentionArchivedJson(p, stub) {
165
+ const archive = stub?.retention_archive;
166
+ const sourceRel = String(archive?.source_path || '').split(path.sep).join('/');
167
+ const gzipRel = String(archive?.gzip_path || '').split(path.sep).join('/');
168
+ if (!sourceRel || sourceRel.startsWith('../') || path.posix.isAbsolute(sourceRel) || path.posix.normalize(sourceRel) !== sourceRel) {
169
+ throw new Error('retention_archive_invalid_source_path');
170
+ }
171
+ if (gzipRel !== `${sourceRel}.gz`)
172
+ throw new Error('retention_archive_invalid_gzip_path');
173
+ const sourceParts = sourceRel.split('/').filter(Boolean);
174
+ const archiveRoot = path.resolve(path.dirname(p), ...Array(Math.max(0, sourceParts.length - 1)).fill('..'));
175
+ const resolvedSource = path.resolve(p);
176
+ const resolvedGzip = path.resolve(archiveRoot, ...gzipRel.split('/'));
177
+ if (path.resolve(archiveRoot, ...sourceParts) !== resolvedSource || resolvedGzip !== `${resolvedSource}.gz`) {
178
+ throw new Error('retention_archive_path_escape');
179
+ }
180
+ const compressed = await fsp.readFile(resolvedGzip);
181
+ const original = await gunzipAsync(compressed);
182
+ const expectedSha = String(archive?.original_sha256 || '');
183
+ if (!/^[a-f0-9]{64}$/i.test(expectedSha) || sha256(original) !== expectedSha) {
184
+ throw new Error('retention_archive_sha256_mismatch');
185
+ }
186
+ return JSON.parse(original.toString('utf8'));
187
+ }
140
188
  export async function writeJsonAtomic(p, data) {
141
189
  await writeTextAtomic(p, `${JSON.stringify(data, null, 2)}\n`);
142
190
  }
@@ -5,11 +5,15 @@ export const OTHER_HARNESS_NAMES = ['OMX', 'DCodex'];
5
5
  export async function scanHarnessConflicts(root, opts = {}) {
6
6
  const projectRoot = path.resolve(root || process.cwd());
7
7
  const home = opts.home || process.env.HOME || '';
8
+ const codexHomes = [...new Set([
9
+ home ? path.join(home, '.codex') : '',
10
+ opts.codexHome || process.env.CODEX_HOME || ''
11
+ ].filter(Boolean).map((entry) => path.resolve(entry)))];
8
12
  const includeGlobal = opts.includeGlobal !== false;
9
13
  const conflicts = [];
10
14
  conflicts.push(...await scanProjectHarnessConflicts(projectRoot));
11
- if (includeGlobal && home)
12
- conflicts.push(...await scanGlobalHarnessConflicts(home));
15
+ if (includeGlobal && (home || codexHomes.length))
16
+ conflicts.push(...await scanGlobalHarnessConflicts(home, codexHomes));
13
17
  const hard = conflicts.filter((x) => x.hard_block);
14
18
  const repairable = conflicts.filter((x) => x.repairable && !x.hard_block);
15
19
  return {
@@ -18,6 +22,7 @@ export async function scanHarnessConflicts(root, opts = {}) {
18
22
  requires_human_approval: conflicts.some((x) => x.requires_human_approval),
19
23
  project_root: projectRoot,
20
24
  global_home: home || null,
25
+ global_codex_homes: codexHomes,
21
26
  conflicts,
22
27
  hard,
23
28
  repairable
@@ -72,9 +77,9 @@ async function scanProjectHarnessConflicts(root) {
72
77
  }
73
78
  return out;
74
79
  }
75
- async function scanGlobalHarnessConflicts(home) {
80
+ async function scanGlobalHarnessConflicts(home, codexHomes) {
76
81
  const out = [];
77
- for (const rel of [
82
+ for (const rel of home ? [
78
83
  '.omx',
79
84
  '.omxrc',
80
85
  '.config/omx',
@@ -83,17 +88,19 @@ async function scanGlobalHarnessConflicts(home) {
83
88
  '.dcodexrc',
84
89
  '.config/dcodex',
85
90
  'Library/Application Support/DCodex'
86
- ]) {
91
+ ] : []) {
87
92
  const abs = path.join(home, rel);
88
93
  if (await exists(abs)) {
89
94
  const name = rel.toLowerCase().includes('omx') ? 'OMX' : 'DCodex';
90
95
  out.push(blockingConflict('global', abs, `${name} global harness marker exists`, `${name} must be removed globally before SKS can be installed.`));
91
96
  }
92
97
  }
93
- const globalCodex = path.join(home, '.codex', 'config.toml');
94
- const configText = await readText(globalCodex, null);
95
- if (typeof configText === 'string' && /\bomx\b|\.omx|\bdcodex\b|\.dcodex/i.test(configText)) {
96
- out.push(blockingConflict('global', globalCodex, 'Other harness marker detected in global Codex config', 'Remove the other harness global config before SKS setup.'));
98
+ for (const codexHome of codexHomes) {
99
+ const globalCodex = path.join(codexHome, 'config.toml');
100
+ const configText = await readText(globalCodex, null);
101
+ if (typeof configText === 'string' && /\bomx\b|\.omx|\bdcodex\b|\.dcodex/i.test(configText)) {
102
+ out.push(blockingConflict('global', globalCodex, 'Other harness marker detected in global Codex config', 'Remove the other harness global config before SKS setup.'));
103
+ }
97
104
  }
98
105
  return out;
99
106
  }
@@ -169,7 +176,7 @@ export function formatHarnessConflictReport(scan, opts = {}) {
169
176
  }
170
177
  export function llmHarnessCleanupPrompt(scan) {
171
178
  const paths = (scan?.conflicts || []).map((x) => `- ${x.scope}: ${x.path} (${x.reason})`).join('\n') || '- No paths supplied. Re-run `sks doctor --json` first.';
172
- return `Use GPT-5.5 with reasoning effort high.
179
+ return `Use GPT-5.6 with reasoning effort high.
173
180
 
174
181
  Goal: completely remove the conflicting Codex harnesses before installing Sneakoscope Codex.
175
182
 
@@ -204,6 +211,8 @@ export async function repairSksGeneratedArtifacts(root, opts = {}) {
204
211
  '.sneakoscope/harness-guard.json'
205
212
  ];
206
213
  for (const rel of rels) {
214
+ if (rel === '.codex/agents' && opts.preserveCodexAgents === true)
215
+ continue;
207
216
  const abs = path.join(root, rel);
208
217
  if (!(await exists(abs)))
209
218
  continue;
@@ -11,10 +11,11 @@ import { exists, readJson, runProcess } from '../fsx.js';
11
11
  * the whole check is one JSON read plus one `git rev-parse HEAD`, wrapped in a hard
12
12
  * timeout so it cannot blow the hook latency budget. Any failure resolves to null. */
13
13
  export async function codePackFreshnessNote(root, opts = {}) {
14
- const budgetMs = opts.budgetMs ?? 250;
15
- return raceWithTimeout(computeNote(root), budgetMs).catch(() => null);
14
+ const budgetMs = Math.max(1, opts.budgetMs ?? 250);
15
+ const gitTimeoutMs = Math.max(1, budgetMs - 50);
16
+ return raceWithTimeout(computeNote(root, gitTimeoutMs), budgetMs).catch(() => null);
16
17
  }
17
- async function computeNote(root) {
18
+ async function computeNote(root, gitTimeoutMs) {
18
19
  const packPath = path.join(root, '.sneakoscope', 'wiki', 'code-pack.json');
19
20
  if (!(await exists(packPath)))
20
21
  return null;
@@ -24,7 +25,7 @@ async function computeNote(root) {
24
25
  // rather than nag with a comparison we can't actually make.
25
26
  if (!packSha)
26
27
  return null;
27
- const head = await runProcess('git', ['rev-parse', 'HEAD'], { cwd: root, timeoutMs: 200 }).catch(() => null);
28
+ const head = await runProcess('git', ['rev-parse', 'HEAD'], { cwd: root, timeoutMs: gitTimeoutMs }).catch(() => null);
28
29
  const currentSha = head && head.code === 0 ? String(head.stdout || '').trim() : null;
29
30
  if (!currentSha || currentSha === packSha)
30
31
  return null;