sneakoscope 4.8.7 → 5.3.0

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 (261) hide show
  1. package/README.md +51 -726
  2. package/config/bench-baseline.json +7 -0
  3. package/crates/sks-core/Cargo.lock +1 -1
  4. package/crates/sks-core/Cargo.toml +1 -1
  5. package/crates/sks-core/src/main.rs +1 -1
  6. package/dist/bin/install.js +35 -0
  7. package/dist/bin/sks.js +1 -1
  8. package/dist/cli/cli-theme.js +51 -0
  9. package/dist/cli/command-registry.js +15 -4
  10. package/dist/cli/help-fast.js +18 -8
  11. package/dist/cli/insane-search-command.js +36 -8
  12. package/dist/cli/install-helpers.js +32 -0
  13. package/dist/commands/codex-lb.js +2 -0
  14. package/dist/commands/doctor.js +94 -9
  15. package/dist/commands/proof.js +6 -3
  16. package/dist/config/skills-manifest.json +82 -54
  17. package/dist/core/agents/agent-conflict-graph.js +5 -0
  18. package/dist/core/agents/agent-lease.js +5 -0
  19. package/dist/core/agents/agent-ledger-schemas.js +1 -0
  20. package/dist/core/agents/agent-lifecycle.js +5 -3
  21. package/dist/core/agents/agent-orchestrator.js +268 -62
  22. package/dist/core/agents/agent-output-validator.js +14 -3
  23. package/dist/core/agents/agent-patch-queue-store.js +95 -2
  24. package/dist/core/agents/agent-patch-queue.js +6 -3
  25. package/dist/core/agents/agent-patch-schema.js +13 -0
  26. package/dist/core/agents/agent-proof-evidence.js +6 -1
  27. package/dist/core/agents/agent-runner-fake.js +40 -0
  28. package/dist/core/agents/agent-worker-pipeline.js +36 -2
  29. package/dist/core/agents/codex-exec-worker-adapter.js +2 -0
  30. package/dist/core/agents/native-cli-worker.js +0 -1
  31. package/dist/core/agents/native-worker-backend-router.js +58 -1
  32. package/dist/core/codex-app/sks-menubar.js +477 -132
  33. package/dist/core/codex-app.js +1 -0
  34. package/dist/core/codex-control/codex-sdk-config-policy.js +2 -1
  35. package/dist/core/codex-control/codex-sdk-env-policy.js +1 -1
  36. package/dist/core/codex-control/schemas/agent-worker-result.schema.js +12 -3
  37. package/dist/core/codex-hooks/codex-hook-managed-install.js +5 -0
  38. package/dist/core/codex-hooks/codex-hook-state-writer.js +70 -11
  39. package/dist/core/codex-hooks/codex-hook-trust-doctor.js +2 -2
  40. package/dist/core/codex-lb/codex-lb-env.js +20 -1
  41. package/dist/core/commands/basic-cli.js +18 -1
  42. package/dist/core/commands/check-command.js +37 -5
  43. package/dist/core/commands/computer-use-command.js +62 -7
  44. package/dist/core/commands/db-command.js +31 -5
  45. package/dist/core/commands/fast-mode-command.js +3 -0
  46. package/dist/core/commands/gate-result-contract.js +43 -0
  47. package/dist/core/commands/gates-command.js +6 -1
  48. package/dist/core/commands/gc-command.js +29 -2
  49. package/dist/core/commands/goal-command.js +9 -2
  50. package/dist/core/commands/gx-command.js +79 -7
  51. package/dist/core/commands/image-ux-review-command.js +188 -13
  52. package/dist/core/commands/mad-db-command.js +85 -176
  53. package/dist/core/commands/mad-sks-command.js +230 -29
  54. package/dist/core/commands/menubar-command.js +24 -2
  55. package/dist/core/commands/naruto-command.js +64 -10
  56. package/dist/core/commands/plan-command.js +76 -0
  57. package/dist/core/commands/ppt-command.js +159 -24
  58. package/dist/core/commands/qa-loop-command.js +6 -2
  59. package/dist/core/commands/release-command.js +55 -2
  60. package/dist/core/commands/research-command.js +1 -1
  61. package/dist/core/commands/review-command.js +217 -0
  62. package/dist/core/commands/route-success-helpers.js +59 -0
  63. package/dist/core/commands/run-command.js +19 -7
  64. package/dist/core/commands/seo-command.js +49 -1
  65. package/dist/core/commands/ui-command.js +161 -0
  66. package/dist/core/commands/uninstall-command.js +15 -1
  67. package/dist/core/db-safety.js +2 -2
  68. package/dist/core/doctor/doctor-dirty-planner.js +51 -7
  69. package/dist/core/doctor/doctor-transaction.js +8 -0
  70. package/dist/core/doctor/doctor-zellij-repair.js +1 -0
  71. package/dist/core/doctor/imagegen-repair.js +161 -0
  72. package/dist/core/feature-fixture-runner.js +2 -2
  73. package/dist/core/feature-fixtures.js +58 -37
  74. package/dist/core/feature-registry.js +102 -2
  75. package/dist/core/fsx.js +39 -6
  76. package/dist/core/image-ux-review/imagegen-adapter.js +48 -11
  77. package/dist/core/image-ux-review.js +16 -0
  78. package/dist/core/imagegen/imagegen-capability.js +11 -5
  79. package/dist/core/imagegen/require-imagegen.js +57 -0
  80. package/dist/core/init/skills.js +10 -5
  81. package/dist/core/mad-db/mad-db-coordinator.js +94 -18
  82. package/dist/core/mad-db/mad-db-policy.js +12 -10
  83. package/dist/core/mad-sks/executors/executor-base.js +8 -2
  84. package/dist/core/mad-sks/executors/index.js +4 -0
  85. package/dist/core/mad-sks/executors/sql-plane-executor.js +194 -0
  86. package/dist/core/naruto/naruto-active-pool.js +15 -4
  87. package/dist/core/naruto/naruto-real-worker-child.js +11 -1
  88. package/dist/core/naruto/naruto-role-policy.js +3 -0
  89. package/dist/core/naruto/naruto-task-hints.js +10 -0
  90. package/dist/core/naruto/naruto-work-graph.js +8 -2
  91. package/dist/core/naruto/naruto-work-item.js +6 -0
  92. package/dist/core/naruto/solution-tournament.js +101 -0
  93. package/dist/core/permission-gates.js +30 -0
  94. package/dist/core/pipeline-internals/runtime-core.js +11 -3
  95. package/dist/core/pipeline-internals/runtime-gates.js +27 -0
  96. package/dist/core/ppt-review/index.js +6 -1
  97. package/dist/core/ppt-review/slide-imagegen-review.js +75 -10
  98. package/dist/core/ppt.js +70 -2
  99. package/dist/core/proof/auto-finalize.js +70 -11
  100. package/dist/core/proof/proof-schema.js +2 -0
  101. package/dist/core/proof/route-adapter.js +5 -1
  102. package/dist/core/proof/route-finalizer.js +8 -5
  103. package/dist/core/proof/selftest-proof-fixtures.js +18 -5
  104. package/dist/core/proof/validation.js +2 -0
  105. package/dist/core/provider/model-router.js +53 -0
  106. package/dist/core/release/release-gate-node.js +3 -0
  107. package/dist/core/release/release-gate-resource-governor.js +1 -0
  108. package/dist/core/routes/constants.js +1 -1
  109. package/dist/core/routes.js +65 -18
  110. package/dist/core/safety/mutation-guard.js +5 -1
  111. package/dist/core/stop-gate/gate-evaluator.js +102 -0
  112. package/dist/core/stop-gate/stop-gate-check.js +16 -1
  113. package/dist/core/stop-gate/stop-gate-writer.js +4 -0
  114. package/dist/core/triwiki/agents-md-projector.js +184 -0
  115. package/dist/core/triwiki-wrongness/wrongness-schema.js +3 -1
  116. package/dist/core/trust-kernel/trust-kernel-schema.js +1 -0
  117. package/dist/core/trust-kernel/trust-report.js +1 -1
  118. package/dist/core/trust-kernel/trust-status.js +2 -0
  119. package/dist/core/ui/dashboard-html.js +111 -0
  120. package/dist/core/update/update-migration-state.js +386 -15
  121. package/dist/core/update-check.js +178 -81
  122. package/dist/core/verification/diff-quality.js +100 -0
  123. package/dist/core/verification/impact-scan.js +164 -0
  124. package/dist/core/verification/machine-feedback.js +146 -0
  125. package/dist/core/verification/mistake-rule-compiler.js +195 -0
  126. package/dist/core/version.js +1 -1
  127. package/dist/core/zellij/zellij-self-heal.js +9 -6
  128. package/dist/core/zellij/zellij-slot-telemetry.js +1 -1
  129. package/dist/scripts/check-feature-quality.js +2 -2
  130. package/dist/scripts/cli-output-consistency-check.js +57 -0
  131. package/dist/scripts/coding-bench-check.js +136 -0
  132. package/dist/scripts/doctor-imagegen-repair-check.js +62 -0
  133. package/dist/scripts/ensure-bin-executable.js +11 -3
  134. package/dist/scripts/harness-benchmark-check.js +104 -0
  135. package/dist/scripts/legacy-update-e2e-check.js +228 -0
  136. package/dist/scripts/mad-db-command-check.js +11 -8
  137. package/dist/scripts/mad-db-route-identity-check.js +8 -6
  138. package/dist/scripts/mad-db-safety-conflict-matrix-check.js +31 -8
  139. package/dist/scripts/mad-db-skill-policy-snapshot-check.js +4 -5
  140. package/dist/scripts/naruto-real-active-pool-runtime-check.js +26 -1
  141. package/dist/scripts/ppt-real-imagegen-wiring-check.js +5 -1
  142. package/dist/scripts/proof-root-cause-policy-check.js +2 -0
  143. package/dist/scripts/release-dag-full-coverage-check.js +13 -4
  144. package/dist/scripts/release-gate-dag-runner.js +14 -0
  145. package/dist/scripts/release-gate-existence-audit.js +2 -1
  146. package/dist/scripts/release-gate-planner.js +2 -1
  147. package/dist/scripts/release-gate-script-parity-check.js +45 -17
  148. package/dist/scripts/release-metadata-1-19-check.js +2 -1
  149. package/dist/scripts/seo-geo-feature-fixture-quality-check.js +1 -1
  150. package/dist/scripts/sks-1-11-gate-lib.js +8 -6
  151. package/dist/scripts/sks-menubar-install-check.js +57 -20
  152. package/dist/scripts/ux-review-real-loop-fixture-check.js +9 -4
  153. package/dist/scripts/ux-review-run-wires-imagegen-check.js +4 -0
  154. package/dist/scripts/zellij-slot-telemetry-runtime-check.js +1 -0
  155. package/docs/assets/sneakoscope-architecture-pipeline.jpg +0 -0
  156. package/docs/demo.tape +28 -0
  157. package/package.json +31 -24
  158. package/schemas/codex/completion-proof.schema.json +3 -2
  159. package/schemas/release/release-gate-node.schema.json +2 -1
  160. package/dist/scripts/agent-backfill-route-blackbox.js +0 -5
  161. package/dist/scripts/agent-dynamic-pool-route-blackbox.js +0 -5
  162. package/dist/scripts/agent-parallel-write-blackbox.js +0 -56
  163. package/dist/scripts/agent-patch-swarm-route-blackbox.js +0 -10
  164. package/dist/scripts/agent-route-blackbox-lib.js +0 -132
  165. package/dist/scripts/blackbox-command-import-smoke.js +0 -143
  166. package/dist/scripts/blackbox-global-shim.js +0 -77
  167. package/dist/scripts/blackbox-matrix.js +0 -70
  168. package/dist/scripts/blackbox-npx-one-shot.js +0 -69
  169. package/dist/scripts/blackbox-pack-install.js +0 -174
  170. package/dist/scripts/brand-neutrality-zero-leakage-blackbox.js +0 -4
  171. package/dist/scripts/build-once-runner-blackbox.js +0 -34
  172. package/dist/scripts/codex-0140-integration-blackbox.js +0 -13
  173. package/dist/scripts/codex-agent-type-blackbox.js +0 -4
  174. package/dist/scripts/codex-app-harness-blackbox.js +0 -4
  175. package/dist/scripts/codex-app-skill-agent-blackbox.js +0 -4
  176. package/dist/scripts/codex-hook-approval-blackbox.js +0 -4
  177. package/dist/scripts/codex-init-deep-directory-local-blackbox.js +0 -4
  178. package/dist/scripts/codex-native-feature-broker-blackbox.js +0 -4
  179. package/dist/scripts/codex-native-pattern-analysis-blackbox.js +0 -4
  180. package/dist/scripts/codex-native-read-repair-split-blackbox.js +0 -55
  181. package/dist/scripts/codex-native-reference-cache-blackbox.js +0 -41
  182. package/dist/scripts/core-skill-integrity-blackbox.js +0 -32
  183. package/dist/scripts/dfix-fast-blackbox-check.js +0 -37
  184. package/dist/scripts/dfix-parallel-write-blackbox.js +0 -48
  185. package/dist/scripts/dfix-patch-swarm-route-blackbox.js +0 -10
  186. package/dist/scripts/doctor-dirty-repair-blackbox.js +0 -22
  187. package/dist/scripts/doctor-dirty-semantic-blackbox.js +0 -8
  188. package/dist/scripts/doctor-native-capability-repair-blackbox.js +0 -39
  189. package/dist/scripts/doctor-transaction-engine-blackbox.js +0 -28
  190. package/dist/scripts/doctor-zellij-fix-blackbox.js +0 -4
  191. package/dist/scripts/doctor-zellij-no-homebrew-blackbox.js +0 -4
  192. package/dist/scripts/doctor-zellij-upgrade-blackbox.js +0 -4
  193. package/dist/scripts/gate-pack-runner-blackbox.js +0 -27
  194. package/dist/scripts/gate-pack-v2-blackbox.js +0 -18
  195. package/dist/scripts/geo-cli-blackbox-check.js +0 -18
  196. package/dist/scripts/loop-collision-blackbox.js +0 -3
  197. package/dist/scripts/loop-concurrency-oversubscription-blackbox.js +0 -3
  198. package/dist/scripts/loop-fixture-production-misuse-blackbox.js +0 -3
  199. package/dist/scripts/loop-kill-interrupt-real-blackbox.js +0 -3
  200. package/dist/scripts/loop-merge-strategy-blackbox.js +0 -3
  201. package/dist/scripts/loop-mesh-production-e2e-blackbox.js +0 -3
  202. package/dist/scripts/loop-side-effect-blackbox.js +0 -3
  203. package/dist/scripts/mad-db-operation-lifecycle-blackbox.js +0 -29
  204. package/dist/scripts/mad-sks-actual-executor-blackbox.js +0 -5
  205. package/dist/scripts/mad-zellij-headless-fallback-blackbox.js +0 -4
  206. package/dist/scripts/mad-zellij-self-heal-blackbox.js +0 -4
  207. package/dist/scripts/naruto-loop-mesh-blackbox.js +0 -3
  208. package/dist/scripts/naruto-real-parallelism-blackbox.js +0 -307
  209. package/dist/scripts/naruto-worktree-coding-blackbox.js +0 -29
  210. package/dist/scripts/parallel-runtime-real-blackbox.js +0 -44
  211. package/dist/scripts/pipeline-codex-native-doctor-mad-routing-real-blackbox.js +0 -77
  212. package/dist/scripts/pipeline-codex-native-e2e-blackbox.js +0 -13
  213. package/dist/scripts/pipeline-codex-native-image-routing-real-blackbox.js +0 -50
  214. package/dist/scripts/pipeline-codex-native-loop-routing-real-blackbox.js +0 -74
  215. package/dist/scripts/pipeline-codex-native-qa-routing-real-blackbox.js +0 -51
  216. package/dist/scripts/pipeline-codex-native-research-routing-real-blackbox.js +0 -45
  217. package/dist/scripts/pipeline-execution-profile-routing-blackbox.js +0 -4
  218. package/dist/scripts/postinstall-global-doctor-blackbox.js +0 -12
  219. package/dist/scripts/ppt-full-e2e-blackbox-check.js +0 -109
  220. package/dist/scripts/ppt-imagegen-blackbox-check.js +0 -46
  221. package/dist/scripts/qa-backfill-route-blackbox.js +0 -5
  222. package/dist/scripts/qa-patch-swarm-route-blackbox.js +0 -10
  223. package/dist/scripts/release-full-parallelism-blackbox.js +0 -41
  224. package/dist/scripts/release-triwiki-first-runner-blackbox.js +0 -48
  225. package/dist/scripts/release-wiring-3110-blackbox.js +0 -27
  226. package/dist/scripts/release-wiring-3112-blackbox.js +0 -17
  227. package/dist/scripts/release-wiring-3113-blackbox.js +0 -17
  228. package/dist/scripts/research-backfill-route-blackbox.js +0 -5
  229. package/dist/scripts/research-final-reviewer-blackbox.js +0 -70
  230. package/dist/scripts/research-stage-cycle-runtime-blackbox.js +0 -40
  231. package/dist/scripts/research-synthesis-writer-blackbox.js +0 -24
  232. package/dist/scripts/route-blackbox-realism-check.js +0 -21
  233. package/dist/scripts/scheduler-resource-claim-blackbox.js +0 -24
  234. package/dist/scripts/seo-cli-blackbox-check.js +0 -18
  235. package/dist/scripts/sks-3110-all-feature-regression-blackbox.js +0 -116
  236. package/dist/scripts/sks-3112-all-feature-regression-blackbox.js +0 -29
  237. package/dist/scripts/sks-3113-all-feature-regression-blackbox.js +0 -17
  238. package/dist/scripts/sks-400-all-feature-regression-blackbox.js +0 -21
  239. package/dist/scripts/sks-400-extreme-parallel-blackbox.js +0 -8
  240. package/dist/scripts/sks-400-five-minute-blackbox.js +0 -9
  241. package/dist/scripts/sks-400-legacy-purge-blackbox.js +0 -8
  242. package/dist/scripts/sks-401-all-feature-regression-blackbox.js +0 -46
  243. package/dist/scripts/sks-401-five-minute-actual-blackbox.js +0 -23
  244. package/dist/scripts/sks-402-all-feature-regression-blackbox.js +0 -9
  245. package/dist/scripts/sks-402-five-minute-real-blackbox.js +0 -22
  246. package/dist/scripts/sksd-warm-cache-blackbox.js +0 -12
  247. package/dist/scripts/team-backfill-route-blackbox.js +0 -5
  248. package/dist/scripts/team-parallel-write-blackbox.js +0 -55
  249. package/dist/scripts/team-patch-swarm-route-blackbox.js +0 -10
  250. package/dist/scripts/triwiki-affected-graph-blackbox.js +0 -28
  251. package/dist/scripts/triwiki-proof-bank-blackbox.js +0 -30
  252. package/dist/scripts/triwiki-proof-bank-lock-blackbox.js +0 -7
  253. package/dist/scripts/ux-patch-swarm-route-blackbox.js +0 -10
  254. package/dist/scripts/ux-review-imagegen-blackbox-check.js +0 -67
  255. package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -28
  256. package/dist/scripts/zellij-pane-lock-concurrency-blackbox.js +0 -80
  257. package/dist/scripts/zellij-pane-lock-open-worker-integration-blackbox.js +0 -137
  258. package/dist/scripts/zellij-self-heal-typed-blackbox.js +0 -4
  259. package/dist/scripts/zellij-slot-telemetry-real-blackbox.js +0 -20
  260. package/dist/scripts/zellij-stacked-fallback-integration-blackbox.js +0 -81
  261. package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -202
