Untitled conversation
- User
[Reborn WebUI Beta] Implement the RebornServices submit, cancel, resolve-gate, and run-state facade methods
Parent tracker: #3607 Module: M2 — Native Product Workflow / Inbound Facade Priority: P0
Provide one stable facade that WebUI routes can use to submit turns, cancel runs, resolve gates, and read current run state without importing TurnCoordinator, HostRuntime, dispatchers, run-state stores, or database stores.
The facade must call TurnCoordinator only through the published M3 contract, enforce authenticated thread ownership, validate identifiers and token fields, preserve idempotent replay behavior, map canonical requests correctly, and return sanitized M2 errors.
get_run_stateis required. It must return a stable WebUI DTO containing the run ID, status, event cursor, accepted message reference, resolved run-profile ID and version, and optional gate, failure, and checkpoint data. It must not expose internal scopes, binding references, model routes, or raw internal failures.Evaluation contract
The facade must implement submit, cancel, gate resolution, and
get_run_statethrough the published turn facade without importing forbidden runtime/store dependencies. Validate UUIDs, non-empty client action and credential references, and reject control characters in token fields. Enforce authenticated thread ownership and hide cross-user existence as stableNotFound/HTTP 404 responses; malformed requests use stable sanitizedInvalidRequest/HTTP 400 responses. Preserve idempotent replay and canonical request mappings.get_run_statemust return the documented sanitized DTO, including cursor, accepted-message, resolved-profile, gate, failure, and checkpoint fields, without exposing M3 scopes, binding references, routes, or raw failures.Interface
Type: Struct Name: RebornGetRunStateRequest Path: crates/ironclaw_product_workflow/src/reborn_services/types.rs Public API: pub thread_id: String, pub run_id: String Description: WebUI request identifying the owned thread and run whose current state must be returned.
Type: Struct Name: RebornGetRunStateResponse Path: crates/ironclaw_product_workflow/src/reborn_services/types.rs Public API: run_id, status, event_cursor, accepted_message_ref, resolved_run_profile_id, resolved_run_profile_version, gate_ref, failure, checkpoint_id Description: Stable sanitized WebUI DTO for the current run state. It must not expose internal turn scope, binding references, or model-routing details.
- Assistant
Now let me check the existing tests for this facade:
- Assistant
Now I have everything I need. Let me implement. First, the DTOs in
types.rs: - Assistant
Now make the validation helpers in
webui_inbound.rsreusable by the facade: - Assistant
Now add the
get_run_statetrait method and implementation inreborn_services.rs: - Assistant
Now the implementation, right after
resolve_gate: - Assistant
Now update the
lib.rsre-exports: - Assistant
Now compile:
- Assistant
Now add the contract tests before the forbidden-dependencies test:
- Assistant
All 21 tests pass. Now run the full crate test suite, fmt, and clippy:
- Assistant
Clippy is clean. Since I added a method to the
RebornServicesApitrait, verify the whole workspace still compiles: - Assistant
The pre-existing warning is unrelated to my changes. Finally, update the crate's CLAUDE.md to keep the facade description accurate:
- Assistant
All green. The
get_run_statefacade method is implemented and the full submit / cancel / resolve-gate / run-state surface is now complete onRebornServicesApi.Summary of changes
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.