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
@@ -0,0 +1,179 @@
1
+ import fs from 'node:fs/promises';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+ import { ensureDir, nowIso, readText, writeJsonAtomic } from '../fsx.js';
5
+ export const LEGACY_GLOBAL_HOOK_CLEANUP_SCHEMA = 'sks.legacy-global-hook-cleanup.v1';
6
+ export async function cleanupLegacyGlobalSksHooks(input) {
7
+ const root = path.resolve(input.root);
8
+ const home = input.home || os.homedir();
9
+ const globalPath = path.join(home, '.codex', 'hooks.json');
10
+ const projectPath = path.join(root, '.codex', 'hooks.json');
11
+ const globalParsed = await readHooks(globalPath);
12
+ const projectParsed = await readHooks(projectPath);
13
+ const warnings = [];
14
+ const blockers = [];
15
+ if (globalParsed.error)
16
+ blockers.push(`global_hooks_json_invalid:${globalParsed.error}`);
17
+ if (projectParsed.error)
18
+ warnings.push(`project_hooks_json_invalid:${projectParsed.error}`);
19
+ const projectRefs = projectParsed.value ? collectProjectSksHookRefs(projectParsed.value) : new Set();
20
+ const pruned = globalParsed.value
21
+ ? pruneDuplicatedGlobalHooks(globalParsed.value, projectRefs)
22
+ : { value: globalParsed.value, removed: [] };
23
+ if (pruned.removed.length && projectRefs.size === 0)
24
+ blockers.push('project_sks_hooks_missing_no_safe_global_cleanup');
25
+ let backupPath = null;
26
+ let rollbackPerformed = false;
27
+ let applied = false;
28
+ if (input.apply === true && pruned.removed.length && blockers.length === 0) {
29
+ backupPath = `${globalPath}.sks-legacy-global-${Date.now().toString(36)}.bak`;
30
+ try {
31
+ await ensureDir(path.dirname(globalPath));
32
+ await fs.copyFile(globalPath, backupPath);
33
+ await writeJsonAtomic(globalPath, pruned.value);
34
+ const postcheck = await readHooks(globalPath);
35
+ const remaining = postcheck.value ? pruneDuplicatedGlobalHooks(postcheck.value, projectRefs).removed : [];
36
+ if (postcheck.error || remaining.length)
37
+ throw new Error(postcheck.error || `duplicate_hooks_remain:${remaining.join(',')}`);
38
+ applied = true;
39
+ await pruneOldBackups(globalPath, backupPath);
40
+ }
41
+ catch (err) {
42
+ blockers.push(`legacy_global_hook_cleanup_failed:${messageOf(err)}`);
43
+ if (backupPath) {
44
+ try {
45
+ await fs.copyFile(backupPath, globalPath);
46
+ rollbackPerformed = true;
47
+ }
48
+ catch (rollbackErr) {
49
+ blockers.push(`legacy_global_hook_cleanup_rollback_failed:${messageOf(rollbackErr)}`);
50
+ }
51
+ }
52
+ }
53
+ }
54
+ let report = {
55
+ schema: LEGACY_GLOBAL_HOOK_CLEANUP_SCHEMA,
56
+ generated_at: nowIso(),
57
+ ok: blockers.length === 0,
58
+ root,
59
+ apply: input.apply === true,
60
+ global_hooks_path: globalPath,
61
+ project_hooks_path: projectPath,
62
+ project_sks_hook_count: projectRefs.size,
63
+ duplicate_global_hooks: pruned.removed,
64
+ removed_count: applied ? pruned.removed.length : 0,
65
+ applied,
66
+ backup_path: backupPath,
67
+ rollback_performed: rollbackPerformed,
68
+ non_sks_hooks_preserved: true,
69
+ requires_new_task: applied,
70
+ restart_app_if_stale: applied,
71
+ next_actions: applied ? [
72
+ 'Start a new Codex/Work task so only the project-local SKS hooks are loaded.',
73
+ 'If duplicate hook output persists, restart the ChatGPT/Codex desktop app and retry in a new task.'
74
+ ] : [],
75
+ blockers,
76
+ warnings
77
+ };
78
+ if (input.reportPath !== null) {
79
+ const reportPath = input.reportPath || path.join(root, '.sneakoscope', 'reports', 'legacy-global-hook-cleanup.json');
80
+ await writeJsonAtomic(reportPath, report).catch((err) => {
81
+ report = { ...report, report_write_failed: true, warnings: [...warnings, `report_write_failed:${messageOf(err)}`] };
82
+ });
83
+ report.report_path = reportPath;
84
+ }
85
+ return report;
86
+ }
87
+ function collectProjectSksHookRefs(value) {
88
+ const refs = new Set();
89
+ forEachHook(value, (event, matcher, hook) => {
90
+ const command = projectSksHookCommand(hook?.command);
91
+ if (command && hook?.type === 'command')
92
+ refs.add(hookRef(event, matcher, command));
93
+ });
94
+ return refs;
95
+ }
96
+ function pruneDuplicatedGlobalHooks(value, projectRefs) {
97
+ const next = structuredClone(value);
98
+ const container = hookContainer(next);
99
+ const removed = [];
100
+ for (const [event, groups] of Object.entries(container)) {
101
+ if (!Array.isArray(groups))
102
+ continue;
103
+ const keptGroups = groups.flatMap((group) => {
104
+ if (!group || !Array.isArray(group.hooks))
105
+ return [group];
106
+ const hooks = group.hooks.filter((hook) => {
107
+ const command = legacyGlobalSksHookCommand(hook?.command);
108
+ const ref = hookRef(event, group?.matcher, command || '');
109
+ if (hook?.type !== 'command' || !command || !projectRefs.has(ref))
110
+ return true;
111
+ removed.push(ref);
112
+ return false;
113
+ });
114
+ return hooks.length ? [{ ...group, hooks }] : [];
115
+ });
116
+ if (keptGroups.length)
117
+ container[event] = keptGroups;
118
+ else
119
+ delete container[event];
120
+ }
121
+ return { value: next, removed };
122
+ }
123
+ function forEachHook(value, visit) {
124
+ for (const [event, groups] of Object.entries(hookContainer(value))) {
125
+ if (!Array.isArray(groups))
126
+ continue;
127
+ for (const group of groups) {
128
+ for (const hook of Array.isArray(group?.hooks) ? group.hooks : [])
129
+ visit(event, group?.matcher, hook);
130
+ }
131
+ }
132
+ }
133
+ function hookContainer(value) {
134
+ return value?.hooks && typeof value.hooks === 'object' && !Array.isArray(value.hooks) ? value.hooks : value;
135
+ }
136
+ function legacyGlobalSksHookCommand(value) {
137
+ const command = String(value || '').trim();
138
+ if (/[;&|`$<>\r\n]/.test(command))
139
+ return null;
140
+ return command.match(/^(?:\S*\/)?sks\s+hook\s+([a-z0-9-]+)$/i)?.[1] || null;
141
+ }
142
+ function projectSksHookCommand(value) {
143
+ const command = String(value || '').trim();
144
+ if (/[;&|`$<>\r\n]/.test(command))
145
+ return null;
146
+ return command.match(/^node\s+\.\/dist\/bin\/sks\.js\s+hook\s+([a-z0-9-]+)$/i)?.[1] || null;
147
+ }
148
+ function hookRef(event, matcher, command) {
149
+ return `${event}:${String(matcher ?? '')}:${command}`;
150
+ }
151
+ async function readHooks(file) {
152
+ const text = await readText(file, '');
153
+ if (!text.trim())
154
+ return { value: null, error: null };
155
+ try {
156
+ const value = JSON.parse(text);
157
+ return value && typeof value === 'object' ? { value, error: null } : { value: null, error: 'root_not_object' };
158
+ }
159
+ catch (err) {
160
+ return { value: null, error: messageOf(err) };
161
+ }
162
+ }
163
+ async function pruneOldBackups(globalPath, keepPath) {
164
+ const dir = path.dirname(globalPath);
165
+ const prefix = `${path.basename(globalPath)}.sks-legacy-global-`;
166
+ const directoryEntries = await fs.readdir(dir, { withFileTypes: true }).catch(() => []);
167
+ const entries = directoryEntries
168
+ .filter((entry) => entry.isFile() && entry.name.startsWith(prefix) && entry.name.endsWith('.bak'))
169
+ .map((entry) => path.join(dir, entry.name));
170
+ const ranked = await Promise.all(entries.map(async (file) => ({ file, mtime: (await fs.stat(file)).mtimeMs })));
171
+ ranked.sort((a, b) => b.mtime - a.mtime);
172
+ for (const row of ranked.slice(3))
173
+ if (row.file !== keepPath)
174
+ await fs.rm(row.file, { force: true }).catch(() => undefined);
175
+ }
176
+ function messageOf(err) {
177
+ return err instanceof Error ? err.message : String(err);
178
+ }
179
+ //# sourceMappingURL=legacy-global-hook-cleanup.js.map
@@ -59,7 +59,8 @@ export async function runFeatureFixture(feature, { root = process.cwd() } = {})
59
59
  };
