@kynver-app/runtime 0.2.23 → 0.2.28

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 (413) hide show
  1. package/README.md +52 -18
  2. package/dist/chat/command-auth-proof.js +1 -1
  3. package/dist/cli.js +74 -65
  4. package/dist/index.js +96 -87
  5. package/dist/instruction-bundle/contract.js +2 -2
  6. package/dist/local-run-store/index.js +6 -6
  7. package/dist/server/adapter-contract.js +1 -1
  8. package/dist/server/cleanup.js +14 -14
  9. package/dist/server/db-credentials.js +2 -2
  10. package/dist/server/default-repo.js +1 -1
  11. package/dist/server/heavy-verification.js +1 -1
  12. package/dist/server/memory-cost-enforce.js +2 -2
  13. package/dist/server/memory-cost.js +2 -2
  14. package/dist/server/model-routing.js +4 -4
  15. package/dist/server/monitor.js +7 -7
  16. package/dist/server/orchestration.js +1 -1
  17. package/dist/server/worker-policy.js +2 -2
  18. package/package.json +6 -3
  19. package/dist/active-harness-workers.d.ts +0 -11
  20. package/dist/auto-complete.d.ts +0 -60
  21. package/dist/bootstrap.d.ts +0 -1
  22. package/dist/bounded-build/admission.d.ts +0 -30
  23. package/dist/bounded-build/constants.d.ts +0 -10
  24. package/dist/bounded-build/exec.d.ts +0 -35
  25. package/dist/bounded-build/index.d.ts +0 -6
  26. package/dist/bounded-build/meminfo.d.ts +0 -5
  27. package/dist/bounded-build/node-options.d.ts +0 -9
  28. package/dist/bounded-build/systemd-wrap.d.ts +0 -17
  29. package/dist/box-identity.d.ts +0 -19
  30. package/dist/box-resource-snapshot-shared.d.ts +0 -13
  31. package/dist/box-resource-snapshot.d.ts +0 -45
  32. package/dist/box-worker-cap.d.ts +0 -9
  33. package/dist/byoc/context-hydration.d.ts +0 -54
  34. package/dist/byoc/execution-proof.d.ts +0 -46
  35. package/dist/byoc/index.d.ts +0 -5
  36. package/dist/byoc/job-envelope.d.ts +0 -39
  37. package/dist/byoc/m6-golden-path.d.ts +0 -86
  38. package/dist/byoc/mcp-tool-proof.d.ts +0 -42
  39. package/dist/callback-headers.d.ts +0 -2
  40. package/dist/callbacks.d.ts +0 -74
  41. package/dist/chat/anthropic-credentials.d.ts +0 -11
  42. package/dist/chat/anthropic-stream.d.ts +0 -43
  43. package/dist/chat/chat-claim-loop.d.ts +0 -41
  44. package/dist/chat/chat-primary-cli.d.ts +0 -2
  45. package/dist/chat/command-allowlist.d.ts +0 -8
  46. package/dist/chat/command-auth-proof.d.ts +0 -67
  47. package/dist/chat/command-executor.d.ts +0 -18
  48. package/dist/chat/delta-batcher.d.ts +0 -13
  49. package/dist/cleanup-active-worktrees.d.ts +0 -14
  50. package/dist/cleanup-build-cache-paths.d.ts +0 -5
  51. package/dist/cleanup-cli.d.ts +0 -1
  52. package/dist/cleanup-completion-blocker.d.ts +0 -10
  53. package/dist/cleanup-dependency-scan.d.ts +0 -13
  54. package/dist/cleanup-dir-size.d.ts +0 -5
  55. package/dist/cleanup-disk-pressure.d.ts +0 -15
  56. package/dist/cleanup-duplicate-worktrees.d.ts +0 -8
  57. package/dist/cleanup-evidence.d.ts +0 -10
  58. package/dist/cleanup-execute.d.ts +0 -7
  59. package/dist/cleanup-git-probe.d.ts +0 -5
  60. package/dist/cleanup-git-rev-cache.d.ts +0 -5
  61. package/dist/cleanup-git-status-cache.d.ts +0 -5
  62. package/dist/cleanup-guards-helpers.d.ts +0 -2
  63. package/dist/cleanup-guards.d.ts +0 -53
  64. package/dist/cleanup-harness-path-validate.d.ts +0 -5
  65. package/dist/cleanup-harness-roots.d.ts +0 -6
  66. package/dist/cleanup-index-status.d.ts +0 -16
  67. package/dist/cleanup-orphan-safety.d.ts +0 -17
  68. package/dist/cleanup-path-ownership.d.ts +0 -9
  69. package/dist/cleanup-privileged-remove.d.ts +0 -13
  70. package/dist/cleanup-progress.d.ts +0 -2
  71. package/dist/cleanup-remove-path.d.ts +0 -17
  72. package/dist/cleanup-retention-config.d.ts +0 -26
  73. package/dist/cleanup-run-directory.d.ts +0 -20
  74. package/dist/cleanup-run-liveness.d.ts +0 -21
  75. package/dist/cleanup-run-terminal-cache.d.ts +0 -6
  76. package/dist/cleanup-salvage-evidence.d.ts +0 -33
  77. package/dist/cleanup-scan.d.ts +0 -15
  78. package/dist/cleanup-summary.d.ts +0 -29
  79. package/dist/cleanup-types.d.ts +0 -154
  80. package/dist/cleanup-worker-harness-live.d.ts +0 -9
  81. package/dist/cleanup-worktree-index.d.ts +0 -18
  82. package/dist/cleanup-worktree-salvage.d.ts +0 -7
  83. package/dist/cleanup.d.ts +0 -5
  84. package/dist/cli-output/worker-start-stdout.d.ts +0 -11
  85. package/dist/cli.d.ts +0 -3
  86. package/dist/command-center-contract-cli.d.ts +0 -1
  87. package/dist/completion-ack.d.ts +0 -18
  88. package/dist/completion-replay.d.ts +0 -10
  89. package/dist/completion-response.d.ts +0 -15
  90. package/dist/config.d.ts +0 -122
  91. package/dist/context-budget-receipt.d.ts +0 -96
  92. package/dist/context-preview/chat-memory-preview.d.ts +0 -33
  93. package/dist/cron/cron-cli-bin.d.ts +0 -7
  94. package/dist/cron/cron-env-file.d.ts +0 -22
  95. package/dist/cron/cron-env.d.ts +0 -21
  96. package/dist/cron/cron-fire.d.ts +0 -8
  97. package/dist/cron/cron-id.d.ts +0 -3
  98. package/dist/cron/cron-install-api.d.ts +0 -27
  99. package/dist/cron/cron-install-cli.d.ts +0 -2
  100. package/dist/cron/cron-install-plan.d.ts +0 -34
  101. package/dist/cron/cron-install-secrets.d.ts +0 -6
  102. package/dist/cron/cron-install-systemd.d.ts +0 -18
  103. package/dist/cron/cron-install-verify.d.ts +0 -15
  104. package/dist/cron/cron-install.d.ts +0 -51
  105. package/dist/cron/cron-lock.d.ts +0 -9
  106. package/dist/cron/cron-match.d.ts +0 -8
  107. package/dist/cron/cron-readiness.d.ts +0 -35
  108. package/dist/cron/cron-status.d.ts +0 -10
  109. package/dist/cron/cron-store.d.ts +0 -8
  110. package/dist/cron/cron-tick-cli.d.ts +0 -2
  111. package/dist/cron/cron-tick-state.d.ts +0 -5
  112. package/dist/cron/cron-tick.d.ts +0 -19
  113. package/dist/cron/cron-types.d.ts +0 -53
  114. package/dist/cron/hermes-provider-notice.d.ts +0 -1
  115. package/dist/daemon-box-identity.d.ts +0 -16
  116. package/dist/daemon-heartbeat.d.ts +0 -30
  117. package/dist/daemon-keeper.d.ts +0 -21
  118. package/dist/daemon-platform-guard.d.ts +0 -2
  119. package/dist/daemon-supervision/host.d.ts +0 -4
  120. package/dist/daemon-supervision/index.d.ts +0 -6
  121. package/dist/daemon-supervision/policy.d.ts +0 -16
  122. package/dist/daemon-supervision/setup.d.ts +0 -23
  123. package/dist/daemon-supervision/start.d.ts +0 -26
  124. package/dist/daemon-supervision/supervision-health.d.ts +0 -20
  125. package/dist/daemon-supervision/verify.d.ts +0 -13
  126. package/dist/daemon.d.ts +0 -5
  127. package/dist/db-credential-env-paths.d.ts +0 -13
  128. package/dist/db-credential-resolver.d.ts +0 -38
  129. package/dist/db-url-hint.d.ts +0 -4
  130. package/dist/default-repo-cli.d.ts +0 -20
  131. package/dist/default-repo-discovery.d.ts +0 -25
  132. package/dist/default-repo.d.ts +0 -32
  133. package/dist/device-login.d.ts +0 -8
  134. package/dist/discard-disposable.d.ts +0 -6
  135. package/dist/disk-gate.d.ts +0 -25
  136. package/dist/dispatch-callback-timeout.d.ts +0 -1
  137. package/dist/dispatch-claim-release.d.ts +0 -23
  138. package/dist/dispatch-lane-normalization.d.ts +0 -14
  139. package/dist/dispatch-model-guard.d.ts +0 -26
  140. package/dist/dispatch-progress.d.ts +0 -3
  141. package/dist/dispatch-resource-gate.d.ts +0 -20
  142. package/dist/dispatch-start-abort.d.ts +0 -3
  143. package/dist/dispatch-start-readback.d.ts +0 -27
  144. package/dist/dispatch.d.ts +0 -24
  145. package/dist/disposable-artifacts.d.ts +0 -2
  146. package/dist/doctor/context-envelope-cli.d.ts +0 -1
  147. package/dist/doctor/context-envelope.d.ts +0 -13
  148. package/dist/doctor/context-envelope.probes.d.ts +0 -25
  149. package/dist/doctor/context-envelope.types.d.ts +0 -42
  150. package/dist/doctor/doctor.types.d.ts +0 -50
  151. package/dist/doctor/github-readiness.d.ts +0 -16
  152. package/dist/doctor/index.d.ts +0 -7
  153. package/dist/doctor/local-store-cli.d.ts +0 -11
  154. package/dist/doctor/local-store.d.ts +0 -35
  155. package/dist/doctor/node-runtime-cli.d.ts +0 -6
  156. package/dist/doctor/node-runtime.d.ts +0 -19
  157. package/dist/doctor/runner-install-cli.d.ts +0 -1
  158. package/dist/doctor/runner-install.d.ts +0 -2
  159. package/dist/doctor/runtime-takeover-cli.d.ts +0 -1
  160. package/dist/doctor/runtime-takeover-daemon-supervision.d.ts +0 -3
  161. package/dist/doctor/runtime-takeover-deploy-evidence.d.ts +0 -13
  162. package/dist/doctor/runtime-takeover-scheduler.d.ts +0 -29
  163. package/dist/doctor/runtime-takeover.d.ts +0 -3
  164. package/dist/doctor/runtime-takeover.probes.d.ts +0 -45
  165. package/dist/executor-ref-routing.d.ts +0 -14
  166. package/dist/exit-classify.d.ts +0 -12
  167. package/dist/exited-salvage.d.ts +0 -22
  168. package/dist/exited-worker-handoff-capture.d.ts +0 -19
  169. package/dist/factory-status/collect.d.ts +0 -12
  170. package/dist/factory-status/lightweight.d.ts +0 -5
  171. package/dist/factory-status/render.d.ts +0 -5
  172. package/dist/factory-status/types.d.ts +0 -46
  173. package/dist/factory-status-cli.d.ts +0 -1
  174. package/dist/factory-steer-delivery.d.ts +0 -7
  175. package/dist/finalize.d.ts +0 -25
  176. package/dist/fortress-engagement-gate.d.ts +0 -5
  177. package/dist/git.d.ts +0 -37
  178. package/dist/github-repo.d.ts +0 -5
  179. package/dist/harness-expert-review.d.ts +0 -12
  180. package/dist/harness-lease-owner.d.ts +0 -13
  181. package/dist/harness-notice/harness-notice.auto-complete.d.ts +0 -3
  182. package/dist/harness-notice/harness-notice.monitor-tick.d.ts +0 -6
  183. package/dist/harness-notice/harness-notice.parse.d.ts +0 -3
  184. package/dist/harness-notice/harness-notice.tool-response.d.ts +0 -3
  185. package/dist/harness-notice/harness-notice.types.d.ts +0 -17
  186. package/dist/harness-notice/harness-notice.worker-complete.d.ts +0 -3
  187. package/dist/harness-notice/harness-notice.worker-start.d.ts +0 -7
  188. package/dist/harness-notice/harness-notice.worker-status.d.ts +0 -2
  189. package/dist/harness-notice/index.d.ts +0 -8
  190. package/dist/harness-repair-target.d.ts +0 -23
  191. package/dist/harness-storage-snapshot.d.ts +0 -26
  192. package/dist/harness-verify-cli.d.ts +0 -1
  193. package/dist/harness-verify.d.ts +0 -30
  194. package/dist/harness-worker-active.d.ts +0 -12
  195. package/dist/harness-worktree-build-guard.d.ts +0 -12
  196. package/dist/heartbeat-final-result.d.ts +0 -5
  197. package/dist/heartbeat.d.ts +0 -27
  198. package/dist/heavy-verification/command-classify.d.ts +0 -9
  199. package/dist/heavy-verification/gate.d.ts +0 -10
  200. package/dist/heavy-verification/index.d.ts +0 -5
  201. package/dist/heavy-verification/paths.d.ts +0 -3
  202. package/dist/heavy-verification/slot.d.ts +0 -49
  203. package/dist/heavy-verification/worker-command-gate.d.ts +0 -23
  204. package/dist/index.d.ts +0 -85
  205. package/dist/installed-package-versions.d.ts +0 -8
  206. package/dist/instruction-bundle/cache.d.ts +0 -6
  207. package/dist/instruction-bundle/client.d.ts +0 -25
  208. package/dist/instruction-bundle/contract.d.ts +0 -4
  209. package/dist/instruction-bundle/embedded-bundle.d.ts +0 -3
  210. package/dist/instruction-bundle/index.d.ts +0 -7
  211. package/dist/instruction-bundle/keys.d.ts +0 -14
  212. package/dist/instruction-bundle/state.d.ts +0 -24
  213. package/dist/instruction-bundle/types.d.ts +0 -42
  214. package/dist/instruction-bundle/verify.d.ts +0 -15
  215. package/dist/landing/cli-auth.d.ts +0 -11
  216. package/dist/landing/land-pr-check-classify.d.ts +0 -17
  217. package/dist/landing/land-pr-completion-post.d.ts +0 -12
  218. package/dist/landing/land-pr.d.ts +0 -28
  219. package/dist/landing-contract-gate.d.ts +0 -27
  220. package/dist/landing-contract-pr-classify.d.ts +0 -4
  221. package/dist/landing-gate.d.ts +0 -24
  222. package/dist/lane/landing-maintainer-local.d.ts +0 -15
  223. package/dist/lane/landing-maintainer-tick.d.ts +0 -16
  224. package/dist/lane/lane-spec.d.ts +0 -8
  225. package/dist/lane/lane-tick-cli.d.ts +0 -1
  226. package/dist/lease-renewal.d.ts +0 -15
  227. package/dist/local-pr-attention-reconcile.d.ts +0 -25
  228. package/dist/local-run-store/admission-enforce.d.ts +0 -38
  229. package/dist/local-run-store/admission-shadow.d.ts +0 -56
  230. package/dist/local-run-store/dispatch-claim-recovery-startup.d.ts +0 -11
  231. package/dist/local-run-store/dispatch-claim-recovery.d.ts +0 -54
  232. package/dist/local-run-store/dispatch-receipts.d.ts +0 -90
  233. package/dist/local-run-store/index.d.ts +0 -15
  234. package/dist/local-run-store/local-run-store.d.ts +0 -106
  235. package/dist/local-run-store/remote-surface-flags.d.ts +0 -15
  236. package/dist/local-run-store/small-surfaces.d.ts +0 -37
  237. package/dist/local-run-store/sqlite/sqlite-filesystem-policy.d.ts +0 -16
  238. package/dist/local-run-store/sqlite/sqlite-local-run-store.d.ts +0 -68
  239. package/dist/local-run-store/sqlite/sqlite-recovery.d.ts +0 -14
  240. package/dist/local-run-store/sqlite/sqlite-schema.d.ts +0 -13
  241. package/dist/local-run-store/store-lifecycle.d.ts +0 -38
  242. package/dist/local-run-store/surface-flags.d.ts +0 -47
  243. package/dist/local-run-store/tick-posture.d.ts +0 -27
  244. package/dist/material-worktree-changes.d.ts +0 -2
  245. package/dist/memory-cost-package-version-guard-enforce.d.ts +0 -10
  246. package/dist/memory-cost-package-version-guard.d.ts +0 -49
  247. package/dist/mesh-liveness/mesh-cron-lease-store.d.ts +0 -9
  248. package/dist/model-routing-task-enrich.d.ts +0 -8
  249. package/dist/model-routing.d.ts +0 -49
  250. package/dist/monitor/index.d.ts +0 -7
  251. package/dist/monitor/monitor-cli.d.ts +0 -9
  252. package/dist/monitor/monitor-loop.d.ts +0 -1
  253. package/dist/monitor/monitor-spawn.d.ts +0 -18
  254. package/dist/monitor/monitor.classify.d.ts +0 -15
  255. package/dist/monitor/monitor.service.d.ts +0 -17
  256. package/dist/monitor/monitor.store.d.ts +0 -6
  257. package/dist/monitor/monitor.task-lease.d.ts +0 -11
  258. package/dist/monitor/monitor.terminal.d.ts +0 -11
  259. package/dist/monitor/monitor.types.d.ts +0 -77
  260. package/dist/node-runtime-policy.d.ts +0 -25
  261. package/dist/orchestration-enforcement/config.d.ts +0 -5
  262. package/dist/orchestration-enforcement/evaluator.d.ts +0 -6
  263. package/dist/orchestration-enforcement/idempotency.d.ts +0 -8
  264. package/dist/orchestration-enforcement/index.d.ts +0 -4
  265. package/dist/orchestration-enforcement/types.d.ts +0 -24
  266. package/dist/orchestration-providers/adapter-contract.d.ts +0 -50
  267. package/dist/orchestration-providers/audit.d.ts +0 -3
  268. package/dist/orchestration-providers/capabilities.d.ts +0 -3
  269. package/dist/orchestration-providers/claude-oauth-binding.d.ts +0 -6
  270. package/dist/orchestration-providers/codex-oauth-binding.d.ts +0 -5
  271. package/dist/orchestration-providers/codex-orchestration-adapter.d.ts +0 -13
  272. package/dist/orchestration-providers/cost-router.d.ts +0 -24
  273. package/dist/orchestration-providers/cursor-oauth-binding.d.ts +0 -5
  274. package/dist/orchestration-providers/hermes-cli-adapter.d.ts +0 -15
  275. package/dist/orchestration-providers/hermes-openai-codex-binding.d.ts +0 -15
  276. package/dist/orchestration-providers/index.d.ts +0 -14
  277. package/dist/orchestration-providers/inventory.d.ts +0 -31
  278. package/dist/orchestration-providers/oauth-binding-utils.d.ts +0 -22
  279. package/dist/orchestration-providers/routing.d.ts +0 -16
  280. package/dist/orchestration-providers/types.d.ts +0 -45
  281. package/dist/package-version.d.ts +0 -5
  282. package/dist/path-values.d.ts +0 -5
  283. package/dist/paths.d.ts +0 -16
  284. package/dist/pipeline-dispatch.d.ts +0 -8
  285. package/dist/pipeline-exact-targets.d.ts +0 -2
  286. package/dist/pipeline-max-starts.d.ts +0 -26
  287. package/dist/pipeline-tick.d.ts +0 -50
  288. package/dist/plan-persist/agentos-api.d.ts +0 -28
  289. package/dist/plan-persist/body-hash.d.ts +0 -3
  290. package/dist/plan-persist/drain.d.ts +0 -7
  291. package/dist/plan-persist/errors.d.ts +0 -9
  292. package/dist/plan-persist/handoff.d.ts +0 -7
  293. package/dist/plan-persist/idempotency.d.ts +0 -2
  294. package/dist/plan-persist/index.d.ts +0 -8
  295. package/dist/plan-persist/outbox-durability.d.ts +0 -31
  296. package/dist/plan-persist/outbox-store.d.ts +0 -36
  297. package/dist/plan-persist/paths.d.ts +0 -8
  298. package/dist/plan-persist/persist.d.ts +0 -10
  299. package/dist/plan-persist/readback.d.ts +0 -17
  300. package/dist/plan-persist/types.d.ts +0 -95
  301. package/dist/plan-persist-cli.d.ts +0 -3
  302. package/dist/plan-progress-daemon-sync.d.ts +0 -7
  303. package/dist/plan-progress-sync.d.ts +0 -21
  304. package/dist/plan-progress.d.ts +0 -10
  305. package/dist/post-restart-unblock.d.ts +0 -24
  306. package/dist/pr-handoff/index.d.ts +0 -6
  307. package/dist/pr-handoff/pr-handoff-assess.d.ts +0 -44
  308. package/dist/pr-handoff/pr-handoff-dedupe.d.ts +0 -18
  309. package/dist/pr-handoff/pr-handoff-gh.d.ts +0 -52
  310. package/dist/pr-handoff/pr-handoff-supersede.d.ts +0 -17
  311. package/dist/pr-handoff/pr-handoff.d.ts +0 -8
  312. package/dist/pr-handoff/pr-handoff.types.d.ts +0 -45
  313. package/dist/pr-handoff/same-head-pr-guard.d.ts +0 -10
  314. package/dist/prompt.d.ts +0 -56
  315. package/dist/provider-evidence/collect.d.ts +0 -31
  316. package/dist/provider-evidence/exec.d.ts +0 -5
  317. package/dist/provider-evidence/index.d.ts +0 -7
  318. package/dist/provider-evidence/recipes-github.d.ts +0 -5
  319. package/dist/provider-evidence/recipes-vercel.d.ts +0 -2
  320. package/dist/provider-evidence/registry.d.ts +0 -6
  321. package/dist/provider-evidence/shared-cache.d.ts +0 -8
  322. package/dist/provider-evidence/types.d.ts +0 -48
  323. package/dist/provider-evidence/wanted-store.d.ts +0 -13
  324. package/dist/provider-quota-preflight.d.ts +0 -38
  325. package/dist/providers/claude.d.ts +0 -8
  326. package/dist/providers/codex.d.ts +0 -14
  327. package/dist/providers/cursor-windows.d.ts +0 -7
  328. package/dist/providers/cursor.d.ts +0 -13
  329. package/dist/providers/hermes-codex.d.ts +0 -12
  330. package/dist/providers/model-preflight.d.ts +0 -33
  331. package/dist/providers/openai-codex-resilience.d.ts +0 -33
  332. package/dist/providers/registry.d.ts +0 -4
  333. package/dist/providers/types.d.ts +0 -36
  334. package/dist/redact.d.ts +0 -1
  335. package/dist/repair-target-worktree.d.ts +0 -4
  336. package/dist/repo-search.d.ts +0 -53
  337. package/dist/resource-gate.d.ts +0 -74
  338. package/dist/retry-limits.d.ts +0 -12
  339. package/dist/review-head-reconcile.d.ts +0 -17
  340. package/dist/run-list.d.ts +0 -38
  341. package/dist/run-metadata-retention.d.ts +0 -38
  342. package/dist/run-resolve.d.ts +0 -4
  343. package/dist/run-store.d.ts +0 -38
  344. package/dist/run-worker-index.d.ts +0 -10
  345. package/dist/runner-boundary/index.d.ts +0 -6
  346. package/dist/runner-boundary/runner-boundary.dispatch-guard.d.ts +0 -4
  347. package/dist/runner-boundary/runner-boundary.forge-legacy-migration.d.ts +0 -23
  348. package/dist/runner-boundary/runner-boundary.harness-root.d.ts +0 -17
  349. package/dist/runner-boundary/runner-boundary.resolve.d.ts +0 -4
  350. package/dist/runner-boundary/runner-boundary.run-guard.d.ts +0 -12
  351. package/dist/runner-boundary/runner-boundary.types.d.ts +0 -31
  352. package/dist/runner-config-backfill.d.ts +0 -18
  353. package/dist/runner-identity.d.ts +0 -21
  354. package/dist/runtime-identity.d.ts +0 -9
  355. package/dist/runtime-memory-envelope.d.ts +0 -16
  356. package/dist/scheduler-cutover-cli.d.ts +0 -2
  357. package/dist/scheduler-cutover.d.ts +0 -25
  358. package/dist/security-review-environment.d.ts +0 -27
  359. package/dist/server/adapter-contract.d.ts +0 -1
  360. package/dist/server/cleanup.d.ts +0 -3
  361. package/dist/server/context-budget-receipt.d.ts +0 -2
  362. package/dist/server/db-credentials.d.ts +0 -1
  363. package/dist/server/default-repo.d.ts +0 -1
  364. package/dist/server/harness-notice.d.ts +0 -2
  365. package/dist/server/heavy-verification.d.ts +0 -3
  366. package/dist/server/landing.d.ts +0 -1
  367. package/dist/server/memory-cost-enforce.d.ts +0 -1
  368. package/dist/server/memory-cost.d.ts +0 -1
  369. package/dist/server/model-routing.d.ts +0 -3
  370. package/dist/server/monitor.d.ts +0 -3
  371. package/dist/server/node-runtime-policy.d.ts +0 -1
  372. package/dist/server/orchestration.d.ts +0 -10
  373. package/dist/server/pr-evidence.d.ts +0 -2
  374. package/dist/server/prompt.d.ts +0 -1
  375. package/dist/server/repo-search.d.ts +0 -1
  376. package/dist/server/worker-policy.d.ts +0 -6
  377. package/dist/server/wsl-crash-dumps.d.ts +0 -2
  378. package/dist/shell-command-outcome.d.ts +0 -32
  379. package/dist/sidecar-cli.d.ts +0 -16
  380. package/dist/stale-reconcile.d.ts +0 -31
  381. package/dist/start-box-identity.d.ts +0 -12
  382. package/dist/start.d.ts +0 -13
  383. package/dist/status.d.ts +0 -260
  384. package/dist/stream.d.ts +0 -20
  385. package/dist/supervisor.d.ts +0 -40
  386. package/dist/sweep.d.ts +0 -1
  387. package/dist/util.d.ts +0 -35
  388. package/dist/validate.d.ts +0 -15
  389. package/dist/vercel/index.d.ts +0 -4
  390. package/dist/vercel/vercel-api.d.ts +0 -17
  391. package/dist/vercel/vercel-evidence.d.ts +0 -48
  392. package/dist/vercel/vercel-github-status.d.ts +0 -19
  393. package/dist/vercel/vercel-url.d.ts +0 -18
  394. package/dist/verify-live/verify-live-prompt.d.ts +0 -2
  395. package/dist/worker-cap-source.d.ts +0 -29
  396. package/dist/worker-env.d.ts +0 -52
  397. package/dist/worker-execution-mode.d.ts +0 -5
  398. package/dist/worker-final-result-embed.d.ts +0 -1
  399. package/dist/worker-lease-sync.d.ts +0 -15
  400. package/dist/worker-lifecycle.d.ts +0 -28
  401. package/dist/worker-metadata-paths.d.ts +0 -26
  402. package/dist/worker-metadata-reconcile.d.ts +0 -21
  403. package/dist/worker-ops.d.ts +0 -45
  404. package/dist/worker-persona-catalog.d.ts +0 -29
  405. package/dist/worker-provider-policy.d.ts +0 -26
  406. package/dist/workspace-runtime-config.d.ts +0 -10
  407. package/dist/worktree-base-ref.d.ts +0 -34
  408. package/dist/worktree-completion-handoff.d.ts +0 -17
  409. package/dist/worktree.d.ts +0 -11
  410. package/dist/wsl-crash-dumps-cleanup.d.ts +0 -31
  411. package/dist/wsl-crash-dumps-cli.d.ts +0 -1
  412. package/dist/wsl-crash-dumps.d.ts +0 -90
  413. package/dist/wsl-host.d.ts +0 -71
