feat(adagents): add permissive property resolver#827
Draft
sangilish wants to merge 2 commits into
Draft
Conversation
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
Refs #711.
This adds an explicit opt-in resolver for operational adagents.json files that list a sales agent in
authorized_agents[]but omit the schema-conformantauthorization_typeselector.The existing
get_properties_by_agent()behavior stays strict and unchanged. New callers can use:In permissive mode, a matching bare
authorized_agentsentry resolves to the file's top-levelproperties[]. The fallback only applies when the entry has noauthorization_typeand no known selector field. If the agent is not listed, or if the entry has an explicit selector, the result remains the strict result.What changed
resolve_properties_for_agent(..., mode="strict" | "permissive").get_properties_by_agent()as the strict path.adcp.__all__and updated the public API snapshot.Testing
uv run pytest tests/test_adagents.py -q -k "resolve_properties_for_agent or get_properties_by_agent"uv run pytest tests/test_public_api.py tests/test_adagents.py -quv run pytest -quv run ruff check src/adcp/adagents.py src/adcp/__init__.py tests/test_adagents.py tests/fixtures/public_api_snapshot.jsonuv run mypy src/adcpgit diff --checkNote:
uv run ruff checkacross the full repository currently reports pre-existing lint drift in unrelated tests. The files touched in this PR pass ruff.