Skip to content

refactor: match crate directories and package names - #10080

Closed
404Wolf wants to merge 12 commits into
mainfrom
wolf/reorg-move-names
Closed

404Wolf wants to merge 12 commits into
mainfrom
wolf/reorg-move-names

Conversation

@404Wolf

@404Wolf 404Wolf commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Why

The crate reorganization moves crates/ into feature groups over a
series of PRs. Check in the scripts that do each move, and the map each
PR runs, so branches opened before a move can rewrite their own paths
with move_crates.py --rewrite-only after merging it.

model-entity, model-error-response and worker-rs-otel were hyphenated
packages in hyphenated directories while their lib names were already
snake_case; local_e2e_integration_tests did not match its directory.
Rename the packages and directories so directory, package and lib name
agree, and every dependency key reads like the use path.

Also drops two layer-baseline entries that main made stale: mcp_client
no longer depends on agent, and microsoft_oauth_grant_db_utils is no
longer a workspace member.

Part of the crate reorganization: crates grouped one level deep by feature,
so the layer rules in .config/layers.toml are path globs and related
crates sit together. Package names are unchanged unless the title says
otherwise.

Stacked. This branch includes #10022 (root [workspace.dependencies]) and #10021 (layer check), so CI runs against main.
Review only ac9948174e..d48207d207 (186 files changed, 1474 insertions(+), 738 deletions(-)).

MACRO-5031
MACRO-4984

How it works

  • tooling/scripts/crate_moves/ (first commit) holds the scripts every
    move in this series runs, plus one map per move PR, so branches opened
    before a move can rewrite their own paths after merging it.
  • move_crates.py maps/05-names.txt moved the three hyphenated
    directories and rewrote every path to them; rename_packages.py
    renamed the four packages in manifests, hakari's lists, -p flags and
    docs. The lib names were already snake_case, so no use line changes.
  • cargo x deps regenerated .github/workspace-dep-closures.json.

Updating an open branch after this lands

Git carries your edits across the renames. A file you added inside a moved
crate shows up as "added in a directory that was renamed": accept git's
suggested location. Then fix paths your branch wrote for the old layout:

git merge origin/main
git add -A
python3 tooling/scripts/crate_moves/move_crates.py --rewrite-only tooling/scripts/crate_moves/maps/05-names.txt
cargo x deps

For the package renames, also replace model-entity, model-error-response,
worker-rs-otel and local_e2e_integration_tests with their snake_case
names in your manifests (python3 tooling/scripts/crate_moves/rename_packages.py model-entity=model_entity model-error-response=model_error_response worker-rs-otel=worker_rs_otel local_e2e_integration_tests=local_e2e).

cargo x deps now keeps a root [workspace.dependencies] entry for every
member at its current path, sorts members one per line, and rewrites
relative path dependencies between members to { workspace = true }.
--check reports manifests that need it. hakari's workspace-hack lines
keep their relative path.
Generated by `cargo x deps`: every member has a root entry, members are
sorted one per line, and the relative path dependencies between members
become { workspace = true }. Feature resolution is unchanged.
cargo x deps now reads .config/layers.toml, places every workspace
crate in a layer by directory glob, and prints the normal and build
edges that cross layers in a direction the config does not allow.
The 26 edges that violate the rules today are baselined as [[allow]]
entries with reasons. The report never fails the run.
Also documents how to read and fix the layer report.
The root manifest now lists every workspace crate in
[workspace.dependencies]. Hash only the entries of crates in the wasm
package's closure, so adding or moving another crate keeps the key.
Took main's manifests where they conflicted and regenerated them with
`cargo x deps`.
cargo shear rejects root [workspace.dependencies] entries no member
uses, so cargo x deps now drops those and adds an entry once a crate
gains its first dependent.
Took main's manifests where they conflicted and regenerated them with
`cargo x deps`.
…f/reorg-move-names

# Conflicts:
#	tooling/xtask/crates/xtask_deps/src/main.rs
The crate reorganization moves crates/ into feature groups over a
series of PRs. Check in the scripts that do each move, and the map each
PR runs, so branches opened before a move can rewrite their own paths
with `move_crates.py --rewrite-only` after merging it.

MACRO-4984
model-entity, model-error-response and worker-rs-otel were hyphenated
packages in hyphenated directories while their lib names were already
snake_case; local_e2e_integration_tests did not match its directory.
Rename the packages and directories so directory, package and lib name
agree, and every dependency key reads like the `use` path.

Also drops two layer-baseline entries that main made stale: mcp_client
no longer depends on agent, and microsoft_oauth_grant_db_utils is no
longer a workspace member.

MACRO-4984
@macro-application

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 374 files, which is 74 over the limit of 300.

To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch.

Usage-priced reviews support at most 300 files.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1feb36c and d48207d.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock, !**/Cargo.lock
Files selected for processing: 374

  • .agents/rules/rust/libraries.md
  • .cargo/config.toml
  • .config/hakari.toml
  • .config/layers.toml
  • .github/workflows/pr-ci.yml
  • .github/workspace-dep-closures.json
  • Cargo.toml
  • apps/web/scripts/wasm-cache-key.test.ts
  • apps/web/scripts/wasm-cache-key.ts
  • crates/access_requests/Cargo.toml
  • crates/account_manager/Cargo.toml
  • crates/activity/AGENTS.md
  • crates/activity/Cargo.toml
  • crates/agent/Cargo.toml
  • crates/agent_api_keys/Cargo.toml
  • crates/agent_changes/Cargo.toml
  • crates/agent_code_mode/Cargo.toml
  • crates/agent_correlation/Cargo.toml
  • crates/agent_egress/Cargo.toml
  • crates/agent_harness/Cargo.toml
  • crates/agent_inmem/Cargo.toml
  • crates/agent_preview/Cargo.toml
  • crates/agent_runtime_protocol/Cargo.toml
  • crates/agent_session/Cargo.toml
  • crates/agent_session_realtime/Cargo.toml
  • crates/agent_trigger/Cargo.toml
  • crates/ai_billing/Cargo.toml
  • crates/ai_engine/Cargo.toml
  • crates/ai_projections/Cargo.toml
  • crates/ai_tools/Cargo.toml
  • crates/ai_toolset/Cargo.toml
  • crates/ai_usage/Cargo.toml
  • crates/analytics_client/Cargo.toml
  • crates/anthropic/Cargo.toml
  • crates/attachment/.agents/skills/WRITE_ATTACHMENT_SERVICE/SKILL.md
  • crates/attachment/AGENTS.md
  • crates/attachment/Cargo.toml
  • crates/attention_feed/Cargo.toml
  • crates/authentication_service_client/Cargo.toml
  • crates/bot_id/Cargo.toml
  • crates/bots/Cargo.toml
  • crates/cal/AGENTS.md
  • crates/cal/Cargo.toml
  • crates/calendar_events/Cargo.toml
  • crates/calendar_scheduling/Cargo.toml
  • crates/call/Cargo.toml
  • crates/channel_bots/Cargo.toml
  • crates/channel_labels/Cargo.toml
  • crates/channel_sender/Cargo.toml
  • crates/channels/AGENTS.md
  • crates/channels/Cargo.toml
  • crates/chat/Cargo.toml
  • crates/client/cache-core/Cargo.toml
  • crates/client/cache-turso/Cargo.toml
  • crates/client/cache-wasm/Cargo.toml
  • crates/code_execution/Cargo.toml
  • crates/codex_cloud_agents/Cargo.toml
  • crates/codex_connection/Cargo.toml
  • crates/coding_agent_worker/Cargo.toml
  • crates/cognition/Cargo.toml
  • crates/collab_surface/Cargo.toml
  • crates/comms_db_client/Cargo.toml
  • crates/complete_graph/Cargo.toml
  • crates/connect_client/Cargo.toml
  • crates/connection/AGENTS.md
  • crates/connection/Cargo.toml
  • crates/connection_gateway_client/AGENTS.md
  • crates/connection_gateway_client/Cargo.toml
  • crates/connection_gateway_models/Cargo.toml
  • crates/contacts/Cargo.toml
  • crates/crm/Cargo.toml
  • crates/cursor_api_key/Cargo.toml
  • crates/cursor_cloud_agents/Cargo.toml
  • crates/database_env_vars/Cargo.toml
  • crates/database_sql/Cargo.toml
  • crates/database_webhooks/Cargo.toml
  • crates/databases/Cargo.toml
  • crates/databases_sql/Cargo.toml
  • crates/decode_jwt/Cargo.toml
  • crates/dictation/Cargo.toml
  • crates/document_storage_service_client/Cargo.toml
  • crates/documents/Cargo.toml
  • crates/docx_engine/Cargo.toml
  • crates/dynamodb_client/Cargo.toml
  • crates/email/Cargo.toml
  • crates/email_api_client/Cargo.toml
  • crates/email_db_client/Cargo.toml
  • crates/email_formatting/Cargo.toml
  • crates/email_service_client/Cargo.toml
  • crates/entity_access/AGENTS.md
  • crates/entity_access/Cargo.toml
  • crates/entity_access_db_utils/AGENTS.md
  • crates/entity_access_db_utils/Cargo.toml
  • crates/entity_access_management/AGENTS.md
  • crates/entity_access_management/Cargo.toml
  • crates/entity_mutation/AGENTS.md
  • crates/entity_mutation/Cargo.toml
  • crates/entity_registry/entity_registry/AGENTS.md
  • crates/entity_registry/entity_registry/Cargo.toml
  • crates/entity_registry/entity_registry_db_utils/Cargo.toml
  • crates/entity_registry/shared_entity_registry/Cargo.toml
  • crates/external_chat/Cargo.toml
  • crates/favorites/AGENTS.md
  • crates/favorites/Cargo.toml
  • crates/feature_flags/Cargo.toml
  • crates/folds/agent_fold/Cargo.toml
  • crates/folds/claude_fold/Cargo.toml
  • crates/folds/codex_fold/Cargo.toml
  • crates/foreign_entity/Cargo.toml
  • crates/forms/Cargo.toml
  • crates/frecency/AGENTS.md
  • crates/frecency/Cargo.toml
  • crates/fusionauth/Cargo.toml
  • crates/genai_telemetry/Cargo.toml
  • crates/github/Cargo.toml
  • crates/github_pull_requests/Cargo.toml
  • crates/gmail_client/Cargo.toml
  • crates/google_token/Cargo.toml
  • crates/granola_sync/Cargo.toml
  • crates/graphql_activity/Cargo.toml
  • crates/graphql_calendar/Cargo.toml
  • crates/graphql_channel/Cargo.toml
  • crates/graphql_common/AGENTS.md
  • crates/graphql_common/Cargo.toml
  • crates/graphql_crm/Cargo.toml
  • crates/graphql_databases/Cargo.toml
  • crates/graphql_email/Cargo.toml
  • crates/graphql_entity_mutation/Cargo.toml
  • crates/graphql_favorite/Cargo.toml
  • crates/graphql_initiative/Cargo.toml
  • crates/graphql_notification/Cargo.toml
  • crates/graphql_notification_inbox/Cargo.toml
  • crates/graphql_permission/Cargo.toml
  • crates/graphql_properties/Cargo.toml
  • crates/graphql_registered_work/Cargo.toml
  • crates/graphql_scheduled_action/Cargo.toml
  • crates/graphql_soup/Cargo.toml
  • crates/graphql_soup_filter_input/Cargo.toml
  • crates/graphql_work_feed/Cargo.toml
  • crates/gtm_invite/Cargo.toml
  • crates/harnesses/Cargo.toml
  • crates/image_generation/Cargo.toml
  • crates/import/Cargo.toml
  • crates/import_jira/Cargo.toml
  • crates/import_linear/Cargo.toml
  • crates/import_notion/Cargo.toml
  • crates/import_tracker/Cargo.toml
  • crates/initiative/Cargo.toml
  • crates/initiative_description/Cargo.toml
  • crates/integration_tests/local_e2e/AGENTS.md
  • crates/integration_tests/local_e2e/Cargo.toml
  • crates/integration_tests/local_e2e/README.md
  • crates/invite_email/AGENTS.md
  • crates/invite_email/Cargo.toml
  • crates/item_filter_index/Cargo.toml
  • crates/item_filters/Cargo.toml
  • crates/jev/Cargo.toml
  • crates/kafka_util/Cargo.toml
  • crates/last_online_tracker/Cargo.toml
  • crates/lexical_client/Cargo.toml
  • crates/lexical_mention_extractor/Cargo.toml
  • crates/local_e2e_test_support/Cargo.toml
  • crates/macro_auth/Cargo.toml
  • crates/macro_authorization/AGENTS.md
  • crates/macro_authorization/Cargo.toml
  • crates/macro_aws_config/Cargo.toml
  • crates/macro_cache_client/Cargo.toml
  • crates/macro_config/Cargo.toml
  • crates/macro_db_client/AGENTS.md
  • crates/macro_db_client/Cargo.toml
  • crates/macro_entrypoint/Cargo.toml
  • crates/macro_env/Cargo.toml
  • crates/macro_event_broker/Cargo.toml
  • crates/macro_middleware/Cargo.toml
  • crates/macro_queues/Cargo.toml
  • crates/macro_service_urls/Cargo.toml
  • crates/macro_sha_count_client/Cargo.toml
  • crates/macro_user_id/Cargo.toml
  • crates/mcp_client/Cargo.toml
  • crates/mcp_select/Cargo.toml
  • crates/mcp_toolset/Cargo.toml
  • crates/memory/Cargo.toml
  • crates/mention_utils/Cargo.toml
  • crates/messages/Cargo.toml
  • crates/microsoft_oauth_grant_db_utils/Cargo.toml
  • crates/mobile_welcome_email_db_client/Cargo.toml
  • crates/model/AGENTS.md
  • crates/model/Cargo.toml
  • crates/model_entity/Cargo.toml
  • crates/model_entity/src/external_chat.rs
  • crates/model_entity/src/lib.rs
  • crates/model_entity/src/tests.rs
  • crates/model_error_response/Cargo.toml
  • crates/model_error_response/src/lib.rs
  • crates/model_notifications/AGENTS.md
  • crates/model_notifications/Cargo.toml
  • crates/model_owner/Cargo.toml
  • crates/models_databases/Cargo.toml
  • crates/models_email/Cargo.toml
  • crates/models_forms/Cargo.toml
  • crates/models_pagination/AGENTS.md
  • crates/models_pagination/Cargo.toml
  • crates/models_permissions/AGENTS.md
  • crates/models_permissions/Cargo.toml
  • crates/models_properties/Cargo.toml
  • crates/models_search/Cargo.toml
  • crates/models_soup/AGENTS.md
  • crates/models_soup/Cargo.toml
  • crates/name_search/Cargo.toml
  • crates/native_app_service/Cargo.toml
  • crates/notification/Cargo.toml
  • crates/notification_db_client/AGENTS.md
  • crates/notification_db_client/Cargo.toml
  • crates/notification_inbox/Cargo.toml
  • crates/onboarding/Cargo.toml
  • crates/opensearch_client/Cargo.toml
  • crates/pipedream_mcp/Cargo.toml
  • crates/projects/Cargo.toml
  • crates/properties/Cargo.toml
  • crates/properties_service/Cargo.toml
  • crates/psd_engine/Cargo.toml
  • crates/referral/Cargo.toml
  • crates/reminders/Cargo.toml
  • crates/remote_env_var/Cargo.toml
  • crates/roles_and_permissions/Cargo.toml
  • crates/routine_program/Cargo.toml
  • crates/routines/Cargo.toml
  • crates/s3_key/Cargo.toml
  • crates/saved_views/Cargo.toml
  • crates/scheduled_action/Cargo.toml
  • crates/search_service/Cargo.toml
  • crates/search_service_client/Cargo.toml
  • crates/secretsmanager_client/Cargo.toml
  • crates/ses_client/Cargo.toml
  • crates/share_permission_db_utils/Cargo.toml
  • crates/skills/Cargo.toml
  • crates/slack_integration/Cargo.toml
  • crates/soup/Cargo.toml
  • crates/soup_filter_cache_adapter/Cargo.toml
  • crates/soup_filter_projection/Cargo.toml
  • crates/soup_realtime/AGENTS.md
  • crates/soup_realtime/Cargo.toml
  • crates/sqs_client/Cargo.toml
  • crates/static_file/AGENTS.md
  • crates/static_file/Cargo.toml
  • crates/static_file_service_client/Cargo.toml
  • crates/stream/AGENTS.md
  • crates/stream/Cargo.toml
  • crates/sync_router/Cargo.toml
  • crates/sync_service/AGENTS.md
  • crates/sync_service/Cargo.toml
  • crates/sync_service_client/Cargo.toml
  • crates/system_properties/Cargo.toml
  • crates/system_skills/Cargo.toml
  • crates/system_status/Cargo.toml
  • crates/task_dedup/Cargo.toml
  • crates/teams/Cargo.toml
  • crates/trigger_context/Cargo.toml
  • crates/universal_input/Cargo.toml
  • crates/user_api_key/Cargo.toml
  • crates/user_language/Cargo.toml
  • crates/web_search/Cargo.toml
  • crates/webhook/Cargo.toml
  • crates/whatsapp_e2e/Cargo.toml
  • crates/whatsapp_fake_server/Cargo.toml
  • crates/whatsapp_linked/Cargo.toml
  • crates/whatsapp_store_pg/Cargo.toml
  • crates/whatsmeow/Cargo.toml
  • crates/whatsmeow_signal/Cargo.toml
  • crates/work_feed/Cargo.toml
  • crates/worker_rs_otel/AGENTS.md
  • crates/worker_rs_otel/CLAUDE.md
  • crates/worker_rs_otel/Cargo.toml
  • crates/worker_rs_otel/src/exporter.rs
  • crates/worker_rs_otel/src/exporter/test.rs
  • crates/worker_rs_otel/src/layer.rs
  • crates/worker_rs_otel/src/layer/test.rs
  • crates/worker_rs_otel/src/lib.rs
  • crates/worker_rs_otel/src/model.rs
  • crates/worker_rs_otel/src/proto.rs
  • crates/worker_rs_otel/src/proto/test.rs
  • crates/worker_rs_otel/src/trace_context.rs
  • crates/worker_rs_otel/src/trace_context/test.rs
  • deny.toml
  • docs/development/rust.md
  • docs/guides/add-block.md
  • docs/guides/add-entity.md
  • docs/guides/new-service.md
  • services/agent_harness_service/Cargo.toml
  • services/agent_harness_service/load-test/Cargo.toml
  • services/agent_trigger_service/Cargo.toml
  • services/authentication_service/Cargo.toml
  • services/calendar_service/Cargo.toml
  • services/call_recording_preview_handler/Cargo.toml
  • services/connection_gateway/Cargo.toml
  • services/contacts_service/Cargo.toml
  • services/convert_service/Cargo.toml
  • services/dataloss_prevention_handler/Cargo.toml
  • services/delete_chat_handler/Cargo.toml
  • services/deleted_item_poller/Cargo.toml
  • services/document_storage_service/Cargo.toml
  • services/document_text_extractor/Cargo.toml
  • services/document_upload_finalizer_handler/Cargo.toml
  • services/docx_unzip_handler/Cargo.toml
  • services/email_focus_worker/Cargo.toml
  • services/email_refresh_handler/Cargo.toml
  • services/email_scheduled_handler/Cargo.toml
  • services/email_service/Cargo.toml
  • services/email_sfs_delete_handler/Cargo.toml
  • services/email_suppression_handler/Cargo.toml
  • services/image_optimizer/Cargo.toml
  • services/image_proxy_service/Cargo.toml
  • services/mcp_auth_proxy/Cargo.toml
  • services/notification_retention_handler/Cargo.toml
  • services/notification_service/Cargo.toml
  • services/organization_retention_handler/Cargo.toml
  • services/organization_retention_trigger/Cargo.toml
  • services/search_processing_service/Cargo.toml
  • services/search_upload_handler/Cargo.toml
  • services/sha_cleanup_worker/Cargo.toml
  • services/slack_import_worker/Cargo.toml
  • services/static_file_service/Cargo.toml
  • services/sync-service/Cargo.toml
  • services/unfurl_service/Cargo.toml
  • services/upload_extractor_lambda_handler/Cargo.toml
  • services/upload_extractor_lambda_trigger/Cargo.toml
  • services/user_link_cleanup_handler/Cargo.toml
  • services/whatsapp_session_service/Cargo.toml
  • services/worker_trigger/Cargo.toml
  • tooling/ai_billing_cli/Cargo.toml
  • tooling/native_app_server/Cargo.toml
  • tooling/notification_sandbox/Cargo.toml
  • tooling/scripts/crate_moves/README.md
  • tooling/scripts/crate_moves/dedupe_layers.py
  • tooling/scripts/crate_moves/group_agents.py
  • tooling/scripts/crate_moves/maps/05-names.txt
  • tooling/scripts/crate_moves/maps/06-graphql.txt
  • tooling/scripts/crate_moves/maps/07-aws.txt
  • tooling/scripts/crate_moves/maps/08-clients.txt
  • tooling/scripts/crate_moves/maps/09-platform.txt
  • tooling/scripts/crate_moves/maps/10-types.txt
  • tooling/scripts/crate_moves/maps/11-accounts-notifications.txt
  • tooling/scripts/crate_moves/maps/12-email-calendar.txt
  • tooling/scripts/crate_moves/maps/13-comms-whatsapp.txt
  • tooling/scripts/crate_moves/maps/14a-entities.txt
  • tooling/scripts/crate_moves/maps/14b-search.txt
  • tooling/scripts/crate_moves/maps/14c-projects.txt
  • tooling/scripts/crate_moves/maps/14d-integrations.txt
  • tooling/scripts/crate_moves/maps/15-databases.txt
  • tooling/scripts/crate_moves/maps/16-documents.txt
  • tooling/scripts/crate_moves/maps/17-engines.txt
  • tooling/scripts/crate_moves/maps/18-ai-billing.txt
  • tooling/scripts/crate_moves/maps/19-agents.txt
  • tooling/scripts/crate_moves/maps/20-testing.txt
  • tooling/scripts/crate_moves/move_crates.py
  • tooling/scripts/crate_moves/rename_packages.py
  • tooling/scripts/crate_moves/validate_paths.py
  • tooling/seed_cli/Cargo.toml
  • tooling/xtask/crates/xtask_cache_wasm/Cargo.toml
  • tooling/xtask/crates/xtask_deps/Cargo.toml
  • tooling/xtask/crates/xtask_deps/src/layers.rs
  • tooling/xtask/crates/xtask_deps/src/layers/test.rs
  • tooling/xtask/crates/xtask_deps/src/main.rs
  • tooling/xtask/crates/xtask_deps/src/workspace_deps.rs
  • tooling/xtask/crates/xtask_doppler_bins/Cargo.toml
  • tooling/xtask/crates/xtask_graph/Cargo.toml
  • tooling/xtask/crates/xtask_graphql_schema_compat/Cargo.toml
  • tooling/xtask/crates/xtask_graphql_soup_schema/Cargo.toml
  • tooling/xtask/crates/xtask_kafka_topics/Cargo.toml
  • tooling/xtask/crates/xtask_local/Cargo.toml
  • tooling/xtask/crates/xtask_local/src/local/e2e.rs
  • tooling/xtask/crates/xtask_nextest_filter/Cargo.toml
  • tooling/xtask/crates/xtask_workflows/Cargo.toml
  • tooling/xtask/crates/xtask_workflows/src/workflows/cargo_workspace_dependency_check.rs

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@404Wolf

404Wolf commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Folded into the single reorg PR #10111 (one PR for the whole reorganization). Its commits are there; closing this one.

@404Wolf 404Wolf closed this Nov 7, 2026
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