Expand description
Booking triage contracts for deterministic review before agent drafting.
The app evaluates reservation readiness from policy/evidence first. Agents may draft review packets or customer-safe scripts only after the deterministic packet exposes the allowed review boundary; provider mutation, booking confirmation, customer sends, and payment movement remain blocked actions.
The typestate request machine models the safe sequence for triage evidence:
intake, pet profile attachment, reservation fact attachment, deterministic
review, and staff-ready handoff. The machine’s generated helper pages are a
statum implementation detail; this module documents the operational contract
here and on the source state variants so external readers understand that the
generated Request/state APIs enforce evidence order rather than granting live
booking authority.
use app::booking_triage as triage;
let vaccine_review = triage::rule::ReviewFinding::builder()
.rule_id(triage::rule::Id::VaccineRequirements)
.failure_code(triage::FailureCode::MissingOrUnverifiedVaccine)
.readiness_bucket(triage::ReadinessBucket::VaccinePending)
.human_approval_required(triage::ApprovalGate::MedicalDocumentReview)
.evidence_refs(vec![triage::EvidenceRef::try_new(
"gingr:reservation:fixture-123:vaccine-expired",
)?])
.build();
let deterministic = triage::DeterministicResult::evaluate(vec![
triage::rule::Evaluation::needs_human_approval(vaccine_review),
]);
assert_eq!(deterministic.recommended_status(), triage::ReadinessBucket::VaccinePending);
assert!(deterministic.requires(triage::ApprovalGate::MedicalDocumentReview));
assert_eq!(deterministic.staff_decision_boundary(), triage::StaffDecisionBoundary::ReviewPacketOnly);
assert!(deterministic.blocked_actions().contains(&triage::BlockedAction::ConfirmBooking));
assert!(deterministic.blocked_actions().contains(&triage::BlockedAction::SendCustomerMessage));
assert!(deterministic.blocked_actions().contains(&triage::BlockedAction::MutateProviderRecord));
let packet = triage::StaffEvaluationPacket::new(
triage::Reservation::try_new("reservation-fixture-123")?,
deterministic,
);
let draft = triage::ConfirmationDraft::new(
triage::CustomerMessageDraft::try_new("We can draft this only after staff review.")?,
);
assert_eq!(
packet.try_with_confirmation_draft(draft).unwrap_err(),
triage::ConfirmationDraftError::DeterministicGateNotReadyForDraft,
);Modules§
- reservation
- Reservation identifiers used by booking-triage packets and review evidence.
- rule
- Deterministic booking rules that explain readiness findings and safe agent actions.
Structs§
- AiRecommendation
- Ai recommendation carried by the booking-readiness workflow; it keeps booking work grounded in deterministic policy evidence before any agent draft reaches staff.
- Confirmation
Draft - Confirmation draft carried by the booking-readiness workflow; it keeps booking work grounded in deterministic policy evidence before any agent draft reaches staff.
- Customer
Message Draft - Deterministic
Result - Deterministic result carried by the booking-readiness workflow; it keeps booking work grounded in deterministic policy evidence before any agent draft reaches staff.
- Evidence
Ref - Intake
- PetProfile
- Pet profile carried by the booking-readiness workflow; it keeps booking work grounded in deterministic policy evidence before any agent draft reaches staff.
- PetProfile
Attached - Policy
Attached - Policy
Attached Data - Policy attached data carried by the booking-readiness workflow; it keeps booking work grounded in deterministic policy evidence before any agent draft reaches staff.
- Policy
Snapshot - Ready
ForPolicy Decision - Recommendation
Text - Request
- Reservation
- Service
- Service carried by the booking-readiness workflow; it keeps booking work grounded in deterministic policy evidence before any agent draft reaches staff.
- Staff
Evaluation Packet - Staff evaluation packet carried by the booking-readiness workflow; it keeps booking work grounded in deterministic policy evidence before any agent draft reaches staff.
Enums§
- Agent
Recommended Action - Classifies agent recommended action values that drive the booking-readiness workflow.
- Approval
Gate - Human approval checkpoints that must clear before the workflow can advance.
- Audit
Event Draft - Classifies audit event draft values that drive the booking-readiness workflow.
- Blocked
Action - Actions the agent must never perform without a human/operator system of record.
- Confirmation
Draft Error - Classifies confirmation draft error values that drive the booking-readiness workflow.
- Customer
Message Draft Error - Error
- Classifies error values that drive the booking-readiness workflow.
- Evidence
RefError - Failure
Code - Classifies failure code values that drive the booking-readiness workflow.
- PetProfile
Completeness - Classifies pet profile completeness values that drive the booking-readiness workflow.
- Policy
Snapshot Error - Readiness
Bucket - Deterministic booking status bucket used to prioritize staff review.
- Recommendation
Text Error - Request
State - Reservation
Error - Safe
Agent Action - Review-safe agent tasks allowed to save staff time without crossing mutation or send boundaries.
- Staff
Decision Boundary - How far the packet may advance before a staff decision is required.
Traits§
Type Aliases§
- AppResult
- Shared app result type used across the booking triage boundary.