Repository navigation
Conversation
|
|
1 similar comment
|
|
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.
Problem
The runner and materialization validator execute candidate adapters without registering their module. A valid adapter using
from __future__ import annotationsand a dataclass can fail during import because Python cannot resolve the class's module. Deferred type-hint resolution has the same missing namespace problem.Changes
Share a loader that registers the module before execution, using a stable name derived from its resolved file path so separate adapters retain separate namespaces. Use it both during materialization and at runner startup. Restore the previous registration, or remove the partial entry, when execution fails.
Validation
Regressions execute a dataclass-backed candidate hook, resolve deferred annotations, load two adapters with different aliases, and check failed imports leave no partial registration. An additional end-to-end regression materializes a dataclass-backed adapter and resolves its annotations in a subprocess using the portable bundle.
Base regression result: 3 failed, 1 passed.
python -m pytest -q tests/test_candidate_module_registration.py tests/test_runner_contract_and_failure_policy.py: 40 passed, 26 subtests passed.No candidate permissions, contract checks, or third-party dependencies are added.