Build a structured knowledge model in ai_task_analysis_notes/[bug-name].ai_task_analysis_notes_temp.md.
PHASE 1A: INITIALIZATION AND DISCOVERY
- Initialize the analysis file with a
## Metadata heading. Under it, add the full original prompt/error in a markdown box using 5 backticks:
```markdown
[Full original prompt/error here]
```
- Continue adding to the
## Metadata section: the bug description and full details of the Source Code Structure from ai-prompt-context.md. Use 6 backticks for this nested markdown:
```markdown
## Bug Description
[Bug description here]
## Source Code Structure
[Full details from ai-prompt-context.md]
```
- Create all required headings:
- ## Progress
- ## Errors
- ## Assumption Validations
- ## Performance Metrics
- ## Memory Management
- ## Processed Files
- ## File List
- ## Knowledge Graph
- ## Error Boundaries (debugging-specific)
- ## Interaction Map (debugging-specific)
- ## Platform Error Patterns (debugging-specific)
- Populate
## Progress with:
- Phase: 1
- Items Processed: 0
- Total Items: 0
- Current Operation: "initialization"
- Current Focus: "[original bug diagnosis task]"
- Additional searches to ensure no critical infrastructure is missed:
- grep search patterns: .EventHandler.{EntityName}|{EntityName}.*EventHandler
- grep search patterns: .BackgroundJob.{EntityName}|{EntityName}.*BackgroundJob
- grep search patterns: .Consumer.{EntityName}|{EntityName}.*Consumer
- grep search patterns: .Service.{EntityName}|{EntityName}.*Service
- grep search patterns: .Helper.{EntityName}|{EntityName}.*Helper
- Include pattern: */.{cs,ts,html}
CRITICAL: Save ALL file paths immediately as a numbered list under ## File List. Update the Total Items count in ## Progress.
DEBUGGING-SPECIFIC DISCOVERY
ERROR_BOUNDARY_DISCOVERY: Focus on debugging-relevant patterns:
- Error Tracing Analysis: Find stack traces, map error propagation paths, identify handling patterns. Document under
## Error Boundaries.
- Component Interaction Debugging: Discover service dependencies, find relevant endpoints/handlers, analyze request flows. Document under
## Interaction Map.
- Platform Debugging Intelligence: Find platform error patterns (
PlatformValidationResult, PlatformException), CQRS error paths, repository error patterns. Document under ## Platform Error Patterns.
- Discovery searches:
- Semantic and grep search all error keywords
- Prioritize: Domain Entities, Commands, Queries, Event Handlers, Controllers, Background Jobs, Consumers
- Save ALL file paths to ## File List
PHASE 1B: SYSTEMATIC FILE ANALYSIS FOR DEBUGGING
IMPORTANT: MUST DO WITH TODO LIST
Count total files in file list, split it into many batches of 10 files in priority order. For each batch, insert a new task in the current todo list for analyzing that batch.
File Analysis Order (by priority):
- Domain Entities
- Commands
- Queries
- Event Handlers
- Controllers
- Background Jobs
- Consumers
- Frontend Components .ts
CRITICAL: You must analyze ALL files in the file list identified as belonging to the highest priority categories.
For each file, add results into ## Knowledge Graph section. The heading of each analyzed file must have the item order number in the heading.
Core fields for each file:
filePath: Full path to the filetype: Component classificationarchitecturalPattern: Design pattern usedcontent: Purpose and logic summarysymbols: Classes, interfaces, methodsdependencies: Imports/using statementsbusinessContext: Comprehensive detail of all business logic, how it contributes to requirementsreferenceFiles: Files using this file's symbolsrelevanceScore: 1-10evidenceLevel: "verified" or "inferred"uncertainties: Unclear aspectsplatformAbstractions: Platform base classes usedserviceContext: Microservice ownershipdependencyInjection: DI registrationsgenericTypeParameters: Generic type relationships
Debugging-specific fields:
errorPatterns: Exception handling, validation logicstackTraceRelevance: Relation to stack tracesdebuggingComplexity: Difficulty to debug (1-10)errorPropagation: How errors flow through componentplatformErrorHandling: Use of platform error patternscrossServiceErrors: Cross-service error scenariosvalidationLogic: Business rule validation that could faildependencyErrors: Potential dependency failures
Message Bus Analysis (CRITICAL FOR CONSUMERS):
messageBusAnalysis: When analyzing Consumer files (*Consumer.cs extending PlatformApplicationMessageBusConsumer):
1. Identify the *BusMessage type used
2. Grep search ALL services to find files that send/publish this message
3. List all producer files and their service locations in messageBusProducers
Targeted Aspect Analysis (targetedAspectAnalysis):
For Front-End items:
componentHierarchy, routeConfig, routeGuardsstateManagementStores, dataBindingPatterns, validationStrategies
For Back-End items:
authorizationPolicies, commands, queriesdomainEntities, repositoryPatterns, businessRuleImplementations
For Consumer items:
messageBusMessage, messageBusProducerscrossServiceIntegration, handleLogicWorkflow
MANDATORY PROGRESS TRACKING: After processing every 10 files, you MUST update Items Processed in ## Progress, run a CONTEXT_ANCHOR_CHECK, and explicitly state your progress. After each file, add its path to the ## Processed Files list.
PHASE 1C: OVERALL ANALYSIS
Write comprehensive overallAnalysis: summary showing:
- Complete end-to-end workflows discovered
- Key architectural patterns and relationships
- Error propagation paths
- All business logic workflows: From front-end to back-end
- Example: Front-end Component => Controller Api Service => Command/Query => EventHandler => Others (Send email, producer bus message)
- Example: Background Job => Event Handler => Others
- Integration points and failure points
- Cross-service dependencies identified
---