pub struct HostedPlanning(pub Arc<MissionHost>);Expand description
Adapter handed to kranz_slack::serve_slack by the serve command.
Tuple Fields§
§0: Arc<MissionHost>Trait Implementations§
Source§impl PlanningHost for HostedPlanning
impl PlanningHost for HostedPlanning
Source§fn approve_pending_if<'a>(
&'a self,
id: &'a str,
expected_identity: Option<&'a str>,
) -> BoxFuture<'a, Result<ApprovePendingOutcome>>
fn approve_pending_if<'a>( &'a self, id: &'a str, expected_identity: Option<&'a str>, ) -> BoxFuture<'a, Result<ApprovePendingOutcome>>
The shared identity-checked approval holds the engine and pending-plan locks through commit, so a concurrent re-plan cannot replace the plan or be overwritten by a failed approval. Overrides the trait’s default.
Source§fn pending_plan_identity<'a>(
&'a self,
id: &'a str,
) -> BoxFuture<'a, Result<Option<String>>>
fn pending_plan_identity<'a>( &'a self, id: &'a str, ) -> BoxFuture<'a, Result<Option<String>>>
Reads the parked plan without consuming it, so the bridge can refuse an approve from a card that shows an older plan (Slack M2).
Source§fn create<'a>(&'a self, goal: &'a str) -> BoxFuture<'a, Result<String>>
fn create<'a>(&'a self, goal: &'a str) -> BoxFuture<'a, Result<String>>
Create a mission (no planning turn yet); returns the mission id.
Source§fn planning_turn<'a>(
&'a self,
id: &'a str,
text: &'a str,
) -> BoxFuture<'a, Result<String>>
fn planning_turn<'a>( &'a self, id: &'a str, text: &'a str, ) -> BoxFuture<'a, Result<String>>
One conversational planning turn; returns the orchestrator’s reply
(seed reply already prepended by the host).
Source§fn request_plan<'a>(&'a self, id: &'a str) -> BoxFuture<'a, Result<PlanOutcome>>
fn request_plan<'a>(&'a self, id: &'a str) -> BoxFuture<'a, Result<PlanOutcome>>
Demand the plan (one orchestrator turn).
Source§fn approve_pending<'a>(
&'a self,
id: &'a str,
) -> BoxFuture<'a, Result<Option<String>>>
fn approve_pending<'a>( &'a self, id: &'a str, ) -> BoxFuture<'a, Result<Option<String>>>
Approve the plan PARKED by the last Ready
Self::request_plan —
the ONE pending-plan cache every surface (Slack, web, glasses ring)
shares, held by the host, never the bridge. Ok(Some(branch)) =
committed (plan.json/plan.md/index.md on the mission branch);
Ok(None) = nothing parked (never requested, or forfeited by a serve
restart / idle release — re-run /kranz plan). A failed approve
re-parks the plan so a retry can fire.Source§fn start<'a>(&'a self, id: &'a str) -> BoxFuture<'a, Result<()>>
fn start<'a>(&'a self, id: &'a str) -> BoxFuture<'a, Result<()>>
Start execution: the host consumes the engine into a background run.
Source§fn release<'a>(&'a self, id: &'a str) -> BoxFuture<'a, Result<bool>>
fn release<'a>(&'a self, id: &'a str) -> BoxFuture<'a, Result<bool>>
Release a hosted idle engine (freeing the mission lock) so an external
runner — the
kranz work dispatcher — can take the mission over.
true = the mission is now free of this host (released or never
hosted); false = it is actively running here and was left alone.Source§fn draft<'a>(&'a self, slug: &'a str) -> BoxFuture<'a, Result<DraftOutcome>>
fn draft<'a>(&'a self, slug: &'a str) -> BoxFuture<'a, Result<DraftOutcome>>
Run a non-interactive draft turn for backlog ticket
slug (/kranz draft <slug>): validates the slug, creates + seeds the mission
through this host, and drives it to a terminal DraftOutcome. A
money-spending, multi-minute operation — the bridge runs it off the
socket read loop after posting an immediate ack, mirroring
Self::create + Self::planning_turn.Source§fn approve_ticket<'a>(&'a self, slug: &'a str) -> BoxFuture<'a, Result<String>>
fn approve_ticket<'a>(&'a self, slug: &'a str) -> BoxFuture<'a, Result<String>>
Approve backlog ticket
slug into the queue (/kranz approve <slug>,
the slug-resolving twin of /kranz approve <mission-id>): runs the
EXACT SAME gate the REST/CLI approve path runs
(kranz_engine::deps::approve_ticket, mirrored by
kranz_server::MissionHost::approve_ticket) — refuses when the ticket
isn’t REVIEW, when a blocked-by cycle is reachable, or when an
unsatisfied blocker exists. Ok(mission_id) = the ticket’s drafted
mission was queued; Err carries the engine’s refusal message
VERBATIM (never paraphrased) for the bridge to forward unchanged.Source§fn drain<'a>(&'a self) -> BoxFuture<'a, Result<()>>
fn drain<'a>(&'a self) -> BoxFuture<'a, Result<()>>
/kranz work run → trigger the queue drain/claim/skip loop THROUGH
the host (POST /api/queue/drain’s seam): the host spawns the drain
as a background task on the serve process and returns once it has
been kicked off (idempotent while a drain is already live) — this
call never itself drives a mission turn, so the bridge caller never
resumes/runs a mission on the socket read loop.Source§fn merge<'a>(&'a self, id: &'a str) -> BoxFuture<'a, Result<Value>>
fn merge<'a>(&'a self, id: &'a str) -> BoxFuture<'a, Result<Value>>
/kranz merge <slug|id> / the Delivered card’s Merge button → the
human-triggered gated Merge action (POST /api/missions/:id/merge’s
seam): refuses on a dirty tracked tree, runs the full CI gate suite,
and merges --no-ff into the base branch on green — never pushes.
Ok(value) carries the host’s {"merged":true,"commit":…}; Err
carries the refusal (dirty tree / failing gate with captured output /
merge conflict); the bridge clips long output to Slack’s field limit.Auto Trait Implementations§
impl !RefUnwindSafe for HostedPlanning
impl !UnwindSafe for HostedPlanning
impl Freeze for HostedPlanning
impl Send for HostedPlanning
impl Sync for HostedPlanning
impl Unpin for HostedPlanning
impl UnsafeUnpin for HostedPlanning
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more