Skip to main content

Module manager_daily_brief

Module manager_daily_brief 

Source
Expand description

Manager Daily Brief workflow rules 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.

Crosswalk navigation: operator docs link this workflow to the Manager Daily Brief packet row in docs/entity-atlas/contract-crosswalk/workflow-packets.md; storage outcome projection evidence lives in storage-persistence.md, runtime/API exposure in runtime-exposure.md, and executable proof in app/tests/manager_daily_brief_workflow_contracts.rs plus API/storage tests.

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 used by the manager daily brief workflow; it assembles reviewable manager brief packets from deterministic context and agent drafts.
BriefAction
Brief action used 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 used by the manager daily brief workflow; it assembles reviewable manager brief packets from deterministic context and agent drafts.
LaborImpactEstimate
Labor impact estimate used by the manager daily brief workflow; it assembles reviewable manager brief packets from deterministic context and agent drafts.
LaborMinutes
Labor minutes used by the manager daily brief workflow; it assembles reviewable manager brief packets from deterministic context and agent drafts.
OutcomeRecord
Outcome record used 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 rules 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 used 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 used 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 used 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 used 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 choices for brief action kind in the manager daily brief workflow; each value routes reviewed source facts to the right queue, draft, or staff gate.
BriefActionPriority
Decision choices for brief action priority in the manager daily brief workflow; each value routes reviewed source facts to the right queue, draft, or staff gate.
BriefSummaryError
Error
Decision choices for error in the manager daily brief workflow; each value routes reviewed source facts to the right queue, draft, or staff gate.
FeedbackOutcome
Decision choices for feedback outcome in the manager daily brief workflow; each value routes reviewed source facts to the right queue, draft, or staff gate.
ManagerBriefPersona
Decision choices for manager brief persona in the manager daily brief workflow; each value routes reviewed source facts to the right queue, draft, or staff gate.
RemovedManualWork
Decision choices for removed manual work in the manager daily brief workflow; each value routes reviewed source facts to the right queue, draft, or staff gate.
SafeAgentAction
Review-safe agent tasks allowed to save staff time without crossing mutation or send gates.
SourceFactKind
Decision choices for source fact kind in the manager daily brief workflow; each value routes reviewed source facts to the right queue, draft, or staff gate.

Functions§

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

Type Aliases§

Result
Result type returned by fallible manager daily brief operations.