60
60
  }
61
61
  const tokens = tokenizeCommand(fixture.command);
62
- const spawnEnv = { ...process.env, CI: 'true', SKS_SKIP_NPM_FRESHNESS_CHECK: '1', SKS_ENSURE_DIST_NO_REBUILD: '1' };
62
+ const fixtureEnv = fixture.codex_app_session === true ? { SKS_NARUTO_APP_SESSION: '1' } : {};
63
+ const spawnEnv = { ...process.env, ...fixtureEnv, CI: 'true', SKS_SKIP_NPM_FRESHNESS_CHECK: '1', SKS_ENSURE_DIST_NO_REBUILD: '1' };
63
64
  const isSksCommand = tokens[0] === 'sks';
64
65
  const [spawnCommand, spawnArgs] = isSksCommand
65
66
  ? [process.execPath, [resolveSksEntrypoint(root), ...tokens.slice(1)]]
@@ -85,13 +86,16 @@ export async function runFeatureFixture(feature, { root = process.cwd() } = {})
85
86
  const missionIdFromOutput = extractMissionId(spawnResult.stdout);
86
87
  const latestMissionId = missionIdFromOutput
87
88
  ?? (kind === 'execute_and_validate_artifacts' ? await findLatestMission(root).catch(() => null) : null);
89
+ const stdoutJson = parseJsonOutput(spawnResult.stdout);
90
+ const stdoutFieldFailures = expectedFieldFailures('stdout', stdoutJson, fixture.expected_stdout_fields);
88
91
  const artifacts = kind === 'execute_and_validate_artifacts'
