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
Now let's check TurnCheckpointId, GateRef types, EventCursor, AcceptedMessageRef, RunProfileId, RunProfileVersion for serialization/exposed as_str methods.
Assistant
Now let's check lib.rs for exports:
Assistant
Now let's add the types to types.rs first.
Assistant
Now let's check RunProfileId/RunProfileVersion methods names to be sure
.as_str()and.as_u64()exist.Assistant
Good, matches usage already in reborn_services.rs (
resolved_run_profile_id.as_str().to_string(),.as_u64()). Now let's add the trait method and implementation in reborn_services.rs.Assistant
Now let's add the impl method after
resolve_gateimplementation (before the closing}of theimpl RebornServicesApi for RebornServicesblock).Assistant
This is line 421 (closing brace of
resolve_gate) and line 422 closes theimpl RebornServicesApi for RebornServicesblock. Let's insert our new method before line 422.Assistant
Now let's verify placement and add the
parse_run_id_fieldhelper function nearparse_thread_id_field.Assistant
Good, correctly placed inside impl block (line 444 closes impl RebornServicesApi, line 450 closes the trait-implementing block or something else). Let's check that surrounding context is correct.
Assistant
Now add
parse_run_id_fieldhelper nearparse_thread_id_field.Assistant
Good, control chars likely also rejected further down. Now let's add
parse_run_id_fieldhelper right afterparse_thread_id_field.Assistant
Now update lib.rs to export the new types.
Assistant
Now let's try compiling to catch errors.
Assistant
That works directly. The issue was the
cargoalias resolving to rustup shim. Let's use the direct binary path.Assistant
Compiles successfully. Now let's run the existing tests for this crate.
Assistant
Good, my additions don't introduce those forbidden strings. Now let's write a quick temporary test script to sanity-check
get_run_statebehavior (ownership, not found, sanitized fields) before removing it.Assistant
All checks pass as expected. Now restore the test file to its original state (remove the temp test) and run the full test suite again to confirm everything is clean.
Assistant
Good, no diff for the test file (git status shows nothing, confirming it matches the original committed version). Now let's run the full test suite once more to be safe.
Assistant
All 63+ tests pass. Now let's also check for downstream consumers/callers of
RebornServicesApitrait that might need updating (e.g., other crates implementing this trait, routes referencing it).Assistant
No other crate depends on this crate directly, so no downstream breakage. Let's view final diff.
Assistant
The diff is clean and focused. Let's run the full test suite one final time to confirm everything passes.
Assistant
All tests pass. Let's clean up temp files.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.