@@ -1,25 +0,0 @@
1
- export interface LocalPrAttentionReconcileOutcome {
2
- runId: string;
3
- worker: string;
4
- action: "marked_done" | "skipped";
5
- reason: string;
6
- prUrl?: string;
7
- mergeCommit?: string | null;
8
- }
9
- export interface LocalPrAttentionReconcileResult {
10
- workers: LocalPrAttentionReconcileOutcome[];
11
- }
12
- interface PrLookupResult {
13
- prUrl: string;
14
- state: string;
15
- mergedAt?: string | null;
16
- mergeCommit?: string | null;
17
- }
18
- export interface LocalPrAttentionReconcileOptions {
19
- lookupPr?: (input: {
20
- repoDir: string;
21
- prNumber: number;
22
- }) => PrLookupResult | null;
23
- }
24
- export declare function reconcileLocalOnlyMergedPrAttention(options?: LocalPrAttentionReconcileOptions): LocalPrAttentionReconcileResult;
25
- export {};
@@ -1,38 +0,0 @@
1
- export declare const ADMISSION_SLOT_KEY_PREFIX = "worker-slot-n:";
2
- export interface AdmissionSlotDecision {
3
- admitted: boolean;
4
- /** Set when admitted via a numbered reservation (absent in off/shadow no-op admits). */
5
- slot?: number;
6
- reason?: "disk_backstop" | "slots_exhausted";
7
- }
8
- /**
9
- * Pre-spawn admission (enforce only; off/shadow admit unconditionally — the
10
- * existing gate stays authoritative there). `diskActiveWorkers` MUST be a
11
- * fresh count taken at call time, not the tick-start gate sample.
12
- */
13
- export declare function acquireWorkerAdmissionSlot(input: {
14
- runId: string;
15
- workerName: string;
16
- maxSlots: number;
17
- diskActiveWorkers: number;
18
- }): AdmissionSlotDecision;
19
- /** Free the numbered slot a worker holds (terminal transition / spawn abort). Never throws. */
20
- export declare function releaseWorkerAdmissionSlot(runId: string, workerName: string): void;
21
- /**
22
- * Per-tick numbered-slot reconcile (enforce only; called from the shared
23
- * admission reconcile): refresh slots whose owner worker is live, release
24
- * slots whose owner is provably dead, and adopt live workers holding no
25
- * slot (pre-flip spawns) so the reservation view converges with reality.
26
- */
27
- export declare function reconcileNumberedAdmissionSlots(input: {
28
- liveWorkers: Array<{
29
- runId: string;
30
- workerName: string;
31
- }>;
32
- }): {
33
- refreshed: number;
34
- deadReleased: number;
35
- adopted: number;
36
- };
37
- export declare function admissionEnforceCounters(): Record<string, number>;
38
- export declare function __resetAdmissionEnforceCountersForTests(): void;
@@ -1,56 +0,0 @@
1
- import type { LocalRunStoreSurfaceMode } from "./surface-flags.js";
2
- export declare const ADMISSION_RESERVATION_TTL_MS: number;
3
- /**
4
- * Re-arm the adoption pass when the surface is observed OFF (re-review
5
- * finding 2): workers spawned during an off window take no reservations, so
6
- * the first reconcile after an off→active flag transition must adopt them
7
- * silently — otherwise an operator toggling the emergency brake poisons the
8
- * `missingForLive` metric that gates D2b. Called from the tick's off branch
9
- * (the reconcile itself never runs while off).
10
- */
11
- export declare function rearmAdmissionAdoptionPass(): void;
12
- export declare function admissionMode(env?: NodeJS.ProcessEnv): LocalRunStoreSurfaceMode;
13
- /** Take/refresh the reservation for a spawned worker. Never throws. */
14
- export declare function takeWorkerSlotReservation(runId: string, workerName: string): void;
15
- /** Release on worker terminal transition. Never throws. */
16
- export declare function releaseWorkerSlotReservation(runId: string, workerName: string): void;
17
- export interface AdmissionShadowReconcile {
18
- liveReservations: number;
19
- refreshed: number;
20
- deadReleased: number;
21
- /** Pre-reconcile: live workers with no reservation (missed takes; 0 on the adoption pass). */
22
- missingForLive: number;
23
- /** Pre-reconcile: reservations with no live worker (crash backstop firing OR a missed release). */
24
- orphaned: number;
25
- /** True when this call was the silent adoption pass. */
26
- adoptionPass: boolean;
27
- }
28
- /**
29
- * Per-tick reconcile with PRE-reconcile classified measurement (review B —
30
- * measuring after adoption/release repaired the evidence made the old parity
31
- * count a tautology; comparing against a minutes-earlier disk sample made it
32
- * noise). The instrument now compares like-for-like at the same instant,
33
- * BEFORE repairing anything:
34
- *
35
- * - `missingForLive` (counted as divergence, post-adoption-pass): a live
36
- * worker with no reservation means `takeWorkerSlotReservation` missed —
37
- * a real lifecycle defect. Reads as: broken take → non-zero every tick.
38
- * - `orphaned` (reported, folded into `deadSlotsReleased` when released):
39
- * crash-terminated workers legitimately leave orphans for the reconcile
40
- * to reap — that is the design's crash backstop, not a defect. A broken
41
- * COMPLETION-release shows up as `deadSlotsReleased` trending with the
42
- * completion rate instead of the (rare) crash rate.
43
- *
44
- * Then the repair: refresh live slots, adopt missing ones, release dead
45
- * ones. No cross-time disk-count comparison exists anymore.
46
- */
47
- export declare function reconcileAdmissionShadow(input: {
48
- /** Live workers by identity (from the same records the gate counts). */
49
- liveWorkers: Array<{
50
- runId: string;
51
- workerName: string;
52
- }>;
53
- }): AdmissionShadowReconcile;
54
- /** Counters snapshot for the operator-tick posture (surface active only). */
55
- export declare function admissionShadowCounters(): Record<string, number>;
56
- export declare function __resetAdmissionShadowCountersForTests(): void;
@@ -1,11 +0,0 @@
1
- import { type StrandedClaimRecoveryResult } from "./dispatch-claim-recovery.js";
2
- export declare function __resetStartupClaimRecoveryForTests(): void;
3
- export declare function maybeRunStartupClaimRecovery(input: {
4
- agentOsId: string;
5
- baseUrl: string;
6
- secret: string;
7
- hasLiveWorker: (intent: {
8
- runId: string;
9
- workerName: string;
10
- }) => boolean;
11
- }): Promise<StrandedClaimRecoveryResult | null>;
@@ -1,54 +0,0 @@
1
- export interface StrandedClaimRecoveryOutcome {
2
- taskId: string;
3
- leaseToken: string;
4
- runId: string | null;
5
- workerName: string | null;
6
- action: "released" | "finalized_late" | "deferred_orphan" | "release_refused" | "deferred_transport" | "skipped";
7
- detail?: string;
8
- }
9
- export interface StrandedClaimRecoveryResult {
10
- mode: "off" | "shadow" | "enforce";
11
- scanned: number;
12
- outcomes: StrandedClaimRecoveryOutcome[];
13
- }
14
- /**
15
- * Scan /proc for a live process whose cmdline references `pathFragment`.
16
- * Linux only — on other platforms the probe reports no orphan, so recovery
17
- * PROCEEDS TO RELEASE after the stall window (review A6: an unfindable
18
- * orphan can never report anyway — it has no worker record — so the release
19
- * narrows the pre-existing 1 h expiry window rather than adding risk; prod
20
- * boxes are Linux). Bounded, never throws.
21
- */
22
- export declare function findLiveProcessByCmdlinePath(pathFragment: string): number | null;
23
- export interface RecoverStrandedClaimsOptions {
24
- nowMs?: number;
25
- strandedAfterMs?: number;
26
- /** Same liveness delegation as the shadow scan (worker.json + pid). */
27
- hasLiveWorker: (intent: {
28
- runId: string;
29
- workerName: string;
30
- }) => boolean;
31
- /** Derive the deterministic worktree path for a claim's spawn intent. */
32
- worktreePathFor: (intent: {
33
- runId: string;
34
- workerName: string;
35
- }) => string;
36
- /** Injectable orphan probe (defaults to the /proc cmdline scan). */
37
- findOrphanPid?: (worktreePath: string) => number | null;
38
- /**
39
- * Perform the server release for one stranded claim. MUST present the
40
- * claim's lease token (§7.7). Returns released=true only on server ack.
41
- */
42
- releaseClaim: (input: {
43
- taskId: string;
44
- leaseToken: string;
45
- runId: string;
46
- }) => Promise<{
47
- released: boolean;
48
- transportError?: boolean;
49
- detail?: string;
50
- }>;
51
- }
52
- export declare function recoverStrandedDispatchClaims(opts: RecoverStrandedClaimsOptions): Promise<StrandedClaimRecoveryResult>;
53
- export declare function dispatchClaimRecoveryCounters(): Record<string, number>;
54
- export declare function __resetDispatchClaimRecoveryForTests(): void;
@@ -1,90 +0,0 @@
1
- import { type LocalRunStoreSurfaceMode } from "./surface-flags.js";
2
- export interface DispatchReceiptIdentity {
3
- taskId: string;
4
- leaseToken: string;
5
- }
6
- export interface DispatchClaimIntent extends DispatchReceiptIdentity {
7
- runId: string;
8
- workerName: string;
9
- provider: string | null;
10
- }
11
- export declare function dispatchReceiptsMode(env?: NodeJS.ProcessEnv): LocalRunStoreSurfaceMode;
12
- export declare function recordDispatchClaimReceipt(intent: DispatchClaimIntent): void;
13
- export declare function recordDispatchSpawnedReceipt(identity: DispatchReceiptIdentity): void;
14
- export declare function recordDispatchReleasedReceipt(identity: DispatchReceiptIdentity, reasonClass: string): void;
15
- export declare function recordCompletionSentReceipt(identity: DispatchReceiptIdentity): void;
16
- export declare function recordCompletionAckedReceipt(identity: DispatchReceiptIdentity, outcome: "acknowledged" | "rejected"): void;
17
- /**
18
- * Shadow invariant: the worker record says this completion still needs to be
19
- * POSTed, but the store already holds a `completion-acked` receipt — the ack
20
- * was recorded locally and then lost from worker.json (torn ack / replay).
21
- * Report-only: the POST still happens (server idempotency absorbs it); the
22
- * divergence is counted so the shadow window can prove how often replays are
23
- * store-detectable before D1b short-circuits them.
24
- */
25
- export declare function noteCompletionReplayIfAcked(identity: DispatchReceiptIdentity): boolean;
26
- /** Reason-class extraction for released receipts (never the full detail text). */
27
- export declare function releaseReasonClass(failureDetail: string | null | undefined): string;
28
- /**
29
- * D1b — completion replay short-circuit: in ENFORCE mode a worker replaying a
30
- * completion whose ack the store already holds (outcome "acknowledged") skips
31
- * the POST entirely — the local receipt is authoritative for "the server
32
- * already accepted this". Shadow/off keep today's behavior (POST proceeds,
33
- * server idempotency absorbs it). The observation counter still fires via
34
- * `noteCompletionReplayIfAcked` at the call site; this adds the decision.
35
- */
36
- export declare function shouldShortCircuitCompletionReplay(identity: DispatchReceiptIdentity): boolean;
37
- export declare function recordDispatchStartFailedReceipt(taskId: string, runId: string): void;
38
- export declare function listRecentDispatchStartFailures(runId: string, opts?: {
39
- nowMs?: number;
40
- windowMs?: number;
41
- }): string[];
42
- /**
43
- * Attempt embedded in a lease token (`${attempt}:${uuid}`), or null. D1b R2:
44
- * completion-ack exclusion must be attempt-aware — a PRIOR attempt's ack must
45
- * not mask a LATER claim's stranding.
46
- */
47
- export declare function leaseTokenAttempt(token: string): number | null;
48
- export interface DispatchReceiptInvariantScan {
49
- scannedClaims: number;
50
- /** Claim receipts past the stall window with no spawned/released receipt and no live worker. */
51
- strandedClaimCandidates: number;
52
- /** Bracketed/aged receipt rows removed this scan (retention). */
53
- prunedReceipts: number;
54
- }
55
- /**
56
- * Report-only shadow scan (review-N1 hardened): the window is recency-bounded
57
- * (`recordedAfter`, 7 days) AND self-pruning — bracketed (spawned/released)
58
- * claim trios older than 24 h are deleted each scan, so old bracketed claims
59
- * can never pin the window and blind the counter on a busy box.
60
- *
61
- * A claim with a LIVE worker is never a candidate — that is the crux case
62
- * (crash between spawn and the `spawned` receipt), and flagging it would
63
- * train operators to distrust the counter. A claim whose task already holds a
64
- * `completion-acked` receipt is never a candidate either (review N4: a
65
- * crux-crashed claim whose worker went on to finish and report is closed
66
- * evidence, not a stranding). Liveness is delegated via `hasLiveWorker` so
67
- * this module stays free of run-store imports.
68
- *
69
- * Known false-positive class (documented, closed by D1b's worktree-path
70
- * probe): a crash between `provider.start` and `saveWorker` leaves a live
71
- * ORPHAN child with no worker record — the worker.json-based probe cannot see
72
- * it, so it counts as stranded until the orphan exits.
73
- *
74
- * Scope: `spawnClaimed` dispatches only. land_pr dispatches carry no claim
75
- * receipts (plan D1a item 1); their aborts share `abortClaimedSpawn` and may
76
- * emit `released` receipts with no matching claim — harmless, the scan
77
- * iterates claims only.
78
- */
79
- export declare function scanDispatchReceiptInvariants(options?: {
80
- nowMs?: number;
81
- strandedAfterMs?: number;
82
- hasLiveWorker?: (intent: {
83
- runId: string;
84
- workerName: string;
85
- }) => boolean;
86
- }): DispatchReceiptInvariantScan;
87
- /** Counters snapshot for the operator-tick posture (report-only). */
88
- export declare function dispatchReceiptCounters(): Record<string, number>;
89
- /** Test-only: reset in-memory shadow counters. */
90
- export declare function __resetDispatchReceiptCountersForTests(): void;
@@ -1,15 +0,0 @@
1
- export type { AdmissionReservation, LocalRunStore, OperationReceiptRecord, ProcessIdentityRecord, RecoveryCheckpointRecord, ReserveOutcome, } from "./local-run-store.js";
2
- export { classifyDatabaseDirectory, type ClassifyOptions, type FilesystemClassification, } from "./sqlite/sqlite-filesystem-policy.js";
3
- export { LOCAL_SCHEMA_VERSION, SchemaDowngradeRefusedError, } from "./sqlite/sqlite-schema.js";
4
- export { FilesystemPolicyError, SqliteLocalRunStore, type OpenSqliteLocalRunStoreOptions, } from "./sqlite/sqlite-local-run-store.js";
5
- export { openSqliteLocalRunStoreWithRecovery, type OpenWithRecoveryResult, } from "./sqlite/sqlite-recovery.js";
6
- export { __resetLocalRunStoreLifecycleForTests, __setLocalRunStoreLifecycleTestOverrides, closeLocalRunStore, getLocalRunStore, getLocalRunStoreLifecycleStatus, LOCAL_RUN_STORE_OPEN_RETRY_MS, probeLocalRunStore, type LocalRunStoreLifecycleStatus, } from "./store-lifecycle.js";
7
- export { __resetDispatchReceiptCountersForTests, dispatchReceiptCounters, dispatchReceiptsMode, noteCompletionReplayIfAcked, recordCompletionAckedReceipt, recordCompletionSentReceipt, recordDispatchClaimReceipt, recordDispatchReleasedReceipt, recordDispatchSpawnedReceipt, recordDispatchStartFailedReceipt, listRecentDispatchStartFailures, leaseTokenAttempt, releaseReasonClass, scanDispatchReceiptInvariants, shouldShortCircuitCompletionReplay, type DispatchClaimIntent, type DispatchReceiptIdentity, type DispatchReceiptInvariantScan, } from "./dispatch-receipts.js";
8
- export { dispatchClaimRecoveryCounters, findLiveProcessByCmdlinePath, recoverStrandedDispatchClaims, __resetDispatchClaimRecoveryForTests, type RecoverStrandedClaimsOptions, type StrandedClaimRecoveryOutcome, type StrandedClaimRecoveryResult, } from "./dispatch-claim-recovery.js";
9
- export { maybeRunStartupClaimRecovery, __resetStartupClaimRecoveryForTests, } from "./dispatch-claim-recovery-startup.js";
10
- export { anyLocalRunStoreSurfaceActive, LOCAL_RUN_STORE_SURFACES, parseLocalRunStoreSurfaceMode, resolveLocalRunStoreSurfaceFlags, type LocalRunStoreSurfaceDefinition, type LocalRunStoreSurfaceFlags, type LocalRunStoreSurfaceKey, type LocalRunStoreSurfaceMode, type ResolvedLocalRunStoreSurfaceFlags, } from "./surface-flags.js";
11
- export { buildLocalRunStoreTickPosture, type LocalRunStoreTickPosture, } from "./tick-posture.js";
12
- export { __resetAdmissionShadowCountersForTests, admissionShadowCounters, ADMISSION_RESERVATION_TTL_MS, rearmAdmissionAdoptionPass, reconcileAdmissionShadow, releaseWorkerSlotReservation, takeWorkerSlotReservation, type AdmissionShadowReconcile, } from "./admission-shadow.js";
13
- export { acquireWorkerAdmissionSlot, admissionEnforceCounters, ADMISSION_SLOT_KEY_PREFIX, reconcileNumberedAdmissionSlots, releaseWorkerAdmissionSlot, __resetAdmissionEnforceCountersForTests, type AdmissionSlotDecision, } from "./admission-enforce.js";
14
- export { __resetSmallSurfaceCountersForTests, assessQuotaCooldownReservation, clearQuotaCooldownReservation, readMeshLeaseCheckpoint, recordQuotaCooldownReservation, restoreKeeperBackoffCheckpoint, saveKeeperBackoffCheckpoint, saveMeshLeaseCheckpoint, smallSurfaceCounters, type MeshLeaseGrant, } from "./small-surfaces.js";
15
- export { __resetRemoteSurfaceFlagsCacheForTests, extractLocalRunStoreFlagsFromOperatorTickResponse, getRemoteSurfaceFlags, persistRemoteSurfaceFlags, remoteSurfaceFlagsPath, type RemoteSurfaceModeMap, } from "./remote-surface-flags.js";
@@ -1,106 +0,0 @@
1
- /**
2
- * Node 24 migration N4.1 — the replaceable LocalRunStore adapter contract.
3
- *
4
- * Covers ONLY host-local concerns the durable-harness plan needs:
5
- * attempt/process identity, admission reservations, operation
6
- * receipts/idempotency, recovery checkpoints, and the local schema version.
7
- * It deliberately does NOT model global AgentOS task authority —
8
- * AgentOS/PostgreSQL stays authoritative; nothing here may become a source
9
- * of truth for tasks, plans, or audit.
10
- *
11
- * Implementations: sqlite/ (qualification under N4). A future fallback
12
- * implementation must pass the same contract suite
13
- * (__tests__/local-run-store/contract-suite.ts).
14
- */
15
- export interface ProcessIdentityRecord {
16
- processKey: string;
17
- pid: number;
18
- runtimeVersion: string;
19
- nodeVersion: string;
20
- startedAt: string;
21
- registeredAt: string;
22
- }
23
- export interface AdmissionReservation {
24
- key: string;
25
- owner: string;
26
- expiresAt: string;
27
- }
28
- export interface ReserveOutcome {
29
- acquired: boolean;
30
- /** The live reservation after the attempt (the winner's, not necessarily the caller's). */
31
- current: AdmissionReservation;
32
- }
33
- export interface OperationReceiptRecord {
34
- idempotencyKey: string;
35
- operation: string;
36
- resultJson: string | null;
37
- recordedAt: string;
38
- }
39
- export interface RecoveryCheckpointRecord {
40
- scope: string;
41
- seq: number;
42
- payloadJson: string;
43
- createdAt: string;
44
- }
45
- export interface LocalRunStore {
46
- /** Upsert this process's identity row (idempotent per processKey). */
47
- registerProcessIdentity(input: {
48
- processKey: string;
49
- pid: number;
50
- runtimeVersion: string;
51
- nodeVersion: string;
52
- startedAt: string;
53
- }): ProcessIdentityRecord;
54
- getProcessIdentity(processKey: string): ProcessIdentityRecord | null;
55
- /**
56
- * Try to acquire a keyed admission slot. An unexpired reservation held by
57
- * another owner loses; an expired one is replaced. Re-acquiring your own
58
- * live reservation refreshes it.
59
- */
60
- tryReserveAdmission(key: string, owner: string, ttlMs: number, now?: Date): ReserveOutcome;
61
- releaseAdmission(key: string, owner: string): boolean;
62
- /**
63
- * Bounded reservation scan (durable-harness D2 shadow parity + dead-slot
64
- * release): filter by escaped-LIKE key prefix; optionally include expired
65
- * rows (default live-only). Oldest expiry first.
66
- */
67
- listAdmissionReservations(input?: {
68
- keyPrefix?: string;
69
- includeExpired?: boolean;
70
- limit?: number;
71
- now?: Date;
72
- }): AdmissionReservation[];
73
- /** Record an operation receipt; a duplicate idempotency key is reported, never overwritten. */
74
- recordOperationReceipt(input: {
75
- idempotencyKey: string;
76
- operation: string;
77
- resultJson?: string | null;
78
- }): {
79
- deduplicated: boolean;
80
- };
81
- getOperationReceipt(idempotencyKey: string): OperationReceiptRecord | null;
82
- /**
83
- * Bounded receipt scan for invariant checks (durable-harness D1 shadow):
84
- * filter by exact `operation`, key prefix, and/or a recency floor
85
- * (`recordedAfter`, ISO — strictly newer than), oldest first. `limit`
86
- * defaults to a small bound — this is a diagnostic surface, not a query
87
- * engine.
88
- */
89
- listOperationReceipts(input?: {
90
- operation?: string;
91
- keyPrefix?: string;
92
- recordedAfter?: string;
93
- limit?: number;
94
- }): OperationReceiptRecord[];
95
- /** Delete receipts by exact key (retention pruning). Returns rows removed. */
96
- deleteOperationReceiptsByKeys(keys: string[]): number;
97
- saveRecoveryCheckpoint(input: {
98
- scope: string;
99
- payloadJson: string;
100
- }): {
101
- seq: number;
102
- };
103
- latestRecoveryCheckpoint(scope: string): RecoveryCheckpointRecord | null;
104
- localSchemaVersion(): number;
105
- close(): void;
106
- }
@@ -1,15 +0,0 @@
1
- import type { LocalRunStoreSurfaceKey, LocalRunStoreSurfaceMode } from "./surface-flags.js";
2
- export type RemoteSurfaceModeMap = Partial<Record<LocalRunStoreSurfaceKey, LocalRunStoreSurfaceMode>>;
3
- export declare function remoteSurfaceFlagsPath(agentOsId: string): string;
4
- /** Pull the delivered flag map off an operator-tick response (tolerant). */
5
- export declare function extractLocalRunStoreFlagsFromOperatorTickResponse(operatorTick: unknown): RemoteSurfaceModeMap | null;
6
- /** Persist a delivery atomically and refresh the in-process cache. Never throws. */
7
- export declare function persistRemoteSurfaceFlags(agentOsId: string, flags: RemoteSurfaceModeMap): void;
8
- /**
9
- * Server-delivered modes for this box (cached). Empty map when nothing has
10
- * ever been delivered, the file is unreadable, or no workspace is configured.
11
- * Never throws.
12
- */
13
- export declare function getRemoteSurfaceFlags(nowMs?: number): RemoteSurfaceModeMap;
14
- /** Test-only: drop the cache so the next read hits disk. */
15
- export declare function __resetRemoteSurfaceFlagsCacheForTests(): void;
@@ -1,37 +0,0 @@
1
- /** Matches the keeper's HEALTHY_RESET window — older counts are stale evidence. */
2
- export declare const KEEPER_CHECKPOINT_MAX_AGE_MS: number;
3
- export declare function saveKeeperBackoffCheckpoint(input: {
4
- consecutiveFailures: number;
5
- exitCode: number | null;
6
- exitSignal: string | null;
7
- }): void;
8
- /** Enforce only: resume the failure count across keeper restarts. */
9
- export declare function restoreKeeperBackoffCheckpoint(): number | null;
10
- export interface MeshLeaseGrant {
11
- leaseToken: string | null;
12
- holderBoxId: string | null;
13
- authorized: boolean;
14
- updatedAt: string;
15
- }
16
- export declare function saveMeshLeaseCheckpoint(runId: string, grant: MeshLeaseGrant): void;
17
- /**
18
- * Enforce: the store is the read source (JSON kept for external readers).
19
- * Shadow: returns null (JSON stays authoritative) but counts divergence
20
- * against the JSON value the caller read.
21
- */
22
- export declare function readMeshLeaseCheckpoint(runId: string, jsonValue: MeshLeaseGrant | null): MeshLeaseGrant | null;
23
- export declare function recordQuotaCooldownReservation(provider: string, cooldownMs: number): void;
24
- export declare function clearQuotaCooldownReservation(provider: string): void;
25
- /**
26
- * The reservation-backed cooldown verdict. Enforce: this IS the verdict
27
- * (race-free record/prune; a torn JSON can no longer fail open into attempt
28
- * burns). Shadow: returns null (JSON verdict stands) but counts divergence
29
- * against it. Returns the reservation's expiry when cooling down, null when
30
- * clear.
31
- */
32
- export declare function assessQuotaCooldownReservation(provider: string, jsonBlocked: boolean): {
33
- blocked: boolean;
34
- retryAtIso: string | null;
35
- } | null;
36
- export declare function smallSurfaceCounters(): Record<string, number>;
37
- export declare function __resetSmallSurfaceCountersForTests(): void;
@@ -1,16 +0,0 @@
1
- export interface FilesystemClassification {
2
- verdict: "accepted" | "rejected";
3
- /** Bounded operator-facing reason; never environment values. */
4
- reason: string;
5
- filesystemType: string | null;
6
- mountPoint: string | null;
7
- /** Realpath-resolved nearest existing ancestor the classification applied to. */
8
- resolvedPath: string;
9
- }
10
- export interface ClassifyOptions {
11
- /** Injectable mounts content (tests); default reads /proc/self/mounts. Return null when unavailable. */
12
- mountsSource?: () => string | null;
13
- /** Injectable realpath (tests); default resolves via the filesystem. */
14
- resolveRealPath?: (p: string) => string;
15
- }
16
- export declare function classifyDatabaseDirectory(directory: string, options?: ClassifyOptions): FilesystemClassification;
@@ -1,68 +0,0 @@
1
- import type { AdmissionReservation, LocalRunStore, OperationReceiptRecord, ProcessIdentityRecord, RecoveryCheckpointRecord, ReserveOutcome } from "../local-run-store.js";
2
- import { type ClassifyOptions } from "./sqlite-filesystem-policy.js";
3
- export declare class FilesystemPolicyError extends Error {
4
- constructor(reason: string);
5
- }
6
- export interface OpenSqliteLocalRunStoreOptions {
7
- directory: string;
8
- filename?: string;
9
- /** Busy timeout in ms (writer contention wait). */
10
- busyTimeoutMs?: number;
11
- /** Test injection for the filesystem policy. */
12
- classifyOptions?: ClassifyOptions;
13
- now?: () => Date;
14
- }
15
- export declare class SqliteLocalRunStore implements LocalRunStore {
16
- private readonly db;
17
- private readonly now;
18
- readonly databasePath: string;
19
- private constructor();
20
- static open(options: OpenSqliteLocalRunStoreOptions): SqliteLocalRunStore;
21
- /** Writer helper — every mutation runs inside BEGIN IMMEDIATE. */
22
- private inImmediateTransaction;
23
- registerProcessIdentity(input: {
24
- processKey: string;
25
- pid: number;
26
- runtimeVersion: string;
27
- nodeVersion: string;
28
- startedAt: string;
29
- }): ProcessIdentityRecord;
30
- getProcessIdentity(processKey: string): ProcessIdentityRecord | null;
31
- tryReserveAdmission(key: string, owner: string, ttlMs: number, now?: Date): ReserveOutcome;
32
- releaseAdmission(key: string, owner: string): boolean;
33
- listAdmissionReservations(input?: {
34
- keyPrefix?: string;
35
- includeExpired?: boolean;
36
- limit?: number;
37
- now?: Date;
38
- }): AdmissionReservation[];
39
- recordOperationReceipt(input: {
40
- idempotencyKey: string;
41
- operation: string;
42
- resultJson?: string | null;
43
- }): {
44
- deduplicated: boolean;
45
- };
46
- listOperationReceipts(input?: {
47
- operation?: string;
48
- keyPrefix?: string;
49
- recordedAfter?: string;
50
- limit?: number;
51
- }): OperationReceiptRecord[];
52
- deleteOperationReceiptsByKeys(keys: string[]): number;
53
- getOperationReceipt(idempotencyKey: string): OperationReceiptRecord | null;
54
- saveRecoveryCheckpoint(input: {
55
- scope: string;
56
- payloadJson: string;
57
- }): {
58
- seq: number;
59
- };
60
- latestRecoveryCheckpoint(scope: string): RecoveryCheckpointRecord | null;
61
- localSchemaVersion(): number;
62
- /** Explicit checkpoint policy: truncate the WAL back into the main db. */
63
- checkpointTruncate(): void;
64
- integrityCheck(): boolean;
65
- /** Read-only config readback used by qualification assertions. */
66
- pragma(name: "journal_mode" | "synchronous"): string;
67
- close(): void;
68
- }
@@ -1,14 +0,0 @@
1
- import { SqliteLocalRunStore, type OpenSqliteLocalRunStoreOptions } from "./sqlite-local-run-store.js";
2
- export interface OpenWithRecoveryResult {
3
- store: SqliteLocalRunStore;
4
- recovered: boolean;
5
- quarantinedTo: string | null;
6
- }
7
- /**
8
- * Open the store; on open failure or integrity failure, quarantine and
9
- * rebuild fresh. Schema-downgrade refusals are NOT recovered — a newer
10
- * schema is an operator decision, not corruption.
11
- */
12
- export declare function openSqliteLocalRunStoreWithRecovery(options: OpenSqliteLocalRunStoreOptions & {
13
- quarantineStamp?: string;
14
- }): OpenWithRecoveryResult;
@@ -1,13 +0,0 @@
1
- /**
2
- * Node 24 migration N4.3 — explicit versioned schema for the SQLite
3
- * local-run-store qualification. Upgrades run forward only; a database
4
- * written by a NEWER schema is refused (downgrade is not assumed safe).
5
- */
6
- import type { DatabaseSync } from "node:sqlite";
7
- export declare const LOCAL_SCHEMA_VERSION = 1;
8
- export declare class SchemaDowngradeRefusedError extends Error {
9
- constructor(found: number, supported: number);
10
- }
11
- export declare function readStoredSchemaVersion(db: DatabaseSync): number | null;
12
- /** Apply/upgrade the schema; refuses downgrade. Caller must already hold the connection. */
13
- export declare function applyLocalRunStoreSchema(db: DatabaseSync, nowIso: string): void;
@@ -1,38 +0,0 @@
1
- import type { LocalRunStore } from "./local-run-store.js";
2
- import type { ClassifyOptions } from "./sqlite/sqlite-filesystem-policy.js";
3
- interface LifecycleTestOverrides {
4
- classifyOptions?: ClassifyOptions;
5
- }
6
- /** Test-only: inject filesystem-policy classification (cross-platform temp dirs). */
7
- export declare function __setLocalRunStoreLifecycleTestOverrides(overrides: LifecycleTestOverrides): void;
8
- export interface LocalRunStoreLifecycleStatus {
9
- /** `open` — handle live; `unavailable` — open failed (reason set); `unopened` — not yet requested. */
10
- state: "open" | "unavailable" | "unopened";
11
- harnessRoot: string | null;
12
- databasePath: string | null;
13
- schemaVersion: number | null;
14
- /** True when open had to quarantine a corrupt db and rebuild fresh. */
15
- recovered: boolean;
16
- quarantinedTo: string | null;
17
- /** Failure classification when unavailable (message, no payloads). */
18
- reason: string | null;
19
- /** Total open attempts this process (retry churn indicator). */
20
- openAttempts: number;
21
- }
22
- /** Backoff window before an unavailable store is re-probed (D1a precondition). */
23
- export declare const LOCAL_RUN_STORE_OPEN_RETRY_MS: number;
24
- /**
25
- * The process-wide store handle, or `null` when the store cannot open.
26
- * Never throws. A changed harness root (tests, reconfiguration) re-opens; a
27
- * transient open failure is retried after the backoff window.
28
- */
29
- export declare function getLocalRunStore(nowMs?: number): LocalRunStore | null;
30
- /** Lifecycle status without forcing an open (state `unopened` before first use). */
31
- export declare function getLocalRunStoreLifecycleStatus(): LocalRunStoreLifecycleStatus;
32
- /** Open (if needed) and report status in one call — the doctor/tick probe. */
33
- export declare function probeLocalRunStore(): LocalRunStoreLifecycleStatus;
34
- /** Close and forget the handle (tests, daemon shutdown). Never throws. */
35
- export declare function closeLocalRunStore(): void;
36
- /** Test-only: full reset including the process open-attempt counter. */
37
- export declare function __resetLocalRunStoreLifecycleForTests(): void;
38
- export {};