89
- ? expected.map((artifact) => inspectArtifact(root, artifact, latestMissionId))
92
+ ? expected.map((artifact) => inspectArtifact(root, artifact, latestMissionId, fixture.expected_artifact_fields?.[artifact.path]))
90
93
  : [];
91
94
  const artifactFailures = artifacts.filter((artifact) => !artifact.ok).map((artifact) => `${id}:${artifact.path}:${artifact.failure || 'artifact_invalid'}`);
92
95
  const blockers = [];
93
96
  if (!exitOk)
94
97
  blockers.push(timedOut ? `${id}:command_timeout_${timeoutMs}` : `${id}:command_exit_${spawnResult.status}`);
98
+ blockers.push(...stdoutFieldFailures.map((failure) => `${id}:${failure}`));
95
99
  blockers.push(...artifactFailures);
96
100
  const ok = blockers.length === 0;
97
101
  const actualStatus = ok ? 'pass' : 'blocked';
@@ -125,6 +129,13 @@ export async function runFeatureFixture(feature, { root = process.cwd() } = {})
125
129
  stdout_bytes: Buffer.byteLength(spawnResult.stdout || ''),
126
130
  stderr_bytes: Buffer.byteLength(spawnResult.stderr || ''),
127
131
  stderr_tail: String(spawnResult.stderr || '').slice(-800),
132
+ completion_semantics: fixture.completion_semantics || null,
133
+ stdout_contract: {
134
+ expected_fields: fixture.expected_stdout_fields || null,
135
+ parsed: Boolean(stdoutJson),
136
+ ok: stdoutFieldFailures.length === 0,
137
+ failures: stdoutFieldFailures
138
+ },
128
139
  artifacts,
129
140
  blockers,
130
141
  resolved_mission_id: latestMissionId
@@ -171,13 +182,24 @@ function extractMissionId(stdout) {
171
182
  }
172
183
  return null;
173
184
  }
