feat: expose Uhura as a reusable framework host - #9
Conversation
WalkthroughThe PR introduces ChangesUnified host runtime
Integrated authority discovery
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 `@crates/uhura-cli/src/cmd/dev.rs`:
- Around line 99-103: Replace the unbounded std::thread::spawn loop in the
incoming_requests handling with a bounded executor that limits concurrent
request work. Add an explicit cap for long-lived SSE sessions so persistent
responses cannot consume all worker capacity, while preserving the existing
respond(request, &host) behavior for accepted requests.
In `@crates/uhura-host/src/lib.rs`:
- Around line 868-953: The index_asset_references scanner must parse actual HTML
start-tag attributes rather than matching src= or href= in arbitrary text such
as comments or inline JavaScript. Track HTML tag boundaries and only extract
these attribute names within start tags, while preserving existing asset
validation; add regression tests covering inline content and comments containing
src/href assignments.
- Around line 1149-1156: Decode each incoming web or Wasm URL path exactly once
and validate its decoded path segments before lookup. Apply this to the
application and Wasm route handling around serve_file_map and the corresponding
handlers near the other affected locations, while preserving the existing
PlayAsset behavior and error mapping.
- Around line 1115-1139: Update the request handling around api_route,
event_method_error, and all byte-producing responses so every HEAD response has
its body removed, including 404, 503, and the early 405 SSE response. Centralize
this finalization step for all responses while preserving the status, headers,
and other metadata that the corresponding GET response would return.
🪄 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: CHILL
Plan: Pro
Run ID: a296305e-4473-4b79-826c-bb3ff8fa3d28
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (11)
Cargo.tomlcrates/uhura-cli/Cargo.tomlcrates/uhura-cli/src/cmd/dev.rscrates/uhura-cli/src/cmd/mod.rscrates/uhura-cli/src/cmd/trace.rscrates/uhura-host/Cargo.tomlcrates/uhura-host/src/lib.rscrates/uhura-host/src/source.rsexamples/instagram-uhura/README.mdexamples/instagram-uhura/providers/spock.test.tsexamples/instagram-uhura/providers/spock.ts
💤 Files with no reviewable changes (1)
- crates/uhura-cli/src/cmd/mod.rs
Summary
uhura-hostlibrary from the standalone CLIuhura-clias the independent contributor/subsystem entrypoint over the same host boundaryBoundary preserved
This is operational composition, not a language merger. Uhura owns client experience behavior and non-authoritative UI-session state; Spock remains the authority for durable facts, policy, and mutations. The reusable host does not bind a mandatory listener or absorb Spock semantics.
Companion framework integration: gridaco/spock#15. It consumes this branch through the existing submodule boundary.
Review hardening
503/Retry-Afteroverload behaviorHEADfinalization while preserving GET metadata and exactContent-Lengthfor byte responsesVerification
cargo fmt --all -- --checkcargo clippy --locked --workspace --all-targets -- -D warningscargo test --locked --workspace --all-targetspnpm -C web check(typecheck, lint, production builds, browser/provider tests)fmt --check,check --deny-warnings, andtraceCodeRabbit's four actionable threads are addressed and resolved; its incremental review reported no new actionable comments.