@sema-agent/server 7.146.0 → 7.147.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 (398) hide show
  1. package/MIGRATION.md +384 -0
  2. package/README.md +1 -1
  3. package/README.zh-CN.md +1 -1
  4. package/USAGE.md +170 -66
  5. package/deploy/facts/lanes.json +7 -0
  6. package/deploy/sema-up/README.md +2 -2
  7. package/deploy/sema-up/chart/templates/_helpers.tpl +22 -0
  8. package/deploy/sema-up/chart/templates/server-v4pro.yaml +5 -4
  9. package/deploy/sema-up/chart/templates/server.yaml +5 -4
  10. package/deploy/sema-up/chart/values.yaml +1 -1
  11. package/deploy/sema-up/cluster-up.sh +2 -1
  12. package/deploy/sema-up/lib/flagshape.sh +4 -0
  13. package/deploy/sema-up/lib/lanes.json +2 -5
  14. package/deploy/sema-up/sema-up.sh +12 -9
  15. package/deploy/sema-up/stack/compose.yaml +5 -4
  16. package/deploy/sema-up/stack/sema-stack-cluster.yaml +4 -3
  17. package/dist/approval-card.d.ts +4 -4
  18. package/dist/approval.d.ts +3 -3
  19. package/dist/audit.js +2 -2
  20. package/dist/bench/s1/live-deps.js +3 -1
  21. package/dist/boot/crash-last.js +2 -1
  22. package/dist/boot/device-lane.js +5 -5
  23. package/dist/boot/engine-lease.d.ts +12 -11
  24. package/dist/boot/execution-env.d.ts +2 -1
  25. package/dist/boot/execution-env.js +45 -33
  26. package/dist/boot/execution-lane.d.ts +37 -9
  27. package/dist/boot/execution-lane.js +74 -20
  28. package/dist/boot/exit-boundary.d.ts +1 -1
  29. package/dist/boot/exit-last.js +2 -1
  30. package/dist/boot/governance-seams.d.ts +2 -2
  31. package/dist/boot/leader.js +1 -1
  32. package/dist/boot/memory-boundary.d.ts +11 -11
  33. package/dist/boot/memory-boundary.js +3 -3
  34. package/dist/boot/memory-consolidation.d.ts +13 -24
  35. package/dist/boot/memory-consolidation.js +0 -13
  36. package/dist/boot/org-memory.js +3 -2
  37. package/dist/boot/parked-revive-gate.d.ts +1 -1
  38. package/dist/boot/parked-revive-gate.js +1 -1
  39. package/dist/boot/reapers.js +1 -1
  40. package/dist/boot/resolve-spec.js +91 -111
  41. package/dist/boot/retention-lane.d.ts +4 -42
  42. package/dist/boot/session-faces.d.ts +1 -0
  43. package/dist/boot/session-faces.js +8 -2
  44. package/dist/boot/stage-01-config.d.ts +1 -1
  45. package/dist/boot/stage-01-config.js +6 -2
  46. package/dist/boot/stage-02-web-admin-pull.d.ts +1 -1
  47. package/dist/boot/stage-02-web-admin-pull.js +10 -8
  48. package/dist/boot/stage-03-store-backend.d.ts +1 -1
  49. package/dist/boot/stage-04-stores.d.ts +1 -1
  50. package/dist/boot/stage-05-execution-env.d.ts +2 -2
  51. package/dist/boot/stage-05-execution-env.js +3 -3
  52. package/dist/boot/stage-06-runners.d.ts +3 -3
  53. package/dist/boot/stage-06-runners.js +1 -3
  54. package/dist/boot/stage-07-capability-layer.d.ts +3 -3
  55. package/dist/boot/stage-07-capability-layer.js +4 -9
  56. package/dist/boot/stage-08-reapers.d.ts +3 -3
  57. package/dist/boot/stage-09-leader.d.ts +4 -3
  58. package/dist/boot/stage-10-http-server.d.ts +4 -3
  59. package/dist/boot/stage-10-http-server.js +2 -1
  60. package/dist/boot/stores.d.ts +9 -0
  61. package/dist/boot/stores.js +18 -7
  62. package/dist/boot/web-admin.js +3 -3
  63. package/dist/capabilities/center-plugins.d.ts +2 -0
  64. package/dist/capabilities/center-plugins.js +6 -2
  65. package/dist/capabilities/composite-members.d.ts +1 -0
  66. package/dist/capabilities/composite-members.js +1 -0
  67. package/dist/capabilities/execution-lane.d.ts +7 -7
  68. package/dist/capabilities/execution-lane.js +2 -2
  69. package/dist/capabilities/hands-lane.d.ts +1 -1
  70. package/dist/capabilities/scenarios.d.ts +32 -18
  71. package/dist/capabilities/scenarios.js +13 -9
  72. package/dist/capabilities/settings-contract.d.ts +29 -0
  73. package/dist/capabilities/settings-contract.js +14 -0
  74. package/dist/capabilities/skills.d.ts +5 -5
  75. package/dist/capability-facts.d.ts +38 -0
  76. package/dist/capability-facts.js +34 -1
  77. package/dist/center-credential-renewer.js +3 -2
  78. package/dist/config-catalog.js +6 -5
  79. package/dist/config-invariants.d.ts +18 -3
  80. package/dist/config-invariants.js +36 -19
  81. package/dist/config-lkg.d.ts +1 -1
  82. package/dist/config-lkg.js +5 -6
  83. package/dist/config-provider.js +2 -0
  84. package/dist/config-types.d.ts +190 -186
  85. package/dist/config.d.ts +68 -5
  86. package/dist/config.js +80 -54
  87. package/dist/degenerate-instrument.js +1 -1
  88. package/dist/deploy-facts.js +3 -2
  89. package/dist/deployment-shape.d.ts +21 -12
  90. package/dist/deployment-shape.js +24 -6
  91. package/dist/env-facts.d.ts +7 -5
  92. package/dist/env-facts.js +10 -6
  93. package/dist/execution-config-root.d.ts +5 -5
  94. package/dist/execution-config-root.js +5 -5
  95. package/dist/execution-env-purpose.d.ts +14 -0
  96. package/dist/execution-env-purpose.js +29 -0
  97. package/dist/execution-lane-caps.d.ts +49 -86
  98. package/dist/execution-lane-caps.js +52 -62
  99. package/dist/execution-placement.d.ts +18 -2
  100. package/dist/execution-placement.js +19 -0
  101. package/dist/file-history-disclosure.d.ts +2 -2
  102. package/dist/fleet/drain-entry.d.ts +17 -10
  103. package/dist/fleet/drain-entry.js +1 -1
  104. package/dist/fleet/serving-lease.js +3 -4
  105. package/dist/history-anchor.d.ts +22 -0
  106. package/dist/history-anchor.js +14 -0
  107. package/dist/hooks/command-spawn.d.ts +1 -4
  108. package/dist/hooks/command-spawn.js +0 -11
  109. package/dist/hooks/hook-runner.d.ts +52 -8
  110. package/dist/hooks/hook-runner.js +160 -36
  111. package/dist/http/approval-sweeps.d.ts +2 -5
  112. package/dist/http/approval-sweeps.js +3 -2
  113. package/dist/http/checkpoint-ctx.d.ts +17 -0
  114. package/dist/http/checkpoint-ctx.js +6 -0
  115. package/dist/http/claim-latency.d.ts +10 -0
  116. package/dist/http/claim-latency.js +12 -0
  117. package/dist/http/dispatch.js +1 -1
  118. package/dist/http/durable-run-leg.js +2 -1
  119. package/dist/http/execution-context.d.ts +3 -1
  120. package/dist/http/execution-context.js +4 -0
  121. package/dist/http/memory-compliance-failure-reply.d.ts +1 -1
  122. package/dist/http/memory-compliance-failure-reply.js +3 -0
  123. package/dist/http/memory-store-refusal-reply.d.ts +3 -3
  124. package/dist/http/memory-store-refusal-reply.js +3 -0
  125. package/dist/http/owner-access.d.ts +11 -0
  126. package/dist/http/owner-access.js +7 -4
  127. package/dist/http/principal-gate.d.ts +3 -14
  128. package/dist/http/principal-gate.js +0 -13
  129. package/dist/http/request-guards.d.ts +1 -1
  130. package/dist/http/resume-legs.d.ts +7 -10
  131. package/dist/http/resume-legs.js +79 -50
  132. package/dist/http/rewind-files-reply.d.ts +34 -0
  133. package/dist/http/rewind-files-reply.js +36 -0
  134. package/dist/http/route-ctx.d.ts +32 -16
  135. package/dist/http/route-table.js +2 -0
  136. package/dist/http/routes/approvals-assistant.js +5 -25
  137. package/dist/http/routes/capabilities.js +8 -2
  138. package/dist/http/routes/devices.js +1 -1
  139. package/dist/http/routes/memory-origin.d.ts +1 -1
  140. package/dist/http/routes/notify-wake.js +2 -1
  141. package/dist/http/routes/projects.d.ts +70 -0
  142. package/dist/http/routes/projects.js +86 -0
  143. package/dist/http/routes/rules.js +30 -2
  144. package/dist/http/routes/runs.js +8 -8
  145. package/dist/http/routes/session-sync.js +27 -10
  146. package/dist/http/routes/sessions.d.ts +7 -1
  147. package/dist/http/routes/sessions.js +104 -2
  148. package/dist/http/routes/tasks.js +9 -3
  149. package/dist/http/server.d.ts +24 -10
  150. package/dist/http/server.js +17 -6
  151. package/dist/http/stored-body-replay.d.ts +5 -3
  152. package/dist/http/stored-body-replay.js +10 -1
  153. package/dist/http/wire-types.d.ts +19 -10
  154. package/dist/index.d.ts +2 -2
  155. package/dist/index.js +1 -1
  156. package/dist/instruction-source-notice.d.ts +1 -1
  157. package/dist/memory-embedder-reembed.d.ts +38 -0
  158. package/dist/memory-embedder-reembed.js +20 -0
  159. package/dist/memory-incident-sink.d.ts +0 -28
  160. package/dist/memory-incident-sink.js +5 -0
  161. package/dist/memory-scope.d.ts +2 -2
  162. package/dist/memory-scope.js +1 -1
  163. package/dist/memory-store-refusal.d.ts +17 -4
  164. package/dist/memory-store-refusal.js +1 -1
  165. package/dist/memory-sync-client.d.ts +2 -0
  166. package/dist/memory-sync-client.js +13 -11
  167. package/dist/memory-sync.js +1 -1
  168. package/dist/model-compat.d.ts +35 -21
  169. package/dist/model-compat.js +49 -21
  170. package/dist/model-entry-refusal.d.ts +11 -1
  171. package/dist/model-entry-refusal.js +7 -0
  172. package/dist/namespaced-rule-name.d.ts +18 -1
  173. package/dist/namespaced-rule-name.js +12 -0
  174. package/dist/observability/fail-open.d.ts +17 -9
  175. package/dist/observability/fail-open.js +17 -9
  176. package/dist/observability/metrics.d.ts +2 -0
  177. package/dist/observability/metrics.js +2 -0
  178. package/dist/observability/secret-env-scrub.d.ts +30 -4
  179. package/dist/observability/secret-env-scrub.js +15 -3
  180. package/dist/orchestration/workflow-agent-session-index.d.ts +7 -12
  181. package/dist/orchestration/workflow-agent-session-index.js +1 -6
  182. package/dist/orchestration/workflow-completion-inbox.d.ts +26 -6
  183. package/dist/orchestration/workflow-completion-inbox.js +63 -45
  184. package/dist/org-memory-admission.d.ts +5 -2
  185. package/dist/org-memory-admission.js +25 -10
  186. package/dist/parked-decide.d.ts +33 -26
  187. package/dist/parked-decide.js +36 -44
  188. package/dist/plugins/approval-ask-store-file.d.ts +10 -2
  189. package/dist/plugins/approval-ask-store-file.js +37 -4
  190. package/dist/plugins/approval-ask-store-memory.d.ts +5 -3
  191. package/dist/plugins/approval-ask-store-memory.js +11 -2
  192. package/dist/plugins/approval-ask-store-sql.d.ts +3 -0
  193. package/dist/plugins/approval-ask-store-sql.js +3 -1
  194. package/dist/plugins/blob-backend.d.ts +38 -195
  195. package/dist/plugins/blob-backend.js +33 -229
  196. package/dist/plugins/caching-session-store.d.ts +9 -4
  197. package/dist/plugins/checkpoint-index-columns.d.ts +1 -1
  198. package/dist/plugins/checkpoint-index-columns.js +3 -2
  199. package/dist/plugins/checkpoint-store-face.d.ts +1 -1
  200. package/dist/plugins/device-store-sql.d.ts +2 -2
  201. package/dist/plugins/device-store-sql.js +5 -10
  202. package/dist/plugins/execution-lane-rename-m40.d.ts +20 -0
  203. package/dist/plugins/execution-lane-rename-m40.js +10 -0
  204. package/dist/plugins/execution-placement-sql.d.ts +63 -88
  205. package/dist/plugins/execution-placement-sql.js +94 -54
  206. package/dist/plugins/file-run-store.d.ts +26 -12
  207. package/dist/plugins/file-run-store.js +63 -63
  208. package/dist/plugins/imported-layer-root-retirement.d.ts +17 -8
  209. package/dist/plugins/imported-layer-root-retirement.js +4 -8
  210. package/dist/plugins/inbox-payload-column.d.ts +14 -0
  211. package/dist/plugins/inbox-payload-column.js +13 -0
  212. package/dist/plugins/local-checkpoint-store.d.ts +5 -0
  213. package/dist/plugins/local-checkpoint-store.js +11 -7
  214. package/dist/plugins/local-data-dir-modes-m39.d.ts +48 -0
  215. package/dist/plugins/local-data-dir-modes-m39.js +182 -0
  216. package/dist/plugins/local-engine-high-water.d.ts +11 -0
  217. package/dist/plugins/local-engine-high-water.js +59 -0
  218. package/dist/plugins/local-session-store.d.ts +91 -25
  219. package/dist/plugins/local-session-store.js +124 -45
  220. package/dist/plugins/local-task-attachment-store.d.ts +2 -0
  221. package/dist/plugins/local-task-attachment-store.js +10 -11
  222. package/dist/plugins/memory-embedder-fingerprint.d.ts +33 -10
  223. package/dist/plugins/memory-embedder-fingerprint.js +52 -12
  224. package/dist/plugins/memory-embedder.d.ts +1 -1
  225. package/dist/plugins/memory-embedder.js +2 -2
  226. package/dist/plugins/memory-engine-pg.d.ts +4 -3
  227. package/dist/plugins/memory-engine-pg.js +4 -4
  228. package/dist/plugins/memory-engine-sql-apply.d.ts +13 -4
  229. package/dist/plugins/memory-engine-sql-apply.js +1 -1
  230. package/dist/plugins/memory-engine-tidb.d.ts +8 -5
  231. package/dist/plugins/memory-engine-tidb.js +7 -8
  232. package/dist/plugins/one-time-migrations.d.ts +145 -35
  233. package/dist/plugins/one-time-migrations.js +272 -120
  234. package/dist/plugins/owner-only-file-mode.d.ts +29 -0
  235. package/dist/plugins/owner-only-file-mode.js +141 -0
  236. package/dist/plugins/permission-rule-store-file.d.ts +8 -8
  237. package/dist/plugins/permission-rule-store-file.js +14 -2
  238. package/dist/plugins/pg-pool.d.ts +2 -1
  239. package/dist/plugins/pg-pool.js +11 -4
  240. package/dist/plugins/release-version.d.ts +20 -0
  241. package/dist/plugins/release-version.js +28 -0
  242. package/dist/plugins/remote-env-adb.d.ts +20 -4
  243. package/dist/plugins/remote-env-adb.js +39 -11
  244. package/dist/plugins/remote-env-e2b.d.ts +12 -3
  245. package/dist/plugins/remote-env-e2b.js +6 -4
  246. package/dist/plugins/remote-env-host.d.ts +9 -1
  247. package/dist/plugins/remote-env-host.js +6 -5
  248. package/dist/plugins/remote-env-k8s.d.ts +5 -2
  249. package/dist/plugins/remote-env-k8s.js +15 -4
  250. package/dist/plugins/remote-env-local-docker.d.ts +4 -1
  251. package/dist/plugins/remote-env-local-docker.js +3 -3
  252. package/dist/plugins/remote-env-ssh.d.ts +8 -2
  253. package/dist/plugins/remote-env-ssh.js +26 -24
  254. package/dist/plugins/remote-shell.d.ts +59 -30
  255. package/dist/plugins/remote-shell.js +175 -62
  256. package/dist/plugins/retention-declaration.d.ts +37 -0
  257. package/dist/plugins/retention-declaration.js +9 -0
  258. package/dist/plugins/retention-deployment.d.ts +126 -0
  259. package/dist/plugins/retention-deployment.js +88 -0
  260. package/dist/plugins/retention-lane-store-sql.d.ts +74 -4
  261. package/dist/plugins/retention-lane-store-sql.js +103 -1
  262. package/dist/plugins/retention-sql.d.ts +29 -0
  263. package/dist/plugins/retention-sql.js +8 -0
  264. package/dist/plugins/schema-consistency.d.ts +0 -6
  265. package/dist/plugins/schema-consistency.js +1 -2
  266. package/dist/plugins/schema-ensure-legs.d.ts +1 -1
  267. package/dist/plugins/schema-ensure-legs.js +11 -1
  268. package/dist/plugins/session-ext-table.d.ts +74 -0
  269. package/dist/plugins/session-ext-table.js +121 -0
  270. package/dist/plugins/session-fork.d.ts +1 -1
  271. package/dist/plugins/session-row-sql.d.ts +8 -7
  272. package/dist/plugins/session-row-sql.js +15 -7
  273. package/dist/plugins/session-store-sql.d.ts +131 -0
  274. package/dist/plugins/session-store-sql.js +298 -0
  275. package/dist/plugins/session-workspace-cell.d.ts +2 -2
  276. package/dist/plugins/session-workspace-cell.js +2 -2
  277. package/dist/plugins/shared-memory-store-sql.d.ts +10 -0
  278. package/dist/plugins/shared-memory-store-sql.js +13 -13
  279. package/dist/plugins/snapshot-bucket-presence.js +1 -1
  280. package/dist/plugins/sql-driver.d.ts +23 -7
  281. package/dist/plugins/sql-driver.js +41 -8
  282. package/dist/plugins/sql-errors.d.ts +5 -2
  283. package/dist/plugins/sql-errors.js +4 -0
  284. package/dist/plugins/store-backend.d.ts +35 -8
  285. package/dist/plugins/store-backend.js +184 -62
  286. package/dist/plugins/store-contracts.d.ts +9 -2
  287. package/dist/plugins/store-contracts.js +1 -0
  288. package/dist/plugins/task-attachment-store.d.ts +6 -8
  289. package/dist/plugins/task-attachment-store.js +15 -10
  290. package/dist/plugins/task-list-store-sql.d.ts +1 -1
  291. package/dist/plugins/text-column-capacity.d.ts +21 -0
  292. package/dist/plugins/text-column-capacity.js +5 -0
  293. package/dist/plugins/tidb-pool.d.ts +3 -2
  294. package/dist/plugins/tidb-pool.js +19 -31
  295. package/dist/plugins/user-input-ledger-sql.d.ts +1 -1
  296. package/dist/read-face-posture.d.ts +6 -6
  297. package/dist/read-face-posture.js +2 -2
  298. package/dist/request-value-closure.d.ts +5 -5
  299. package/dist/request-value-closure.js +1 -1
  300. package/dist/rules-consent.d.ts +41 -13
  301. package/dist/rules-consent.js +101 -53
  302. package/dist/run-local.js +17 -13
  303. package/dist/runs.d.ts +48 -30
  304. package/dist/runs.js +26 -16
  305. package/dist/runtime-caps-resolver.d.ts +15 -8
  306. package/dist/runtime-caps-resolver.js +14 -10
  307. package/dist/sealed-key-layout.d.ts +2 -3
  308. package/dist/sealed-key-layout.js +0 -1
  309. package/dist/sealed-key.js +7 -5
  310. package/dist/security.d.ts +5 -3
  311. package/dist/sema-config-dir.js +2 -2
  312. package/dist/server-secret-env.d.ts +2 -0
  313. package/dist/service-version.d.ts +2 -1
  314. package/dist/service-version.js +2 -2
  315. package/dist/session-error-wire.d.ts +1 -1
  316. package/dist/session-incarnation.d.ts +8 -5
  317. package/dist/session-resident-background.d.ts +85 -32
  318. package/dist/session-resident-background.js +75 -7
  319. package/dist/session-row.d.ts +1 -1
  320. package/dist/session-sync-kernel.d.ts +1 -1
  321. package/dist/session-workspace.d.ts +11 -2
  322. package/dist/session-workspace.js +5 -0
  323. package/dist/sighup-idle.d.ts +1 -1
  324. package/dist/store-posture.d.ts +2 -1
  325. package/dist/stored-request-hooks-m20.d.ts +3 -2
  326. package/dist/stored-request-hooks-m20.js +19 -14
  327. package/dist/stores-sql/blob-index-sql.d.ts +148 -0
  328. package/dist/stores-sql/blob-index-sql.js +154 -0
  329. package/dist/stores-sql/checkpoint-store-sql.d.ts +1 -1
  330. package/dist/stores-sql/checkpoint-store-sql.js +11 -27
  331. package/dist/{plugins → stores-sql}/file-history-store-sql.d.ts +23 -11
  332. package/dist/{plugins → stores-sql}/file-history-store-sql.js +23 -18
  333. package/dist/{plugins → stores-sql}/pg-session-storage.d.ts +23 -76
  334. package/dist/{plugins → stores-sql}/pg-session-storage.js +80 -209
  335. package/dist/{plugins → stores-sql}/retention-store-sql.d.ts +123 -217
  336. package/dist/{plugins → stores-sql}/retention-store-sql.js +66 -190
  337. package/dist/{plugins → stores-sql}/session-event-payload.d.ts +1 -1
  338. package/dist/{plugins → stores-sql}/session-event-payload.js +1 -1
  339. package/dist/stores-sql/session-policy-store-sql.d.ts +1 -1
  340. package/dist/stores-sql/session-write-hooks.d.ts +59 -0
  341. package/dist/stores-sql/session-write-hooks.js +2 -0
  342. package/dist/{plugins → stores-sql}/tidb-session-storage.d.ts +10 -11
  343. package/dist/{plugins → stores-sql}/tidb-session-storage.js +10 -21
  344. package/dist/{plugins → stores-sql}/tidb-session-store.d.ts +32 -122
  345. package/dist/{plugins → stores-sql}/tidb-session-store.js +71 -171
  346. package/dist/stores-sql/tool-result-store-sql.d.ts +1 -1
  347. package/dist/stores-sql/tool-result-store-sql.js +1 -1
  348. package/dist/stores-sql/windowed-session-storage.d.ts +56 -0
  349. package/dist/stores-sql/windowed-session-storage.js +61 -0
  350. package/dist/task-a2a.d.ts +7 -1
  351. package/dist/task-a2a.js +15 -14
  352. package/dist/task-cwd.d.ts +11 -3
  353. package/dist/task-cwd.js +17 -1
  354. package/dist/task-mcp.d.ts +10 -2
  355. package/dist/task-mcp.js +13 -16
  356. package/dist/task-settings.d.ts +9 -4
  357. package/dist/task-settings.js +17 -6
  358. package/dist/tool-approval.d.ts +21 -8
  359. package/dist/tool-approval.js +10 -6
  360. package/dist/trace/core-keyset-guard.d.ts +9 -3
  361. package/dist/trace/engine-notice-wire.d.ts +1 -1
  362. package/dist/trace/engine-notice-wire.js +2 -0
  363. package/dist/trace/exit-seat.d.ts +23 -1
  364. package/dist/trace/exit-seat.js +3 -0
  365. package/dist/trace/project.d.ts +33 -16
  366. package/dist/trace/project.js +12 -9
  367. package/dist/trace/redact.d.ts +1 -1
  368. package/dist/trace/redact.js +61 -73
  369. package/dist/trace/self-minted-wire.d.ts +263 -10
  370. package/dist/trace/self-minted-wire.js +90 -2
  371. package/dist/trace/sema-provenance.d.ts +45 -41
  372. package/dist/trace/sema-provenance.js +81 -10
  373. package/dist/trace/task-notification-facets.d.ts +70 -2
  374. package/dist/trace/task-notification-facets.js +71 -1
  375. package/dist/trace/wire-projection-faces.d.ts +38 -2
  376. package/dist/trace/wire-projection-faces.js +26 -1
  377. package/dist/unread-request-members.d.ts +66 -0
  378. package/dist/unread-request-members.js +41 -0
  379. package/dist/user-input-ledger.d.ts +2 -2
  380. package/dist/web-admin-client/apply-effective.js +22 -26
  381. package/dist/web-admin-client/candidate-gate.d.ts +35 -3
  382. package/dist/web-admin-client/candidate-gate.js +53 -5
  383. package/dist/web-admin-client/center-request.d.ts +4 -1
  384. package/dist/web-admin-client/center-request.js +2 -1
  385. package/dist/web-admin-client/effective-keys.js +0 -1
  386. package/dist/web-admin-client/facade.d.ts +1 -1
  387. package/dist/web-admin-client/http-client.d.ts +1 -0
  388. package/dist/web-admin-client/http-client.js +17 -9
  389. package/dist/web-admin-client/restart-signal.js +5 -2
  390. package/dist/web-admin-client/skills-mcp.d.ts +20 -6
  391. package/dist/web-admin-client/skills-mcp.js +26 -21
  392. package/dist/web-admin-client/types.d.ts +34 -49
  393. package/docs/DEVICE-EXECUTOR-PROTOCOL.md +2 -2
  394. package/package.json +13 -12
  395. package/scripts/drain-check-local.mjs +2 -28
  396. package/scripts/drain-check.mysql.sql +2 -18
  397. package/scripts/drain-check.pg.sql +2 -18
  398. package/wire-changes/server@7.147.0.json +813 -0
