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
Let's see the truncated middle part (lines 257-514) to understand cancel_run, resolve_gate implementations already present.
Assistant
So RebornGetRunStateRequest/Response don't exist yet - need to create them. Let's inspect TurnRunState structure and the test file for context/expected DTO shape.
Assistant
Now let's look at the reborn_services_contract.rs test to understand expected API/DTO usage patterns, and webui_inbound.rs for validation utilities and command structures.
Assistant
Now let's check
TurnRunStatefields again and add imports, then append new types.Assistant
Now let's edit types.rs to add the new request/response structs and conversion.
Assistant
sed multi-line didn't do anything (fine, my earlier edit already applied). Now add TurnCheckpointId to import list.
Assistant
Now let's check
RunProfileVersion::as_u64exists, andGateRef::as_str.Assistant
Good,
GateRef::as_str()exists. Now update reborn_services.rs: add trait method, implementation, imports, and helper function.Assistant
Now add the trait method declaration to
RebornServicesApi:Assistant
Now add the implementation in the
impl RebornServicesApi for RebornServicesblock, right afterresolve_gate's implementation ends (before the closing}of the impl block).Assistant
Now insert
get_run_stateimplementation before line 421 (the}that closes theresolve_gatefunction, right before}that closes theimplblock on line 422).Assistant
Now add
parse_run_id_fieldhelper nearparse_thread_id_field:Assistant
Now let's update the crate's
lib.rsto re-export new types.Assistant
Now let's try compiling the crate.
Assistant
Compiles cleanly. Let's run tests for the crate, including the existing contract test.
Assistant
Good - our new code doesn't reference any of these. Now let's write a quick manual test script to verify
get_run_stateworks end-to-end (since no existing test exercises it), to be thorough.Assistant
All checks pass. Now clean up temp test file and run full test suite once more.
Assistant
All tests pass. Let's check
git status/git diffto review the final changes and ensure nothing stray remains.Assistant
Good, only intended files changed. Let's view full diff for final review.
Assistant
This looks complete and clean. Let's run the whole workspace's related test suites once more to make sure nothing else broke (e.g., anything depending on the public API that we changed).
Assistant
No other crate depends on
ironclaw_product_workflow, so no downstream compilation is affected. Let's do a final full crate test run and a workspace-widecargo checkscoped to affected crate to be safe.Assistant
All good. Now let's go through the checklist.
Checklist review:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.