Skip to content

Commit 1311e7b

Browse files
committed
feat: default report downloads to the holon
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.
1 parent 4036134 commit 1311e7b

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

‎robosystems_client/clients/ledger_client.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,7 +2481,7 @@ def download_report_bundle(
24812481
graph_id: str,
24822482
report_id: str,
24832483
*,
2484-
format: str = "tavi",
2484+
format: str = "holon-jsonld",
24852485
to: str | Path | None = None,
24862486
expires_in: int = 300,
24872487
) -> ReportBundleDownload:
@@ -2497,10 +2497,10 @@ def download_report_bundle(
24972497
Args:
24982498
graph_id: Graph identifier owning the Report.
24992499
report_id: Report identifier (``rpt_``-prefixed ULID).
2500-
format: Serialization flavor — ``"tavi"`` (default, the Project
2501-
Tavi compiled model stamped at publish), ``"holon-jsonld"``
2502-
(the dataset-form scene/boundary/projection holon), or
2503-
``"xbrl-2.1"``. The enum names ``"TAVI"`` /
2500+
format: Serialization flavor — ``"holon-jsonld"`` (default, the
2501+
dataset-form scene/boundary/projection holon, which carries
2502+
the whole report), ``"tavi"`` (the Project Tavi compiled
2503+
model stamped at publish), or ``"xbrl-2.1"``. The enum names ``"TAVI"`` /
25042504
``"HOLON_JSONLD"`` / ``"XBRL_2_1"`` are also accepted.
25052505
to: Optional file path to write the bytes to. When set, the
25062506
returned ``ReportBundleDownload.path`` points at the

‎tests/test_ledger_client.py‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,25 +2187,26 @@ def _patch_httpx(self, mock_client_cls, artifact: Mock) -> Mock:
21872187
return mock_client
21882188

21892189
@patch("robosystems_client.clients.ledger_client.httpx.Client")
2190-
def test_default_download_is_the_tavi(self, mock_client_cls, mock_config, graph_id):
2191-
"""No format: the Tavi anchor. GraphQL resolves the URL, client follows it."""
2190+
def test_default_download_is_the_holon(self, mock_client_cls, mock_config, graph_id):
2191+
"""No format: the holon. GraphQL resolves the URL, client follows it."""
21922192
mock_client = self._patch_httpx(
2193-
mock_client_cls, self._mock_artifact(b'{"xbrlModel": {}}', "rpt_01-g2.tavi.json")
2193+
mock_client_cls,
2194+
self._mock_artifact(b'{"@graph": []}', "rpt_01-g2.holon.jsonld"),
21942195
)
21952196
with patch.object(
21962197
LedgerClient,
21972198
"_query",
2198-
return_value=self._gql_data("application/json", "tavi", gen=2),
2199+
return_value=self._gql_data("application/ld+json", "holon-jsonld", gen=2),
21992200
) as mock_query:
22002201
result = LedgerClient(mock_config).download_report_bundle(graph_id, "rpt_01")
22012202

2202-
assert result.content == b'{"xbrlModel": {}}'
2203-
assert result.filename == "rpt_01-g2.tavi.json"
2204-
assert result.format == "tavi"
2205-
assert result.content_type == "application/json"
2203+
assert result.content == b'{"@graph": []}'
2204+
assert result.filename == "rpt_01-g2.holon.jsonld"
2205+
assert result.format == "holon-jsonld"
2206+
assert result.content_type == "application/ld+json"
22062207
assert result.generation_count == 2
22072208
# GraphQL var carries the enum NAME, not the wire flavor string.
2208-
assert mock_query.call_args.args[2]["format"] == "TAVI"
2209+
assert mock_query.call_args.args[2]["format"] == "HOLON_JSONLD"
22092210
# The bytes come from following the presigned URL.
22102211
assert mock_client.get.call_args.args[0].startswith("https://s3.example.com/")
22112212

0 commit comments

Comments
 (0)