Skip to content

Comments

Add vocabulary normalization docs and updates#471

Open
leynos wants to merge 2 commits intomainfrom
add-vocabulary-normalization-docs-rbfae7
Open

Add vocabulary normalization docs and updates#471
leynos wants to merge 2 commits intomainfrom
add-vocabulary-normalization-docs-rbfae7

Conversation

@leynos
Copy link
Owner

@leynos leynos commented Feb 20, 2026

Summary

Implements vocabulary normalization documentation across guides, updates public-facing wording in docs, and aligns code commentary with the canonical layering model. No public API renames were introduced; changes focus on terminology and documentation.

Changes

Documentation

  • Added docs/developers-guide.md defining architectural vocabulary, naming invariants, allowed/forbidden term mixing, and a vocabulary-focused API checklist.
  • Updated docs/contents.md to reference the Developers' guide as the canonical vocabulary resource.
  • Expanded docs/users-guide.md with a Conceptual model section and vocabulary rules per architectural layer.
  • Updated docs/api.md to clarify packet/envelope semantics:
    • id: u32 — packet/envelope identifier used for routing (instead of frame identifier).
  • Added a Vocabulary normalization by layer section to docs/v0-1-0-to-v0-2-0-migration-guide.md describing terminology changes and guidance for updating usage.
  • Updated docs/execplans/vocabulary-normalization.md status to COMPLETE (2026-02-20).
  • Updated src/app/envelope.rs doc comments to reflect terminology changes:
    • Refer to packets/envelopes instead of frames where appropriate.
    • Example types renamed in docs to MyEnvelope where shown (instead of MyFrame).
    • Terminator concept clarified as envelope/packet terminator in the public docs.

Code

  • Minor doc wording adjustments in src/app/envelope.rs to align with the canonical terminology and layer separation (Packet, Envelope, Message, Fragment).

Migration & Verification

  • Documentation-only changes; public symbols remain unchanged. This pass normalizes terminology across rustdoc, docs, and examples without introducing breaking API renames.

Rationale

  • Establish a stable, language-agnostic vocabulary model across transport, routing, and domain layers to improve clarity and consistency in documentation and rustdoc.
  • Keep public APIs intact while aligning docs and examples with the canonical layering (FrameCodec/Frame vs Packet/Envelope/Message). This reduces confusion and potential misuses in client code.

Testing and validation

  • Build and run tests to ensure no compiler or doc-test regressions.
  • Run formatting and linting:
    • cargo fmt
    • cargo clippy
  • Optional: cargo test to validate crate integrity with updated doc examples.

Impact

  • No changes to public API surface or behavior.
  • Documentation and examples now reflect canonical terminology across all layers, improving discoverability and consistency for users and contributors.

◳ Generated by DevBoxer


ℹ️ Tag @devboxerhub to ask questions and address PR feedback

📎 Task: https://www.devboxer.com/task/bcb3ccec-3029-4ca5-bb83-ab1f5e6bfd00

Summary by Sourcery

Normalize architectural vocabulary across documentation and packet-related rustdoc without changing public APIs.

Enhancements:

  • Align src/app/envelope.rs rustdoc and examples with the canonical packet/envelope terminology while preserving existing types and behavior.

Documentation:

  • Add a canonical layered vocabulary and conceptual model to the users’ guide and new developers’ guide, including naming invariants and allowed aliasing.
  • Clarify packet/envelope semantics and identifiers in the API docs and migration guide, documenting terminology mappings and confirming no new public renames.
  • Mark the vocabulary normalization execution plan as complete with recorded outcomes and validation results, and reference the developers’ guide from the docs contents index.

Tests:

  • Document execution of existing formatting, linting, test, and markdown validation commands as part of the normalization pass.

- Introduced `docs/developers-guide.md` defining architectural vocabulary and naming invariants.
- Updated `docs/users-guide.md`, `docs/api.md`, and rustdoc to clarify terms per canonical layering model.
- Normalized 'frame' to transport codec units, 'packet/envelope' to routing wrappers, 'message' to domain payloads, and 'fragment' to transport subdivisions.
- Updated migration guide with vocabulary normalization details and usage guidance.
- Modified example types and docs to align with new naming conventions, improving clarity without breaking API.
- Completed vocabulary normalization plan and validated with full quality gates.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 20, 2026

Reviewer's Guide

Normalizes vocabulary across documentation and rustdoc to align with a canonical architectural layer model (Frame, Packet/Envelope, Message, Fragment) without changing public APIs, and marks the vocabulary normalization execution plan as complete.

Class diagram for Packet, Envelope, and PacketParts vocabulary alignment

classDiagram
  class CorrelatableFrame {
    <<trait>>
    +correlation_id() Option_u64_
    +set_correlation_id(cid Option_u64_)
  }

  class Message {
    <<trait>>
  }

  class Packet {
    <<trait>>
    +id() u32
    +into_parts() PacketParts
    +from_parts(parts PacketParts) Self
    +is_stream_terminator() bool
  }

  class PacketParts {
    <<struct>>
    -id u32
    -correlation_id Option_u64_
    -payload Vec_u8_
    +new(id u32, correlation_id Option_u64_, payload Vec_u8_) PacketParts
    +id() u32
    +correlation_id() Option_u64_
    +into_payload() Vec_u8_
  }

  class Envelope {
    <<struct>>
    -id u32
    -correlation_id Option_u64_
    -payload Vec_u8_
  }

  class WireframeApp {
    +handle_connection()
  }

  Packet <|.. Envelope
  CorrelatableFrame <|.. Envelope
  Message <|.. Envelope

  Packet o-- PacketParts

  WireframeApp --> Envelope
Loading

File-Level Changes

Change Details Files
Introduce a canonical developer-facing vocabulary and layer model and make it the reference for naming and docs.
  • Added docs/developers-guide.md with a layer glossary, naming invariants, allowed aliases, and an API/docs checklist.
  • Linked the developers' guide from docs/contents.md as the canonical architectural vocabulary reference.
  • Documented vocabulary normalization outcomes and non-renaming policy for the 2026-02-20 pass.
docs/developers-guide.md
docs/contents.md
docs/execplans/vocabulary-normalization.md
Expand user-facing documentation with a conceptual model, vocabulary rules, and updated examples that use packet/envelope terminology consistently.
  • Added a Conceptual model and vocabulary section to docs/users-guide.md with a per-layer terminology table and usage rules.
  • Updated example types and comments from MyFrame/frame to MyEnvelope/envelope to match routing-layer semantics, including the stream terminator description.
  • Clarified guidance to refer developers to the developers' guide for invariants and naming rules.
docs/users-guide.md
Clarify API docs around Packet/Envelope semantics and routing identifiers, and align terminology in rustdoc for Packet and Envelope types.
  • Updated docs/api.md to describe id as a packet/envelope routing identifier instead of a frame identifier.
  • Adjusted doc comments in src/app/envelope.rs to consistently use packet/envelope wording (not frame) and updated the Packet::is_stream_terminator example to use MyEnvelope.
  • Clarified that incoming packets are deserialized into Envelope instances and that PacketParts.id is the message identifier used for routing packets.
docs/api.md
src/app/envelope.rs
Mark the vocabulary normalization execution plan as complete and record progress, decisions, outcomes, and validation steps.
  • Changed exec plan status from DRAFT to COMPLETE with a completion date.
  • Checked off all planned work items and added observations about ambiguity living mostly in docs rather than symbol names.
  • Recorded decisions to keep public symbols unchanged, enumerated completed documentation updates, and listed validation commands that passed.
  • Expanded potential touched files and added revision history entries for 2026-02-18 and 2026-02-20.
docs/execplans/vocabulary-normalization.md
Update migration guidance to describe terminology changes by layer and emphasize that no additional public renames were introduced.
  • Added a Vocabulary normalization by layer section describing the canonical vocabulary sources and mapping prior wording to canonical terms.
  • Explicitly noted that the normalization pass is terminology-only with no new public symbol renames.
  • Provided recommendations for naming in application code to align with Frame/Packet/Envelope/Message layer semantics.
docs/v0-1-0-to-v0-2-0-migration-guide.md

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 20, 2026

Summary by CodeRabbit

  • Documentation
    • Added a Developers' guide defining architectural vocabulary and naming conventions for consistency.
    • Aligned terminology across user guides, examples and API references (frame → envelope/packet wording).
    • Updated API docs wording for packet/envelope identifier description.
    • Marked vocabulary-normalisation plan as complete and documented outcomes.
    • Expanded migration guide and contents with links to the Developers' guide.

Walkthrough

Summarise documentation vocabulary to canonical layer terms (Frame, Packet/Envelope, Message, Fragment), add a developers' guide and migration notes, and update examples and docs wording; do not change public API signatures or runtime behaviour.

