Skip to Content

State Diagrams

Chat Session State Machine

This state diagram shows all possible states in a credit advisory chat session with Claude 4 and the transitions between them.

Chat Session States:

StateDescriptionAllowed Actions
InactiveNo active sessionStart Chat
InitializingSetting up sessionCancel
ActiveChat session activeSend Message, End Chat
LoadingContextFetching user dataWait
ProcessingClaude 4 processingWait
ToolExecutionRunning credit toolsWait
RespondingStreaming responseWait
IdleInactive timeoutResume, End
ErrorRecoverable errorRetry, End
RecoveringAuto-recovery attemptWait
FailedUnrecoverable errorEnd Session
EndedSession terminatedStart New

Composite States:

  • Active: Contains sub-states for user interaction
  • ToolExecution: Credit score, analysis, and planning tools

Credit Analysis State Machine

This state diagram shows the states and transitions for credit score analysis and improvement plan generation.

Analysis States:

StateDescriptionProcessing Time
IdleNo active analysisN/A
InitializingLoading services~100ms
ReadyAwaiting requestsN/A
FetchingScoreRetrieving credit data1-3s
CacheCheckChecking cached data~10ms
BureauCallAPI call to bureaus2-3s
ScoreRetrievedScore data readyN/A
FactorAnalysisAnalyzing 5 factors~200ms
ImprovementPlanGenerating plan~500ms
RecommendationsCreating advice~300ms
CompleteAnalysis doneN/A
MonitoringWatching for changesContinuous
ErrorRecoverable errorN/A
FailedUnrecoverable errorN/A

Composite State Details:

  • FactorAnalysis: Payment History → Utilization → Credit Age → Mix → Inquiries
  • ImprovementPlan: Goal Setting → Action ID → Prioritization → Timeline

User Authentication State Machine

This state diagram shows the user authentication flow with Firebase Auth and session management.

Authentication States:

StateDescriptionUser ActionsSystem Actions
UnauthenticatedNo active sessionLogin, RegisterNone
SigningUpRegistration flowSubmit formValidate data
VerifyingEmail verificationClick linkSend email
ProfileSetupInitial profileComplete formStore data
CreditConsentBureau consentAccept/DeclineRecord consent
LoggingInAuthenticationEnter credentialsVerify user
MFARequired2FA neededEnter codeValidate MFA
AuthenticatedValid sessionUse appTrack activity
SessionActiveActive useActionsMonitor
SessionRefreshToken refreshNoneRefresh JWT
LoggingOutEnding sessionConfirmClear session

Session Timeouts:

  • Access token: 1 hour
  • Refresh token: 30 days
  • Idle timeout: 30 minutes
  • Absolute timeout: 24 hours
Last updated on