Skip to content

Add the encode-intent-in-vis coding guideline - #3714

Merged
tatetian merged 2 commits into
asterinas:mainfrom
tatetian:encode-intent-in-vis
Aug 13, 2026
Merged

Add the encode-intent-in-vis coding guideline#3714
tatetian merged 2 commits into
asterinas:mainfrom
tatetian:encode-intent-in-vis

Conversation

@tatetian

@tatetian tatetian commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This PR adds a new coding guideline, encode-intent-in-vis, to the maintainability guidelines: a visibility modifier in Asterinas declares an item's maximum intended exposure, regardless of what its enclosing modules happen to allow. It grew out of the discussion in #3710.

This PR includes a secondary change that reorders the guidelines in the "Crates & Modules" pages to make related guidelines close to each other.

Copilot AI lite review requested due to automatic review settings August 13, 2026 05:11
@tatetian
tatetian force-pushed the encode-intent-in-vis branch from 2466225 to 9eacf47 Compare August 13, 2026 05:12

Copilot AI 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.

Pull request overview

This PR extends Asterinas’s maintainability coding guidelines by introducing a new Rust guideline, encode-intent-in-vis, clarifying that visibility modifiers should express an item’s maximum intended exposure (not merely its current effective exposure given module nesting).

Changes:

  • Add the encode-intent-in-vis guideline to the “Crates & Modules” Rust-specific maintainability guidance, including rationale and an exception for struct/union fields.
  • Add the new guideline to the maintainability guideline index so it appears in the quick “one-line gist” list.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
book/src/to-contribute/coding-guidelines/for-maintainability/rust-specific/crates-and-modules.md Adds the new visibility-intent guideline text and supporting explanations/links.
book/src/to-contribute/coding-guidelines/for-maintainability/README.md Adds encode-intent-in-vis to the maintainability guideline index list.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@tatetian
tatetian force-pushed the encode-intent-in-vis branch from 1aab4f8 to f08804e Compare August 13, 2026 05:28
@tatetian

Copy link
Copy Markdown
Contributor Author

We reached a consensus with this new guideline in #3710. So I am merging this new guideline directly.

@tatetian
tatetian merged commit aa9938e into asterinas:main Aug 13, 2026
43 checks passed
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.

2 participants