Skip to main content

Module manager_daily_brief

Module manager_daily_brief 

Source
Expand description

Manager Daily Brief workflow contracts for labor-saving internal review.

The workflow starts from app-owned, source-grounded context and produces a deterministic packet that an agent may summarize or rank, but not use as authority to mutate schedules, provider/PMS records, customer channels, or money movement. Outcome records then capture whether the reviewed action actually reduced manager/front-desk labor.

use app::manager_daily_brief as brief;
use chrono::NaiveDate;
use domain::{analytics, entities, operations, source};
use uuid::Uuid;

let location_id = entities::LocationId(Uuid::from_u128(0x170));
let operating_day = operations::operating_day::Date::try_new(
    NaiveDate::from_ymd_opt(2026, 6, 18).expect("fixture date is valid"),
)?;
let source_ref = source::RecordRef::new(
    source::System::BusinessIntelligence,
    source::record::Id::try_new("labor-read-model:boarding-demand:2026-06-18")?,
);
let demand_fact = analytics::service_demand::Fact::try_new(
    analytics::service_demand::Id::try_new("boarding-demand-risk")?,
    operations::operating_day::Key::new(
        location_id,
        operations::service_core::ServiceLine::Boarding,
        operating_day,
    ),
    analytics::service_demand::DemandUnits::try_new(42)?,
    vec![source_ref.clone()],
    analytics::ProjectionVersion::try_new("manager-brief-fixture-v1")?,
    vec![],
)?;

let request = brief::Request::builder()
    .location_id(location_id)
    .operating_day(operating_day)
    .prepared_for(brief::ManagerBriefPersona::GeneralManager)
    .demand_attention_threshold(brief::DemandThresholdUnits::try_new(25)?)
    .service_demand_facts(vec![demand_fact])
    .build();

let packet = brief::Workflow::evaluate(request);

assert_eq!(packet.actions().len(), 1);
assert!(packet.all_actions_are_source_grounded());
assert!(packet.safe_agent_actions().contains(&brief::SafeAgentAction::RankManagerActions));
assert!(packet.blocked_actions().contains(&brief::BlockedAction::ChangeStaffSchedule));
assert!(packet.blocked_actions().contains(&brief::BlockedAction::MutateProviderOrPmsRecord));
assert!(packet.minutes_saved() > 0);

let outcome = brief::OutcomeRecord::builder()
    .action_id(packet.actions()[0].id().clone())
    .recorded_by(entities::ActorRef::Manager {
        manager_id: entities::ManagerId::try_new("gm-fixture")?,
    })
    .outcome(brief::FeedbackOutcome::Completed)
    .before_minutes(brief::LaborMinutes::try_new(45)?)
    .actual_minutes(brief::LaborMinutes::try_new(12)?)
    .source_record_refs(vec![source_ref])
    .build();

assert!(outcome.records_feedback_without_external_mutation());
assert!(outcome.blocked_actions().contains(&brief::BlockedAction::SendCustomerMessage));
assert_eq!(outcome.actual_minutes_saved(), 33);

Structs§

ActionId
ActionRationale
AggregateLaborMinutes
Aggregate labor minutes carried by the manager daily brief workflow; it assembles reviewable manager brief packets from deterministic context and agent drafts.
BriefAction
Brief action carried by the manager daily brief workflow; it assembles reviewable manager brief packets from deterministic context and agent drafts.
BriefActionBuilder
Use builder syntax to set the inputs and finish with build().
BriefSummary
DemandThresholdUnits
Demand threshold units carried by the manager daily brief workflow; it assembles reviewable manager brief packets from deterministic context and agent drafts.
LaborImpactEstimate
Labor impact estimate carried by the manager daily brief workflow; it assembles reviewable manager brief packets from deterministic context and agent drafts.
LaborMinutes
Labor minutes carried by the manager daily brief workflow; it assembles reviewable manager brief packets from deterministic context and agent drafts.
OutcomeRecord
Outcome record carried by the manager daily brief workflow; it assembles reviewable manager brief packets from deterministic context and agent drafts.
OutcomeRecordBuilder
Use builder syntax to set the inputs and finish with build().
Packet
Reviewable packet handed to staff or agents with deterministic gates already applied.
Request
Input contract for building the workflow packet from source-grounded records.
RequestBuilder
Use builder syntax to set the inputs and finish with build().
ScopedCheckoutPacket
Scoped checkout packet carried by the manager daily brief workflow; it assembles reviewable manager brief packets from deterministic context and agent drafts.
ScopedCheckoutPacketBuilder
Use builder syntax to set the inputs and finish with build().
ScopedRetentionPacket
Scoped retention packet carried by the manager daily brief workflow; it assembles reviewable manager brief packets from deterministic context and agent drafts.
ScopedRetentionPacketBuilder
Use builder syntax to set the inputs and finish with build().
SourceFact
Source fact carried by the manager daily brief workflow; it assembles reviewable manager brief packets from deterministic context and agent drafts.
SourceFactBuilder
Use builder syntax to set the inputs and finish with build().
Workflow
Workflow carried by the manager daily brief workflow; it assembles reviewable manager brief packets from deterministic context and agent drafts.

Enums§

ActionIdError
ActionRationaleError
BlockedAction
Actions the agent must never perform without a human/operator system of record.
BriefActionKind
Decision taxonomy for brief action kind in the manager daily brief workflow; each value carries operational meaning for source-grounded routing and review.
BriefActionPriority
Decision taxonomy for brief action priority in the manager daily brief workflow; each value carries operational meaning for source-grounded routing and review.
BriefSummaryError
Error
Decision taxonomy for error in the manager daily brief workflow; each value carries operational meaning for source-grounded routing and review.
FeedbackOutcome
Decision taxonomy for feedback outcome in the manager daily brief workflow; each value carries operational meaning for source-grounded routing and review.
ManagerBriefPersona
Decision taxonomy for manager brief persona in the manager daily brief workflow; each value carries operational meaning for source-grounded routing and review.
RemovedManualWork
Decision taxonomy for removed manual work in the manager daily brief workflow; each value carries operational meaning for source-grounded routing and review.
SafeAgentAction
Review-safe agent tasks allowed to save staff time without crossing mutation or send boundaries.
SourceFactKind
Decision taxonomy for source fact kind in the manager daily brief workflow; each value carries operational meaning for source-grounded routing and review.

Functions§

requested_side_effect_rejection_reason
Produces the requested side effect rejection reason contract for the manager daily brief workflow.

Type Aliases§

Result
Result type returned by fallible manager daily brief operations.