Changes

Cohort / File(s) Summary
Top-level documentation updates
docs/api.md, docs/contents.md, docs/users-guide.md, docs/v0-1-0-to-v0-2-0-migration-guide.md
Replace inconsistent frame/packet wording with canonical layer terminology. Add Developers' guide links to contents and operations sections. Update examples and narrative to use MyEnvelope and packet/envelope wording; no API changes.
New developers guide
docs/developers-guide.md
Add canonical architectural vocabulary, layer model glossary (Frame, Packet/Envelope, Message, Fragment), naming invariants, allowed aliases, and an API/docs checklist for consistent terminology across code and docs.
Execution plan update
docs/execplans/vocabulary-normalization.md
Mark vocabulary-normalization execplan COMPLETE (2026-02-20). Record completed checklist items, observations, decisions to avoid public symbol renames, and expanded validation/outcomes.
Code comment & example text
src/app/envelope.rs
Update module/docs/example comments from frame to packet/envelope terminology and rename example types (MyFrame → MyEnvelope) in examples. Preserve all public signatures and runtime logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

📚 Align the words, let layers speak clear,
Envelopes whisper where frames once did steer,
A guide is penned, the glossary near,
APIs untouched, the intent sincere—
Celebrate the names with a quiet cheer ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly summarises the main change: adding vocabulary normalization documentation and updates across the codebase.
Description check ✅ Passed The description thoroughly documents all changes and is closely aligned with the changeset, covering documentation additions, rustdoc updates, and the rationale for vocabulary normalisation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-vocabulary-normalization-docs-rbfae7

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

@leynos leynos marked this pull request as ready for review February 20, 2026 23:21
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • Several places still use dual terms like Packet / Envelope or packet/envelope identifier (e.g., in the glossary tables and docs/api.md); consider choosing a single canonical term per context and explicitly noting the other as an alias to keep the mental model tighter.
  • In docs/developers-guide.md, the allowed alias fragment frame for Fragment risks reintroducing confusion around the very specific Frame term; it may be clearer to drop fragment frame or qualify it more strongly so Frame remains strictly transport-wired.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Several places still use dual terms like `Packet / Envelope` or `packet/envelope identifier` (e.g., in the glossary tables and `docs/api.md`); consider choosing a single canonical term per context and explicitly noting the other as an alias to keep the mental model tighter.
- In `docs/developers-guide.md`, the allowed alias `fragment frame` for `Fragment` risks reintroducing confusion around the very specific `Frame` term; it may be clearer to drop `fragment frame` or qualify it more strongly so `Frame` remains strictly transport-wired.

## Individual Comments

### Comment 1
<location> `docs/execplans/vocabulary-normalization.md:102-103` </location>
<code_context>
+- Added a canonical layered glossary to `docs/users-guide.md`.
+- Created `docs/developers-guide.md` to define naming invariants and
+  allowed/disallowed term mixing.
+- Updated `docs/v0-1-0-to-v0-2-0-migration-guide.md` with explicit
+  terminology mapping and a no-additional-public-rename note.
+- Updated terminology wording in public rustdoc and references
+  (`src/app/envelope.rs`, `docs/api.md`, `docs/contents.md`).
</code_context>

<issue_to_address>
**nitpick (typo):** The phrase "a no-additional-public-rename note" reads awkwardly; consider rephrasing for clarity.

The multiple hyphens make this hard to read. Consider something like “a note that no additional public renames were made” or “a no additional public renames note” for clarity.

```suggestion
- Updated `docs/v0-1-0-to-v0-2-0-migration-guide.md` with explicit
-  terminology mapping and a note that no additional public renames were made.
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/developers-guide.md`:
- Around line 39-43: The three checklist bullets all start with "Confirm"
causing repetitive phrasing; update the three lines to use varied verbs and
structures (e.g., "Ensure the identifier name matches the owning layer," "Verify
rustdoc examples use the same term as the symbol being documented," and
"Document the meaning consistently in docs/users-guide.md and migration notes")
and keep the cross-layer example (`correlation_id`) explicitly labeled as shared
metadata; adjust the three checklist items around rustdoc, docs/users-guide.md,
and identifier naming to follow this varied wording.

In `@src/app/envelope.rs`:
- Around line 147-148: Doc comment above the Envelope type uses the en-US
spelling "deserialised"; update that documentation to the en-GB-oxendict form
"deserialized". Locate the comment string containing "Incoming packets are
deserialised into an `Envelope`..." in src/app/envelope.rs (the doc for the
Envelope type) and replace the single word "deserialised" with "deserialized" so
the documentation conforms to the required spelling standard.

Comment on lines 39 to 43
- Confirm the identifier name matches the owning layer.
- Confirm rustdoc examples use the same term as the symbol being documented.
- Confirm `docs/users-guide.md` and migration notes describe the same meaning.
- Confirm cross-layer terms (for example, `correlation_id`) are explicitly
labelled as shared metadata.
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Vary the sentence structure in the checklist.

The static analysis tool flagged three successive bullet points beginning with "Confirm". Rephrase for variety:

✏️ Suggested rewording
 Use this checklist before merging API naming changes:
 
-- Confirm the identifier name matches the owning layer.
-- Confirm rustdoc examples use the same term as the symbol being documented.
-- Confirm `docs/users-guide.md` and migration notes describe the same meaning.
-- Confirm cross-layer terms (for example, `correlation_id`) are explicitly
+- Verify the identifier name matches the owning layer.
+- Check rustdoc examples use the same term as the symbol being documented.
+- Ensure `docs/users-guide.md` and migration notes describe the same meaning.
+- Label cross-layer terms (for example, `correlation_id`) explicitly as
   labelled as shared metadata.
🧰 Tools
🪛 LanguageTool

[style] ~41-~41: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... term as the symbol being documented. - Confirm docs/users-guide.md and migration not...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~42-~42: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...tion notes describe the same meaning. - Confirm cross-layer terms (for example, `correl...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/developers-guide.md` around lines 39 - 43, The three checklist bullets
all start with "Confirm" causing repetitive phrasing; update the three lines to
use varied verbs and structures (e.g., "Ensure the identifier name matches the
owning layer," "Verify rustdoc examples use the same term as the symbol being
documented," and "Document the meaning consistently in docs/users-guide.md and
migration notes") and keep the cross-layer example (`correlation_id`) explicitly
labeled as shared metadata; adjust the three checklist items around rustdoc,
docs/users-guide.md, and identifier naming to follow this varied wording.

…lines

- Updated allowed aliases and prohibited mixing table for consistency
- Improved checklist wording for clarity and parallel structure
- Corrected terminology in docs and comments for uniformity
- Fixed typographical error from 'deserialised' to 'deserialized' in envelope.rs documentation

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/app/envelope.rs`:
- Around line 3-5: Update the doc-comment wording to use en-GB-oxendict "-ize"
spellings: replace "serialisation" with "serialization" and "deserialisation"
with "deserialization" in the comment that references
crate::app::builder::WireframeApp (and any other occurrences in this module),
ensuring the sentence remains grammatically correct after the substitutions.

Comment on lines 3 to +5
//! These types decouple serialisation from routing by wrapping raw payloads in
//! identifiers understood by [`crate::app::builder::WireframeApp`]. This
//! allows the builder to route frames before full deserialisation. See
//! allows the builder to route packets before full deserialisation. See
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use -ize spelling for serialization terms.

Replace "serialisation" and "deserialisation" with "serialization" and
"deserialization" to match en-GB-oxendict spelling.

✏️ Proposed fix
-//! These types decouple serialisation from routing by wrapping raw payloads in
+//! These types decouple serialization from routing by wrapping raw payloads in
-//! allows the builder to route packets before full deserialisation. See
+//! allows the builder to route packets before full deserialization. See

As per coding guidelines, Comments and docs must follow en-GB-oxendict (-ize / -yse / -our) spelling and grammar.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
//! These types decouple serialisation from routing by wrapping raw payloads in
//! identifiers understood by [`crate::app::builder::WireframeApp`]. This
//! allows the builder to route frames before full deserialisation. See
//! allows the builder to route packets before full deserialisation. See
//! These types decouple serialization from routing by wrapping raw payloads in
//! identifiers understood by [`crate::app::builder::WireframeApp`]. This
//! allows the builder to route packets before full deserialization. See
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app/envelope.rs` around lines 3 - 5, Update the doc-comment wording to
use en-GB-oxendict "-ize" spellings: replace "serialisation" with
"serialization" and "deserialisation" with "deserialization" in the comment that
references crate::app::builder::WireframeApp (and any other occurrences in this
module), ensuring the sentence remains grammatically correct after the
substitutions.

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