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 look at webui_inbound.rs for existing request types (WebUiCancelRunRequest, WebUiResolveGateRequest) to mimic style for a new WebUiGetRunStateRequest maybe, and check TurnRunState struct definition.
Assistant
Now update reborn_services.rs: exports, trait method, impl, and helper functions.
Assistant
Now add implementation of get_run_state inside
impl RebornServicesApi for RebornServicesblock, right after resolve_gate closing.Assistant
Now insert get_run_state implementation before line 421 closing (the
}that ends resolve_gate fn, followed by}ending impl block). Let's insert after line 420 (before impl closing brace at line 421... need exact line numbers).Assistant
Line 421 closes resolve_gate fn, line 422 closes the impl block. I'll insert new method between lines 421 and 422.
Assistant
I need to use the terminal-based
editcommand properly, opening file first.Assistant
Now file is open. Let's use edit command on line 421.
Assistant
Good, that's correct. Now add
parse_run_id_fieldhelper function nearparse_thread_id_field, and addRebornGetRunStateRequest, RebornGetRunStateResponseimport inuse crate::{...}if needed (types module already imported viapub use types::{...}, but internal code uses these types unqualified since same module).Assistant
I need to fix this properly. Let me rewrite lines 591-613 cleanly.
Assistant
Good, that's fixed now. Just missing blank line between
parse_run_id_fieldandaccepted_message_ref, minor style but fine. Let's add blank line for cleanliness.Assistant
Fine as is (just no blank line between two functions but that's a purely stylistic issue). Now let's check use statement for RebornGetRunStateRequest and RebornGetRunStateResponse aren't imported anywhere else needed (they're defined via
pub use types::{...}at top, so within module scope they're accessible without full path). Let's build now.Assistant
Good, cargo works directly now (rustup was confused but direct paths work).
Assistant
Compiles fine. Now update lib.rs exports.
Assistant
Now let's double check the
fakes.rsmodule — maybe it implements RebornServicesApi trait for test fakes, which would need updating too.Assistant
No other implementers. Now build again and run tests.
Assistant
Now run the test suite for this crate, including existing contract tests.
Assistant
All existing tests pass. Now let's write a temporary test script to validate
get_run_statebehavior end-to-end (cross-user rejection, successful sanitized DTO, no forbidden fields).Assistant
All scratch tests pass, confirming the implementation works correctly. Now clean up the scratch test file and run full crate test suite once more.
Assistant
All pass. Let's verify no forbidden dependency strings crept into reborn_services.rs and double check the diff.
Assistant
Let's fix the missing blank line for style consistency.
Assistant
Now let's rebuild and rerun tests to confirm everything is still fine.
Assistant
All tests still pass. Let's also run cargo check on the broader workspace to ensure downstream crates (e.g., ironclaw_reborn_composition) that might reference
RebornServicesApistill compile.Assistant
Only used within this crate — no downstream implementers to break. Let's also run cargo fmt check to ensure code style consistency (optional but good practice), and clippy for this crate.
Assistant
Let's apply fmt.
Assistant
Now let's run clippy for good measure.
Assistant
Clippy passes with no warnings for this crate. Let's view the final diff to confirm everything looks clean.
Assistant
Clean — only the intended source changes remain, and the temporary scratch test file has been removed. Let's run the full crate test suite once more as a final check.
Assistant
All good. Now let me review the checklist explicitly.
Assistant
Assistant
The changes are in place and verified. Everything looks good — the working tree only contains the intended modifications. Let me do one final confirmation test run before submitting.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.