fix(store,gui,package): every reader that derives facts reads the committed journal (P15 T1 review)
A failed call's ids are handed out again (nothing it wrote counted), so a reader of the raw journal pins dead lines on whatever takes the id next: a failed books.create_bill for entry 42 then a manual entry 42 showed as a Bill. One accessor, calls::committed (lines outside a call and of calls that closed ok, the frame left out), now feeds the viewer's books (entry events and origin, asset trails, party events), the package feed attention reads, and the adopt preview's settings check. The journal page and journal_history keep every line and say in words of each line of a call that failed, never finished or is still running that it did not count. A call's closing line is now bounded (ANSWER_CAP 4 KiB: above it, the answer's SHA-256 and length), a call that wrote no line leaves no line (its key and answer live in a bounded in-memory table), and the journaled argument digest is an HMAC under the books' own call key, so two requests that differ only in a tax id are two requests and nothing journaled lets a guess of one be tested. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
e542319e63
commit
d4c0036599
11 files changed
+950
-120
No files matched your search
@@ -257,11 +257,28 @@ impl Snapshot {
|
||||
}
|
||||
|
||||
/// Every journal line read so far, in order: the complete history,
|
||||
/// with timestamps and hashes.
|
||||
/// with timestamps and hashes, the lines of calls that failed or never
|
||||
/// finished among them. For showing history only: a reader that
|
||||
/// derives a fact reads [`Snapshot::committed_journal`] (calls.rs
|
||||
/// INVARIANT 7), and labels each line here with
|
||||
/// [`Snapshot::journal_standings`].
|
||||
pub fn journal(&self) -> &[JournalLine] {
|
||||
&self.lines
|
||||
}
|
||||
|
||||
/// The standing of each line of [`Snapshot::journal`], in the same
|
||||
/// order (calls.rs [`crate::calls::standings`]).
|
||||
pub fn journal_standings(&self) -> Result<Vec<crate::calls::Standing>, StoreError> {
|
||||
crate::calls::standings(&self.lines)
|
||||
}
|
||||
|
||||
/// The committed journal: the lines that are facts of the books, the
|
||||
/// frame lines left out ([`crate::calls::committed`]). What every
|
||||
/// reader that derives facts from the journal reads.
|
||||
pub fn committed_journal(&self) -> Result<Vec<JournalLine>, StoreError> {
|
||||
crate::calls::committed(&self.lines)
|
||||
}
|
||||
|
||||
/// Sequence number of the last journal line read.
|
||||
pub fn journal_seq(&self) -> u64 {
|
||||
self.lines.len() as u64
|
||||
|
||||
Reference in new issue
Block a user