ISSUE DESCRIPTION [Reborn WebUI Beta] Implement the RebornServices submit, cancel,…
- User
ISSUE DESCRIPTION
[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.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository using command. Additionally, you can use and to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call ) using or commands. However you don't need to use or before submitting your changes. In fact, only submits currently unstaged changes because it uses to get the changes that need to be submitted. - Assistant
I'll start by exploring the repository structure and the existing reborn_services module to understand what's already implemented and what needs to be added.
- Assistant
I'll inspect the existing reborn_services implementation, types, tests, and related M3 contracts.
- Assistant
The first half of the facade is already there; next I'll read the rest of the module and the contract tests.
- Assistant
Next I'll inspect helpers, the contract tests for run-state expectations, and the M3 TurnCoordinator API.
- Assistant
I'll keep digging into remaining helpers, TurnRunState DTO shapes, and full contract tests with grep.
- Assistant
I'll examine TurnRunState, WebUI inbound types, and any docs or TODOs about the get_run_state facade.
- Assistant
I'll search git history, tracker notes, and failure/DTO types for the expected
get_run_stateshape. - Assistant
There's a commit about RebornServices. Let me look at more recent commits related to this and any uncommitted work / task trackers.
- Assistant
Let me look at the CLAUDE.md for product_workflow and AGENTS.md for hints about what needs to be done.
- Assistant
I'll check related managers/types and full contract tests to mirror the expected API.
- Assistant
I'll check the deleted
WebUiServicefor a priorget_run_stateshape and inspectSanitizedFailure. - Assistant
Let me look at the original WebUiService at commit before deletion for get_run_state.
- Assistant
I'll Inspect validation helpers and TurnCheckpointId serialization to design the DTO mapping.
- Assistant
I'll implement the get_run_state types and facade method,and export them from the crate.
- Assistant
I'll add the new types to types.rs and update the facade.
- Assistant
Now add the request/response structs at the end of the file.
- Assistant
I'll append the new types after RebornResolveGateResponse.
- Assistant
I introduced a duplicate
Cancelledvariant — fixing that now. - Assistant
Updating the facade module next: exports, trait method, and implementation.
- Assistant
I'll update the exports and trait, then add the implementation after resolve_gate.
- Assistant
Next I'll insert the
get_run_stateimplementation right afterresolve_gate. - Assistant
Let meread lines 340-440
- Assistant
I'll insert get_run_state before the closing brace of the impl.
- Assistant
Next I'll drop the stray comment and add the
parse_run_id_fieldhelper. - Assistant
There's a duplicate closing brace — cleaning that up.
- Assistant
I'll add
parse_run_id_fieldnext to the thread-id parser and updatelib.rsexports. - Assistant
Let me read those lines and insert parse_run_id_field.
- Assistant
I used саме word length issue.
- Assistant
I'll check how ThreadId validates input.
- Assistant
I'll add parse_run_id_field with proper QR validation.
- Assistant
I need to fix a syntax typo in the
parse_run_id_fieldsignature. - Assistant
Updating public re-exports in
lib.rsnext. - Assistant
I'll verify type exports and that GateRef is available, then compile.
- Assistant
I'll update the ownership helper docs, then compile the crate.
- Assistant
Compiling and running the product_workflow tests to verify the facade.
- Assistant
Rust isn't configured yet — I'll set up the toolchain next.
- Assistant
Need to set RUSTUP_TOOLCHAIN or default.
- Assistant
I'll write a temporary script to exercise
get_run_statecovering ownership, validation, and sanitized DTO fields. - Assistant
I'll run the temporary example to validate behavior.
- Assistant
Cleaning up the temporary example and running the full package test suite.
- Assistant
Reviewing the full diff before submit.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.