@gajae-code/coding-agent 0.14.2 → 0.15.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 (345) hide show
  1. package/CHANGELOG.md +120 -1
  2. package/dist/types/async/job-manager.d.ts +4 -1
  3. package/dist/types/autoresearch/dashboard.d.ts +29 -4
  4. package/dist/types/autoresearch/data-context.d.ts +25 -0
  5. package/dist/types/autoresearch/git.d.ts +65 -7
  6. package/dist/types/autoresearch/harness.d.ts +58 -0
  7. package/dist/types/autoresearch/prompts.d.ts +51 -0
  8. package/dist/types/autoresearch/runs.d.ts +173 -0
  9. package/dist/types/autoresearch/types.d.ts +9 -139
  10. package/dist/types/capability/types.d.ts +20 -0
  11. package/dist/types/cli/accounts-cli.d.ts +1 -0
  12. package/dist/types/commands/{rlm.d.ts → autoresearch.d.ts} +2 -4
  13. package/dist/types/config/autorouting-contract.d.ts +146 -0
  14. package/dist/types/config/autorouting-generator.d.ts +40 -0
  15. package/dist/types/config/autorouting-tier-map.d.ts +16844 -0
  16. package/dist/types/config/autorouting.d.ts +35 -0
  17. package/dist/types/config/model-discovery-manager.d.ts +8 -1
  18. package/dist/types/config/model-registry.d.ts +30 -1
  19. package/dist/types/config/provider-selection-policy.d.ts +23 -0
  20. package/dist/types/config/settings-schema.d.ts +61 -3
  21. package/dist/types/config/settings.d.ts +3 -0
  22. package/dist/types/coordinator/contract.d.ts +1 -1
  23. package/dist/types/coordinator-mcp/durability.d.ts +29 -0
  24. package/dist/types/coordinator-mcp/event-webhook.d.ts +50 -0
  25. package/dist/types/coordinator-mcp/question-state.d.ts +1 -1
  26. package/dist/types/coordinator-mcp/server.d.ts +14 -0
  27. package/dist/types/crash/index-store.d.ts +3 -0
  28. package/dist/types/crash/record-loader.d.ts +2 -0
  29. package/dist/types/crash/upstream/relay.d.ts +5 -3
  30. package/dist/types/cursor.d.ts +12 -0
  31. package/dist/types/defaults/gjc-defaults.d.ts +35 -1
  32. package/dist/types/defaults/gjc-skills.generated.d.ts +1 -1
  33. package/dist/types/discovery/helpers.d.ts +1 -1
  34. package/dist/types/edit/index.d.ts +2 -1
  35. package/dist/types/eval/py/executor.d.ts +2 -0
  36. package/dist/types/extensibility/extensions/loader.d.ts +32 -0
  37. package/dist/types/extensibility/gjc-plugins/types.d.ts +1 -1
  38. package/dist/types/extensibility/skills.d.ts +2 -0
  39. package/dist/types/gjc-runtime/autoresearch-runtime.d.ts +194 -0
  40. package/dist/types/gjc-runtime/gc-runtime.d.ts +1 -1
  41. package/dist/types/gjc-runtime/psmux-detect.d.ts +1 -1
  42. package/dist/types/gjc-runtime/python-transcript.d.ts +19 -0
  43. package/dist/types/gjc-runtime/ralplan-runtime.d.ts +2 -8
  44. package/dist/types/gjc-runtime/session-layout.d.ts +6 -3
  45. package/dist/types/gjc-runtime/state-renderer.d.ts +0 -22
  46. package/dist/types/gjc-runtime/state-schema.d.ts +7 -7
  47. package/dist/types/gjc-runtime/tmux-common.d.ts +2 -2
  48. package/dist/types/gjc-runtime/ultragoal-change-set.d.ts +38 -1
  49. package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +2 -24
  50. package/dist/types/gjc-runtime/ultragoal-validation-policy.d.ts +73 -0
  51. package/dist/types/gjc-runtime/workflow-recovery-projection.d.ts +100 -0
  52. package/dist/types/hooks/skill-keywords.d.ts +1 -1
  53. package/dist/types/main.d.ts +0 -10
  54. package/dist/types/modes/acp/acp-agent.d.ts +13 -6
  55. package/dist/types/modes/components/model-selector.d.ts +14 -0
  56. package/dist/types/modes/components/skill-hud/render.d.ts +6 -1
  57. package/dist/types/modes/components/smart-routing-panel.d.ts +82 -0
  58. package/dist/types/modes/controllers/selector-controller.d.ts +14 -0
  59. package/dist/types/modes/interactive-mode.d.ts +3 -0
  60. package/dist/types/modes/types.d.ts +9 -0
  61. package/dist/types/rlm/artifacts.d.ts +4 -4
  62. package/dist/types/runtime/optional-runtime-services.d.ts +2 -1
  63. package/dist/types/runtime/workspace-tree-service.d.ts +5 -1
  64. package/dist/types/runtime-mcp/config.d.ts +6 -0
  65. package/dist/types/runtime-mcp/manager.d.ts +10 -0
  66. package/dist/types/sdk/acp/adapter.d.ts +0 -4
  67. package/dist/types/sdk/broker/broker.d.ts +1 -1
  68. package/dist/types/sdk/broker/lifecycle.d.ts +57 -2
  69. package/dist/types/sdk/broker/session-index.d.ts +15 -0
  70. package/dist/types/sdk/bus/chat-daemon-control.d.ts +6 -0
  71. package/dist/types/sdk/bus/chat-daemon-runtime.d.ts +4 -0
  72. package/dist/types/sdk/bus/index.d.ts +8 -0
  73. package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +2 -0
  74. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +12 -2
  75. package/dist/types/sdk/client/client.d.ts +39 -4
  76. package/dist/types/sdk/host/host.d.ts +1 -0
  77. package/dist/types/sdk/host/internal-autorouting-state.d.ts +3 -0
  78. package/dist/types/sdk/host/model-pin.d.ts +29 -0
  79. package/dist/types/sdk/host/session-runtime.d.ts +2 -1
  80. package/dist/types/sdk/lifecycle-session.d.ts +13 -0
  81. package/dist/types/sdk/router/session-router.d.ts +27 -1
  82. package/dist/types/sdk/session.d.ts +11 -1
  83. package/dist/types/session/agent-session.d.ts +36 -6
  84. package/dist/types/session/artifacts.d.ts +16 -1
  85. package/dist/types/session/internal/managed-session-storage.d.ts +7 -0
  86. package/dist/types/session/session-manager.d.ts +84 -2
  87. package/dist/types/session/session-staging-paths.d.ts +3 -0
  88. package/dist/types/skill-state/canonical-skills.d.ts +1 -1
  89. package/dist/types/skill-state/workflow-hud.d.ts +12 -21
  90. package/dist/types/skill-state/workflow-mutation-guard.d.ts +1 -0
  91. package/dist/types/slash-commands/helpers/autorouting-status.d.ts +8 -0
  92. package/dist/types/system-prompt.d.ts +23 -0
  93. package/dist/types/task/executor.d.ts +35 -4
  94. package/dist/types/task/index.d.ts +17 -3
  95. package/dist/types/task/receipt.d.ts +3 -1
  96. package/dist/types/task/types.d.ts +144 -0
  97. package/dist/types/tools/atomic-file-write.d.ts +72 -0
  98. package/dist/types/tools/descriptors.d.ts +1 -0
  99. package/dist/types/tools/index.d.ts +36 -1
  100. package/dist/types/tools/move-session.d.ts +40 -0
  101. package/dist/types/tools/python.d.ts +12 -0
  102. package/dist/types/tools/resource-gc.d.ts +0 -3
  103. package/dist/types/tools/search.d.ts +8 -1
  104. package/dist/types/tools/skill.d.ts +9 -4
  105. package/dist/types/tools/subagent.d.ts +33 -3
  106. package/dist/types/utils/xml-escape.d.ts +2 -0
  107. package/dist/types/workflow/workflow-intent-diff.d.ts +2 -2
  108. package/dist/types/workflow/workflow-intent-report-consumer.d.ts +1 -1
  109. package/package.json +11 -12
  110. package/scripts/build-sdk-package-smoke.ts +7 -5
  111. package/scripts/check-autorouting-tier-map.ts +183 -0
  112. package/scripts/generate-sdk-operation-inventory.ts +12 -0
  113. package/scripts/generate-tool-catalog.ts +40 -5
  114. package/src/async/job-manager.ts +5 -2
  115. package/src/autoresearch/dashboard.ts +134 -314
  116. package/src/autoresearch/data-context.ts +35 -0
  117. package/src/autoresearch/git.ts +186 -26
  118. package/src/autoresearch/{helpers.ts → harness.ts} +65 -40
  119. package/src/autoresearch/{prompt-setup.md → prompts/prompt-setup.md} +7 -7
  120. package/src/autoresearch/prompts/prompt.md +103 -0
  121. package/src/autoresearch/prompts.ts +126 -0
  122. package/src/autoresearch/runs.ts +708 -0
  123. package/src/autoresearch/types.ts +9 -150
  124. package/src/capability/index.ts +4 -4
  125. package/src/capability/types.ts +20 -0
  126. package/src/cli/accounts-cli.ts +21 -5
  127. package/src/cli/config-cli.ts +25 -1
  128. package/src/cli/fast-help.ts +1 -2
  129. package/src/cli/list-models.ts +5 -8
  130. package/src/cli/setup-cli.ts +8 -0
  131. package/src/cli.ts +2 -21
  132. package/src/commands/autoresearch.ts +33 -0
  133. package/src/commands/coordinator.ts +15 -0
  134. package/src/commands/launch.ts +2 -4
  135. package/src/commands/quick-lane.ts +1 -1
  136. package/src/commands/sdk.ts +24 -0
  137. package/src/commands/state.ts +1 -1
  138. package/src/config/autorouting-contract.ts +474 -0
  139. package/src/config/autorouting-generator.ts +238 -0
  140. package/src/config/autorouting-tier-map.ts +6108 -0
  141. package/src/config/autorouting.ts +120 -0
  142. package/src/config/model-discovery-manager.ts +42 -11
  143. package/src/config/model-registry.ts +348 -68
  144. package/src/config/provider-selection-policy.ts +60 -9
  145. package/src/config/settings-schema.ts +195 -6
  146. package/src/config/settings.ts +62 -1
  147. package/src/config.ts +2 -3
  148. package/src/coordinator/contract.ts +0 -1
  149. package/src/coordinator-mcp/codex-handoff.ts +68 -42
  150. package/src/coordinator-mcp/durability.ts +200 -0
  151. package/src/coordinator-mcp/event-webhook.ts +278 -0
  152. package/src/coordinator-mcp/question-state.ts +109 -46
  153. package/src/coordinator-mcp/server.ts +932 -504
  154. package/src/crash/index-store.ts +126 -22
  155. package/src/crash/record-loader.ts +7 -0
  156. package/src/crash/upstream/relay.ts +82 -34
  157. package/src/cursor.ts +84 -1
  158. package/src/debug/index.ts +26 -0
  159. package/src/defaults/gjc/skills/autoresearch/SKILL.md +116 -0
  160. package/src/defaults/gjc/skills/autoresearch/auto-critic.md +46 -0
  161. package/src/defaults/gjc/skills/autoresearch/auto-iterate.md +42 -0
  162. package/src/defaults/gjc/skills/deep-interview/SKILL.md +17 -37
  163. package/src/defaults/gjc/skills/ralplan/SKILL.md +21 -18
  164. package/src/defaults/gjc/skills/ultragoal/SKILL.md +6 -17
  165. package/src/defaults/gjc/skills/ultragoal/ai-slop-cleaner.md +2 -2
  166. package/src/defaults/gjc-defaults.ts +89 -2
  167. package/src/defaults/gjc-skills.generated.ts +24 -17
  168. package/src/discovery/builtin.ts +18 -5
  169. package/src/discovery/helpers.ts +6 -6
  170. package/src/edit/index.ts +5 -2
  171. package/src/eval/py/executor.ts +8 -0
  172. package/src/extensibility/extensions/loader.ts +135 -13
  173. package/src/extensibility/extensions/wrapper.ts +1 -2
  174. package/src/extensibility/gjc-plugins/schema.ts +1 -1
  175. package/src/extensibility/runtime-skill-discovery.ts +2 -2
  176. package/src/extensibility/skill-management.ts +2 -3
  177. package/src/extensibility/skills.ts +16 -8
  178. package/src/gjc-runtime/autoresearch-runtime.ts +1509 -0
  179. package/src/gjc-runtime/gc-render.ts +0 -1
  180. package/src/gjc-runtime/gc-runtime.ts +1 -11
  181. package/src/gjc-runtime/launch-tmux.ts +3 -3
  182. package/src/gjc-runtime/psmux-detect.ts +2 -2
  183. package/src/gjc-runtime/python-transcript.ts +58 -0
  184. package/src/gjc-runtime/ralplan-runtime.ts +6 -18
  185. package/src/gjc-runtime/session-layout.ts +18 -7
  186. package/src/gjc-runtime/session-state-sidecar.ts +58 -9
  187. package/src/gjc-runtime/state-renderer.ts +0 -38
  188. package/src/gjc-runtime/state-runtime.ts +43 -22
  189. package/src/gjc-runtime/state-schema.ts +1 -1
  190. package/src/gjc-runtime/tmux-common.ts +7 -7
  191. package/src/gjc-runtime/ultragoal-change-set.ts +232 -11
  192. package/src/gjc-runtime/ultragoal-runtime.ts +309 -114
  193. package/src/gjc-runtime/ultragoal-validation-policy.ts +247 -0
  194. package/src/gjc-runtime/workflow-command-ref.ts +15 -11
  195. package/src/gjc-runtime/workflow-manifest.generated.json +413 -532
  196. package/src/gjc-runtime/workflow-manifest.ts +43 -83
  197. package/src/gjc-runtime/workflow-recovery-projection.ts +616 -0
  198. package/src/hooks/skill-keywords.ts +3 -3
  199. package/src/hooks/skill-state.ts +2 -2
  200. package/src/internal-urls/docs-index.generated.ts +26 -24
  201. package/src/lsp/index.ts +25 -5
  202. package/src/main.ts +2 -27
  203. package/src/modes/acp/acp-agent.ts +200 -75
  204. package/src/modes/components/model-selector.ts +216 -13
  205. package/src/modes/components/oauth-selector.ts +5 -5
  206. package/src/modes/components/skill-hud/render.ts +173 -35
  207. package/src/modes/components/smart-routing-panel.ts +531 -0
  208. package/src/modes/components/tool-status-header.ts +6 -3
  209. package/src/modes/controllers/command-controller.ts +17 -7
  210. package/src/modes/controllers/input-controller.ts +44 -9
  211. package/src/modes/controllers/runtime-mcp-command-controller.ts +4 -0
  212. package/src/modes/controllers/selector-controller.ts +298 -65
  213. package/src/modes/interactive-mode.ts +8 -1
  214. package/src/modes/shared/agent-wire/workflow-gate-types.ts +1 -1
  215. package/src/modes/types.ts +9 -1
  216. package/src/prompts/agents/planner.md +1 -1
  217. package/src/prompts/system/system-prompt.md +1 -1
  218. package/src/prompts/system/volatile-project-context.md +2 -1
  219. package/src/prompts/tools/move-session.md +15 -0
  220. package/src/prompts/tools/python.md +12 -0
  221. package/src/prompts/tools/skill-discovery.md +1 -1
  222. package/src/prompts/tools/skill.md +2 -2
  223. package/src/prompts/tools/task-summary.md +1 -0
  224. package/src/prompts/tools/task.md +6 -0
  225. package/src/rlm/artifacts.ts +12 -10
  226. package/src/runtime/optional-runtime-services.ts +3 -2
  227. package/src/runtime/workspace-tree-service.ts +11 -3
  228. package/src/runtime-mcp/config.ts +8 -1
  229. package/src/runtime-mcp/manager.ts +33 -0
  230. package/src/sdk/acp/adapter.ts +48 -1
  231. package/src/sdk/broker/broker.ts +30 -2
  232. package/src/sdk/broker/discovery.ts +217 -2
  233. package/src/sdk/broker/lifecycle.ts +385 -59
  234. package/src/sdk/broker/session-index.ts +243 -48
  235. package/src/sdk/broker/transport.ts +1 -0
  236. package/src/sdk/bus/chat-daemon-control.ts +8 -2
  237. package/src/sdk/bus/chat-daemon-runtime.ts +5 -0
  238. package/src/sdk/bus/index.ts +208 -11
  239. package/src/sdk/bus/kind-aware-reconciliation.ts +16 -0
  240. package/src/sdk/bus/reconciliation-store.ts +27 -5
  241. package/src/sdk/bus/telegram-daemon-contract.ts +12 -2
  242. package/src/sdk/client/client.ts +204 -22
  243. package/src/sdk/host/host.ts +16 -0
  244. package/src/sdk/host/internal-autorouting-state.ts +13 -0
  245. package/src/sdk/host/model-pin.ts +101 -0
  246. package/src/sdk/host/reverse-leases.ts +2 -1
  247. package/src/sdk/host/session-runtime.test.ts +224 -1
  248. package/src/sdk/host/session-runtime.ts +125 -37
  249. package/src/sdk/lifecycle/service.ts +3 -1
  250. package/src/sdk/lifecycle-session.ts +42 -1
  251. package/src/sdk/protocol/operation-inventory.generated.json +66 -0
  252. package/src/sdk/router/session-router.ts +375 -36
  253. package/src/sdk/session.ts +547 -47
  254. package/src/session/account-inventory.ts +1 -1
  255. package/src/session/agent-session.ts +765 -189
  256. package/src/session/artifacts.ts +234 -4
  257. package/src/session/internal/managed-session-storage.ts +91 -4
  258. package/src/session/provider-safety-stop-hint.ts +3 -2
  259. package/src/session/session-manager.ts +775 -16
  260. package/src/session/session-staging-paths.ts +8 -0
  261. package/src/setup/hermes/templates/operator-instructions.v1.md +0 -1
  262. package/src/setup/host-plugin-setup.ts +2 -2
  263. package/src/skill-state/active-state.ts +2 -2
  264. package/src/skill-state/canonical-skills.ts +1 -1
  265. package/src/skill-state/initial-phase.ts +1 -1
  266. package/src/skill-state/workflow-hud.ts +41 -41
  267. package/src/skill-state/workflow-mutation-guard.ts +26 -7
  268. package/src/slash-commands/builtin-registry.ts +77 -0
  269. package/src/slash-commands/helpers/autorouting-status.ts +55 -0
  270. package/src/system-prompt.ts +102 -5
  271. package/src/task/discovery.ts +2 -3
  272. package/src/task/executor.ts +617 -43
  273. package/src/task/index.ts +262 -15
  274. package/src/task/receipt.ts +30 -0
  275. package/src/task/render.ts +11 -1
  276. package/src/task/types.ts +316 -0
  277. package/src/tools/atomic-file-write.ts +594 -0
  278. package/src/tools/bisect.ts +3 -2
  279. package/src/tools/descriptors.test.ts +3 -0
  280. package/src/tools/descriptors.ts +24 -0
  281. package/src/tools/image-gen.ts +5 -1
  282. package/src/tools/index.ts +62 -5
  283. package/src/tools/move-session.ts +107 -0
  284. package/src/tools/python.ts +205 -0
  285. package/src/tools/read.ts +88 -15
  286. package/src/tools/renderers.ts +2 -0
  287. package/src/tools/resource-gc.ts +8 -177
  288. package/src/tools/search.ts +30 -6
  289. package/src/tools/skill-discovery.ts +1 -0
  290. package/src/tools/skill.ts +37 -7
  291. package/src/tools/subagent-render.ts +119 -13
  292. package/src/tools/subagent.ts +91 -74
  293. package/src/tools/tool-catalog.generated.ts +64 -2
  294. package/src/tools/write.ts +16 -12
  295. package/src/utils/xml-escape.ts +14 -0
  296. package/src/web/search/providers/codex.ts +2 -2
  297. package/src/workflow/workflow-intent-diff.ts +13 -12
  298. package/src/workflow/workflow-intent-report-consumer.ts +6 -6
  299. package/dist/types/autoresearch/helpers.d.ts +0 -24
  300. package/dist/types/autoresearch/index.d.ts +0 -2
  301. package/dist/types/autoresearch/state.d.ts +0 -17
  302. package/dist/types/autoresearch/storage.d.ts +0 -142
  303. package/dist/types/autoresearch/tools/init-experiment.d.ts +0 -31
  304. package/dist/types/autoresearch/tools/log-experiment.d.ts +0 -23
  305. package/dist/types/autoresearch/tools/run-experiment.d.ts +0 -8
  306. package/dist/types/autoresearch/tools/update-notes.d.ts +0 -12
  307. package/dist/types/commands/team.d.ts +0 -24
  308. package/dist/types/gjc-runtime/team-gc.d.ts +0 -7
  309. package/dist/types/gjc-runtime/team-launch.d.ts +0 -61
  310. package/dist/types/gjc-runtime/team-notify.d.ts +0 -45
  311. package/dist/types/gjc-runtime/team-runtime.d.ts +0 -336
  312. package/dist/types/gjc-runtime/team-store.d.ts +0 -168
  313. package/dist/types/gjc-runtime/team-worker-heartbeat.d.ts +0 -43
  314. package/dist/types/gjc-runtime/team-worker-memory-guard.d.ts +0 -92
  315. package/dist/types/gjc-runtime/team-workers.d.ts +0 -83
  316. package/dist/types/rlm/index.d.ts +0 -47
  317. package/dist/types/rlm/preset.d.ts +0 -23
  318. package/dist/types/rlm/python-tool.d.ts +0 -16
  319. package/src/autoresearch/command-resume.md +0 -14
  320. package/src/autoresearch/index.ts +0 -536
  321. package/src/autoresearch/prompt.md +0 -103
  322. package/src/autoresearch/resume-message.md +0 -10
  323. package/src/autoresearch/state.ts +0 -273
  324. package/src/autoresearch/storage.ts +0 -699
  325. package/src/autoresearch/tools/init-experiment.ts +0 -272
  326. package/src/autoresearch/tools/log-experiment.ts +0 -524
  327. package/src/autoresearch/tools/run-experiment.ts +0 -475
  328. package/src/autoresearch/tools/update-notes.ts +0 -109
  329. package/src/commands/rlm.ts +0 -19
  330. package/src/commands/team.ts +0 -238
  331. package/src/defaults/gjc/skills/deep-interview/auto-research-greenfield.md +0 -42
  332. package/src/defaults/gjc/skills/team/SKILL.md +0 -467
  333. package/src/gjc-runtime/team-gc.ts +0 -49
  334. package/src/gjc-runtime/team-launch.ts +0 -404
  335. package/src/gjc-runtime/team-notify.ts +0 -326
  336. package/src/gjc-runtime/team-runtime.ts +0 -5923
  337. package/src/gjc-runtime/team-store.ts +0 -878
  338. package/src/gjc-runtime/team-worker-heartbeat.ts +0 -149
  339. package/src/gjc-runtime/team-worker-memory-guard.ts +0 -363
  340. package/src/gjc-runtime/team-workers.ts +0 -1123
  341. package/src/prompts/system/rlm-report-command.md +0 -1
  342. package/src/prompts/system/rlm-research.md +0 -23
  343. package/src/rlm/index.ts +0 -365
  344. package/src/rlm/preset.ts +0 -76
  345. package/src/rlm/python-tool.ts +0 -68
@@ -53,6 +53,8 @@ export declare function loadSkillsFromDir(options: LoadSkillsFromDirOptions): Pr
53
53
  export interface LoadSkillsOptions extends SkillsSettings {
54
54
  /** Working directory for project-local skills. Default: getProjectDir() */
55
55
  cwd?: string;
56
+ /** Explicit user home for skill discovery. Default: getTrustedHomeDir(). */
57
+ home?: string;
56
58
  }
57
59
  /**
58
60
  * Load skills from all configured locations.
@@ -0,0 +1,194 @@
1
+ import { type RlmDataContext } from "../autoresearch/data-context";
2
+ import { type EnsureAutoresearchBranchResult } from "../autoresearch/git";
3
+ import { type ParsedHarnessOutput } from "../autoresearch/harness";
4
+ import { AutoresearchRunsStore, type MetricDirection } from "../autoresearch/runs";
5
+ export type AutoresearchMode = "web" | "mixed" | "data";
6
+ export type AutoresearchIntakeKind = "handoff" | "cold";
7
+ export declare const AUTORESEARCH_MODES: Set<AutoresearchMode>;
8
+ export declare const AUTORESEARCH_LEDGER_EVENT_KINDS: readonly ["mission_created", "mode_set", "run_logged", "verdict_issued", "critic_recorded", "mission_cleared"];
9
+ export type AutoresearchLedgerEventKind = (typeof AUTORESEARCH_LEDGER_EVENT_KINDS)[number];
10
+ /** The one mission artifact both intake entrypoints write. */
11
+ export interface AutoresearchMission {
12
+ objective: string;
13
+ mode: AutoresearchMode;
14
+ deliverables: string[];
15
+ constraints: string[];
16
+ slug: string;
17
+ intake: AutoresearchIntakeKind;
18
+ createdAt: string;
19
+ updatedAt: string;
20
+ /** Absolute path of the deep-interview spec consumed by spec intake. */
21
+ specPath?: string;
22
+ handedOffAt?: string;
23
+ /**
24
+ * Primary metric contract for the mission's harness.
25
+ *
26
+ * Optional: a mission that declares none keeps the historical default
27
+ * (`metric`, lower-is-better). When declared it MUST reach the experiment
28
+ * config -- otherwise a mission whose research contract is
29
+ * higher-is-better silently optimizes the wrong direction.
30
+ */
31
+ primaryMetric?: string;
32
+ metricUnit?: string;
33
+ metricDirection?: MetricDirection;
34
+ }
35
+ export interface AutoresearchPaths {
36
+ dir: string;
37
+ missionPath: string;
38
+ ledgerPath: string;
39
+ /** Quarantine root for retired missions: `<dir>/retired/<slug>.<timestamp>/`. */
40
+ retiredRoot: string;
41
+ }
42
+ /** Append-only session ledger row. */
43
+ export interface AutoresearchLedgerEvent {
44
+ eventId: string;
45
+ event: AutoresearchLedgerEventKind;
46
+ timestamp: string;
47
+ [field: string]: unknown;
48
+ }
49
+ /** Optional per-mission critic pass receipt; evaluator is distinct from the mission agent. */
50
+ export interface AutoresearchCriticReceipt {
51
+ criticId: string;
52
+ status: Record<string, unknown>;
53
+ evidence: string[];
54
+ caveats: string[];
55
+ evaluator: string;
56
+ recordedAt: string;
57
+ }
58
+ /** Structured mission verdict: status is open data, not a pinned enum — terminality is deliberately deferred. */
59
+ export interface AutoresearchVerdictReceipt {
60
+ receiptId: string;
61
+ status: Record<string, unknown>;
62
+ evidence: string[];
63
+ caveats: string[];
64
+ evaluator: string;
65
+ issuedAt: string;
66
+ criticReceipt?: AutoresearchCriticReceipt;
67
+ }
68
+ export interface AutoresearchCommandResult {
69
+ status: number;
70
+ stdout?: string;
71
+ stderr?: string;
72
+ intake?: AutoresearchIntakeKind;
73
+ missionCreated?: boolean;
74
+ }
75
+ export interface AutoresearchReadReceipt {
76
+ ok: true;
77
+ exists: boolean;
78
+ mission?: AutoresearchMission;
79
+ ledger: AutoresearchLedgerEvent[];
80
+ paths: AutoresearchPaths;
81
+ /**
82
+ * GJC session id the mission state was read from. Callers deriving
83
+ * session-scoped identity (notably the kernel owner id) MUST use this
84
+ * instead of re-resolving, so every path agrees on one scope.
85
+ */
86
+ sessionId: string;
87
+ }
88
+ export interface AutoresearchWriteReceipt {
89
+ ok: true;
90
+ mission: AutoresearchMission;
91
+ missionPath: string;
92
+ intake: AutoresearchIntakeKind;
93
+ ledgerEvent?: AutoresearchLedgerEvent;
94
+ }
95
+ export interface AutoresearchClearReceipt {
96
+ ok: true;
97
+ cleared: boolean;
98
+ missionPath: string;
99
+ ledgerEvent: AutoresearchLedgerEvent;
100
+ /** Where the retired mission's artifacts were quarantined, when one existed. */
101
+ retiredTo?: string;
102
+ }
103
+ export interface AutoresearchIntakeReceipt extends AutoresearchWriteReceipt {
104
+ specPath: string;
105
+ }
106
+ export declare function getAutoresearchPaths(cwd: string, sessionId?: string | null): AutoresearchPaths;
107
+ export declare function readAutoresearchMission(cwd: string, sessionId?: string | null): Promise<AutoresearchMission | null>;
108
+ export declare function readAutoresearchLedger(cwd: string, sessionId?: string | null): Promise<AutoresearchLedgerEvent[]>;
109
+ /** read verb: current mission + append-only ledger snapshot. */
110
+ export declare function autoresearchRead(cwd: string, sessionId?: string | null): Promise<AutoresearchReadReceipt>;
111
+ /** write verb: persist the mission after cold-intake clarification. Mode is required. */
112
+ export declare function autoresearchWrite(input: {
113
+ cwd: string;
114
+ objective: string;
115
+ mode: AutoresearchMode;
116
+ deliverables?: string[];
117
+ constraints?: string[];
118
+ slug: string;
119
+ sessionId?: string | null;
120
+ primaryMetric?: string;
121
+ metricUnit?: string;
122
+ metricDirection?: string;
123
+ }): Promise<AutoresearchWriteReceipt>;
124
+ /**
125
+ * clear verb: retire the entire mission working set and record the mission clear.
126
+ *
127
+ * Artifacts are QUARANTINED to `<dir>/retired/<slug>.<timestamp>/`, never
128
+ * deleted, so a completed mission's evidence stays auditable while the
129
+ * successor mission starts from genuinely empty state. The `mission_cleared` row
130
+ * is appended to the OUTGOING ledger before it is moved, so the retired ledger
131
+ * is a complete record that ends with its own clear and the successor's ledger
132
+ * starts empty rather than the clear silently vanishing from the audit trail.
133
+ */
134
+ export declare function autoresearchClear(cwd: string, sessionId?: string | null): Promise<AutoresearchClearReceipt>;
135
+ /** Spec intake (`intake --spec <path>` or bare `--spec`): read the spec, write the mission, ask zero questions. The persisted intake kind stays "handoff" (seeded by a deep-interview handoff). */
136
+ export declare function autoresearchIntake(input: {
137
+ cwd: string;
138
+ specPath: string;
139
+ sessionId?: string | null;
140
+ }): Promise<AutoresearchIntakeReceipt>;
141
+ /** Record one experiment run in the ledger. */
142
+ export declare function autoresearchLogRun(input: {
143
+ cwd: string;
144
+ runId: string;
145
+ status: string;
146
+ description: string;
147
+ metric?: number;
148
+ slug?: string;
149
+ sessionId?: string | null;
150
+ }): Promise<AutoresearchLedgerEvent>;
151
+ /** Record the optional per-mission critic pass; its evaluator is distinct from the mission agent. */
152
+ export declare function autoresearchRecordCritic(input: {
153
+ cwd: string;
154
+ status: Record<string, unknown>;
155
+ evidence: string[];
156
+ caveats: string[];
157
+ evaluator: string;
158
+ slug?: string;
159
+ sessionId?: string | null;
160
+ }): Promise<AutoresearchCriticReceipt>;
161
+ /** Issue the mission verdict; an optional critic receipt rides along with its own evaluator identity. */
162
+ export declare function autoresearchIssueVerdict(input: {
163
+ cwd: string;
164
+ status: Record<string, unknown>;
165
+ evidence: string[];
166
+ caveats: string[];
167
+ evaluator: string;
168
+ criticReceipt?: AutoresearchCriticReceipt;
169
+ slug?: string;
170
+ sessionId?: string | null;
171
+ }): Promise<AutoresearchVerdictReceipt>;
172
+ export declare function runNativeAutoresearchCommand(args: string[], cwd?: string): Promise<AutoresearchCommandResult>;
173
+ /**
174
+ * Rebuilt autoresearch capability surface. Each capability is reachable from
175
+ * the runtime through a thin, mission-state-aware wrapper. All are read-only
176
+ * with respect to the ledger — none append events; the verbs above remain the
177
+ * only writers.
178
+ */
179
+ /** 1. Branch isolation: ensure the worktree is on an `autoresearch/*` branch. */
180
+ export declare function autoresearchBranchIsolation(cwd: string, goal: string): Promise<EnsureAutoresearchBranchResult>;
181
+ /** 2. Harness contract: parse `METRIC`/`ASI` lines out of captured harness output. */
182
+ export declare function autoresearchHarnessOutput(output: string, primaryMetricName?: string): ParsedHarnessOutput;
183
+ /**
184
+ * 3. Durable run storage: open the session-scoped JSONL run store, seeding an
185
+ * in-memory experiment config from the mission when none is persisted yet.
186
+ */
187
+ export declare function autoresearchRunsStore(cwd: string, sessionId?: string | null): Promise<AutoresearchRunsStore>;
188
+ /** 4. TUI dashboard: render the run table (collapsed + expanded) from persisted state. */
189
+ export declare function autoresearchDashboardText(cwd: string, sessionId?: string | null, width?: number): Promise<string>;
190
+ export declare function autoresearchDataContext(cwd: string, dataFlag?: string, sessionId?: string | null): Promise<RlmDataContext | null>;
191
+ /** 8. Two-phase prompts: Phase 1 (harness setup) rendered from mission/branch state. */
192
+ export declare function autoresearchSetupPrompt(baseSystemPrompt: string, cwd: string, goal?: string, sessionId?: string | null): Promise<string>;
193
+ /** 8. Two-phase prompts: Phase 2 (iterate) rendered from the persisted experiment state. */
194
+ export declare function autoresearchIteratePrompt(baseSystemPrompt: string, cwd: string, sessionId?: string | null): Promise<string>;
@@ -13,7 +13,7 @@
13
13
  * - Dry-run by default: nothing is deleted unless `--prune`/`--force`.
14
14
  */
15
15
  import { type GcSessionScopeUsage } from "./gc-session-scope";
16
- export type GcStore = "harness_leases" | "team_workers" | "file_locks" | "tmux_sessions" | "registry_entries" | "local_roots";
16
+ export type GcStore = "harness_leases" | "file_locks" | "tmux_sessions" | "registry_entries" | "local_roots";
17
17
  export declare const GC_STORES: readonly GcStore[];
18
18
  /** Why a probed pid is kept instead of treated as dead. */
19
19
  export type GcPidKeepReason = "alive" | "eperm" | "unknown";
@@ -65,7 +65,7 @@ export interface ResolvedTmuxBinary {
65
65
  }
66
66
  /**
67
67
  * Resolve the tmux command GJC should invoke. Honors the existing
68
- * GJC_TMUX_COMMAND / GJC_TEAM_TMUX_COMMAND overrides; on Windows when no
68
+ * GJC_TMUX_COMMAND override; on Windows when no
69
69
  * override is set, psmux (installed as psmux, pmux, or tmux) is picked
70
70
  * automatically so the default gjc --tmux flow lands on a real multiplexer.
71
71
  */
@@ -0,0 +1,19 @@
1
+ export interface PythonTranscriptRecord {
2
+ timestamp: string;
3
+ code: string;
4
+ output: string;
5
+ exitCode: number | null;
6
+ cancelled: boolean;
7
+ truncated: boolean;
8
+ }
9
+ export interface PythonKernelTranscript {
10
+ readonly dir: string;
11
+ readonly kernelInstanceId: string;
12
+ append(record: PythonTranscriptRecord): Promise<void>;
13
+ }
14
+ export declare function openPythonKernelTranscript(input: {
15
+ cwd: string;
16
+ sessionId: string;
17
+ kernelInstanceId: string;
18
+ now?: Date;
19
+ }): PythonKernelTranscript;
@@ -14,7 +14,7 @@ import { type RalplanIndexRow } from "./ledger-event-renderer";
14
14
  * 2. **Artifact write**: `gjc ralplan --write --stage <type> --stage_n <N>
15
15
  * (--artifact <path-or-string> | --artifact-env GJC_RALPLAN_ARTIFACT)
16
16
  * [--run-id <id>] [--session-id <id>] [--lane-verdict <token>] [--json]` persists Planner / Architect
