Align Python provider contracts - #6
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ebd8abc742
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| packet: dict[str, Any] = { | ||
| "schemaId": RESPONSE_SCHEMA_ID, | ||
| "schemaVersion": "1", | ||
| "languageId": "python", | ||
| "providerId": "asp-python", |
There was a problem hiding this comment.
Emit the required exact-response fields
Every successful query response built here violates the newly registered provider-native-exact-response.v1 schema: the resolved branch requires both ownerPath and normalizedParserFacts, but this packet includes neither. A schema-driven ASP client will therefore reject otherwise successful source and callable-skeleton projections before consuming their payload.
Useful? React with 👍 / 👎.
| kind=parts[-2], | ||
| symbol=unquote(parts[-1]), |
There was a problem hiding this comment.
Parse the item identity before scoped selector suffixes
For every method selector emitted by _projection_batch.py, such as #item/method/run/scope/implementation-owner/type/Agent, taking the final two path components produces kind="type" and symbol="Agent". find_function() then rejects the selector because its kind is not function or method, so resident exact queries cannot materialize any projected method; parse the item/<kind>/<symbol> portion separately and retain the following scope components for disambiguation.
Useful? React with 👍 / 👎.
| package_ids_by_name = { | ||
| package["name"]: package["packageId"] for package in packages | ||
| } | ||
| internal_dependencies = [] | ||
| external_dependencies = [] | ||
| for dependency in dependencies: | ||
| to_package_id = package_ids_by_name.get(dependency["packageName"]) |
There was a problem hiding this comment.
Normalize distribution names before matching workspace packages
When one workspace package depends on another using an equivalent normalized spelling—such as package name my_pkg and requirement my-pkg, or merely different case—this exact lookup misses the package and emits an external dependency instead of an internal edge. Python distribution names treat runs of -, _, and . case-insensitively as equivalent, so both package names and dependency names need the same normalization before this match.
Useful? React with 👍 / 👎.
Summary
semantic-structural-index.v1with the shared ASP schema extensionVerification
uv run --frozen --group test python -m pytest -o addopts= tests(376 passed on the earlier aligned snapshot)uv run --frozen py-harness check --full .