@@ -37,13 +37,19 @@ import type { SessionUnreadable } from "../session-error-wire.js";
37
37
  * F1 [high] 实测:`DB_BACKEND` 未设时坏账本 ⇒ `{backend: undefined, degraded: true}`,不是拒启)。
38
38
  * 收法:**一个基类,一条重抛**。新 File 店的拒启只要 `extends StoreBootRefusalError` 就自动落在正确的
39
39
  * 一侧;忘了继承是**可见**的(它是一个必须显式选择的父类),而忘了往 if 链里加一行是不可见的。
40
- * (core 的 `AdoptionError` 不在本仓,改不了它的继承链 ⇒ 降级臂保留它那一条 `instanceof`,共两条。)
40
+ * (core 的 `AdoptionError` 不在本族:它的标记住在数据根里,而降级臂只对**空 / 不存在**的数据根开(`openStoreBackendWithFallback` 的数据根判据),
41
+ * 它到不了降级那一步 ⇒ 降级臂不为它单开一条。local 形上本族同样先被那条判据兜住;族规仍在,管的是拒句的属主与 SQL 族。)
41
42
  *
42
43
  * 族的含义是「**确定的拒启表态**」,不限 File 店:SQL `ensureSchema()` 里库带着已退役 schema 的拒启(`RetiredSchemaPresentError`)也属此族。三处读它,读法一致 ——
