Repository navigation
feat(reports): investor graphs receive reports, and a report records its origin - #2084
Conversation
Receiving a report needs RoboLedger's reporting tables (Report, Fact, FactSet and their edges), not its general ledger. The roboinvestor schema now brings that section the way the SEC repository does, and the materializer stages it on any graph that can receive, so the traversal from a position to a fact resolves on an investor-only graph. Bumps xbrlkit to 0.22.
A report carries an origin: authored from the graph's own books, shared in from another graph, or uploaded as a file. Every rule that protected a received report (read-only, never re-derived from rows, no lineage download, admin delete) now reads the origin instead of the source graph, which a report that arrives as a file does not have. A received report cannot be shared onward. The origin is on the report responses.
The demo's fund graph now carries the roboinvestor extension alone, so its traversal check proves the claim; the technical docs say it, and describe a report's origin.
|
Change classification: normal — platform or application code changed. A normal change carries a documented automated review on this pull request before merge, in place of a second human approver. The |
|
@claude please review this PR |
|
Claude finished @jfrench9's task in 20s —— View job Review of PR #2084Verdict: solid, approve with a few follow-ups. The change is coherent and the tests and demo cover the main paths. I read the diff and checked a few call sites. I did not run the test suite. Findings
Things I'd confirm before merge
|
The column refresh, the close's freeze and the reopen's thaw still told a received report by its source report id, which a report that arrives as a file does not have. All three read the origin now, with a database-backed test for both received origins.
|
Review follow-up, pushed:
|
Summary
Two foundations for receiving reports. An investor graph now carries RoboLedger's reporting tables, so a report shared into a graph with the
roboinvestorextension alone materializes andPortfolio → Position → Security → Entity → Report → Factresolves there. And a report now records how it arrived (origin), so the rules that protect a received report no longer depend on it having a source graph.Changes
Graph schema and materialization
schemas/extensions/roboinvestor.py: the extension's tables are its portfolio tables plus RoboLedger's reporting section (Report,Fact,FactSetand their edges), the same section the SEC repository loads. None of the general ledger.schemas/runtime/manager.py,schemas/runtime/builder.py: a table named by two extensions is defined once, so a graph with bothroboinvestorandroboledgerstill compiles.operations/extensions/materialize.py: the reporting tables belong to areportingsection, staged on any graph with a receiving extension (roboledgerorroboinvestor). Ledger tables still stage only on a ledger graph.Report origin
models/extensions/roboledger/report.py:reports.origin, one ofauthored,shared,uploaded, NOT NULL with a CHECK, andReport.is_received.0069: adds the column inpublicand every tenant schema and backfillssharedwheresource_graph_idis set.operations/roboledger/commands/reports.py: a share stamps its copyshared. Read-only, admin delete and the filing-status exemption readis_received. A received report cannot be shared onward.operations/roboledger/reads/reports.py,views/information_blocks.py: the stored artifact of a received report is never re-derived from rows, and it has no lineage download, keyed on origin.models/api/extensions/reports.py,report_package.py,graphql/types/report_package.py:originon the report responses.Nothing writes
uploadedyet; the value exists so the import that will use it lands on rules already in place.Dependencies, demo, docs
xbrlkit0.21 → 0.22.examples/roboinvestor_demo: the fund graph is created withroboinvestoralone.docs/technical: RoboInvestor-Operations and Reporting-and-Rendering say both of the above.Breaking Changes
None.
originonReportResponseand the report package (REST and GraphQL). Generated tier, so a client minor on the next regen; the Python client'sschema.graphqlsnapshot will need a refresh.0069runs on the daemon's boot. An existing investor-only graph gains the reporting tables the next time it materializes.Testing
just test-all: 19,359 passed, 44 skipped, 2 xfailed; ruff, format, basedpyright, cfn-lint, actionlint and the dbt tests passed.0069applied on the local stack: the column is present inpublicand all tenant schemas.just demo-roboinvestoragainst the local stack on this branch, with the fund graph carryingroboinvestoralone: 31/31 checks, including "Portfolio → Position → Security → Entity → Report → Fact resolves" and "traversal attributes facts to the issuer".Certification
🤖 Generated with Claude Code