feat: add reconciliations to the ledger facade - #228
Merged
Merged
Conversation
Regenerated against the current API, then on `LedgerClient`: - `list_reconciliations` reads every reconciliation's standing for a period. - `preview_reconciliations`, `refresh_reconciliations`, `record_statement_balance`, `set_reconciliation_policy` and `sign_off_reconciliation` call the matching operations. - `close_period` takes `allow_unreconciled_accounts`, and `create_schedule` takes `booked_on`. - `get_fiscal_calendar` carries the unreconciled-account count and sample. Claude-Session: https://claude.ai/code/session_01N4VGnvrpE2cwbBZykz4yGd
The holon carries the whole report; the Tavi has no home for the Information Block payloads, definition arcs, framework pins or filing lifecycle. Pass format="tavi" for the compiled model.
jfrench9
marked this pull request as ready for review
October 2, 2026 04:57
jfrench9
added a commit
that referenced
this pull request
Oct 2, 2026
## Summary Regenerate against the current API so the checked-in GraphQL schema and models carry its descriptions. Two API changes reach the text: report downloads now describe the holon as the stamped anchor and the default format (robosystems#1658), and a reconciliation's `status` gains `stale` and drops `explained` (robosystems#1657). ## Changes - `robosystems_client/graphql/schema.graphql` (generated): the `reportDownloadUrl` field, its `format` argument and `ReportBundleDownload` describe the holon as stamped at publish and the default, with the Tavi and XBRL built on first download. `ReconciliationSummary.status` lists `not_started`, `stale`, `unreconciled`, `reconciled`, `reviewed`. - `robosystems_client/models/reconciliation_summary.py` (generated): the same `status` docstring. No hand-written facade code changes; the facade's download default already moved to `holon-jsonld` in #228. ## Compatibility INTERNAL. Descriptions only: no export, signature or model field changes. `status` stays a plain string. The values the API returns change server-side (`stale` added, `explained` removed), so code that branches on `explained` should handle `stale` once the server release with robosystems#1657 is deployed. Prod does not have it yet, so this should ship in the next client minor after that deploy. ## Testing Regenerated by hand against a local API running robosystems#1658 on top of `main`. The pre-commit hook ran the test suite: 609 passed, 17 skipped. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds reconciliations to the ledger facade, so a script or an agent can list them, run them, record a statement balance, change a block's policy and sign a period off. Regenerated against robosystems
main(ed9f4cf2), which carries the reconciliation surface from robosystems #1646, #1649, #1652, #1653 andbooked_onfrom #1655. The TypeScript twin is robosystems-typescript-client #243.Release order: cut the client release only after the robosystems release that contains #1652 and #1653 is deployed.
list_reconciliationsselects GraphQL fields that only exist from that release (ledgerBalance,independentBalance,balanceAsOf,components,notes), so the query fails validation against an older server. Merging is safe at any time, and no existing method is affected: the two fields added to the fiscal calendar query are already served.Changes
Facade (
clients/ledger_client.py), stable tier, additivelist_reconciliations(graph_id, period): every reconciliation block's standing for a period.preview_reconciliations(graph_id, period, *, method, include_tied): one comparison, nothing recorded.refresh_reconciliations(graph_id, period): run every check that applies and record the results.notesnames a check that could not run.record_statement_balance(graph_id, *, element_id, as_of, balance, document_id, note).set_reconciliation_policy(graph_id, structure_id, *, required_for_close, materiality, review_required, separate_reviewer): an omitted field keeps its value.sign_off_reconciliation(graph_id, structure_id, period, note).close_periodtakesallow_unreconciled_accounts;create_scheduletakesbooked_on.get_fiscal_calendarcarriesunreconciled_account_countandunreconciled_account_sample.download_report_bundlenow defaults to the holon (format="holon-jsonld"), which carries the whole report. Passformat="tavi"for the compiled model.GraphQL
operations/ledger/ListLedgerReconciliations.graphql(new);GetLedgerFiscalCalendar.graphqlselects the two unreconciled-account fields.schema.graphqlrefreshed andgenerated/regenerated from it.Generated tier (
api/,models/)preview_reconciliations,refresh_reconciliations,record_statement_balance,set_reconciliation_policy,sign_off_reconciliation, with their request and response models.allow_unreconciled_accountson the close and backfill requests;reconciliationas a block type;ReconciliationMechanics;booked_onon the schedule metadata request.Compatibility
ADDITIVE, plus one facade default that moved:
download_report_bundlereturns the holon unless a format is named. A caller that relied on the default now gets a different file and passesformat="tavi"to keep the old one. That rides this minor and belongs in the release notes.Otherwise: new facade methods, two new optional keyword arguments, and new generated operations and models. I compared the emitted models: no file was deleted, and no field was removed or became required. The only removed lines are docstrings. A minor.
Testing
just test-all: 609 passed, 17 skipped; format, lint and typecheck clean.close_periodandcreate_schedule.main;booked_onand the reconciliation operations were confirmed present in its/openapi.jsonfirst. An earlier regeneration in this checkout had run against a stale stack and lackedbooked_on; it was redone.🤖 Generated with Claude Code
https://claude.ai/code/session_01N4VGnvrpE2cwbBZykz4yGd