Repository navigation
chore: regenerate the API client from the current Client API spec - #279
quinn-galileo wants to merge 17 commits into
Conversation
The Client API spec now has a single ScorerName schema, so the CoreScorerName retitle no longer applies and the duplicate-value dedupe moves to ScorerName. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Re-imported openapi.yaml from the production Client API spec and regenerated src/splunk_ao/resources with the repo's generator scripts. No hand edits. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ScorerConfig is now RuntimeScorerConfig in the spec, and ProjectCreate no longer has create_example_templates. Both broke at import or call time without a type-check error, because mypy skips the generated package. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Also switch the non-gen_ai delete test to ProjectType.PROTECT, since LLM_MONITOR is no longer a project type. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… breaking Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
quinn-galileo
left a comment
There was a problem hiding this comment.
🤖 This review was generated by the Astra agent (claude-opus-5-5). It may contain mistakes.
Verdict: approve — The hand-written adaptations are correct and complete. Every hand-written import resolves against the regenerated tree, and the regression tests exercise the real parser.
General Comments
- 🟡 minor (question): The linked ticket contradicts this PR's premise. SAO-9342 says: "API client: already done. ... No regeneration or api change needed." This PR regenerates the client and adds a Breaking entry under
[Unreleased](CHANGELOG.md:22). The stagingconfigure_rate_limitfailure justifies the change. Still, please confirm two points with the ticket owner: - Should SAO-9342 be updated, or should this prerequisite get its own ticket? The description also says the link was not verified. The ticket exists and is under epic SAO-6584.
- Is a breaking change to
splunk_ao.resourcesacceptable for the next release after0.5.0(pyproject.toml:3)? The stacked evaluator PRs will ship with it.
Follow-ups
Suggested follow-up work that could be tracked as Jira tickets:
pyproject.toml:337-337: mypy runs withfollow_imports = "skip", so it cannot detect a hand-written import of a generated symbol that a regeneration removed. This PR hit that twice:ScorerConfigandcreate_example_templates. Add a cheap guard test that imports every non-generatedsplunk_aomodule and resolves eachfrom splunk_ao.resources... import X. That catches the next regeneration break in CI rather than by hand. I ran an equivalent AST-based check on this branch, and it found no unresolved symbols.src/splunk_ao/evaluators.py:49-72: The regeneratedDecisionScorerDB.answer_optionsnow advertises two new server shapes:list[DecisionChoice]({label, description}) for categorical.DecisionBooleanCriteria({true, false}) for boolean_probability.
normalize_decision_answer_optionsrejects both. A Mapping raises at line 49, and a choice dict withoutlevelraises at line 62.DecisionEvaluator._read_answer_options(src/splunk_ao/evaluator.py:1053-1061) then logs a warning and setsanswer_optionsto None. Reads stay safe, but evaluators with described choices or boolean criteria lose that data. The create path also cannot send them. Add support for both shapes.
Re-add vegas_gateway to IntegrationProvider and LLMIntegration and task types 7, 9 and 12 to TaskType, as the StepType patch does, and fail with a clear message if the ScorerName enum moves. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated output only. The remaining openapi.yaml churn is the server's unordered applicable_types lists in column examples. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Experiments().list parses a row with task_type 7. The project tests gain Given/When/Then comments, and the create test is renamed for what it guards. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
List every removed field, name removed members, describe the ScorerName rename and the RuntimeScorerConfig construction change, and drop the restored enum values from the removals. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A += on a renamed schema would create a stub and exit 0, silently dropping the restored values. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…h note Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
quinn-galileo
left a comment
There was a problem hiding this comment.
🤖 This review was generated by the Astra agent (claude-opus-5-5). It may contain mistakes.
Verdict: approve — The new enum guard fails on a spec that lacks the patched schemas and passes on the current spec. The corrected ground_truth note in CHANGELOG matches what RuntimeScorerConfig.from_dict does.
Why
The checked-in API client (
src/splunk_ao/resources/, generated fromopenapi.yaml) has drifted from the server. Current servers return enum values the client doesn't know, and the generated parser raises on them. Against staging,Projects().get(id=...)fails with:GET /projects/{id}now includesconfigure_rate_limitinpermissions, which the generatedProjectActionenum lacks. Lookup by name still works, but every project lookup by id is broken on current servers. That blocks the project-scoped evaluator PRs stacked on this one.Ticket: SAO-9342
What
The client is regenerated with the repo's documented procedure:
Spec source: the production Client API spec,
https://api.galileo.ai/client/openapi.json. Nothing underresources/is hand-edited.Spec diff against the previous
openapi.yaml:CoreScorerName/ScorerNamepair is now one schema.Notable enum changes:
ProjectAction: +configure_rate_limit,read_all_logs,read_filtered_logs; −update.CollaboratorRole: +custom.ScorerAction: +create_global,create_shared.UserRole: +capability_based.UserAction: +change_role_to_capability_based.NodeTypeandStepType: +http.OrganizationAction: +read_ai_usage_organization,read_unredacted_data.IntegrationProvider: +typesafe. The spec dropsvegas_gateway; the import script keeps it (see below).ProjectType: −llm_monitor, −prompt_evaluation.TaskType: +19. The spec drops 7, 9 and 12; the import script keeps them (see below).ScorerName: now holds the public metric names, not the internal underscore-prefixed ones.Import script. The spec now has a single
ScorerNameschema, which replaces the oldCoreScorerName/ScorerNamepair. The oldCoreScorerNameretitle patch no longer applied and failed the import. The duplicate-value dedupe now targetsScorerName, behind a guard that fails with a clear message ifScorerName,IntegrationProvider,LLMIntegrationorTaskTypeis renamed or removed. Without the guard, a+=patch on a missing schema would create a stub and silently drop the restored values.vegas_gatewayfromIntegrationProviderandLLMIntegration, and task types 7, 9 and 12 fromTaskType. Older servers still return them, and the strict parsers would then fail:Integration.list(all=True)on any server still offeringvegas_gateway, andExperiments().list()for a whole page containing one legacy experiment. Following the existingStepTypepatch, the script adds the values back (+= [...] |= unique).CoreScorerNamepatch. Its stale PR Update API Client #205 will need closing or resetting before that workflow's next run after this merges.Hand-written adaptations forced by the regeneration (all small):
ScorerConfigwas renamedRuntimeScorerConfigon the server. It keeps the old fields, adds new ones with defaults, and makesscorer_typeoptional. The references are updated inexperiment.py,experiments.py,runs.py,scorers.pyandutils/metrics.py, plus two tests. Before this change,import splunk_aofailed.ProjectCreate.create_example_templateswas removed.Projects.createno longer passes it; passing it raisedTypeError.ProjectType.PROTECT, becauseLLM_MONITORno longer exists.The repo's mypy runs with
follow_imports = "skip", so it can't see removed generated symbols, and neither break above was a type error. Both were found by importing every module and by resolving each hand-written import against the new tree.Unchanged. The scope fields and endpoint that the stacked PRs use are generated with the same names and types:
CreateScorerRequest.is_global/project_idsScorerResponse.is_global/scope_projects(ScorerScopeProjectRef(id, name))UpdateScorerScopeRequest(is_global, project_ids)set_scorer_scope_scorers_scorer_id_scope_putBreaking changes for SDK users
These matter only for code that imports generated symbols from
splunk_ao.resourcesdirectly. The full list is inCHANGELOG.mdunder[Unreleased]→### Changed.ScorerConfig→RuntimeScorerConfig. Its field order changed, so pass fields by keyword./projects/{project_id}/experiments/metrics/projects/{project_id}/experiments/{experiment_id}/metric_settings/integrations/vegas_gatewayCustomized*GPTScorerand*Templatescorer families,FineTunedScorer,RegisteredScorer,ScorerType,ScorersConfiguration, and others.BaseScorerVersionResponse.input_type(returned bycreate_custom_llm_evaluator()and the other evaluator create functions);input_type,output_typeandscoreable_node_typesonBaseScorerVersionDB;BaseScorer.sub_scorers;ProjectCreate.create_example_templates;scorer_type/critiqueon theMetric*status models; and eight fields onCreateJobRequest/CreateJobResponse.ProjectAction.UPDATE,ProjectType.LLM_MONITOR,ProjectType.PROMPT_EVALUATION.CoreScorerNameis renamed toScorerName, replacing the old underscore-valuedScorerName.Where to start reading
scripts/import-openapi-yaml.sh: the one patch change.fix: adapt hand-written code to the regenerated client, and the tests.CHANGELOG.md.openapi.yamlandsrc/splunk_ao/resources/are mechanical generator output. The twochore: regenerate the API client …commits contain only those files.import splunk_aofails at the generated-only commit and works again after the next commit, so review the PR as a whole.How it was tested
New tests in
tests/test_projects.py:test_get_project_by_id_parses_configure_rate_limit_permissionserves a project with aconfigure_rate_limitpermission throughrespxand runs it through the real generated parser. It fails on the old client with the staging error above.test_create_project_posts_body_without_example_templateschecks the exactProjectCreatebody thatProjects.createsends.New test in
tests/test_experiments.py:test_list_experiments_parses_legacy_task_typeserves an experiment withtask_type: 7throughrespxand checks that it parses.Targeted tests:
test_projects,test_project,test_evaluators,test_evaluator,test_experiments,test_experiment,test_runs,test_scorers,utils/test_metricsandtest_agent_streams_evaluatorsandtest_integrationall pass.poetry run invoke type-checkpasses.ruff checkpasses on the changed hand-written files.Every non-generated
splunk_aomodule imports.Read-only staging check, run from a script outside the repo:
Projects().get(name=...)Projects().get(id=...)ValueError: 'configure_rate_limit' is not a valid ControlResourceActionRelated PRs
🤖 Generated with Claude Code