17
- * / Critic / disposition / revision / post-interview / ADR / final artifacts under
17
+ * / Critic / intent / disposition / revision / post-interview / ADR / final artifacts under
18
18
  * `.gjc/plans/ralplan/<run-id>/`, maintains an `index.jsonl` audit log, copies `final`
19
19
  * stages to `pending-approval.md`, and advances the HUD chip to reflect the latest
20
20
  * persisted stage. Disposition stage artifacts are fail-closed JSON documents that
@@ -35,7 +35,7 @@ export declare const PLANNING_STUCK_MARKER = "PLANNING-STUCK";
35
35
  export declare const RALPLAN_DEFAULT_MAX_REVIEW_PASSES_PER_LANE = 1;
36
36
  /** Inclusive upper bound for `gjc.ralplan.maxReviewPassesPerLane` settings overrides. */
37
37
  export declare const RALPLAN_MAX_REVIEW_PASSES_PER_LANE_LIMIT = 10;
38
- export type RalplanAutoHandoffTarget = "off" | "ultragoal" | "team";
38
+ export type RalplanAutoHandoffTarget = "off" | "ultragoal" | "autoresearch";
39
39
  export interface RalplanAutoHandoffResolution {
40
40
  configuredTarget: RalplanAutoHandoffTarget;
41
41
  effectiveTarget: RalplanAutoHandoffTarget;
@@ -139,12 +139,6 @@ export declare function resolveRalplanMaxIterations(cwd: string, agentDir?: stri
139
139
  }>;
140
140
  type RalplanAutoHandoffOptions = {
141
141
  planningStuck?: boolean;
142
- teamAvailabilityProbe?: () => {
143
- available: true;
144
- } | {
145
- available: false;
146
- reason: string;
147
- };
148
142
  /** The session's effective agent directory (see resolveWorkflowSetting). */
149
143
  agentDir?: string;
150
144
  };
@@ -44,16 +44,19 @@ export declare function sessionAuditDir(cwd: string, gjcSessionId: string): stri
44
44
  export declare function sessionReportsDir(cwd: string, gjcSessionId: string): string;
45
45
  export declare function sessionLogsDir(cwd: string, gjcSessionId: string): string;
46
46
  export declare function sessionRuntimeDir(cwd: string, gjcSessionId: string): string;
47
- export declare function sessionRlmDir(cwd: string, gjcSessionId: string): string;
47
+ export declare function sessionIpykernelsDir(cwd: string, gjcSessionId: string): string;
48
+ export declare function sessionIpykernelsArtifactsDir(cwd: string, gjcSessionId: string): string;
49
+ export declare function pythonKernelTranscriptPath(cwd: string, gjcSessionId: string, dirName: string): string;
50
+ export declare function sessionAutoresearchDir(cwd: string, gjcSessionId: string): string;
51
+ export declare function sessionAutoresearchRunsDir(cwd: string, gjcSessionId: string): string;
48
52
  export declare function activeStateDir(cwd: string, gjcSessionId: string): string;
49
53
  export declare function activeSnapshotPath(cwd: string, gjcSessionId: string): string;
50
54
  export declare function activeEntryPath(cwd: string, gjcSessionId: string, skill: string): string;
51
55
  export declare function modeStatePath(cwd: string, gjcSessionId: string, mode: string): string;
52
56
  export declare function auditPath(cwd: string, gjcSessionId: string): string;
53
57
  export declare function transactionJournalPath(cwd: string, gjcSessionId: string, mutationId: string): string;
54
- export declare function teamStateRoot(cwd: string, gjcSessionId: string): string;
55
58
  export declare function workflowGatePath(cwd: string, gjcSessionId: string, gateId: string): string;
56
59
  export declare function harnessStateRoot(cwd: string, gjcSessionId: string): string;
57
60
  export declare function coordinatorMcpStateRoot(cwd: string, gjcSessionId: string): string;
58
61
  export declare function tmuxRuntimeSessionPath(cwd: string, gjcSessionId: string, slug: string): string;
59
- export declare function rlmArtifactRoot(cwd: string, gjcSessionId: string, rlmSessionId: string): string;
62
+ export declare function autoresearchRlmArtifactRoot(cwd: string, gjcSessionId: string, rlmSessionId: string): string;
@@ -45,26 +45,4 @@ export declare function renderUltragoalStatusMarkdown(summary: {
45
45
  nudgeGoalId?: string;
46
46
  nudgeTargetKind?: string;
47
47
  }): string;
48
- export declare function renderTeamStatusMarkdown(snapshot: {
49
- team_name: string;
50
- phase: string;
51
- tmux_target?: string;
52
- tmux_session?: string;
53
- state_dir: string;
54
- task_total: number;
55
- task_counts: Record<string, number>;
56
- workers: Array<{
57
- id: string;
58
- status: string;
59
- }>;
60
- notification_summary?: {
61
- total: number;
62
- replay_eligible: number;
63
- by_state: Record<string, number>;
64
- };
65
- integration_by_worker?: Record<string, {
66
- status?: string;
67
- conflict_files?: string[];
68
- }>;
69
- }): string;
70
48
  export declare function renderStateMarkdown(skill: CanonicalGjcWorkflowSkill, stateJson: Record<string, unknown>, manifest: SkillManifest): string;
@@ -9,9 +9,9 @@ export declare const WorkflowStateContentChecksumSchema: z.ZodObject<{
9
9
  export declare const WorkflowStateReceiptSchema: z.ZodObject<{
10
10
  version: z.ZodNumber;
11
11
  skill: z.ZodEnum<{
12
+ autoresearch: "autoresearch";
12
13
  "deep-interview": "deep-interview";
13
14
  ralplan: "ralplan";
14
- team: "team";
15
15
  ultragoal: "ultragoal";
16
16
  }>;
17
17
  owner: z.ZodEnum<{
@@ -52,9 +52,9 @@ export declare const WorkflowStateEnvelopeSchema: z.ZodObject<{
52
52
  receipt: z.ZodOptional<z.ZodObject<{
53
53
  version: z.ZodNumber;
54
54
  skill: z.ZodEnum<{
55
+ autoresearch: "autoresearch";
55
56
  "deep-interview": "deep-interview";
56
57
  ralplan: "ralplan";
57
- team: "team";
58
58
  ultragoal: "ultragoal";
59
59
  }>;
60
60
  owner: z.ZodEnum<{
@@ -93,9 +93,9 @@ export declare const WorkflowStateEnvelopeSchema: z.ZodObject<{
93
93
  export declare const RequiredWorkflowStateReceiptSchema: z.ZodObject<{
94
94
  version: z.ZodNumber;
95
95
  skill: z.ZodEnum<{
96
+ autoresearch: "autoresearch";
96
97
  "deep-interview": "deep-interview";
97
98
  ralplan: "ralplan";
98
- team: "team";
99
99
  ultragoal: "ultragoal";
100
100
  }>;
101
101
  owner: z.ZodEnum<{
@@ -126,9 +126,9 @@ export declare const RequiredWorkflowStateReceiptSchema: z.ZodObject<{
126
126
  */
127
127
  export declare const RequiredOnWriteEnvelopeSchema: z.ZodObject<{
128
128
  skill: z.ZodEnum<{
129
+ autoresearch: "autoresearch";
129
130
  "deep-interview": "deep-interview";
130
131
  ralplan: "ralplan";
131
- team: "team";
132
132
  ultragoal: "ultragoal";
133
133
  }>;
134
134
  version: z.ZodLiteral<2>;
@@ -138,9 +138,9 @@ export declare const RequiredOnWriteEnvelopeSchema: z.ZodObject<{
138
138
  receipt: z.ZodObject<{
139
139
  version: z.ZodNumber;
140
140
  skill: z.ZodEnum<{
141
+ autoresearch: "autoresearch";
141
142
  "deep-interview": "deep-interview";
142
143
  ralplan: "ralplan";
143
- team: "team";
144
144
  ultragoal: "ultragoal";
145
145
  }>;
146
146
  owner: z.ZodEnum<{
@@ -196,9 +196,9 @@ export declare const SkillActiveEntrySchema: z.ZodObject<{
196
196
  receipt: z.ZodOptional<z.ZodObject<{
197
197
  version: z.ZodNumber;
198
198
  skill: z.ZodEnum<{
199
+ autoresearch: "autoresearch";
199
200
  "deep-interview": "deep-interview";
200
201
  ralplan: "ralplan";
201
- team: "team";
202
202
  ultragoal: "ultragoal";
203
203
  }>;
204
204
  owner: z.ZodEnum<{
@@ -257,9 +257,9 @@ export declare const SkillActiveStateSchema: z.ZodObject<{
257
257
  receipt: z.ZodOptional<z.ZodObject<{
258
258
  version: z.ZodNumber;
259
259
  skill: z.ZodEnum<{
260
+ autoresearch: "autoresearch";
260
261
  "deep-interview": "deep-interview";
261
262
  ralplan: "ralplan";
262
- team: "team";
263
263
  ultragoal: "ultragoal";
264
264
  }>;
265
265
  owner: z.ZodEnum<{
@@ -33,14 +33,14 @@ export declare function envDisabled(value: string | undefined): boolean;
33
33
  * Resolve the tmux (or tmux-compatible multiplexer) command GJC should invoke.
34
34
  *
35
35
  * This is the shared entry point used by every GJC code path that needs to talk
36
- * to a multiplexer: `gjc --tmux` planning, `gjc session ...`, `gjc team ...`,
36
+ * to a multiplexer: `gjc --tmux` planning and `gjc session ...`,
37
37
  * the lifecycle controller, and the harness resident owner. Routing all of
38
38
  * them through the same resolver means a single `GJC_TMUX_COMMAND` override or
39
39
  * a single Windows psmux / pmux detection wins for the whole process — the
40
40
  * failure mode where `gjc --tmux` creates a psmux-backed session and then
41
41
  * `gjc session status` fails because it queries literal `tmux` is closed off.
42
42
  *
43
- * Explicit `GJC_TMUX_COMMAND` / `GJC_TEAM_TMUX_COMMAND` overrides are honored on
43
+ * Explicit `GJC_TMUX_COMMAND` overrides are honored on
44
44
  * every platform. On native Windows without an override the resolver walks
45
45
  * `psmux`, then `pmux`, then `tmux` and uses the first binary present on PATH.
46
46
  * On POSIX the resolver returns `tmux` (the historical default) and only
@@ -1,4 +1,30 @@
1
- import { type UltragoalChangeSet, type UltragoalChangeSetPath } from "./ultragoal-runtime";
1
+ export type UltragoalChangeStatus = "added" | "modified" | "deleted" | "renamed" | "copied" | "unknown";
2
+ export type UltragoalChangeCategory = "code" | "generated-binding" | "tool" | "settings-registry" | "prompt-doc-behavior" | "docs-static" | "other";
3
+ export interface UltragoalChangeSetPath {
4
+ path: string;
5
+ status: UltragoalChangeStatus;
6
+ oldPath?: string;
7
+ category?: UltragoalChangeCategory;
8
+ [key: string]: unknown;
9
+ }
10
+ export interface UltragoalChangeSet {
11
+ source: "checkpoint-git" | "review-pr" | "review-branch" | "review-worktree" | "review-spec";
12
+ baseRef?: string;
13
+ headRef?: string;
14
+ mergeBase?: string;
15
+ paths: UltragoalChangeSetPath[];
16
+ rawDiffStat?: string;
17
+ rawDiff?: string;
18
+ untrackedContentHash?: string;
19
+ untrackedContentHashVerified?: boolean;
20
+ captureIncomplete?: boolean;
21
+ trusted: true;
22
+ [key: string]: unknown;
23
+ }
24
+ export declare function normalizeRepoPath(value: string): string;
25
+ export declare function normalizeChangeSetPath(value: string): string;
26
+ export declare function categorizeComputerChangePath(pathValue: string): UltragoalChangeCategory;
27
+ export declare function computeUltragoalReviewSourceHash(changeSet: UltragoalChangeSet | undefined): string | undefined;
2
28
  export declare function spawnText(command: string[], options: {
3
29
  cwd: string;
4
30
  timeoutMs?: number;
@@ -13,4 +39,15 @@ export declare function parseGitUntrackedPaths(output: string): UltragoalChangeS
13
39
  export declare function ciDevChangedPathRows(): UltragoalChangeSetPath[];
14
40
  export declare function mergeChangeSetPaths(groups: UltragoalChangeSetPath[][]): UltragoalChangeSetPath[];
15
41
  export declare function computeCheckpointChangeSet(cwd: string): Promise<UltragoalChangeSet | undefined>;
42
+ /**
43
+ * A content witness of overall repository state. HEAD and porcelain status are
44
+ * retained for cheap structural diagnostics, but the authoritative comparison
45
+ * also digests every tracked and non-ignored untracked path. A same-status edit
46
+ * therefore cannot pass the capture boundary merely because Git's status text
47
+ * stayed unchanged.
48
+ */
49
+ type RepositoryStateWitnessTestHook = (phase: "after-initial", cwd: string) => void | Promise<void>;
50
+ /** @internal Test-only seam; production capture has no injected mutation hook. */
51
+ export declare function __setRepositoryStateWitnessTestHookForTests(hook: RepositoryStateWitnessTestHook | undefined): void;
16
52
  export declare function parseUnifiedDiffPaths(diff: string): UltragoalChangeSetPath[];
53
+ export {};
@@ -2,6 +2,8 @@ import type { WorkflowHudSummary } from "../skill-state/active-state";
2
2
  import { type RepositoryBinding } from "./repository-binding";
3
3
  import { type CriticVerdict } from "./ultragoal-receipt-freshness";
4
4
  export { CRITIC_GATE_HARD_STOP_EVENT, CRITIC_GATE_OVERRIDE_EVENT, CRITIC_VERDICT_EVENT, type CriticVerdict, computeUltragoalPlanGeneration, countTerminalCriticVerdicts, receiptRelevantGoals, TERMINAL_CRITIC_CEILING, terminalCriticCeilingReached, terminalCriticGateOverridden, } from "./ultragoal-receipt-freshness";
5
+ import { type UltragoalChangeSet } from "./ultragoal-change-set";
6
+ export { categorizeComputerChangePath, ciDevChangedPathRows, computeCheckpointChangeSet, computeUltragoalReviewSourceHash, mergeChangeSetPaths, normalizeChangeSetPath, normalizeRepoPath, parseGitNameStatus, parseGitUntrackedPaths, parseUnifiedDiffPaths, resolveGitBase, spawnText, type UltragoalChangeCategory, type UltragoalChangeSet, type UltragoalChangeSetPath, type UltragoalChangeStatus, } from "./ultragoal-change-set";
5
7
  export { captureUltragoalRecoverySnapshot, parseStrictTerminalTranscript, persistUltragoalRecoveryDecision, planUltragoalOwnerLossRecovery, type UltragoalOwnerLossReceipt, type UltragoalRecoveryBinding, type UltragoalRecoveryDecision, type UltragoalRecoverySnapshot, validateOwnerLossBinding, validateRawUltragoalEvidence, validateRecoveryAdmission, validateRecoveryPath, } from "./ultragoal-owner-loss-recovery";
6
8
  export type UltragoalGjcGoalMode = "aggregate" | "per-story";
7
9
  export type UltragoalGoalStatus = "pending" | "active" | "complete" | "failed" | "blocked" | "review_blocked" | "superseded";
@@ -287,28 +289,6 @@ export declare function requireResolvedLinks(ids: string[], map: Map<string, Jso
287
289
  export declare function normalizedEvidenceKind(row: JsonObject): string;
288
290
  export declare function evidenceKindMatches(kind: string, words: string[]): boolean;
289
291
  export type SurfaceFamily = "web" | "cli" | "native" | "api-package" | "algorithm-math" | "unknown";
290
- export type UltragoalChangeStatus = "added" | "modified" | "deleted" | "renamed" | "copied" | "unknown";
291
- export type UltragoalChangeCategory = "code" | "generated-binding" | "tool" | "settings-registry" | "prompt-doc-behavior" | "docs-static" | "other";
292
- export interface UltragoalChangeSetPath extends JsonObject {
293
- path: string;
294
- status: UltragoalChangeStatus;
295
- oldPath?: string;
296
- category?: UltragoalChangeCategory;
297
- }
298
- export interface UltragoalChangeSet extends JsonObject {
299
- source: "checkpoint-git" | "review-pr" | "review-branch" | "review-worktree" | "review-spec";
300
- baseRef?: string;
301
- headRef?: string;
302
- mergeBase?: string;
303
- paths: UltragoalChangeSetPath[];
304
- rawDiffStat?: string;
305
- rawDiff?: string;
306
- captureIncomplete?: boolean;
307
- trusted: true;
308
- }
309
- export declare function normalizeRepoPath(value: string): string;
310
- export declare function normalizeChangeSetPath(value: string): string;
311
- export declare function categorizeComputerChangePath(value: string): UltragoalChangeCategory;
312
292
  export declare function normalizeSurfaceToken(value: string): string;
313
293
  export declare function surfaceFamily(value: string): SurfaceFamily;
314
294
  export declare function isLiveSurfaceFamily(family: SurfaceFamily): boolean;
@@ -426,8 +406,6 @@ interface UltragoalReviewResult extends JsonObject {
426
406
  weakContractCapApplied: boolean;
427
407
  blockerGoalIds?: string[];
428
408
  }
429
- import { ciDevChangedPathRows, computeCheckpointChangeSet, mergeChangeSetPaths, parseGitNameStatus, parseGitUntrackedPaths, parseUnifiedDiffPaths, resolveGitBase, spawnText } from "./ultragoal-change-set";
430
- export { ciDevChangedPathRows, computeCheckpointChangeSet, mergeChangeSetPaths, parseGitNameStatus, parseGitUntrackedPaths, parseUnifiedDiffPaths, resolveGitBase, spawnText, };
431
409
  /**
432
410
  * Typed terminal handoff thrown when {@link recordUltragoalReviewBlockers} would
433
411
  * exceed {@link MAX_REVIEW_BLOCKER_DESCENTS} unresolved review_blocker descents
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Deterministic Ultragoal validation applicability policy (#4560).
3
+ *
4
+ * The boundary cohort (`cleaner || architect || QA`) and the terminal critic
5
+ * are expensive LLM lanes. They were introduced as unconditional per-boundary
6
+ * ceremony, which inflates token cost and failure surface on low-risk work and
7
+ * makes compaction more likely during long runs (#3473/#3474 moved review from
8
+ * per-subgoal to per-boundary; this policy makes the boundary lanes
9
+ * risk-proportional without removing them for risky work).
10
+ *
11
+ * Selection is runtime-authoritative and deterministic from durable facts
12
+ * (change set, plan shape, ledger receipts) — never free-form model prose.
13
+ * It fails closed: any condition that cannot be proven cheap is treated as
14
+ * high-risk and keeps the full heavyweight cohort. The precedent is
15
+ * `requiresComputerRedTeamSuite`, whose applicability the runtime derives from
16
+ * the computed change set and refuses to let the model self-exempt.
17
+ */
18
+ import { type UltragoalChangeSet, type UltragoalChangeSetPath } from "./ultragoal-change-set";
19
+ export type UltragoalValidationLane = "cleaner" | "architect" | "qa" | "terminal-critic";
20
+ export interface UltragoalValidationApplicabilityInput {
21
+ /** Trusted computed change set for the boundary (checkpoint path). */
22
+ changeSet?: UltragoalChangeSet;
23
+ /**
24
+ * Durable aggregate shape: the number of goals the plan actually requires.
25
+ * This is a property of the plan, not of how far it has progressed, so the
26
+ * multi-goal risk signal cannot evaporate at the final goal of a multi-goal
27
+ * run — which is precisely the aggregate boundary where risk is highest.
28
+ */
29
+ requiredGoals?: number;
30
+ /** Open review blockers exist (review_blocked goals). */
31
+ hasOpenReviewBlockers?: boolean;
32
+ /** Newest joined cohort sourceHash recorded in the ledger. */
33
+ latestCohortSourceHash?: string;
34
+ /** Current frozen source hash the boundary would review. */
35
+ currentSourceHash?: string;
36
+ /** Runtime-computed digest of the authoritative current source basis. */
37
+ authoritativeSourceHash?: string;
38
+ }
39
+ export interface UltragoalValidationApplicability {
40
+ /** Lane -> applicability decision with the durable facts that forced it. */
41
+ lanes: Record<UltragoalValidationLane, {
42
+ applicable: boolean;
43
+ reasons: string[];
44
+ }>;
45
+ /** True only when every heavyweight lane is applicable (full cohort). */
46
+ heavyweight: boolean;
47
+ /** Risk classification driving the selection. */
48
+ riskClass: "low" | "high";
49
+ /** True when open review blockers make terminal evidence uncertain. */
50
+ hasOpenReviewBlockers: boolean;
51
+ /** True when an unchanged immutable source basis permits evidence reuse. */
52
+ basisUnchanged: boolean;
53
+ /** Human- and machine-inspectable selection basis, recorded in diagnostics. */
54
+ selection: string[];
55
+ }
56
+ export interface UltragoalValidationLaneSelection {
57
+ riskClass: "low" | "high";
58
+ reasons: string[];
59
+ omittedLanes: UltragoalValidationLane[];
60
+ }
61
+ export declare function isHighRiskChangePath(row: UltragoalChangeSetPath): boolean;
62
+ export declare function validationLaneSelectionFor(applicability: UltragoalValidationApplicability): UltragoalValidationLaneSelection;
63
+ export declare function isMigrationChangePath(row: UltragoalChangeSetPath): boolean;
64
+ /**
65
+ * Compute the deterministic validation applicability for a boundary.
66
+ *
67
+ * Low-risk eligibility (the only case where redundant lanes may be omitted):
68
+ * trusted change set, single outstanding goal, no open review blockers, no
69
+ * high-risk/migration/computer/public-contract path, complete capture.
70
+ * Everything else — including a missing/untrusted change set — keeps the full
71
+ * heavyweight cohort exactly as today.
72
+ */
73
+ export declare function resolveUltragoalValidationApplicability(input: UltragoalValidationApplicabilityInput): UltragoalValidationApplicability;