pub struct PlaybookLearning { /* private fields */ }Expand description
The playbook-learning job’s code (spec 3.5 §7.15, §7.20): it reads the outcomes, drafts
the proposals and applies the owner’s decisions on them.
Implementations§
Source§impl PlaybookLearning
impl PlaybookLearning
Sourcepub fn open(parts: LearningParts) -> Result<Self>
pub fn open(parts: LearningParts) -> Result<Self>
The learning job over parts, with the proposals a restart left.
§Errors
A proposals file that does not read.
Sourcepub fn with_clock(self, clock: Arc<dyn Clock>) -> Self
pub fn with_clock(self, clock: Arc<dyn Clock>) -> Self
Reads the time from clock.
Sourcepub fn versions(&self) -> &PlaybookVersions
pub fn versions(&self) -> &PlaybookVersions
The playbooks and their versions.
Sourcepub async fn proposals(&self) -> Vec<PlaybookProposal>
pub async fn proposals(&self) -> Vec<PlaybookProposal>
Every proposal, oldest first.
Sourcepub async fn propose(
&self,
review: &WeeklyReview,
experiments: &[ExperimentRecord],
) -> Result<Vec<PlaybookProposal>>
pub async fn propose( &self, review: &WeeklyReview, experiments: &[ExperimentRecord], ) -> Result<Vec<PlaybookProposal>>
Drafts a proposal for every outcome in review and experiments with enough evidence
that has not proposed before, and cards each for the owner unless the learning job is
at Observe. Returns the new proposals.
§Errors
A store’s error, or the approval service’s.
Sourcepub async fn step(&self) -> Result<Vec<PlaybookProposal>>
pub async fn step(&self) -> Result<Vec<PlaybookProposal>>
Applies the owner’s decided cards (spec 3.5 §7.15): an approval makes the proposed
text the playbook’s next version, an edit makes the owner’s text it, a refusal or an
expiry changes nothing; each person’s decision counts on the ladder for the learning
job. Returns the proposals it decided.
§Errors
The approval service’s error, or the versions’ or the journal’s.
Sourcepub fn trigger(&self, app_name: &str, expr: &str) -> Trigger
pub fn trigger(&self, app_name: &str, expr: &str) -> Trigger
The standing trigger of the weekly learning run on expr (six fields, UTC), on the
maintenance queue of app app_name.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PlaybookLearning
impl !RefUnwindSafe for PlaybookLearning
impl !UnwindSafe for PlaybookLearning
impl Forget for PlaybookLearning
impl Move for PlaybookLearning
impl Send for PlaybookLearningwhere
RawVecInner: Send,
Arc<dyn CharterStore>: Send,
Arc<dyn KpiStore>: Send,
NodeRef<Owned, String, Arc<dyn KpiSource>, LeafOrInternal>: Send,
BoxRaw<(String, Arc<dyn KpiSource>)>: Send,
Arc<dyn JobControl>: Send,
Arc<dyn AutonomyStore>: Send,
Arc<dyn Clock>: Send,
Arc<dyn AuditRecorder>: Send,
Arc<dyn CharterEventSink>: Send,
Arc<WalletKpi>: Send,
Arc<dyn CommerceOutcomes>: Send,
Arc<IncidentPath>: Send,
Arc<AlarmRouter>: Send,
Arc<ExperimentRunner>: Send,
Arc<UpdateEngine>: Send,
Arc<dyn ApprovalService>: Send,
Mutex<Vec<PlaybookProposal>>: Send,
impl Sync for PlaybookLearningwhere
RawVecInner: Sync,
Arc<dyn CharterStore>: Sync,
Arc<dyn KpiStore>: Sync,
NodeRef<Owned, String, Arc<dyn KpiSource>, LeafOrInternal>: Sync,
BoxRaw<(String, Arc<dyn KpiSource>)>: Sync,
Arc<dyn JobControl>: Sync,
Arc<dyn AutonomyStore>: Sync,
Arc<dyn Clock>: Sync,
Arc<dyn AuditRecorder>: Sync,
Arc<dyn CharterEventSink>: Sync,
Arc<WalletKpi>: Sync,
Arc<dyn CommerceOutcomes>: Sync,
Arc<IncidentPath>: Sync,
Arc<AlarmRouter>: Sync,
Arc<ExperimentRunner>: Sync,
Arc<UpdateEngine>: Sync,
Arc<dyn ApprovalService>: Sync,
Mutex<Vec<PlaybookProposal>>: Sync,
impl Unpin for PlaybookLearningwhere
*const u8 is !null: Unpin,
Arc<dyn CharterStore>: Unpin,
Arc<dyn KpiStore>: Unpin,
*const LeafNode<String, Arc<dyn KpiSource>> is !null: Unpin,
Box<(String, Arc<dyn KpiSource>)>: Unpin,
Arc<dyn JobControl>: Unpin,
Arc<dyn AutonomyStore>: Unpin,
Arc<dyn Clock>: Unpin,
Arc<dyn AuditRecorder>: Unpin,
Arc<dyn CharterEventSink>: Unpin,
Arc<WalletKpi>: Unpin,
Arc<dyn CommerceOutcomes>: Unpin,
Arc<IncidentPath>: Unpin,
Arc<AlarmRouter>: Unpin,
Arc<ExperimentRunner>: Unpin,
Arc<UpdateEngine>: Unpin,
Arc<dyn ApprovalService>: Unpin,
Align4<u32>: Unpin,
Align1<u8>: Unpin,
*const Waiter is !null: Unpin,
Align8<usize>: Unpin,
NonZero<i32>: Unpin,
Utc: Unpin,
impl UnsafeUnpin for PlaybookLearningwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<AgentRole>: UnsafeUnpin,
*const ArcInner<dyn CharterStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn CharterStore>>: UnsafeUnpin,
*const ArcInner<dyn KpiStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn KpiStore>>: UnsafeUnpin,
*const LeafNode<String, Arc<dyn KpiSource>> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Arc<dyn KpiSource>)>>: UnsafeUnpin,
*const ArcInner<dyn JobControl> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn JobControl>>: UnsafeUnpin,
*const ArcInner<dyn AutonomyStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn AutonomyStore>>: UnsafeUnpin,
*const ArcInner<dyn Clock> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Clock>>: UnsafeUnpin,
*const ArcInner<dyn AuditRecorder> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn AuditRecorder>>: UnsafeUnpin,
*const ArcInner<dyn CharterEventSink> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn CharterEventSink>>: UnsafeUnpin,
*const ArcInner<WalletKpi> is !null: UnsafeUnpin,
PhantomData<ArcInner<WalletKpi>>: UnsafeUnpin,
*const ArcInner<dyn CommerceOutcomes> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn CommerceOutcomes>>: UnsafeUnpin,
*const ArcInner<IncidentPath> is !null: UnsafeUnpin,
PhantomData<ArcInner<IncidentPath>>: UnsafeUnpin,
*const ArcInner<AlarmRouter> is !null: UnsafeUnpin,
PhantomData<ArcInner<AlarmRouter>>: UnsafeUnpin,
*const ArcInner<ExperimentRunner> is !null: UnsafeUnpin,
PhantomData<ArcInner<ExperimentRunner>>: UnsafeUnpin,
*const ArcInner<UpdateEngine> is !null: UnsafeUnpin,
PhantomData<ArcInner<UpdateEngine>>: UnsafeUnpin,
*const ArcInner<dyn ApprovalService> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ApprovalService>>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const Waiter is !null: UnsafeUnpin,
Align8<usize>: UnsafeUnpin,
PhantomData<PlaybookProposal>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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> ⓘ
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> ⓘ
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