SDS-051: Context Analyzer Service

[!WARNING] Superseded by SDS-051: Universal Context Service

This specification has been merged with SDS-051 (Project Context Analyzer) into a unified “Universal Context Service” that provides holistic context vectors for the Isomorphic Compiler.

Addresses Requirements

MVP Status

MVP


Component Description

The Context Analyzer processes real-time conversational context, user intent, and project goals. It integrates information from the Knowledge Graph and Domain Services to build a rich, contextual understanding that informs AI agent behavior and cognitive artifact recommendations.


Technical Details

Interfaces

Direction Description Format
Input User dialogue Text/JSON
Input Current task state JSON
Input User profile JSON
Input Project metadata JSON
Output Enriched contextual data JSON object

Protocols


Data Model

Output is a dynamic JSON object representing the current context, conforming to ContextSnapshot within the UserInteractionFeedback schema.

Context Object Structure:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
  "sessionId": "uuid",
  "timestamp": "ISO-8601",
  "user": {
    "id": "user-123",
    "role": "Developer",
    "preferences": {...}
  },
  "task": {
    "type": "documentation",
    "project": "order-service",
    "phase": "review"
  },
  "entities": [
    {"type": "Customer", "id": "cust-456"},
    {"type": "Order", "id": "order-789"}
  ],
  "intent": "generate-api-docs",
  "semanticContext": {...}
}

API Specification

Endpoints

Endpoint Method Description
/context/analyze POST Analyze and enrich context

Request/Response

Analyze Context

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
POST /context/analyze
{
  "sessionId": "session-abc",
  "userInput": "I need to update the order processing documentation",
  "currentTask": "documentation-review",
  "projectId": "order-service"
}

// Response
{
  "context": {
    "intent": "update-documentation",
    "entities": ["Order", "OrderProcessing"],
    "suggestedArtifacts": ["checklist", "api-reference"],
    "relevantRules": ["order-validation-rule"],
    "architecturalContext": {...}
  }
}

Error Codes

Code Description
400 Bad Request Missing required input
500 Internal Server Error Processing error

Dependencies


Error Handling


Performance Considerations


Security Considerations


Testing Strategy