Skip to content

Plan zero-copy frame migration: ADRs 008–010 and 16.x/17.x roadmap; refactor nested conditionals (Epic #284)#523

Merged
leynos merged 15 commits intomainfrom
migrate-vec-to-bytes-zero-copy-e6rl2o
Apr 15, 2026
Merged

Plan zero-copy frame migration: ADRs 008–010 and 16.x/17.x roadmap; refactor nested conditionals (Epic #284)#523
leynos merged 15 commits intomainfrom
migrate-vec-to-bytes-zero-copy-e6rl2o

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Apr 12, 2026

Summary

  • Broad internal refactor to improve zero-copy migration readiness, including ADRs and roadmap updates. Public behavior remains unchanged.
  • Core internals now use a dedicated prefix-buffer helper and centralized sequence-tracking helpers to simplify control flow and linting.
  • ADRs and migration roadmap updated to reflect ongoing zero-copy migration plan and governance.
  • Examines and aligns various docs and tests with the new zero-copy strategy.

What this PR does

Documentation & architecture

  • Adds ADR-008 (docs/adr-008-zero-copy-public-byte-container.md): adopts
    Bytes-compatible shared storage as the canonical public payload
    representation, with an edit-on-demand copy-on-write mutation helper for
    middleware and client-hook surfaces.
  • Adds ADR-009 (docs/adr-009-vec-u8-migration-rollout.md): selects a
    staged breaking-release rollout (Option C) for the Vec<u8> → zero-copy
    migration, with finite bounded compatibility helpers.
  • Adds ADR-010 (docs/adr-010-transport-frame-boundary-for-zero-copy.md):
    establishes ConnectionActor as packet-oriented and the codec-driver as the
    sole owner of transport-frame emission, removing Vec<u8> frame bridges from
    the core runtime once validated.
  • Adds docs/zero-copy-frame-and-payload-migration-roadmap.md: a phased
    programme (decision closure & baseline → internal foundations → public API
    migration → validation → release rollout) with task checklists, success
    measures, and explicit ADR cross-references.
  • Updates docs/frame-vec-u8-inventory.md and docs/contents.md to reference
    the new ADRs and roadmap.
  • Renumbers roadmap sections and all execplans from the 10.x/11.x/12.x/
    13.x/14.x family to 16.x/17.x/18.x/19.x to accommodate the new
    zero-copy phases (10–14) ahead of the formal-verification and client-library
    phases.

Code refactors (no public API changes)

  • src/frame/conversion.rs: extracts fill_prefix_buffer(prefix, size, endianness) -> [u8; 8] — computes a single byte offset and performs one flat
    copy_from_slice, replacing the two if let Some(dst) = buf.get_mut(...)
    clusters that triggered a bumpy_road_function Dylint violation in
    bytes_to_u64.
  • src/message_assembler/series.rs: extracts handle_untracked_first_sequence
    and advance_tracked_sequence from validate_and_advance_sequence, reducing
    five nested conditional clusters to two flat single-expression match arms.

Traceability

Each ADR carries explicit item-level back-references to roadmap.md and the
zero-copy migration roadmap:

ADR Governed roadmap items
ADR-008 10.1.1, 11.1.1, 12.1.1, 12.1.2, 12.2.1, 12.2.3, 13.1.2
ADR-009 10.1.2, 10.2.3, 12.1.2, 12.2.2, 13.1.1, 13.1.2, 14.1.1–14.1.3, 14.2.1
ADR-010 9.3.1, 10.1.3, 11.1.2, 11.2.1–11.2.3, 14.2.1

Testing & validation

  • All refactors are isolated to private helpers; no exported function signatures
    were modified.
  • Documentation files compiled and cross-reference links validated.
  • Full CI validation (dylint/Clippy) targeted by the lint fixes above.

Task

… migration

- Introduced ADR 008, 009, and 010 to define architectural decisions for the new zero-copy public byte container, migration rollout strategy, and transport-frame boundary.
- Added a detailed zero-copy frame and payload migration roadmap outlining phased implementation, benchmarking, migration plans, and release preparation.
- Updated documentation links and inventory notes to incorporate these critical migration strategy documents.

This lays the foundation for removing the final Vec<u8> copy in outbound paths and establishes a clear public API, rollout and performance validation strategy for the breaking change to zero-copy payloads.

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

coderabbitai Bot commented Apr 12, 2026

Walkthrough

Summarise the addition of three ADRs and a detailed zero‑copy migration roadmap; renumber roadmap sections and update many execplans and supporting docs to reference new phase identifiers and local Epic 284 tracking. Report that all modifications are documentation-only.

Changes

Cohort / File(s) Summary
New ADRs
docs/adr-008-zero-copy-public-byte-container.md, docs/adr-009-vec-u8-migration-rollout.md, docs/adr-010-transport-frame-boundary-for-zero-copy.md
Add three ADRs: select a Bytes-compatible public byte representation with an explicit edit‑on‑demand (copy‑on‑write) mutation model; define a staged breaking‑release rollout and bounded compatibility helpers; establish the codec/transport ownership boundary for zero‑copy emission.
Zero‑copy Roadmap
docs/zero-copy-frame-and-payload-migration-roadmap.md
Add a five‑phase migration roadmap for Epic 284 covering decision closure, internal foundations, public API migration, validation/ecosystem updates, and release rollout with success measures and task checklists.
Roadmap Reorganisation
docs/roadmap.md
Insert zero‑copy migration phases (10–14), reindex prior “Formal verification” to section 15, renumber subsequent roadmap sections (11→16, 12→17, 13→18, 14→19), and update intra‑roadmap prerequisite links and headings.
Execplan renumbering
docs/execplans/...
docs/execplans/16-2-1-client-message-api.md, docs/execplans/16-2-2-client-decode-and-transport-failures.md, docs/execplans/16-3-1-client-response-stream-and-response-multipacket.md, docs/execplans/16-3-2-exercise-interleaved-queues.md, docs/execplans/16-4-1-client-documentation-and-examples.md, docs/execplans/17-1-1-outgoing-request-middleware-hooks.md, docs/execplans/17-1-2-structured-logging-and-tracing-spans.md, docs/execplans/17-2-1-configurable-connection-pool-preserving-preamble.md, docs/execplans/17-2-2-expose-pool-handle-api.md, docs/execplans/17-3-1-helpers-for-consuming-streaming-responses.md, docs/execplans/17-3-2-in-process-server-and-client-pair-test-harness.md, docs/execplans/17-4-2-troubleshooting-section.md
Renumber execplan documents and in‑file references to match updated roadmap identifiers; update example/log file paths and titles. Text edits only.
Cross‑reference & supporting docs
docs/contents.md, docs/frame-vec-u8-inventory.md, docs/multi-packet-and-streaming-responses-design.md, docs/users-guide.md, docs/wireframe-client-design.md, docs/wireframe-testing-crate.md
Update supporting documentation to reference new roadmap phases and ADRs; add Epic 284 tracking links and local inventory pointers.
Small editorial updates
docs/execplans/* (multiple files)
Adjust roadmap/phase identifiers and example paths inside execplans; no API or code changes.
Contents update
docs/contents.md
Add a roadmap entry titled “Zero‑copy frame and payload migration roadmap.”
Internal helpers & refactors
src/frame/conversion.rs, src/message_assembler/series.rs
Add private helper fill_prefix_buffer and simplify bytes_to_u64 alignment logic; refactor MessageSeries sequence validation into two helpers and dispatching wrapper. No public API changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client as Client
  participant Conn as ConnectionActor
  participant Codec as CodecDriver/Serializer
  participant Transport as Transport/FrameEmitter

  rect rgba(200,220,255,0.5)
    Client->>Conn: send Packet/Envelope (payload = Bytes-compatible)
    Conn->>Codec: hand off packet without materialising Vec<u8>
  end

  rect rgba(200,255,200,0.5)
    Codec->>Codec: apply wrap_payload (zero-copy)
    alt caller needs mutation
      Codec->>Codec: invoke edit-on-demand helper (copy-on-write)
    end
    Codec->>Transport: emit transport frame
  end

  rect rgba(255,220,200,0.5)
    Transport->>Client: deliver frame/ack
  end
Loading

Possibly related issues

Poem

🔁 Bytes stride forth, light and spry,
Vec steps back without a sigh.
Three ADRs and roadmap clear,
Edit‑on‑demand draws near,
Ship the plan and hoist it high.

🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Developer Documentation ⚠️ Warning Pull request introduces new internal APIs and architectural changes but developers-guide documents only layer terminology, ignoring the refactored sequence validation architecture and two helper functions lack rustdoc documentation. Update docs/developers-guide.md to document message sequence validation architecture. Add rustdoc comments to handle_untracked_first_sequence and advance_tracked_sequence functions explaining their role in the validation flow.
✅ Passed checks (6 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Testing ✅ Passed Refactored code is adequately guarded by existing comprehensive tests. Extracted helpers are private implementation details exercised through public API tests covering all code paths, edge cases, and boundary conditions.
User-Facing Documentation ✅ Passed PR introduces no new user-facing functionality; all changes are internal refactors and documentation additions (architectural records and roadmap planning).
Module-Level Documentation ✅ Passed Both modified source files contain proper module-level documentation. src/frame/conversion.rs includes the docstring explaining conversion helpers for length prefix encoding. src/message_assembler/series.rs includes a comprehensive module-level docstring explaining the module's purpose and design. Both satisfy the requirement for clear documentation.
Title check ✅ Passed The pull request title clearly summarises the main changes: ADRs 008–010, zero-copy roadmap planning, renumbered execplans (16.x/17.x), and code refactors for nested conditionals.
Description check ✅ Passed The pull request description accurately and comprehensively relates to the changeset, detailing ADR additions, roadmap updates, code refactors, and documentation alignment for Epic #284's zero-copy migration.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch migrate-vec-to-bytes-zero-copy-e6rl2o

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

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Apr 12, 2026

Reviewer's Guide

Documents and wires up the zero-copy frame and payload migration effort by adding ADRs 008–010, introducing a dedicated migration roadmap, and aligning the existing roadmap, exec plans, and inventory docs (including renumbering client-roadmap items from 10–14 to 16–19) to reference and track epic 284 coherently.

Flow diagram for the zero-copy frame and payload migration roadmap

flowchart TD
  A["1 Decision closure and baseline"] --> B["2 Internal zero-copy foundations"]
  B --> C["3 Public API migration"]
  C --> D["4 Validation ecosystem updates and documentation"]
  D --> E["5 Release rollout"]

  subgraph Phase1_Decision_Closure
    A1["1.1 Approve public byte container and edit-on-demand model<br/>ADR 008"]
    A2["1.1 Approve compatibility and rollout policy<br/>ADR 009"]
    A3["1.1 Approve actor and codec-driver boundary<br/>ADR 010"]
    A4["1.2 Define benchmarks and thresholds"]
    A5["1.2 Draft migration guide outline"]
  end

  subgraph Phase2_Internal_Foundations
    B1["2.1 Introduce internal zero-copy payload representation"]
    B2["2.1 Convert PacketParts and Envelope storage"]
    B3["2.1 Update internal channels and buffers"]
    B4["2.2 Implement actor and codec-driver boundary"]
    B5["2.2 Remove core Vec<u8> frame bridges"]
    B6["2.2 Add allocation and pointer-reuse regressions"]
  end

  subgraph Phase3_Public_API
    C1["3.1 Migrate packet and middleware APIs off Vec<u8>"]
    C2["3.1 Preserve edit-on-demand ergonomics"]
    C3["3.1 Update server examples and behavioural tests"]
    C4["3.2 Update before_send hook and client byte APIs"]
    C5["3.2 Update Serializer::serialize contract"]
    C6["3.2 Re-evaluate client preamble policy"]
  end

  subgraph Phase4_Validation_and_Docs
    D1["4.1 Update testing helpers and examples to new byte model"]
    D2["4.1 Publish migration guide and breaking-change summary"]
    D3["4.1 Close or supersede ADRs 008 009 010"]
    D4["4.2 Run benchmarks vs thresholds and record results"]
    D5["4.2 Run downstream canaries and capture outcomes"]
  end

  subgraph Phase5_Release
    E1["5.1 Finalize versioning plan for breaking release"]
    E2["5.1 Publish release notes changelog and upgrade guidance"]
    E3["5.1 Capture post-release follow-ups and compatibility helper review"]
  end

  A --> A1 --> A2 --> A3 --> A4 --> A5
  B --> B1 --> B2 --> B3 --> B4 --> B5 --> B6
  C --> C1 --> C2 --> C3 --> C4 --> C5 --> C6
  D --> D1 --> D2 --> D3 --> D4 --> D5
  E --> E1 --> E2 --> E3
Loading

File-Level Changes

Change Details Files
Add ADRs defining the zero-copy public byte model, rollout policy, and transport-frame boundary, and hook them into the documentation set.
  • Create ADR 008 capturing the choice of a Bytes-compatible stable public byte container plus explicit edit-on-demand mutation helpers, including goals, trade-offs, and phased migration outline.
  • Create ADR 009 defining the staged rollout and compatibility strategy for migrating from Vec to the zero-copy representation, including finite helper lifetime and release planning.
  • Create ADR 010 specifying the long-term boundary between ConnectionActor, codec driver, protocol hooks, and transport frames for the zero-copy path, and how to remove Vec-specific bridges from the core runtime.
docs/adr-008-zero-copy-public-byte-container.md
docs/adr-009-vec-u8-migration-rollout.md
docs/adr-010-transport-frame-boundary-for-zero-copy.md
Add a dedicated zero-copy frame and payload migration roadmap document and wire it to the inventory and ADRs.
  • Introduce docs/zero-copy-frame-and-payload-migration-roadmap.md describing phases for decision closure, internal zero-copy foundations, public API migration, validation/ecosystem updates, and release rollout, each with checklist items and dependencies.
  • Align the new roadmap’s phases with ADR-008/009/010 by explicitly referencing them as requirements and closure conditions for decision and rollout tasks.
  • Document benchmark baselines, acceptance thresholds, downstream canary expectations, and migration-guide content as explicit steps in the roadmap.
docs/zero-copy-frame-and-payload-migration-roadmap.md
Update the Vec inventory and documentation index to reference the new roadmap and ADRs for traceability.
  • Revise the coordination notes in docs/frame-vec-u8-inventory.md so epic 284 is now explicitly tracked via roadmap phases 10–14 and cross-referenced to the new ADRs and migration roadmap.
  • Provide a concise block of “source-of-truth” links (inventory, migration roadmap, ADR-008/009/010) to embed into external epic tracking systems.
  • Extend docs/contents.md to surface the new zero-copy migration roadmap alongside existing roadmaps.
docs/frame-vec-u8-inventory.md
docs/contents.md
Keep client and testing design docs aligned with the renumbered roadmap and in-process harness work.
  • Update references in docs/wireframe-client-design.md so decision records and validation notes point at the new 16.x/17.x client roadmap items instead of 11.x/12.x.
  • Adjust docs/wireframe-testing-crate.md to tie the in-process client/server harness back to the new roadmap item number for that workstream.
docs/wireframe-client-design.md
docs/wireframe-testing-crate.md

Assessment against linked issues

Issue Objective Addressed Explanation
#284 Create and integrate a concrete design proposal for migrating the public Frame and payload-related APIs from Vec to a zero-copy Bytes-based model, including options, risks, and trade-offs.
#284 Document a migration, compatibility, and rollout strategy for downstream users, including benchmarking plans/baselines, acceptance thresholds, and a migration-guide outline for the breaking release.

Possibly linked issues


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-delta-analysis[bot]

This comment was marked as outdated.

- Rename multiple execplan docs and their internal references to move roadmap items from the 10 and 11 series to the 16 and 17 series respectively.
- Update all corresponding documentation and source comments to reflect the new roadmap item numbering.
- Adjust examples, logs, test names, and documentation to maintain consistency with the new item numbers.
- Ensure tests and quality gates refer to updated roadmap items.

This change aligns roadmap tracking and documentation with the current iteration scheme, preparing for the next phase of development in the 16.x and 17.x series and maintaining internal consistency.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos leynos marked this pull request as ready for review April 12, 2026 19:59
sourcery-ai[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
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: 3

🤖 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/contents.md`:
- Around line 32-34: Reflow the markdown bullet starting with "Zero-copy frame
and payload migration roadmap" so the list item and its following sentence are
wrapped to 80 columns per the repository rule; edit the bullet text and its
paragraph to split long lines (breaking after the link or logical word
boundaries) so no line exceeds 80 characters while preserving the link
`[Zero-copy frame and payload migration
roadmap](zero-copy-frame-and-payload-migration-roadmap.md)` and the sentence
"Phased plan for migrating from `Vec<u8>`-owned frame APIs to a zero-copy
alternative."

In `@docs/execplans/17-4-2-troubleshooting-section.md`:
- Around line 451-454: The checklist sentence is grammatically broken; revise
the line starting "Only after these pass should implementation:" so the
checklist flows correctly—e.g., change to "Only after these pass should the
implementation team:" or "Only after these pass should the following be
completed:" and ensure the two items read as complete actions (mark `17.4.2` as
done in `docs/roadmap.md` and update the `Progress` and `Outcomes &
Retrospective` sections). Update the surrounding text to match the chosen
phrasing so the closing checklist is clear and unambiguous.

In `@docs/frame-vec-u8-inventory.md`:
- Around line 359-361: The text in docs/frame-vec-u8-inventory.md references
"phases 10 through 14 of `roadmap.md`" which is stale; update the Epic 284
coordination sentence to either use the current phase identifiers from the
renumbered roadmap or point to the dedicated zero-copy roadmap document instead
of hard-coded phase numbers. Edit the sentence that mentions "Epic 284" and
"phases 10 through 14 of `roadmap.md`" to reference the correct phase names/IDs
or replace the link with the authoritative zero-copy roadmap link so the
source-of-truth mapping remains accurate.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b794ac95-8965-4128-adba-a88d9e0401b7

📥 Commits

Reviewing files that changed from the base of the PR and between 7304e62 and d14b7b9.

📒 Files selected for processing (23)
  • docs/adr-008-zero-copy-public-byte-container.md
  • docs/adr-009-vec-u8-migration-rollout.md
  • docs/adr-010-transport-frame-boundary-for-zero-copy.md
  • docs/contents.md
  • docs/execplans/16-2-1-client-message-api.md
  • docs/execplans/16-2-2-client-decode-and-transport-failures.md
  • docs/execplans/16-3-1-client-response-stream-and-response-multipacket.md
  • docs/execplans/16-3-2-exercise-interleaved-queues.md
  • docs/execplans/16-4-1-client-documentation-and-examples.md
  • docs/execplans/17-1-1-outgoing-request-middleware-hooks.md
  • docs/execplans/17-1-2-structured-logging-and-tracing-spans.md
  • docs/execplans/17-2-1-configurable-connection-pool-preserving-preamble.md
  • docs/execplans/17-2-2-expose-pool-handle-api.md
  • docs/execplans/17-3-1-helpers-for-consuming-streaming-responses.md
  • docs/execplans/17-3-2-in-process-server-and-client-pair-test-harness.md
  • docs/execplans/17-4-2-troubleshooting-section.md
  • docs/frame-vec-u8-inventory.md
  • docs/multi-packet-and-streaming-responses-design.md
  • docs/roadmap.md
  • docs/users-guide.md
  • docs/wireframe-client-design.md
  • docs/wireframe-testing-crate.md
  • docs/zero-copy-frame-and-payload-migration-roadmap.md

Comment thread docs/contents.md
Comment thread docs/execplans/17-4-2-troubleshooting-section.md Outdated
Comment thread docs/frame-vec-u8-inventory.md Outdated
…p and epic work

Add detailed traceability sections to ADR-008, ADR-009, and ADR-010 to reference Epic 284 tasks, roadmap items, and relevant documentation. Update frame-vec-u8-inventory.md coordination notes to reflect roadmap tracking updates for zero-copy migration epic.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
@leynos leynos changed the title Plan zero-copy frame/payload migration roadmap and ADRs Plan zero-copy frame/payload migration ADRs (008–010) Apr 12, 2026
codescene-delta-analysis[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
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: 4

🤖 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/adr-008-zero-copy-public-byte-container.md`:
- Around line 7-10: The ADR's Date line uses a trailing full stop and
inconsistent formatting; update the Date header in
docs/adr-008-zero-copy-public-byte-container.md to exactly "2026-04-12"
(YYYY-MM-DD) with no trailing period so it matches the ADR date syntax and
coding guidelines.

In `@docs/adr-009-vec-u8-migration-rollout.md`:
- Around line 7-10: Update the "Date" field in the ADR header to strictly follow
YYYY-MM-DD by removing the trailing period so the value reads exactly
`2026-04-12`; edit the "Date" line under the "## Date" heading in
docs/adr-009-vec-u8-migration-rollout.md to delete the full stop after the date
to comply with ADR formatting rules.

In `@docs/adr-010-transport-frame-boundary-for-zero-copy.md`:
- Around line 7-10: In the "## Date" section (the line currently containing
"2026-04-12."), remove the trailing period so the date is exactly "2026-04-12"
to match the required YYYY-MM-DD format; update the line that follows the "##
Date" header (the literal date string) accordingly and ensure no other
punctuation remains on that date line.

In `@docs/frame-vec-u8-inventory.md`:
- Around line 359-363: Remove the stray leading space at the start of the
paragraph continuation that begins with "with the combined
[`roadmap.md`](roadmap.md)..." in the paragraph mentioning
"zero-copy-frame-and-payload-migration-roadmap.md" so the line starts flush with
the previous sentence (no leading space) to preserve consistent Markdown
paragraph formatting and satisfy markdownlint/docstyle rules.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2b86da6a-2666-4d43-946c-ac42e7180216

📥 Commits

Reviewing files that changed from the base of the PR and between d14b7b9 and 92cd244.

📒 Files selected for processing (4)
  • docs/adr-008-zero-copy-public-byte-container.md
  • docs/adr-009-vec-u8-migration-rollout.md
  • docs/adr-010-transport-frame-boundary-for-zero-copy.md
  • docs/frame-vec-u8-inventory.md

Comment thread docs/adr-008-zero-copy-public-byte-container.md
Comment thread docs/adr-009-vec-u8-migration-rollout.md
Comment thread docs/adr-010-transport-frame-boundary-for-zero-copy.md
Comment thread docs/frame-vec-u8-inventory.md Outdated
Removed unnecessary trailing periods in the date fields of ADRs 008, 009, and 010 markdown files to maintain consistency and formatting correctness.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos leynos changed the title Plan zero-copy frame/payload migration ADRs (008–010) Plan zero-copy frame and payload migration ADRs (008–010) and roadmap Apr 12, 2026
Copy link
Copy Markdown
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: 4

♻️ Duplicate comments (1)
docs/adr-009-vec-u8-migration-rollout.md (1)

5-5: ⚠️ Potential issue | 🟡 Minor

Normalize ADR status token.

Change Line 5 to Proposed without the full stop to match the required ADR
status value format.

Triage: [type:docstyle]
As per coding guidelines: "ADR required sections: Include Status (one of
'Proposed', 'Accepted', 'Superseded', or 'Deprecated'...)".

Suggested patch
-Proposed.
+Proposed
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/adr-009-vec-u8-migration-rollout.md` at line 5, Update the ADR status
token on docs/adr-009-vec-u8-migration-rollout.md so it matches the required
canonical values: replace the current "Proposed." text on the Status line with
"Proposed" (remove the trailing period) to conform to the ADR required sections
format.
🤖 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/adr-008-zero-copy-public-byte-container.md`:
- Line 5: Update the ADR status token on line 5 to exactly "Proposed" with no
trailing punctuation so the Status field is machine-checkable and matches
required tokens; locate the Status header in
docs/adr-008-zero-copy-public-byte-container.md (the ADR's Status line) and
replace the current text with the exact token Proposed.
- Around line 25-26: Rewrite the sentence that currently reads "The default
codec path wants shared, cheap-to-clone bytes to remove the final copy
identified in epic 284." to direct technical language: replace the nonstandard
"wants shared" with a precise verb such as "requires" or "uses", refer to "byte
buffers" or "bytes" explicitly (e.g., "requires shared, cheap-to-clone byte
buffers") and change "remove" to "avoid" or "eliminate" so the line reads
clearly and in en-GB spelling while still referencing the final copy discussed
in epic 284 and the "default codec path".

In `@docs/adr-010-transport-frame-boundary-for-zero-copy.md`:
- Line 5: Change the ADR status token on line 5 to exactly "Proposed" (no
trailing period or other punctuation) so the ADR metadata matches the required
set of statuses; update the status field in
docs/adr-010-transport-frame-boundary-for-zero-copy.md (the ADR Status line) to
the normalized value "Proposed".
- Around line 96-140: Add an explicit consolidation step to the Migration Plan
that declares the codec driver as the sole owner of transport frame emission and
mandates migrating all non-driver wrap_payload call sites into the codec-driver
boundary; specifically mention relocating any existing wrap_payload usages
(e.g., the runtime inbound emission path currently calling wrap_payload) into
the codec driver, update Phase 1 to include a concrete "consolidate non-driver
wrap_payload callers" task, and add a risk/control item that tracks these call
sites (e.g., by name or TODO tags) until they are removed, referencing
ConnectionActor, FrameCodec::wrap_payload, and the inbound emission path so
reviewers can locate and verify the changes.

---

Duplicate comments:
In `@docs/adr-009-vec-u8-migration-rollout.md`:
- Line 5: Update the ADR status token on
docs/adr-009-vec-u8-migration-rollout.md so it matches the required canonical
values: replace the current "Proposed." text on the Status line with "Proposed"
(remove the trailing period) to conform to the ADR required sections format.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d733114b-0a36-4dc6-9fbe-c232ed1df95c

📥 Commits

Reviewing files that changed from the base of the PR and between 92cd244 and defce06.

📒 Files selected for processing (3)
  • docs/adr-008-zero-copy-public-byte-container.md
  • docs/adr-009-vec-u8-migration-rollout.md
  • docs/adr-010-transport-frame-boundary-for-zero-copy.md

Comment thread docs/adr-008-zero-copy-public-byte-container.md Outdated
Comment thread docs/adr-008-zero-copy-public-byte-container.md Outdated
Comment thread docs/adr-010-transport-frame-boundary-for-zero-copy.md Outdated
Comment thread docs/adr-010-transport-frame-boundary-for-zero-copy.md
…me boundary

- Corrected proposal statuses from "Proposed." to "Proposed" in ADR-008, ADR-009, and ADR-010.
- Improved wording for byte buffer usage in ADR-008 to reflect shared, cheap-to-clone buffers.
- In ADR-010, added clarification on consolidating FrameCodec::wrap_payload call sites into codec driver and tracking remaining call sites to enforce codec driver ownership of transport frame emission.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
@leynos leynos changed the title Plan zero-copy frame and payload migration ADRs (008–010) and roadmap Plan zero-copy frame/payload migration: ADRs 008–010 and 16.x/17.x roadmap Apr 12, 2026
codescene-delta-analysis[bot]

This comment was marked as outdated.

…proved formatting

Reformatted the coordination notes section for better readability by explicitly stating that Epic 284 is tracked locally in a dedicated roadmap file. Improved sentence structure to distinctly separate details about the roadmap and the zero-copy migration phases.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
@leynos leynos changed the title Plan zero-copy frame/payload migration: ADRs 008–010 and 16.x/17.x roadmap Plan zero-copy frame migration: ADRs 008–010 and 16.x/17.x roadmap Apr 12, 2026
Copy link
Copy Markdown
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: 3

🤖 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/adr-008-zero-copy-public-byte-container.md`:
- Around line 32-50: In the ADR "Traceability" section add an explicit entry for
zero-copy-frame-and-payload-migration-roadmap.md so the ADR links directly to
the zero-copy migration roadmap (keeping ADR-to-roadmap navigation one hop and
auditable); update the list alongside the existing frame-vec-u8-inventory.md and
roadmap.md references so the new roadmap filename is clearly declared in that
Traceability block.

In `@docs/adr-009-vec-u8-migration-rollout.md`:
- Around line 28-48: Update the "Traceability" section to include a direct
reference to the zero-copy roadmap file by adding
`docs/zero-copy-frame-and-payload-migration-roadmap.md` to the listed tracking
artifacts so the rollout traceability explicitly couples migration policy and
roadmap milestones; modify the Traceability bulleted list (inside the same
"Traceability" section and near the existing roadmap.md entries and roadmap
items `10.1.2`–`14.2.1`) to include the new file and ensure the phrasing makes
it clear this roadmap is part of the migration publish phase described in "Phase
1".

In `@docs/adr-010-transport-frame-boundary-for-zero-copy.md`:
- Around line 31-48: Update the Traceability section of this ADR to add a
dedicated bullet linking the "Zero-Copy Frame and Payload Migration Roadmap"
document (the zero-copy migration roadmap) and explicitly state the relationship
between this ADR's boundary decision and the rollout workstream; keep the
wording that preserves navigation between the boundary decision and rollout
tasks and add the implementation note to monitor all non-driver
FrameCodec::wrap_payload call sites during review so the codec driver becomes
the sole owner of transport frame emission (reference FrameCodec::wrap_payload
and this ADR title).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b6648492-713a-4405-86cb-b549644999f1

📥 Commits

Reviewing files that changed from the base of the PR and between defce06 and 0e0724a.

📒 Files selected for processing (3)
  • docs/adr-008-zero-copy-public-byte-container.md
  • docs/adr-009-vec-u8-migration-rollout.md
  • docs/adr-010-transport-frame-boundary-for-zero-copy.md

Comment thread docs/adr-008-zero-copy-public-byte-container.md
Comment thread docs/adr-009-vec-u8-migration-rollout.md
Comment thread docs/adr-010-transport-frame-boundary-for-zero-copy.md
codescene-delta-analysis[bot]

This comment was marked as outdated.

Added references to zero-copy migration roadmap document in ADRs 008, 009, and 010 to track migration phases, rollout policy, and boundary decisions related to Epic 284.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
codescene-delta-analysis[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
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: 4

🤖 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/adr-008-zero-copy-public-byte-container.md`:
- Around line 44-53: The ADR references outdated roadmap IDs (10.1.1, 11.1.1,
12.1.1, 12.1.2, 12.2.1, 12.2.3, 13.1.2); update those tokens to their renumbered
equivalents in the 16.x/17.x plan family so traceability links remain auditable
and clickable. Edit the listed bullets in
docs/adr-008-zero-copy-public-byte-container.md replacing each `10.x`–`13.x`
item reference with the correct new roadmap IDs (ensure the specific tokens
`10.1.1`, `11.1.1`, `12.1.1`, `12.1.2`, `12.2.1`, `12.2.3`, `13.1.2` are matched
and replaced), and verify any associated hyperlinks or cross-references still
resolve after the change.

In `@docs/adr-009-vec-u8-migration-rollout.md`:
- Around line 37-38: The traceability sentence in
docs/adr-009-vec-u8-migration-rollout.md uses the incorrect noun phrase "later
publish milestones"; update that phrase to "later publication milestones"
(maintaining en-GB-oxendict spelling) so the sentence reads "...including the
Phase 1 decision closure and the later publication milestones." Ensure you
replace the exact phrase in the traceability paragraph.
- Around line 40-51: Update the listed roadmap item IDs to the current 16.x/17.x
numbering so the ADR maps to the live migration plan; specifically replace the
old IDs `10.1.2`, `10.2.3`, `12.1.2`, `12.2.2`, `13.1.1`, `13.1.2`, `14.1.1`,
`14.1.2`, `14.1.3`, and `14.2.1` in the Vec<u8> migration rollout section with
their corresponding new 16.x/17.x IDs from the renumbered roadmap, verify each
new ID matches the roadmap title/description, and update any adjacent text that
assumes the old numbering so all references (the listed roadmap item
identifiers) are consistent and accurate.

In `@docs/adr-010-transport-frame-boundary-for-zero-copy.md`:
- Around line 45-53: Update the outdated roadmap ID references in the ADR text
by replacing the tokens `10.1.3`, `11.1.2`, `11.2.1`, `11.2.2`, `11.2.3`, and
`14.2.1` with the current active roadmap IDs so reviewers can trace
implementation checkpoints; locate the paragraph listing these roadmap items in
the ADR and substitute each old ID with the corresponding up-to-date roadmap
entry (verify against the current roadmap source), keeping the same phrasing and
bullets (`actor and codec-driver boundary`, `remove default-path Vec<u8> copy`,
`implement boundary and move Vec<u8>-specific runtime traits`,
`allocation/pointer-reuse regressions`, `review runtime-only compatibility
bridges`) to preserve intent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 857d4a98-08da-4601-ac05-36a53f6bb3f9

📥 Commits

Reviewing files that changed from the base of the PR and between 1899caa and b4dafc6.

📒 Files selected for processing (3)
  • docs/adr-008-zero-copy-public-byte-container.md
  • docs/adr-009-vec-u8-migration-rollout.md
  • docs/adr-010-transport-frame-boundary-for-zero-copy.md

Comment thread docs/adr-008-zero-copy-public-byte-container.md
Comment thread docs/adr-009-vec-u8-migration-rollout.md Outdated
Comment thread docs/adr-009-vec-u8-migration-rollout.md
Comment thread docs/adr-010-transport-frame-boundary-for-zero-copy.md
Corrected minor typos in docs/adr-009-vec-u8-migration-rollout.md and docs/execplans/17-4-2-troubleshooting-section.md for clarity and correctness.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 14, 2026

@coderabbitai Please suggest a fix for the following lint violation and provide an AI coding agent prompt for the fix:

Error:   --> src/frame/conversion.rs:40:8
   |
40 |    pub fn bytes_to_u64(bytes: &[u8], size: usize, endianness: Endianness) -> io::Result<u64> {
   |  _________^^^^^^^^^^^^_______________________________________________________________________-
   | | ___________________________________________________________________________________________|
   | ||
41 | ||     if !matches!(size, 1 | 2 | 4 | 8) {
42 | ||         return Err(io::Error::new(
43 | ||             io::ErrorKind::InvalidInput,
...  ||
68 | ||                 ));
69 | ||             }
   | ||_- Complexity bump 1 spans 7 lines.
...  |
79 | |                  ));
80 | |              }
   | |__- Complexity bump 2 spans 7 lines.
   |
note: Detected 2 complexity bumps above the threshold 2.5.
  --> src/frame/conversion.rs:40:8
   |
40 | pub fn bytes_to_u64(bytes: &[u8], size: usize, endianness: Endianness) -> io::Result<u64> {
   |        ^^^^^^^^^^^^
   = help: Extract helper functions from the highlighted regions to reduce clustered complexity.
   = note: `-D bumpy-road-function` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(bumpy_road_function)]`

error: Multiple clusters of nested conditional logic in `validate_and_advance_sequence`.
Error:    --> src/message_assembler/series.rs:200:8
    |
200 |        fn validate_and_advance_sequence(
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
204 |        ) -> Result<(), MessageSeriesError> {
    |   _________________________________________-
    |  |_________________________________________|
205 | ||         match self.sequence_tracking {
206 | ||             SequenceTracking::Untracked => {
...   ||
212 | ||                     return Err(MessageSeriesError::SequenceOverflow { last: incoming });
213 | ||                 }
    | ||_- Complexity bump 2 spans 2 lines.
...   |
221 | |                  if incoming.0 < expected.0 {
    | |__- Complexity bump 1 spans 4 lines.
    |
note: Detected 5 complexity bumps above the threshold 2.5.
   --> src/message_assembler/series.rs:200:8
    |
200 |     fn validate_and_advance_sequence(
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: Extract helper functions from the highlighted regions to reduce clustered complexity.

error: could not compile `wireframe` (lib) due to 2 previous errors
Error: 
Error: Compilation failed with toolchain `nightly-2025-09-18`

Caused by:
    command failed: env -u CARGO -u RUSTC CLIPPY_DISABLE_DOCS_LINKS="null" DYLINT_LIBS="[\"/home/runner/.local/share/whitaker/lints/nightly-2025-09-18/x86_64-unknown-linux-gnu/lib/libwhitaker_suite@nightly-2025-09-18.so\"]" DYLINT_METADATA="null" DYLINT_NO_DEPS="0" RUSTC_WORKSPACE_WRAPPER="/home/runner/.dylint_drivers/nightly-2025-09-18/dylint-driver" RUSTUP_TOOLCHAIN="nightly-2025-09-18" "cargo" "check" "--target-dir" "/home/runner/work/wireframe/wireframe/target/dylint/target/nightly-2025-09-18" "--all-targets" "--all-features"

Stack backtrace:
   0: <anyhow::Error>::msg::<alloc::string::String>
   1: anyhow::__private::format_err
   2: <std::process::Command as dylint_internal::command::CommandExt>::success
   3: dylint::run_with_name_toolchain_map
   4: dylint::run
   5: cargo_dylint::main
   6: std::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core::result::Result<(), dylint::error::ColorizedError<anyhow::Error>>, core::result::Result<(), dylint::error::ColorizedError<anyhow::Error>>>
   7: std::rt::lang_start::<core::result::Result<(), dylint::error::ColorizedError<anyhow::Error>>>::{closure#0}
   8: std::rt::lang_start_internal
   9: main
  10: <unknown>
  11: __libc_start_main
  12: _start
make: *** [Makefile:51: lint] Error 1

@coderabbitai

This comment was marked as resolved.

…uence validation logic

- Extracted fill_prefix_buffer helper in frame conversion for clarity and reusability.
- Simplified bytes_to_u64 by delegating buffer filling to the new helper.
- Refactored MessageSeries sequence validation into handle_untracked_first_sequence and advance_tracked_sequence for clearer separation of concerns.
- Improved error handling and explicit sequence flow in message assembly.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos leynos changed the title Plan zero-copy frame migration: ADRs 008–010 and 16.x/17.x roadmap Refactor nested conditionals in wireframe crate; ADR zero-copy docs Apr 14, 2026
@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 14, 2026

@coderabbitai Please suggest a fix for the following lint violation and provide an AI coding agent prompt for the fix:

error: Multiple clusters of nested conditional logic in `fill_prefix_buffer`.
Error:   --> src/frame/conversion.rs:37:4
   |
37 |    fn fill_prefix_buffer(prefix: &[u8], size: usize, endianness: Endianness) -> [u8; 8] {
   |  _____^^^^^^^^^^^^^^^^^^________________________________________________________________-
   | | ______________________________________________________________________________________|
   | ||
38 | ||     let mut buf = [0u8; 8];
39 | ||     match endianness {
40 | ||         Endianness::Big => {
...  ||
47 | ||                 );
48 | ||             }
   | ||_- Complexity bump 1 spans 6 lines.
...  |
57 | |                  );
58 | |              }
   | |__- Complexity bump 2 spans 6 lines.
   |
note: Detected 2 complexity bumps above the threshold 2.5.
  --> src/frame/conversion.rs:37:4
   |
37 | fn fill_prefix_buffer(prefix: &[u8], size: usize, endianness: Endianness) -> [u8; 8] {
   |    ^^^^^^^^^^^^^^^^^^
   = help: Extract helper functions from the highlighted regions to reduce clustered complexity.
   = note: `-D bumpy-road-function` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(bumpy_road_function)]`

error: could not compile `wireframe` (lib) due to 1 previous error
Error: 
Error: Compilation failed with toolchain `nightly-2025-09-18`

Caused by:
    command failed: env -u CARGO -u RUSTC CLIPPY_DISABLE_DOCS_LINKS="null" DYLINT_LIBS="[\"/home/runner/.local/share/whitaker/lints/nightly-2025-09-18/x86_64-unknown-linux-gnu/lib/libwhitaker_suite@nightly-2025-09-18.so\"]" DYLINT_METADATA="null" DYLINT_NO_DEPS="0" RUSTC_WORKSPACE_WRAPPER="/home/runner/.dylint_drivers/nightly-2025-09-18/dylint-driver" RUSTUP_TOOLCHAIN="nightly-2025-09-18" "cargo" "check" "--target-dir" "/home/runner/work/wireframe/wireframe/target/dylint/target/nightly-2025-09-18" "--all-targets" "--all-features"

Stack backtrace:
   0: <anyhow::Error>::msg::<alloc::string::String>
   1: anyhow::__private::format_err
   2: <std::process::Command as dylint_internal::command::CommandExt>::success
   3: dylint::run_with_name_toolchain_map
   4: dylint::run
   5: cargo_dylint::main
   6: std::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core::result::Result<(), dylint::error::ColorizedError<anyhow::Error>>, core::result::Result<(), dylint::error::ColorizedError<anyhow::Error>>>
   7: std::rt::lang_start::<core::result::Result<(), dylint::error::ColorizedError<anyhow::Error>>>::{closure#0}
   8: std::rt::lang_start_internal
   9: main
  10: <unknown>
  11: __libc_start_main
  12: _start
make: *** [Makefile:51: lint] Error 1
Error: Process completed with exit code 2.

@coderabbitai

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

…offset

Replaced the match arms and conditional checks in fill_prefix_buffer with a single calculated offset and direct slice copy. This reduces code complexity and removes redundant debug assertions, improving readability and maintainability while preserving functionality.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
@leynos leynos changed the title Refactor nested conditionals in wireframe crate; ADR zero-copy docs Refactor fill_prefix_buffer and sequence tracking in wireframe Apr 14, 2026
codescene-delta-analysis[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
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/frame/conversion.rs`:
- Around line 37-47: Change fill_prefix_buffer to derive size from prefix.len()
and enforce the precondition with a debug_assert! instead of leaving a
debug_assert!(false) path or lint suppression: in function
fill_prefix_buffer(prefix: &[u8], endianness: Endianness) compute let size =
prefix.len(); add debug_assert!(matches!(size, 1 | 2 | 4 | 8), "prefix must be
1, 2, 4, or 8 bytes"); compute offset as before and call buf[offset..offset +
size].copy_from_slice(prefix); return buf; remove the #[expect(...)] suppression
and the unused size parameter, and update the call site (the caller that
currently passes size, referenced at the previous line 76) to call
fill_prefix_buffer(prefix, endianness) with the new signature.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: abe557a7-3110-40ea-b762-6d3ae7c8b923

📥 Commits

Reviewing files that changed from the base of the PR and between fec5561 and f60c7f0.

📒 Files selected for processing (2)
  • src/frame/conversion.rs
  • src/message_assembler/series.rs

Comment thread src/frame/conversion.rs Outdated
@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 14, 2026

@coderabbitai Please suggest a fix for the following concern and provide an AI coding agent prompt for the fix:

error: Multiple clusters of nested conditional logic in `assert_connection_aborted`.
Error:    --> tests/bdd/../fixtures/memory_budget_hard_cap.rs:226:12
    |
226 |        pub fn assert_connection_aborted(&mut self) -> TestResult {
    |  _____________^^^^^^^^^^^^^^^^^^^^^^^^^__________________________-
    | | _______________________________________________________________|
    | ||
227 | ||         self.spin_runtime()?;
228 | ||         match self.join_server()? {
229 | ||             Ok(()) => Err("expected connection to abort, but it completed successfully".into()),
...   ||
236 | ||                     .into());
237 | ||                 }
    | ||_- Complexity bump 2 spans 5 lines.
...   |
247 | |                      .into());
248 | |                  }
    | |__- Complexity bump 1 spans 7 lines.
    |
note: Detected 2 complexity bumps above the threshold 2.5.
   --> tests/bdd/../fixtures/memory_budget_hard_cap.rs:226:12
    |
226 |     pub fn assert_connection_aborted(&mut self) -> TestResult {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: Extract helper functions from the highlighted regions to reduce clustered complexity.
    = note: `-D bumpy-road-function` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(bumpy_road_function)]`

error: could not compile `wireframe` (test "bdd") due to 1 previous error
Error: 
Error: Compilation failed with toolchain `nightly-2025-09-18`

Caused by:
    command failed: env -u CARGO -u RUSTC CLIPPY_DISABLE_DOCS_LINKS="null" DYLINT_LIBS="[\"/home/runner/.local/share/whitaker/lints/nightly-2025-09-18/x86_64-unknown-linux-gnu/lib/libwhitaker_suite@nightly-2025-09-18.so\"]" DYLINT_METADATA="null" DYLINT_NO_DEPS="0" RUSTC_WORKSPACE_WRAPPER="/home/runner/.dylint_drivers/nightly-2025-09-18/dylint-driver" RUSTUP_TOOLCHAIN="nightly-2025-09-18" "cargo" "check" "--target-dir" "/home/runner/work/wireframe/wireframe/target/dylint/target/nightly-2025-09-18" "--all-targets" "--all-features"

Stack backtrace:
   0: <anyhow::Error>::msg::<alloc::string::String>
   1: anyhow::__private::format_err
   2: <std::process::Command as dylint_internal::command::CommandExt>::success
   3: dylint::run_with_name_toolchain_map
   4: dylint::run
   5: cargo_dylint::main
   6: std::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core::result::Result<(), dylint::error::ColorizedError<anyhow::Error>>, core::result::Result<(), dylint::error::ColorizedError<anyhow::Error>>>
   7: std::rt::lang_start::<core::result::Result<(), dylint::error::ColorizedError<anyhow::Error>>>::{closure#0}
   8: std::rt::lang_start_internal
   9: main
  10: <unknown>
  11: __libc_start_main
  12: _start
make: *** [Makefile:51: lint] Error 1

@coderabbitai

This comment was marked as resolved.

Removed the explicit size parameter from fill_prefix_buffer and instead infer size from the prefix slice length. Added debug assertions to validate prefix length and buffer slice correctness. Updated callers accordingly to streamline and clarify slice handling, improving code safety and readability.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
@leynos leynos changed the title Refactor fill_prefix_buffer and sequence tracking in wireframe Refactor fill_prefix_buffer and sequence-tracking to fix lint Apr 14, 2026
codescene-delta-analysis[bot]

This comment was marked as outdated.

…g verification logic

Extracted the inline budget-related abort verification from assert_connection_aborted into a dedicated verify_abort_outcome method. This helps improve test code clarity and reuse by validating error kind, draining late payloads, and checking no payloads are observed before abort.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
@leynos leynos changed the title Refactor fill_prefix_buffer and sequence-tracking to fix lint Refactor prefix buffer and sequence-tracking; ADRs & roadmap updates Apr 14, 2026
codescene-delta-analysis[bot]

This comment was marked as outdated.

…on architecture

Add detailed documentation of message continuation ordering in `src/message_assembler/series.rs`.

Describe the public API `validate_and_advance_sequence()` and its two private helpers, `handle_untracked_first_sequence()` and `advance_tracked_sequence()`, clarifying their roles in managing state transitions and validation rules.

This improves developer understanding of the sequence tracking design and aids future maintenance and refactoring.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
@leynos leynos changed the title Refactor prefix buffer and sequence-tracking; ADRs & roadmap updates Refactor fill_prefix_buffer to fix bumpy_road lint Apr 15, 2026
@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 15, 2026

@coderabbitai Have the following failed checks now been resolved?

If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures.

❌ Failed checks (2 warnings)

Check name | Status | Explanation | Resolution -- | -- | -- | -- Developer Documentation | ⚠️ Warning | Pull request introduces new internal APIs and architectural changes but developers-guide documents only layer terminology, ignoring the refactored sequence validation architecture and two helper functions lack rustdoc documentation. | Update docs/developers-guide.md to document message sequence validation architecture. Add rustdoc comments to handle_untracked_first_sequence and advance_tracked_sequence functions explaining their role in the validation flow.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
echo "=== docs/developers-guide.md (sequence-related content) ==="
grep -n "sequence\|series\|MessageSeries\|handle_untracked\|advance_tracked\|validate_and_advance" docs/developers-guide.md || echo "(no matches)"

echo ""
echo "=== docs/developers-guide.md (full) ==="
cat docs/developers-guide.md

echo ""
echo "=== src/message_assembler/series.rs (helper functions) ==="
sed -n '180,280p' src/message_assembler/series.rs

Length of output: 9495


@leynos: Yes, both sub-items of the Developer Documentation warning are now fully resolved.

  1. docs/developers-guide.md already contains a dedicated "## Message sequence validation architecture" section that describes the role of validate_and_advance_sequence and both private helpers, including the deliberate design rationale for the untracked-to-tracked split.

  2. src/message_assembler/series.rs already carries rustdoc on both helpers:

    • handle_untracked_first_sequence — documents the untracked-start transition and overflow semantics.
    • advance_tracked_sequence — documents duplicate/gap/overflow rejection and delegation intent.

No further work is needed for this check.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 15, 2026

@coderabbitai re:

Title check ⚠️ Warning The title 'Refactor fill_prefix_buffer to fix bumpy_road lint' is narrowly focused on a single internal refactor, but the PR scope is substantially broader: three ADRs, a comprehensive zero-copy roadmap, dozens of documentation updates, and roadmap renumbering across many files. Revise the title to reflect the actual primary scope—e.g. 'Plan zero-copy frame migration: ADRs 008–010 and docs realignment' or 'Add ADRs and zero-copy roadmap; refactor nested conditionals (Epic #284)'.

Please provide an accurate title and summary that I can paste in

@coderabbitai

This comment was marked as resolved.

@leynos leynos changed the title Refactor fill_prefix_buffer to fix bumpy_road lint Plan zero-copy frame migration: ADRs 008–010 and 16.x/17.x roadmap; refactor nested conditionals (Epic #284) Apr 15, 2026
@leynos leynos merged commit 3d0c6f9 into main Apr 15, 2026
6 checks passed
@leynos leynos deleted the migrate-vec-to-bytes-zero-copy-e6rl2o branch April 15, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant