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
@@ -1,5 +1,6 @@
1
1
  import { codexAppIntegrationStatus } from './codex-app.js';
2
2
  import { buildComputerUseLiveEvidence, computerUseLiveEvidencePath, writeComputerUseLiveEvidence } from './computer-use-live-evidence.js';
3
+ export { createOfficialCodexComputerUseScreenshotAdapter } from './computer-use-live-evidence.js';
3
4
  export async function computerUseStatusReport(opts = {}) {
4
5
  if (process.platform !== 'darwin' && !opts.forceMacos) {
5
6
  return baseReport('not_macos', {
@@ -76,7 +77,8 @@ export async function computerUseLiveSmoke(opts = {}) {
76
77
  if (liveEvidence && evidencePath)
77
78
  await writeComputerUseLiveEvidence(evidencePath, liveEvidence);
78
79
  const evidenceMode = liveEvidence?.mode || 'probe_only';
79
- const liveCaptureSuccess = evidenceMode === 'live_capture_success';
80
+ const adapterAttested = liveEvidence?.capture?.screenshot?.adapter_provenance?.verified === true;
81
+ const liveCaptureSuccess = evidenceMode === 'live_capture_success' && adapterAttested;
80
82
  const blockers = [...(liveEvidence?.blockers || [])];
81
83
  if (!realOptIn && status.status === 'not_macos')
82
84
  blockers.push('not_macos');
@@ -102,7 +104,8 @@ export async function computerUseLiveSmoke(opts = {}) {
102
104
  blockers,
103
105
  warnings,
104
106
  evidence: {
105
- screenshot_captured: liveEvidence?.capture?.screenshot?.status === 'captured',
107
+ screenshot_captured: liveEvidence?.capture?.screenshot?.status === 'captured' && adapterAttested,
108
+ official_adapter_attested: adapterAttested,
106
109
  action_captured: liveEvidence?.capture?.action?.status === 'captured',
107
110
  image_voxel_linked: liveEvidence?.image_voxel?.linked === true,
108
111
  evidence_path: liveEvidence && evidencePath ? evidencePath : null
@@ -2,11 +2,11 @@
2
2
  // Entrypoint for the detached sksd hook daemon process (spawned by
3
3
  // spawnSksdHookDaemonDetached). Not invoked directly by users.
4
4
  import { startSksdHookDaemon } from './sksd-hook-daemon.js';
5
- import { evaluateHookPayload } from '../hooks-runtime.js';
5
+ import { evaluateHookPayloadOnce } from '../hooks-runtime.js';
6
6
  const root = process.argv[2];
7
7
  if (!root) {
8
8
  process.stderr.write('sksd-hook-daemon-entrypoint: root argument required\n');
9
9
  process.exit(1);
10
10
  }
11
- await startSksdHookDaemon(root, async (name, payload) => evaluateHookPayload(name, payload, { root }));
11
+ await startSksdHookDaemon(root, async (name, payload) => evaluateHookPayloadOnce(name, payload, { root }));
12
12
  //# sourceMappingURL=sksd-hook-daemon-entrypoint.js.map
@@ -20,16 +20,102 @@ import { sha256 } from '../fsx.js';
20
20
  const IDLE_SHUTDOWN_MS = 30 * 60 * 1000;
21
21
  const CONNECT_TIMEOUT_MS = 150;
22
22
  const REQUEST_TIMEOUT_MS = 5_000;
23
- // Unix domain socket paths have a ~100 byte limit on macOS/Linux (see
24
- // ZELLIJ_UNIX_SOCKET_PATH_LIMIT for the same constraint elsewhere in this
25
- // codebase) a deeply nested project path under .sneakoscope/ would
26
- // routinely blow that. Keyed by a root hash under the OS tmpdir instead,
27
- // same strategy as zellij's socket dir.
23
+ // Unix domain socket paths have a ~100 byte limit on macOS/Linux. TMPDIR can
24
+ // itself be a deeply nested hermetic test root, so sockets use a short,
25
+ // per-user SKS-owned runtime directory under the platform's real /tmp. The
26
+ // project hash keeps independent repositories collision-free.
28
27
  export function sksdSocketPath(root) {
29
- return path.join(os.tmpdir(), `sksd-${sha256(path.resolve(root)).slice(0, 16)}.sock`);
28
+ return path.join(sksdRuntimeDir(), `sksd-${projectKey(root)}.sock`);
30
29
  }
31
30
  function sksdPidFilePath(root) {
32
- return path.join(os.tmpdir(), `sksd-${sha256(path.resolve(root)).slice(0, 16)}.pid.json`);
31
+ return path.join(sksdRuntimeDir(), `sksd-${projectKey(root)}.pid.json`);
32
+ }
33
+ function projectKey(root) {
34
+ return sha256(path.resolve(root)).slice(0, 16);
35
+ }
36
+ function sksdRuntimeDir() {
37
+ const owner = typeof process.getuid === 'function'
38
+ ? String(process.getuid())
39
+ : sha256(os.userInfo().username).slice(0, 8);
40
+ const base = process.platform === 'win32'
41
+ ? os.tmpdir()
42
+ : fs.realpathSync.native('/tmp');
43
+ return path.join(base, `sksd-${owner}`);
44
+ }
45
+ async function ensureSafeRuntimeDir(runtimeDir) {
46
+ await fsp.mkdir(runtimeDir, { recursive: true, mode: 0o700 });
47
+ const stat = await fsp.lstat(runtimeDir);
48
+ if (!stat.isDirectory() || stat.isSymbolicLink())
49
+ throw new Error('unsafe_sksd_runtime_dir_type');
50
+ if (typeof process.getuid === 'function' && stat.uid !== process.getuid())
51
+ throw new Error('unsafe_sksd_runtime_dir_owner');
52
+ if ((stat.mode & 0o077) !== 0)
53
+ await fsp.chmod(runtimeDir, 0o700);
54
+ const real = await fsp.realpath(runtimeDir);
55
+ if (real !== path.resolve(runtimeDir))
56
+ throw new Error('unsafe_sksd_runtime_dir_symlink');
57
+ }
58
+ async function hardenSocketPermissions(socketPath) {
59
+ await fsp.chmod(socketPath, 0o600);
60
+ }
61
+ function safeRuntimeDirPresent(runtimeDir) {
62
+ try {
63
+ const stat = fs.lstatSync(runtimeDir);
64
+ if (!stat.isDirectory() || stat.isSymbolicLink())
65
+ return false;
66
+ if (typeof process.getuid === 'function' && stat.uid !== process.getuid())
67
+ return false;
68
+ if ((stat.mode & 0o077) !== 0)
69
+ return false;
70
+ return fs.realpathSync(runtimeDir) === path.resolve(runtimeDir);
71
+ }
72
+ catch {
73
+ return false;
74
+ }
75
+ }
76
+ async function safeExistingPid(pidFilePath) {
77
+ const stat = await fsp.lstat(pidFilePath).catch((err) => {
78
+ if (err.code === 'ENOENT')
79
+ return null;
80
+ throw err;
81
+ });
82
+ if (!stat)
83
+ return undefined;
84
+ if (!stat.isFile() || stat.isSymbolicLink())
85
+ throw new Error('unsafe_sksd_pid_file');
86
+ const record = await fsp.readFile(pidFilePath, 'utf8').then((raw) => JSON.parse(raw), () => null);
87
+ return Number.isInteger(record?.pid) ? Number(record.pid) : null;
88
+ }
89
+ async function claimPidFile(pidFilePath, root) {
90
+ const existingPid = await safeExistingPid(pidFilePath);
91
+ if (existingPid && pidAlive(existingPid))
92
+ return false;
93
+ if (existingPid !== undefined)
94
+ await fsp.rm(pidFilePath, { force: true });
95
+ try {
96
+ const handle = await fsp.open(pidFilePath, 'wx', 0o600);
97
+ try {
98
+ await handle.writeFile(JSON.stringify({
99
+ pid: process.pid,
100
+ started_at: new Date().toISOString(),
101
+ root,
102
+ project_hash: projectKey(root)
103
+ }));
104
+ await handle.sync().catch(() => undefined);
105
+ }
106
+ finally {
107
+ await handle.close();
108
+ }
109
+ return true;
110
+ }
111
+ catch (err) {
112
+ if (err?.code === 'EEXIST') {
113
+ const racedPid = await safeExistingPid(pidFilePath);
114
+ if (racedPid && pidAlive(racedPid))
115
+ return false;
116
+ }
117
+ throw err;
118
+ }
33
119
  }
34
120
  function pidAlive(pid) {
35
121
  if (!Number.isInteger(pid) || pid <= 0)
@@ -42,6 +128,19 @@ function pidAlive(pid) {
42
128
  return false;
43
129
  }
44
130
  }
131
+ async function removeStaleSocketPath(socketPath) {
132
+ const stat = await fsp.lstat(socketPath).catch((err) => {
133
+ if (err.code === 'ENOENT')
134
+ return null;
135
+ throw err;
136
+ });
137
+ if (!stat)
138
+ return;
139
+ if (stat.isDirectory() && !stat.isSymbolicLink())
140
+ throw new Error('unsafe_sksd_socket_path_directory');
141
+ // rm() unlinks a symlink itself; it never follows it to the target.
142
+ await fsp.rm(socketPath, { force: true });
143
+ }
45
144
  // Called by the daemon entrypoint (registers real process signal handlers
46
145
  // and exits the process on shutdown) and directly by tests (which own the
47
146
  // returned handle's close() instead and must not have this call
@@ -49,15 +148,21 @@ function pidAlive(pid) {
49
148
  export async function startSksdHookDaemon(root, handleHook) {
50
149
  const socketPath = sksdSocketPath(root);
51
150
  const pidFilePath = sksdPidFilePath(root);
52
- const existingPid = await fsp.readFile(pidFilePath, 'utf8').then((raw) => JSON.parse(raw)?.pid, () => null);
53
- if (existingPid && pidAlive(existingPid)) {
54
- // Another daemon for this root is already up; nothing to do.
55
- return null;
151
+ const runtimeDir = path.dirname(socketPath);
152
+ await ensureSafeRuntimeDir(runtimeDir);
153
+ if (!(await claimPidFile(pidFilePath, root))) {
154
+ return null; // Another daemon for this root owns the live PID claim.
155
+ }
156
+ try {
157
+ await removeStaleSocketPath(socketPath);
158
+ }
159
+ catch (err) {
160
+ await fsp.rm(pidFilePath, { force: true }).catch(() => undefined);
161
+ throw err;
56
162
  }
57
- await fsp.rm(socketPath, { force: true }).catch(() => undefined);
58
- await fsp.mkdir(path.dirname(pidFilePath), { recursive: true });
59
- await fsp.writeFile(pidFilePath, JSON.stringify({ pid: process.pid, started_at: new Date().toISOString(), root }));
60
163
  let idleTimer = null;
164
+ let closePromise = null;
165
+ let signalHandlersRegistered = false;
61
166
  const server = net.createServer((socket) => {
62
167
  resetIdleTimer();
63
168
  let buffer = '';
@@ -95,26 +200,61 @@ export async function startSksdHookDaemon(root, handleHook) {
95
200
  idleTimer = setTimeout(() => void idleShutdown(), IDLE_SHUTDOWN_MS);
96
201
  idleTimer.unref();
97
202
  }
98
- async function close() {
99
- if (idleTimer)
100
- clearTimeout(idleTimer);
101
- await new Promise((resolve) => server.close(() => resolve()));
203
+ const onSigterm = () => void idleShutdown();
204
+ const onSigint = () => void idleShutdown();
205
+ function removeSignalHandlers() {
206
+ if (!signalHandlersRegistered)
207
+ return;
208
+ signalHandlersRegistered = false;
209
+ process.removeListener('SIGTERM', onSigterm);
210
+ process.removeListener('SIGINT', onSigint);
211
+ }
212
+ async function cleanupRuntimeArtifacts() {
102
213
  await fsp.rm(socketPath, { force: true }).catch(() => undefined);
103
- await fsp.rm(pidFilePath, { force: true }).catch(() => undefined);
214
+ const claimedPid = await safeExistingPid(pidFilePath).catch(() => null);
215
+ if (claimedPid === process.pid)
216
+ await fsp.rm(pidFilePath, { force: true }).catch(() => undefined);
217
+ await fsp.rmdir(runtimeDir).catch((err) => {
218
+ if (!['ENOENT', 'ENOTEMPTY'].includes(String(err.code)))
219
+ throw err;
220
+ });
221
+ }
222
+ function close() {
223
+ if (closePromise)
224
+ return closePromise;
225
+ closePromise = (async () => {
226
+ if (idleTimer)
227
+ clearTimeout(idleTimer);
228
+ removeSignalHandlers();
229
+ if (server.listening)
230
+ await new Promise((resolve) => server.close(() => resolve()));
231
+ await cleanupRuntimeArtifacts();
232
+ })();
233
+ return closePromise;
104
234
  }
105
235
  async function idleShutdown() {
106
236
  await close();
107
237
  process.exit(0);
108
238
  }
109
- process.on('SIGTERM', () => void idleShutdown());
110
- process.on('SIGINT', () => void idleShutdown());
111
- await new Promise((resolve, reject) => {
112
- server.once('error', reject);
113
- server.listen(socketPath, () => {
114
- server.removeListener('error', reject);
115
- resolve();
239
+ try {
240
+ await new Promise((resolve, reject) => {
241
+ server.once('error', reject);
242
+ server.listen(socketPath, () => {
243
+ server.removeListener('error', reject);
244
+ resolve();
245
+ });
116
246
  });
117
- });
247
+ await hardenSocketPermissions(socketPath);
248
+ }
249
+ catch (err) {
250
+ if (server.listening)
251
+ await new Promise((resolve) => server.close(() => resolve()));
252
+ await cleanupRuntimeArtifacts();
253
+ throw err;
254
+ }
255
+ process.on('SIGTERM', onSigterm);
256
+ process.on('SIGINT', onSigint);
257
+ signalHandlersRegistered = true;
118
258
  resetIdleTimer();
119
259
  return { close };
120
260
  }
@@ -136,7 +276,10 @@ export function spawnSksdHookDaemonDetached(root) {
136
276
  // can fail open to the direct in-process path.
137
277
  export async function callSksdHookDaemon(root, name, payload) {
138
278
  const socketPath = sksdSocketPath(root);
139
- if (!fs.existsSync(socketPath))
279
+ if (!safeRuntimeDirPresent(path.dirname(socketPath)))
280
+ return null;
281
+ const socketStat = fs.lstatSync(socketPath, { throwIfNoEntry: false });
282
+ if (!socketStat || socketStat.isSymbolicLink() || socketStat.isDirectory())
140
283
  return null;
141
284
  return new Promise((resolve) => {
142
285
  const socket = net.createConnection(socketPath);
@@ -28,8 +28,8 @@ export async function hookDaemonInline(name) {
28
28
  }
29
29
  else {
30
30
  spawnSksdHookDaemonDetached(root);
31
- const { evaluateHookPayload } = await import('../hooks-runtime.js');
32
- result = await evaluateHookPayload(name, payload, { root });
31
+ const { evaluateHookPayloadOnce } = await import('../hooks-runtime.js');
32
+ result = await evaluateHookPayloadOnce(name, payload, { root });
33
33
  }
34
34
  process.stdout.write(`${JSON.stringify(normalizeHookResult(name, result))}\n`);
35
35
  }
@@ -454,10 +454,10 @@ async function writeMadSksTableDeletePending(root, state = {}, decision = {}) {
454
454
  return pending;
455
455
  }
456
456
  function looksLikeConfirmationYes(prompt = '') {
457
- return /^(yes|y|confirm|confirmed|approve|approved|proceed|continue|ok|okay|네|예|응|허용|승인|진행|계속|삭제\s*허용|테이블\s*삭제\s*허용)\b/i.test(String(prompt || '').trim());
457
+ return /^(yes|y|confirm|confirmed|approve|approved|proceed|continue|ok|okay|네|예|응|허용|승인|진행|계속|삭제\s*허용|테이블\s*삭제\s*허용)(?=$|\s|[.!?。!?,,])/i.test(String(prompt || '').trim());
458
458
  }
459
459
  function looksLikeConfirmationNo(prompt = '') {
460
- return /^(no|n|stop|abort|cancel|deny|denied|아니|아니요|중단|취소|거부|멈춰)\b/i.test(String(prompt || '').trim());
460
+ return /^(no|n|stop|abort|cancel|deny|denied|아니|아니요|중단|취소|거부|멈춰)(?=$|\s|[.!?。!?,,])/i.test(String(prompt || '').trim());
461
461
  }
462
462
  export async function handleMadSksUserConfirmation(root, state = {}, prompt = '') {
463
463
  if (!isMadSksRouteState(state) || !state?.mission_id)
@@ -68,13 +68,13 @@ const DEFAULT_ACTIONS = Object.freeze([
68
68
  notes: ['Checks syntax and behavior for the changed module.']
69
69
  },
70
70
  {
71
- id: 'five_lane_review',
72
- label: 'Collect five-lane Team review',
71
+ id: 'risk_scoped_review',
72
+ label: 'Collect risk-scoped official review',
73
73
  delta: { review: 1 },
74
74
  risk: 0.2,
75
- friction: 1.1,
75
+ friction: 0.55,
76
76
  info_gain: 1,
77
- notes: ['Satisfies Team review gate for broad missions.']
77
+ notes: ['Starts with one reviewer and expands only for independent risk domains.']
78
78
  },
79
79
  {
80
80
  id: 'honest_mode',
@@ -96,13 +96,13 @@ const DEFAULT_ROUTE_PATHS = Object.freeze([
96
96
  {
97
97
  id: 'balanced_team_lane',
98
98
  label: 'Balanced Team Lane',
99
- action_ids: ['seal_contract', 'read_triwiki', 'proof_field_scan', 'minimal_patch', 'focused_verification', 'five_lane_review', 'honest_mode'],
99
+ action_ids: ['seal_contract', 'read_triwiki', 'proof_field_scan', 'minimal_patch', 'focused_verification', 'risk_scoped_review', 'honest_mode'],
100
100
  notes: ['Adds review evidence while preserving a compact change surface.']
101
101
  },
102
102
  {
103
103
  id: 'full_team_honest_path',
104
104
  label: 'Full Team Honest Path',
105
- action_ids: ['seal_contract', 'read_triwiki', 'proof_field_scan', 'five_lane_review', 'minimal_patch', 'focused_verification', 'five_lane_review', 'honest_mode'],
105
+ action_ids: ['seal_contract', 'read_triwiki', 'proof_field_scan', 'risk_scoped_review', 'minimal_patch', 'focused_verification', 'risk_scoped_review', 'honest_mode'],
106
106
  notes: ['Heaviest default for broad or release-sensitive missions.']
107
107
  }
108
108
  ]);
@@ -16,10 +16,12 @@ export async function buildDfixVerificationSelection(root, input = {}) {
16
16
  const candidates = [];
17
17
  if (changedFiles.some((file) => /(?:^|\/)test\/.*\.(?:test|spec)\.(?:mjs|js|ts)$/.test(file)) && scripts['test:unit'])
18
18
  candidates.push({ command: 'npm run test:unit', reason: 'test_file_changed', confidence: 0.82, expected_duration_budget_ms: 15000 });
19
- if (changedFiles.some((file) => /^src\/core\/dfix/.test(file)) && scripts['dfix:fixture'])
20
- candidates.push({ command: 'npm run dfix:fixture', reason: 'dfix_source_changed', confidence: 0.9, expected_duration_budget_ms: 3000 });
21
- if (changedFiles.some((file) => /^src\/core\/dfix/.test(file)) && scripts['dfix:verification'])
22
- candidates.push({ command: 'npm run dfix:verification', reason: 'dfix_source_changed', confidence: 0.88, expected_duration_budget_ms: 3000 });
19
+ if (changedFiles.some((file) => /^src\/core\/dfix/.test(file)) && await existsFile(path.join(root, 'dist', 'scripts', 'dfix-fixture-check.js'))) {
20
+ candidates.push({ command: 'node ./dist/scripts/dfix-fixture-check.js', reason: 'dfix_source_changed', confidence: 0.9, expected_duration_budget_ms: 3000 });
21
+ }
22
+ if (changedFiles.some((file) => /^src\/core\/dfix/.test(file)) && await existsFile(path.join(root, 'dist', 'scripts', 'dfix-verification-check.js'))) {
23
+ candidates.push({ command: 'node ./dist/scripts/dfix-verification-check.js', reason: 'dfix_source_changed', confidence: 0.88, expected_duration_budget_ms: 3000 });
24
+ }
23
25
  if (changedFiles.some((file) => /\.(?:json|schema\.json)$/.test(file)) && scripts['schema:check'])
24
26
  candidates.push({ command: 'npm run schema:check', reason: 'schema_file_changed', confidence: 0.76, expected_duration_budget_ms: 10000 });
25
27
  if (changedFiles.some((file) => /^docs\/|\.md$/.test(file)) && scripts.packcheck)
@@ -1,7 +1,9 @@
1
1
  import path from 'node:path';
2
2
  import { codexChromeExtensionStatus, CODEX_CHROME_EXTENSION_SETUP_DOCS_URL } from '../codex-app.js';
3
+ import { ensureCodexPlugins } from '../codex-plugins/codex-plugin-repair.js';
3
4
  import { runDoctorCodexStartupRepair } from './doctor-codex-startup-repair.js';
4
5
  import { ensureDir, nowIso, runProcess, which, writeJsonAtomic } from '../fsx.js';
6
+ import { redactString } from '../secret-redaction.js';
5
7
  export const DOCTOR_BROWSER_USE_REPAIR_SCHEMA = 'sks.doctor-browser-use-repair.v1';
6
8
  export async function repairBrowserUse(input) {
7
9
  const root = path.resolve(input.root || process.cwd());
@@ -25,10 +27,15 @@ export async function repairBrowserUse(input) {
25
27
  command: 'which codex',
26
28
  blocker: codexBin ? null : 'codex_binary_missing'
27
29
  });
28
- const flagsNeedingEnable = ['browser_use_external', 'plugins'];
30
+ const requiredChromeFlags = new Set(['browser_use_external', 'plugins', 'apps']);
31
+ const flagsNeedingEnable = [...requiredChromeFlags, 'in_app_browser', 'browser_use'];
29
32
  for (const flag of flagsNeedingEnable) {
30
- const alreadyOk = before?.ok === true || (before?.blockers || []).every((b) => !b.includes(`${flag}_feature_missing`));
31
- if (codexBin && apply) {
33
+ const detectorRequiresFlag = Array.isArray(before?.required_flags) && before.required_flags.includes(flag);
34
+ const detectorReportsMissing = (before?.blockers || []).some((b) => b.includes(`${flag}_feature_missing`));
35
+ const explicitlyEnabled = before?.features?.[flag] === true || before?.feature_flags?.[flag] === true;
36
+ const alreadyOk = explicitlyEnabled
37
+ || (requiredChromeFlags.has(flag) && (before?.ok === true || (detectorRequiresFlag && !detectorReportsMissing)));
38
+ if (codexBin && apply && !alreadyOk) {
32
39
  const enable = await runProcess(codexBin, ['features', 'enable', flag], {
33
40
  timeoutMs: input.timeoutMs || 10000,
34
41
  maxOutputBytes: 32 * 1024
@@ -41,6 +48,7 @@ export async function repairBrowserUse(input) {
41
48
  exit_code: enable.code,
42
49
  stdout_tail: tail(enable.stdout),
43
50
  stderr_tail: tail(enable.stderr),
51
+ status: enable.code === 0 ? 'enabled' : 'unsupported_or_failed',
44
52
  blocker: enable.code === 0 ? null : 'codex_feature_enable_unsupported_or_failed'
45
53
  });
46
54
  }
@@ -50,19 +58,27 @@ export async function repairBrowserUse(input) {
50
58
  ok: alreadyOk,
51
59
  attempted: false,
52
60
  command: codexBin ? `${codexBin} features enable ${flag}` : `codex features enable ${flag}`,
61
+ status: alreadyOk ? 'already_enabled' : apply ? 'blocked' : 'detect_only',
53
62
  blocker: alreadyOk ? null : apply ? 'codex_cli_missing' : 'doctor_fix_not_requested'
54
63
  });
55
64
  }
56
65
  }
57
- // codex plugin enable/install has no documented CLI subcommand for the bundled chrome plugin
58
- // in this repo's evidence (only `plugin list --json` / app-server plugin RPCs are attested); do not guess one.
66
+ const repairPlugins = input.pluginRepair || ensureCodexPlugins;
67
+ const pluginRepair = before?.ok === true
68
+ ? null
69
+ : await repairPlugins({
70
+ pluginIds: ['browser@openai-bundled', 'chrome@openai-bundled'],
71
+ apply,
72
+ codexBin,
73
+ timeoutMs: input.timeoutMs || 30_000
74
+ }).catch((err) => ({ ok: false, changed: false, installs: [], blockers: [messageOf(err)], next_actions: [] }));
59
75
  steps.push({
60
- id: 'chrome_plugin_enable',
61
- ok: false,
62
- attempted: false,
63
- command: null,
64
- status: 'needs_more_info',
65
- blocker: 'chrome_plugin_enable_cli_subcommand_unknown'
76
+ id: 'browser_chrome_plugin_repair',
77
+ ok: before?.ok === true || pluginRepair?.ok === true,
78
+ attempted: Boolean(pluginRepair?.installs?.length),
79
+ command: codexBin ? `${codexBin} plugin add <browser|chrome>@openai-bundled --json` : 'codex plugin add <browser|chrome>@openai-bundled --json',
80
+ status: before?.ok === true ? 'already_ready' : pluginRepair?.ok ? 'ready' : 'blocked',
81
+ blocker: before?.ok === true || pluginRepair?.ok === true ? null : pluginRepair?.blockers?.[0] || 'codex_browser_plugins_not_ready'
66
82
  });
67
83
  let nodeReplStep;
68
84
  if (apply) {
@@ -104,7 +120,16 @@ export async function repairBrowserUse(input) {
104
120
  blockers.push('chrome_extension_manual_install_required');
105
121
  }
106
122
  const recovered = after?.ok === true;
107
- const nextActions = recovered ? [] : [
123
+ const optionalFeatureSteps = steps.filter((step) => step.id === 'in_app_browser_feature_enable' || step.id === 'browser_use_feature_enable');
124
+ const optionalFeatureEnablementBlockers = optionalFeatureSteps
125
+ .filter((step) => step.attempted && !step.ok)
126
+ .map((step) => `${step.id}:codex_feature_enable_unsupported_or_failed`);
127
+ // This repair can establish configuration/plugin capability only. A live Browser or
128
+ // Chrome action in a fresh Codex task is required before any route may claim use proof.
129
+ const realBrowserInteractionVerified = false;
130
+ const refreshActions = pluginRepair?.changed ? pluginRepair.next_actions || [] : [];
131
+ const nextActions = recovered ? refreshActions : [
132
+ ...refreshActions,
108
133
  'Open the Codex Desktop app and check its settings for the Chrome/Browser Use plugin entry (exact menu wording may vary by version; check Codex app settings generically if unsure).',
109
134
  'If a Chrome extension install/enable action is offered from within Codex App settings, follow it there rather than the Chrome Web Store directly, since Codex App is the source of truth for what "ready" means for this feature.',
110
135
  `If no in-app action is available, consult the setup docs: ${CODEX_CHROME_EXTENSION_SETUP_DOCS_URL}`,
@@ -115,12 +140,28 @@ export async function repairBrowserUse(input) {
115
140
  schema: DOCTOR_BROWSER_USE_REPAIR_SCHEMA,
116
141
  generated_at: nowIso(),
117
142
  ok: recovered,
143
+ ok_scope: 'configuration',
118
144
  attempted: before?.ok !== true,
119
145
  apply,
120
146
  recovered,
147
+ capability_ready: recovered,
148
+ configuration_ready: recovered,
149
+ configuration_recovered: before?.ok !== true && recovered,
150
+ route_ready: realBrowserInteractionVerified,
151
+ real_browser_interaction_verified: realBrowserInteractionVerified,
152
+ evidence_level: recovered ? 'configuration' : 'none',
121
153
  before,
122
154
  after,
123
155
  steps,
156
+ plugin_repair: pluginRepair,
157
+ current_task_tool_manifest_verified: false,
158
+ requires_new_task: pluginRepair?.requires_new_task === true,
159
+ optional_feature_enablement_blockers: optionalFeatureEnablementBlockers,
160
+ completion_blockers: realBrowserInteractionVerified ? [] : ['codex_browser_real_interaction_unverified'],
161
+ completion_actions: realBrowserInteractionVerified ? [] : [
162
+ 'Start a fresh Codex task so repaired Browser/Chrome tools are attached to the new task manifest.',
163
+ 'Perform and retain one real Browser or Chrome interaction before claiming browser-route completion.'
164
+ ],
124
165
  blockers: [...new Set(blockers)],
125
166
  next_actions: nextActions,
126
167
  manual_actions: nextActions,
@@ -140,7 +181,7 @@ export async function repairBrowserUse(input) {
140
181
  return report;
141
182
  }
142
183
  function tail(value, max = 2000) {
143
- const text = String(value || '');
184
+ const text = redactString(String(value || ''));
144
185
  return text.length > max ? text.slice(-max) : text;
145
186
  }
146
187
  function messageOf(err) {
@@ -1,4 +1,5 @@
1
1
  import path from 'node:path';
2
+ import { CURRENT_CODEX_RELEASE_MANIFEST } from '../codex-compat/codex-release-manifest.js';
2
3
  import { readJson } from '../fsx.js';
3
4
  export async function readCodex0139DoctorRealProbeStatus(root) {
4
5
  const summary = await readJson(path.join(root, '.sneakoscope', 'codex-0139-real-probe-summary.json'), null);
@@ -6,10 +7,10 @@ export async function readCodex0139DoctorRealProbeStatus(root) {
6
7
  return {
7
8
  schema: 'sks.doctor-codex-0139-real-probes.v1',
8
9
  codex_cli_version: result?.version_text || null,
9
- capability_version_flag: Boolean(result?.parsed_version && String(result.parsed_version).startsWith('0.139')),
10
+ capability_version_flag: result?.parsed_version === CURRENT_CODEX_RELEASE_MANIFEST.requiredCliVersion,
10
11
  real_probes_last_run_status: summary ? (summary.ok ? 'ok' : 'blocked') : 'not_run',
11
12
  skipped_probes: result?.skipped || [],
12
- strict_probe_command: 'npm run codex:0139-real-probes:require-real',
13
+ strict_probe_command: 'node ./dist/scripts/codex-0144-core-real-probes-check.js --require-real --allow-network',
13
14
  unsafe_auto_fix: false
14
15
  };
15
16
  }
@@ -8,16 +8,21 @@ export async function repairCodexStartupConfig(input) {
8
8
  const roleRepair = await repairAgentRoleConfigs({
9
9
  root,
10
10
  apply: input.apply === true,
11
- reportPath: path.join(root, '.sneakoscope', 'reports', 'agent-role-config-repair.json')
11
+ reportPath: path.join(root, '.sneakoscope', 'reports', 'agent-role-config-repair.json'),
12
+ ...(input.codexHome ? { codexHome: input.codexHome } : {})
12
13
  });
13
14
  const fileRepair = await repairAgentConfigFileReferences({
14
15
  root,
15
16
  apply: input.apply === true,
16
- reportPath: path.join(root, '.sneakoscope', 'reports', 'agent-config-file-repair.json')
17
+ reportPath: path.join(root, '.sneakoscope', 'reports', 'agent-config-file-repair.json'),
18
+ ...(input.home ? { home: input.home } : {}),
19
+ ...(input.codexHome ? { codexHome: input.codexHome } : {})
17
20
  });
18
21
  const postcheck = await postcheckCodexStartupConfig({
19
22
  root,
20
- reportPath: path.join(root, '.sneakoscope', 'reports', 'codex-startup-config-postcheck.json')
23
+ reportPath: path.join(root, '.sneakoscope', 'reports', 'codex-startup-config-postcheck.json'),
24
+ ...(input.home ? { home: input.home } : {}),
25
+ ...(input.codexHome ? { codexHome: input.codexHome } : {})
21
26
  });
22
27
  let report = {
23
28
  schema: 'sks.codex-startup-config-repair.v1',