Skip to content

chore(sdk): regenerate; report downloads default to the Tavi - #220

Merged
jfrench9 merged 1 commit into
mainfrom
chore/tavi-download-default
Sep 24, 2026
Merged

jfrench9 merged 1 commit into
mainfrom
chore/tavi-download-default

Conversation

@jfrench9

Copy link
Copy Markdown
Member

Summary

Regenerates the SDK against the current API and moves report downloads to the Tavi default. The backend retired the flat JSON-LD download and the JSONLD value of ReportDownloadFormat (RoboFinSystems/robosystems#1514); a published report's anchor artifact is now the Tavi compiled model. LedgerClient.download_report_bundle defaulted to "jsonld", so it moves to "tavi" in the same release.

Changes

Facade (clients/ledger_client.py)

  • download_report_bundle defaults format to "tavi". "jsonld" is removed from _DOWNLOAD_FORMAT_ALIASES, and the docstring lists tavi / holon-jsonld / xbrl-2.1.
  • The fallback file extension, used when the presigned response carries no filename, is now tavi.json.

GraphQL

  • operations/ledger/GetLedgerReportDownloadUrl.graphql defaults $format to TAVI.
  • schema.graphql is refreshed from the running backend, and the typed models are regenerated (just generate-graphql): ReportDownloadFormat.JSONLD is gone from generated/enums.py.

OpenAPI regen (api/, models/), drift from backend changes already on main:

  • regenerate_mfa_recovery_codes, delete_user_passkey and get_passkey_reauth_options accept AuthenticatedClient | Client.
  • ExecuteEventBlockResponse gains an optional qb_entry_ids field (new model ExecuteEventBlockResponseQbEntryIdsType0).
  • The rest is docstring changes carried over from the API.

Compatibility

MINOR, by decision. It's ADDITIVE except for one retired value:

  • download_report_bundle(..., format="jsonld") is no longer accepted, because the server no longer serves the flat JSON-LD. A call that passed no format now returns the Tavi instead of the flat JSON-LD.
  • Name both in the release notes.
  • The integration template's emit path doesn't download reports.
  • The tavi format has been served since 2026-09-06, so this release works against the current production API, ahead of refactor(reports): anchor publish on the Tavi model, retire the flat JSON-LD robosystems#1514's deploy.

Testing

  • just test-all: 591 passed, 17 skipped; ruff, format and basedpyright clean.
  • The download test now covers the default: no format → TAVI in the GraphQL variables, a .tavi.json filename, and format == "tavi".
  • just generate-graphql regenerates cleanly against the refreshed schema.

🤖 Generated with Claude Code

The backend retired the flat JSON-LD download and the JSONLD value of
ReportDownloadFormat; a published report's anchor is now the Tavi model.
LedgerClient.download_report_bundle defaults to "tavi" and no longer
accepts "jsonld", the GetLedgerReportDownloadUrl operation defaults to
TAVI, and the SDK and typed GraphQL models are regenerated against the
current API.
@jfrench9

Copy link
Copy Markdown
Member Author

@claude please review this PR

@claude

claude Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Claude finished @jfrench9's task in 1m 36s —— View job


Reviewing PR #220

  • Gather PR metadata, diff, and existing comments
  • Review hand-written changes (ledger_client.py, GraphQL operation, tests)
  • Review generated diff for unexpected surface changes
  • Check compatibility claims against actual diff
  • Post review summary

PR Summary

Title: chore(sdk): regenerate; report downloads default to the Tavi
Branch: chore/tavi-download-default → main
Changes: +226/-148 across 64 files (generated: 61 files / hand-written: 3 — ledger_client.py, GetLedgerReportDownloadUrl.graphql, test_ledger_client.py)

Regenerates the SDK against the current API. ReportDownloadFormat.JSONLD is retired backend-side, so LedgerClient.download_report_bundle's default format moves from "jsonld" to "tavi", and "jsonld" is dropped from _DOWNLOAD_FORMAT_ALIASES. The rest of the diff is unrelated regeneration drift already on main (auth endpoints widened to AuthenticatedClient | Client, a new qb_entry_ids field on ExecuteEventBlockResponse, docstring wording changes).

Compatibility

BREAKING (by decision), correctly scoped and disclosed. A caller of download_report_bundle(...) with no format argument now gets the Tavi compiled model instead of the flat JSON-LD, and format="jsonld" is no longer accepted (it falls through _DOWNLOAD_FORMAT_ALIASES.get(format.lower(), format) unmapped and will fail server-side enum validation rather than raise a clear client-side error — acceptable given this is an explicitly retired value, but worth noting for anyone still passing it literally). Everything else in the diff is additive (new optional model field, widened auth client type unions).

Verification

  • ledger_client.py: _DOWNLOAD_FORMAT_ALIASES correctly drops "jsonld", default format is "tavi", fallback extension is tavi.json, docstring accurately lists the three remaining flavors. Consistent with GetLedgerReportDownloadUrl.graphql's $format: ReportDownloadFormat = TAVI, generated/operations.py's embedded query string, and generated/enums.py dropping JSONLD.
  • schema.graphql: ReportDownloadFormat enum and field docs match the regenerated operation/enum — no drift between the snapshot and the operations that depend on it.
  • models/execute_event_block_response.py + new execute_event_block_response_qb_entry_ids_type_0.py: new optional field is properly exported from models/__init__.py (__all__ updated too).
  • test_ledger_client.py: the renamed test (test_default_download_is_the_tavi) covers the new default end-to-end — no format arg → TAVI in the GraphQL variables, .tavi.json filename, format == "tavi". The error-path test was updated to use a tavi mock response consistently.
  • No hand-edits under generated paths (api/, models/, graphql/generated/) — all changes there are consistent with just generate-sdk / just generate-graphql output.
  • CI (Test, PR #220) both green.

My Review

Issues (should fix before merge)

None found.

Suggestions (non-blocking)

  1. Since format="jsonld" now falls through to an unmapped GraphQL variable value rather than being rejected client-side, a caller who missed the release notes gets an opaque GraphQL enum-validation error instead of a clear ValueError: unsupported format 'jsonld'. Not required given this is a deliberate, documented removal, but a small quality-of-life improvement if you want one.

Questions

None — the compatibility section in the PR description already covers the one behavioral break clearly and calls out the release-notes obligation.

Verdict

APPROVE. Clean, well-scoped regeneration; the one intentional breaking change (Tavi as default download format) is correctly implemented across the facade, GraphQL operation, generated code, and tests, and is clearly disclosed in the PR description.

@jfrench9
jfrench9 merged commit b6520cb into main Sep 24, 2026
4 checks passed
@jfrench9
jfrench9 deleted the chore/tavi-download-default branch September 24, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant