feat(sdk/go): expose include_provenance and fix dead query_results json tag#2731
Open
r266-tech wants to merge 1 commit into
Open
feat(sdk/go): expose include_provenance and fix dead query_results json tag#2731r266-tech wants to merge 1 commit into
r266-tech wants to merge 1 commit into
Conversation
…on tag Go callers could not request retrieval provenance (server FindRequest/ SearchRequest accept include_provenance with extra=forbid, but FindOptions/ SearchOptions had no field and never sent it). Separately, FindResult. QueryResults was tagged json:"query_results" while the server emits per- query results under the top-level "provenance" key, so it was always empty. Add IncludeProvenance to FindOptions/SearchOptions, send it only when set, and fix the result tag to "provenance". Follow-up to volcengine#2703.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
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
Two related gaps in the Go SDK's retrieval surface, both verified against
main:include_provenancecould not be requested from Go. The server'sFindRequest/SearchRequestacceptinclude_provenance: bool = Falseand usemodel_config = ConfigDict(extra="forbid"), butFindOptions/SearchOptionshad no field for it and the request payloads never sent it — so a Go caller literally could not ask for retrieval provenance.FindResult.QueryResultshad a dead JSON tag. It was taggedjson:"query_results,omitempty", but the server'sto_dict(include_provenance=True)emits the per-query results under the top-levelprovenancekey (openviking_cli/retrieve/types.py:result["provenance"] = [...]). The server never emitsquery_results, soQueryResultswas always silently empty.Changes
FindOptions/SearchOptions: addIncludeProvenance bool(defaults false).Find/Search: sendinclude_provenance: trueonly when set — absent when false, matching theextra="forbid"contract and mirroring howlevel/since/untilare wired in fix(sdk/go): expose search date and level filters #2703.FindResult.QueryResults: fix the JSON tagquery_results→provenanceso it actually populates.FindandSearcheach assert the flag is sent when true, omitted when unset, and that aprovenanceresponse parses intoQueryResults.Backward compatibility
The previous
query_resultstag was dead — the server never emitted that key, soQueryResultswas always empty. Withomitempty, the marshaled output is unchanged for anyFindResultproduced by this SDK/server; the change only makes the field start populating from the realprovenancekey.Follow-up to #2703 (Go retrieval date/level parity).