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
@@ -1,174 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import os from 'node:os';
5
- import path from 'node:path';
6
- import { spawnSync } from 'node:child_process';
7
- import { fileURLToPath } from 'node:url';
8
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
9
- const json = process.argv.includes('--json');
10
- const dryRun = process.argv.includes('--dry-run');
11
- const keep = process.argv.includes('--keep');
12
- const npmBin = process.platform === 'win32' ? 'npm.cmd' : 'npm';
13
- const npxBin = process.platform === 'win32' ? 'npx.cmd' : 'npx';
14
- const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'sks-blackbox-pack-install-'));
15
- const cache = path.join(tmp, 'npm-cache');
16
- const prefix = path.join(tmp, 'prefix');
17
- const consumer = path.join(tmp, 'consumer');
18
- fs.mkdirSync(consumer, { recursive: true });
19
- fs.writeFileSync(path.join(consumer, 'package.json'), `${JSON.stringify({ name: 'sks-blackbox-consumer', private: true, version: '0.0.0' }, null, 2)}\n`);
20
- const steps = [];
21
- function spawnStep(label, cmd, args, options = {}) {
22
- const result = dryRun
23
- ? { status: 0, signal: null, stdout: '', stderr: '' }
24
- : spawnSync(cmd, args, {
25
- cwd: options.cwd || root,
26
- encoding: 'utf8',
27
- timeout: options.timeout || 120_000,
28
- env: childNpmEnv(options.env)
29
- });
30
- return {
31
- label,
32
- command: [cmd, ...args].join(' '),
33
- cwd: options.cwd || root,
34
- status: result.status,
35
- ok: result.status === 0,
36
- stdout_bytes: Buffer.byteLength(result.stdout || ''),
37
- stderr_bytes: Buffer.byteLength(result.stderr || ''),
38
- stdout_tail: String(result.stdout || '').slice(-800),
39
- stderr_tail: String(result.stderr || '').slice(-800),
40
- stdout: result.stdout || '',
41
- stderr: result.stderr || ''
42
- };
43
- }
44
- function childNpmEnv(extra = {}) {
45
- const env = { ...process.env, npm_config_cache: cache, npm_config_prefix: prefix, SKS_SKIP_NPM_FRESHNESS_CHECK: '1', CI: 'true', ...extra };
46
- delete env.npm_config_dry_run;
47
- delete env.NPM_CONFIG_DRY_RUN;
48
- return env;
49
- }
50
- function run(label, cmd, args, options = {}) {
51
- const row = spawnStep(label, cmd, args, options);
52
- steps.push(recordStep(row));
53
- return row;
54
- }
55
- function runWithRetry(label, cmd, args, options = {}) {
56
- const attempts = Math.max(1, Number(options.attempts || 2));
57
- const attemptRows = [];
58
- for (let index = 0; index < attempts; index += 1) {
59
- if (index > 0)
60
- cleanupInstallAttempt(options.cwd || root);
61
- const row = spawnStep(label, cmd, args, options);
62
- attemptRows.push(row);
63
- if (row.ok || dryRun) {
64
- const final = { ...row, label, attempts: index + 1, retry_count: index, attempts_log: attemptRows.map(compactAttempt) };
65
- steps.push(recordStep(final));
66
- return final;
67
- }
68
- }
69
- const last = attemptRows.at(-1);
70
- const final = { ...last, label, attempts, retry_count: attempts - 1, attempts_log: attemptRows.map(compactAttempt) };
71
- steps.push(recordStep(final));
72
- return final;
73
- }
74
- function recordStep(row) {
75
- const { stdout, stderr, ...recorded } = row;
76
- return recorded;
77
- }
78
- function compactAttempt(row) {
79
- return {
80
- status: row.status,
81
- ok: row.ok,
82
- stdout_bytes: row.stdout_bytes,
83
- stderr_bytes: row.stderr_bytes,
84
- stdout_tail: row.stdout_tail,
85
- stderr_tail: row.stderr_tail
86
- };
87
- }
88
- function cleanupInstallAttempt(cwd) {
89
- if (dryRun)
90
- return;
91
- for (const rel of ['node_modules', 'package-lock.json']) {
92
- fs.rmSync(path.join(cwd, rel), { recursive: true, force: true });
93
- }
94
- }
95
- let tarball = dryRun ? path.join(tmp, 'sneakoscope-0.0.0.tgz') : null;
96
- const pack = run('npm_pack', npmBin, ['pack', '--json', '--ignore-scripts', '--pack-destination', tmp, '--registry', 'https://registry.npmjs.org/']);
97
- if (pack.ok && !dryRun) {
98
- const info = JSON.parse(pack.stdout || '[]')[0];
99
- tarball = path.join(tmp, info.filename);
100
- }
101
- if (pack.ok)
102
- runWithRetry('npm_install_tarball', npmBin, ['install', '--no-audit', '--no-fund', tarball], { cwd: consumer, attempts: 2 });
103
- if (steps.at(-1)?.ok)
104
- run('npx_sks_version', npxBin, ['sks', '--version'], { cwd: consumer });
105
- if (steps.at(-1)?.ok)
106
- run('npx_sks_root_json', npxBin, ['sks', 'root', '--json'], { cwd: consumer });
107
- if (steps.at(-1)?.ok)
108
- run('npx_sks_setup_local_only', npxBin, ['sks', 'setup', '--local-only', '--json'], { cwd: consumer });
109
- if (steps.at(-1)?.ok)
110
- run('npx_sks_selftest_mock', npxBin, ['sks', 'selftest', '--mock'], { cwd: consumer, timeout: 180_000 });
111
- if (steps.at(-1)?.ok)
112
- run('npx_sks_run_execute_mock', npxBin, ['sks', 'run', 'blackbox execute fixture', '--execute', '--mock', '--json'], { cwd: consumer, timeout: 180_000 });
113
- if (steps.at(-1)?.ok)
114
- run('npx_sks_agent_mock', npxBin, ['sks', 'agent', 'run', 'blackbox native agent fixture', '--mock', '--json'], { cwd: consumer, timeout: 180_000 });
115
- let qaMissionId = null;
116
- if (steps.at(-1)?.ok) {
117
- const qaPrepare = run('npx_sks_qa_loop_prepare', npxBin, ['sks', 'qa-loop', 'prepare', 'blackbox API QA', '--json'], { cwd: consumer, timeout: 180_000 });
118
- try {
119
- qaMissionId = JSON.parse(qaPrepare.stdout).mission_id || null;
120
- }
121
- catch { }
122
- }
123
- if (steps.at(-1)?.ok)
124
- run('npx_sks_qa_loop_run_mock', npxBin, ['sks', 'qa-loop', 'run', qaMissionId || 'latest', '--mock', '--json'], { cwd: consumer, timeout: 180_000 });
125
- if (steps.at(-1)?.ok) {
126
- const proofFile = dryRun ? '<dry-run>' : latestCompletionProof(consumer);
127
- steps.push({
128
- label: 'verify_completion_proof_exists',
129
- command: 'fs.existsSync(.sneakoscope/missions/<latest>/completion-proof.json)',
130
- cwd: consumer,
131
- status: proofFile ? 0 : 1,
132
- ok: Boolean(proofFile),
133
- stdout_bytes: 0,
134
- stderr_bytes: 0,
135
- stderr_tail: proofFile || 'completion-proof.json missing'
136
- });
137
- }
138
- const result = { schema: 'sks.blackbox-pack-install.v1', ok: steps.every((step) => step.ok), dry_run: dryRun, temp_root: keep ? tmp : null, steps };
139
- if (!result.ok)
140
- result.temp_root = tmp;
141
- if (!keep && result.ok)
142
- fs.rmSync(tmp, { recursive: true, force: true });
143
- if (json)
144
- console.log(JSON.stringify(result, null, 2));
145
- else {
146
- console.log(`Blackbox pack install: ${result.ok ? 'ok' : 'blocked'}${dryRun ? ' (dry-run)' : ''}`);
147
- for (const step of steps) {
148
- console.log(`- ${step.ok ? 'ok' : 'blocked'} ${step.label}${step.attempts ? ` attempts=${step.attempts}` : ''}`);
149
- if (!step.ok && step.stderr_tail)
150
- console.log(` stderr_tail: ${step.stderr_tail.replace(/\n/g, '\\n')}`);
151
- if (!step.ok && step.stdout_tail)
152
- console.log(` stdout_tail: ${step.stdout_tail.replace(/\n/g, '\\n')}`);
153
- }
154
- if (!result.ok)
155
- console.log(`temp_root: ${tmp}`);
156
- }
157
- if (!result.ok)
158
- process.exitCode = 1;
159
- function latestCompletionProof(rootDir) {
160
- const missions = path.join(rootDir, '.sneakoscope', 'missions');
161
- if (!fs.existsSync(missions))
162
- return null;
163
- const ids = fs.readdirSync(missions, { withFileTypes: true })
164
- .filter((entry) => entry.isDirectory() && entry.name.startsWith('M-'))
165
- .map((entry) => entry.name)
166
- .sort();
167
- for (const id of ids.reverse()) {
168
- const proof = path.join(missions, id, 'completion-proof.json');
169
- if (fs.existsSync(proof))
170
- return proof;
171
- }
172
- return null;
173
- }
174
- //# sourceMappingURL=blackbox-pack-install.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective316Gate } from './sks-3-1-6-directive-check-lib.js';
3
- await runDirective316Gate('brand-neutrality:zero-leakage-blackbox');
4
- //# sourceMappingURL=brand-neutrality-zero-leakage-blackbox.js.map
@@ -1,34 +0,0 @@
1
- import fs from 'node:fs/promises';
2
- import path from 'node:path';
3
- import { assertGate, emitGate, makeTempRoot, writeText } from './sks-3-1-8-check-lib.js';
4
- import { importDist } from './sks-1-18-gate-lib.js';
5
- const tmp = await makeTempRoot('sks-build-once-');
6
- await writeText(path.join(tmp, 'package.json'), JSON.stringify({
7
- version: '4.0.2',
8
- scripts: {
9
- 'build:clean': 'node build.mjs',
10
- 'build:incremental': 'node build.mjs'
11
- }
12
- }, null, 2));
13
- await writeText(path.join(tmp, 'package-lock.json'), JSON.stringify({ name: 'fixture', version: '4.0.2', lockfileVersion: 3, packages: { '': { version: '4.0.2' } } }, null, 2));
14
- await writeText(path.join(tmp, 'tsconfig.json'), JSON.stringify({ compilerOptions: { outDir: 'dist' } }, null, 2));
15
- await writeText(path.join(tmp, 'src/index.ts'), 'export const value = 1;\n');
16
- await writeText(path.join(tmp, 'build.mjs'), "import fs from 'node:fs'; fs.mkdirSync('dist/bin',{recursive:true}); fs.writeFileSync('dist/bin/sks.js','#!/usr/bin/env node\\n');\n");
17
- const mod = await importDist('core/build/build-once-runner.js');
18
- const first = mod.runBuildOnce({ root: tmp, mode: 'clean', force: true });
19
- const second = mod.runBuildOnce({ root: tmp, mode: 'incremental' });
20
- await writeText(path.join(tmp, 'src/index.ts'), 'export const value = 2;\n');
21
- const third = mod.runBuildOnce({ root: tmp, mode: 'incremental' });
22
- await writeText(path.join(tmp, 'build.mjs'), "import fs from 'node:fs'; fs.mkdirSync('dist/bin',{recursive:true});\n");
23
- await fs.rm(path.join(tmp, 'dist', 'bin', 'sks.js'), { force: true });
24
- const broken = mod.runBuildOnce({ root: tmp, mode: 'incremental', force: true });
25
- await writeText(path.join(tmp, 'build.mjs'), "import fs from 'node:fs'; fs.mkdirSync('dist/bin',{recursive:true}); fs.writeFileSync('dist/bin/sks.js','#!/usr/bin/env node\\n');\n");
26
- await writeText(path.join(tmp, 'package-lock.json'), JSON.stringify({ name: 'fixture', version: '4.0.2', lockfileVersion: 3, packages: { '': { version: '4.0.2' } }, changed: true }, null, 2));
27
- const lockChanged = mod.runBuildOnce({ root: tmp, mode: 'incremental' });
28
- assertGate(first.ok === true && first.reused === false, 'clean build must write an initial proof', first);
29
- assertGate(second.ok === true && second.reused === true, 'second unchanged incremental run must reuse proof', second);
30
- assertGate(third.ok === true && third.reused === false && third.source_hash !== first.source_hash, 'source edit must invalidate proof', { first, third });
31
- assertGate(broken.ok === false && broken.blockers.some((item) => item.includes('dist_target_missing:dist/bin/sks.js')), 'missing dist/bin/sks.js must fail proof', broken);
32
- assertGate(lockChanged.ok === true && lockChanged.package_lock_hash !== third.package_lock_hash, 'package-lock change must invalidate proof', { third, lockChanged });
33
- emitGate('build-once:runner-blackbox', { first: first.ok, reused: second.reused, broken: broken.ok });
34
- //# sourceMappingURL=build-once-runner-blackbox.js.map
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
- import { assertGate, emitGate } from './sks-1-18-gate-lib.js';
3
- import { detectCodex0140Capability } from '../core/codex-control/codex-0140-capability.js';
4
- process.env.SKS_CODEX_0140_FAKE = '1';
5
- process.env.SKS_CODEX_VERSION_FAKE = 'codex-cli 0.140.0';
6
- process.env.SKS_CODEX_0140_PROBE = '1';
7
- const report = await detectCodex0140Capability({ codexBin: 'codex' });
8
- assertGate(report.ok === true && Object.values(report.features).every(Boolean), 'Codex 0.140 integration blackbox requires every fixture feature', report);
9
- assertGate(Object.values(report.feature_states).every((state) => state.supported === true && state.certainty === 'fixture'), 'Codex 0.140 integration blackbox requires explicit fixture feature states', report);
10
- assertGate(Object.keys(report.feature_certainty).length === Object.keys(report.features).length, 'Codex 0.140 integration blackbox requires per-feature certainty coverage', report);
11
- assertGate(JSON.stringify(report).includes('SUPABASE_ACCESS_TOKEN') === false, 'Codex 0.140 blackbox must not serialize secret env values', report);
12
- emitGate('codex:0140-integration-blackbox', { feature_count: Object.keys(report.features).length });
13
- //# sourceMappingURL=codex-0140-integration-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective315Gate } from './sks-3-1-5-directive-check-lib.js';
3
- await runDirective315Gate('codex-app:agent-type-blackbox');
4
- //# sourceMappingURL=codex-agent-type-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective314Gate } from './sks-3-1-4-directive-check-lib.js';
3
- await runDirective314Gate('codex-app:harness-blackbox');
4
- //# sourceMappingURL=codex-app-harness-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective314Gate } from './sks-3-1-4-directive-check-lib.js';
3
- await runDirective314Gate('codex-app:skill-agent-blackbox');
4
- //# sourceMappingURL=codex-app-skill-agent-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective315Gate } from './sks-3-1-5-directive-check-lib.js';
3
- await runDirective315Gate('codex-app:hook-approval-blackbox');
4
- //# sourceMappingURL=codex-hook-approval-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective315Gate } from './sks-3-1-5-directive-check-lib.js';
3
- await runDirective315Gate('codex-app:init-deep-directory-local-blackbox');
4
- //# sourceMappingURL=codex-init-deep-directory-local-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective316Gate } from './sks-3-1-6-directive-check-lib.js';
3
- await runDirective316Gate('codex-native:feature-broker-blackbox');
4
- //# sourceMappingURL=codex-native-feature-broker-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective316Gate } from './sks-3-1-6-directive-check-lib.js';
3
- await runDirective316Gate('codex-native:pattern-analysis-blackbox');
4
- //# sourceMappingURL=codex-native-pattern-analysis-blackbox.js.map
@@ -1,55 +0,0 @@
1
- #!/usr/bin/env node
2
- import fs from 'node:fs/promises';
3
- import path from 'node:path';
4
- import { buildCodexNativeFeatureMatrix } from '../core/codex-native/codex-native-feature-broker.js';
5
- import { repairCodexNativeManagedAssets } from '../core/codex-native/codex-native-repair-transaction.js';
6
- import { createCodexNativeRuntimeFixture, withFixtureEnv } from './codex-native-runtime-e2e-fixture.js';
7
- const fixture = await createCodexNativeRuntimeFixture({
8
- hook: 'approved',
9
- agentType: 'supported',
10
- appHandoff: true,
11
- imagePathExposure: true,
12
- mcpCandidates: true,
13
- codeModeWebSearch: true
14
- });
15
- const previous = process.env.CODEX_HOME;
16
- process.env.CODEX_HOME = path.join(fixture.root, 'codex-home');
17
- try {
18
- await withFixtureEnv(fixture, async () => {
19
- await buildCodexNativeFeatureMatrix({ root: fixture.root, mode: 'read-only' });
20
- assertGate(!(await exists(path.join(fixture.root, 'codex-home', 'skills'))), 'read-only matrix created skills');
21
- assertGate(!(await exists(path.join(fixture.root, 'codex-home', 'agents'))), 'read-only matrix created agent roles');
22
- const repair = await repairCodexNativeManagedAssets({ root: fixture.root, requestedBy: 'manual', yes: true });
23
- assertGate(repair.repaired.some((row) => row.asset === 'skills'), 'repair transaction did not include skills', repair);
24
- assertGate(await exists(path.join(fixture.root, 'codex-home', 'skills')), 'repair transaction did not create managed skills');
25
- assertGate(await exists(path.join(fixture.root, 'codex-home', 'agents')), 'repair transaction did not create managed agent roles');
26
- const matrixAfter = await buildCodexNativeFeatureMatrix({ root: fixture.root, mode: 'read-only' });
27
- assertGate(matrixAfter.features.skill_sync.ok === true || matrixAfter.features.agent_roles.ok === true, 'post-repair read-only matrix did not reflect managed assets', matrixAfter);
28
- });
29
- }
30
- finally {
31
- if (previous === undefined)
32
- delete process.env.CODEX_HOME;
33
- else
34
- process.env.CODEX_HOME = previous;
35
- }
36
- emitGate('codex-native:read-repair-split-blackbox');
37
- async function exists(file) {
38
- try {
39
- await fs.stat(file);
40
- return true;
41
- }
42
- catch {
43
- return false;
44
- }
45
- }
46
- function assertGate(condition, message, detail = {}) {
47
- if (condition)
48
- return;
49
- console.error(JSON.stringify({ ok: false, message, detail }, null, 2));
50
- process.exit(1);
51
- }
52
- function emitGate(gate) {
53
- console.log(JSON.stringify({ schema: 'sks.release-gate.v1', ok: true, gate }, null, 2));
54
- }
55
- //# sourceMappingURL=codex-native-read-repair-split-blackbox.js.map
@@ -1,41 +0,0 @@
1
- #!/usr/bin/env node
2
- import fs from 'node:fs/promises';
3
- import os from 'node:os';
4
- import path from 'node:path';
5
- import { runProcess } from '../core/fsx.js';
6
- import { ensureCodexNativeReferenceSnapshot } from '../core/codex-native/codex-native-reference-cache.js';
7
- import { analyzeCodexNativeReferenceSource } from '../core/codex-native/codex-native-reference-source.js';
8
- const missing = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-reference-cache-missing-'));
9
- const missingReport = await ensureCodexNativeReferenceSnapshot({ root: missing, offline: true });
10
- assertGate(missingReport.ok === false && missingReport.blockers.includes('source_snapshot_missing'), 'offline no-cache scenario must report source_snapshot_missing', missingReport);
11
- const missingEvidence = await analyzeCodexNativeReferenceSource({ root: missing, writeReport: false });
12
- assertGate(missingEvidence.blockers.includes('source_snapshot_missing') && missingEvidence.evidence.length === 0, 'missing cache must not hallucinate evidence', missingEvidence);
13
- const reused = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-reference-cache-reused-'));
14
- await fs.mkdir(path.join(reused, '.sneakoscope', 'cache', 'codex-native-reference'), { recursive: true });
15
- await fs.writeFile(path.join(reused, '.sneakoscope', 'cache', 'codex-native-reference', 'README.md'), 'npx plugin hook agent_type fallback AGENTS.md doctor MCP managed proof\n', 'utf8');
16
- const reusedReport = await ensureCodexNativeReferenceSnapshot({ root: reused, offline: true });
17
- assertGate(reusedReport.ok === true && reusedReport.refreshed === false, 'offline existing cache should be reused', reusedReport);
18
- const source = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-reference-source-'));
19
- await fs.writeFile(path.join(source, 'README.md'), 'npx plugin hook agent_type fallback AGENTS.md doctor MCP managed proof\n', 'utf8');
20
- await runProcess('git', ['init'], { cwd: source, timeoutMs: 10_000, maxOutputBytes: 64 * 1024 });
21
- await runProcess('git', ['add', 'README.md'], { cwd: source, timeoutMs: 10_000, maxOutputBytes: 64 * 1024 });
22
- await runProcess('git', ['-c', 'user.email=sks@example.invalid', '-c', 'user.name=SKS', 'commit', '-m', 'fixture'], { cwd: source, timeoutMs: 10_000, maxOutputBytes: 64 * 1024 });
23
- const refreshedRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-reference-cache-refresh-'));
24
- const refreshed = await ensureCodexNativeReferenceSnapshot({ root: refreshedRoot, sourceUrl: source, refresh: true });
25
- const serialized = JSON.stringify(refreshed);
26
- assertGate(refreshed.ok === true && refreshed.refreshed === true && typeof refreshed.source_sha === 'string', 'refresh from local git source should record source sha', refreshed);
27
- assertGate(!serialized.includes(source), 'cache report leaked raw source URL/path', refreshed);
28
- const evidence = await analyzeCodexNativeReferenceSource({ root: refreshedRoot, writeReport: true });
29
- const docs = await fs.readFile(path.join(refreshedRoot, 'docs', 'codex-native-patterns.md'), 'utf8');
30
- assertGate(!JSON.stringify(evidence).includes(source) && !docs.includes(source), 'reference evidence/docs leaked raw source URL/path', { evidence, docs });
31
- emitGate('codex-native:reference-cache-blackbox');
32
- function assertGate(condition, message, detail = {}) {
33
- if (condition)
34
- return;
35
- console.error(JSON.stringify({ ok: false, message, detail }, null, 2));
36
- process.exit(1);
37
- }
38
- function emitGate(gate) {
39
- console.log(JSON.stringify({ schema: 'sks.release-gate.v1', ok: true, gate }, null, 2));
40
- }
41
- //# sourceMappingURL=codex-native-reference-cache-blackbox.js.map
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env node
2
- import fs from 'node:fs/promises';
3
- import path from 'node:path';
4
- import { assertGate, emitGate, makeTempRoot, writeText, writeUserSkill } from './sks-3-1-8-check-lib.js';
5
- import { syncCoreSkillsIntegrity } from '../core/codex-native/core-skill-integrity.js';
6
- import { buildSksCoreSkillManifest, renderCoreSkillTemplate } from '../core/codex-native/core-skill-manifest.js';
7
- import { initProject } from '../core/init.js';
8
- const root = await makeTempRoot('sks-core-blackbox-');
9
- const skillsRoot = path.join(root, '.agents', 'skills');
10
- const expectedSkillCount = buildSksCoreSkillManifest('1970-01-01T00:00:00.000Z').skills.length;
11
- const first = await syncCoreSkillsIntegrity({ root, apply: true, skillsRoot });
12
- const second = await syncCoreSkillsIntegrity({ root, apply: true, skillsRoot });
13
- await writeText(path.join(skillsRoot, 'research', 'SKILL.md'), `${renderCoreSkillTemplate('research')}\nmutated\n`);
14
- const third = await syncCoreSkillsIntegrity({ root, apply: true, skillsRoot });
15
- const restoredText = await fs.readFile(path.join(skillsRoot, 'research', 'SKILL.md'), 'utf8');
16
- const userRoot = path.join(root, 'user-skills');
17
- await writeUserSkill(root, 'user-skills', 'research', 'research');
18
- const user = await syncCoreSkillsIntegrity({ root, apply: true, skillsRoot: userRoot });
19
- const setupRoot = await makeTempRoot('sks-core-setup-blackbox-');
20
- const setup = await initProject(setupRoot, { force: true, installScope: 'project', localOnly: true, globalCommand: 'sks' });
21
- const setupIntegrity = await syncCoreSkillsIntegrity({ root: setupRoot, apply: false, skillsRoot: path.join(setupRoot, '.agents', 'skills') });
22
- const setupRestore = await initProject(setupRoot, { force: true, installScope: 'project', localOnly: true, globalCommand: 'sks' });
23
- const setupLoopExists = await fs.stat(path.join(setupRoot, '.agents', 'skills', 'loop', 'SKILL.md')).then(() => true, () => false);
24
- assertGate(first.installed.length === expectedSkillCount, 'blackbox A: first sync installs missing core skills', first);
25
- assertGate(second.installed.length === 0 && second.restored.length === 0, 'blackbox B: second sync changes nothing', second);
26
- assertGate(third.restored.length === 1 && restoredText === renderCoreSkillTemplate('research'), 'blackbox C: managed drift restored exactly', third);
27
- assertGate(user.skipped_user_authored.length === 1, 'blackbox D: user skill is not overwritten', user);
28
- assertGate((setup.skill_install?.installed_skills || []).length === 0, 'blackbox E: project setup must not install official/core skills locally', setup.skill_install);
29
- assertGate(setupIntegrity.restored.length === 0 && setupIntegrity.skipped_user_authored.length === 0, 'blackbox F: setup-produced core skills are current', setupIntegrity);
30
- assertGate((setupRestore.skill_install?.installed_skills || []).length === 0 && !setupLoopExists, 'blackbox G: project setup remains official-skill-free on repeat init', setupRestore.skill_install);
31
- emitGate('core-skill:integrity-blackbox');
32
- //# sourceMappingURL=core-skill-integrity-blackbox.js.map
@@ -1,37 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import os from 'node:os';
5
- import path from 'node:path';
6
- import { spawnSync } from 'node:child_process';
7
- import { emitGate } from './sks-1-12-real-execution-check-lib.js';
8
- const root = fs.mkdtempSync(path.join(os.tmpdir(), 'sks-dfix-fast-blackbox-'));
9
- fs.mkdirSync(path.join(root, '.sneakoscope'), { recursive: true });
10
- fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify({
11
- private: true,
12
- type: 'module',
13
- scripts: {
14
- test: 'node test.mjs',
15
- 'test:unit': 'node test.mjs',
16
- 'dfix:fixture': 'node test.mjs',
17
- 'dfix:verification': 'node test.mjs'
18
- }
19
- }, null, 2));
20
- fs.writeFileSync(path.join(root, 'value.js'), 'export const value = "bad";\n');
21
- fs.writeFileSync(path.join(root, 'test.mjs'), 'import { value } from "./value.js"; if (value !== "good") throw new Error("expected good");\n');
22
- const sks = path.join(process.cwd(), 'dist', 'bin', 'sks.js');
23
- const env = { ...process.env, SKS_DISABLE_UPDATE_CHECK: '1' };
24
- const diagnose = run(root, sks, ['dfix', 'diagnose', 'fix value', '--file', 'value.js', '--error', 'AssertionError: expected good at value.js:1', '--json'], env);
25
- const mission = JSON.parse(diagnose.stdout).mission_id;
26
- const patch = run(root, sks, ['dfix', 'patch', mission, '--file', 'value.js', '--find', 'bad', '--replace', 'good', '--apply', '--json'], env);
27
- const verify = run(root, sks, ['dfix', 'verify', mission, '--command', 'node test.mjs', '--verify-auto', '--json'], env);
28
- const ok = diagnose.status === 0 && patch.status === 0 && verify.status === 0 && fs.readFileSync(path.join(root, 'value.js'), 'utf8').includes('"good"');
29
- console.log(JSON.stringify({ schema: 'sks.dfix-fast-blackbox-check.v1', ok, mission_id: mission, root }, null, 2));
30
- if (!ok)
31
- process.exitCode = 1;
32
- else
33
- emitGate('dfix:blackbox-fast', { mission_id: mission });
34
- function run(cwd, bin, args, env) {
35
- return spawnSync(process.execPath, [bin, ...args], { cwd, env, encoding: 'utf8', timeout: 30_000 });
36
- }
37
- //# sourceMappingURL=dfix-fast-blackbox-check.js.map
@@ -1,48 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import os from 'node:os';
5
- import path from 'node:path';
6
- import { spawnSync } from 'node:child_process';
7
- import { assertGate, emitGate, importDist, root } from './sks-1-18-gate-lib.js';
8
- const applyMod = await importDist('core/agents/agent-patch-apply-worker.js');
9
- const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'sks-dfix-patch-'));
10
- fs.writeFileSync(path.join(tmp, 'copy.txt'), 'old label\n');
11
- const envelope = {
12
- schema: 'sks.agent-patch-envelope.v1',
13
- agent_id: 'dfix-fast-lane',
14
- session_id: 'dfix-session',
15
- slot_id: 'dfix-slot',
16
- generation_index: 1,
17
- lease_id: 'lease:dfix-fast-lane:copy.txt',
18
- operations: [{ op: 'replace', path: 'copy.txt', search: 'old label', replace: 'new label' }]
19
- };
20
- const applied = await applyMod.applyAgentPatchEnvelope(tmp, envelope);
21
- const dfixFile = path.join(tmp, 'dfix-route.txt');
22
- fs.writeFileSync(dfixFile, 'old label\n');
23
- const diagnose = spawnSync(process.execPath, ['dist/bin/sks.js', 'dfix', 'diagnose', 'dfix parallel write route fixture', '--file', dfixFile, '--json'], { cwd: root, encoding: 'utf8', maxBuffer: 1024 * 1024 });
24
- const diagnoseJson = parseJson(diagnose.stdout);
25
- const plan = diagnoseJson?.mission_id
26
- ? spawnSync(process.execPath, ['dist/bin/sks.js', 'dfix', 'plan', diagnoseJson.mission_id, '--file', dfixFile, '--write-mode', 'parallel', '--apply-patches', '--dry-run-patches', '--max-write-agents', '1', '--json'], { cwd: root, encoding: 'utf8', maxBuffer: 1024 * 1024 })
27
- : { status: 1, stdout: '', stderr: 'diagnose mission missing' };
28
- const planJson = parseJson(plan.stdout);
29
- const routePolicy = planJson?.patch_plan?.route_parallel_write || null;
30
- const report = { schema: 'sks.dfix-parallel-write-blackbox.v1', ok: applied.ok && diagnose.status === 0 && plan.status === 0 && routePolicy?.route_level_flags_wired === true, applied, route_command: { diagnose_status: diagnose.status, plan_status: plan.status, mission_id: diagnoseJson?.mission_id || null, route_policy: routePolicy, stderr_tail: `${diagnose.stderr || ''}${plan.stderr || ''}`.slice(-2000) } };
31
- const out = path.join(root, '.sneakoscope', 'reports', 'dfix-parallel-write-blackbox.json');
32
- fs.mkdirSync(path.dirname(out), { recursive: true });
33
- fs.writeFileSync(out, `${JSON.stringify(report, null, 2)}\n`);
34
- assertGate(applied.ok === true, 'DFix parallel write blackbox patch failed', report);
35
- assertGate(fs.readFileSync(path.join(tmp, 'copy.txt'), 'utf8') === 'new label\n', 'DFix parallel write blackbox content mismatch', report);
36
- assertGate(routePolicy?.write_mode === 'parallel', 'DFix route must record --write-mode parallel', report);
37
- assertGate(routePolicy?.apply_patches === true, 'DFix route must record --apply-patches', report);
38
- assertGate(routePolicy?.dry_run_patches === true, 'DFix route must record --dry-run-patches', report);
39
- emitGate('dfix:parallel-write-blackbox', { changed_files: applied.changed_files.length });
40
- function parseJson(text) {
41
- try {
42
- return JSON.parse(text);
43
- }
44
- catch {
45
- return null;
46
- }
47
- }
48
- //# sourceMappingURL=dfix-parallel-write-blackbox.js.map
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import { runPatchSwarmRouteBlackbox } from './agent-patch-swarm-gate-lib.js';
4
- await runPatchSwarmRouteBlackbox({
5
- gate: 'dfix:patch-swarm-route-blackbox',
6
- route: '$DFix',
7
- routeCommand: 'sks dfix',
8
- reportName: 'dfix-patch-swarm-route-blackbox'
9
- });
10
- //# sourceMappingURL=dfix-patch-swarm-route-blackbox.js.map
@@ -1,22 +0,0 @@
1
- // @ts-nocheck
2
- import { assertGate, emitGate, makeTempRoot } from './sks-3-1-8-check-lib.js';
3
- import { importDist } from './sks-1-18-gate-lib.js';
4
- const tmp = await makeTempRoot('doctor-dirty-repair-');
5
- const planner = await importDist('core/doctor/doctor-dirty-planner.js');
6
- const tx = await importDist('core/doctor/doctor-transaction.js');
7
- const proofId = planner.markDoctorPhaseClean(tmp, 'setup');
8
- await tx.writeDoctorFixTransaction({
9
- root: tmp,
10
- phases: [],
11
- proofIdsUsed: [proofId]
12
- });
13
- let ran = false;
14
- const report = await tx.runDoctorFixTransaction({
15
- root: tmp,
16
- reportPath: null,
17
- dirtyPlan: planner.planDoctorDirtyRepair(tmp, ['setup']),
18
- phases: [{ id: 'setup', run: async () => { ran = true; return { id: 'setup', ok: true }; } }]
19
- });
20
- assertGate(ran === false && report.ok === true && report.phases[0].warnings.some((warning) => warning.startsWith('dirty_plan_skipped_clean_phase')), 'dirty repair must skip clean phase', { ran, report });
21
- emitGate('doctor:dirty-repair-blackbox', { skipped: true });
22
- //# sourceMappingURL=doctor-dirty-repair-blackbox.js.map
@@ -1,8 +0,0 @@
1
- import { assertGate, emitGate, readText } from './sks-1-18-gate-lib.js';
2
- const source = readText('src/core/doctor/doctor-dirty-planner.ts');
3
- assertGate(!source.includes('stat.isDirectory() ? `dir:${stat.mtimeMs}`'), 'doctor dirty planner must not hash directory mtimes');
4
- assertGate(!source.includes('mtimeMs, text'), 'doctor dirty planner must not mix file mtime into semantic hashes');
5
- assertGate(source.includes('phaseSemanticState'), 'doctor dirty planner must include phase-specific semantic state');
6
- assertGate(source.includes('clean_proof_missing'), 'doctor dirty planner must reject markers with missing proof evidence');
7
- emitGate('doctor:dirty-semantic-blackbox');
8
- //# sourceMappingURL=doctor-dirty-semantic-blackbox.js.map
@@ -1,39 +0,0 @@
1
- #!/usr/bin/env node
2
- import { assertGate, emitGate, makeTempRoot, writeText } from './sks-3-1-8-check-lib.js';
3
- import { repairNativeCapabilities } from '../core/codex-native/native-capability-repair.js';
4
- import path from 'node:path';
5
- const repairableRoot = await makeTempRoot('sks-doctor-native-repairable-');
6
- process.env.SKS_CHROME_EXTENSION_READY = '1';
7
- process.env.SKS_COMPUTER_USE_CAPABILITY = 'verified';
8
- const repairable = await repairNativeCapabilities({ root: repairableRoot, fix: true, yes: true, fixture: 'all-repairable' });
9
- delete process.env.SKS_CHROME_EXTENSION_READY;
10
- delete process.env.SKS_COMPUTER_USE_CAPABILITY;
11
- const manualRoot = await makeTempRoot('sks-doctor-native-manual-');
12
- const manual = await repairNativeCapabilities({ root: manualRoot, fix: true, yes: true, fixture: 'manual-required' });
13
- const screenshotBlockedRoot = await makeTempRoot('sks-doctor-native-screenshot-blocked-');
14
- await writeText(path.join(screenshotBlockedRoot, '.sneakoscope', 'app-screenshots'), 'not-a-directory');
15
- const screenshotBlocked = await repairNativeCapabilities({
16
- root: screenshotBlockedRoot,
17
- fix: false,
18
- yes: true,
19
- fixture: 'all-repairable',
20
- capabilities: ['codex_app_screenshot']
21
- });
22
- const corruptContractRoot = await makeTempRoot('sks-doctor-native-contract-repair-');
23
- await writeText(path.join(corruptContractRoot, '.sneakoscope', 'reports', 'saved-artifact-path-contract.json'), '{"schema":"broken"}\n');
24
- const corruptContract = await repairNativeCapabilities({
25
- root: corruptContractRoot,
26
- fix: true,
27
- yes: true,
28
- fixture: 'manual-required',
29
- capabilities: ['saved_artifact_path_contract']
30
- });
31
- assertGate(repairable.ok === true, 'repairable fixture must verify after doctor native repair', repairable);
32
- assertGate(manual.capabilities.some((state) => state.repairability === 'manual-required' && state.after !== 'verified'), 'manual-only fixture must not fake verified success', manual);
33
- assertGate(manual.capabilities.find((state) => state.id === 'image_generation')?.after !== 'verified', 'image generation auth missing must not verify', manual);
34
- assertGate(manual.capabilities.find((state) => state.id === 'chrome_web_review')?.after !== 'verified', 'Chrome/web review missing extension must not verify', manual);
35
- assertGate(manual.capabilities.find((state) => state.id === 'image_path_exposure')?.after === 'degraded', 'saved artifact path fallback must be degraded rather than verified', manual);
36
- assertGate(screenshotBlocked.capabilities.find((state) => state.id === 'codex_app_screenshot')?.after === 'blocked', 'unwritable screenshot artifact root must block postcheck', screenshotBlocked);
37
- assertGate(corruptContract.capabilities.find((state) => state.id === 'saved_artifact_path_contract')?.after === 'verified', 'doctor fix must repair corrupt saved artifact path contract', corruptContract);
38
- emitGate('doctor:native-capability-repair-blackbox');
39
- //# sourceMappingURL=doctor-native-capability-repair-blackbox.js.map
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env node
2
- import { assertGate, emitGate, makeTempRoot } from './sks-3-1-8-check-lib.js';
3
- import { runDoctorFixTransaction } from '../core/doctor/doctor-transaction.js';
4
- import { doctorRepairPostcheck } from '../core/doctor/doctor-repair-postcheck.js';
5
- const root = await makeTempRoot('sks-doctor-tx-blackbox-');
6
- const tx = await runDoctorFixTransaction({
7
- root,
8
- phases: [
9
- { id: 'preflight', run: async () => ({ id: 'preflight', ok: true, artifact_path: `${root}/preflight.json` }) },
10
- {
11
- id: 'postchecked',
12
- run: async () => ({ id: 'postchecked', ok: true }),
13
- postcheck: async () => ({ ok: true, warnings: ['postcheck_executed'] })
14
- },
15
- {
16
- id: 'optional_operator',
17
- required_for_ready: false,
18
- run: async () => ({ id: 'optional_operator', ok: false, manual_required: true, required_for_ready: false, blockers: ['operator_action_required'] })
19
- }
20
- ],
21
- reportPath: null
22
- });
23
- const postcheck = doctorRepairPostcheck(tx);
24
- assertGate(tx.ok === true && postcheck.ok === true, 'doctor transaction blackbox must allow optional manual follow-up without blocking readiness', { tx, postcheck });
25
- assertGate(tx.phases.some((phase) => phase.warnings.includes('postcheck_executed')), 'doctor transaction blackbox must run phase postchecks', tx);
26
- assertGate(tx.raw_secret_values_recorded === false, 'doctor transaction blackbox must not record raw secrets', tx);
27
- emitGate('doctor:transaction-engine-blackbox', { phases: tx.phases.length });
28
- //# sourceMappingURL=doctor-transaction-engine-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective314Gate } from './sks-3-1-4-directive-check-lib.js';
3
- await runDirective314Gate('doctor:zellij-fix-blackbox');
4
- //# sourceMappingURL=doctor-zellij-fix-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective314Gate } from './sks-3-1-4-directive-check-lib.js';
3
- await runDirective314Gate('doctor:zellij-no-homebrew-blackbox');
4
- //# sourceMappingURL=doctor-zellij-no-homebrew-blackbox.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runDirective314Gate } from './sks-3-1-4-directive-check-lib.js';
3
- await runDirective314Gate('doctor:zellij-upgrade-blackbox');
4
- //# sourceMappingURL=doctor-zellij-upgrade-blackbox.js.map