Skip to content

Refactor module and crate responsibility boundaries - #28

Merged
JedimEmO merged 36 commits into
masterfrom
refactor/responsibility-boundaries
Sep 5, 2026
Merged

Refactor module and crate responsibility boundaries#28
JedimEmO merged 36 commits into
masterfrom
refactor/responsibility-boundaries

Conversation

@JedimEmO

@JedimEmO JedimEmO commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Large macro, transport, identity, and example modules mixed parsing, policy, runtime lifecycle, rendering, and tests. This change assigns those responsibilities to focused modules while preserving public import paths, generated APIs, protocol ordering, and serialized output.

  • Separate REST/JSON-RPC parsing, server generation, and specification emission; split file-service generation by responsibility.
  • Add ras-api-explorer-assets as an explicit dependency of both macros. Its source fragments assemble to the original byte-identical HTML.
  • Separate auth/session/OAuth2 policy, HTTP helpers, and WebSocket contracts, builders, drivers, and scenario tests. Observability core now depends directly on http.
  • Give chat one production application constructor, used by integration fixtures, and separate WASM UI state/actions from rendering.
  • Preserve existing test inventories and add a production-router chat test and a browser task-flow regression. A pre-existing CSS-token panic discovered during browser validation is fixed in its own checkpoint.

All work is in this MR, with each checkpoint verified before the next extraction. See the execution record and accepted plan. Optional demo cleanups and the breaking bidirectional adapter crate move remain deferred.

Validation: hosted workspace tests pass all 927 tests without retries (one existing ignored), plus doctests. Format, Clippy, rustdoc, feature matrix, generated specs, documentation, supply-chain checks, and 11 explorer browser tests pass. Local validation additionally passes the WASM browser task flow, packaged/unpacked macro builds, and exact explorer-byte comparison.

The full local run at default parallelism still intermittently fails in identity/Argon2 tests, including failures observed before refactoring. A fresh build reproduces this; all 927 tests pass locally at four-worker concurrency and in hosted CI without retries. Host/kernel faults were observed, but the cause remains unconfirmed. No skips or crypto changes mask these failures.

Comment-cleanup PR #27 is merged, and this branch includes the updated master. The diff contains only the refactor work. No workflow changes are included. The additional WASM browser test has a documented local command.

@JedimEmO
JedimEmO changed the base branch from docs/comment-cleanup to master September 5, 2026 10:16
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Test coverage (lines)

Total: 92.39% (-0.32 vs base) — 14931/16161 lines

Crate Lines Coverage Δ
crates/core/ras-auth-core 750/824 91.02% -2.01
crates/core/ras-identity-core 113/113 100.00% ±0.00
crates/core/ras-observability-core 97/97 100.00% ±0.00
crates/core/ras-transport-core 497/534 93.07% ±0.00
crates/core/ras-version-core 90/90 100.00% ±0.00
crates/identity/ras-identity-local 123/130 94.62% +2.57
crates/identity/ras-identity-oauth2 856/895 95.64% -1.86
crates/identity/ras-identity-session 378/436 86.70% -6.95
crates/observability/ras-observability-otel 115/115 100.00% ±0.00
crates/rest/ras-file-core 281/360 78.06% ±0.00
crates/rest/ras-file-macro 1163/1300 89.46% +0.07
crates/rest/ras-rest-core 153/153 100.00% ±0.00
crates/rest/ras-rest-macro 1545/1673 92.35% +0.22
crates/rpc/bidirectional/ras-jsonrpc-bidirectional-client 1033/1092 94.60% +5.23
crates/rpc/bidirectional/ras-jsonrpc-bidirectional-macro 453/494 91.70% ±0.00
crates/rpc/bidirectional/ras-jsonrpc-bidirectional-server 1861/2064 90.16% -2.10
crates/rpc/bidirectional/ras-jsonrpc-bidirectional-types 357/373 95.71% +1.67
crates/rpc/ras-jsonrpc-core 92/97 94.85% ±0.00
crates/rpc/ras-jsonrpc-macro 961/1046 91.87% +0.37
crates/rpc/ras-jsonrpc-types 168/168 100.00% ±0.00
crates/specs/ras-api-explorer-assets 42/42 100.00% new
crates/specs/ras-openrpc-types 3672/3857 95.20% ±0.00
crates/specs/ras-permission-manifest 131/208 62.98% ±0.00
Files with coverage drops ≥ 1 point
File Coverage Δ
rust-api-stack/crates/rest/ras-rest-macro/src/lib.rs 83.33% -7.26
rust-api-stack/crates/rpc/ras-jsonrpc-macro/src/lib.rs 83.33% -2.35
rust-api-stack/crates/identity/ras-identity-oauth2/src/provider.rs 95.92% -1.92

@JedimEmO
JedimEmO marked this pull request as ready for review September 5, 2026 10:27
JedimEmO and others added 5 commits September 5, 2026 12:36
Move the style and script wrapper tags out of the asset files into the
assembler so each file is valid CSS, JavaScript, or HTML on its own and
whitespace normalization by editors cannot break the served page. Export
the configuration placeholder as a constant and use it from both macros.
Add unit tests for the placeholder, document structure, and script order.
List the crate in the README and changelog.

The served explorer differs from before only by one blank line before
the closing script tag.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hgg3oKtpBsZ6DC6T1KEnsT
The spec was ignored by the default Playwright config and its CI step had
been dropped, leaving the CSS-token regression test manual-only. Run it
after the bundle build and upload results on failure. Open and close the
task detail panel explicitly in the spec instead of relying on the
checkbox click bubbling to the card.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hgg3oKtpBsZ6DC6T1KEnsT
Use ChatServiceClientBuilder from the chat API crate instead of the
axum-test ws feature, which had pulled a third tungstenite version into
the lockfile. The test now exercises the production client handshake,
header auth, and typed dispatch against the real router. Update the
refactor record for the explorer and CI follow-ups.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hgg3oKtpBsZ6DC6T1KEnsT
The workspace pinned 0.26 while Axum 0.8 pulled 0.29, so every build
carried two copies of tungstenite and tokio-tungstenite. Move the pin to
0.29. No source changes were needed; bidirectional, chat, and WASM
client builds and tests pass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hgg3oKtpBsZ6DC6T1KEnsT
@JedimEmO
JedimEmO merged commit 15404c3 into master Sep 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant