merge: P6, the evidence pipeline (branch P6, checkpoint ce366408)

The last of the paused branches, from its "not for merge" checkpoint:
extraction in ledger-import (text, pages, page images; capped, caught),
journaled as attachment.text_extracted; dedup by hash with
books.find_attachment and books.consolidate_duplicates; annotations and
books.set_entry_settles; the company record categories; the two fuzz
targets; feature attachment_text. Nineteen files conflicted with the
four P4b merges, resolved as plan 8.0.2 says: P6 retakes schema 18 (it
had taken 16, which S4.3 holds; S5 holds 17); the tool table is 129 and
the destructive count 31; both sides' appends kept with their seams
restored; one B-27 paragraph naming every feature; in the old-books
fixture P6's hand-written reimbursement is entry 7 (its ids collided
with S4.3's invoice); the replay fuzzer's list gains S7's
invoice.written_off; S4.3's issued-PDF test expects the extraction
record P6 journals right after a filing.

One integration defect between S7 and P6, found by the arap property
test and fixed here: under P6's dedup, a write-off whose evidence bytes
were filed already (the same collection letter for a second write-off of
the same invoice) was refused only after its entry had been journaled,
at the final link to the invoice ("already linked"). The write-off now
resolves the dedup before anything is journaled and keeps a link the
record already has to the invoice instead of refusing it; an explicit
existing_attachment_id already on an entry is still refused (S7's
one-receipt-once rule). P6's gate never ran before the pause; it runs on
main after this merge, and its ledger-store -> ledger-import dependency
is the open review point (plan 8.0.1).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
This commit is contained in:
swaitsandClaude Fable 5.1 committed 2026-10-28 23:08:59 -06:00
commit 2ad192bbcd
70 files changed
+4618 -384

No files matched your search

