Skip to content

Commit 811d645

Browse files
authored
feat: a report fact's own provenance and frozen_at on the envelope (#271)
## Summary Regenerated against the local stack running robosystems `feature/fact-lineage-surface` (RoboFinSystems/robosystems#1898): the Information Block envelope's fact row now carries the fact's own provenance descriptor and when its column froze, so a reader of `reportPackage` / `informationBlock` can drill from a figure to how it was made. Waits on the robosystems release that carries #1896, #1897 and #1898 — the next after v1.19.4; the fields are null from a server without them. ## Changes - **Regenerated SDK** — `FactLite` gains `provenance` (the fact's own `FactProvenance` descriptor, as an opaque object discriminated on `origin`, modelled as `FactLiteProvenanceType0`) and `frozen_at`; the `regenerate-report` and `file-report` operation descriptions follow the column freeze (a filed report states closed periods only; a regenerate rewrites live columns and keeps frozen ones). - **GraphQL SDL snapshot** — `InformationBlockFact.provenance: JSON` and `frozenAt: DateTime`; `just generate-graphql` run, `generated/` unchanged (no operation document reads the new fields yet). - No hand-written changes. ## Compatibility ADDITIVE — two new optional fields on a generated-tier model and description-only changes on two operations. Nothing in the stable tier (facades, the integration template's emit path) moves. A client minor (2.25.0) once released; the version bump stays with the release dispatch. ## Testing - `just generate-sdk` and `just generate-graphql` against the rebuilt local stack; the drift gate's inputs (`schema.graphql`, `generated/`) are committed. - `just test` (ruff, format, basedpyright, pytest): 714 passed, 17 skipped — run by the pre-commit hook on this commit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013UXnatpnbiixt1ZVHfdZAP
2 parents b59a994 + 5376ff2 commit 811d645

14 files changed

Lines changed: 173 additions & 16 deletions

‎robosystems_client/api/robo_ledger_reports/file_report.py‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ def sync_detailed(
112112
"""File Report
113113
114114
Transitions the Report's filing_status to 'filed' — locks the package. Allowed from 'draft' or
115-
'under_review'. Stamps filed_at + filed_by.
115+
'under_review', and only once the books are closed through every period the Report states. Stamps
116+
filed_at + filed_by.
116117
117118
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
118119
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -160,7 +161,8 @@ def sync(
160161
"""File Report
161162
162163
Transitions the Report's filing_status to 'filed' — locks the package. Allowed from 'draft' or
163-
'under_review'. Stamps filed_at + filed_by.
164+
'under_review', and only once the books are closed through every period the Report states. Stamps
165+
filed_at + filed_by.
164166
165167
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
166168
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -203,7 +205,8 @@ async def asyncio_detailed(
203205
"""File Report
204206
205207
Transitions the Report's filing_status to 'filed' — locks the package. Allowed from 'draft' or
206-
'under_review'. Stamps filed_at + filed_by.
208+
'under_review', and only once the books are closed through every period the Report states. Stamps
209+
filed_at + filed_by.
207210
208211
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
209212
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -249,7 +252,8 @@ async def asyncio(
249252
"""File Report
250253
251254
Transitions the Report's filing_status to 'filed' — locks the package. Allowed from 'draft' or
252-
'under_review'. Stamps filed_at + filed_by.
255+
'under_review', and only once the books are closed through every period the Report states. Stamps
256+
filed_at + filed_by.
253257
254258
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
255259
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

‎robosystems_client/api/robo_ledger_reports/regenerate_report.py‎

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ def sync_detailed(
111111
) -> Response[ErrorResponse | OperationEnvelopeReportResponse]:
112112
"""Regenerate Report
113113
114-
Re-runs fact generation for an existing Report against the latest ledger state. Pass
115-
`period_start`/`period_end`/`periods` only if you want to change the reporting window.
114+
Rewrites a Report's live columns from the latest ledger state. A column whose period the books have
115+
closed is frozen and keeps its facts; an open column already follows the ledger on every read, so
116+
pass `period_start`/`period_end`/`periods` to change the reporting window, which drops the frozen
117+
facts of any window no column states.
116118
117119
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
118120
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -155,8 +157,10 @@ def sync(
155157
) -> ErrorResponse | OperationEnvelopeReportResponse | None:
156158
"""Regenerate Report
157159
158-
Re-runs fact generation for an existing Report against the latest ledger state. Pass
159-
`period_start`/`period_end`/`periods` only if you want to change the reporting window.
160+
Rewrites a Report's live columns from the latest ledger state. A column whose period the books have
161+
closed is frozen and keeps its facts; an open column already follows the ledger on every read, so
162+
pass `period_start`/`period_end`/`periods` to change the reporting window, which drops the frozen
163+
facts of any window no column states.
160164
161165
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
162166
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -194,8 +198,10 @@ async def asyncio_detailed(
194198
) -> Response[ErrorResponse | OperationEnvelopeReportResponse]:
195199
"""Regenerate Report
196200
197-
Re-runs fact generation for an existing Report against the latest ledger state. Pass
198-
`period_start`/`period_end`/`periods` only if you want to change the reporting window.
201+
Rewrites a Report's live columns from the latest ledger state. A column whose period the books have
202+
closed is frozen and keeps its facts; an open column already follows the ledger on every read, so
203+
pass `period_start`/`period_end`/`periods` to change the reporting window, which drops the frozen
204+
facts of any window no column states.
199205
200206
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
201207
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -236,8 +242,10 @@ async def asyncio(
236242
) -> ErrorResponse | OperationEnvelopeReportResponse | None:
237243
"""Regenerate Report
238244
239-
Re-runs fact generation for an existing Report against the latest ledger state. Pass
240-
`period_start`/`period_end`/`periods` only if you want to change the reporting window.
245+
Rewrites a Report's live columns from the latest ledger state. A column whose period the books have
246+
closed is frozen and keeps its facts; an open column already follows the ledger on every read, so
247+
pass `period_start`/`period_end`/`periods` to change the reporting window, which drops the frozen
248+
facts of any window no column states.
241249
242250
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
243251
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

‎robosystems_client/graphql/generated/get_information_block.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ class GetInformationBlockInformationBlockFacts(BaseModel):
8787
unit: str
8888
fact_scope: str = Field(alias="factScope")
8989
fact_set_id: Optional[str] = Field(alias="factSetId")
90+
provenance: Optional[Any]
91+
frozen_at: Optional[str] = Field(alias="frozenAt")
9092

9193

9294
class GetInformationBlockInformationBlockRules(BaseModel):

‎robosystems_client/graphql/generated/get_ledger_report_package.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ class GetLedgerReportPackageReportPackageItemsBlockFacts(BaseModel):
118118
unit: str
119119
fact_scope: str = Field(alias="factScope")
120120
fact_set_id: Optional[str] = Field(alias="factSetId")
121+
provenance: Optional[Any]
122+
frozen_at: Optional[str] = Field(alias="frozenAt")
121123

122124

123125
class GetLedgerReportPackageReportPackageItemsBlockRules(BaseModel):

‎robosystems_client/graphql/generated/list_information_blocks.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ class ListInformationBlocksInformationBlocksFacts(BaseModel):
8787
unit: str
8888
fact_scope: str = Field(alias="factScope")
8989
fact_set_id: Optional[str] = Field(alias="factSetId")
90+
provenance: Optional[Any]
91+
frozen_at: Optional[str] = Field(alias="frozenAt")
9092

9193

9294
class ListInformationBlocksInformationBlocksRules(BaseModel):

‎robosystems_client/graphql/generated/operations.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,8 @@
553553
unit
554554
factScope
555555
factSetId
556+
provenance
557+
frozenAt
556558
}
557559
rules {
558560
id
@@ -1323,6 +1325,8 @@
13231325
unit
13241326
factScope
13251327
factSetId
1328+
provenance
1329+
frozenAt
13261330
}
13271331
rules {
13281332
id
@@ -1648,6 +1652,8 @@
16481652
unit
16491653
factScope
16501654
factSetId
1655+
provenance
1656+
frozenAt
16511657
}
16521658
rules {
16531659
id

‎robosystems_client/graphql/operations/ledger/GetInformationBlock.graphql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ query GetInformationBlock(
2828
}
2929
facts {
3030
id elementId value textValue factType contentType periodStart periodEnd
31-
periodType unit factScope factSetId
31+
periodType unit factScope factSetId provenance frozenAt
3232
}
3333
rules {
3434
id ruleCategory rulePattern ruleCheckKind ruleExpression

‎robosystems_client/graphql/operations/ledger/GetLedgerReportPackage.graphql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ query GetLedgerReportPackage($reportId: String!) {
2424
}
2525
facts {
2626
id elementId value textValue factType contentType periodStart periodEnd
27-
periodType unit factScope factSetId
27+
periodType unit factScope factSetId provenance frozenAt
2828
}
2929
rules {
3030
id ruleCategory rulePattern ruleCheckKind ruleExpression

‎robosystems_client/graphql/operations/ledger/ListInformationBlocks.graphql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ query ListInformationBlocks(
2828
}
2929
facts {
3030
id elementId value textValue factType contentType periodStart periodEnd
31-
periodType unit factScope factSetId
31+
periodType unit factScope factSetId provenance frozenAt
3232
}
3333
rules {
3434
id ruleCategory rulePattern ruleCheckKind ruleExpression

‎robosystems_client/graphql/schema.graphql‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4047,6 +4047,16 @@ type InformationBlockFact {
40474047
"""historical | in_scope"""
40484048
factScope: String!
40494049
factSetId: String
4050+
4051+
"""
4052+
The fact's own typed `FactProvenance` descriptor (discriminated on `origin`): a `pivot` names the accounts that foot to it, a `rollup` the concepts and weights it summed, a `derived` value its computations and the amounts by part. Null means unknown, never the set's descriptor.
4053+
"""
4054+
provenance: JSON
4055+
4056+
"""
4057+
When the fact's column froze: its period fully closed, so the value is the record. Null is a live column that follows the books.
4058+
"""
4059+
frozenAt: DateTime
40504060
}
40514061

40524062
"""

0 commit comments

Comments
 (0)