sneakoscope 2.0.14 → 2.0.16

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 (491) hide show
  1. package/README.md +6 -3
  2. package/crates/sks-core/Cargo.lock +1 -1
  3. package/crates/sks-core/Cargo.toml +1 -1
  4. package/crates/sks-core/src/main.rs +1 -1
  5. package/dist/.sks-build-stamp.json +4 -4
  6. package/dist/bin/sks.js +1 -1
  7. package/dist/cli/command-registry.js +2 -1
  8. package/dist/commands/mad-db.js +5 -0
  9. package/dist/commands/zellij-slot-pane.js +3 -1
  10. package/dist/core/agents/agent-orchestrator.js +66 -3
  11. package/dist/core/agents/agent-plan.js +3 -2
  12. package/dist/core/agents/agent-scheduler.js +204 -86
  13. package/dist/core/agents/agent-schema.js +1 -1
  14. package/dist/core/agents/native-cli-session-swarm.js +199 -15
  15. package/dist/core/agents/native-cli-worker.js +85 -0
  16. package/dist/core/agents/parallel-runtime-proof.js +217 -0
  17. package/dist/core/codex-control/codex-task-runner.js +32 -4
  18. package/dist/core/codex-control/model-call-concurrency.js +106 -0
  19. package/dist/core/commands/basic-cli.js +1 -1
  20. package/dist/core/commands/command-suggestions.js +1 -1
  21. package/dist/core/commands/mad-db-command.js +106 -0
  22. package/dist/core/commands/mad-sks-command.js +50 -13
  23. package/dist/core/commands/naruto-command.js +128 -5
  24. package/dist/core/commands/research-command.js +13 -1
  25. package/dist/core/commands/team-command.js +23 -175
  26. package/dist/core/db-safety.js +55 -1
  27. package/dist/core/fsx.js +1 -1
  28. package/dist/core/git/git-worktree-capability.js +18 -0
  29. package/dist/core/git/git-worktree-manager.js +80 -0
  30. package/dist/core/git/git-worktree-pool.js +4 -0
  31. package/dist/core/mad-db/mad-db-capability.js +116 -0
  32. package/dist/core/mad-db/mad-db-ledger.js +31 -0
  33. package/dist/core/mad-db/mad-db-policy-resolver.js +48 -0
  34. package/dist/core/naruto/naruto-concurrency-governor.js +14 -1
  35. package/dist/core/pipeline-internals/runtime-core.js +74 -8
  36. package/dist/core/pipeline-internals/runtime-gates.js +44 -0
  37. package/dist/core/proof/route-proof-gate.js +5 -3
  38. package/dist/core/proof/route-proof-policy.js +9 -1
  39. package/dist/core/release/release-gate-affected-selector.js +113 -0
  40. package/dist/core/release/release-gate-batch-runner.js +67 -0
  41. package/dist/core/release/release-gate-dag.js +22 -3
  42. package/dist/core/release/release-gate-resource-governor.js +23 -11
  43. package/dist/core/research/implementation-blueprint-densifier.js +1 -1
  44. package/dist/core/research/implementation-blueprint-markdown.js +1 -1
  45. package/dist/core/research/implementation-blueprint.js +68 -7
  46. package/dist/core/research/research-final-reviewer.js +27 -1
  47. package/dist/core/research/research-handoff.js +69 -5
  48. package/dist/core/research/research-realistic-report.js +162 -0
  49. package/dist/core/research/research-repetition-detector.js +75 -0
  50. package/dist/core/research/research-report-quality.js +27 -5
  51. package/dist/core/research/research-stage-runner.js +40 -13
  52. package/dist/core/research/research-synthesis-prompt.js +52 -0
  53. package/dist/core/research/research-synthesis-writer.js +208 -0
  54. package/dist/core/research.js +60 -48
  55. package/dist/core/routes.js +23 -19
  56. package/dist/core/update/update-notice.js +120 -0
  57. package/dist/core/version.js +1 -1
  58. package/dist/core/zellij/zellij-dashboard-renderer.js +2 -0
  59. package/dist/core/zellij/zellij-slot-column-anchor.js +35 -1
  60. package/dist/core/zellij/zellij-slot-pane-renderer.js +57 -0
  61. package/dist/core/zellij/zellij-slot-telemetry.js +237 -0
  62. package/dist/scripts/release-gate-dag-runner.js +5 -0
  63. package/dist/scripts/release-speed-summary.js +27 -0
  64. package/package.json +76 -5
  65. package/schemas/agents/parallel-runtime-proof.schema.json +48 -0
  66. package/schemas/mad-db/mad-db-capability.schema.json +31 -0
  67. package/schemas/mad-db/mad-db-ledger.schema.json +14 -0
  68. package/schemas/research/implementation-blueprint.schema.json +6 -1
  69. package/schemas/research/research-final-review.schema.json +10 -0
  70. package/schemas/research/research-synthesis-output.schema.json +62 -0
  71. package/schemas/update/update-notice.schema.json +19 -0
  72. package/schemas/zellij/zellij-slot-telemetry.schema.json +89 -0
  73. package/dist/scripts/agent-ast-aware-work-graph-check.js +0 -25
  74. package/dist/scripts/agent-backfill-replenishment-check.js +0 -13
  75. package/dist/scripts/agent-backfill-route-blackbox.js +0 -5
  76. package/dist/scripts/agent-background-terminals-check.js +0 -16
  77. package/dist/scripts/agent-cleanup-command-ux-check.js +0 -12
  78. package/dist/scripts/agent-cleanup-executor-check.js +0 -53
  79. package/dist/scripts/agent-cleanup-executor-v2-check.js +0 -39
  80. package/dist/scripts/agent-cli-options-to-task-graph-check.js +0 -5
  81. package/dist/scripts/agent-codex-app-cockpit-check.js +0 -91
  82. package/dist/scripts/agent-codex-child-overlap-check.js +0 -21
  83. package/dist/scripts/agent-dynamic-cockpit-check.js +0 -10
  84. package/dist/scripts/agent-dynamic-pool-check.js +0 -13
  85. package/dist/scripts/agent-dynamic-pool-route-blackbox.js +0 -5
  86. package/dist/scripts/agent-fast-mode-default-check.js +0 -62
  87. package/dist/scripts/agent-fast-mode-worker-propagation-check.js +0 -7
  88. package/dist/scripts/agent-follow-up-work-schema-check.js +0 -80
  89. package/dist/scripts/agent-goal-mode-propagation-check.js +0 -9
  90. package/dist/scripts/agent-intelligent-work-graph-check.js +0 -25
  91. package/dist/scripts/agent-janitor-check.js +0 -76
  92. package/dist/scripts/agent-main-no-scout-check.js +0 -11
  93. package/dist/scripts/agent-model-authored-patch-envelope-check.js +0 -15
  94. package/dist/scripts/agent-multi-project-isolation-check.js +0 -86
  95. package/dist/scripts/agent-native-cli-session-proof-check.js +0 -7
  96. package/dist/scripts/agent-native-cli-session-swarm-10-check.js +0 -7
  97. package/dist/scripts/agent-native-cli-session-swarm-20-check.js +0 -7
  98. package/dist/scripts/agent-native-cli-session-swarm-check.js +0 -7
  99. package/dist/scripts/agent-no-subagent-scaling-check.js +0 -7
  100. package/dist/scripts/agent-parallel-write-blackbox.js +0 -56
  101. package/dist/scripts/agent-parallel-write-kernel-check.js +0 -103
  102. package/dist/scripts/agent-patch-conflict-rebase-check.js +0 -198
  103. package/dist/scripts/agent-patch-envelope-extraction-check.js +0 -17
  104. package/dist/scripts/agent-patch-proof-check.js +0 -41
  105. package/dist/scripts/agent-patch-proof-runtime-check.js +0 -63
  106. package/dist/scripts/agent-patch-queue-runtime-check.js +0 -36
  107. package/dist/scripts/agent-patch-rollback-check.js +0 -38
  108. package/dist/scripts/agent-patch-rollback-dag-check.js +0 -14
  109. package/dist/scripts/agent-patch-swarm-route-blackbox.js +0 -10
  110. package/dist/scripts/agent-patch-swarm-runtime-check.js +0 -10
  111. package/dist/scripts/agent-patch-swarm-runtime-truth-check.js +0 -76
  112. package/dist/scripts/agent-patch-transaction-journal-check.js +0 -57
  113. package/dist/scripts/agent-patch-verification-dag-check.js +0 -14
  114. package/dist/scripts/agent-proof-contract-reconciled-check.js +0 -5
  115. package/dist/scripts/agent-real-codex-dynamic-smoke-check.js +0 -166
  116. package/dist/scripts/agent-real-codex-dynamic-smoke-v2-check.js +0 -14
  117. package/dist/scripts/agent-real-codex-in-zellij-worker-pane-check.js +0 -229
  118. package/dist/scripts/agent-real-codex-parallel-workers-10-check.js +0 -5
  119. package/dist/scripts/agent-real-codex-parallel-workers-20-check.js +0 -5
  120. package/dist/scripts/agent-real-codex-parallel-workers-5-check.js +0 -5
  121. package/dist/scripts/agent-real-codex-parallel-workers-check.js +0 -5
  122. package/dist/scripts/agent-role-config-repair-check.js +0 -33
  123. package/dist/scripts/agent-rollback-command-check.js +0 -86
  124. package/dist/scripts/agent-route-truth-backfill-check.js +0 -5
  125. package/dist/scripts/agent-scheduler-proof-check.js +0 -13
  126. package/dist/scripts/agent-scheduler-proof-hardening-check.js +0 -22
  127. package/dist/scripts/agent-session-generation-check.js +0 -21
  128. package/dist/scripts/agent-slot-pane-binding-proof-check.js +0 -64
  129. package/dist/scripts/agent-source-intelligence-propagation-check.js +0 -9
  130. package/dist/scripts/agent-strategy-to-lease-wiring-check.js +0 -32
  131. package/dist/scripts/agent-strategy-to-patch-strict-check.js +0 -54
  132. package/dist/scripts/agent-task-graph-expansion-check.js +0 -14
  133. package/dist/scripts/agent-terminal-generations-check.js +0 -23
  134. package/dist/scripts/agent-visual-consistency-check.js +0 -9
  135. package/dist/scripts/agent-wiki-context-proof-check.js +0 -62
  136. package/dist/scripts/agent-worker-backend-router-check.js +0 -63
  137. package/dist/scripts/agent-worker-scout-limited-check.js +0 -17
  138. package/dist/scripts/agent-zellij-dynamic-backfill-panes-check.js +0 -34
  139. package/dist/scripts/agent-zellij-runtime-check.js +0 -84
  140. package/dist/scripts/all-feature-deep-completion-check.js +0 -31
  141. package/dist/scripts/appshots-capability-check.js +0 -18
  142. package/dist/scripts/appshots-evidence-check.js +0 -48
  143. package/dist/scripts/appshots-operator-policy-check.js +0 -25
  144. package/dist/scripts/appshots-privacy-safety-check.js +0 -48
  145. package/dist/scripts/appshots-source-intelligence-check.js +0 -53
  146. package/dist/scripts/appshots-thread-attachment-discovery-check.js +0 -87
  147. package/dist/scripts/appshots-triwiki-voxel-check.js +0 -46
  148. package/dist/scripts/architecture-guard-check.js +0 -55
  149. package/dist/scripts/changelog-check.js +0 -47
  150. package/dist/scripts/codex-0-133-official-compat-report.js +0 -53
  151. package/dist/scripts/codex-0-134-official-compat-report.js +0 -110
  152. package/dist/scripts/codex-0-134-runner-truth-check.js +0 -66
  153. package/dist/scripts/codex-0-135-compat-check.js +0 -57
  154. package/dist/scripts/codex-0-136-compat-check.js +0 -30
  155. package/dist/scripts/codex-0-137-compat-check.js +0 -27
  156. package/dist/scripts/codex-app-fast-ui-preservation-check.js +0 -32
  157. package/dist/scripts/codex-app-provider-badge-check.js +0 -37
  158. package/dist/scripts/codex-app-ui-clobber-guard-check.js +0 -22
  159. package/dist/scripts/codex-app-ui-preservation-check.js +0 -96
  160. package/dist/scripts/codex-control-all-pipelines-check.js +0 -36
  161. package/dist/scripts/codex-control-capability-check.js +0 -10
  162. package/dist/scripts/codex-control-empty-result-retry-check.js +0 -43
  163. package/dist/scripts/codex-control-event-stream-ledger-check.js +0 -10
  164. package/dist/scripts/codex-control-keepalive-no-cot-leak-check.js +0 -14
  165. package/dist/scripts/codex-control-no-legacy-fallback-check.js +0 -31
  166. package/dist/scripts/codex-control-side-effect-scope-check.js +0 -26
  167. package/dist/scripts/codex-control-stream-idle-watchdog-check.js +0 -18
  168. package/dist/scripts/codex-control-structured-output-check.js +0 -11
  169. package/dist/scripts/codex-control-thread-registry-check.js +0 -11
  170. package/dist/scripts/codex-control-tool-call-sequence-repair-check.js +0 -14
  171. package/dist/scripts/codex-environment-scoped-approvals-check.js +0 -10
  172. package/dist/scripts/codex-exec-output-schema-actual-syntax-check.js +0 -33
  173. package/dist/scripts/codex-fast-mode-profile-propagation-check.js +0 -12
  174. package/dist/scripts/codex-history-search-check.js +0 -19
  175. package/dist/scripts/codex-hook-semantic-check.js +0 -15
  176. package/dist/scripts/codex-hook-strict-subset-check.js +0 -61
  177. package/dist/scripts/codex-lb-config-toml-safety-check.js +0 -85
  178. package/dist/scripts/codex-lb-persistence-truth-check.js +0 -96
  179. package/dist/scripts/codex-lb-setup-fixture-check.js +0 -91
  180. package/dist/scripts/codex-lb-setup-truthfulness-check.js +0 -84
  181. package/dist/scripts/codex-legacy-profile-consumers-removed-check.js +0 -24
  182. package/dist/scripts/codex-managed-proxy-env-check.js +0 -17
  183. package/dist/scripts/codex-output-schema-fixture-check.js +0 -25
  184. package/dist/scripts/codex-permission-profiles-check.js +0 -36
  185. package/dist/scripts/codex-plugin-list-json-check.js +0 -8
  186. package/dist/scripts/codex-profile-primary-check.js +0 -13
  187. package/dist/scripts/codex-project-config-policy-splitter-check.js +0 -51
  188. package/dist/scripts/codex-resume-cwd-truth-check.js +0 -17
  189. package/dist/scripts/codex-sdk-all-pipelines-check.js +0 -32
  190. package/dist/scripts/codex-sdk-backend-router-check.js +0 -65
  191. package/dist/scripts/codex-sdk-capability-check.js +0 -11
  192. package/dist/scripts/codex-sdk-core-skill-pipeline-check.js +0 -9
  193. package/dist/scripts/codex-sdk-dfix-pipeline-check.js +0 -9
  194. package/dist/scripts/codex-sdk-event-stream-ledger-check.js +0 -9
  195. package/dist/scripts/codex-sdk-no-legacy-fallback-check.js +0 -33
  196. package/dist/scripts/codex-sdk-qa-pipeline-check.js +0 -8
  197. package/dist/scripts/codex-sdk-real-smoke-check.js +0 -39
  198. package/dist/scripts/codex-sdk-release-review-pipeline-check.js +0 -13
  199. package/dist/scripts/codex-sdk-research-pipeline-check.js +0 -47
  200. package/dist/scripts/codex-sdk-sandbox-policy-check.js +0 -21
  201. package/dist/scripts/codex-sdk-structured-output-check.js +0 -10
  202. package/dist/scripts/codex-sdk-team-naruto-agent-pipeline-check.js +0 -12
  203. package/dist/scripts/codex-sdk-thread-registry-check.js +0 -11
  204. package/dist/scripts/codex-sdk-ux-ppt-review-pipeline-check.js +0 -9
  205. package/dist/scripts/codex-sdk-zellij-pane-binding-check.js +0 -13
  206. package/dist/scripts/codex-thread-runtime-choice-check.js +0 -10
  207. package/dist/scripts/codex-web-adapter-check.js +0 -12
  208. package/dist/scripts/computer-use-live-evidence-check.js +0 -55
  209. package/dist/scripts/computer-use-live-optional-check.js +0 -32
  210. package/dist/scripts/computer-use-policy-check.js +0 -69
  211. package/dist/scripts/computer-use-visual-route-fixture-check.js +0 -37
  212. package/dist/scripts/core-skill-card-schema-check.js +0 -61
  213. package/dist/scripts/core-skill-deployment-snapshot-check.js +0 -54
  214. package/dist/scripts/core-skill-heldout-validation-check.js +0 -49
  215. package/dist/scripts/core-skill-no-inference-optimizer-check.js +0 -75
  216. package/dist/scripts/core-skill-patch-check.js +0 -79
  217. package/dist/scripts/core-skill-promotion-side-effect-ledger-check.js +0 -64
  218. package/dist/scripts/core-skill-rollout-scoring-check.js +0 -72
  219. package/dist/scripts/core-skill-route-runtime-integration-check.js +0 -49
  220. package/dist/scripts/dfix-fast-blackbox-check.js +0 -37
  221. package/dist/scripts/dfix-fast-kernel-check.js +0 -26
  222. package/dist/scripts/dfix-fixture-check.js +0 -6
  223. package/dist/scripts/dfix-parallel-write-blackbox.js +0 -48
  224. package/dist/scripts/dfix-patch-handoff-check.js +0 -13
  225. package/dist/scripts/dfix-patch-swarm-route-blackbox.js +0 -10
  226. package/dist/scripts/dfix-performance-check.js +0 -15
  227. package/dist/scripts/dfix-verification-check.js +0 -9
  228. package/dist/scripts/dfix-verification-recommendation-check.js +0 -15
  229. package/dist/scripts/docs-truthfulness-check.js +0 -61
  230. package/dist/scripts/doctor-codex-doctor-parity-check.js +0 -17
  231. package/dist/scripts/doctor-fix-proves-codex-read-check.js +0 -64
  232. package/dist/scripts/doctor-fix-recovers-corrupted-config-check.js +0 -122
  233. package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +0 -39
  234. package/dist/scripts/evidence-fixture-check.js +0 -26
  235. package/dist/scripts/evidence-flagship-coverage-check.js +0 -55
  236. package/dist/scripts/fake-real-proof-policy-v2-check.js +0 -27
  237. package/dist/scripts/fake-vs-real-proof-policy-check.js +0 -14
  238. package/dist/scripts/fast-codex-service-tier-proof-check.js +0 -42
  239. package/dist/scripts/flagship-proof-graph-v2-check.js +0 -48
  240. package/dist/scripts/flagship-proof-graph-v3-check.js +0 -67
  241. package/dist/scripts/flagship-proof-graph-v4-check.js +0 -61
  242. package/dist/scripts/git-precommit-fixture-check.js +0 -41
  243. package/dist/scripts/git-worktree-cache-performance-check.js +0 -25
  244. package/dist/scripts/git-worktree-capability-check.js +0 -27
  245. package/dist/scripts/git-worktree-checkpoint-check.js +0 -20
  246. package/dist/scripts/git-worktree-cleanup-check.js +0 -27
  247. package/dist/scripts/git-worktree-cross-rebase-check.js +0 -39
  248. package/dist/scripts/git-worktree-diff-envelope-check.js +0 -17
  249. package/dist/scripts/git-worktree-diff-export-check.js +0 -43
  250. package/dist/scripts/git-worktree-dirty-lock-check.js +0 -17
  251. package/dist/scripts/git-worktree-dirty-main-detection-check.js +0 -14
  252. package/dist/scripts/git-worktree-integration-primary-check.js +0 -24
  253. package/dist/scripts/git-worktree-integration-primary-runtime-check.js +0 -20
  254. package/dist/scripts/git-worktree-manager-check.js +0 -37
  255. package/dist/scripts/git-worktree-manifest-append-check.js +0 -18
  256. package/dist/scripts/git-worktree-merge-queue-check.js +0 -31
  257. package/dist/scripts/git-worktree-pool-performance-check.js +0 -20
  258. package/dist/scripts/git-worktree-untracked-diff-check.js +0 -18
  259. package/dist/scripts/goal-mode-official-default-check.js +0 -12
  260. package/dist/scripts/gpt-final-arbiter-check.js +0 -63
  261. package/dist/scripts/gpt-final-arbiter-performance-check.js +0 -36
  262. package/dist/scripts/gpt-image-2-request-validator-check.js +0 -35
  263. package/dist/scripts/hooks-0.134-context-parity-check.js +0 -20
  264. package/dist/scripts/hooks-actual-parity-check.js +0 -17
  265. package/dist/scripts/hooks-actual-parity-v2-check.js +0 -21
  266. package/dist/scripts/hooks-latest-schema-check.js +0 -20
  267. package/dist/scripts/hooks-managed-install-fixture-check.js +0 -21
  268. package/dist/scripts/hooks-official-hash-oracle-check.js +0 -35
  269. package/dist/scripts/hooks-official-hash-parity-check.js +0 -17
  270. package/dist/scripts/hooks-subagent-events-check.js +0 -17
  271. package/dist/scripts/hooks-trust-state-check.js +0 -14
  272. package/dist/scripts/image-fidelity-fixture-check.js +0 -24
  273. package/dist/scripts/imagegen-capability-check.js +0 -30
  274. package/dist/scripts/imagegen-real-smoke-check.js +0 -155
  275. package/dist/scripts/install-update-preserves-config-check.js +0 -87
  276. package/dist/scripts/json-schema-recursive-check.js +0 -78
  277. package/dist/scripts/legacy-multiagent-removal-check.js +0 -85
  278. package/dist/scripts/legacy-upgrade-matrix-check.js +0 -300
  279. package/dist/scripts/local-collab-all-pipelines-final-gpt-check.js +0 -21
  280. package/dist/scripts/local-collab-gpt-final-availability-check.js +0 -58
  281. package/dist/scripts/local-collab-no-local-only-final-check.js +0 -27
  282. package/dist/scripts/local-collab-policy-check.js +0 -17
  283. package/dist/scripts/local-collab-worktree-gpt-final-apply-policy-check.js +0 -63
  284. package/dist/scripts/local-llm-all-pipelines-check.js +0 -11
  285. package/dist/scripts/local-llm-cache-performance-check.js +0 -10
  286. package/dist/scripts/local-llm-capability-check.js +0 -14
  287. package/dist/scripts/local-llm-smoke-check.js +0 -23
  288. package/dist/scripts/local-llm-structured-output-check.js +0 -11
  289. package/dist/scripts/local-llm-throughput-check.js +0 -10
  290. package/dist/scripts/local-llm-tool-call-repair-check.js +0 -10
  291. package/dist/scripts/local-llm-warmup-check.js +0 -11
  292. package/dist/scripts/loop-blocker-check.js +0 -15
  293. package/dist/scripts/mad-preflight-blocks-unreadable-config-check.js +0 -35
  294. package/dist/scripts/mad-sks-actual-executor-blackbox.js +0 -5
  295. package/dist/scripts/mad-sks-app-ui-no-mutation-check.js +0 -92
  296. package/dist/scripts/mad-sks-audit-proof-check.js +0 -34
  297. package/dist/scripts/mad-sks-db-executor-check.js +0 -5
  298. package/dist/scripts/mad-sks-executor-proof-graph-check.js +0 -5
  299. package/dist/scripts/mad-sks-fast-mode-propagation-check.js +0 -24
  300. package/dist/scripts/mad-sks-file-write-executor-check.js +0 -5
  301. package/dist/scripts/mad-sks-immutable-harness-check.js +0 -36
  302. package/dist/scripts/mad-sks-no-harness-modification-check.js +0 -25
  303. package/dist/scripts/mad-sks-package-executor-check.js +0 -5
  304. package/dist/scripts/mad-sks-permission-model-check.js +0 -22
  305. package/dist/scripts/mad-sks-rollback-apply-check.js +0 -5
  306. package/dist/scripts/mad-sks-service-executor-check.js +0 -5
  307. package/dist/scripts/mad-sks-shell-executor-check.js +0 -5
  308. package/dist/scripts/mad-sks-write-guard-check.js +0 -28
  309. package/dist/scripts/mad-sks-zellij-default-pane-worker-check.js +0 -37
  310. package/dist/scripts/mad-sks-zellij-launch-check.js +0 -102
  311. package/dist/scripts/mcp-0-134-modernization-check.js +0 -55
  312. package/dist/scripts/mcp-readonly-concurrency-check.js +0 -17
  313. package/dist/scripts/mcp-readonly-runtime-scheduler-check.js +0 -20
  314. package/dist/scripts/mcp-tool-naming-parity-check.js +0 -16
  315. package/dist/scripts/memory-summary-rebuild-check.js +0 -22
  316. package/dist/scripts/mutation-callsite-coverage-check.js +0 -180
  317. package/dist/scripts/naruto-active-pool-check.js +0 -39
  318. package/dist/scripts/naruto-actual-worker-control-plane-check.js +0 -56
  319. package/dist/scripts/naruto-allocation-policy-check.js +0 -33
  320. package/dist/scripts/naruto-allocation-runtime-wiring-check.js +0 -92
  321. package/dist/scripts/naruto-concurrency-governor-check.js +0 -53
  322. package/dist/scripts/naruto-extreme-parallelism-check.js +0 -22
  323. package/dist/scripts/naruto-extreme-parallelism-real-check.js +0 -43
  324. package/dist/scripts/naruto-gpt-final-pack-check.js +0 -34
  325. package/dist/scripts/naruto-orchestrator-runtime-source-check.js +0 -70
  326. package/dist/scripts/naruto-parallel-patch-apply-check.js +0 -41
  327. package/dist/scripts/naruto-readonly-routing-check.js +0 -116
  328. package/dist/scripts/naruto-real-active-pool-check.js +0 -39
  329. package/dist/scripts/naruto-real-active-pool-runtime-check.js +0 -55
  330. package/dist/scripts/naruto-rebalance-policy-check.js +0 -41
  331. package/dist/scripts/naruto-role-distribution-check.js +0 -23
  332. package/dist/scripts/naruto-shadow-clone-swarm-check.js +0 -153
  333. package/dist/scripts/naruto-verification-pool-check.js +0 -36
  334. package/dist/scripts/naruto-work-graph-check.js +0 -24
  335. package/dist/scripts/naruto-worktree-coding-blackbox.js +0 -29
  336. package/dist/scripts/naruto-worktree-coding-check.js +0 -44
  337. package/dist/scripts/naruto-worktree-gpt-final-check.js +0 -45
  338. package/dist/scripts/naruto-worktree-zellij-ui-check.js +0 -28
  339. package/dist/scripts/naruto-zellij-dynamic-right-column-check.js +0 -48
  340. package/dist/scripts/naruto-zellij-massive-ui-check.js +0 -23
  341. package/dist/scripts/non-recursive-pipeline-check.js +0 -68
  342. package/dist/scripts/npm-publish-performance-check.js +0 -65
  343. package/dist/scripts/official-docs-compat-report.js +0 -304
  344. package/dist/scripts/packlist-performance-check.js +0 -83
  345. package/dist/scripts/parallel-verification-engine-check.js +0 -85
  346. package/dist/scripts/postinstall-safe-side-effects-check.js +0 -65
  347. package/dist/scripts/ppt-full-e2e-artifact-graph-check.js +0 -40
  348. package/dist/scripts/ppt-full-e2e-blackbox-check.js +0 -109
  349. package/dist/scripts/ppt-image-voxel-relations-check.js +0 -9
  350. package/dist/scripts/ppt-imagegen-blackbox-check.js +0 -46
  351. package/dist/scripts/ppt-imagegen-review-fixture-check.js +0 -6
  352. package/dist/scripts/ppt-issue-extraction-fixture-check.js +0 -7
  353. package/dist/scripts/ppt-no-mock-as-real-check.js +0 -8
  354. package/dist/scripts/ppt-no-text-fallback-check.js +0 -7
  355. package/dist/scripts/ppt-proof-trust-fixture-check.js +0 -10
  356. package/dist/scripts/ppt-real-export-adapter-check.js +0 -13
  357. package/dist/scripts/ppt-real-imagegen-smoke-check.js +0 -42
  358. package/dist/scripts/ppt-real-imagegen-wiring-check.js +0 -16
  359. package/dist/scripts/ppt-reexport-rereview-check.js +0 -19
  360. package/dist/scripts/ppt-slide-export-fixture-check.js +0 -7
  361. package/dist/scripts/prepublish-fast-check.js +0 -128
  362. package/dist/scripts/priority-full-closure-check.js +0 -12
  363. package/dist/scripts/product-design-auto-install-check.js +0 -119
  364. package/dist/scripts/product-design-plugin-routing-check.js +0 -101
  365. package/dist/scripts/prompt-placeholder-guard-check.js +0 -33
  366. package/dist/scripts/provider-badge-context-check.js +0 -26
  367. package/dist/scripts/provider-context-config-toml-check.js +0 -63
  368. package/dist/scripts/python-codex-sdk-all-pipelines-check.js +0 -47
  369. package/dist/scripts/python-codex-sdk-capability-check.js +0 -75
  370. package/dist/scripts/python-codex-sdk-sandbox-policy-check.js +0 -10
  371. package/dist/scripts/python-codex-sdk-stream-bridge-check.js +0 -12
  372. package/dist/scripts/python-tools-smoke-check.js +0 -71
  373. package/dist/scripts/qa-actual-route-backfill-check.js +0 -5
  374. package/dist/scripts/qa-backfill-route-blackbox.js +0 -5
  375. package/dist/scripts/qa-patch-swarm-route-blackbox.js +0 -10
  376. package/dist/scripts/readme-architecture-imagegen-official-check.js +0 -448
  377. package/dist/scripts/release-cache-glob-hashing-check.js +0 -42
  378. package/dist/scripts/release-dag-full-coverage-check.js +0 -66
  379. package/dist/scripts/release-dist-freshness-check.js +0 -8
  380. package/dist/scripts/release-dynamic-performance-check.js +0 -103
  381. package/dist/scripts/release-gate-budget-check.js +0 -36
  382. package/dist/scripts/release-gate-dag-runner-check.js +0 -17
  383. package/dist/scripts/release-metadata-1-11-check.js +0 -37
  384. package/dist/scripts/release-metadata-1-12-check.js +0 -48
  385. package/dist/scripts/release-metadata-1-13-check.js +0 -53
  386. package/dist/scripts/release-metadata-1-14-check.js +0 -63
  387. package/dist/scripts/release-metadata-1-16-check.js +0 -81
  388. package/dist/scripts/release-metadata-1-17-check.js +0 -51
  389. package/dist/scripts/release-metadata-1-19-check.js +0 -371
  390. package/dist/scripts/release-metadata-check.js +0 -7
  391. package/dist/scripts/release-native-agent-fixture-check.js +0 -41
  392. package/dist/scripts/release-parallel-check.js +0 -374
  393. package/dist/scripts/release-parallel-full-coverage-check.js +0 -13
  394. package/dist/scripts/release-parallel-speed-budget-check.js +0 -84
  395. package/dist/scripts/release-provenance-check.js +0 -150
  396. package/dist/scripts/release-real-check.js +0 -330
  397. package/dist/scripts/release-registry-check.js +0 -344
  398. package/dist/scripts/release-runtime-truth-matrix-check.js +0 -47
  399. package/dist/scripts/release-stability-report-check.js +0 -99
  400. package/dist/scripts/release-version-truth-check.js +0 -134
  401. package/dist/scripts/research-actual-route-backfill-check.js +0 -5
  402. package/dist/scripts/research-backfill-route-blackbox.js +0 -5
  403. package/dist/scripts/research-blueprint-densifier-check.js +0 -21
  404. package/dist/scripts/research-claim-builder-check.js +0 -19
  405. package/dist/scripts/research-complete-package-fixture-check.js +0 -23
  406. package/dist/scripts/research-final-reviewer-blackbox.js +0 -22
  407. package/dist/scripts/research-parallel-source-shards-check.js +0 -22
  408. package/dist/scripts/research-quality-gate-check.js +0 -111
  409. package/dist/scripts/research-real-cycle-no-legacy-final-md-check.js +0 -14
  410. package/dist/scripts/research-short-report-rejection-check.js +0 -46
  411. package/dist/scripts/research-source-ledger-merge-check.js +0 -26
  412. package/dist/scripts/research-stage-cycle-runtime-blackbox.js +0 -24
  413. package/dist/scripts/responses-retry-policy-centralized-check.js +0 -19
  414. package/dist/scripts/retention-cleanup-safety-check.js +0 -155
  415. package/dist/scripts/route-blackbox-realism-check.js +0 -21
  416. package/dist/scripts/route-proof-artifact-structure-check.js +0 -145
  417. package/dist/scripts/runtime-dist-parity-check.js +0 -78
  418. package/dist/scripts/runtime-no-mjs-scripts-check.js +0 -45
  419. package/dist/scripts/runtime-no-src-mjs-check.js +0 -32
  420. package/dist/scripts/runtime-no-tmux-check.js +0 -113
  421. package/dist/scripts/runtime-ts-python-boundary-check.js +0 -59
  422. package/dist/scripts/runtime-ts-rust-boundary-check.js +0 -74
  423. package/dist/scripts/runtime-ts-source-of-truth-check.js +0 -55
  424. package/dist/scripts/safety-check.js +0 -23
  425. package/dist/scripts/shared-memory-fixture-check.js +0 -27
  426. package/dist/scripts/side-effect-runtime-report-check.js +0 -19
  427. package/dist/scripts/side-effect-zero-gate-check.js +0 -226
  428. package/dist/scripts/sks-1-11-fixture-check.js +0 -130
  429. package/dist/scripts/source-intelligence-all-modes-check.js +0 -32
  430. package/dist/scripts/source-intelligence-policy-check.js +0 -13
  431. package/dist/scripts/strategy-adhd-orchestrating-gate-check.js +0 -22
  432. package/dist/scripts/strategy-file-ownership-plan-check.js +0 -18
  433. package/dist/scripts/strategy-parallel-modification-plan-check.js +0 -19
  434. package/dist/scripts/strategy-verification-rollback-dag-check.js +0 -19
  435. package/dist/scripts/team-actual-route-backfill-check.js +0 -5
  436. package/dist/scripts/team-backfill-route-blackbox.js +0 -5
  437. package/dist/scripts/team-parallel-write-blackbox.js +0 -55
  438. package/dist/scripts/team-patch-swarm-route-blackbox.js +0 -10
  439. package/dist/scripts/terminal-keyboard-enhancement-safety-check.js +0 -12
  440. package/dist/scripts/terminal-tui-output-stability-check.js +0 -35
  441. package/dist/scripts/test-no-orphan-dist-imports-check.js +0 -73
  442. package/dist/scripts/trust-fixture-check.js +0 -33
  443. package/dist/scripts/typescript-migration-report.js +0 -78
  444. package/dist/scripts/ultra-router-auto-router-check.js +0 -33
  445. package/dist/scripts/ultra-router-classification-check.js +0 -28
  446. package/dist/scripts/ux-patch-swarm-route-blackbox.js +0 -10
  447. package/dist/scripts/ux-ppt-structured-extraction-check.js +0 -21
  448. package/dist/scripts/ux-review-extract-real-callouts-fixture-check.js +0 -8
  449. package/dist/scripts/ux-review-extract-wires-real-extractor-check.js +0 -15
  450. package/dist/scripts/ux-review-generate-callouts-fixture-check.js +0 -9
  451. package/dist/scripts/ux-review-image-voxel-relations-check.js +0 -31
  452. package/dist/scripts/ux-review-imagegen-blackbox-check.js +0 -67
  453. package/dist/scripts/ux-review-no-fake-callouts-check.js +0 -8
  454. package/dist/scripts/ux-review-no-text-fallback-check.js +0 -25
  455. package/dist/scripts/ux-review-patch-diff-recheck-check.js +0 -20
  456. package/dist/scripts/ux-review-patch-handoff-fixture-check.js +0 -8
  457. package/dist/scripts/ux-review-real-imagegen-smoke-check.js +0 -31
  458. package/dist/scripts/ux-review-real-loop-fixture-check.js +0 -24
  459. package/dist/scripts/ux-review-recapture-recheck-fixture-check.js +0 -8
  460. package/dist/scripts/ux-review-run-wires-imagegen-check.js +0 -11
  461. package/dist/scripts/worker-pane-communication-contract-check.js +0 -54
  462. package/dist/scripts/wrongness-fixture-check.js +0 -65
  463. package/dist/scripts/xai-mcp-capability-check.js +0 -14
  464. package/dist/scripts/zellij-capability-check.js +0 -15
  465. package/dist/scripts/zellij-dashboard-pane-check.js +0 -70
  466. package/dist/scripts/zellij-developer-controls-check.js +0 -20
  467. package/dist/scripts/zellij-doctor-readiness-check.js +0 -63
  468. package/dist/scripts/zellij-dynamic-pane-lifecycle-check.js +0 -21
  469. package/dist/scripts/zellij-first-slot-down-stack-check.js +0 -20
  470. package/dist/scripts/zellij-first-slot-down-stack-real-check.js +0 -356
  471. package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -28
  472. package/dist/scripts/zellij-lane-renderer-check.js +0 -65
  473. package/dist/scripts/zellij-launch-command-truth-check.js +0 -75
  474. package/dist/scripts/zellij-layout-valid-check.js +0 -90
  475. package/dist/scripts/zellij-pane-proof-check.js +0 -59
  476. package/dist/scripts/zellij-real-session-cleanup-check.js +0 -21
  477. package/dist/scripts/zellij-real-session-heartbeat-check.js +0 -49
  478. package/dist/scripts/zellij-real-session-launch-check.js +0 -57
  479. package/dist/scripts/zellij-right-column-headless-overflow-check.js +0 -22
  480. package/dist/scripts/zellij-right-column-manager-check.js +0 -27
  481. package/dist/scripts/zellij-screen-proof-check.js +0 -45
  482. package/dist/scripts/zellij-slot-column-anchor-check.js +0 -66
  483. package/dist/scripts/zellij-slot-only-ui-check.js +0 -26
  484. package/dist/scripts/zellij-slot-pane-renderer-check.js +0 -106
  485. package/dist/scripts/zellij-slot-renderer-proof-semantics-check.js +0 -59
  486. package/dist/scripts/zellij-spawn-on-demand-layout-check.js +0 -40
  487. package/dist/scripts/zellij-ui-design-check.js +0 -105
  488. package/dist/scripts/zellij-worker-pane-manager-check.js +0 -109
  489. package/dist/scripts/zellij-worker-pane-manager-single-owner-check.js +0 -47
  490. package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -202
  491. package/dist/scripts/zellij-worker-pane-spawn-order-check.js +0 -35
@@ -0,0 +1,162 @@
1
+ import { REQUIRED_RESEARCH_REPORT_HEADINGS } from './research-report-quality.js';
2
+ export function buildRealisticResearchReport(input) {
3
+ const plan = input.plan || {};
4
+ const claims = normalizeClaims(input.claims);
5
+ const sourceIds = normalizeIds(input.sourceIds).length ? normalizeIds(input.sourceIds) : fallbackIds('source', 14);
6
+ const counterIds = normalizeIds(input.counterevidenceIds).length ? normalizeIds(input.counterevidenceIds) : fallbackIds('counter', 2);
7
+ const sections = Array.isArray(input.blueprint?.sections) ? input.blueprint.sections : [];
8
+ const experimentSteps = Array.isArray(input.experimentPlan?.steps) ? input.experimentPlan.steps : [];
9
+ const falsificationCases = Array.isArray(input.falsificationLedger?.cases) ? input.falsificationLedger.cases : [];
10
+ const claimBullets = claims.slice(0, 8).map((claim, index) => {
11
+ const sourceA = sourceIds[index % sourceIds.length];
12
+ const sourceB = sourceIds[(index + 3) % sourceIds.length];
13
+ const counter = counterIds[index % counterIds.length];
14
+ return `- ${claim.id}: ${claim.claim} The claim is supported by ${sourceA} and ${sourceB}, challenged by ${counter}, and kept falsifiable through "${claim.test_or_probe || 'the next listed validation probe'}".`;
15
+ });
16
+ const blueprintTargets = [...new Set(sections.flatMap((section) => Array.isArray(section?.target_paths) ? section.target_paths : []))].slice(0, 12);
17
+ return [
18
+ '# SKS Research Report',
19
+ '',
20
+ `Prompt: ${plan.prompt || 'research mission'}`,
21
+ '',
22
+ '## Question',
23
+ `The research question is whether the package can support a downstream implementation route without leaning on a long deterministic summary. For ${plan.mission_id || 'the mission'}, the answer must come from source-ledger ids, key claim ids, falsification cases, implementation blueprint sections, and explicit validation commands rather than prose volume alone. This report treats the research artifact set as the evidence object: source ids such as ${sourceIds.slice(0, 4).join(', ')} are not decorative references, and claim ids such as ${claims.slice(0, 3).map((claim) => claim.id).join(', ')} must remain visible all the way to the handoff.`,
24
+ '',
25
+ '## Methodology',
26
+ `The method follows a staged research runtime. Source shards first collect layer-specific evidence, the source-ledger merge deduplicates rows, the claim matrix binds source ids to key claims, the falsification ledger records failure modes, and the implementation blueprint turns supported findings into concrete files and tests. The staged order matters because a final report can sound plausible while still hiding missing evidence. Here the synthesis uses ${sourceIds.length} source ids, ${counterIds.length} counterevidence ids, ${claims.length} claim rows, ${falsificationCases.length || 4} falsification cases, and ${sections.length || 8} blueprint sections before it makes a recommendation.`,
27
+ '',
28
+ '## Source Map',
29
+ `The source map spans primary, recency, practitioner, public-discourse, counterevidence, and local-project rows. The most frequently cited support ids are ${sourceIds.slice(0, 8).join(', ')}, while the explicit counterevidence ids are ${counterIds.slice(0, 4).join(', ')}. A useful synthesis distinguishes those roles: supportive rows stabilize the claim, counter rows bound the claim, and local-project rows translate the claim into repository work. If a source id does not appear in the ledger, it cannot carry a factual assertion in this report.`,
30
+ '',
31
+ 'The report also keeps source density visible. Each major section names concrete source-ledger ids and claim ids so the final reviewer can reject unsupported synthesis without reading between the lines. This is especially important for recommendations, because implementation guidance should point back to source rows and blueprint sections instead of becoming free-floating advice.',
32
+ '',
33
+ '## Key Claims',
34
+ ...claimBullets,
35
+ '',
36
+ '## Evidence Matrix Summary',
37
+ `The claim-evidence matrix separates facts, inferences, hypotheses, recommendations, and implementation guidance. Claims ${claims.slice(0, 4).map((claim) => claim.id).join(', ')} receive direct support from ${sourceIds.slice(0, 6).join(', ')}, while claims ${claims.slice(4, 8).map((claim) => claim.id).join(', ')} add triangulation across later source layers. This lets the final reviewer ask three concrete questions: whether the cited source ids exist, whether important claims include counterevidence, and whether any unsupported high-importance claim remains in the matrix.`,
38
+ '',
39
+ `The matrix is also the bridge from research to implementation. Recommendations remain recommendations until they are backed by blueprint sections. In this package, the relevant sections include ${sections.slice(0, 6).map((section) => section.id || section.title).join(', ') || 'problem, decision, architecture, interfaces, execution_plan, verification_plan'}, and the target file map includes ${blueprintTargets.length ? blueprintTargets.join(', ') : 'src/core/research/research-stage-runner.ts, src/core/research/research-report-quality.ts, src/core/research/research-final-reviewer.ts, package.json, release-gates.v2.json, docs/research-pipeline.md'}.`,
40
+ '',
41
+ '## Counterevidence',
42
+ `Counterevidence is not treated as an appendix. The report cites ${counterIds.join(', ')} because each counter row limits what the synthesis can claim. One counter row challenges summary-only output; another challenges missing replication; a third, when present, challenges source density or low claim coverage. These rows prevent the report from converting runtime success into a claim about live research accuracy. The acceptable conclusion is narrower: the package has enough artifact evidence to be reviewed and handed off.`,
43
+ '',
44
+ 'The counterevidence also shapes the recommended tests. A repeated paragraph can meet a word floor while still failing the research objective. A source ledger can contain many rows while still leaving key claims uncited. A blueprint can name files while still lacking rollback and acceptance checks. The report therefore keeps the negative cases visible and links them to final reviewer blockers rather than hiding them under a confident narrative.',
45
+ '',
46
+ '## Falsification',
47
+ ...(falsificationCases.length ? falsificationCases.slice(0, 4).map((row, index) => `Case ${index + 1}: ${row.id || `falsification-${index + 1}`} tests ${row.target_claim || claims[index % claims.length]?.id || 'a key claim'} against ${normalizeIds(row.source_ids).join(', ') || counterIds[index % counterIds.length]}. The expected result is not unconditional approval; the claim survives only if the cited evidence, replication command, and blueprint acceptance check remain present.`) : [
48
+ `Case 1: ${claims[0].id} fails if the report cites fewer than eight unique source ids such as ${sourceIds.slice(0, 8).join(', ')}.`,
49
+ `Case 2: ${claims[1].id} fails if counterevidence ids ${counterIds.join(', ')} disappear from the matrix.`,
50
+ `Case 3: ${claims[2].id} fails if the handoff lacks concrete files, tests, and rollback steps.`,
51
+ `Case 4: ${claims[3].id} fails if repeated or template-like prose is accepted as synthesis evidence.`
52
+ ]),
53
+ '',
54
+ '## Implementation Blueprint',
55
+ `The implementation handoff is concrete enough for Naruto only when it names files, tests, work items, and rollback steps. The blueprint in this package is repository-aware and points to files such as ${blueprintTargets.slice(0, 10).join(', ') || 'src/core/research/research-synthesis-writer.ts, src/core/research/research-repetition-detector.ts, src/core/research/research-stage-runner.ts, src/core/research/research-final-reviewer.ts, src/core/research/implementation-blueprint.ts, src/core/commands/research-command.ts, package.json, release-gates.v2.json'}. The research route itself remains read-only against repository source; the blueprint is a handoff, not a hidden mutation channel.`,
56
+ '',
57
+ `The execution plan should be numbered and reviewable. First, add the evidence-bound synthesis writer and schema. Second, add anti-template quality checks that emit source density, claim density, and repetition metrics. Third, route non-mock synthesis through Codex/GPT only and keep deterministic rendering for mock or fallback paths. Fourth, harden final review so template-like prose, weak blueprint concreteness, and source-density failures block approval. Fifth, update release gates and documentation so these checks are part of the public release path. Sixth, run the final checklist and record any blocked command honestly.`,
58
+ '',
59
+ `The rollback plan is similarly explicit. If a new quality threshold rejects valid reports, revert the threshold change and keep the blackbox fixture that exposed the mismatch. If the synthesis writer fails because Codex/GPT is unavailable in non-mock mode, keep the research gate blocked and surface the backend blocker instead of approving with a local-only or deterministic substitute. If release metadata drifts, restore package and lockfile version truth before rerunning release checks.`,
60
+ '',
61
+ `The implementation section also defines ownership boundaries for a follow-up execution route. The synthesis writer lane owns ${sourceIds[8 % sourceIds.length]} and ${claims[4].id} evidence about report generation. The quality lane owns ${sourceIds[9 % sourceIds.length]} and ${claims[5].id} evidence about repetition, source density, claim density, and section depth. The final-review lane owns ${counterIds[0]} plus ${claims[6].id}, because reviewer approval must fall back to blocked status when evidence is unavailable. The release lane owns ${sourceIds[10 % sourceIds.length]} and ${claims[7].id}, making package scripts, release DAG nodes, documentation, and changelog entries observable in the same verification bundle.`,
62
+ '',
63
+ `For Naruto consumption, each lane needs an acceptance proof rather than a vague instruction. A clone working on source and claim density can inspect research-report-quality, run the repetition detector, and show that the report keeps ${sourceIds.slice(0, 10).join(', ')} visible. A clone working on synthesis can inspect research-synthesis-output.json and show that ${claims.slice(0, 6).map((claim) => claim.id).join(', ')} are covered. A clone working on handoff can inspect team-handoff-goal.md and show that file lists, test commands, rollback steps, and explicit blockers are present. This framing keeps parallel work decomposed without giving any worker permission to mutate Research artifacts as a substitute for source evidence.`,
64
+ '',
65
+ `The blueprint therefore carries three acceptance dimensions. Traceability asks whether the report maps claims to sources and counterevidence. Concreteness asks whether the target paths and tests are specific enough to execute. Recoverability asks whether a failed release gate has a bounded rollback path. The report should pass only when all three are visible together, because a release candidate can be source-rich but operationally vague, or operationally detailed but unsupported by evidence. That is why ${counterIds[1 % counterIds.length]} remains in the same section as package, release, and documentation work.`,
66
+ '',
67
+ '## Experiment / Validation Plan',
68
+ ...(experimentSteps.length ? experimentSteps.map((step) => `- ${step.id}: ${step.action} Evidence: ${normalizeIds(step.expected_evidence).join(', ') || 'mission artifacts'}.`) : [
69
+ '- E1: Compare a template-like report against this realistic package and require the template report to fail.',
70
+ '- E2: Run the repetition detector and require repeated paragraph ratio to stay below 0.18.',
71
+ '- E3: Run report quality checks and require source and claim density metrics to clear their thresholds.',
72
+ '- E4: Run final reviewer blackbox cases for both repeated and realistic reports.',
73
+ '- E5: Run handoff consumability checks and verify Naruto work items include files, tests, and acceptance.'
74
+ ]),
75
+ '',
76
+ `Replication commands should include ${normalizeIds(input.replicationPack?.commands).slice(0, 5).join(', ') || 'npm run research:synthesis-writer, npm run research:repetition-detector, npm run research:template-report-rejection, npm run research:handoff-consumability, npm run release:dag-full-coverage'}. The expected artifacts are research-synthesis-output.json, research-report.md, the paper artifact, research-final-review.json, team-handoff-goal.md, and research-gate.evaluated.json.`,
77
+ '',
78
+ `A second validation pass should compare the realistic package against two adversarial reports. The first adversarial report repeats a long paragraph with small id changes, which should trigger repeated paragraph and template phrase blockers. The second adversarial report cites a few source ids but does not mention enough claim ids, which should trigger claim density and key-claim coverage blockers. The realistic package must beat both controls without requiring a special mock-mode exemption inside report quality analysis.`,
79
+ '',
80
+ `A third validation pass should inspect operator-facing behavior. The completion output should name the synthesis writer, report word count, source count, key claim count, repetition ratio, final review verdict, and handoff artifact. The JSON status output should expose the same information under research_quality.synthesis so automation can compare runs without scraping prose. This pass matters because release stability is not only an internal gate property; the operator must be able to diagnose why a Research mission passed, blocked, or paused. A gate that silently rejects source-light prose is safer than before, but it is still incomplete if the user cannot see the source-density and claim-density signals that caused the decision.`,
81
+ '',
82
+ '## Limitations',
83
+ `This report does not claim that a mock run performed live web research. Mock evidence proves artifact shape, gate behavior, and downstream consumability. Non-mock research has a higher bar: it must use Codex/GPT synthesis, preserve source ids, reject unsupported claims, and block if the model backend or source access is unavailable. The distinction keeps ${sourceIds[0]} style fixture evidence from being mistaken for public empirical evidence.`,
84
+ '',
85
+ `Another limitation is that density metrics are necessary but not sufficient. A report can cite many ids while still being vague, so the final reviewer must combine static metrics with semantic checks for blueprint concreteness and evidence-bound recommendations. The best closure is a bundle of checks: repeated prose fails, source-light prose fails, unsupported claims fail, and realistic complete packages pass because every section stays tied to ids, tests, and rollback logic.`,
86
+ '',
87
+ `Finally, this synthesis is designed to be inspected by release automation. A public-grade Research package should let a reviewer locate the writer, the density checks, the final reviewer decision, the handoff, and the release DAG node without relying on private memory. That is why the report names concrete artifacts and repeated verification commands instead of asking the reader to trust a natural-language conclusion.`,
88
+ '',
89
+ `The remaining uncertainty is deliberately narrow. Mock mode can prove that the artifact contract, blackbox rejection, and handoff shape work locally, but it cannot prove live source retrieval or live Codex/GPT availability. Non-mock mode must therefore block when the synthesis writer or final reviewer is unavailable. That blocker is an acceptable release outcome because it preserves the difference between fixture evidence and real behavior. The release is public-grade only when that distinction is visible in both artifacts and CLI output.`,
90
+ '',
91
+ '## References',
92
+ ...sourceIds.map((id) => `- ${id}: source-ledger row cited by the synthesis.`),
93
+ ...counterIds.map((id) => `- ${id}: counterevidence row used by falsification and limitations.`),
94
+ ''
95
+ ].join('\n\n');
96
+ }
97
+ export function buildRealisticResearchPaper(input) {
98
+ const claims = normalizeClaims(input.claims);
99
+ const sourceIds = normalizeIds(input.sourceIds).length ? normalizeIds(input.sourceIds) : fallbackIds('source', 14);
100
+ const counterIds = normalizeIds(input.counterevidenceIds).length ? normalizeIds(input.counterevidenceIds) : fallbackIds('counter', 2);
101
+ return [
102
+ `# Research Paper: ${input.plan?.prompt || 'Evidence-bound research synthesis'}`,
103
+ '',
104
+ '## Abstract',
105
+ `This manuscript summarizes an SKS Research package whose conclusion depends on cited source-ledger rows, claim-evidence matrix coverage, falsification cases, and final review. The principal claim, ${claims[0].id}, is supported by ${sourceIds.slice(0, 3).join(', ')} and bounded by ${counterIds[0]}.`,
106
+ '',
107
+ '## Introduction',
108
+ `Research reports can pass superficial readability checks while remaining weak evidence. This paper treats artifact completeness and citation density as reviewable runtime properties, using source ids ${sourceIds.slice(3, 7).join(', ')} and claims ${claims.slice(1, 4).map((claim) => claim.id).join(', ')} as the audit trail.`,
109
+ '',
110
+ '## Methodology',
111
+ 'The method executes source shards, merges a source ledger, builds a claim matrix, writes falsification cases, densifies an implementation blueprint, synthesizes a report, and performs static plus Codex/GPT final review before gate approval.',
112
+ '',
113
+ '## Findings/Results',
114
+ `The package passes only when realistic synthesis covers key claims, cites enough unique source ids, preserves counterevidence, and exposes implementation steps. Claims ${claims.slice(4, 8).map((claim) => claim.id).join(', ')} show the bridge from evidence to handoff.`,
115
+ '',
116
+ '## Discussion',
117
+ 'The important behavior is not the length of the report but the traceability of each recommendation. The paper therefore keeps source ids, claim ids, falsification cases, and blueprint files visible in the same evidence chain.',
118
+ '',
119
+ '## Limitations/Falsification',
120
+ `The conclusion fails if source ids such as ${sourceIds[0]} are absent, if counterevidence ids such as ${counterIds[0]} are omitted, if repeated paragraphs pass quality checks, or if non-mock synthesis falls back to a deterministic renderer.`,
121
+ '',
122
+ '## Conclusion/Next Experiment',
123
+ 'The next experiment is to run template rejection, synthesis writer blackbox, handoff consumability, final reviewer blackbox, and release DAG coverage gates together and compare their blocker sets.',
124
+ '',
125
+ '## References',
126
+ ...sourceIds.slice(0, 12).map((id) => `- [${id}] Source ledger row.`),
127
+ ...counterIds.map((id) => `- [${id}] Counterevidence row.`),
128
+ ''
129
+ ].join('\n');
130
+ }
131
+ export function requiredResearchReportHeadings() {
132
+ return [...REQUIRED_RESEARCH_REPORT_HEADINGS];
133
+ }
134
+ function normalizeClaims(claims) {
135
+ const rows = Array.isArray(claims) ? claims : [];
136
+ const normalized = rows.map((claim, index) => ({
137
+ id: String(claim?.id || `claim-${index + 1}`),
138
+ claim: String(claim?.claim || claim?.title || `Research claim ${index + 1} remains evidence-bound.`),
139
+ source_ids: normalizeIds(claim?.source_ids),
140
+ counterevidence_ids: normalizeIds(claim?.counterevidence_ids),
141
+ test_or_probe: String(claim?.test_or_probe || '')
142
+ })).filter((claim) => claim.id);
143
+ if (normalized.length >= 8)
144
+ return normalized;
145
+ return [
146
+ ...normalized,
147
+ ...Array.from({ length: 8 - normalized.length }, (_unused, index) => ({
148
+ id: `claim-${normalized.length + index + 1}`,
149
+ claim: `Research synthesis claim ${normalized.length + index + 1} must remain tied to source-ledger evidence and a validation probe.`,
150
+ source_ids: [],
151
+ counterevidence_ids: [],
152
+ test_or_probe: 'Run the matching research quality gate.'
153
+ }))
154
+ ];
155
+ }
156
+ function normalizeIds(value) {
157
+ return [...new Set((Array.isArray(value) ? value : value == null ? [] : [value]).map((item) => String(item || '').trim()).filter(Boolean))];
158
+ }
159
+ function fallbackIds(prefix, count) {
160
+ return Array.from({ length: count }, (_unused, index) => `${prefix}-${index + 1}`);
161
+ }
162
+ //# sourceMappingURL=research-realistic-report.js.map
@@ -0,0 +1,75 @@
1
+ export const RESEARCH_TEMPLATE_PHRASES = Object.freeze([
2
+ 'Runtime evidence note',
3
+ 'This paragraph exists to make report quality measurable',
4
+ 'deterministic fixture',
5
+ 'mock fixture',
6
+ 'summary-only baseline repeated note',
7
+ 'Research handoff detail for'
8
+ ]);
9
+ export function analyzeResearchRepetition(text) {
10
+ const body = String(text || '');
11
+ const paragraphs = body.split(/\n\s*\n/g).map((part) => part.trim()).filter(Boolean);
12
+ const paragraphKeys = paragraphs.filter(shouldAnalyzeParagraph).map(normalizeRepeatableText).filter(Boolean);
13
+ const uniqueParagraphs = new Set(paragraphKeys);
14
+ const paragraphCount = paragraphKeys.length;
15
+ const repeatedParagraphRatio = paragraphCount ? (paragraphCount - uniqueParagraphs.size) / paragraphCount : 0;
16
+ const sentences = body.split(/(?<=[.!?])\s+/g).map((part) => part.trim()).filter((part) => countWords(part) >= 6);
17
+ const sentenceKeys = sentences.map(normalizeRepeatableText).filter(Boolean);
18
+ const repeatedSentenceRatio = sentenceKeys.length ? (sentenceKeys.length - new Set(sentenceKeys).size) / sentenceKeys.length : 0;
19
+ const ngramRepetitionScore = repeatedNgramRatio(body, 5);
20
+ const lower = body.toLowerCase();
21
+ const templatePhraseHits = RESEARCH_TEMPLATE_PHRASES.filter((phrase) => lower.includes(phrase.toLowerCase()));
22
+ const blockers = [
23
+ ...(repeatedParagraphRatio > 0.18 ? ['research_report_repeated_paragraphs'] : []),
24
+ ...(templatePhraseHits.map((phrase) => `research_report_template_phrase_hit:${phrase}`)),
25
+ ...(ngramRepetitionScore > 0.32 ? ['research_report_ngram_repetition_high'] : [])
26
+ ];
27
+ return {
28
+ schema: 'sks.research-repetition-report.v1',
29
+ paragraph_count: paragraphCount,
30
+ unique_paragraph_count: uniqueParagraphs.size,
31
+ repeated_paragraph_ratio: round4(repeatedParagraphRatio),
32
+ repeated_sentence_ratio: round4(repeatedSentenceRatio),
33
+ ngram_repetition_score: round4(ngramRepetitionScore),
34
+ template_phrase_hits: templatePhraseHits,
35
+ blockers,
36
+ ok: blockers.length === 0
37
+ };
38
+ }
39
+ function repeatedNgramRatio(text, size) {
40
+ const words = String(text || '').toLowerCase().replace(/[^a-z0-9:_-]+/g, ' ').trim().split(/\s+/).filter(Boolean);
41
+ if (words.length < size * 2)
42
+ return 0;
43
+ const counts = new Map();
44
+ for (let index = 0; index <= words.length - size; index += 1) {
45
+ const gram = words.slice(index, index + size).join(' ');
46
+ counts.set(gram, (counts.get(gram) || 0) + 1);
47
+ }
48
+ const grams = [...counts.values()];
49
+ const repeated = grams.reduce((sum, count) => sum + Math.max(0, count - 1), 0);
50
+ return grams.length ? repeated / grams.length : 0;
51
+ }
52
+ function normalizeRepeatableText(value) {
53
+ return String(value || '')
54
+ .toLowerCase()
55
+ .replace(/\b(?:mock-source|shard-[a-z0-9_-]+|source|src|counter|mock-counter|claim|stage-claim|mock-claim)-[a-z0-9_.:-]+\b/g, '<id>')
56
+ .replace(/\b\d+(?:\.\d+)?\b/g, '<n>')
57
+ .replace(/[^a-z0-9<>]+/g, ' ')
58
+ .replace(/\s+/g, ' ')
59
+ .trim();
60
+ }
61
+ function shouldAnalyzeParagraph(value) {
62
+ const trimmed = String(value || '').trim();
63
+ if (countWords(trimmed) < 18)
64
+ return false;
65
+ if (/^-\s+(?:\[?[a-z0-9_.:-]+\]?[:\]])?/i.test(trimmed))
66
+ return false;
67
+ return true;
68
+ }
69
+ function countWords(value) {
70
+ return String(value || '').trim().split(/\s+/).filter(Boolean).length;
71
+ }
72
+ function round4(value) {
73
+ return Math.round(value * 10000) / 10000;
74
+ }
75
+ //# sourceMappingURL=research-repetition-detector.js.map
@@ -1,3 +1,4 @@
1
+ import { analyzeResearchRepetition } from './research-repetition-detector.js';
1
2
  export const REQUIRED_RESEARCH_REPORT_HEADINGS = [
2
3
  'Question',
3
4
  'Methodology',
@@ -21,20 +22,36 @@ export function analyzeResearchReportQuality(text) {
21
22
  const missingHeadings = REQUIRED_RESEARCH_REPORT_HEADINGS.filter((heading) => !headingsPresent.includes(heading));
22
23
  const implementationText = sectionText(body, 'Implementation Blueprint');
23
24
  const referencesText = sectionText(body, 'References');
24
- const referencesSourceIds = [...new Set([
25
- ...body.matchAll(/\b(?:source|src|mock-source|counter|mock-counter)-[A-Za-z0-9_.:-]+\b/g)
25
+ const sourceIdMentions = [...new Set([
26
+ ...body.matchAll(/\b(?:source|src|mock-source|shard-[A-Za-z0-9_-]+|counter|mock-counter)-[A-Za-z0-9_.:-]+\b/g)
26
27
  ].map((match) => match[0]))];
28
+ const claimIdMentions = [...new Set([
29
+ ...body.matchAll(/\b(?:claim|stage-claim|mock-claim)-[A-Za-z0-9_.:-]+\b/g)
30
+ ].map((match) => match[0]))];
31
+ const wordCount = countWords(body);
32
+ const sourceDensity = densityPer1000(sourceIdMentions.length, wordCount);
33
+ const claimDensity = densityPer1000(claimIdMentions.length, wordCount);
34
+ const repetition = analyzeResearchRepetition(body);
27
35
  const blockers = [
28
36
  ...missingHeadings.map((heading) => `research_report_heading_missing:${normalizeHeading(heading).replace(/\s+/g, '_')}`),
29
- ...(referencesSourceIds.length ? [] : ['research_report_references_missing_source_ids'])
37
+ ...(sourceIdMentions.length ? [] : ['research_report_references_missing_source_ids']),
38
+ ...(sourceDensity < 4 ? ['research_report_source_density_low'] : []),
39
+ ...(claimDensity < 2 ? ['research_report_claim_density_low'] : []),
40
+ ...repetition.blockers,
41
+ ...(countWords(implementationText) < 300 ? ['implementation_section_too_thin'] : [])
30
42
  ];
31
43
  return {
32
44
  schema: 'sks.research-report-quality.v1',
33
- word_count: countWords(body),
45
+ word_count: wordCount,
34
46
  headings_present: headingsPresent,
35
47
  missing_headings: missingHeadings,
36
48
  implementation_section_words: countWords(implementationText),
37
- references_source_ids: referencesText ? referencesSourceIds : [],
49
+ references_source_ids: referencesText ? sourceIdMentions : [],
50
+ source_id_mentions: sourceIdMentions,
51
+ claim_id_mentions: claimIdMentions,
52
+ source_density_per_1000_words: sourceDensity,
53
+ claim_density_per_1000_words: claimDensity,
54
+ repetition,
38
55
  blockers,
39
56
  ok: blockers.length === 0
40
57
  };
@@ -45,6 +62,11 @@ export function countWords(text) {
45
62
  function normalizeHeading(value) {
46
63
  return String(value || '').toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim();
47
64
  }
65
+ function densityPer1000(count, words) {
66
+ if (!words)
67
+ return 0;
68
+ return Math.round((count / Math.max(1, words / 1000)) * 10000) / 10000;
69
+ }
48
70
  function sectionText(text, heading) {
49
71
  const lines = String(text || '').split(/\r?\n/);
50
72
  const target = normalizeHeading(heading);
@@ -10,6 +10,7 @@ import { renderImplementationBlueprintMarkdown } from './implementation-blueprin
10
10
  import { readImplementationBlueprint, validateImplementationBlueprint, writeImplementationBlueprint } from './implementation-blueprint.js';
11
11
  import { writeResearchHandoffArtifacts } from './research-handoff.js';
12
12
  import { runResearchCodexFinalReviewer, runResearchFinalReviewer, runResearchStaticFinalReview } from './research-final-reviewer.js';
13
+ import { runResearchCodexSynthesisWriter, validateResearchSynthesisOutput } from './research-synthesis-writer.js';
13
14
  import { buildResearchSourceShardPrompt, defaultResearchSourceShardOutput, researchSourceLayerById, researchSourceShardOutputSchema, validateResearchSourceShardOutput } from './research-source-shards.js';
14
15
  import { mergeResearchSourceShards } from './research-source-ledger-merge.js';
15
16
  import { evaluateResearchGate, researchPaperArtifactForPlan, RESEARCH_AGENT_COUNCIL, RESEARCH_GENIUS_SUMMARY_ARTIFACT, researchAgentAgentName, RESEARCH_PAPER_SECTION_GROUPS } from '../research.js';
@@ -171,6 +172,7 @@ async function runExperimentPlanStage(input, startedAt) {
171
172
  async function runSynthesisStage(input, startedAt) {
172
173
  const claimMatrix = await readJson(path.join(input.dir, 'claim-evidence-matrix.json'), null);
173
174
  const sourceLedger = await readJson(path.join(input.dir, 'source-ledger.json'), null);
175
+ const contract = await readJson(path.join(input.dir, 'research-quality-contract.json'), null);
174
176
  const claims = Array.isArray(claimMatrix?.claims) ? claimMatrix.claims : [];
175
177
  const sourceIds = [
176
178
  ...(Array.isArray(sourceLedger?.sources) ? sourceLedger.sources : []),
@@ -196,9 +198,41 @@ async function runSynthesisStage(input, startedAt) {
196
198
  await writeJsonAtomic(path.join(input.dir, 'agent-ledger.json'), buildAgentLedger(input.plan, sourceIds));
197
199
  await writeJsonAtomic(path.join(input.dir, 'debate-ledger.json'), buildDebateLedger(sourceIds));
198
200
  await writeTextAtomic(path.join(input.dir, RESEARCH_GENIUS_SUMMARY_ARTIFACT), buildGeniusSummary(input.plan));
199
- await writeTextAtomic(path.join(input.dir, 'research-report.md'), buildResearchReport(input.plan, claims, sourceIds));
200
- await writeTextAtomic(path.join(input.dir, researchPaperArtifactForPlan(input.plan)), buildResearchPaper(input.plan, sourceIds));
201
- return baseResult(input, startedAt, 'synthesis', 'passed', ['research-report.md', researchPaperArtifactForPlan(input.plan), RESEARCH_GENIUS_SUMMARY_ARTIFACT, 'agent-ledger.json', 'debate-ledger.json', 'novelty-ledger.json'], [], { claims: claims.length, sources: sourceIds.length });
201
+ if (input.mock || input.backend === 'mock' || input.backend === 'deterministic') {
202
+ return runDeterministicMockSynthesisStage(input, startedAt, { claimMatrix, sourceLedger, contract, claims, sourceIds });
203
+ }
204
+ const synthesis = await runResearchCodexSynthesisWriter({
205
+ root: input.root,
206
+ dir: input.dir,
207
+ plan: input.plan,
208
+ cycle: input.cycle,
209
+ timeoutMs: input.timeoutMs,
210
+ backendPreference: input.backend === 'python-codex-sdk' ? ['python-codex-sdk', 'codex-sdk'] : ['codex-sdk', 'python-codex-sdk']
211
+ });
212
+ const validation = validateResearchSynthesisOutput(synthesis, contract, claimMatrix, sourceLedger);
213
+ return synthesisStageResult(input, startedAt, synthesis, validation, 'codex');
214
+ }
215
+ async function runDeterministicMockSynthesisStage(input, startedAt, artifacts) {
216
+ const synthesis = await runResearchCodexSynthesisWriter({
217
+ root: input.root,
218
+ dir: input.dir,
219
+ plan: { ...input.plan, backend: input.backend },
220
+ cycle: input.cycle,
221
+ timeoutMs: input.timeoutMs,
222
+ mock: true
223
+ });
224
+ const validation = validateResearchSynthesisOutput(synthesis, artifacts.contract, artifacts.claimMatrix, artifacts.sourceLedger);
225
+ return synthesisStageResult(input, startedAt, synthesis, validation, input.backend === 'deterministic' ? 'deterministic' : 'mock');
226
+ }
227
+ function synthesisStageResult(input, startedAt, synthesis, validation, writer) {
228
+ const artifacts = ['research-synthesis-output.json', 'research-report.md', researchPaperArtifactForPlan(input.plan), RESEARCH_GENIUS_SUMMARY_ARTIFACT, 'agent-ledger.json', 'debate-ledger.json', 'novelty-ledger.json'];
229
+ const blockers = [...new Set([...(validation.blockers || []), ...(synthesis.blockers || [])])];
230
+ return baseResult(input, startedAt, 'synthesis', validation.ok && blockers.length === 0 ? 'passed' : 'blocked', artifacts, blockers, {
231
+ synthesis_writer: writer === 'codex' ? 'codex-sdk' : writer,
232
+ claims: synthesis.synthesis_summary.key_claim_ids.length,
233
+ sources: synthesis.synthesis_summary.source_ids_used.length,
234
+ ...synthesis.quality_signals
235
+ });
202
236
  }
203
237
  async function runFinalReviewStage(input, startedAt) {
204
238
  const staticReview = await runResearchStaticFinalReview(input.dir, { plan: input.plan });
@@ -431,13 +465,7 @@ function buildGeniusSummary(plan) {
431
465
  ])
432
466
  ].join('\n');
433
467
  }
434
- function buildResearchReport(plan, claims, sourceIds) {
435
- const paragraphs = Array.from({ length: 72 }, (_unused, index) => {
436
- const claim = claims[index % Math.max(1, claims.length)] || { id: `claim-${index + 1}`, claim: 'stage-aware research runtime evidence is required' };
437
- const sourceA = sourceIds[index % Math.max(1, sourceIds.length)] || 'source-ledger';
438
- const sourceB = sourceIds[(index + 1) % Math.max(1, sourceIds.length)] || 'claim-evidence-matrix';
439
- return `Runtime evidence note ${index + 1}: ${claim.id} is evaluated as a falsifiable claim, not as narrative filler. The synthesis cites ${sourceA} and ${sourceB}, checks counterevidence where available, and keeps implementation guidance in the blueprint rather than mutating source files during Research. This paragraph exists to make report quality measurable while still tying every repeated claim back to source-ledger ids and stage artifacts.`;
440
- });
468
+ function buildDeterministicMockResearchReport(plan, claims, sourceIds) {
441
469
  return [
442
470
  '# SKS Research Report',
443
471
  '',
@@ -475,11 +503,10 @@ function buildResearchReport(plan, claims, sourceIds) {
475
503
  '',
476
504
  '## References',
477
505
  ...sourceIds.map((id) => `- ${id}`),
478
- '',
479
- ...paragraphs
506
+ ''
480
507
  ].join('\n\n') + '\n';
481
508
  }
482
- function buildResearchPaper(plan, sourceIds) {
509
+ function buildDeterministicMockResearchPaper(plan, sourceIds) {
483
510
  return [
484
511
  `# Research Paper: ${plan?.prompt || 'Stage-aware research runtime'}`,
485
512
  '',
@@ -0,0 +1,52 @@
1
+ export function buildResearchSynthesisPrompt(input) {
2
+ return [
3
+ 'You are writing the final SKS Research synthesis.',
4
+ 'Do not write a short summary.',
5
+ 'Do not pad with repeated paragraphs.',
6
+ 'Every key claim must cite source-ledger ids.',
7
+ 'Every recommendation must point to implementation-blueprint sections.',
8
+ 'Every limitation must point to falsification-ledger cases or source blockers.',
9
+ 'Return JSON only matching sks.research-synthesis-output.v1.',
10
+ 'Do not modify repository source.',
11
+ 'If evidence is insufficient, return blockers rather than confident prose.',
12
+ '',
13
+ `Mission: ${input.plan?.mission_id || 'unknown'}`,
14
+ `Cycle: ${input.cycle}`,
15
+ `Prompt: ${input.plan?.prompt || ''}`,
16
+ '',
17
+ 'Compact evidence pack:',
18
+ JSON.stringify(compactEvidencePack(input), null, 2).slice(0, 24000)
19
+ ].join('\n');
20
+ }
21
+ function compactEvidencePack(input) {
22
+ const sourceRows = [
23
+ ...(Array.isArray(input.sourceLedger?.sources) ? input.sourceLedger.sources : []),
24
+ ...(Array.isArray(input.sourceLedger?.counterevidence_sources) ? input.sourceLedger.counterevidence_sources : [])
25
+ ];
26
+ return {
27
+ source_ids: sourceRows.map((source) => ({
28
+ id: source.id,
29
+ layer: source.layer,
30
+ title: source.title,
31
+ stance: source.stance,
32
+ claim_ids: source.claim_ids || []
33
+ })),
34
+ key_claims: (Array.isArray(input.claimMatrix?.claims) ? input.claimMatrix.claims : []).map((claim) => ({
35
+ id: claim.id,
36
+ claim: claim.claim,
37
+ source_ids: claim.source_ids || [],
38
+ counterevidence_ids: claim.counterevidence_ids || [],
39
+ test_or_probe: claim.test_or_probe || ''
40
+ })),
41
+ falsification_cases: Array.isArray(input.falsificationLedger?.cases) ? input.falsificationLedger.cases : [],
42
+ blueprint_sections: (Array.isArray(input.implementationBlueprint?.sections) ? input.implementationBlueprint.sections : []).map((section) => ({
43
+ id: section.id,
44
+ title: section.title,
45
+ target_paths: section.target_paths || [],
46
+ acceptance_checks: section.acceptance_checks || []
47
+ })),
48
+ experiment_steps: Array.isArray(input.experimentPlan?.steps) ? input.experimentPlan.steps : [],
49
+ replication_commands: Array.isArray(input.replicationPack?.commands) ? input.replicationPack.commands : []
50
+ };
51
+ }
52
+ //# sourceMappingURL=research-synthesis-prompt.js.map