43
44
  * 降级臂不吞(穿过 `mayFallback`)、SQL 开库的等待窗不重试它(`store-open-wait.ts`:再等也等不来另一个答案)、「库打不开」的拒句不改写它(它自己的拒句才是真话)。
44
45
  */
45
46
  export declare class StoreBootRefusalError extends Error {
46
47
  }
48
+ /**
49
+ * 起服对账一族的拒启码(机读;附录 A / 拒启码表的登记名)。含义 = 「本构建读不出 / 建不出的持久形,开始服务之前判」:SQL 列册对账与退役 schema 两道(`schema-consistency.ts`)、
50
+ * 会话部署格旁表建不出(`session-ext-table.ts`)、local 数据根的严格边档对账(`local-session-store.ts`)。码住在族基类旁边:读它的几只模块彼此不必互相 import。
51
+ */
52
+ export declare const SCHEMA_MISMATCH_ERROR_CODE = "config.schema_mismatch";
47
53
  /**
48
54
  * 取消便签里的**大脑相位**快照 —— core `BrainStatus` 帧经 `brainStatusEventData` 投影后的五键子集。
49
55
  *
@@ -545,7 +551,8 @@ export interface SessionRunRollupSource {
545
551
  }
546
552
  /**
547
553
  * 会话**此刻的 run 认领**(单活槽)的窄读面 —— run 店的 `getActiveTaskId`,同一个问题在 SQL 孪生里是写事务内对 `task_active` 的锁定读。
548
- * local 会话店的执行席在 `markMirror` 的写锁内读它,判序与 SQL 孪生同(行不在 / 住客不同 / writer / mirror 先判,认领只拦「absent → mirror」这一笔写)。
554
+ * local 会话店在写锁内读它:执行席的 `markMirror`(判序与 SQL 孪生同:行不在 / 住客不同 / writer / mirror 先判,认领只拦「absent → mirror」这一笔写),
555
+ * 与导入三写口(整段 `importEntries` / `replaceEntries` / 暂存提交;判官 `judgeImportWrite` 与 SQL 事务内钩的 `import` 臂同一只:先认领后本处写者)。
549
556
  */
