PR7 — bulk statements for every overdue party - #144
Conversation
2173e24 to
e72388b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e72388bcfd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e72388b to
f5236e5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5236e53ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
f5236e5 to
93ce643
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93ce6434c1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
93ce643 to
1235e51
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1235e51593
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
1235e51 to
61fce34
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 61fce34481
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let bills_xml = "<ENVELOPE>\ | ||
| <BILLFIXED><BILLDATE>1-Jul-26</BILLDATE><BILLREF>FUTURE-1</BILLREF><BILLPARTY>Synthetic Party</BILLPARTY></BILLFIXED>\ | ||
| <BILLCL>-100.00</BILLCL><BILLDUE>1-Aug-26</BILLDUE><BILLOVERDUE>0</BILLOVERDUE>\ | ||
| </ENVELOPE>"; |
There was a problem hiding this comment.
Replace the synthetic XML with a captured response
When this test is used as end-to-end evidence for future-due statement handling, the hand-authored XML only proves behavior for the request shape and field encoding assumed by the implementation, so it can pass even if real Tally bytes differ. Exercise the bulk path with the existing captured validation-lab fixture, or another response captured from a real instance, instead of constructing protocol evidence inline.
AGENTS.md reference: AGENTS.md:L86-L90
Useful? React with 👍 / 👎.
| continue; | ||
| } | ||
| }; | ||
| let amount = statement.grand_total.as_str().to_string(); |
There was a problem hiding this comment.
Preserve exposure direction in the batch manifest
For a payable-only party, or a party carrying both receivable and payable rows, grand_total is a sum of positive magnitudes, but the manifest serializes it as an unqualified amount. Unlike the statement itself, the JSON therefore cannot tell whether the value is receivable, payable, or mixed, so reconciliation or automation consuming the manifest can reverse the meaning of a client balance. Record directional subtotals (or at minimum an explicit gross-magnitude classification) rather than emitting this ambiguous amount.
Useful? React with 👍 / 👎.
61fce34 to
8e885d5
Compare
8e885d5 to
7e785e9
Compare
Replace page/content offset arithmetic with one checked allocator used for every indirect PDF object. This removes the fragile assumption that page references start at 10 and content streams at 11. Mutation proof: replacing the allocator increment with a self-assignment made pdf_object_allocator_issues_unique_sequential_references fail with [1, 1, 1, 1, 1, 1, 1, 1] instead of [1, 2, 3, 4, 5, 6, 7, 8]. Restored implementation passes.
Write one XLSX or PDF per party into an operator-selected folder, with a JSON manifest that records each original party, generated file, exact total, as-of date, and any failure. Excel remains the default action. The dashboard keeps its display caps while the completed outstandings result carries uncapped statement-source rows; the batch never rereads Tally and cannot silently omit a party past the top-ten or 2,000-row UI projections. Partial rendering failures are best-effort but loud: remaining parties continue, while the command result and manifest retain every failed party and error. Mutation proof: returning the raw traversal party name caused the traversal batch test to write zero statements; dropping renderer-failure recording made its expected failure count 0; replacing create_new with truncating writes made colliding names identical; forcing a manifest amount to 0 failed its exact-total assertion. Each mutation was restored and the focused test passed.
Collapse the duplicate format and extension parameter, send one complete statement-source payload, and confirm the backend-derived full party count before writing files.\n\nTest proof: party_count_deduplicates_nonzero_bill_and_unallocated_parties passes on the intended implementation. Mutating the preview count to subtract one made it fail 2 != 3, then restoring it passed.\n\nMigration: the Tauri load result no longer serializes capped open_bills or unallocated_by_party projections; the frontend locally applies its display caps to the complete statement-source rows.\n\nSecurity: no Tally endpoint is read by preview or export; both consume the already-complete local result.
Mutation proof: removing the manifest company field made renderer_failure_is_recorded_in_result_and_manifest_while_other_parties_write fail (RC 101). The field is restored.
Exercises synthetic raw Bills and Ledger envelopes through parsing, native outstandings computation, the uncapped statement source, and actual XLSX bulk output. Mutation proof: routing BILLDUE through BillDate failed at native_date_year_outside_book_window; restoring DueDate and mutating the future-due branch to return None failed at the zero-row statement-source assertion. Both mutations were restored, then this test passed.
Adapt the validation-book runtime assertion to the PR7 all_open_bill_rows helper name and update the existing raw-byte bulk test to the measured rule: a future-due bill remains age_days=None but contributes 100 to the first ageing bucket and one to the open-receivable count. Mutation proof: with the inherited zero-bucket assertion left in place, the focused raw-byte test failed with exit 101 (ExactDecimal 100 != 0). After restoring the F1X expectation, that test passed 1/1 with exit 0 and the validation-lab runtime test passed 1/1 with exit 0. Signed-off-by: Tapish Khandelwal <tapishkhandelwal13@gmail.com>
Carry the PR7 bulk-statement surface over the F4X BILLREF presentation disclosure. Claims, evidence, and trusted-evidence keys remain byte-identical to the preserved PR7 head. Compatibility gate: exit 0, unknown_claims=11, evidenced_claims=0. Claims/evidence/trusted identity checks: exit 0.
7e785e9 to
4314b5f
Compare
Stacked on
feat/party-statement-pdf— review only this PR's own diff.Local gate green at this level: workspace tests and clippy in both feature configurations, fmt, tools tests, live-read boundary, fixture byte integrity, licence inventory, tsc, production build, and the workflow-consistency gate.
CI is NOT proven: the GitHub-hosted Windows and bundle-smoke jobs have never run, and one read-transport harness test fails deterministically on macOS with an unknown ubuntu outcome.