Agent Interface

Context Contract

The interface downstream coding agents consume. Provenant should make the emitted context packet inspectable and measurable.

Current REST Surface

Available from the local Provenant server today. Includes model, pages, and repair endpoints.

MethodEndpointPurposeState
GET/api/projectRepository model metadata and corpus countsavailable
GET/api/searchSearch representation pagesavailable
POST/api/contextEmit compact/full context for targetsavailable
GET/api/graphGraph nodes and edgesavailable
POST/api/riskRisk diagnostics for targetsavailable
POST/api/dead-codeDead-code findingsavailable
GET/api/modelSnapshot, quality, repair, and economics summaryavailable
GET/api/pagesList representation pages with freshness and confidenceavailable
GET/api/pages/{id}Full page detail including content and historyavailable
GET/api/repair/candidatesWeak pages from attribution logsavailable
POST/api/repair/runDry-run or execute targeted repairsavailable

Planned API Targets

Endpoints still needed to make the UI wiki fully backend-backed.

MethodEndpointPurposeState
GET/api/economicsRepository-level token and money savingsnext backend pass

Context Packet Shape

The primary object Provenant hands to agents.

{
  "query": "agent task or target",
  "pages": [
    {
      "page_id": "file:src/auth/session.py",
      "target_path": "src/auth/session.py",
      "summary": "...",
      "content": "...",
      "source_hash": "abc123",
      "confidence": 0.87
    }
  ],
  "metrics": {
    "emitted_tokens": 4200,
    "raw_source_equivalent_tokens": 180000,
    "tokens_saved": 175800,
    "estimated_dollars_saved": 0.44
  }
}
White Paper