174
- function inspectArtifact(root, artifact, latestMissionId) {
185
+ function inspectArtifact(root, artifact, latestMissionId, expectedFields = undefined) {
175
186
  const file = resolveExpectedArtifactPath(root, artifact.path, { latestMissionId });
176
187
  const exists = fs.existsSync(file);
177
188
  const relPath = path.isAbsolute(artifact.path) ? artifact.path : artifact.path;
178
189
  if (!exists) {
179
190
  return { path: relPath, schema: artifact.schema, exists: false, ok: Boolean(artifact.optional), failure: artifact.optional ? undefined : 'missing' };
180
191
  }
192
+ if (file.endsWith('.jsonl')) {
193
+ const lines = fs.readFileSync(file, 'utf8').split('\n').map((line) => line.trim()).filter(Boolean);
194
+ try {
195
+ for (const line of lines)
196
+ JSON.parse(line);
197
+ return { path: relPath, schema: artifact.schema, exists: true, ok: true, record_count: lines.length };
198
+ }
199
+ catch {
200
+ return { path: relPath, schema: artifact.schema, exists: true, ok: false, failure: 'jsonl_parse' };
201
+ }
202
+ }
181
203
  if (!file.endsWith('.json')) {
182
204
  const content = fs.readFileSync(file, 'utf8');
183
205
  return { path: relPath, schema: artifact.schema, exists: true, ok: content.trim().length > 0, failure: content.trim().length ? undefined : 'empty' };
@@ -189,10 +211,52 @@ function inspectArtifact(root, artifact, latestMissionId) {
189
211
  catch {
190
212
  return { path: relPath, schema: artifact.schema, exists: true, ok: false, failure: 'json_parse' };
191
213
  }
192
- if (!artifact.schema)
193
- return { path: relPath, schema: null, exists: true, ok: true };
194
- const schemaOk = parsed.schema === artifact.schema || parsed.schema_version != null;
195
- return { path: relPath, schema: artifact.schema, exists: true, ok: schemaOk, failure: schemaOk ? undefined : 'schema_mismatch', actual_schema: parsed.schema || null };
214
+ const fieldFailures = expectedFieldFailures(`artifact:${artifact.path}`, parsed, expectedFields);
215
+ const schemaOk = !artifact.schema || parsed.schema === artifact.schema || parsed.schema_version != null;
216
+ const ok = schemaOk && fieldFailures.length === 0;
217
+ return {
218
+ path: relPath,
219
+ schema: artifact.schema,
220
+ exists: true,
221
+ ok,
222
+ failure: !schemaOk ? 'schema_mismatch' : fieldFailures[0],
223
+ actual_schema: parsed.schema || null,
224
+ expected_fields: expectedFields || null,
225
+ field_failures: fieldFailures
226
+ };
227
+ }
228
+ function parseJsonOutput(stdout) {
229
+ const text = String(stdout || '').trim();
230
+ if (!text)
231
+ return null;
232
+ try {
233
+ return JSON.parse(text);
234
+ }
235
+ catch { }
236
+ const candidates = [];
237
+ for (const line of text.split(/\r?\n/)) {
238
+ const trimmed = line.trim();
239
+ if (!trimmed.startsWith('{'))
240
+ continue;
241
+ try {
242
+ candidates.push(JSON.parse(trimmed));
243
+ }
244
+ catch { }
245
+ }
246
+ return candidates.at(-1) || null;
247
+ }
248
+ function expectedFieldFailures(scope, actual, expected) {
249
+ if (!expected || typeof expected !== 'object' || Array.isArray(expected))
250
+ return [];
251
+ if (!actual || typeof actual !== 'object' || Array.isArray(actual))
252
+ return [`${scope}:json_missing`];
253
+ const failures = [];
254
+ for (const [field, expectedValue] of Object.entries(expected)) {
255
+ const actualValue = field.split('.').reduce((value, key) => value && typeof value === 'object' ? value[key] : undefined, actual);
256
+ if (JSON.stringify(actualValue) !== JSON.stringify(expectedValue))
257
+ failures.push(`${scope}:field_mismatch:${field}`);
258
+ }
259
+ return failures;
196
260
  }
197
261
  function normalizeExpectedArtifacts(items = []) {
198
262
  return (items || []).map((artifact) => {
@@ -13,7 +13,10 @@ export function runFeatureFixture(feature, { root = process.cwd(), tempRoot = fs
13
13
  const latestAfter = execution?.mission_id || latestMissionId(projectRoot) || latestBefore;
14
14
  const shouldValidateArtifacts = validateArtifacts && (fixture.kind === 'execute_and_validate_artifacts' || execution);
15
15
  const artifacts = shouldValidateArtifacts
16
- ? expected.map((artifact) => inspectExpectedArtifact(projectRoot, tempRoot, artifact, { latestMissionId: latestAfter }))
16
+ ? expected.map((artifact) => inspectExpectedArtifact(projectRoot, tempRoot, artifact, {
17
+ latestMissionId: latestAfter,
18
+ expectedFields: fixture.expected_artifact_fields?.[artifact.path]
19
+ }))
17
20
  : expected.map((artifact) => ({ path: artifact.path, requested_path: artifact.path, schema: artifact.schema || inferSchema(artifact.path), exists: null, schema_ok: null, content_ok: null, skipped: 'static_contract' }));
18
21
  const artifactFailures = shouldValidateArtifacts
19
22
  ? artifacts.filter((artifact) => !artifact.exists || !artifact.schema_ok || !artifact.content_ok).map((artifact) => `${feature.id}:${artifact.path}:${artifact.failure || 'artifact_invalid'}`)
@@ -58,28 +61,38 @@ function executeCommand(sourceRoot, projectRoot, spec, fixture = {}) {
58
61
  ...(fixture.root_mode === 'source_checkout_required' ? [] : [['setup', '--local-only', '--json']]),
59
62
  ...(normalized.setup || [])
60
63
  ];
61
- const setupResults = setup.map((args) => spawnSks(sourceRoot, projectRoot, args));
64
+ const fixtureEnv = fixture.codex_app_session === true ? { SKS_NARUTO_APP_SESSION: '1' } : {};
65
+ const setupResults = setup.map((args) => spawnSks(sourceRoot, projectRoot, args, fixtureEnv));
62
66
  const command = normalized.command || normalized.args || [];
63
- const result = command.length ? spawnSks(sourceRoot, projectRoot, command) : { status: 0, signal: null, ok: true, stdout_bytes: 0, stderr_bytes: 0, args: [] };
67
+ const result = command.length ? spawnSks(sourceRoot, projectRoot, command, fixtureEnv) : { status: 0, signal: null, ok: true, stdout_bytes: 0, stderr_bytes: 0, args: [] };
64
68
  const missionId = result.mission_id || [...setupResults].reverse().find((row) => row.mission_id)?.mission_id || null;
69
+ const expectationFailures = expectedFieldFailures('stdout', result.stdout_json, fixture.expected_stdout_fields);
65
70
  return {
66
71
  args: command,
67
72
  setup: setupResults,
68
73
  mission_id: missionId,
69
74
  status: result.status,
70
75
  signal: result.signal || null,
71
- ok: setupResults.every((row) => row.ok) && result.ok,
76
+ ok: setupResults.every((row) => row.ok) && result.ok && expectationFailures.length === 0,
72
77
  stdout_bytes: result.stdout_bytes,
73
- stderr_bytes: result.stderr_bytes
78
+ stderr_bytes: result.stderr_bytes,
79
+ completion_semantics: fixture.completion_semantics || null,
80
+ stdout_contract: {
81
+ expected_fields: fixture.expected_stdout_fields || null,
82
+ parsed: Boolean(result.stdout_json),
83
+ ok: expectationFailures.length === 0,
84
+ failures: expectationFailures
85
+ },
86
+ expectation_failures: expectationFailures
74
87
  };
75
88
  }
76
- function spawnSks(sourceRoot, projectRoot, args = []) {
89
+ function spawnSks(sourceRoot, projectRoot, args = [], fixtureEnv = {}) {
77
90
  const entrypoint = resolveSksEntrypoint(sourceRoot);
78
91
  const result = spawnSync(process.execPath, [entrypoint, ...args], {
79
92
  cwd: projectRoot,
80
93
  encoding: 'utf8',
81
94
  timeout: FEATURE_FIXTURE_COMMAND_TIMEOUT_MS,
82
- env: { ...process.env, CI: 'true', SKS_SKIP_NPM_FRESHNESS_CHECK: '1' }
95
+ env: { ...process.env, ...fixtureEnv, CI: 'true', SKS_SKIP_NPM_FRESHNESS_CHECK: '1' }
83
96
  });
84
97
  const parsed = parseJsonOutput(result.stdout || '');
85
98
  const timedOut = result.error?.code === 'ETIMEDOUT';
@@ -92,6 +105,7 @@ function spawnSks(sourceRoot, projectRoot, args = []) {
92
105
  timeout_ms: FEATURE_FIXTURE_COMMAND_TIMEOUT_MS,
93
106
  error_code: result.error?.code || null,
94
107
  mission_id: parsed?.mission_id || parsed?.id || parsed?.proof?.mission_id || parsed?.completion_proof?.mission_id || null,
108
+ stdout_json: parsed,
95
109
  stdout_bytes: Buffer.byteLength(result.stdout || ''),
96
110
  stderr_bytes: Buffer.byteLength(result.stderr || ''),
97
111
  stderr_tail: String(result.stderr || '').slice(-600)
@@ -100,6 +114,8 @@ function spawnSks(sourceRoot, projectRoot, args = []) {
100
114
  function fixtureExecutionFailure(featureId, execution) {
101
115
  if (execution?.timed_out)
102
116
  return `${featureId}:command_timeout_${execution.timeout_ms || 'unknown'}`;
117
+ if (execution?.expectation_failures?.length)
118
+ return `${featureId}:${execution.expectation_failures[0]}`;
103
119
  return `${featureId}:command_exit_${execution?.status}`;
104
120
  }
105
121
  function resolveSksEntrypoint(sourceRoot) {
@@ -173,6 +189,17 @@ function inspectExpectedArtifact(root, tempRoot, artifact, ctx = {}) {
173
189
  return { ...result, failure: 'missing' };
174
190
  if (file.endsWith('.md'))
175
191
  return { ...result, schema_ok: true, content_ok: fs.readFileSync(file, 'utf8').trim().length > 0 };
192
+ if (file.endsWith('.jsonl')) {
193
+ const lines = fs.readFileSync(file, 'utf8').split('\n').map((line) => line.trim()).filter(Boolean);
194
+ try {
195
+ for (const line of lines)
196
+ JSON.parse(line);
197
+ return { ...result, schema_ok: true, content_ok: true, record_count: lines.length };
198
+ }
199
+ catch {
200
+ return { ...result, failure: 'jsonl_parse' };
201
+ }
202
+ }
176
203
  let parsed;
177
204
  try {
178
205
  parsed = JSON.parse(fs.readFileSync(file, 'utf8'));
@@ -180,20 +207,34 @@ function inspectExpectedArtifact(root, tempRoot, artifact, ctx = {}) {
180
207
  catch {
181
208
  return { ...result, failure: 'json_parse' };
182
209
  }
210
+ const fieldFailures = expectedFieldFailures(`artifact:${artifact.path}`, parsed, ctx.expectedFields);
183
211
  if (schema === 'sks.completion-proof.v1')
184
- return { ...result, schema_ok: parsed.schema === schema, content_ok: ['verified', 'verified_partial', 'mock_only', 'blocked'].includes(parsed.status), status: parsed.status };
212
+ return { ...result, schema_ok: parsed.schema === schema, content_ok: ['verified', 'verified_partial', 'mock_only', 'blocked'].includes(parsed.status) && fieldFailures.length === 0, status: parsed.status, field_failures: fieldFailures };
185
213
  if (schema === 'sks.image-voxel-ledger.v1') {
186
214
  const anchorCount = Array.isArray(parsed.anchors) ? parsed.anchors.length : 0;
187
215
  const relationCount = Array.isArray(parsed.relations) ? parsed.relations.length : 0;
188
216
  const requireAnchors = artifact.require_anchors !== false;
189
217
  const requireRelations = artifact.require_relations === true;
190
- return { ...result, schema_ok: parsed.schema === schema, content_ok: (!requireAnchors || anchorCount >= 1) && (!requireRelations || relationCount >= 1), anchor_count: anchorCount, relation_count: relationCount };
218
+ return { ...result, schema_ok: parsed.schema === schema, content_ok: (!requireAnchors || anchorCount >= 1) && (!requireRelations || relationCount >= 1) && fieldFailures.length === 0, anchor_count: anchorCount, relation_count: relationCount, field_failures: fieldFailures };
191
219
  }
192
220
  if (schema === 'sks.visual-anchors.v1')
193
- return { ...result, schema_ok: parsed.schema === schema, content_ok: Array.isArray(parsed.anchors) && (artifact.require_anchors === false || parsed.anchors.length >= 1), anchor_count: parsed.anchors?.length || 0 };
221
+ return { ...result, schema_ok: parsed.schema === schema, content_ok: Array.isArray(parsed.anchors) && (artifact.require_anchors === false || parsed.anchors.length >= 1) && fieldFailures.length === 0, anchor_count: parsed.anchors?.length || 0, field_failures: fieldFailures };
194
222
  if (schema === 'sks.fixture-artifact.v1')
195
- return { ...result, schema_ok: Boolean(parsed.schema || parsed.schema_version || Object.hasOwn(parsed, 'passed') || Object.hasOwn(parsed, 'ok')), content_ok: true };
196
- return { ...result, schema_ok: schema ? parsed.schema === schema || parsed.schema_version != null : true, content_ok: true };
223
+ return { ...result, schema_ok: Boolean(parsed.schema || parsed.schema_version || Object.hasOwn(parsed, 'passed') || Object.hasOwn(parsed, 'ok')), content_ok: fieldFailures.length === 0, field_failures: fieldFailures };
224
+ return { ...result, schema_ok: schema ? parsed.schema === schema || parsed.schema_version != null : true, content_ok: fieldFailures.length === 0, field_failures: fieldFailures };
225
+ }
226
+ function expectedFieldFailures(scope, actual, expected) {
227
+ if (!expected || typeof expected !== 'object' || Array.isArray(expected))
228
+ return [];
229
+ if (!actual || typeof actual !== 'object' || Array.isArray(actual))
230
+ return [`${scope}:json_missing`];
231
+ const failures = [];
232
+ for (const [field, expectedValue] of Object.entries(expected)) {
233
+ const actualValue = field.split('.').reduce((value, key) => value && typeof value === 'object' ? value[key] : undefined, actual);
234
+ if (JSON.stringify(actualValue) !== JSON.stringify(expectedValue))
235
+ failures.push(`${scope}:field_mismatch:${field}`);
236
+ }
237
+ return failures;
197
238
  }
198
239
  function normalizeExpectedArtifacts(items = []) {
199
240
  return (items || []).map((artifact) => {
@@ -84,7 +84,6 @@ const FIXTURES = Object.freeze({
84
84
  'cli-with-local-llm': fixture('execute', 'sks with-local-llm status --json', [], 'pass'),
85
85
  'cli-dfix': fixture('execute_and_validate_artifacts', 'sks dfix fixture --json', ['completion-proof.json', 'dfix-gate.json', 'dfix-verification.json'], 'pass'),
86
86
  'cli-wiki': fixture('execute_and_validate_artifacts', 'sks wiki image-ingest test/fixtures/images/one-by-one.png --json', [{ path: '.sneakoscope/wiki/image-voxel-ledger.json', schema: 'sks.image-voxel-ledger.v1', require_anchors: false }], 'pass'),
87
- 'cli-db': fixture('execute', 'sks db policy', [], 'pass'),
88
87
  'cli-wizard': fixture('execute', 'sks wizard', [], 'pass'),
89
88
  'cli-bootstrap': fixture('execute', 'sks bootstrap --dry-run', [], 'pass'),
90
89
  'cli-deps': fixture('execute', 'sks deps check --json', [], 'pass'),
@@ -116,11 +115,11 @@ const FIXTURES = Object.freeze({
116
115
  'cli-init': fixture('execute', 'sks init --local-only --dry-run', [], 'pass'),
117
116
  'cli-eval': fixture('execute', 'sks eval run --mock --json', [], 'pass'),
118
117
  'cli-harness': fixture('execute', 'sks harness fixture --mock --json', [], 'pass'),
119
- 'cli-naruto': fixture('execute_and_validate_artifacts', 'sks naruto run "fixture" --backend fake --work-items 4 --json', ['completion-proof.json', 'naruto-gate.json'], 'pass'),
120
- 'cli-team': fixture('execute_and_validate_artifacts', 'sks team "fixture" --mock --clones 4 --backend fake --work-items 4 --json', ['naruto-gate.json', 'team-alias-to-naruto.json'], 'pass', { timeout_ms: 90000 }),
118
+ 'cli-naruto': fixture('execute_and_validate_artifacts', 'sks naruto run "fixture" --agents 4 --max-threads 4 --json', ['subagent-plan.json', 'subagent-events.jsonl', 'subagent-evidence.json', 'naruto-summary.json', 'naruto-gate.json', 'work-order-ledger.json'], 'pass', preparationFixtureContract()),
119
+ 'cli-team': fixture('execute_and_validate_artifacts', 'sks team "fixture" --agents 4 --max-threads 4 --json', ['subagent-plan.json', 'subagent-events.jsonl', 'subagent-evidence.json', 'naruto-summary.json', 'naruto-gate.json', 'team-alias-to-naruto.json', 'work-order-ledger.json'], 'pass', preparationFixtureContract({ timeout_ms: 90000 })),
121
120
  'cli-reasoning': fixture('execute', 'sks reasoning status --json', [], 'pass'),
122
121
  'cli-profile': fixture('execute', 'sks profile status --json', [], 'pass'),
123
- 'skill-db-safety-guard': fixture('execute_and_validate_artifacts', 'sks db check --sql "SELECT 1" --json', ['db-operation-report.json', 'completion-proof.json'], 'pass'),
122
+ 'skill-db-safety-guard': fixture('execute', 'node --test test/unit/db-safety.test.mjs', [], 'pass', { root_mode: 'source_checkout_required' }),
124
123
  'skill-honest-mode': fixture('execute_and_validate_artifacts', 'sks proof smoke --json', ['completion-proof.json', 'trust-report.json'], 'pass'),
125
124
  'skill-imagegen': fixture('execute_and_validate_artifacts', 'sks image-ux-review fixture --mock --json', ['image-ux-generated-review-ledger.json', 'image-voxel-ledger.json'], 'pass'),
126
125
  'ux-review:run-wires-imagegen': fixture('execute_and_validate_artifacts', 'npm run ux-review:run-wires-imagegen --silent', [{ path: 'image-ux-review-gate.json', schema: 'sks.image-ux-review-gate.v2', optional: true }], 'pass', {
@@ -135,18 +134,18 @@ const FIXTURES = Object.freeze({
135
134
  'cli-proof': fixture('execute_and_validate_artifacts', 'sks proof smoke --json', ['.sneakoscope/proof/latest.json'], 'pass'),
136
135
  'cli-trust': fixture('execute_and_validate_artifacts', 'sks trust report latest --json', ['trust-report.json'], 'pass'),
137
136
  'cli-wrongness': fixture('execute_and_validate_artifacts', 'sks wrongness add --kind missing_evidence --claim "fixture wrongness" --json', ['.sneakoscope/wiki/wrongness-ledger.json'], 'pass'),
138
- 'route-team': fixture('execute_and_validate_artifacts', 'sks team "fixture" --mock --clones 4 --backend fake --work-items 4 --json', ['naruto-gate.json', 'team-alias-to-naruto.json', 'work-order-ledger.json'], 'pass', { timeout_ms: 90000 }),
139
- 'route-team-alias': fixture('execute_and_validate_artifacts', 'sks team "fixture" --mock --clones 4 --backend fake --work-items 4 --json', ['naruto-gate.json', 'team-alias-to-naruto.json'], 'pass'),
140
- 'route-naruto': fixture('execute_and_validate_artifacts', 'sks naruto run "fixture" --clones 4 --backend fake --work-items 4 --json', ['agents/agent-proof-evidence.json', 'agents/agent-scheduler-state.json', 'work-order-ledger.json'], 'pass', { timeout_ms: 90000 }),
141
- 'route-work': fixture('execute_and_validate_artifacts', 'sks naruto run "fixture" --backend fake --work-items 4 --json', ['naruto-gate.json', 'work-order-ledger.json'], 'pass', { timeout_ms: 285000, reason: 'naruto-command.ts never invokes the route-finalizer/completion-proof pipeline; naruto-gate.json is the real artifact it writes.' }),
142
- 'route-swarm': fixture('execute_and_validate_artifacts', 'sks naruto run "fixture" --backend fake --work-items 4 --json', ['naruto-gate.json', 'work-order-ledger.json'], 'pass', { timeout_ms: 285000, reason: 'Same as route-work: naruto-command.ts never invokes the completion-proof pipeline.' }),
137
+ 'route-team': fixture('execute_and_validate_artifacts', 'sks team "fixture" --agents 4 --max-threads 4 --json', ['subagent-plan.json', 'subagent-events.jsonl', 'subagent-evidence.json', 'naruto-summary.json', 'naruto-gate.json', 'team-alias-to-naruto.json', 'work-order-ledger.json'], 'pass', preparationFixtureContract({ timeout_ms: 90000 })),
138
+ 'route-team-alias': fixture('execute_and_validate_artifacts', 'sks team "fixture" --agents 4 --max-threads 4 --json', ['subagent-plan.json', 'subagent-events.jsonl', 'subagent-evidence.json', 'naruto-summary.json', 'naruto-gate.json', 'team-alias-to-naruto.json'], 'pass', preparationFixtureContract()),
139
+ 'route-naruto': fixture('execute_and_validate_artifacts', 'sks naruto run "fixture" --agents 4 --max-threads 4 --json', ['subagent-plan.json', 'subagent-events.jsonl', 'subagent-evidence.json', 'naruto-summary.json', 'naruto-gate.json', 'work-order-ledger.json'], 'pass', preparationFixtureContract({ timeout_ms: 90000 })),
140
+ 'route-work': fixture('static', '$Work compatibility alias for the Naruto Codex official subagent workflow', [], 'pass', { quality: 'wiring_only', reason: 'Pure alias of $Naruto; official workflow execution is covered by route-naruto.' }),
141
+ 'route-swarm': fixture('static', '$Swarm compatibility alias for the Naruto Codex official subagent workflow', [], 'pass', { quality: 'wiring_only', reason: 'Pure alias of $Naruto; official workflow execution is covered by route-naruto.' }),
143
142
  'route-plan': fixture('execute', 'sks plan "fixture" --json', [], 'pass'),
144
143
  'route-review': fixture('execute', 'sks review --diff HEAD --json', [], 'pass'),
145
- 'route-shadowclone': fixture('static', '$ShadowClone alias of $Naruto shadow-clone swarm route', [], 'pass', {
144
+ 'route-shadowclone': fixture('static', '$ShadowClone compatibility alias for the Naruto Codex official subagent workflow', [], 'pass', {
146
145
  quality: 'wiring_only',
147
146
  reason: 'Pure alias of $Naruto; no independent behavior to verify beyond route-naruto\'s own execute_and_validate_artifacts fixture.'
148
147
  }),
149
- 'route-kagebunshin': fixture('static', '$Kagebunshin alias of $Naruto shadow-clone swarm route', [], 'pass', {
148
+ 'route-kagebunshin': fixture('static', '$Kagebunshin compatibility alias for the Naruto Codex official subagent workflow', [], 'pass', {
150
149
  quality: 'wiring_only',
151
150
  reason: 'Pure alias of $Naruto; no independent behavior to verify beyond route-naruto\'s own execute_and_validate_artifacts fixture.'
152
151
  }),
@@ -178,7 +177,7 @@ const FIXTURES = Object.freeze({
178
177
  reason: 'hasFromChatImgSignal() routes $From-Chat-IMG to the full Naruto multi-agent work-order pipeline (routes.ts routeById(\'Naruto\')), which requires real chat-screenshot attachments to produce from-chat-img-work-order.md; there is no lightweight deterministic `--mock` single-command invocation that produces this route\'s specific work-order/coverage artifacts the way route-naruto\'s generic fixture prompt does. Left as documented mock.'
179
178
  }),
180
179
  'route-ux-review': fixture('mock', 'sks image-ux-review fixture --mock --json', ['completion-proof.json', { path: 'image-voxel-ledger.json', schema: 'sks.image-voxel-ledger.v1' }, 'image-ux-generated-review-ledger.json'], 'pass', { reason: 'Alias of route-image-ux-review ($UX-Review -> $Image-UX-Review); shares the identical underlying command and the same intentional exit-1/ok:false mock-fixture hardening in imageUxFixture().' }),
181
- 'route-db': fixture('execute_and_validate_artifacts', 'sks db check --sql "SELECT 1" --json', ['completion-proof.json', 'db-operation-report.json'], 'pass', { timeout_ms: 120000 }),
180
+ 'route-db': fixture('execute', 'node ./dist/scripts/db-route-materialization-check.js', [], 'pass', { root_mode: 'source_checkout_required' }),
182
181
  'route-mad-db': fixture('mock', '$MAD-DB deprecated alias to $MAD-SKS sql-plane contract', ['mad-sks-gate.json', 'completion-proof.json'], 'pass', {
183
182
  reason: 'Deprecated alias of $MAD-SKS; shares the same gap as route-mad-sks (mad-sks-gate.json is only written via the real Codex App route dispatch pipeline, not any safe single sks CLI invocation). Left as documented mock alongside route-mad-sks.'
184
183
  }),
@@ -216,9 +215,9 @@ const FIXTURES = Object.freeze({
216
215
  'route-commit-and-push': fixture('mock', '$Commit-And-Push git route', ['completion-proof.json'], 'pass', {
217
216
  reason: 'Dollar-command alias of cli-commit-and-push; dispatches to the same simpleGitCommitCommand() that performs a real commit and `git push` with no working --dry-run mode. Left as documented mock alongside cli-commit-and-push.'
218
217
  }),
219
- 'route-release-review': fixture('execute_and_validate_artifacts', 'sks agent run "release audit" --route "$Release-Review" --agents 10 --concurrency 4 --mock --json', ['release-review-native-agent-plan.json', 'agents/agent-proof-evidence.json', 'agents/agent-effort-policy.json'], 'pass', { timeout_ms: 90000 }),
218
+ 'route-release-review': fixture('execute_and_validate_artifacts', 'sks agent run "release audit" --route "$Release-Review" --agents 10 --concurrency 4 --legacy-native-runtime --mock --json', ['release-review-native-agent-plan.json', 'agents/agent-proof-evidence.json', 'agents/agent-effort-policy.json'], 'pass', { timeout_ms: 90000, note: 'legacy compatibility fixture only; the public $Release-Review route uses official Codex subagents' }),
220
219
  'route-native-agent-intake': fixture('execute_and_validate_artifacts', 'sks agent run "fixture" --route "$Team" --agents 5 --concurrency 4 --mock --json', ['agents/agent-central-ledger.json', 'agents/agent-task-board.json', 'agents/agent-leases.json', 'agents/agent-no-overlap-proof.json', 'agents/agent-session-cleanup.json', 'agents/agent-proof-evidence.json', 'agents/agent-effort-policy.json'], 'pass', { timeout_ms: 90000 }),
221
- 'proof-agent-evidence': fixture('execute_and_validate_artifacts', 'sks naruto run "fixture" --backend fake --work-items 4 --json', ['naruto-gate.json', 'agents/agent-proof-evidence.json'], 'pass', { timeout_ms: 240000 })
220
+ 'proof-agent-evidence': fixture('execute_and_validate_artifacts', 'sks agent run "fixture" --mock --json', ['agents/agent-proof-evidence.json'], 'pass', { timeout_ms: 120000 })
222
221
  });
223
222
  const STATIC_CONTRACT_FEATURES = new Set([
224
223
  'cli-wizard',
@@ -240,6 +239,21 @@ const STATIC_CONTRACT_FEATURES = new Set([
240
239
  'cli-team',
241
240
  'cli-reasoning',
242
241
  'cli-profile',
242
+ 'cli-gates',
243
+ 'cli-postinstall',
244
+ 'cli-menubar',
245
+ 'cli-zellij-lane',
246
+ 'cli-zellij-slot-pane',
247
+ 'cli-zellij-monitor-pane',
248
+ 'cli-zellij-viewport-pane',
249
+ 'cli-zellij-slot-column-anchor',
250
+ 'cli-glm',
251
+ 'cli-mad-db',
252
+ 'cli-stop-gate',
253
+ 'cli-route',
254
+ 'cli-loop',
255
+ 'cli-autoresearch',
256
+ 'cli-hook',
243
257
  'handler-$',
244
258
  'handler-autoresearch',
245
259
  'handler-autoreview',
@@ -324,6 +338,25 @@ function fixture(kind, command, expected_artifacts, status, extra = {}) {
324
338
  ...extra
325
339
  };
326
340
  }
341
+ function preparationFixtureContract(extra = {}) {
342
+ return {
343
+ timeout_ms: 90000,
344
+ codex_app_session: true,
345
+ completion_semantics: 'preparation_only',
346
+ expected_stdout_fields: {
347
+ ok: false,
348
+ status: 'delegation_context_ready',
349
+ completion_evidence: false
350
+ },
351
+ expected_artifact_fields: {
352
+ 'naruto-gate.json': {
353
+ passed: false
354
+ }
355
+ },
356
+ reason: 'Codex App execution prepares delegation in the current parent. The fixture passes only when stdout remains ok:false/status:delegation_context_ready and naruto-gate.json remains passed:false.',
357
+ ...extra
358
+ };
359
+ }
327
360
  function qualityForKind(kind) {
328
361
  if (kind === 'execute' || kind === 'execute_and_validate_artifacts')
329
362
  return 'runtime_verified';