feat(store): a tool call is one journal transaction (P15 T1, D-88)
Accounting reasoning: a write that is retried after a lost answer must happen once, and a call that dies between its journal lines must never be replayed as if whole. The journal feature `call_transactions` frames a call's lines with `call.begun` and `call.closed`; the lines between count only when the closing line says `ok`. Every replay (open, the viewer, verify, rebuild, the projection's catch-up) goes through one gate (`CallGate`), so no state is built from half a call and a replay of any prefix ending inside a call equals the replay of the prefix before it. A call that never closed is closed `unfinished` at the next open; a call that fails after writing lines is closed `failed`, its SQLite changes (one transaction per call) rolled back and the live ledger rebuilt without them. The closing line keeps the answer given, so a repeat of a request key returns it; the key table is rebuilt from the journal alone. The envelope is untouched. Lines outside a frame apply as ever, so every journal written before the feature replays as it was. Books get a unique id (`books_id`) at creation, and older books at the format upgrade, in the `journal.format_set` that declares the feature. The frame lines never move the audit's figure head. The upgrade's declaration now also carries the id, so the three tests that pinned its exact payload compare it without the id. No figure and no golden moved. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
7058fbd2b9
commit
2633109d55
15 files changed
+1375
-29
No files matched your search
@@ -1098,6 +1098,18 @@ pub fn describe(b: &Books, line: &JournalLine) -> Option<Event> {
|
||||
format!("Recurring: {}", s(p, "description")),
|
||||
Some(Route::Company),
|
||||
),
|
||||
// A call's frame (ledger-store calls.rs): the call's own lines are
|
||||
// listed between them.
|
||||
"call.begun" => ev(
|
||||
icon::FILE_TEXT,
|
||||
format!("Call begun: {}", s(p, "tool")),
|
||||
None,
|
||||
),
|
||||
"call.closed" => ev(
|
||||
icon::FILE_TEXT,
|
||||
format!("Call closed ({}): {}", s(p, "outcome"), s(p, "tool")),
|
||||
None,
|
||||
),
|
||||
"journal.tail_repaired" => ev(
|
||||
icon::WARNING,
|
||||
format!("Cut-off journal line set aside ({} bytes)", p["bytes"]),
|
||||
|
||||
Reference in new issue
Block a user