Skip to content

Design protocol-agnostic wireframe_testing harness lifecycle - #614

Open
leynos wants to merge 5 commits into
mainfrom
agent/protocol-agnostic-testing-harness-design
Open

Design protocol-agnostic wireframe_testing harness lifecycle#614
leynos wants to merge 5 commits into
mainfrom
agent/protocol-agnostic-testing-harness-design

Conversation

@leynos

@leynos leynos commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • add RFC 0001 for a protocol-agnostic wireframe_testing server lifecycle
  • extend the canonical roadmap with implementation items 17.3.3 through 17.3.5
  • index the RFC and update the testing-helper description

Why

The existing WireframePair is a useful convenience for Wireframe's default client, but it fixes the client codec, preamble typestate, and builder return type. It also constructs the server internally. Downstream protocols therefore cannot combine the shared listener, readiness, task ownership, and shutdown machinery with their own codec, typed preamble, server hooks, or client.

The mxd behavioural-harness design in leynos/mxd#401 supplies the first concrete downstream case. It needs Hotline framing and a Hotline preamble while retaining Wireframe's real loopback server lifecycle.

The review also found a separate release-quality gap: the workspace's default member and current Make targets do not execute the companion crate's tests and doctests explicitly. Issue #578 records resulting doctest drift.

Proposed design

The RFC introduces three layers:

  1. spawn_wireframe_server and spawn_wireframe_server_on accept a fully configured, unbound WireframeServer and return a non-generic RunningWireframeServer after listener binding and readiness.
  2. spawn_wireframe_server_and_connect composes that handle with any caller-supplied asynchronous client connector and cleans up the server when connection fails.
  3. The existing concrete WireframePair, spawn_wireframe_pair, and spawn_wireframe_pair_default APIs remain source-compatible convenience wrappers for the default client.

The running handle owns bounded, idempotent shutdown and task joining. The connector returns the caller-owned protocol client separately because an arbitrary client may require asynchronous logout, ordinary drop, or no explicit close operation.

The RFC also requires package-specific all-feature tests and doctests in local and Continuous Integration quality gates before publishing the extension.

Roadmap

Compatibility

This is a design-only, additive proposal. It changes no Rust code and does not deprecate the existing pair helpers.

Validation

The three changed Markdown files pass:

npx --yes markdownlint-cli2@0.22.1 \
  docs/rfcs/0001-protocol-agnostic-test-harness-lifecycle.md \
  docs/contents.md \
  docs/roadmap.md

Result: 0 errors.

The review-feedback commit was additionally gated in a local checkout. make check-fmt, make typecheck, make test, make markdownlint, and make nixie all pass. make lint reports pre-existing no_expect_outside_tests findings in test-support helpers (for example src/client/tests/helpers.rs, src/client/tests/request_hooks.rs) that are untouched by this branch and identical on main; main's tip passed CI with the same pinned whitaker 0.2.6, so these are a local whitaker toolchain/staging drift rather than a regression introduced here. Fixing them belongs to the whitaker test-wave rollout, not this documentation-only change.

Review feedback addressed

  • Marked the schematic Rust blocks in RFC 0001 ignore so the RFC no longer advertises bodyless declarations as compilable no_run examples.
  • Rewrote the docs/contents.md "Testing helpers" entry to describe the implemented in-process server and client pair helpers.
  • Required an explicit trybuild compile-time UI test and proptest-based coverage of the shutdown, readiness, and concurrent-handle invariants; reflected both in roadmap items 17.3.3/17.3.4.
  • Skipped the suggested [pair-plan] change to 12-3-2-…: only 17-3-2-in-process-server-and-client-pair-test-harness.md exists, so the current reference is correct and the proposed target would break the link.

Open implementation questions

  • whether the first release needs a compact readiness and shutdown timeout options type
  • whether simultaneous connector and cleanup failures justify a structured TestError variant rather than a contextual message

References

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @leynos, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Document RFC 0001, proposing a protocol-agnostic server lifecycle API, connector helper, compatibility wrappers, verification plan, and roadmap entries for wireframe_testing.

Changes

Test harness lifecycle RFC

Layer / File(s) Summary
RFC scope and current limitations
docs/rfcs/0001-protocol-agnostic-test-harness-lifecycle.md
Read the RFC context, current client_pair constraints, lifecycle goals, and existing spawn flow.
Running server lifecycle contract
docs/rfcs/0001-protocol-agnostic-test-harness-lifecycle.md
Review the proposed running server handle, listener setup, readiness signalling, shutdown semantics, and startup failure rules.
Connector composition and pair compatibility
docs/rfcs/0001-protocol-agnostic-test-harness-lifecycle.md
Trace caller-supplied connector behaviour, cleanup on connection failure, and preservation of existing pair helpers.
Verification and adoption plan
docs/rfcs/0001-protocol-agnostic-test-harness-lifecycle.md, docs/roadmap.md, docs/contents.md
Check the proposed tests, quality gates, migration plan, open questions, roadmap items, and documentation index updates.

Suggested labels: Roadmap, Issue

Poem

Servers wake, then gently rest,
Connectors bring each protocol guest.
RFC pages mark the way,
Roadmaps chart the coming day.
Tests stand ready, bright and keen.

🚥 Pre-merge checks | ✅ 16 | ❌ 4

❌ Failed checks (4 warnings)

Check name Status Explanation Resolution
Developer Documentation ⚠️ Warning The RFC and roadmap capture the new lifecycle design, but docs/developers-guide.md never documents RunningWireframeServer or the new spawn_wireframe_server boundary. Add a developers-guide section for the new test-harness lifecycle and helper APIs, then keep the roadmap/execplan state aligned with the documented phase.
Testing (Property / Proof) ⚠️ Warning The RFC adds idempotent shutdown, readiness, and cleanup invariants but only recommends rstest/BDD integration tests; it never recommends property-based or exhaustive proof coverage. Add property-based tests (e.g. proptest) for shutdown/readiness/orderings, and reserve an exhaustive proof for any genuine lemma or proof assumption; keep ordinary tests as supplements.
Testing (Compile-Time / Ui) ⚠️ Warning The RFC only asks for generic compile-time coverage; it never names trybuild/UI snapshots, despite the repo already using trybuild for compile-fail checks. Add an explicit trybuild (or equivalent) UI test for the compile-time coverage, and recommend focused snapshots or semantic assertions for lifecycle/error text.
Title check ⚠️ Warning The title matches the new protocol-agnostic harness RFC, but it omits the required roadmap reference. Add the roadmap item reference, e.g. "(17.3.3-17.3.5)", to satisfy the execplan title rule.
✅ Passed checks (16 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Testing (Overall) ✅ Passed Docs-only PR: the diff against origin/main touches only markdown files, with no executable code or behavioural changes to test.
User-Facing Documentation ✅ Passed PASS: This PR is documentation-only and adds no new user-facing behaviour; docs/users-guide.md already covers the existing wireframe_testing::client_pair harness.
Module-Level Documentation ✅ Passed The PR changes only Markdown docs under docs/; no code modules were touched, so the module-level docstring check is not applicable.
Testing (Unit And Behavioural) ✅ Passed PASS: The PR only updates docs/roadmap with future testing work; no executable code or tests were added, so the unit/behavioural test rule is not applicable.
Unit Architecture ✅ Passed PASS: The PR is docs-only and the RFC keeps commands, queries, fallible shutdown, and injectable connectors separate.
Domain Architecture ✅ Passed PASS: The PR only changes docs, and the RFC keeps lifecycle APIs test-only, explicitly not moving them into the production crate surface.
Observability ✅ Passed Docs-only changes; no runtime code or operational paths changed, so observability instrumentation is not required.
Security And Privacy ✅ Passed Pass: the added docs only describe APIs and roadmap items; no secrets, credentials, auth gaps, or sensitive data appear.
Performance And Resource Use ✅ Passed Treat this as PASS: only documentation changed; no executable hot-path code or resource-usage behaviour changed.
Concurrency And State ✅ Passed RFC 0001 makes ownership, shutdown, cleanup, and parallel-handle isolation explicit, and it lists interleaving tests for cancellation, failure, and concurrent handles.
Architectural Complexity And Maintainability ✅ Passed PASS: The RFC justifies the new lifecycle seam with a concrete mxd downstream use case, preserves the concrete pair façade, and keeps boundaries explicit.
Rust Compiler Lint Integrity ✅ Passed Docs-only change touched docs/roadmap.md; no Rust sources, lint suppressions, or clone sites were introduced or altered.
Description check ✅ Passed The description matches the documentation-only RFC, roadmap, and contents updates in the changeset.
✨ 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 agent/protocol-agnostic-testing-harness-design

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

codescene-access[bot]

This comment was marked as outdated.

@codescene-access codescene-access Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No quality gates enabled for this code.

@leynos
leynos force-pushed the agent/protocol-agnostic-testing-harness-design branch from 55ec0d9 to a3174c0 Compare July 26, 2026 00:31
@leynos
leynos marked this pull request as ready for review July 26, 2026 00:31

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @leynos, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

codescene-access[bot]

This comment was marked as outdated.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a3174c00e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +153 to +154
pub fn local_addr(&self) -> SocketAddr;
pub async fn shutdown(&mut self) -> TestResult<()>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make the advertised Rust API example compile

When a reader or future doctest compiles this rust,no_run block, Rust rejects these bodyless methods and the bodyless free functions below because declarations ending in ; are not permitted in inherent impl blocks or at module scope; no_run prevents execution but still requests compilation. Add placeholder bodies such as unimplemented!() or mark the deliberately schematic block as ignored/plaintext so the RFC does not advertise invalid Rust as a compilable example.

AGENTS.md reference: AGENTS.md:L27-L30

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/contents.md`:
- Around line 89-90: Update the “Testing helpers” entry in docs/contents.md to
describe the implemented in-process server and client pair helpers provided by
the wireframe_testing companion crate, replacing the proposal-oriented “Design
and public API” wording.

In `@docs/rfcs/0001-protocol-agnostic-test-harness-lifecycle.md`:
- Around line 14-15: Update the [pair-plan] reference in the RFC to target
12-3-2-in-process-server-and-client-pair-test-harness.md instead of the
incorrect 17-3-2 document.
- Around line 1-466: Reduce RFC 0001 below the repository’s 400-line Markdown
limit by moving detailed verification and release-sequencing content from
sections “7. Verification plan” and “8. Migration and release sequencing” into
cohesive supporting documentation, while retaining only the essential
requirements and recommendation in the RFC. Update any affected references so
the shortened RFC remains coherent.
🪄 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 Plus

Run ID: 85b5b7dd-5f78-42d7-85f7-5eca469f1f4c

📥 Commits

Reviewing files that changed from the base of the PR and between aa8aa93 and a3174c0.

📒 Files selected for processing (3)
  • docs/contents.md
  • docs/rfcs/0001-protocol-agnostic-test-harness-lifecycle.md
  • docs/roadmap.md
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • leynos/rust-prover-tools (auto-detected)
  • leynos/shared-actions (auto-detected)
  • leynos/whitaker (auto-detected)

Comment thread docs/contents.md Outdated
Comment on lines +89 to +90
- [Testing helpers](wireframe-testing-crate.md) Design and public API for the
`wireframe_testing` companion crate.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Describe wireframe_testing as an existing companion crate.

Replace “Design and public API” with a description of the implemented in-process testing helpers. The current wording makes the entry sound like a proposal rather than a usable companion crate.

Proposed wording
-- [Testing helpers](wireframe-testing-crate.md) Design and public API for the
-  `wireframe_testing` companion crate.
+- [Testing helpers](wireframe-testing-crate.md) In-process server and client
+  pair helpers provided by the `wireframe_testing` companion crate.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/contents.md` around lines 89 - 90, Update the “Testing helpers” entry in
docs/contents.md to describe the implemented in-process server and client pair
helpers provided by the wireframe_testing companion crate, replacing the
proposal-oriented “Design and public API” wording.

Source: MCP tools

Comment thread docs/rfcs/0001-protocol-agnostic-test-harness-lifecycle.md
Comment on lines +14 to +15
<!-- markdownlint-disable-next-line MD013 -->
[pair-plan]: ../execplans/17-3-2-in-process-server-and-client-pair-test-harness.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the execution-plan reference.

Point [pair-plan] at the existing 12-3-2-in-process-server-and-client-pair-test-harness.md document; the current 17-3-2 target does not match the repository’s execution-plan path.

Proposed fix
-[pair-plan]: ../execplans/17-3-2-in-process-server-and-client-pair-test-harness.md
+[pair-plan]: ../execplans/12-3-2-in-process-server-and-client-pair-test-harness.md
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/rfcs/0001-protocol-agnostic-test-harness-lifecycle.md` around lines 14 -
15, Update the [pair-plan] reference in the RFC to target
12-3-2-in-process-server-and-client-pair-test-harness.md instead of the
incorrect 17-3-2 document.

Source: MCP tools

Mark the schematic Rust blocks in RFC 0001 as `ignore` so the RFC no longer
advertises bodyless declarations as compilable `no_run` examples. Strengthen
the verification plan: require an explicit `trybuild` compile-time UI test for
the retained pair helpers and misconfigured lifecycle calls, and add
`proptest`-based coverage for the shutdown-idempotence, readiness, and
concurrent-handle invariants, reserving exhaustive proof for genuine lemmas.

Rewrite the `docs/contents.md` "Testing helpers" entry to describe the
implemented in-process server and client pair helpers rather than a proposal.
Reflect the new property and compile-time test requirements in roadmap items
17.3.3 and 17.3.4.

The suggested [pair-plan] change to `12-3-2-...` is skipped: only
`17-3-2-in-process-server-and-client-pair-test-harness.md` exists, so the
current reference is correct and the proposed target would break the link.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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