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.
State Descriptions
Chat Session States:
State | Description | Allowed Actions |
---|---|---|
Inactive | No active session | Start Chat |
Initializing | Setting up session | Cancel |
Active | Chat session active | Send Message, End Chat |
LoadingContext | Fetching user data | Wait |
Processing | Claude 4 processing | Wait |
ToolExecution | Running credit tools | Wait |
Responding | Streaming response | Wait |
Idle | Inactive timeout | Resume, End |
Error | Recoverable error | Retry, End |
Recovering | Auto-recovery attempt | Wait |
Failed | Unrecoverable error | End Session |
Ended | Session terminated | Start 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.
Pipeline States
Analysis States:
State | Description | Processing Time |
---|---|---|
Idle | No active analysis | N/A |
Initializing | Loading services | ~100ms |
Ready | Awaiting requests | N/A |
FetchingScore | Retrieving credit data | 1-3s |
CacheCheck | Checking cached data | ~10ms |
BureauCall | API call to bureaus | 2-3s |
ScoreRetrieved | Score data ready | N/A |
FactorAnalysis | Analyzing 5 factors | ~200ms |
ImprovementPlan | Generating plan | ~500ms |
Recommendations | Creating advice | ~300ms |
Complete | Analysis done | N/A |
Monitoring | Watching for changes | Continuous |
Error | Recoverable error | N/A |
Failed | Unrecoverable error | N/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.
Error Categories
Authentication States:
State | Description | User Actions | System Actions |
---|---|---|---|
Unauthenticated | No active session | Login, Register | None |
SigningUp | Registration flow | Submit form | Validate data |
Verifying | Email verification | Click link | Send email |
ProfileSetup | Initial profile | Complete form | Store data |
CreditConsent | Bureau consent | Accept/Decline | Record consent |
LoggingIn | Authentication | Enter credentials | Verify user |
MFARequired | 2FA needed | Enter code | Validate MFA |
Authenticated | Valid session | Use app | Track activity |
SessionActive | Active use | Actions | Monitor |
SessionRefresh | Token refresh | None | Refresh JWT |
LoggingOut | Ending session | Confirm | Clear session |
Session Timeouts:
- Access token: 1 hour
- Refresh token: 30 days
- Idle timeout: 30 minutes
- Absolute timeout: 24 hours
Last updated on