Quickstart Validation Scenarios
Quickstart Validation Scenarios
Feature: State Authority Subsystem Purpose: Verify implementation meets spec before deployment
Setup Requirements
- Airtable base
YFT-StateAuthoritycreated with all tables - Retool apps connected to Airtable
- Test data: 5 users, 20 garments, 3 boxes
- Operator account for Retool
Scenario 1: Happy Path - Full Cycle
Goal: Verify complete cycle flow from scheduling through closeout.
Steps
- Schedule cycle
- In Admin Console, create cycle for User U1, Week W1
- Verify: CycleEntity created in
Scheduledstate - Verify: Event
CycleScheduledlogged
- Commit cycle
- Assign Box B1 to cycle
- Reserve Garments G1, G2, G3 to cycle
- Trigger commitment
- Verify: Cycle transitions to
Committed - Verify: Garments G1, G2, G3 are in
Reservedstate - Verify: Events logged for each transition
- Pack box
- In Warehouse Ops, start picking for Box B1
- Scan G1, G2, G3 into box
- Verify: Each garment transitions to
Packed - Verify: Box shows
actual_contents = [G1, G2, G3] - Verify: No variance detected
- Ship box
- Enter tracking number, confirm ship
- Verify: Box transitions to
Shipped - Verify: Garments transition to
InTransitOutbound - Verify: Cycle transitions to
OutboundInTransit
- Confirm delivery
- Enter delivery confirmation
- Verify: Cycle transitions through
Delivered→WearWindowOpen - Verify: Garments transition to
InUse
- Initiate return
- Wait for wear window (or manually advance)
- Verify: Cycle transitions to
ReturnWindowOpen - Confirm return pickup
- Verify: Cycle transitions to
ReturnInTransit
- Receive and inspect
- Scan Box B1 at receiving
- Inspect each garment, mark condition as acceptable
- Verify: Garments transition to
ReceivedReturn→Refurbish
- Complete refurbishment
- Mark refurbishment complete for each garment
- Verify: Garments transition to
Available - Verify:
wear_countincremented by 1
- Close cycle
- Trigger settlement
- Verify: Cycle transitions to
Settled→Closed - Verify: Box transitions to
Closed
Expected Outcome
- Cycle is in
Closedstate - All garments back in
Availablestate with updated counters - Event log shows complete history
Scenario 2: Packing Variance - Commit to Observed
Goal: Verify variance detection and compensating allocation.
Steps
- Create committed cycle with planned_contents = [G1, G2, G3]
- Start picking
- Scan G1, G2, G4 (G4 not in plan, G3 missing)
- Verify:
has_variance = true - Attempt to verify pack
- Verify: System blocks - variance unresolved
- Select “Commit to observed”
- Verify:
PackingVarianceevent logged - Verify:
CompensatingAllocationevent logged - Verify:
actual_contents = [G1, G2, G4] - Verify: Box transitions to
PackedVerified - Verify: G3 returns to
Available(was never packed)
Expected Outcome
- Cycle ships with G1, G2, G4
- Events clearly document variance and resolution
- G3 available for other cycles
Scenario 3: Double Allocation Prevention
Goal: Verify garment cannot be reserved for multiple cycles.
Steps
- Create Cycle C1 for User U1, Week W1
- Reserve Garment G1 to Cycle C1
- Create Cycle C2 for User U2, Week W1
- Attempt to reserve Garment G1 to Cycle C2
- Verify: System rejects with error
E001 - Garment already reserved - Verify: Rejection event logged
Expected Outcome
- G1 remains reserved to C1 only
- Clear error message shown
- Audit trail of rejection
Scenario 4: Duplicate Cycle Prevention
Goal: Verify single cycle per user per week constraint.
Steps
- Create Cycle C1 for User U1, Week W1
- Attempt to create Cycle C2 for User U1, Week W1
- Verify: System rejects with error
E002 - Cycle already exists - Verify: Rejection event logged
Expected Outcome
- Only one cycle exists for U1/W1
- Clear error message
- Audit trail
Scenario 5: Lifecycle Bounds Enforcement
Goal: Verify garments exceeding limits transition to Retired.
Steps
- Set Garment G1
wear_count = 49,max_wear_limit = 50 - Run G1 through a cycle (Reserved → Packed → … → ReceivedReturn)
- Complete inspection, mark condition acceptable
- Verify: System increments
wear_countto 50 - Verify: G1 transitions to
Retired, notAvailable - Verify: Event
GarmentRetiredwith reason “lifecycle_exceeded” - Attempt to reserve G1 for new cycle
- Verify: System rejects - garment not Available
Expected Outcome
- G1 is permanently removed from circulation
- Clear reason recorded
- Cannot be allocated again
Scenario 6: User Hold - Payment Failure
Goal: Verify payment hold blocks cycle commitment.
Steps
- Create User U1 in
Activestate - Create Cycle C1 for U1 in
Scheduledstate - Trigger payment failure for U1
- Verify: U1 transitions to
HoldPayment - Verify: Event
UserPaymentHoldlogged - Attempt to commit Cycle C1
- Verify: System rejects with error
E004 - User not Active - Verify: C1 remains in
Scheduledstate - Resolve payment for U1
- Verify: U1 transitions to
Active - Commit Cycle C1
- Verify: C1 successfully transitions to
Committed
Expected Outcome
- Commitment blocked while on hold
- Automatic resume after hold resolved
- Clear audit trail of hold/restore
Scenario 7: Late Return Hold
Goal: Verify logistics hold after overdue return.
Steps
- Create cycle, deliver to user, open return window
- Wait beyond return threshold (or manually set overdue)
- Verify: User transitions to
HoldLogistics - Attempt to commit next week’s cycle
- Verify: System blocks commitment
- Receive the overdue return
- Verify: User transitions to
Active - Verify: Next cycle can commit
Expected Outcome
- No new shipments while returns overdue
- Automatic restoration after return
Scenario 8: Event Reconstruction
Goal: Verify audit trail completeness.
Steps
- Perform 10 state transitions on Garment G1
- Query Events table for G1
- Verify: All 10 events present
- Verify: Correct sequence (timestamps monotonic)
- Verify: Each event has: entity_type, entity_id, from_state, to_state, actor_id
- Attempt to modify an existing event
- Verify: System rejects (append-only)
Expected Outcome
- Complete history available
- Events are immutable
Scenario 9: Idempotent Transitions
Goal: Verify duplicate requests don’t create duplicate state changes.
Steps
- Reserve G1 to C1 with idempotency_key “reserve-g1-c1”
- Repeat same request with same idempotency_key
- Verify: Only one event created
- Verify: G1 still in
Reservedstate (no double-reserve)
Expected Outcome
- Idempotent operations are safe to retry
- No duplicate events or state corruption
Scenario 10: Bounded Uncertainty - Missing Delivery
Goal: Verify system handles missing delivery signal gracefully.
Steps
- Ship box, enter tracking
- Wait beyond expected delivery window without confirmation
- Verify: Cycle enters bounded uncertainty (logged)
- User reports usage
- Trigger
DeliveredByProxyevent - Verify: Cycle proceeds to
WearWindowOpen - Verify: Events clearly document proxy delivery
Expected Outcome
- System doesn’t deadlock on missing signal
- Proxy events preserve auditability
Validation Checklist
| Scenario | Pass/Fail | Notes |
|---|---|---|
| 1. Happy Path | ||
| 2. Packing Variance | ||
| 3. Double Allocation Prevention | ||
| 4. Duplicate Cycle Prevention | ||
| 5. Lifecycle Bounds | ||
| 6. Payment Hold | ||
| 7. Late Return Hold | ||
| 8. Event Reconstruction | ||
| 9. Idempotent Transitions | ||
| 10. Bounded Uncertainty |
All scenarios must pass before production deployment.