@@ -0,0 +1,3 @@
# Records
Kept with the company's papers.
@@ -0,0 +1 @@
Zelle payment to A. Quill, 20.00, 2026-02-10
@@ -0,0 +1,187 @@
{
"assets": [],
"bills": [],
"entries": [
{
"date": "2026-01-01",
"description": "Opening capital",
"id": 1,
"lines": [
{
"account": 1,
"amount": {
"amount": "500.00",
"currency": [
85,
83,
68
]
},
"side": "Debit"
},
{
"account": 3,
"amount": {
"amount": "500.00",
"currency": [
85,
83,
68
]
},
"side": "Credit"
}
],
"reversal_of": null,
"status": "Posted"
},
{
"date": "2026-02-01",
"description": "Web hosting, paid by a member",
"id": 2,
"lines": [
{
"account": 4,
"amount": {
"amount": "20.00",
"currency": [
85,
83,
68
]
},
"side": "Debit"
},
{
"account": 2,
"amount": {
"amount": "20.00",
"currency": [
85,
83,
68
]
},
"side": "Credit"
}
],
"reversal_of": null,
"status": "Posted"
},
{
"date": "2026-02-10",
"description": "Reimburse the member",
"id": 3,
"lines": [
{
"account": 2,
"amount": {
"amount": "20.00",
"currency": [
85,
83,
68
]
},
"side": "Debit"
},
{
"account": 1,
"amount": {
"amount": "20.00",
"currency": [
85,
83,
68
]
},
"side": "Credit"
}
],
"reversal_of": null,
"status": "Posted"
},
{
"date": "2026-03-01",
"description": "March rent",
"id": 4,
"lines": [
{
"account": 4,
"amount": {
"amount": "100.00",
"currency": [
85,
83,
68
]
},
"side": "Debit"
},
{
"account": 1,
"amount": {
"amount": "100.00",
"currency": [
85,
83,
68
]
},
"side": "Credit"
}
],
"reversal_of": null,
"status": "Posted"
}
],
"entry_parties": [],
"invoices": [],
"payroll_runs": [],
"periods": [],
"recurring": [],
"schedules": [],
"snapshot": {
"Ok": {
"balance_sheet": {
"assets": "380",
"balanced": true,
"current_earnings": "-120",
"equity": "380",
"liabilities": "0"
},
"profit_and_loss": {
"expenses": "120",
"net_income": "-120",
"revenue": "0"
},
"trial_balance": {
"lines": [
{
"code": "1000",
"credit": "0",
"debit": "380",
"name": "Cash"
},
{
"code": "3000",
"credit": "500",
"debit": "0",
"name": "Capital"
},
{
"code": "6000",
"credit": "0",
"debit": "120",
"name": "Rent"
}
],
"total_credits": "500",
"total_debits": "500"
}
}
},
"verify": {
"Ok": null
}
}
@@ -0,0 +1,25 @@
{"payload":{"base_currency":"USD"},"prev":"0000000000000000000000000000000000000000000000000000000000000000","seq":1,"ts":"2026-10-27T15:18:09Z","type":"store.created"}
{"payload":{"features":["account_renamed","asset_basis","depreciation_catch_up","disposal_before_service","document_line_projects","document_standing","documents_v2","members_cumulative","month_reposting","party_creditors","payment_instruments","projects","require_tax_category","schedule_convention","tax_categories_gain_exempt","vendor_1099_decisions"],"format":2},"prev":"7f124ed3e91db7042661abf4e5007b1dcae9903a767bea76e7e727a96075bfa6","seq":2,"ts":"2026-10-27T15:18:09Z","type":"journal.format_set"}
{"payload":{"account_type":"Asset","code":"1000","currency":"USD","id":1,"name":"Cash","parent":null,"placeholder":false},"prev":"955f321d1a0bbd460640ba5339b2d3e1313038f3ba615e5ffff223ba3c8c728f","seq":3,"ts":"2026-10-27T15:18:09Z","type":"account.added"}
{"payload":{"account_type":"Liability","code":"2100","currency":"USD","id":2,"name":"Due to Members","parent":null,"placeholder":false},"prev":"7b619dff5f0fb25b516b96b459b39ef67713bef25689946837a28f58e7692db5","seq":4,"ts":"2026-10-27T15:18:09Z","type":"account.added"}
{"payload":{"account_type":"Equity","code":"3000","currency":"USD","id":3,"name":"Capital","parent":null,"placeholder":false},"prev":"d55d7fb14bbfbd1aa43f067617901d7086ecbfa16a693f0aa651b98ba525e4f8","seq":5,"ts":"2026-10-27T15:18:09Z","type":"account.added"}
{"payload":{"account_type":"Expense","code":"6000","currency":"USD","id":4,"name":"Rent","parent":null,"placeholder":false},"prev":"6cd464539b1b1aa60ae1093728da6a48658cc7bf3f962c88a21c863b85b17523","seq":6,"ts":"2026-10-27T15:18:09Z","type":"account.added"}
{"payload":{"date":"2026-01-01","description":"Opening capital","id":1},"prev":"ed316ff3ac6c630502dd56101b39b53fac83e4554fd78e271c91d0d468ae6c93","seq":7,"ts":"2026-10-27T15:18:09Z","type":"entry.created"}
{"payload":{"account":1,"amount":"500.00","currency":"USD","id":1,"side":"debit"},"prev":"cf19ca8e1f8992a73c249c3d5e06997b681799a19d39261082d66ecee54a7c78","seq":8,"ts":"2026-10-27T15:18:09Z","type":"entry.line_added"}
{"payload":{"account":3,"amount":"500.00","currency":"USD","id":1,"side":"credit"},"prev":"31d98c34346a4ca836f1b7a51e993a7c8b682eaab36f061d92e8659eafcf3691","seq":9,"ts":"2026-10-27T15:18:09Z","type":"entry.line_added"}
{"payload":{"date":"2026-01-01","description":"Opening capital","id":1,"lines":[{"account":1,"amount":"500.00","currency":"USD","side":"debit"},{"account":3,"amount":"500.00","currency":"USD","side":"credit"}],"reversal_of":null},"prev":"1589ea4608834aab2019ebd960438eed2ebd843abef29fbcf2174f65b88a34e8","seq":10,"ts":"2026-10-27T15:18:09Z","type":"entry.posted"}
{"payload":{"date":"2026-02-01","description":"Web hosting, paid by a member","id":2},"prev":"ea67596a958a0c100bc81e4d4b7058c3145803ea765a3989d3da58eef343c775","seq":11,"ts":"2026-10-27T15:18:09Z","type":"entry.created"}
{"payload":{"account":4,"amount":"20.00","currency":"USD","id":2,"side":"debit"},"prev":"1e78ebd8c378a723511d3e054f216c02587d9c0795a2958b64a7ef681405301f","seq":12,"ts":"2026-10-27T15:18:09Z","type":"entry.line_added"}
{"payload":{"account":2,"amount":"20.00","currency":"USD","id":2,"side":"credit"},"prev":"06d014884d44765a38cb4ca9220cef0b913ef8a8b561997fdea7d59c0094dc0e","seq":13,"ts":"2026-10-27T15:18:09Z","type":"entry.line_added"}
{"payload":{"date":"2026-02-01","description":"Web hosting, paid by a member","id":2,"lines":[{"account":4,"amount":"20.00","currency":"USD","side":"debit"},{"account":2,"amount":"20.00","currency":"USD","side":"credit"}],"reversal_of":null},"prev":"1863ad9b2fb040fd24c1398b7ec995f083153fbacc5e252e88bcd98541e3c33a","seq":14,"ts":"2026-10-27T15:18:10Z","type":"entry.posted"}
{"payload":{"date":"2026-02-10","description":"Reimburse the member","id":3},"prev":"6e7ec8d7738b85d7e79548f22eb6e314a370a31757c1651a67fa752b7adc4651","seq":15,"ts":"2026-10-27T15:18:10Z","type":"entry.created"}
{"payload":{"account":2,"amount":"20.00","currency":"USD","id":3,"side":"debit"},"prev":"a26929387cbba06f0e89c9b1dd4118320f22be51d8ee499ee398e411f16b890f","seq":16,"ts":"2026-10-27T15:18:10Z","type":"entry.line_added"}
{"payload":{"account":1,"amount":"20.00","currency":"USD","id":3,"side":"credit"},"prev":"b2e9405890eb89ae0e5afd17d3e5cf741e330960f3f01449bd7a82c2e1dea440","seq":17,"ts":"2026-10-27T15:18:10Z","type":"entry.line_added"}
{"payload":{"date":"2026-02-10","description":"Reimburse the member","id":3,"lines":[{"account":2,"amount":"20.00","currency":"USD","side":"debit"},{"account":1,"amount":"20.00","currency":"USD","side":"credit"}],"reversal_of":null},"prev":"94f2dbba114035ebe433c985c6b4f5ace26bd4588903fff15bef8717ab82bc77","seq":18,"ts":"2026-10-27T15:18:10Z","type":"entry.posted"}
{"payload":{"date":"2026-03-01","description":"March rent","id":4},"prev":"b1c37b5614c19fdbe10e16ded9072b31bc0f2576cd6419a86c14d258871ba6dc","seq":19,"ts":"2026-10-27T15:18:10Z","type":"entry.created"}
{"payload":{"account":4,"amount":"100.00","currency":"USD","id":4,"side":"debit"},"prev":"66f50f061925b1be9ad46a015ab7359729324b58419ee97abdc2e430c19cd335","seq":20,"ts":"2026-10-27T15:18:10Z","type":"entry.line_added"}
{"payload":{"account":1,"amount":"100.00","currency":"USD","id":4,"side":"credit"},"prev":"1e5e7bd1e14131c980d43b5da0fb6a21673dd3f7120dfe87873cd7e88eb49340","seq":21,"ts":"2026-10-27T15:18:10Z","type":"entry.line_added"}
{"payload":{"date":"2026-03-01","description":"March rent","id":4,"lines":[{"account":4,"amount":"100.00","currency":"USD","side":"debit"},{"account":1,"amount":"100.00","currency":"USD","side":"credit"}],"reversal_of":null},"prev":"c3ee5fc9f8cf08b452969df15921f6bcaf61514c608971b6180e8b89bdbabfbb","seq":22,"ts":"2026-10-27T15:18:10Z","type":"entry.posted"}
{"payload":{"attachment_id":1,"blob_sha":"5837c77f55b72825a8a6be69e2aecc3e962fba90277e12547ae2d6b7f1ad0435","category":"receipts","description":"March rent invoice","entry_id":4,"file_name":"receipt.pdf","mime_type":"application/pdf","size_bytes":20748},"prev":"4820680a8b8f00fbfee12dcdb515f6c7232fe002b17f6a0d875cbc7b37f9301c","seq":23,"ts":"2026-10-27T15:18:10Z","type":"receipt.attached"}
{"payload":{"attachment_id":2,"blob_sha":"2d6666a14d257ebe2f29c5a10380afaafed93efee2b80d79af3d3d53c10af699","category":"receipts","description":null,"entry_id":3,"file_name":"zelle.txt","mime_type":"text/plain","size_bytes":45},"prev":"06043343802dce570e36d0502cc359bc05dd00f5ccf0831f34c516648ee0c9dc","seq":24,"ts":"2026-10-27T15:18:10Z","type":"receipt.attached"}
{"payload":{"attachment_id":3,"blob_sha":"1697fa59fa7f1f7e6d4e3b53940e9208596242b8451ddb01bef8b00b71040c2b","category":"other","description":null,"entry_id":null,"file_name":"note.md","mime_type":"text/markdown","size_bytes":43},"prev":"9cad59cd4384dc0769bc925032cad7366c814e827d094795404b9b6d9e5ce861","seq":25,"ts":"2026-10-27T15:18:10Z","type":"document.filed"}