feat(ledger): Surface fact provenance and align IB queries with TS parity#126
Merged
Conversation
Add `provenance` to the factSet selection, and level the GetInformationBlock / ListInformationBlocks queries up to the full envelope standard — rules (incl. ruleTarget / ruleVariables), factSet, verificationResults, and view — so the Python IB reads match the TypeScript client field-for-field. Regenerate the FactSetLite model.
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
This PR introduces fact provenance support to the ledger client and brings Interactive Brokers (IB) related GraphQL queries to feature parity with the TypeScript implementation.
Key Accomplishments
Fact Provenance Support
FactSetLiteProvenanceType0model to represent provenance metadata associated with facts, enabling downstream consumers to understand the origin and lineage of individual facts in a fact set.FactSetLitemodel to include an optionalprovenancefield, wiring provenance data into the core fact representation.models/__init__.pybarrel export for clean public API access.IB Query Parity with TypeScript Client
Breaking Changes
FactSetLitemodel now includes aprovenancefield. If any downstream code performs strict schema validation or serialization that does not tolerate new/unknown fields, it may need to be updated. However, since the field appears to be optional (using a union type with a nullable pattern —Type0), this should be backward-compatible for most consumers.Testing Notes
provenancefield is correctly deserialized when present in API responses, and that it gracefully handlesnull/absent values.FactSetLiteProvenanceType0model correctly parses all expected provenance metadata fields.Infrastructure Considerations
FactSetLiteobjects may want to opt in to leveraging the new provenance data for audit trails, debugging, or data lineage features.🤖 Generated with Claude Code
Branch Info:
feature/fact-provenancemainCo-Authored-By: Claude noreply@anthropic.com