550
557
  export interface SessionRunClaimSource {
551
558
  getActiveTaskId(sessionId: string): Promise<string | undefined>;
@@ -1,5 +1,6 @@
1
1
  export class StoreBootRefusalError extends Error {
2
2
  }
3
+ export const SCHEMA_MISMATCH_ERROR_CODE = "config.schema_mismatch";
3
4
  export const ABORT_CAUSES = ["client_disconnected", "ask_park_grace_exhausted", "cancel_verb"];
4
5
  export const RUN_STALLED_ERROR = "run stalled (instance lost?)";
5
6
  export const RUN_ORPHANED_ERROR = "run orphaned by engine restart";
@@ -2,7 +2,7 @@
2
2
  * TaskAttachmentStore —— D-1 通用文件上传的**独立附件 store**(clay 拍 2026-07-27:不复用 fileSnapshot
3
3
  * 的 content-addressed blob 面,新建)。TiDB/PG 双方言 + local 文件店(local-task-attachment-store.ts)。
4
4
  *
5
- * 为什么独立而不是骑 SqlBlobBackend/snapshot_blob:那套的引用追踪=「本域 manifest 里没有的即 orphan」,
5
+ * 为什么独立而不是骑快照 blob 的索引(snapshot_blob):那套的引用追踪=「本域 manifest 里没有的即 orphan」,
6
6
  * 附件不在任何一域的 manifest 里 ⇒ 会被孤儿扫在 1h grace 后误收。生命周期也不同:
7
7
  * snapshot blob 跟 session 的工作树;**附件跟 task/session 的绑定**(上传先行、提交时绑定、E21 随会话
8
8
  * 级联删、未绑定的按 TTL 收割)。
@@ -11,8 +11,8 @@
11
11
  * - `owner` = auth principal ?? "default"(单库 tenant 轴;无 principal 部署全 default = 单用户语义)。
12
12
  * 读/删门在 SQL WHERE 完成(filter-before-reduce,roster 语义条 1 同姿)——他人行连结果集都不进。
13
13
  * - **字节本体在对象存储(clay 裁 2026-07-27:云形态对象存储必配,「现在就接」)**:SQL 只存 meta
14
- * (索引/owner 门/生命周期),bytes 走 {@link AttachmentBytesStore}(生产=既有 MinioBlobBackend,
15
- * 读侧内建 sha 校验)。对象键=**sha256**(同内容天然去重;跨 owner 共享对象 ⇒ 对象删除必须过
14
+ * (索引/owner 门/生命周期),bytes 走 {@link AttachmentBytesStore}(字节口 {@link BlobBackend} —— 生产 = 对象存储
15
+ * MinioBlobBackend;读侧的 sha 校验是本店作为索引属主的事:{@link readAtAddress})。对象键=**sha256**(同内容天然去重;跨 owner 共享对象 ⇒ 对象删除必须过
16
16
  * 零引用检查)+ **附件专属 keyPrefix**(与快照 blob 命名空间隔离——同 sha 不同生命周期,混用会互删)。
17
17
  * 删除次序:meta 先(E21 purge 永不被 MinIO 网络抖动卡死,blob-backend 异步删裁定同旨),对象删
18
18
  * =零引用检查后 best-effort(失败只 log:无 meta 的对象经 API 不可达;彻底清收敛作 follow-up 记账)。
@@ -32,6 +32,7 @@ import type { Pool } from "mysql2/promise";
32
32
  import type { PgQueryFn } from "./pg-query.js";
33
33
  import type { Pool as PgPool } from "pg";
34
34
  import { type IndexSpec } from "./ensure-index.js";
35
+ import { type BlobBackend } from "./blob-backend.js";
35
36
  /**
36
37
  * 一条附件 meta 的**形属主**(整仓唯一那份键集)。
37
38
  *
@@ -79,12 +80,9 @@ export interface TaskAttachmentStore {
79
80
  sweepOrphanObjects?(graceMs: number, nowMs?: number): Promise<number>;
80
81
  }
81
82
  export declare const TASK_ATTACHMENT_TABLE = "task_attachment";
82
- /** 字节面 seam —— MinioBlobBackend 的结构子集(hash 键控;读侧 sha 校验在实现内)。`listObjects` 可选
83
+ /** 字节面 = 字节口 {@link BlobBackend}(sha256 键控;读侧 sha 校验在本店,{@link readAtAddress})+ 对象存储的两只可选读面。`listObjects` 可选
83
84
  * (D-1 孤儿对象 GC 的列举面;测试桩/无列举后端缺席=sweep 诚实 0,不装作扫过)。 */
84
- export interface AttachmentBytesStore {
85
- putBlob(hash: string, bytes: Uint8Array): Promise<void>;
86
- getBlob(hash: string): Promise<Uint8Array | undefined>;
87
- deleteBlobs(hashes: string[]): Promise<number>;
85
+ export interface AttachmentBytesStore extends BlobBackend {
88
86
  listObjects?(): AsyncGenerator<{
89
87
  hash: string;
90
88
  lastModifiedMs: number;
@@ -4,6 +4,7 @@ import { createHash } from "node:crypto";
4
4
  import { attachmentKindOf, PROJECT_BUNDLE_MIME } from "../project-bundle.js";
5
5
  import { mysqlDriver, pgDriver } from "./sql-driver.js";
6
6
  import { isDupKeyError, retryOnDeadlock } from "./sql-errors.js";
7
+ import { readAtAddress } from "./blob-backend.js";
7
8
  export const TaskAttachmentRecordSchema = z.object({
8
9
  id: z.string(),
9
10
  owner: z.string(),
@@ -301,7 +302,7 @@ export class TiDBTaskAttachmentStore {
301
302
  this.db = mysqlDriver(pool);
302
303
  }
303
304
  async put(rec) {
304
- await this.bytes.putBlob(rec.sha256, rec.content);
305
+ await this.bytes.put(rec.sha256, rec.content);
305
306
  await this.pool.execute(`INSERT INTO ${TASK_ATTACHMENT_TABLE} (${COLS}) VALUES (?,?,?,?,?,?,?,?,?)`, [rec.id, rec.owner, rec.name, rec.mime, rec.sha256, rec.sizeBytes, rec.sessionId ?? null, rec.createdAtMs, rec.boundAtMs ?? null]);
306
307
  }
307
308
  async get(owner, id) {
@@ -312,7 +313,7 @@ export class TiDBTaskAttachmentStore {
312
313
  const meta = await this.get(owner, id);
313
314
  if (!meta)
314
315
  return null;
315
- const b = await this.bytes.getBlob(meta.sha256);
316
+ const b = await readAtAddress(this.bytes, meta.sha256);
316
317
  return b && b.byteLength === meta.sizeBytes ? b : null;
317
318
  }
318
319
  async deleteBytesIfUnreferenced(shas) {
@@ -320,7 +321,7 @@ export class TiDBTaskAttachmentStore {
320
321
  try {
321
322
  const [cnt] = await this.pool.query(`SELECT COUNT(*) AS n FROM ${TASK_ATTACHMENT_TABLE} WHERE sha256 = ?`, [sha]);
322
323
  if (Number(cnt[0].n) === 0)
323
- await this.bytes.deleteBlobs([sha]);
324
+ await this.bytes.delete([sha]);
324
325
  }
325
326
  catch {
326
327
  }
@@ -367,8 +368,10 @@ export class TiDBTaskAttachmentStore {
367
368
  const referenced = await this.referencedShas(batch);
368
369
  const orphans = batch.filter((h) => !referenced.has(h));
369
370
  const safe = await this.filterStillOrphan(orphans, graceMs, nowMs);
370
- if (safe.length > 0)
371
- removed += await this.bytes.deleteBlobs(safe);
371
+ if (safe.length > 0) {
372
+ await this.bytes.delete(safe);
373
+ removed += safe.length;
374
+ }
372
375
  batch = [];
373
376
  };
374
377
  for await (const o of lister.listObjects()) {
@@ -417,7 +420,7 @@ export class PgTaskAttachmentStore {
417
420
  this.q = async (text, params) => ({ rows: (await pool.query(text, params)).rows });
418
421
  }
419
422
  async put(rec) {
420
- await this.bytes.putBlob(rec.sha256, rec.content);
423
+ await this.bytes.put(rec.sha256, rec.content);
421
424
  await this.q(`INSERT INTO ${TASK_ATTACHMENT_TABLE} (${COLS}) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9)`, [rec.id, rec.owner, rec.name, rec.mime, rec.sha256, rec.sizeBytes, rec.sessionId ?? null, rec.createdAtMs, rec.boundAtMs ?? null]);
422
425
  }
423
426
  async get(owner, id) {
@@ -428,7 +431,7 @@ export class PgTaskAttachmentStore {
428
431
  const meta = await this.get(owner, id);
429
432
  if (!meta)
430
433
  return null;
431
- const b = await this.bytes.getBlob(meta.sha256);
434
+ const b = await readAtAddress(this.bytes, meta.sha256);
432
435
  return b && b.byteLength === meta.sizeBytes ? b : null;
433
436
  }
434
437
  async deleteBytesIfUnreferenced(shas) {
@@ -436,7 +439,7 @@ export class PgTaskAttachmentStore {
436
439
  try {
437
440
  const res = await this.q(`SELECT COUNT(*) AS n FROM ${TASK_ATTACHMENT_TABLE} WHERE sha256 = $1`, [sha]);
438
441
  if (Number(res.rows[0].n) === 0)
439
- await this.bytes.deleteBlobs([sha]);
442
+ await this.bytes.delete([sha]);
440
443
  }
441
444
  catch {
442
445
  }
@@ -478,8 +481,10 @@ export class PgTaskAttachmentStore {
478
481
  const referenced = await this.referencedShas(batch);
479
482
  const orphans = batch.filter((h) => !referenced.has(h));
480
483
  const safe = await this.filterStillOrphan(orphans, graceMs, nowMs);
481
- if (safe.length > 0)
482
- removed += await this.bytes.deleteBlobs(safe);
484
+ if (safe.length > 0) {
485
+ await this.bytes.delete(safe);
486
+ removed += safe.length;
487
+ }
483
488
  batch = [];
484
489
  };
485
490
  for await (const o of lister.listObjects()) {
@@ -22,7 +22,7 @@ export declare const TASK_LIST_ITEM_TABLE = "task_list_item";
22
22
  * 同族先例 = `env-facts.ts` 的 `scratchpadSessionSegment`(文件名面)——刻意**不**复用彼此的实现:
23
23
  * 一个键空间改了算法不该把另一个键空间的存量行全孤儿化。
24
24
  *
25
- * 🔴 属主在**本文件**(而不是消费它的 boot 车道):留存腿(`retention-store-sql.ts`)按同一派生式
25
+ * 🔴 属主在**本文件**(而不是消费它的 boot 车道):留存腿(`retention-deployment.ts`)按同一派生式
26
26
  * 批量删本表的行,两个消费点必须读同一个函数 —— 键派生有两份就是「在线删除删得掉、留存腿删不掉」。
27
27
  */
28
28
  export declare function taskListKeyFor(sessionId: string): string;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 中央 DDL 用到的**文本列类型的容量**(UTF-8 字节),按方言各一张 —— 「这一列装得下多少字节」这件事实的唯一一处。
3
+ *
4
+ * MySQL 协议(TiDB / MySQL)的 `TEXT` 上限 65,535 字节:严格模式下超长写入抛 `Data too long`,非严格模式静默截断(截断后的 JSON 读侧 parse 失败)。
5
+ * PG 的 `TEXT` 没有每型宽(只有 1 GB 的通用字段上限,不是列型的事实)⇒ 记作无穷。
6
+ *
7
+ * 读者:列属主按自己的类型词查这张表得到列容量(`inbox-payload-column.ts` 的收件 `payload` 预算、`checkpoint-index-columns.ts` 的卡词列容量)。
8
+ * 只登本仓 DDL 真用的类型词:列属主换一个类型词而这里没有 ⇒ tsc 红,由人把那个类型的容量写进来(不在读者那里另抄一个数)。
9
+ */
10
+ import type { SqlDialect } from "./sql-driver.js";
11
+ export declare const TEXT_COLUMN_TYPE_MAX_BYTES: {
12
+ readonly mysql: {
13
+ readonly TEXT: 65535;
14
+ };
15
+ readonly pg: {
16
+ readonly TEXT: number;
17
+ };
18
+ };
19
+ /** 某方言下登记过的文本列类型词。 */
20
+ export type TextColumnType<D extends SqlDialect> = keyof (typeof TEXT_COLUMN_TYPE_MAX_BYTES)[D];
21
+ //# sourceMappingURL=text-column-capacity.d.ts.map
@@ -0,0 +1,5 @@
1
+ export const TEXT_COLUMN_TYPE_MAX_BYTES = {
2
+ mysql: { TEXT: 65_535 },
3
+ pg: { TEXT: Number.POSITIVE_INFINITY },
4
+ };
5
+ //# sourceMappingURL=text-column-capacity.js.map
@@ -51,8 +51,9 @@ export declare function createTidbPool(config: ServiceConfig): Pool;
51
51
  * 3. 生成的全集 SQL 基线导出到 `docs/schema/baseline-mysql.sql`(由本数组机器生成;它是**产物**,不是真源
52
52
  * —— 冲突时以本文件为准并重新生成)。
53
53
  *
54
- * 注意:`ensureSchema` 仍然保留(建表 + advisory lock + image_bake_admit 种子行),只是语句数组现在是纯
55
- * CREATE,不再有 information_schema 探针。
54
+ * 注意:`ensureSchema` 仍然保留(建表 + advisory lock + image_bake_admit 种子行),语句数组是纯 CREATE。数组之外只有一只只读探针:会话部署格旁表
55
+ * `session_ext` 的外键列要抄被引列 `session_meta.session_id` 的字符集 / 排序规则(MySQL 外键两侧必须相同,而存量库上它随建库年代不同),建它之前读一次
56
+ * `information_schema.COLUMNS`(`session-ext-table.ts` 的 `ensureSessionExtTableMysql`;探针只读、不导出任何 ALTER)。
56
57
  */
57
58
  export declare const SCHEMA_STATEMENTS: readonly string[];
58
59
  /** Named MySQL/TiDB advisory lock that serializes the whole `ensureSchema` DDL run (see below). */
@@ -5,17 +5,17 @@ import { TIDB_SESSION_CAPTURE_OPTOUT_STATEMENTS } from "./session-capture-record
5
5
  import { TIDB_LEADER_RUN_STATEMENTS } from "./leader-run-store-sql.js";
6
6
  import { TIDB_ADOPTION_LOG_STATEMENTS } from "./adoption-log-sql.js";
7
7
  import { TIDB_PERMISSION_RULE_STATEMENTS } from "./permission-rule-store-sql.js";
8
- import { TIDB_RETENTION_STATEMENTS } from "./retention-store-sql.js";
8
+ import { TIDB_RETENTION_TOMBSTONE_STATEMENTS } from "../stores-sql/retention-store-sql.js";
9
+ import { TIDB_RETENTION_LANE_STATEMENTS } from "./retention-lane-store-sql.js";
9
10
  import { SESSION_META_INCARNATION_COLUMN } from "../session-incarnation.js";
10
- import { sessionMetaPlacementColumnsDdl } from "./execution-placement-sql.js";
11
- import { SESSION_META_WORKSPACE_COLUMN } from "./session-workspace-cell.js";
11
+ import { ensureSessionExtTableMysql } from "./session-ext-table.js";
12
12
  import { RUN_IDENTITY_COLUMNS } from "../identity-source.js";
13
13
  import { SESSION_RULES_COLUMN } from "./session-rules-column.js";
14
- import { SESSION_TITLE_MAX_CHARS } from "../session-row.js";
14
+ import { INBOX_PAYLOAD_COLUMN } from "./inbox-payload-column.js";
15
15
  import { PRINCIPAL_MAX_UTF8_BYTES } from "../security.js";
16
16
  import { ensureIndexes } from "./ensure-index.js";
17
17
  import { CENTRAL_SCHEMA_INDEXES } from "./schema-indexes.js";
18
- import { SESSION_INDEXES } from "./pg-session-storage.js";
18
+ import { SESSION_INDEXES } from "../stores-sql/pg-session-storage.js";
19
19
  import { TOOL_RESULT_INDEXES } from "../stores-sql/tool-result-store-sql.js";
20
20
  import { COST_QUOTA_INDEXES } from "./pg-cost-quota.js";
21
21
  import { RATE_LIMIT_INDEXES } from "./pg-rate-limiter.js";
@@ -25,7 +25,8 @@ import { IMAGE_BAKE_INDEXES } from "./image-bake-store-sql.js";
25
25
  import { APPROVAL_ASK_INDEXES } from "./approval-ask-store-sql.js";
26
26
  import { ADOPTION_LOG_INDEXES } from "./adoption-log-sql.js";
27
27
  import { PERMISSION_RULE_INDEXES } from "./permission-rule-store-sql.js";
28
- import { RETENTION_INDEXES } from "./retention-store-sql.js";
28
+ import { RETENTION_TOMBSTONE_INDEXES } from "../stores-sql/retention-store-sql.js";
29
+ import { RETENTION_LANE_INDEXES } from "./retention-lane-store-sql.js";
29
30
  import { LEADER_RUN_INDEXES } from "./leader-run-store-sql.js";
30
31
  import { pollUntilLocked } from "./ensure-schema-lock-policy.js";
31
32
  import { createCloseAwarePool } from "./sql-driver.js";
@@ -63,23 +64,8 @@ export const SCHEMA_STATEMENTS = [
63
64
  updated_at DATETIME(3) NOT NULL,
64
65
  leaf_id VARCHAR(64) NULL,
65
66
  leaf_seq BIGINT NOT NULL DEFAULT 0,
66
- -- title: ONE column, two writers, one law (src/session-row.ts): the user's write (PATCH /v1/sessions/:id →
67
- -- writeSessionRowCells, unconditional unless the PATCH carries expectedRowTag; null = cleared back to the automatic title) and the auto-titler (cheap-model
68
- -- one-liner on a submit that finds it NULL; setTitleIfNull, fills NULL only) — a user-set title is never overwritten,
69
- -- a cleared one is filled again. Width = SESSION_TITLE_MAX_CHARS (the wire bound).
70
- title VARCHAR(${SESSION_TITLE_MAX_CHARS}) NULL,
71
- -- pinned: the user's pin (PATCH /v1/sessions/:id → writeSessionRowCells); every list row carries it, false by default.
72
- pinned BOOLEAN NOT NULL DEFAULT FALSE,
73
- -- instruction_source(S-690):本会话**上一次 run** 选中的项目指令文件 = 换源通告(instructions.source_changed)
74
- -- 的基线。NULL = 还没有任何 run 记过(首 run 只写不发);'' = 记过、那一次没有项目指令文件;其余 = 链成员相对路径
75
- -- (CLAUDE.md / .claude/CLAUDE.md / AGENTS.md / .claude/AGENTS.md)。服务端元数据:不进模型上下文、不进 wire
76
- -- 会话面;住在会话行上 ⇒ 随会话删除 / 留存清扫一起消失,fork 出的新行为 NULL(新会话首 run 同样只写不发)。
77
- instruction_source VARCHAR(64) NULL,
78
- -- workspace:本会话上一条腿**自己的**最后一帧 workspace_changed(引擎 7.58.0 的整份快照:cwd / root / entered / project / remote)。
79
- -- NULL = 还没有任何腿记过;唯一写者 = 腿的记录座(src/session-workspace.ts),列属主 = src/plugins/session-workspace-cell.ts
80
- -- (列定义、形读者、编解码;存量库缺这一列 ⇒ 起服列册对账拒启,拒句里给出 ALTER)。下一条腿的 TaskSpec.projectId 读它的 project.id。
81
- -- 服务端元数据:不进 wire 会话面、不进模型上下文;住在会话行上 ⇒ 随会话删除 / 留存清扫一起消失,fork 出的新行为 NULL。
82
- ${SESSION_META_WORKSPACE_COLUMN.mysql},
67
+ -- 本服务记在会话上的格(标题 / 置顶 / 换源通告基线 / 位置与项目 / 执行放置那一格 / fork 键)不住这张引擎座表:旁表 session_ext
68
+ -- (下一条语句;建表 / 列 / 外键级联的唯一属主 = src/plugins/session-ext-table.ts,一会话一行,随本行删除级联)。
83
69
  -- #292 C18(core 5.48.0 design/323)subagent 转录持久化 —— placement 元组,**创建时一次落行、
84
70
  -- first-write 不可变**(register 的 ON DUPLICATE 臂永不重写这六列)。判别位 = placement_kind:
85
71
  -- 在场 ⇒ 该会话住在 placement 分区里(不上宿主枚举、claim 形 acquire 恒拒、release=真删除、
@@ -97,11 +83,6 @@ export const SCHEMA_STATEMENTS = [
97
83
  -- src/session-incarnation.ts 的 SESSION_META_INCARNATION_COLUMN(存量库缺这一列 ⇒ 起服列册对账拒启,拒句里的 ALTER 由本建表语句生成)。
98
84
  -- 不上 wire、不进模型上下文、日志只打前 8 位。
99
85
  ${SESSION_META_INCARNATION_COLUMN.mysql},
100
- -- 执行放置:根会话行上**这一位住客**的一格 —— execution_role('writer' | 'mirror' | NULL = absent)、execution_lane、device 车道的设备与绑定属主、
101
- -- 放下时刻、换绑序号;写只按住客谓词 (session_id, incarnation, owner) ∧ placement_kind IS NULL(换了住客 = 这一格不在)。fork_key = 建这一行的那次
102
- -- fork 请求的键(只由 fork 创建点写,此后每个写携带)。规则在 src/execution-placement.ts,列定义与语句的唯一属主 = src/plugins/execution-placement-sql.ts
103
- -- (存量库缺这些列 ⇒ 起服列册对账拒启;加列只由一次性迁移做)。
104
- ${sessionMetaPlacementColumnsDdl("mysql")},
105
86
  PRIMARY KEY (session_id),
106
87
  KEY idx_session_meta_owner (owner),
107
88
  -- listPlaced 的检索腿(kind + 租户 + 年龄升序);普通会话这三列全 NULL ⇒ 不占索引选择性。
@@ -634,7 +615,8 @@ export const SCHEMA_STATEMENTS = [
634
615
  -- payload: bounded + redacted JSON extras of the entry's kind. task_notification: task_type / result / …;
635
616
  -- workflow_complete: at most {"completionId": …, "diagnostics": …} (the engine's own correlation id, verbatim; the engine's diagnostic
636
617
  -- teaching text, redacted + bounded at enqueue; each key absent when the engine minted none, NULL when neither).
637
- payload TEXT NULL,
618
+ -- Column definition owner = inbox-payload-column.ts (INBOX_PAYLOAD_COLUMN); the entry byte budget derives from the same type word.
619
+ ${INBOX_PAYLOAD_COLUMN.mysql},
638
620
  PRIMARY KEY (session_id, run_id),
639
621
  UNIQUE KEY uq_wfinbox_seq (seq),
640
622
  KEY idx_wfinbox_session_seq (session_id, seq)
@@ -816,7 +798,8 @@ export const SCHEMA_STATEMENTS = [
816
798
  ) COLLATE utf8mb4_bin`,
817
799
  ...TIDB_ADOPTION_LOG_STATEMENTS,
818
800
  ...TIDB_PERMISSION_RULE_STATEMENTS,
819
- ...TIDB_RETENTION_STATEMENTS,
801
+ ...TIDB_RETENTION_LANE_STATEMENTS,
802
+ ...TIDB_RETENTION_TOMBSTONE_STATEMENTS,
820
803
  ];
821
804
  export const ENSURE_SCHEMA_LOCK = "sema_ensure_schema";
822
805
  export async function acquireEnsureSchemaLock(conn, tag = "ensureSchema") {
@@ -845,7 +828,8 @@ export const SCHEMA_INDEXES = [
845
828
  ...APPROVAL_ASK_INDEXES,
846
829
  ...ADOPTION_LOG_INDEXES,
847
830
  ...PERMISSION_RULE_INDEXES,
848
- ...RETENTION_INDEXES,
831
+ ...RETENTION_LANE_INDEXES,
832
+ ...RETENTION_TOMBSTONE_INDEXES,
849
833
  ...LEADER_RUN_INDEXES,
850
834
  ];
851
835
  export async function ensureSchema(pool) {
@@ -857,6 +841,10 @@ export async function ensureSchema(pool) {
857
841
  for (const stmt of SCHEMA_STATEMENTS) {
858
842
  await conn.query(stmt);
859
843
  }
844
+ await ensureSessionExtTableMysql(async (sql) => {
845
+ const [rows] = await conn.query(sql);
846
+ return Array.isArray(rows) ? rows : [];
847
+ });
860
848
  await conn.query("INSERT IGNORE INTO image_bake_admit (pool) VALUES ('standard')");
861
849
  await ensureIndexes((text, params) => conn.query(text, params), "mysql", SCHEMA_INDEXES);
862
850
  }
@@ -15,7 +15,7 @@
15
15
  *
16
16
  * ## 会话树删除([ref])
17
17
  * `deleteBySession` = `DELETE … WHERE session_id = ?`(真删行;File 孪生是一行会话级墓碑,同义)。两条删会话树的级联各有一臂:在线删除协调器
18
- * 经本动词;托管留存的事务化孪生(`retention-store-sql.ts` `purgeSessionTrees` ④)在**自己的事务**里对本表发同一只谓词(`session_id` 单键,
18
+ * 经本动词;托管留存的事务化孪生(`retention-deployment.ts` `deleteDeploymentSessionRows` ④,执行器的 `beforeDelete` 钩)在**自己的事务**里对本表发同一只谓词(`session_id` 单键,
19
19
  * 多值集合按方言)—— 它不调店,理由见该文件顶注的布局裁定(一个事务 ⇒ 一条连接 ⇒ 一个属主)。谓词走 `(session_id, state, accepted_at_ms)` 索引的前缀。
20
20
  *
21
21
  * ## 读不出的行([ref] L6):逐行跳过,游标按原始行推进
@@ -36,7 +36,7 @@
36
36
  * 本模块的定界不变:并列的那一侧开着哪几档,是那张表自己的缺省说了算。core 的 `config.read_face_deployment_clamped`
37
37
  * (只读挂载钳制)同样不受本件影响。
38
38
  */
39
- import { type LaneReadFaceDefault, type RemoteExecProvider } from "./execution-lane-caps.js";
39
+ import { type ExecutionLane, type LaneReadFaceDefault } from "./execution-lane-caps.js";
40
40
  import { type PostureSource } from "./posture-source.js";
41
41
  /**
42
42
  * 档位来源的闭集词表 —— **[ref] 起转 `posture-source.ts` 的共享件**(本模块只是给这一档取个本地名字,
@@ -63,14 +63,14 @@ export declare function readFaceDefaultFor(input: {
63
63
  export interface ReadFaceDeploymentSeat {
64
64
  readFace?: "open" | "roots" | undefined;
65
65
  readFaceSource: ReadFaceSource;
66
- remoteExec?: {
67
- readonly provider: RemoteExecProvider;
68
- } | undefined;
66
+ readonly remoteExec: {
67
+ readonly provider: ExecutionLane;
68
+ };
69
69
  }
70
70
  /**
71
71
  * 把**派生的**读面缺省按这台部署**最终生效的车道**落到配置上(显式 env / center 发布的值与来源原样不动)。返回值 = 这一次有没有改动。
72
- * 两个调用点,同一只函数:`loadConfig` 装配完 `remoteExec` 之后(env 三元链定的车道);车道合成步在 local 形文件覆写之后
73
- * (`config.d/remote-exec.json` 能把车道换成 `host` / `local-docker`,读面缺省随最终车道重派 —— 否则它停在已作废的车道上)。
72
+ * 一个调用点:执行车道合成步,在判点(最终车道来自显式声明)通过之后 —— 车道到那一步才定形(local 形 `config.d/remote-exec.json` 也能声明),
73
+ * 合成前的 raw 配置上车道可以缺席,派生不在那里做(否则会把缺席折成某条车道的缺省)。
74
74
  * 幂等:同一份配置再调一次不改。值与来源**同一处写**(`readFace` 缺席 ⟺ 来源 `engine-default`)。
75
75
  */
76
76
  export declare function settleDerivedReadFace(seat: ReadFaceDeploymentSeat, singleUserTurnkey: boolean): boolean;
@@ -1,4 +1,4 @@
1
- import { LANE_OPEN_READ_FACE_CAUTION, executionLaneOf, laneReadFaceDefault } from "./execution-lane-caps.js";
1
+ import { LANE_OPEN_READ_FACE_CAUTION, laneReadFaceDefault } from "./execution-lane-caps.js";
2
2
  import { POSTURE_SOURCE_WORDS, postureSourceNote } from "./posture-source.js";
3
3
  export const READ_FACE_SOURCE_WORDS = POSTURE_SOURCE_WORDS;
4
4
  function readFaceForPosture(singleUserTurnkey) {
@@ -21,7 +21,7 @@ function isDerivedSource(source) {
21
21
  export function settleDerivedReadFace(seat, singleUserTurnkey) {
22
22
  if (!isDerivedSource(seat.readFaceSource))
23
23
  return false;
24
- const next = readFaceDefaultFor({ laneDefault: laneReadFaceDefault(executionLaneOf(seat.remoteExec?.provider)), singleUserTurnkey });
24
+ const next = readFaceDefaultFor({ laneDefault: laneReadFaceDefault(seat.remoteExec.provider), singleUserTurnkey });
25
25
  if (next.readFace === seat.readFace && next.readFaceSource === seat.readFaceSource)
26
26
  return false;
27
27
  if (next.readFace === undefined)
@@ -119,17 +119,17 @@ export type TaskInheritEnv = (typeof INHERIT_ENV_WORDS)[number];
119
119
  export declare const INHERIT_ENV_VALUE_MESSAGE: string;
120
120
  /**
121
121
  * `inheritEnv` 的 `request.field_invalid` 400 的机读 `reason`([ref];闭集,**一种拒因一个词**,读者穷举读)—— 拒体另带 `field: "inheritEnv"` 与它,
122
- * 壳靠这两位认「这条 400 真是 `inheritEnv` 的」,不猜句子。同一个键的**三只** 400 是一类,词表一张:
122
+ * 壳靠这两位认「这条 400 真是 `inheritEnv` 的」,不猜句子。同一个键的**两类** 400(值形 / 车道)是一类,词表一张:
123
123
  * · `unknown_word` —— 值形:是字符串,但不在受理词表(`"ALL"` · `"everything"` · `""`);
124
124
  * · `not_a_string` —— 值形:根本不是字符串(名单形 `string[]` · 布尔 · 数字 · `null` · 对象);
125
- * · `lane_not_host` —— `"all"` 落在非 host 车道(只有 host 工厂消费这一位,别的车道没有消费点);
126
- * · `no_authorizer_session` —— `"all"` 而部署不接 authorizer(绑定按会话键控,没有会话就没有地方兑现)。
127
- * 前两词的判官是 {@link inheritEnvFieldIssue}(只看体);后两词的判官在 `boot/resolve-spec.ts`(要读部署事实,两腿同过)。
125
+ * · `lane_not_host` —— `"all"` 落在非 host 车道(只有 host 工厂消费这一位,别的车道没有消费点)。
126
+ * 前两词的判官是 {@link inheritEnvFieldIssue}(只看体);`lane_not_host` 的判官在 `boot/resolve-spec.ts`(要读部署事实,两腿同过)。
127
+ * 没有「无会话」一词:绑定按会话键控,而一次提交的根会话由 authorizer 必填席解析、经执行上下文交进装配器(根恒在),不存在「部署不接 authorizer」的形。
128
128
  * 不在这组的:`422 request.host_posture_refused`(托管部署不兑现 `"all"`)—— 那不是这个键的值写错,而是部署姿态拒,码与写容纳面那条腿共用,按 `errorCode` 认(契约 §18)。
129
129
  * 加一种拒因 ⇒ 这里加一个词(并在判官处给它一个分支);词与因一一对应,没有一因两词、也没有一词两因。
130
130
  * 词的铸点只有 {@link inheritEnvFacts} 一处:受理门与 resolveSpec 只经它出机读位,不手拼 `field` / `reason`。
131
131
  */
132
- export declare const INHERIT_ENV_REFUSAL_REASONS: readonly ["unknown_word", "not_a_string", "lane_not_host", "no_authorizer_session"];
132
+ export declare const INHERIT_ENV_REFUSAL_REASONS: readonly ["unknown_word", "not_a_string", "lane_not_host"];
133
133
  export type InheritEnvRefusalReason = (typeof INHERIT_ENV_REFUSAL_REASONS)[number];
134
134
  /** 拒体上的机读位(加性键:直接当 `request.field_invalid` 的附加键用;型别名而不是接口 —— 要能直接当 `Record<string, unknown>` 用)。 */
135
135
  export type InheritEnvFacts = {
@@ -35,7 +35,7 @@ export const INHERIT_ENV_WORDS = ["all", "scrub"];
35
35
  export const INHERIT_ENV_VALUE_MESSAGE = `inheritEnv must be one of ${INHERIT_ENV_WORDS.map((w) => JSON.stringify(w)).join(" | ")} when present ` +
36
36
  `("all" = the model-driven host shell inherits this machine's whole environment except this deployment's own credentials (its configuration directory's secret-typed names), honored only on a single-user host-lane deployment; ` +
37
37
  `"scrub" = the default scrub of credential-shaped variables, accepted on every lane; absent = "scrub") — a name list is not a request value`;
38
- export const INHERIT_ENV_REFUSAL_REASONS = ["unknown_word", "not_a_string", "lane_not_host", "no_authorizer_session"];
38
+ export const INHERIT_ENV_REFUSAL_REASONS = ["unknown_word", "not_a_string", "lane_not_host"];
39
39
  export function inheritEnvFacts(reason) {
40
40
  return { field: "inheritEnv", reason };
41
41
  }
@@ -1,5 +1,5 @@
1
1
  import { type DirectWritableRuleBehavior, type RemovalLiveness } from "./permission-rule-vocab.js";
2
- import { type RuleOwner, type ImportPreview, type ImportedSettingsLayer, type PersistedRule, type RuleBehavior, type RuleCandidate, type EffectivePermissionRule, type RemoveResult, type RuleRefusalCode, type RuleWriteCommitted, type EditedRuleTextPrecheck, type RuleScope, type RuleOffer } from "@sema-agent/core";
2
+ import { type ConfirmRefusalReason, type RuleOwner, type ImportPreview, type ImportedSettingsLayer, type PersistedRule, type RuleBehavior, type RuleCandidate, type EffectivePermissionRule, type RemoveResult, type RuleRefusalCode, type RuleWriteCommitted, type EditedRuleTextPrecheck, type RuleScope, type RuleOffer } from "@sema-agent/core";
3
3
  import type { DurableRulePartitionProvider, PermissionRuleStoreProvider, RuleApprovalRecordStore } from "@sema-agent/core";
4
4
  import { type RuleImportTicket, type RuleTicketPurpose, type RuleTicketReclaimResult, type RuleTicketRedeemResult, type RuleTicketSnapshot } from "./plugins/permission-rule-store-sql.js";
5
5
  /**
@@ -192,9 +192,10 @@ export type LocalImportRefusalCode =
192
192
  | "not_importable";
193
193
  /** 兑付回执的**成员级终态**(闭集,机读;`detail` 是给人看的那一半)。两只 redeem 口(cc-import / local-import)同一张表。
194
194
  *
195
- * 🔴 **引擎拒的成员,结局只读引擎的两词 `committed`**(core 7.63.0 [ref],`RedeemedBatchMember` 拒臂必填):`no` ⇒ `refused`
196
- * (引擎确知这一条没落 —— 裁定,如旧导入记录里从 `/` 写起的全局规则的 `unsupported.layer_root`;同批放行被扣下的 `withheld`)、
197
- * `unknown` ⇒ `indeterminate`(写面抛 / 读回读不出 —— 那一条**可能已经落了**)。本仓不按串判,不另写第二份判据。
195
+ * 🔴 **引擎拒的成员,结局只读引擎的两位**(core 7.65.0 [ref] / [ref]:`committed` 一种读法 + `retriable` 另席,拒臂皆必填):
196
+ * `committed: "no"` ∧ 不可重试 ⇒ `refused`(引擎定了这一条不立 —— 裁定,如旧导入记录里从 `/` 写起的全局规则的 `unsupported.layer_root`;
197
+ * 同批放行被扣下的 `withheld`;人撤掉了它的 `dot_removed`)。可重试(写前的店故障)或 `committed: "unknown"`(写已发出而结局未知)
198
+ * ⇒ 这一走**未定**,整走不落定(见 {@link settleImportWalk})。本仓不按串判,不按码猜,不另写第二份判据。
198
199
  * 它进了**落盘回执的边界 schema**(`ImportOutcomeSchema`;`redeemed_outcome` 列回读同一张词表)。⚠️ 预览面**不用**这个词表:那一面的拒绝形是
199
200
  * `admitted:false + LocalImportRefusalCode`({@link LocalImportPreviewMember}),两面词表**不同**。 */
200
201
  export type ImportMemberOutcome =
@@ -202,11 +203,10 @@ export type ImportMemberOutcome =
202
203
  "persisted"
203
204
  /** 等价规则**已经在店**(引擎的 `deduped`)—— 同意早就生效,这次什么都不用做。 */
204
205
  | "no-op"
205
- /** 引擎拒了这一条,并答 `committed: "no"` —— 确知没落。重来同一条拒因(`reason`)会得同一个答,出路在 `detail`(引擎原话)。 */
206
+ /** 引擎拒了这一条,并答 `committed: "no"`、不可重试 —— 定了不立。重来同一条拒因(`reason`)会得同一个答,出路在 `detail`(引擎原话)。 */
206
207
  | "refused"
207
- /** 引擎拒了这一条,并答 `committed: "unknown"` —— **不知道落没落**。如实编,禁猜。这一词**不进落定的回执**(落定律:任一成员
208
- * 结局不知 ⇒ 不落定、503 同票重走,见 {@link unsettledDetailOf});词表留着它,是因为 7.145.x 及更早落定的票行(`redeemed_outcome`)
209
- * 里有它,回放读那份存量。 */
208
+ /** 7.145.x 及更早落定的票行(`redeemed_outcome`)里的词:引擎答 `committed: "unknown"` 的成员。7.146.0 起这一词**不再铸**(落定律:任一成员
209
+ * 未定 ⇒ 不落定、503 同票重走,见 {@link settleImportWalk});词表留着它只为回放读那份存量。 */
210
210
  | "indeterminate";
211
211
  /** prepare 面的一行。判别式联合:被收下的行**没有**拒因字段可读,被拒的行**必然**带拒因 ——
212
212
  * 「admitted 却带 reason」这种矛盾态在类型上不可表达。
@@ -227,7 +227,7 @@ export type LocalImportPreviewMember = {
227
227
  };
228
228
  /** 一条收紧在 prepare 当场落店的结局(与兑付回执的 `persisted` / `no-op` 同词同义;直写接缝 `addPersistedRule` 的 `added` / `no-op`)。 */
229
229
  export type LocalImportTighteningOutcome = "persisted" | "no-op";
230
- /** 兑付回执的一行(两只 redeem 口同形;唯一铸点 {@link buildImportOutcomeMembers})。`reason` / `detail` 在场 ⇔ 引擎拒了这一条
230
+ /** 兑付回执的一行(两只 redeem 口同形;唯一铸点 {@link settleImportWalk})。`reason` / `detail` 在场 ⇔ 引擎拒了这一条
231
231
  * (`refused` / `indeterminate`):`reason` = 引擎的闭集拒因码(`RuleRefusalCode`,core 属主,逐字),`detail` = 引擎给人看的那句话。 */
232
232
  export interface ImportOutcomeMember {
233
233
  key: ImportRuleKey;
@@ -239,12 +239,12 @@ export interface ImportOutcomeMember {
239
239
  * 一次兑付的回执整只 —— **两只 redeem 口同一张**(cc-import / local-import 的 200 体都是 `{ members, rev }`,路由同一个铸点),
240
240
  * local-import 另把它**逐字**写进票行 `redeemed_outcome`(回放同源:回放答的就是它)。
241
241
  *
242
- * 🔴 **落定律(一条,两口同读)**:兑付走完、拿到引擎的完整成员表、**且每个成员的结局都确定**(`persisted` / `no-op` / 引擎答
243
- * `committed: "no"` 的 `refused`)⇒ 这次兑付落定,回执逐成员交出,票不放回、不答 503:cc-import 一次性用掉、答 200 回执;local-import 把回执
242
+ * 🔴 **落定律(一条,两口同读,{@link settleImportWalk})**:兑付走完、拿到引擎的完整成员表、**且每个成员的结局都定了**(`persisted` / `no-op` / 引擎答
243
+ * `committed: "no"` 且不可重试的 `refused`)⇒ 这次兑付落定,回执逐成员交出,票不放回、不答 503:cc-import 一次性用掉、答 200 回执;local-import 把回执
244
244
  * 落进票行(SETTLED)后答 200 —— 落定这一跳答不成(落定写抛 / 认领被租约接管而新持有者还没落定)⇒ 照旧答 409
245
245
  * `conflict.rule_import_in_flight`,同票再来读到的是权威的那一份回执(那一跳不改成员结局,只决定哪一份是权威)。**没有**完整
246
- * 成员表(引擎在走之前整批拒 / confirm 输给并发写者 / 店在走之前抛 / 循环里仍抛出来的异常),或任一成员结局**不知**(引擎答
247
- * `committed: "unknown"`:规则店的写抛 / 读回读不出,引擎 7.64.0 起还有成员循环里审批记录店的记 dot CAS / dot 分配失败)⇒ 不落定:放回认领、503
246
+ * 成员表(引擎在走之前整批拒 / confirm 输给并发写者或撞记录店故障 / 店在走之前抛 / 循环里仍抛出来的异常),或任一成员**未定**(引擎答
247
+ * `retriable: true`:成员循环里审批记录店的记 dot CAS / dot 分配 / 读记录在规则写之前失败;或 `committed: "unknown"`:规则店的写抛 / 读回读不出)⇒ 不落定:放回认领、503
248
248
  * `state.rule_import_retry`,同一张票重来就是重走一遍 —— 兑付按引擎的设计幂等(记录里的 dot 台账),重走交出完整表,
249
249
  * 被打断的那一走已落的成员读 `no-op`。确知的成员拒**不**按票自动重试:一条永久被拒的成员(旧记录里的 `unsupported.layer_root`)
250
250
  * 若走重试臂,客户端会 503 到票过期、临期放不回 ⇒ 404,已落成员不撤、被拒成员永不落 —— 7.144.0 及更早 cc-import 口就是这一形。
@@ -286,6 +286,14 @@ export type LocalImportPrepared = {
286
286
  reason: "tightening-write-failed";
287
287
  committed: RuleWriteCommitted;
288
288
  detail: string;
289
+ }
290
+ /** 放行那一半的审批记录建不成(引擎 `prepareCcImport` 答可重试的店拒;同 {@link RuleImportPrepared} 同名臂):无票;同批更早的收紧
291
+ * 可能已生效,同一批原样重发即是出路(已生效的答 no-op)。 */
292
+ | {
293
+ ok: false;
294
+ reason: "record-store-refused";
295
+ committed: RuleWriteCommitted;
296
+ detail: string;
289
297
  };
290
298
  /** A7 redeem 的结果。 */
291
299
  export type LocalImportRedeemed =
@@ -332,6 +340,14 @@ export type RuleImportPrepared = {
332
340
  ok: false;
333
341
  reason: "too-many-candidates";
334
342
  candidates: number;
343
+ }
344
+ /** 引擎的审批记录店建记录失败(core 7.65.0 起 `prepareCcImport` 答拒臂而不是抛):`retriable` 为真 ⇒ 本臂(无票、无规则落店,
345
+ * 同一请求原样重发即是出路;`committed` 原样是引擎那一词)。引擎说不可重试的拒(契约上不出现)不进本臂,响亮抛。 */
346
+ | {
347
+ ok: false;
348
+ reason: "record-store-refused";
349
+ committed: RuleWriteCommitted;
350
+ detail: string;
335
351
  };
336
352
  /** 导入 redeem 的结果。wire 口径写死(端点=http/routes/rules.ts):成功 ⇒ 200 回执 `{ members, rev }`(与 local-import 口
337
353
  * 同一张、同一个铸点;落定律见 {@link ImportOutcome});票拒五类(自造 / 别人的 / 错车道 / 过期 / 已用过)与裁定性拒绝
@@ -768,6 +784,18 @@ export interface RuleConsentLane {
768
784
  scope: DurableRuleScope;
769
785
  }): Promise<RuleWritten>;
770
786
  }
787
+ /**
788
+ * 兑付腿拒绝里的**店故障**两词(审批记录店的读 / CAS / dot 分配失败与规则店自己的读写失败同两词):`store_read` / `store_write`。
789
+ * 其余十五词是裁定性拒。卡道重不重试 = 引擎的 `retriable` **∧** 本谓词(见 {@link throwIfRetriable}):`retriable` 真而码不是店故障 = 版本不同步,不重试、响一行;
790
+ * 两只导入口不读本谓词(只读 `retriable` 与 `committed`,见 `openRefusalOf`)。
791
+ * 闭集穷举(词表属主 core 加词 ⇒ 这里编译红,由人裁新词归哪边)。
792
+ */
793
+ export declare function isRuleStoreFault(code: RuleRefusalCode): code is "store_read" | "store_write";
794
+ /**
795
+ * 确认拒里**同一请求重来即可**的三词(闭集穷举):`conflict`(CAS 输给并发写者)、`store_read`(读记录抛,确认一个字没写)、`store_write`
796
+ * (记确认的 CAS 抛:记录可能已落 —— 同一确认重来,已落的记录答幂等的 yes;core 7.65.0 [ref])。其余是裁定。两只导入口读它定「放回认领 / 裁定拒」。
797
+ */
798
+ export declare function confirmRefusalRetries(reason: ConfirmRefusalReason): boolean;
771
799
  export declare function createRuleConsentLane(stores: RuleConsentStores, opts?: {
772
800
  ticketTtlMs?: number;
773
801
  newTicketId?: () => string;