-
Notifications
You must be signed in to change notification settings - Fork 0
Add vocabulary normalization docs and updates #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Wireframe developers' guide | ||
|
|
||
| This guide defines the architectural vocabulary used across Wireframe source, | ||
| rustdoc, and user-facing documentation. Treat it as the naming contract for new | ||
| APIs and refactors. | ||
|
|
||
| ## Layer model and glossary | ||
|
|
||
| | Layer | Canonical term | Primary types | Description | | ||
| | --------------------- | ----------------- | ------------------------------------------------ | ----------------------------------------------------------------------------------- | | ||
| | Transport framing | Frame | `FrameCodec::Frame`, `LengthDelimitedFrameCodec` | Physical wire unit read from or written to the socket. | | ||
| | Routing envelope | Packet / Envelope | `Packet`, `Envelope`, `PacketParts` | Routable wrapper that carries route id, optional correlation id, and payload bytes. | | ||
| | Domain payload | Message | `message::Message`, extractor `Message<T>` | Typed application data encoded into packet payload bytes. | | ||
| | Transport subdivision | Fragment | `FragmentHeader`, `Fragmenter`, `Reassembler` | Size-limited chunk used when a payload exceeds frame budget. | | ||
|
|
||
| ## Naming invariants | ||
|
|
||
| - Frame terms belong to codec and socket boundaries only. | ||
| - Packet or envelope terms belong to routing and middleware request/response | ||
| wrappers. | ||
| - Message terms belong to typed payload encode/decode concerns. | ||
| - Fragment terms belong to transport splitting and reassembly. | ||
| - Correlation identifiers are cross-layer metadata and may appear on frame, | ||
| packet, and message-adjacent APIs when protocol metadata requires it. | ||
|
|
||
| ## Allowed aliases and prohibited mixing | ||
|
|
||
| | Canonical term | Allowed aliases | Avoid in the same context | | ||
| | ----------------- | ------------------------------ | ----------------------------------------- | | ||
| | Frame | wire frame, transport frame | packet, envelope, message | | ||
| | Packet / Envelope | routable envelope | frame (unless describing codec transport) | | ||
| | Message | payload type, domain message | frame, fragment | | ||
| | Fragment | fragment frame, fragment chunk | packet, message | | ||
|
|
||
| ## API and docs checklist | ||
|
|
||
| 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 | ||
| labelled as shared metadata. | ||
|
|
||
| ## Vocabulary normalization outcome (2026-02-20) | ||
|
|
||
| The 2026-02-20 normalization pass aligned docs and rustdoc terminology to this | ||
| model and did not rename public symbols. Existing API names (`FrameCodec`, | ||
| `Packet`, `Envelope`, `Message`, `Fragment*`) already map cleanly to separate | ||
| layers, so the implementation focused on clarifying boundaries rather than | ||
| introducing additional breaking changes. | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |||||||||||||||
| //! | ||||||||||||||||
| //! 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 | ||||||||||||||||
|
Comment on lines
3
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use -ize spelling for serialization terms. Replace "serialisation" and "deserialisation" with "serialization" and ✏️ 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. SeeAs per coding guidelines, Comments and docs must follow en-GB-oxendict (-ize / -yse / -our) spelling and grammar. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| //! [`crate::app::builder::WireframeApp`] for how envelopes are used when | ||||||||||||||||
| //! registering routes. | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -71,7 +71,7 @@ pub trait Packet: CorrelatableFrame + Message + Send + Sync + 'static { | |||||||||||||||
| /// Construct a new packet from raw parts. | ||||||||||||||||
| fn from_parts(parts: PacketParts) -> Self; | ||||||||||||||||
|
|
||||||||||||||||
| /// Returns `true` if this frame represents an end-of-stream terminator. | ||||||||||||||||
| /// Returns `true` if this packet represents an end-of-stream terminator. | ||||||||||||||||
| /// | ||||||||||||||||
| /// The default implementation returns `false`. Protocol implementations | ||||||||||||||||
| /// should override this to detect the protocol-specific terminator format | ||||||||||||||||
|
|
@@ -88,20 +88,20 @@ pub trait Packet: CorrelatableFrame + Message + Send + Sync + 'static { | |||||||||||||||
| /// }; | ||||||||||||||||
| /// | ||||||||||||||||
| /// #[derive(bincode::BorrowDecode, bincode::Encode)] | ||||||||||||||||
| /// struct MyFrame { | ||||||||||||||||
| /// struct MyEnvelope { | ||||||||||||||||
| /// id: u32, | ||||||||||||||||
| /// correlation_id: Option<u64>, | ||||||||||||||||
| /// payload: Vec<u8>, | ||||||||||||||||
| /// } | ||||||||||||||||
| /// | ||||||||||||||||
| /// impl CorrelatableFrame for MyFrame { | ||||||||||||||||
| /// impl CorrelatableFrame for MyEnvelope { | ||||||||||||||||
| /// fn correlation_id(&self) -> Option<u64> { self.correlation_id } | ||||||||||||||||
| /// fn set_correlation_id(&mut self, cid: Option<u64>) { self.correlation_id = cid; } | ||||||||||||||||
| /// } | ||||||||||||||||
| /// | ||||||||||||||||
| /// // Message is auto-implemented via the blanket impl for Encode + BorrowDecode types. | ||||||||||||||||
| /// | ||||||||||||||||
| /// impl Packet for MyFrame { | ||||||||||||||||
| /// impl Packet for MyEnvelope { | ||||||||||||||||
| /// fn id(&self) -> u32 { self.id } | ||||||||||||||||
| /// fn into_parts(self) -> PacketParts { | ||||||||||||||||
| /// PacketParts::new(self.id, self.correlation_id, self.payload) | ||||||||||||||||
|
|
@@ -116,14 +116,14 @@ pub trait Packet: CorrelatableFrame + Message + Send + Sync + 'static { | |||||||||||||||
| /// fn is_stream_terminator(&self) -> bool { self.id == 0 } | ||||||||||||||||
| /// } | ||||||||||||||||
| /// | ||||||||||||||||
| /// let terminator = MyFrame { | ||||||||||||||||
| /// let terminator = MyEnvelope { | ||||||||||||||||
| /// id: 0, | ||||||||||||||||
| /// correlation_id: None, | ||||||||||||||||
| /// payload: vec![], | ||||||||||||||||
| /// }; | ||||||||||||||||
| /// assert!(terminator.is_stream_terminator()); | ||||||||||||||||
| /// | ||||||||||||||||
| /// let data = MyFrame { | ||||||||||||||||
| /// let data = MyEnvelope { | ||||||||||||||||
| /// id: 1, | ||||||||||||||||
| /// correlation_id: None, | ||||||||||||||||
| /// payload: vec![42], | ||||||||||||||||
|
|
@@ -144,7 +144,7 @@ pub struct PacketParts { | |||||||||||||||
| /// Basic envelope type used by | ||||||||||||||||
| /// [`crate::app::builder::WireframeApp::handle_connection`]. | ||||||||||||||||
| /// | ||||||||||||||||
| /// Incoming frames are deserialised into an `Envelope` containing the | ||||||||||||||||
| /// Incoming packets are deserialised into an `Envelope` containing the | ||||||||||||||||
| /// message identifier and raw payload bytes. | ||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||
| #[derive(bincode::Decode, bincode::Encode, Debug, Clone, PartialEq, Eq)] | ||||||||||||||||
| pub struct Envelope { | ||||||||||||||||
|
|
@@ -206,7 +206,7 @@ impl PacketParts { | |||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| /// Return the message identifier used to route this frame. | ||||||||||||||||
| /// Return the message identifier used to route this packet. | ||||||||||||||||
| /// | ||||||||||||||||
| /// # Examples | ||||||||||||||||
| /// | ||||||||||||||||
|
|
||||||||||||||||
There was a problem hiding this comment.
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
🧰 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.mdand 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