Skip to content

fix: register candidate modules while loading adapters - #79

Open
Afloat16 wants to merge 2 commits into
billion-token-one-task:masterfrom
Afloat16:fix/candidate-module-registration-20261202-r2
Open

Afloat16 wants to merge 2 commits into
billion-token-one-task:masterfrom
Afloat16:fix/candidate-module-registration-20261202-r2

Conversation

@Afloat16

@Afloat16 Afloat16 commented Dec 2, 2026 •

Copy link
Copy Markdown

Problem

The runner and materialization validator execute candidate adapters without registering their module. A valid adapter using from __future__ import annotations and 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.

@cla-assistant

cla-assistant Bot commented Dec 2, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@cla-assistant

cla-assistant Bot commented Dec 2, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant