Process Trace
Follow execution paths through your code
Trace execution flows through your codebase, seeing exactly which functions are called in which order.
URI Pattern
map://{repository}/process/{process_id}Response Format
interface ProcessTraceResponse {
id: string;
label: string;
process_type: 'intra_community' | 'cross_community';
communities: string[]; // Communities traversed
trace: TraceStep[];
related: RelatedProcessItem[];
}
interface TraceStep {
step: number;
name: string; // Function name
location: string; // file:line
}
interface RelatedProcessItem {
id: string;
label: string;
common_entry_point?: string;
}Example
{
"id": "proc_login",
"label": "UserLogin",
"process_type": "cross_community",
"communities": ["API", "Authentication", "DataAccess"],
"trace": [
{
"step": 1,
"name": "handleLoginRequest",
"location": "src/api/auth.ts:45"
},
{
"step": 2,
"name": "authenticateUser",
"location": "src/auth/authenticate.ts:67"
},
{
"step": 3,
"name": "getUserByEmail",
"location": "src/data/users.ts:23"
},
{
"step": 4,
"name": "createSession",
"location": "src/auth/session.ts:89"
}
],
"related": [
{
"id": "proc_signup",
"label": "UserSignup",
"common_entry_point": "handleAuthRequest"
}
]
}Understanding Processes
Process Types
intra_community: Stays within one community
- More localized impact
- Easier to understand and modify
cross_community: Spans multiple communities
- Wider system impact
- May indicate architectural boundaries
Trace Steps
Each step shows:
- Order of execution
- Function called
- File location with line number
Use Cases
1. Following Execution Flow
const process = await getResource('map://my-app/process/{id}');
for (const step of process.trace) {
console.log(`Step ${step.step}: ${step.name} at ${step.location}`);
}2. Understanding Dependencies
// Which communities does this process touch?
console.log(`Traverses: ${process.communities.join(' -> ')}`);3. Finding Related Processes
// Explore similar processes
for (const related of process.related) {
const relatedTrace = await getResource(`map://my-app/process/${related.id}`);
}Related
- Community Detail - Find processes in communities
- Cypher Query Tool - Query process steps