Skip to content

refactor(layout): phase2 rewrite call sites to new paths, remove shims - #596

Merged
delete-cloud merged 1 commit into
mainfrom
refactor/layout-phase2-rewrite
Jun 14, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
refactor/layout-phase2-rewrite

Conversation

@delete-cloud

@delete-cloud delete-cloud commented Jun 14, 2026 •

Copy link
Copy Markdown
Owner

What

Phase 2 (final) of the package-layout consolidation. Now that batches 1–4 (#591/#593/#594/#595) relocated the modules behind compat shims, this PR repoints every remaining call site to the new import paths and deletes all 27 deprecation shims. Pure mechanical change — no behavior change.

  • 102 call-site files updated (src + tests)
  • 27 shim files removed
  • 26 old top-level module paths repointed to their subpackage homes (coding_agent.runtime_store → coding_agent.stores.runtime_store, coding_agent.topic_* → coding_agent.topics.*, coding_agent.bee_* → coding_agent.bee.*, coding_agent.metrics → coding_agent.observability.metrics, coding_agent.app → coding_agent.core.app, etc.)
  • A-package names (coding_agent.observability / adapter / kb) were already real packages and are untouched.

Verification (independent, outside codex sandbox)

  • uv run pytest -q: 3725 passed, 8 skipped, 20 xfailed
  • 0 shim files remain.
  • Repo grep for every old dotted path: no matches (the only from .metrics hit is evaluation/metrics.py, a distinct package-internal module).

Completes the consolidation: src/coding_agent/ root now holds only the package essentials + intentional cross-cutting modules (errors.py, redaction.py, tokens.py), with all subsystems in cohesive subpackages.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Internal code reorganization and module restructuring to improve package organization and remove deprecated import paths. No changes to user-facing functionality.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 98f2c87d-890e-4bff-a52b-c1e297e36c3d

📥 Commits

Reviewing files that changed from the base of the PR and between fff0c8c and c7fbe39.

📒 Files selected for processing (129)
  • coding-agent/src/coding_agent/action_safety/validation_feedback.py
  • coding-agent/src/coding_agent/adapter_types.py
  • coding-agent/src/coding_agent/agent_identity.py
  • coding-agent/src/coding_agent/agent_observability.py
  • coding-agent/src/coding_agent/app.py
  • coding-agent/src/coding_agent/approval/interactions.py
  • coding-agent/src/coding_agent/bee/launch.py
  • coding-agent/src/coding_agent/bee/runtime.py
  • coding-agent/src/coding_agent/bee/template_pack.py
  • coding-agent/src/coding_agent/bee/workspace.py
  • coding-agent/src/coding_agent/bee_command_bridge.py
  • coding-agent/src/coding_agent/bee_launch.py
  • coding-agent/src/coding_agent/bee_runtime.py
  • coding-agent/src/coding_agent/bee_template_pack.py
  • coding-agent/src/coding_agent/bee_workspace.py
  • coding-agent/src/coding_agent/cli/acp_command.py
  • coding-agent/src/coding_agent/cli/local_runtime.py
  • coding-agent/src/coding_agent/cli/main.py
  • coding-agent/src/coding_agent/cli/remote_commands.py
  • coding-agent/src/coding_agent/cli/stats_command.py
  • coding-agent/src/coding_agent/context_pack.py
  • coding-agent/src/coding_agent/core/app.py
  • coding-agent/src/coding_agent/events/display.py
  • coding-agent/src/coding_agent/events/replay.py
  • coding-agent/src/coding_agent/executors/external.py
  • coding-agent/src/coding_agent/external_executor.py
  • coding-agent/src/coding_agent/local_durable_store.py
  • coding-agent/src/coding_agent/local_storage.py
  • coding-agent/src/coding_agent/metrics.py
  • coding-agent/src/coding_agent/pg_durable_store.py
  • coding-agent/src/coding_agent/plugins/kb.py
  • coding-agent/src/coding_agent/plugins/memory.py
  • coding-agent/src/coding_agent/plugins/metrics.py
  • coding-agent/src/coding_agent/plugins/storage.py
  • coding-agent/src/coding_agent/recall_context.py
  • coding-agent/src/coding_agent/recall_evaluation.py
  • coding-agent/src/coding_agent/remote/worker.py
  • coding-agent/src/coding_agent/runs/attached_executor.py
  • coding-agent/src/coding_agent/runs/cancel.py
  • coding-agent/src/coding_agent/runs/lifecycle.py
  • coding-agent/src/coding_agent/runs/metadata.py
  • coding-agent/src/coding_agent/runs/observation.py
  • coding-agent/src/coding_agent/runs/persistence.py
  • coding-agent/src/coding_agent/runs/query.py
  • coding-agent/src/coding_agent/runs/recovery.py
  • coding-agent/src/coding_agent/runs/resume.py
  • coding-agent/src/coding_agent/runs/runtime_events.py
  • coding-agent/src/coding_agent/runs/scheduled.py
  • coding-agent/src/coding_agent/runtime_store.py
  • coding-agent/src/coding_agent/scheduled_runs.py
  • coding-agent/src/coding_agent/server/http_server.py
  • coding-agent/src/coding_agent/server/session_manager.py
  • coding-agent/src/coding_agent/storage_migration.py
  • coding-agent/src/coding_agent/stores/durable_local.py
  • coding-agent/src/coding_agent/stores/durable_pg.py
  • coding-agent/src/coding_agent/stores/migration.py
  • coding-agent/src/coding_agent/tools/subagent.py
  • coding-agent/src/coding_agent/topic_lifecycle.py
  • coding-agent/src/coding_agent/topic_memory.py
  • coding-agent/src/coding_agent/topic_provenance.py
  • coding-agent/src/coding_agent/topic_range_index.py
  • coding-agent/src/coding_agent/topic_recall.py
  • coding-agent/src/coding_agent/topic_store.py
  • coding-agent/src/coding_agent/topics/memory.py
  • coding-agent/src/coding_agent/workspace_archive.py
  • coding-agent/tests/cli/test_entrypoint_contract.py
  • coding-agent/tests/cli/test_local_runtime.py
  • coding-agent/tests/cli/test_remote_client.py
  • coding-agent/tests/coding_agent/environment/test_docker_workspace_provider.py
  • coding-agent/tests/coding_agent/environment/test_docker_workspace_provider_transfer.py
  • coding-agent/tests/coding_agent/environment/test_workspace_archive.py
  • coding-agent/tests/coding_agent/test_adapter_types.py
  • coding-agent/tests/coding_agent/test_agent_observability.py
  • coding-agent/tests/coding_agent/test_approval_interactions.py
  • coding-agent/tests/coding_agent/test_bee_command_bridge.py
  • coding-agent/tests/coding_agent/test_bee_launch.py
  • coding-agent/tests/coding_agent/test_bee_runtime.py
  • coding-agent/tests/coding_agent/test_bee_template_pack.py
  • coding-agent/tests/coding_agent/test_bee_template_pack_smoke.py
  • coding-agent/tests/coding_agent/test_bee_workspace.py
  • coding-agent/tests/coding_agent/test_bootstrap.py
  • coding-agent/tests/coding_agent/test_cli_pipeline.py
  • coding-agent/tests/coding_agent/test_context_pack.py
  • coding-agent/tests/coding_agent/test_cross_topic_memory_smoke.py
  • coding-agent/tests/coding_agent/test_display_events.py
  • coding-agent/tests/coding_agent/test_external_executor.py
  • coding-agent/tests/coding_agent/test_external_executor_smoke.py
  • coding-agent/tests/coding_agent/test_jsonl_runtime_store.py
  • coding-agent/tests/coding_agent/test_memory_review.py
  • coding-agent/tests/coding_agent/test_pg_durable_fencing.py
  • coding-agent/tests/coding_agent/test_pg_runtime_store.py
  • coding-agent/tests/coding_agent/test_pipeline_adapter.py
  • coding-agent/tests/coding_agent/test_recall_context.py
  • coding-agent/tests/coding_agent/test_recall_evaluation.py
  • coding-agent/tests/coding_agent/test_release_observability_contract.py
  • coding-agent/tests/coding_agent/test_run_lifecycle.py
  • coding-agent/tests/coding_agent/test_runtime_attached_executor_service.py
  • coding-agent/tests/coding_agent/test_runtime_cancel_service.py
  • coding-agent/tests/coding_agent/test_runtime_event_replay_service.py
  • coding-agent/tests/coding_agent/test_runtime_observation_service.py
  • coding-agent/tests/coding_agent/test_runtime_query_service.py
  • coding-agent/tests/coding_agent/test_runtime_resume_service.py
  • coding-agent/tests/coding_agent/test_runtime_run_persistence.py
  • coding-agent/tests/coding_agent/test_runtime_run_recovery.py
  • coding-agent/tests/coding_agent/test_runtime_store_contracts.py
  • coding-agent/tests/coding_agent/test_runtime_turn_service.py
  • coding-agent/tests/coding_agent/test_runtime_wire_event_recorder.py
  • coding-agent/tests/coding_agent/test_scheduled_runs.py
  • coding-agent/tests/coding_agent/test_sqlite_local_durable_fencing.py
  • coding-agent/tests/coding_agent/test_sqlite_runtime_store.py
  • coding-agent/tests/coding_agent/test_sqlite_storage_migration.py
  • coding-agent/tests/coding_agent/test_topic_layer_smoke.py
  • coding-agent/tests/coding_agent/test_topic_lifecycle.py
  • coding-agent/tests/coding_agent/test_topic_memory.py
  • coding-agent/tests/coding_agent/test_topic_provenance.py
  • coding-agent/tests/coding_agent/test_topic_range_index.py
  • coding-agent/tests/coding_agent/test_topic_recall.py
  • coding-agent/tests/coding_agent/test_topic_store.py
  • coding-agent/tests/coding_agent/tools/test_subagent.py
  • coding-agent/tests/conftest.py
  • coding-agent/tests/dogfood/test_local_dogfood_run.py
  • coding-agent/tests/dogfood/test_workspace_provider_demo.py
  • coding-agent/tests/integration/test_durable_runtime_smoke.py
  • coding-agent/tests/integration/test_pipeline_e2e.py
  • coding-agent/tests/ui/test_developer_console.py
  • coding-agent/tests/ui/test_http_server.py
  • coding-agent/tests/ui/test_session_manager_public_api.py
  • coding-agent/tests/ui/test_session_manager_runtime.py
  • coding-agent/tests/unit/core/test_metrics.py
💤 Files with no reviewable changes (27)
  • coding-agent/src/coding_agent/agent_identity.py
  • coding-agent/src/coding_agent/pg_durable_store.py
  • coding-agent/src/coding_agent/bee_command_bridge.py
  • coding-agent/src/coding_agent/bee_template_pack.py
  • coding-agent/src/coding_agent/topic_recall.py
  • coding-agent/src/coding_agent/bee_workspace.py
  • coding-agent/src/coding_agent/bee_launch.py
  • coding-agent/src/coding_agent/context_pack.py
  • coding-agent/src/coding_agent/topic_provenance.py
  • coding-agent/src/coding_agent/local_durable_store.py
  • coding-agent/src/coding_agent/external_executor.py
  • coding-agent/src/coding_agent/app.py
  • coding-agent/src/coding_agent/bee_runtime.py
  • coding-agent/src/coding_agent/adapter_types.py
  • coding-agent/src/coding_agent/runtime_store.py
  • coding-agent/src/coding_agent/topic_range_index.py
  • coding-agent/src/coding_agent/recall_context.py
  • coding-agent/src/coding_agent/storage_migration.py
  • coding-agent/src/coding_agent/local_storage.py
  • coding-agent/src/coding_agent/recall_evaluation.py
  • coding-agent/src/coding_agent/scheduled_runs.py
  • coding-agent/src/coding_agent/topic_store.py
  • coding-agent/src/coding_agent/metrics.py
  • coding-agent/src/coding_agent/workspace_archive.py
  • coding-agent/src/coding_agent/topic_memory.py
  • coding-agent/src/coding_agent/topic_lifecycle.py
  • coding-agent/src/coding_agent/agent_observability.py

📝 Walkthrough

Walkthrough

All deprecated sys.modules redirect shims at the flat coding_agent/ package level are removed, and every consumer across source and test files is updated to import directly from the canonical structured subpackage paths (e.g., coding_agent.stores.runtime_store, coding_agent.topics.store, coding_agent.bee.*, coding_agent.adapter.types, coding_agent.observability.agent, coding_agent.environment.archive). No functional logic changes are present.

Changes

Deprecated shim removal and call-site import updates

Layer / File(s) Summary
Delete deprecated sys.modules redirect shims
coding-agent/src/coding_agent/adapter_types.py, coding-agent/src/coding_agent/agent_identity.py, coding-agent/src/coding_agent/agent_observability.py, coding-agent/src/coding_agent/app.py, coding-agent/src/coding_agent/bee_command_bridge.py, coding-agent/src/coding_agent/bee_launch.py, coding-agent/src/coding_agent/bee_runtime.py, coding-agent/src/coding_agent/bee_template_pack.py, coding-agent/src/coding_agent/bee_workspace.py, coding-agent/src/coding_agent/context_pack.py, coding-agent/src/coding_agent/external_executor.py, coding-agent/src/coding_agent/local_durable_store.py, coding-agent/src/coding_agent/local_storage.py, coding-agent/src/coding_agent/metrics.py, coding-agent/src/coding_agent/pg_durable_store.py, coding-agent/src/coding_agent/recall_context.py, coding-agent/src/coding_agent/recall_evaluation.py, coding-agent/src/coding_agent/runtime_store.py, coding-agent/src/coding_agent/scheduled_runs.py, coding-agent/src/coding_agent/storage_migration.py, coding-agent/src/coding_agent/topic_lifecycle.py, coding-agent/src/coding_agent/topic_memory.py, coding-agent/src/coding_agent/topic_provenance.py, coding-agent/src/coding_agent/topic_range_index.py, coding-agent/src/coding_agent/topic_recall.py, coding-agent/src/coding_agent/topic_store.py, coding-agent/src/coding_agent/workspace_archive.py
The sys.modules[__name__] redirect shim bodies are removed from all flat top-level module files that previously forwarded imports to new subpackage locations.
Update source implementation import paths
coding-agent/src/coding_agent/action_safety/validation_feedback.py, coding-agent/src/coding_agent/approval/interactions.py, coding-agent/src/coding_agent/bee/launch.py, coding-agent/src/coding_agent/bee/runtime.py, coding-agent/src/coding_agent/bee/template_pack.py, coding-agent/src/coding_agent/bee/workspace.py, coding-agent/src/coding_agent/cli/*, coding-agent/src/coding_agent/core/app.py, coding-agent/src/coding_agent/events/*, coding-agent/src/coding_agent/executors/external.py, coding-agent/src/coding_agent/plugins/*, coding-agent/src/coding_agent/remote/worker.py, coding-agent/src/coding_agent/runs/*, coding-agent/src/coding_agent/server/*, coding-agent/src/coding_agent/stores/*, coding-agent/src/coding_agent/tools/subagent.py, coding-agent/src/coding_agent/topics/memory.py
All source modules update their imports from deprecated flat paths to the canonical structured subpackage locations across stores, topics, bee, adapter, core, observability, and environment namespaces.
Update test import paths and monkeypatch targets
coding-agent/tests/cli/*, coding-agent/tests/coding_agent/*, coding-agent/tests/dogfood/*, coding-agent/tests/integration/*, coding-agent/tests/ui/*, coding-agent/tests/unit/*, coding-agent/tests/conftest.py
All test files update their imports and monkeypatch targets to the new module paths; remote client tests also retarget archive monkeypatches from coding_agent.workspace_archive.* to coding_agent.environment.archive.*.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • delete-cloud/Coding-Agent-Loop#591: Touches the same legacy shim modules (workspace_archive.py, scheduled_runs.py, external_executor.py, local_durable_store.py, pg_durable_store.py, storage_migration.py) and performs the same sys.modules alias removal pattern.
  • delete-cloud/Coding-Agent-Loop#595: Directly precedes this PR's shim cleanup by introducing the coding_agent.topics.* subpackage layout that the shims were forwarding to.
  • delete-cloud/Coding-Agent-Loop#413: Added migrate_legacy_storage_to_sqlite wiring that this PR re-routes through the new coding_agent.stores.migration path while removing the coding_agent/storage_migration.py shim.

Poem

🐇 Hop, hop, the old paths are gone,
No more sys.modules tricks to rely on!
The imports now live where they truly belong,
In topics and stores, structured and strong.
The rabbit tidied each module with glee—
Clean subpackages as far as eyes see! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.53% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: completing phase 2 of package-layout consolidation by removing deprecation shims and updating call sites to new import paths.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/layout-phase2-rewrite

@delete-cloud
delete-cloud merged commit b6a0e50 into main Jun 14, 2026
2 checks passed
@delete-cloud
delete-cloud deleted the refactor/layout-phase2-rewrite branch June 14, 2026 03:41
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