Skip to content

Use current module paths for migrated imports - #120

Open
iamziyuzhao wants to merge 1 commit into
mainfrom
codex/migrate-legacy-imports
Open

iamziyuzhao wants to merge 1 commit into
mainfrom
codex/migrate-legacy-imports

Conversation

@iamziyuzhao

@iamziyuzhao iamziyuzhao commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Change

The agent/task/environment refactors moved shared symbols, but framework callers, examples, and tests still imported them through the compatibility re-exports. Update 66 import statements (78 symbol references) across 51 Python files, including 24 imports in generated Python snippets, to use the current modules:

  • RunOutput and load_callable: hermit.task → hermit.common.
  • Environment types/helpers used by callers (Limits, Mount, Unsupported, as_environment): hermit.agent.base.interface → hermit.environment.
  • as_messages: hermit.agent.base.interface → hermit.agent.model.direct.

Update the migration table to name the current entry points. The original five deprecated module entry points (hermit.agents, hermit.evolver, hermit.backends, hermit.llm, hermit.trajectory) already have zero active callers. Preserve all forwarding modules, public compatibility exports, historical migration notes, and the intentional compatibility tests.

This is an import-only cleanup: no signatures, defaults, agent behavior, exception classes, sandbox boundaries, or test assertions change. Shared core files now import from their owning layers; method and example callers follow the same rule.

Validation

  • Python 3.12 parsed all 51 changed Python files and the generated snippets; git diff --check passed.
  • Independently checked that all eight moved/re-exported symbols are identical objects at their old and current paths, and that the changed files preserve equivalent import bindings and identical non-import syntax trees.
  • python -m pytest tests/core/test_task.py tests/core/test_layers.py -q: 9 passed.
  • Offline walkthrough using the first-training recipe: hermit check, hermit train, and hermit eval --adapter final all exited 0. Training completed two steps; final evaluation scored 1.0 on two tasks with zero errors and $0 model cost.
  • bash docs/build.sh: passed, with warnings treated as errors.
  • python -m pytest --changed --durations=10 --tb=short on macOS / Python 3.12: 1,658 passed, 240 skipped, 16 failed, 1 warning in 544.15 seconds. Ran from a space-free virtual environment with its bin on PATH so the CLI stand-ins use the correct interpreter.
  • Re-ran exactly those 16 failed tests on unmodified base b65a5c6 in the same Python environment: all 16 failed again (9.35 seconds). No new failing test IDs were introduced. The failures concern unavailable bubblewrap/Linux /proc, missing optional rrsi/harness2 dependencies, and three existing virtual-environment interpreter assertions on this host. The one warning comes from the intentional deprecated-import compatibility test.
  • GitHub's Ubuntu test job is still running; it has not been reported as passed.
  • Linux/bubblewrap isolation is unverified on this macOS machine. Ubuntu CI installs bubblewrap, mini-swe-agent, and the configured GEPA/SkillOpt/Harness2/RRSI/SHE dependency groups. Real agent CLI integration tests remain skipped without --integration; ACE and other absent optional dependencies or prepared benchmark data may still skip.

Review

  • Tests and documentation cover the affected behavior, where applicable. Existing tests and their generated snippets use the current imports; compatibility tests are preserved; the migration table is updated.
  • Commands, defaults, and public interfaces are consistent. Public compatibility exports remain available, and all eight objects retain identity.
  • Shared logs and examples contain no credentials or private data. Generated training/evaluation artifacts and worker logs are excluded from the commit.
  • Documentation-only: links the issue where it was discussed with the core team. Not applicable: this changes framework, example, and test imports.
  • Core changes, agent layers, and implementation correctness reviewed: imports only, with no execution, error-handling, cancellation, or environment-boundary changes.
  • Real execution path exercised: the offline CLI check/train/eval walkthrough passed and its final output was evaluated successfully.
  • Test checklist: existing groups, names, docstrings, assertions, fixtures, isolation, and ordering remain unchanged; no tests or runtime cost are added. --changed selects every group because shared core code and the toy-task helper changed.
  • Sandbox checklist applicability checked: no process-launch or sandbox-visibility behavior changes.
  • Description reviewed against commit 4226ed3, the completed local checks, and the base-branch failure comparison. CI is explicitly pending above.
  • Independent review (post-PR audit): a separate agent reviewed the published title/body, complete patch, base/head, existing feedback, relevant callers, tests, and validation records at 4226ed36adeac60d452639c107b9944d82d039e6. The published patch matches the locally reviewed change. No actionable code findings. Its one description correction—clarifying which checks CI skips—is incorporated above. The later completed local suite and base-branch failure comparison are recorded above; no code changed after the audit. CI, Linux, and real CLI limitations remain disclosed.

This branch has not been deployed

No deployments
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