Skip to content

Implement HTTP Server Mode for CoreTrace CLI #10

@SizzleUnrlsd

Description

@SizzleUnrlsd

Add a first-class HTTP server mode to CoreTrace so external clients can trigger analyses via a JSON API. The server should parse JSON requests, map them to the existing ProgramConfig, execute the requested analysis tools, and return structured results (including captured tool output). This mode must be stable for concurrent requests and should avoid breaking existing CLI workflows.

API usage (example):

  • Start server:
    ctrace --ipc serve --serve-host 127.0.0.1 --serve-port 8080

  • POST analysis request:
    POST http://127.0.0.1:8080/api

  • Request body (example)

{
  "proto": "coretrace-1.0",
  "id": 1,
  "type": "request",
  "method": "run_analysis",
  "params": {
    "input": ["./tests/buffer_overflow.cc"],
    "entry_points": ["main"],
    "static_analysis": true,
    "dynamic_analysis": false,
    "invoke": ["flawfinder"],
    "sarif_format": true,
    "report_file": "ctrace-report.txt",
    "output_file": "ctrace.out",
    "ipc": "serv",
    "ipc_path": "/tmp/coretrace_ipc",
    "async": false,
    "verbose": true
  }
}
  • Response: JSON with status and result.outputs per tool.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions