ENGINEERING SCHEMAS & INTERFACES
API & WebSocket Specifications
Internal contract references, event payload schemas, and AWS SAM deployment blueprints for the DevContext intelligence engine.
01 // REST INTERFACE
POST /api/v1/analyze
Triggers asynchronous cloning, AST mapping, and 3-stage synthesis for a public GitHub repository.
Request Payload (JSON)
{
"repository_url": "https://github.com/rounakneema/Revealr",
"branch": "main",
"depth": 2,
"options": {
"skip_tests": true,
"focus_areas": ["security", "architecture"]
},
"callback_url": "https://webhook.site/..."
}Response Payload (202 Accepted)
{
"job_id": "dcx_9f8b2c1a4e",
"status": "queued",
"estimated_completion": "30s",
"websocket_ticket": "ws_ticket_7b9211aa",
"links": {
"status": "/api/v1/analyze/dcx_9f8b2c1a4e/status"
}
}02 // WEBSOCKET STREAMING
Real-Time Mock Interview Event Loop
Streams incremental AST parsing progress and interactive interview Q&A sessions.
Event: ANALYSIS_PROGRESS
{
"type": "ANALYSIS_PROGRESS",
"payload": {
"stage": "AST_PARSING",
"files_processed": 42,
"total_files": 128,
"current_file": "src/core/engine.go"
}
}
Event: INTERVIEW_CHUNK
{
"type": "INTERVIEW_CHUNK",
"payload": {
"chunk_id": "chk_001",
"role": "interviewer",
"text": "Why did you choose raw sockets in Revealr instead of net.Dial?",
"grounding": {
"file": "scanner/network.go",
"lines": [45, 89]
}
}
}
03 // INFRASTRUCTURE AS CODE
AWS SAM Definition (template.yaml)
Resources:
AnalyzeRepoFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: src/analyze/
Handler: app.lambda_handler
Runtime: python3.11
Timeout: 900
MemorySize: 2048
Environment:
Variables:
DDB_TABLE: !Ref AnalysisTable
BEDROCK_MODEL_ID: anthropic.claude-3-sonnet-20240229-v1:0
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref AnalysisTable
- Statement:
- Effect: Allow
Action:
- bedrock:InvokeModel
- bedrock:InvokeModelWithResponseStream
Resource: "*"04 // DEPLOYMENT VERIFICATION
Pipeline CloudFormation Trace
sam deploy --config-env prod
$ sam deploy --config-env prod --no-confirm-changeset
Initiating deployment to devcontext-prod (us-east-1)...
UPDATE_IN_PROGRESS AWS::Lambda::Function AnalyzeRepoFunction
UPDATE_COMPLETE AWS::Lambda::Function AnalyzeRepoFunction
UPDATE_IN_PROGRESS AWS::CloudFormation::Stack devcontext-prod
UPDATE_COMPLETE AWS::CloudFormation::Stack devcontext-prod
UPDATE_COMPLETE AWS::Lambda::Function AnalyzeRepoFunction
UPDATE_IN_PROGRESS AWS::CloudFormation::Stack devcontext-prod
UPDATE_COMPLETE AWS::CloudFormation::Stack devcontext-prod
Stack devcontext-prod successfully updated. Zero errors detected.