Repository navigation
Commit c731e43
committed
A5 done: batch service — receipts and reverse batches
services/batch ports gh-v1's preview-snapshot-send-receipt pipeline as
data, leaving file I/O, console output, permalinks and the prompt to the
CLI (confirm is a callback between the snapshot and the send).
runBatch: refuse what cannot be guarded (unless guard: false; a bare
update/execute from an alias always), preview, describe, name the touched
assets (each type asked only for the Name/Number it has, per the schema),
snapshot exactly what the batch overwrites plus ChangeDate, send guarded
on those ChangeDates, then a receipt: outcome, created with aliases and
numbers, touched, skipped, after-stamps and the reverse batch. dryRun
stops after the snapshot. A send that fails outright throws
BatchSendError carrying the receipt so far: whether it applied is
unknown. reversible() drops from a receipt's reverse the assets changed
since (their ChangeDate is no longer the after-stamp) unless forced.
Services now read results through assetApi.outcomeOf (created, modified,
operated, failures, query rows) and never the envelope; the layers test
enforces that for services, as spec 000 §1 already said.
Live: a guarded batch updating two Stories (scalar and multi-relation)
and creating a Task, its receipt, and its reverse sent back through
runBatch restore both Stories and delete the Task; a reverse skips an
asset another writer changed unless forced. Plan C3 now maps gh-v1's
resolve.js/batch.js onto these.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NSWj65GY2KaXwFjZ9Jzyb1 parent 2046128 commit c731e43
11 files changed
Lines changed: 546 additions & 14 deletions
File tree
- plans
- src
- services
- wire
- test
- integration
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
234 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
235 | 243 | | |
236 | 244 | | |
237 | 245 | | |
| |||
347 | 355 | | |
348 | 356 | | |
349 | 357 | | |
350 | | - | |
| 358 | + | |
351 | 359 | | |
352 | 360 | | |
353 | 361 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
77 | 89 | | |
78 | 90 | | |
79 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
0 commit comments