Skip to content

Move self-named Rust modules into directories - #306

Draft
leynos wants to merge 1 commit into
harden-lint-spelling-gated-20260924from
harden-lint-modules-20260924
Draft

leynos wants to merge 1 commit into
harden-lint-spelling-gated-20260924from
harden-lint-modules-20260924

Conversation

@leynos

@leynos leynos commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

This branch moves nine self-named CLI and daemon modules into mod.rs files so the later lint-configuration layer can enable self_named_module_files without changing runtime or test behaviour. It follows the spelling layer, PR #305; source-level lint-fix waves and enforcement follow this layer.

Review walkthrough

Validation

  • cargo metadata --offline --no-deps --format-version 1: 19 workspace members and 47 targets, matching PR Normalize Rust spelling across the workspace #305's head.
  • Exact source-to-destination comparison: all nine moved files match their prior contents after only the listed path and wording substitutions; the moved CLI unit tests are byte-identical.
  • Focused cargo test --config tools/dev-fast/config.toml -p weaver-cli -p weaverd: 197 CLI and 290 daemon tests passed; doctests passed.
  • make check-fmt, make spelling, make lint, make typecheck, make test, make markdownlint, make nixie, and make test-workflow-contracts: all passed sequentially. The full suite passed 1,585 tests with four skipped; 187 workflow contracts passed. The lint gate includes Whitaker, and Markdown lint reported zero errors.
  • git diff --check: passed. An independent Scrutineer reviewed path resolution, test discovery, content preservation, and documentation.

Notes

The layer is based on PR #305's exact head d96dc91c7ed153f6427ce43851b00990281fc07f and contains one structural commit. Its own hosted CI must still run. The ancestor train has a known Ubuntu 22.04 Whitaker installer binary incompatibility that can stop hosted CI before lint, workflow contracts, and coverage; the installer repair is tracked separately. This branch does not enable the final lint tables or claim those blocked hosted checks passed.

References

Summary by Sourcery

Reorganize self-named Rust modules into directory-based layouts to prepare the codebase for stricter module-file linting without changing runtime behavior.

Enhancements:

  • Move self-named CLI and daemon Rust modules into directory-based mod.rs layouts while preserving behavior and test coverage.
  • Update module paths, lint-compliance references, and developer documentation to reflect the relocated modules.

Documentation:

  • Update the developer guide with the new paths and sibling-module structure.

Tests:

  • Adjust test module resolution for the relocated command metadata and graph-slice modules.

Move nine CLI and daemon modules to mod.rs without changing their
behaviour. Adjust the relative test-module paths and refactor-helper
include path so the moved modules resolve the same source files. Keep
the developer guide's references aligned with the new locations.
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Sep 24, 2026

Copy link
Copy Markdown

Reviewer's Guide

This structural PR converts nine self-named CLI and daemon Rust modules to directory-based mod.rs layouts, updating relative child-module paths, test discovery references, lint-compliance source checks, and documentation while preserving source behavior. The reported focused and full validation suites pass, though hosted CI remains subject to the noted ancestor Whitaker installer issue.

File-Level Changes

Change Details Files
Relocated nine self-named Rust module files into directory-based mod.rs layouts while preserving implementation and test behavior.
  • Moved CLI command metadata tests and updated the nested canonical-projection path.
  • Moved daemon graph-slice and refactor-helper modules, adjusting child and sibling test-module paths.
  • Preserved the moved module contents, with only path-related changes and the documented helper-module wording update.
crates/weaver-cli/src/command_ir/tests.rs → crates/weaver-cli/src/command_ir/tests/mod.rs
crates/weaver-cli/src/tests/unit.rs → crates/weaver-cli/src/tests/unit/mod.rs
crates/weaverd/src/dispatch/observe/graph_slice.rs → crates/weaverd/src/dispatch/observe/graph_slice/mod.rs
crates/weaverd/src/dispatch/act/refactor/refactor_helpers.rs → crates/weaverd/src/dispatch/act/refactor/refactor_helpers/mod.rs
Six additional CLI/daemon self-named module files moved to corresponding mod.rs paths
Updated references that resolve or describe the moved modules.
  • Changed the lint-compliance test to include and report the new refactor-helper path.
  • Updated developer documentation for graph-slice and refactor-helper locations and sibling-module terminology.
crates/weaverd/tests/lint_compliance.rs
docs/developers-guide.md
Validated that the structural migration does not change behavior or violate repository checks.
  • Confirmed source preservation and workspace target metadata.
  • Ran focused and full test, formatting, lint, typecheck, documentation, workflow-contract, and whitespace checks successfully.
Repository-wide validation

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codescene-access codescene-access Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gates Passed
6 Quality Gates Passed

See analysis details in CodeScene

Absence of Expected Change Pattern

  • weaver/crates/weaverd/src/dispatch/act/refactor/refactor_helpers.rs is usually changed with: weaver/crates/weaverd/src/dispatch/act/refactor/contract_tests.rs

Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

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