@@ -2,8 +2,9 @@
2
2
  import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { assertGate, emitGate, root } from './sks-1-18-gate-lib.js';
5
- const releaseManifest = readGateManifest(path.join(root, 'release-gates.v2.json'), 'sks.release-gates.v2');
6
- const harnessManifest = readGateManifest(path.join(root, 'infra-harness-gates.json'), 'sks.infra-harness-gates.v1');
5
+ const packageJson = readPackageJson(path.join(root, 'package.json'));
6
+ const releaseManifest = readReleaseGateManifest(path.join(root, 'release-gates.v2.json'), 'sks.release-gates.v2');
7
+ const harnessManifest = readReleaseGateManifest(path.join(root, 'infra-harness-gates.json'), 'sks.infra-harness-gates.v1');
7
8
  const releasePreset = releaseManifest.gates.filter((gate) => gate.preset.includes('release'));
8
9
  const harnessPreset = harnessManifest.gates.filter((gate) => gate.preset.includes('harness'));
9
10
  const releaseIds = new Set(releasePreset.map((gate) => gate.id));
@@ -58,11 +59,19 @@ const report = {
58
59
  release_zellij: releaseZellij,
59
60
  harness_non_zellij: harnessNonZellij,
60
61
  npm_run_commands: npmRunCommands,
61
- schema_complete: schemaComplete
62
+ schema_complete: schemaComplete,
63
+ package_script_count: Object.keys(packageJson.scripts || {}).length
62
64
  };
63
65
  assertGate(report.ok, 'release/harness gate manifests must satisfy consolidated v2 coverage policy', report);
64
66
  emitGate('release:dag-full-coverage', report);
65
- function readGateManifest(file, expectedSchema) {
67
+ function readPackageJson(file) {
68
+ const parsed = JSON.parse(fs.readFileSync(file, 'utf8'));
69
+ assertGate(isRecord(parsed), 'package.json must be an object', { file });
70
+ const record = parsed;
71
+ const scripts = isRecord(record.scripts) ? Object.fromEntries(Object.entries(record.scripts).filter((entry) => typeof entry[1] === 'string')) : {};
72
+ return { scripts };
73
+ }
74
+ function readReleaseGateManifest(file, expectedSchema) {
66
75
  const parsed = JSON.parse(fs.readFileSync(file, 'utf8'));
67
76
  assertGate(isRecord(parsed), 'gate manifest must be an object', { file });
68
77
  assertGate(parsed.schema === expectedSchema, 'gate manifest schema mismatch', { file, schema: parsed.schema, expected_schema: expectedSchema });
@@ -43,6 +43,20 @@ console.log(`SKS Release DAG
43
43
  critical_path: ${(result.critical_path_ms / 1000).toFixed(1)}s
44
44
  certificate: ${result.completion_certificate.confidence} sla=${(result.completion_certificate.sla_ms / 1000).toFixed(0)}s met=${result.completion_certificate.sla_met}
45
45
  report: ${result.report_dir}`);
46
+ const gateResult = {
47
+ schema: 'sks.gate-result.v1',
48
+ ok: result.ok === true,
49
+ blockers: result.ok ? [] : result.failures.map((failure) => `release_gate_failed:${failure.id}`),
50
+ summary: {
51
+ total_gates: result.total_gates,
52
+ selected_gates: result.selected_gates,
53
+ cached: result.cached,
54
+ completed: result.completed,
55
+ failed: result.failed,
56
+ report_dir: result.report_dir
57
+ }
58
+ };
59
+ console.log(JSON.stringify(gateResult));
46
60
  if (!result.ok) {
47
61
  for (const failure of result.failures) {
48
62
  console.error(`[fail] ${failure.id} exit=${failure.exit_code}\n${failure.stderr_tail}`);
@@ -43,7 +43,8 @@ const releaseCheckTarget = releaseCheck.includes('release:check:affected')
43
43
  : releaseCheck;
44
44
  assertGate(releaseCheckTarget.includes('release-gate-dag-runner') && /--preset\s+(?:release|affected)/.test(releaseCheckTarget), 'release:check must use the v2 DAG release/affected preset', { release_check: scripts['release:check'], resolved_release_check: releaseCheckTarget });
45
45
  assertGate(releaseGates.length > 0 && releaseGates.length <= 200, 'release v2 manifest must include 1..200 release gates', { gate_count: releaseGates.length });
46
- assertGate(Object.keys(scripts).length <= 100, 'package script budget exceeded', { script_count: Object.keys(scripts).length });
46
+ const PACKAGE_SCRIPT_BUDGET = 150;
47
+ assertGate(Object.keys(scripts).length <= PACKAGE_SCRIPT_BUDGET, 'package script budget exceeded', { script_count: Object.keys(scripts).length, limit: PACKAGE_SCRIPT_BUDGET });
47
48
  for (const id of requiredRelease)
48
49
  assertGate(releaseIds.has(id), `critical release gate missing from release v2 manifest: ${id}`, { id });
49
50
  for (const id of requiredHarness)
@@ -9,6 +9,7 @@ import { assertGate, emitGate, importDist, root } from './sks-1-18-gate-lib.js';
9
9
  const { validateReleaseGateManifest } = await importDist('core/release/release-gate-node.js');
10
10
  const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
11
11
  const scripts = pkg.scripts || {};
12
+ const PACKAGE_SCRIPT_BUDGET = 150;
12
13
  const release = readManifest('release-gates.v2.json');
13
14
  const harness = readManifest('infra-harness-gates.json');
14
15
  assertGate(!fs.existsSync(path.join(root, 'release-gates.json')), 'release-gates.json v1 must not be present');
@@ -27,7 +28,7 @@ const releasePresetLeaks = release.gates.filter((gate) => !Array.isArray(gate.pr
27
28
  const harnessPresetLeaks = harness.gates.filter((gate) => !Array.isArray(gate.preset) || !gate.preset.includes('harness') || gate.preset.includes('release')).map((gate) => gate.id);
28
29
  const npmRunGates = release.gates.concat(harness.gates).filter((gate) => /\bnpm\s+run\b/.test(String(gate.command))).map((gate) => gate.id);
29
30
  assertGate(release.gates.length <= 200, 'release preset gate budget exceeded', { release_gates: release.gates.length, limit: 200 });
30
- assertGate(Object.keys(scripts).length <= 100, 'package.json script budget exceeded', { scripts: Object.keys(scripts).length, limit: 100 });
31
+ assertGate(Object.keys(scripts).length <= PACKAGE_SCRIPT_BUDGET, 'package.json script budget exceeded', { scripts: Object.keys(scripts).length, limit: PACKAGE_SCRIPT_BUDGET });
31
32
  assertGate(duplicateAcrossManifests.length === 0, 'gate appears in both release and harness manifests', { duplicateAcrossManifests });
32
33
  assertGate(releaseZellij.length === 0, 'zellij gates must live in infra-harness-gates.json, not release-gates.v2.json', { releaseZellij });
33
34
  assertGate(harnessNonZellij.length === 0, 'infra harness manifest must contain only zellij gates', { harnessNonZellij });
@@ -4,10 +4,6 @@ import path from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
5
5
  import { assertGate, emitGate, readJson, root } from './sks-1-18-gate-lib.js';
6
6
  import { writeJsonAtomic } from '../core/fsx.js';
7
- import { REQUIRED_3112_REAL_CHECK_IDS, REQUIRED_3112_RELEASE_IDS } from './release-3112-required-gates.js';
8
- import { REQUIRED_3113_REAL_CHECK_IDS, REQUIRED_3113_RELEASE_IDS } from './release-3113-required-gates.js';
9
- import { REQUIRED_4000_REAL_CHECK_IDS, REQUIRED_4000_RELEASE_IDS } from './release-4000-required-gates.js';
10
- import { REQUIRED_4002_REAL_CHECK_IDS, REQUIRED_4002_RELEASE_IDS } from './release-4002-required-gates.js';
11
7
  export const REQUIRED_3110_RELEASE_IDS = [
12
8
  'core-skill:manifest',
13
9
  'core-skill:immutable-sync',
@@ -38,7 +34,7 @@ export const REQUIRED_3110_RELEASE_IDS = [
38
34
  'config:managed-merge-callsite-coverage',
39
35
  'release:gate-script-parity',
40
36
  'release:wiring-3110-blackbox',
41
- 'sks:3110-all-feature-regression'
37
+ 'sks:3112-all-feature-regression'
42
38
  ];
43
39
  if (isMain()) {
44
40
  main().catch((err) => {
@@ -63,36 +59,52 @@ export function buildReleaseGateScriptParityReport() {
63
59
  const gates = Array.isArray(manifest.gates) ? manifest.gates : [];
64
60
  const gateById = new Map(gates.map((gate) => [gate.id, gate]));
65
61
  const releaseGateIds = gates.filter((gate) => gate.preset?.includes('release')).map((gate) => gate.id);
66
- const requiredReleaseIds = [...new Set([...REQUIRED_3110_RELEASE_IDS, ...REQUIRED_3112_RELEASE_IDS, ...REQUIRED_3113_RELEASE_IDS, ...REQUIRED_4000_RELEASE_IDS, ...REQUIRED_4002_RELEASE_IDS, 'codex:0140-real-probes'])];
67
- const requiredRealCheckIds = [...new Set([...REQUIRED_3112_REAL_CHECK_IDS, ...REQUIRED_3113_REAL_CHECK_IDS, ...REQUIRED_4000_REAL_CHECK_IDS, ...REQUIRED_4002_REAL_CHECK_IDS])];
62
+ const requiredReleaseIds = releaseGateIds;
63
+ const requiredRealCheckIds = gates.filter((gate) => gate.preset?.includes('real-check')).map((gate) => gate.id);
68
64
  const requiredAllIds = [...new Set([...requiredReleaseIds, ...requiredRealCheckIds])];
69
- const missingScripts = [...new Set([
70
- ...releaseGateIds.filter((id) => !scripts[id]),
71
- ...requiredAllIds.filter((id) => !scripts[id])
72
- ])].sort();
65
+ const requiredEntryScripts = [
66
+ 'build',
67
+ 'build:incremental',
68
+ 'typecheck',
69
+ 'release:check',
70
+ 'release:metadata',
71
+ 'release:check:affected',
72
+ 'release:check:fast',
73
+ 'release:check:confidence',
74
+ 'release:check:full',
75
+ 'prepublishOnly',
76
+ 'publish:prep-ignore-scripts',
77
+ 'publish:ignore-scripts',
78
+ 'gates:run',
79
+ 'policy:gate-audit'
80
+ ];
81
+ const missingEntryScripts = requiredEntryScripts.filter((id) => !scripts[id]).sort();
73
82
  const missingGates = requiredAllIds.filter((id) => !gateById.has(id)).sort();
74
83
  const missingReleasePreset = requiredReleaseIds.filter((id) => !gateById.get(id)?.preset?.includes('release')).sort();
75
84
  const missingRealCheckPreset = requiredRealCheckIds.filter((id) => !gateById.get(id)?.preset?.includes('real-check')).sort();
76
85
  const wrongCommands = requiredAllIds
77
- .map((id) => ({ id, expected: `npm run ${id} --silent`, actual: gateById.get(id)?.command || '' }))
78
- .filter((row) => row.actual !== row.expected);
86
+ .map((id) => {
87
+ const actual = gateById.get(id)?.command || '';
88
+ return { id, actual, reason: directManifestCommandIssue(actual) };
89
+ })
90
+ .filter((row) => row.reason);
79
91
  const missingSourceTargets = requiredAllIds
80
- .map((id) => ({ id, source: sourceTargetForScript(scripts[id]) }))
92
+ .map((id) => ({ id, source: sourceTargetForScript(gateById.get(id)?.command) }))
81
93
  .filter((row) => row.source && !fs.existsSync(path.join(root, row.source)))
82
94
  .map((row) => row.source)
83
95
  .sort();
84
96
  const missingDistTargets = requiredAllIds
85
- .map((id) => ({ id, dist: distTargetForScript(scripts[id]) }))
97
+ .map((id) => ({ id, dist: distTargetForScript(gateById.get(id)?.command) }))
86
98
  .filter((row) => row.dist && fs.existsSync(path.join(root, 'dist')) && !fs.existsSync(path.join(root, row.dist)))
87
99
  .map((row) => row.dist)
88
100
  .sort();
89
101
  return {
90
102
  schema: 'sks.release-gate-script-parity.v1',
91
- ok: missingScripts.length === 0 && missingGates.length === 0 && missingReleasePreset.length === 0 && missingRealCheckPreset.length === 0 && wrongCommands.length === 0 && missingSourceTargets.length === 0 && missingDistTargets.length === 0,
103
+ ok: missingEntryScripts.length === 0 && missingGates.length === 0 && missingReleasePreset.length === 0 && missingRealCheckPreset.length === 0 && wrongCommands.length === 0 && missingSourceTargets.length === 0 && missingDistTargets.length === 0,
92
104
  release_gate_count: releaseGateIds.length,
93
105
  package_script_count: Object.keys(scripts).length,
94
106
  checked_required_ids: requiredAllIds.length,
95
- missing_scripts: missingScripts,
107
+ missing_entry_scripts: missingEntryScripts,
96
108
  missing_gates: missingGates,
97
109
  missing_release_preset: missingReleasePreset,
98
110
  missing_real_check_preset: missingRealCheckPreset,
@@ -101,6 +113,22 @@ export function buildReleaseGateScriptParityReport() {
101
113
  missing_dist_targets: missingDistTargets
102
114
  };
103
115
  }
116
+ function directManifestCommandIssue(command) {
117
+ const text = String(command || '');
118
+ if (!text)
119
+ return 'missing_command';
120
+ if (/\bnpm\s+run\b/.test(text))
121
+ return 'gate_command_must_not_require_package_script_alias';
122
+ const segments = text.split(/\s+(?:&&|\|\|)\s+/).map((part) => part.trim()).filter(Boolean);
123
+ const invalid = segments.find((part) => !(/^node\s+\.\/dist\/scripts\/[^\s]+\.js\b/.test(part)
124
+ || /^node\s+\.\/dist\/bin\/sks\.js\b/.test(part)
125
+ || /^node\s+--test\b/.test(part)
126
+ || /^tsc\s+-p\s+tsconfig\.json\s+--noEmit$/.test(part)));
127
+ if (invalid) {
128
+ return 'gate_command_must_execute_dist_script_or_typecheck_directly';
129
+ }
130
+ return '';
131
+ }
104
132
  function distTargetForScript(script) {
105
133
  const match = String(script || '').match(/node\s+\.\/dist\/scripts\/([^\s]+\.js)/);
106
134
  return match ? `dist/scripts/${match[1]}` : null;
@@ -372,7 +372,8 @@ assertGate(releaseManifest?.schema === 'sks.release-gates.v2', 'release gate man
372
372
  assertGate(harnessManifest?.schema === 'sks.infra-harness-gates.v1', 'infra harness manifest schema mismatch', { schema: harnessManifest?.schema || null });
373
373
  assertGate(releaseGates.length > 0 && releaseGates.length <= 200, 'release v2 manifest must include 1..200 release gates', { release_gates: releaseGates.length });
374
374
  assertGate(harnessGates.length > 0, 'infra harness manifest must include harness gates', { harness_gates: harnessGates.length });
375
- assertGate(Object.keys(pkg.scripts || {}).length <= 100, 'package script budget exceeded', { script_count: Object.keys(pkg.scripts || {}).length });
375
+ const PACKAGE_SCRIPT_BUDGET = 100;
376
+ assertGate(Object.keys(pkg.scripts || {}).length <= PACKAGE_SCRIPT_BUDGET, 'package script budget exceeded', { script_count: Object.keys(pkg.scripts || {}).length, limit: PACKAGE_SCRIPT_BUDGET });
376
377
  for (const script of requiredPackageScripts)
377
378
  assertGate(Boolean(pkg.scripts?.[script]), `missing package script: ${script}`);
378
379
  for (const id of requiredReleaseGates)
@@ -9,7 +9,7 @@ for (const id of ['cli-seo-geo-optimizer', 'route-seo-geo-optimizer']) {
9
9
  assertGate(feature, `feature missing: ${id}`);
10
10
  assertGate(feature.fixture?.status === 'pass', `feature fixture must pass: ${id}`, feature);
11
11
  assertGate(feature.fixture?.quality !== 'static_contract', `SEO/GEO feature must not rely on static contract: ${id}`, feature.fixture);
12
- assertGate(['runtime_verified', 'runtime_mock_verified'].includes(feature.fixture?.quality), `SEO/GEO fixture quality must be runtime-backed: ${id}`, feature.fixture);
12
+ assertGate(feature.fixture?.quality === 'runtime_verified', `SEO/GEO fixture quality must be runtime-backed by execution: ${id}`, feature.fixture);
13
13
  }
14
14
  const selftest = registryMod.buildAllFeaturesSelftest(registry, {});
15
15
  const runtimeCheck = selftest.checks.find((check) => check.id === 'runtime_routes_not_static_contract');
@@ -23,15 +23,17 @@ export function runSksJson(args) {
23
23
  timeout: Number(process.env.SKS_GATE_TIMEOUT_MS || 120_000),
24
24
  env: { ...process.env, SKS_SKIP_NPM_FRESHNESS_CHECK: '1', CI: 'true' }
25
25
  });
26
- if (result.status !== 0) {
27
- assertGate(false, 'sks command failed', { args, status: result.status, stdout: result.stdout, stderr: result.stderr });
28
- }
26
+ let parsed = null;
29
27
  try {
30
- return JSON.parse(result.stdout);
28
+ parsed = JSON.parse(result.stdout);
31
29
  }
32
30
  catch (err) {
33
31
  assertGate(false, 'sks command did not emit parseable JSON', { args, stdout: result.stdout, error: err.message });
34
32
  }
33
+ if (result.status !== 0 && !parsed?.mission_id) {
34
+ assertGate(false, 'sks command failed', { args, status: result.status, stdout: result.stdout, stderr: result.stderr });
35
+ }
36
+ return { ...parsed, _process_status: result.status, _stderr_tail: String(result.stderr || '').slice(-600) };
35
37
  }
36
38
  export function runPptReview(action = 'review') {
37
39
  const json = runSksJson(['ppt', 'fixture', '--mock', '--json']);
@@ -46,7 +48,7 @@ export function runPptReview(action = 'review') {
46
48
  },
47
49
  slideIssues: review.slide_issue_ledger || {}
48
50
  };
49
- assertGate(json.ok === true, 'ppt imagegen review fixture blocked', json);
51
+ assertGate(Boolean(json.mission_id), 'ppt imagegen review fixture did not create a mission', json);
50
52
  assertGate(json.proof_evidence?.generated_slide_callout_images_count > 0, 'ppt callout image evidence missing', json.proof_evidence);
51
53
  assertGate(json.proof_evidence?.slide_issue_extraction_status === 'valid', 'ppt issue extraction missing', json.proof_evidence);
52
54
  return json;
@@ -60,7 +62,7 @@ export function runDfixFixture() {
60
62
  }
61
63
  export function runUxFixture() {
62
64
  const json = runSksJson(['image-ux-review', 'fixture', '--mock', '--json']);
63
- assertGate(json.ok === true, 'image UX review fixture blocked', json);
65
+ assertGate(Boolean(json.mission_id), 'image UX review fixture did not create a mission', json);
64
66
  return json;
65
67
  }
66
68
  export function missionFile(missionId, file) {
@@ -1,7 +1,7 @@
1
1
  import fs from 'node:fs/promises';
2
2
  import os from 'node:os';
3
3
  import path from 'node:path';
4
- import { PACKAGE_VERSION } from '../core/fsx.js';
4
+ import { PACKAGE_VERSION, runProcess, which } from '../core/fsx.js';
5
5
  import { installSksMenuBar } from '../core/codex-app/sks-menubar.js';
6
6
  const temp = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-menubar-check-'));
7
7
  const envHomeTemp = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-menubar-env-home-check-'));
@@ -44,22 +44,30 @@ const actionScript = result.action_script_path ? await fs.readFile(result.action
44
44
  const launchAgentSource = result.launch_agent_path ? await fs.readFile(result.launch_agent_path, 'utf8').catch(() => '') : '';
45
45
  const infoPlistPath = result.app_path ? path.join(result.app_path, 'Contents', 'Info.plist') : null;
46
46
  const infoPlist = infoPlistPath ? await fs.readFile(infoPlistPath, 'utf8').catch(() => '') : '';
47
+ const swiftParse = await swiftParseSmoke(generatedSourcePath);
47
48
  const commandRegistry = await fs.readFile(path.join(process.cwd(), 'src', 'cli', 'command-registry.ts'), 'utf8');
48
49
  const installHelpers = await fs.readFile(path.join(process.cwd(), 'src', 'cli', 'install-helpers.ts'), 'utf8');
50
+ const cltMissing = process.platform === 'darwin' && result.blockers.includes('xcode_clt_missing');
49
51
  const hasVisibleStatusSource = generatedSource.includes('NSStatusItem.variableLength')
50
52
  && generatedSource.includes('configureStatusButton(button, title: state.title)')
51
53
  && generatedSource.includes('SKS ⚠')
52
54
  && generatedSource.includes('SKS ↑')
55
+ && generatedSource.includes('SKS ⋯')
53
56
  && generatedSource.includes('Timer.scheduledTimer(withTimeInterval: 30.0');
54
57
  const hasBackgroundReadonlyActions = generatedSource.includes('runSksBackground(["codex-lb", "fast-check"]')
55
58
  && generatedSource.includes('runSksBackground(["update", "check"]')
56
59
  && generatedSource.includes('display notification')
57
- && !generatedSource.includes('@objc func fastCheck() {\n runSksInTerminal');
58
- const hasTerminalFailureAlert = generatedSource.includes('output.contains("-1743")')
59
- && generatedSource.includes('Privacy & Security > Automation');
60
- const hasTerminalExit = generatedSource.includes('; exit');
60
+ && !generatedSource.includes('runSksInTerminal')
61
+ && !generatedSource.includes('runInTerminal');
62
+ const hasNativeModalSource = generatedSource.includes('func promptText(title: String, message: String')
63
+ && generatedSource.includes('NSSecureTextField')
64
+ && generatedSource.includes('stdinText: key + "\\n"');
65
+ const hasActionLogSource = generatedSource.includes('lastActionLogPath')
66
+ && generatedSource.includes('.posixPermissions: 0o600')
67
+ && generatedSource.includes('redactSecrets');
61
68
  const hasAutosaveNameSource = generatedSource.includes('statusItem.autosaveName = "com.sneakoscope.sks-menubar"');
62
- const hasExplicitVisibleSource = generatedSource.includes('statusItem.isVisible = true');
69
+ const hasCodexLifecycleSource = generatedSource.includes('Codex app not detected — sync disabled')
70
+ || (generatedSource.includes('NSWorkspace.didLaunchApplicationNotification') && generatedSource.includes('NSWorkspace.didTerminateApplicationNotification'));
63
71
  const hasNoUnconditionalKeepAlive = !launchAgentSource.includes('<key>KeepAlive</key>');
64
72
  const hasNoLaunchAgentSecrets = !launchAgentSource.includes('EnvironmentVariables')
65
73
  && !launchAgentSource.includes('CODEX_LB_API_KEY')
@@ -69,11 +77,13 @@ const hasInteractiveProcessType = launchAgentSource.includes('<key>ProcessType</
69
77
  const hasPackagePlistVersion = infoPlist.includes(`<string>${PACKAGE_VERSION}</string>`)
70
78
  && infoPlist.includes('<key>CFBundleShortVersionString</key>')
71
79
  && infoPlist.includes('<key>CFBundleVersion</key>');
72
- const hasActionFallbacks = actionScript.includes('.nvm/versions/node/*/bin/node(Nn[-1])')
80
+ const hasActionFallbacks = actionScript.includes('command -v sks')
81
+ && actionScript.includes('npm root -g')
82
+ && actionScript.includes('.nvm/versions/node/*/lib/node_modules/sneakoscope/dist/bin/sks.js')
73
83
  && actionScript.includes('/bin/zsh -lc')
74
- && actionScript.includes('command -v sks');
75
- const hasEntryWarning = result.warnings.includes('sks_entry_project_local_ignored_global_package_used')
76
- || result.warnings.includes('sks_entry_resolved_under_project_root');
84
+ && actionScript.includes('exit 127')
85
+ && actionScript.includes('display notification');
86
+ const hasEntryWarning = result.warnings.includes('sks_entry_project_local');
77
87
  const hasBuildStamp = buildStampExists
78
88
  && result.build_stamp?.package_version === PACKAGE_VERSION
79
89
  && result.build_stamp?.codesign_identifier === 'com.sneakoscope.sks-menubar';
@@ -94,7 +104,8 @@ const expectedMenuItems = [
94
104
  'Set OpenRouter Key and GLM Profiles',
95
105
  'Fast Check',
96
106
  'SKS Version Check',
97
- 'Update SKS Now'
107
+ 'Update SKS Now',
108
+ 'View Last Log'
98
109
  ];
99
110
  const missingExpectedItems = expectedMenuItems.filter((item) => !result.menu_items.includes(item));
100
111
  const hasExpectedItems = missingExpectedItems.length === 0;
@@ -110,8 +121,9 @@ const launchSkippedForTempInstall = result.launch?.requested === false
110
121
  && envHomeResult.warnings.includes('launch_skipped_temp_install');
111
122
  const preferredPositionSkippedForTempInstall = !result.actions.includes('seeded SKS menu bar preferred position')
112
123
  && !envHomeResult.actions.includes('seeded SKS menu bar preferred position');
113
- const ok = process.platform === 'darwin'
114
- ? result.ok === true
124
+ const darwinOk = cltMissing
125
+ ? swiftParse.status === 'skipped' && swiftParse.reason === 'xcode_clt_missing'
126
+ : result.ok === true
115
127
  && result.status === 'installed_launch_skipped'
116
128
  && secondResult.ok === true
117
129
  && envHomeResult.ok === true
@@ -122,10 +134,10 @@ const ok = process.platform === 'darwin'
122
134
  && hasExpectedItems
123
135
  && hasVisibleStatusSource
124
136
  && hasBackgroundReadonlyActions
125
- && hasTerminalFailureAlert
126
- && hasTerminalExit
137
+ && hasNativeModalSource
138
+ && hasActionLogSource
127
139
  && hasAutosaveNameSource
128
- && hasExplicitVisibleSource
140
+ && hasCodexLifecycleSource
129
141
  && hasNoUnconditionalKeepAlive
130
142
  && hasNoLaunchAgentSecrets
131
143
  && hasInteractiveProcessType
@@ -133,6 +145,7 @@ const ok = process.platform === 'darwin'
133
145
  && hasActionFallbacks
134
146
  && hasEntryWarning
135
147
  && hasBuildStamp
148
+ && swiftParse.ok === true
136
149
  && isIdempotent
137
150
  && hasCommandRegistry
138
151
  && noLaunchctlSecretSetenv
@@ -140,7 +153,9 @@ const ok = process.platform === 'darwin'
140
153
  && launchSkippedForTempHome
141
154
  && launchSkippedForEnvHome
142
155
  && launchSkippedForTempInstall
143
- && preferredPositionSkippedForTempInstall
156
+ && preferredPositionSkippedForTempInstall;
157
+ const ok = process.platform === 'darwin'
158
+ ? darwinOk
144
159
  : result.ok === true && result.status === 'unsupported_platform';
145
160
  const report = {
146
161
  schema: 'sks.sks-menubar-install-check.v1',
@@ -157,10 +172,10 @@ const report = {
157
172
  generated_source_path: generatedSourcePath,
158
173
  has_visible_status_source: hasVisibleStatusSource,
159
174
  has_background_readonly_actions: hasBackgroundReadonlyActions,
160
- has_terminal_failure_alert: hasTerminalFailureAlert,
161
- has_terminal_exit: hasTerminalExit,
175
+ has_native_modal_source: hasNativeModalSource,
176
+ has_action_log_source: hasActionLogSource,
162
177
  has_autosave_name_source: hasAutosaveNameSource,
163
- has_explicit_visible_source: hasExplicitVisibleSource,
178
+ has_codex_lifecycle_source: hasCodexLifecycleSource,
164
179
  has_no_unconditional_keepalive: hasNoUnconditionalKeepAlive,
165
180
  has_no_launch_agent_secrets: hasNoLaunchAgentSecrets,
166
181
  has_interactive_process_type: hasInteractiveProcessType,
@@ -168,6 +183,7 @@ const report = {
168
183
  has_action_fallbacks: hasActionFallbacks,
169
184
  has_entry_warning: hasEntryWarning,
170
185
  has_build_stamp: hasBuildStamp,
186
+ swift_parse: swiftParse,
171
187
  is_idempotent: isIdempotent,
172
188
  has_command_registry: hasCommandRegistry,
173
189
  no_launchctl_secret_setenv: noLaunchctlSecretSetenv,
@@ -193,4 +209,25 @@ async function exists(file) {
193
209
  return false;
194
210
  }
195
211
  }
212
+ async function swiftParseSmoke(sourcePath) {
213
+ if (process.platform !== 'darwin')
214
+ return { ok: true, status: 'skipped', reason: 'not_macos' };
215
+ const xcodeSelect = await which('xcode-select').catch(() => null) || '/usr/bin/xcode-select';
216
+ const clt = await runProcess(xcodeSelect, ['-p'], { timeoutMs: 5_000, maxOutputBytes: 8 * 1024 })
217
+ .catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
218
+ if (clt.code !== 0)
219
+ return { ok: true, status: 'skipped', reason: 'xcode_clt_missing', code: clt.code, error: String(clt.stderr || clt.stdout || '').trim() };
220
+ if (!sourcePath)
221
+ return { ok: false, status: 'failed', reason: 'source_missing' };
222
+ const swiftc = await which('swiftc').catch(() => null) || '/usr/bin/swiftc';
223
+ const parsed = await runProcess(swiftc, ['-parse', sourcePath], { timeoutMs: 30_000, maxOutputBytes: 32 * 1024 })
224
+ .catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
225
+ return {
226
+ ok: parsed.code === 0,
227
+ status: parsed.code === 0 ? 'parsed' : 'failed',
228
+ reason: parsed.code === 0 ? null : 'swift_parse_failed',
229
+ code: parsed.code,
230
+ error: parsed.code === 0 ? null : String(parsed.stderr || parsed.stdout || '').trim()
231
+ };
232
+ }
196
233
  //# sourceMappingURL=sks-menubar-install-check.js.map
@@ -1,24 +1,29 @@
1
1
  #!/usr/bin/env node
2
2
  // @ts-nocheck
3
3
  import assert from 'node:assert/strict';
4
+ import fs from 'node:fs';
5
+ import os from 'node:os';
4
6
  import { spawnSync } from 'node:child_process';
5
7
  import path from 'node:path';
6
- const root = process.cwd();
7
- const result = spawnSync(process.execPath, [path.join(root, 'dist/bin/sks.js'), 'image-ux-review', 'fixture', '--mock', '--json'], {
8
+ const repoRoot = process.cwd();
9
+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'sks-ux-review-real-loop-fixture-'));
10
+ const result = spawnSync(process.execPath, [path.join(repoRoot, 'dist/bin/sks.js'), 'image-ux-review', 'fixture', '--mock', '--json'], {
8
11
  cwd: root,
9
12
  encoding: 'utf8',
10
- env: { ...process.env, SKS_SKIP_NPM_FRESHNESS_CHECK: '1', CI: 'true' },
13
+ env: { ...process.env, SKS_SKIP_NPM_FRESHNESS_CHECK: '1', SKS_UPDATE_MIGRATION_GATE_DISABLED: '1', CI: 'true' },
11
14
  timeout: Number(process.env.SKS_UX_REVIEW_REAL_LOOP_FIXTURE_TIMEOUT_MS || 180_000)
12
15
  });
13
- assert.equal(result.status, 0, JSON.stringify({
16
+ assert.ok([0, 1].includes(result.status), JSON.stringify({
14
17
  stderr: result.stderr,
15
18
  stdout: result.stdout,
16
19
  signal: result.signal,
17
20
  error: result.error?.message || null
18
21
  }, null, 2));
19
22
  const json = JSON.parse(result.stdout);
23
+ assert.equal(json.ok, false);
20
24
  assert.equal(json.artifacts.gate.mock_fixture_cannot_claim_real, true);
21
25
  assert.equal(json.artifacts.generated_review_ledger.real_generated_count, 0);
22
26
  assert.equal(json.artifacts.generated_review_ledger.generated_count, 1);
27
+ assert.equal(json.proof.status, 'mock_only');
23
28
  console.log(JSON.stringify({ schema: 'sks.ux-review-real-loop-fixture.v1', ok: true, mission_id: json.mission_id }, null, 2));
24
29
  //# sourceMappingURL=ux-review-real-loop-fixture-check.js.map
@@ -3,7 +3,11 @@
3
3
  import { emitGate, requireContains } from './sks-1-12-real-execution-check-lib.js';
4
4
  requireContains('ux-review:run-wires-imagegen', 'src/core/commands/image-ux-review-command.ts', [
5
5
  'const shouldGenerateCallouts = flag(args, \'--generate-callouts\') || flag(args, \'--fix\')',
6
+ 'requireCodexImagegen',
6
7
  'generateGptImage2CalloutReview',
8
+ 'evidence_class',
9
+ 'output_sha256',
10
+ 'imagegen_response_non_codex_api_fallback_not_full_evidence',
7
11
  'extractRealCallouts',
8
12
  'buildImageUxCalloutExtractionReport'
9
13
  ]);
@@ -19,5 +19,6 @@ for (const event of requiredEvents) {
19
19
  assertGate(swarm.includes('appendZellijSlotTelemetry'), 'session swarm must append Zellij slot telemetry');
20
20
  assertGate(worker.includes('appendZellijSlotTelemetry'), 'native worker must append Zellij slot telemetry');
21
21
  assertGate(worker.includes('startWorkerProgressTelemetry'), 'native worker must emit progress telemetry during backend runtime');
22
+ assertGate(!/progress:\s*\{\s*done:\s*tick,\s*total:\s*0/.test(worker), 'heartbeat ticks must not be reported as progress done/total counters');
22
23
  emitGate('zellij:slot-telemetry-runtime', { lifecycle_events: requiredEvents.length, progress_pump: true });
23
24
  //# sourceMappingURL=zellij-slot-telemetry-runtime-check.js.map
package/docs/demo.tape ADDED
@@ -0,0 +1,28 @@
1
+ Output docs/assets/sks-v5-demo.gif
2
+ Set Shell "zsh"
3
+ Set FontSize 16
4
+ Set Width 1280
5
+ Set Height 720
6
+ Set TypingSpeed 20ms
7
+
8
+ Type "npx sneakoscope install --yes"
9
+ Sleep 500ms
10
+ Enter
11
+ Sleep 1s
12
+ Ctrl+C
13
+
14
+ Type "sks plan \"ship a proof-first review flow\""
15
+ Enter
16
+ Sleep 1s
17
+
18
+ Type "sks review --staged"
19
+ Enter
20
+ Sleep 1s
21
+
22
+ Type "sks ui --once"
23
+ Enter
24
+ Sleep 1s
25
+
26
+ Type "sks naruto run \"demo no-op swarm\" --backend fake --clones 4 --work-items 4 --no-open-zellij --json"
27
+ Enter
28
+ Sleep 2s
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sneakoscope",
3
3
  "displayName": "ㅅㅋㅅ",
4
- "version": "4.8.7",
4
+ "version": "5.3.0",
5
5
  "description": "Sneakoscope Codex: fast proof-first Codex trust layer with image-based Voxel TriWiki.",
6
6
  "type": "module",
7
7
  "homepage": "https://github.com/mandarange/Sneakoscope-Codex#readme",
@@ -14,7 +14,8 @@
14
14
  },
15
15
  "bin": {
16
16
  "sks": "dist/bin/sks.js",
17
- "sneakoscope": "dist/bin/sks.js"
17
+ "sneakoscope": "dist/bin/sks.js",
18
+ "sneakoscope-install": "dist/bin/install.js"
18
19
  },
19
20
  "publishConfig": {
20
21
  "access": "public",
@@ -32,8 +33,17 @@
32
33
  "!dist/**/*.tsbuildinfo",
33
34
  "!dist/**/__tests__",
34
35
  "!dist/**/*.test.js",
36
+ "!dist/scripts/*blackbox*.js",
37
+ "dist/scripts/doctor-context7-mcp-repair-blackbox.js",
38
+ "dist/scripts/doctor-fix-production-blackbox.js",
39
+ "dist/scripts/doctor-startup-config-repair-blackbox.js",
40
+ "dist/scripts/doctor-supabase-mcp-repair-blackbox.js",
41
+ "dist/scripts/project-skill-dedupe-blackbox.js",
42
+ "dist/scripts/supabase-secret-preservation-blackbox.js",
43
+ "dist/scripts/update-preserves-supabase-keys-blackbox.js",
35
44
  "!dist/vendor/openai-codex/rust-v0.131.0",
36
45
  "config/codex-releases/rust-v0.142.0.json",
46
+ "config/bench-baseline.json",
37
47
  "schemas",
38
48
  "!schemas/codex/app-server-0.142/**",
39
49
  "schemas/codex/app-server-0.142/codex_app_server_protocol.v2.schemas.json",
@@ -41,6 +51,8 @@
41
51
  "crates/sks-core/Cargo.lock",
42
52
  "crates/sks-core/Cargo.toml",
43
53
  "crates/sks-core/src",
54
+ "docs/demo.tape",
55
+ "docs/assets/sneakoscope-architecture-pipeline.jpg",
44
56
  "README.md",
45
57
  "LICENSE"
46
58
  ],
@@ -60,17 +72,31 @@
60
72
  "runtime:dist-parity": "node ./dist/scripts/runtime-dist-parity-check.js",
61
73
  "release:check": "npm run release:check:affected --silent",
62
74
  "release:metadata": "node ./dist/scripts/release-metadata-check.js",
75
+ "release:gate-script-parity": "node ./dist/scripts/release-gate-script-parity-check.js",
63
76
  "release:check:parallel": "npm run build --silent && node ./dist/scripts/release-parallel-check.js && node ./dist/scripts/release-check-stamp.js write",
64
77
  "release:check:legacy": "npm run release:check:parallel --silent",
78
+ "release:dag-full-coverage": "node ./dist/scripts/release-dag-full-coverage-check.js",
65
79
  "core-skill:route-runtime-integration": "node ./dist/scripts/core-skill-route-runtime-integration-check.js",
80
+ "core-skill:no-drift": "node ./dist/scripts/core-skill-no-drift-check.js",
66
81
  "typecheck": "tsc -p tsconfig.json --noEmit",
67
82
  "schema:check": "node ./dist/scripts/check-runtime-schemas.js",
68
83
  "repo-audit": "node ./dist/scripts/repo-audit.js",
84
+ "native-capability:postcheck": "node ./dist/scripts/native-capability-postcheck-check.js",
85
+ "secret:preservation-guard": "node ./dist/scripts/secret-preservation-guard-check.js",
86
+ "secret:supabase-preservation-blackbox": "node ./dist/scripts/supabase-secret-preservation-blackbox.js",
87
+ "update:preserves-supabase-keys": "node ./dist/scripts/update-preserves-supabase-keys-blackbox.js",
88
+ "skill:dedupe-blackbox": "node ./dist/scripts/project-skill-dedupe-blackbox.js",
69
89
  "postinstall": "node ./dist/bin/sks.js postinstall",
70
90
  "selftest": "node ./dist/bin/sks.js selftest --mock",
71
91
  "doctor": "node ./dist/bin/sks.js doctor",
92
+ "doctor:fix-production-blackbox": "node ./dist/scripts/doctor-fix-production-blackbox.js",
93
+ "doctor:startup-config-repair-blackbox": "node ./dist/scripts/doctor-startup-config-repair-blackbox.js",
94
+ "doctor:context7-mcp-repair-blackbox": "node ./dist/scripts/doctor-context7-mcp-repair-blackbox.js",
95
+ "doctor:supabase-mcp-repair-blackbox": "node ./dist/scripts/doctor-supabase-mcp-repair-blackbox.js",
72
96
  "codex:config-load-probe": "node ./dist/scripts/codex-config-load-probe.js --json",
73
97
  "codex:actual-config-load-probe": "node ./dist/scripts/codex-config-load-probe.js --actual-codex --json",
98
+ "codex:0140-capability": "node ./dist/scripts/codex-0140-capability-check.js",
99
+ "codex:0140-feature-probes": "node ./dist/scripts/codex-0140-feature-probes-check.js",
74
100
  "runtime:ts-rust-boundary": "node ./dist/scripts/runtime-ts-rust-boundary-check.js",
75
101
  "release:check:dynamic": "node ./dist/scripts/release-check-dynamic.js",
76
102
  "release:check:dynamic:execute": "node ./dist/scripts/release-check-dynamic-execute.js",
@@ -96,34 +122,15 @@
96
122
  "feature:check": "node ./dist/bin/sks.js features check --json",
97
123
  "feature-quality:check": "node ./dist/scripts/check-feature-quality.js --release",
98
124
  "all-features:selftest": "node ./dist/bin/sks.js all-features selftest --mock --json",
99
- "trust:check": "node ./dist/bin/sks.js trust validate latest --json || node ./dist/scripts/trust-fixture-check.js",
100
- "wrongness:check": "node ./dist/bin/sks.js wrongness validate project --json && node ./dist/scripts/wrongness-fixture-check.js",
101
- "git-hygiene:check": "node ./dist/bin/sks.js git doctor --json",
102
- "shared-memory:check": "node ./dist/bin/sks.js wiki validate-shared --json || node ./dist/scripts/shared-memory-fixture-check.js",
103
- "evidence:check": "node ./dist/scripts/evidence-fixture-check.js",
104
- "codex-app:handoff": "node ./dist/scripts/codex-app-handoff-check.js",
105
- "qa-loop:app-handoff": "node ./dist/scripts/qa-loop-app-handoff-check.js",
106
- "qa-loop:app-handoff-capability": "node ./dist/scripts/qa-loop-app-handoff-capability-check.js",
107
- "qa-loop:app-handoff-cli": "node ./dist/scripts/qa-loop-app-handoff-cli-check.js",
108
- "qa-loop:image-path-exposure": "node ./dist/scripts/qa-loop-image-path-exposure-check.js",
109
- "qa-loop:effort-escalation": "node ./dist/scripts/qa-loop-effort-escalation-check.js",
110
- "qa-loop:budget-policy": "node ./dist/scripts/qa-loop-budget-policy-check.js",
111
125
  "naruto:real-active-pool-runtime": "node ./dist/scripts/naruto-real-active-pool-runtime-check.js",
126
+ "bench": "node ./dist/scripts/coding-bench-check.js",
127
+ "release:check:bench": "npm run build:incremental --silent && npm run bench --silent",
112
128
  "release:check:affected": "npm run build:incremental --silent && node ./dist/scripts/release-gate-dag-runner.js --preset affected --changed-since auto --sla 5m && node ./dist/scripts/release-check-stamp.js write",
113
129
  "release:check:fast": "npm run build:incremental --silent && node ./dist/scripts/release-gate-dag-runner.js --preset fast --changed-since auto --sla 5m && node ./dist/scripts/release-check-stamp.js write",
114
130
  "release:check:confidence": "npm run build:incremental --silent && node ./dist/scripts/release-gate-dag-runner.js --preset confidence --changed-since auto --sla 5m && node ./dist/scripts/release-check-stamp.js write",
115
- "release:check:full": "npm run build:clean --silent && node ./dist/scripts/release-gate-dag-runner.js --preset release --full && node ./dist/scripts/release-check-stamp.js write",
131
+ "release:check:full": "npm run build:clean --silent && node ./dist/scripts/release-gate-dag-runner.js --preset release --full && node ./dist/scripts/release-gate-dag-runner.js --preset bench --full && node ./dist/scripts/release-check-stamp.js write",
116
132
  "publish:prep-ignore-scripts": "npm run prepublishOnly",
117
133
  "publish:ignore-scripts": "npm run publish:prep-ignore-scripts && npm publish --ignore-scripts",
118
- "naruto:ssot-gate-aliases": "node ./dist/scripts/naruto-ssot-gate-aliases-check.js",
119
- "codex-app:handoff-launch": "node ./dist/scripts/codex-app-handoff-launch-check.js",
120
- "qa-loop:app-handoff-launch": "node ./dist/scripts/qa-loop-app-handoff-launch-check.js",
121
- "qa-loop:app-handoff-confirmation": "node ./dist/scripts/qa-loop-app-handoff-confirmation-check.js",
122
- "qa-loop:app-handoff-status-lifecycle": "node ./dist/scripts/qa-loop-app-handoff-status-lifecycle-check.js",
123
- "qa-loop:app-handoff-gate-lifecycle": "node ./dist/scripts/qa-loop-app-handoff-gate-lifecycle-check.js",
124
- "qa-loop:image-path-prompt-injection": "node ./dist/scripts/qa-loop-image-path-prompt-injection-check.js",
125
- "loop:integration-finalizer": "node ./dist/scripts/loop-integration-finalizer-check.js",
126
- "qa-loop:execution-profile-routing": "node ./dist/scripts/qa-loop-execution-profile-routing-check.js",
127
134
  "gates:run": "node ./dist/scripts/release-gate-dag-runner.js",
128
135
  "policy:gate-audit": "node ./dist/scripts/gate-policy-audit-check.js"
129
136
  },