Status: experimental design contract
Date: 2026-09-22
Authority: configuration/dispatch interface only; this API grants no acceptance or merge authority.
This specification defines the first product-facing API for connecting repositories, coding agents, model providers and execution backends to IDKMesh.
It does not replace WorkUnit, ResultManifest, EvaluatorPlan, VerificationResult, compute offers, or the existing A2A/MCP bindings.
Configuration/API objects use:
idkmesh.io/v1alpha1
The HTTP prefix is:
/v1
The HTTP prefix is intentionally decoupled from alpha object-schema naming so future compatible fields do not require a new URL for every additive change.
Example:
{
"api_version": "idkmesh.io/v1alpha1",
"id": "jules-main",
"kind": "agent",
"driver": "jules",
"enabled": true,
"auth": {
"secret_ref": "env:JULES_API_KEY"
},
"settings": {
"source": "sources/github/MSKazemi/idkmesh",
"starting_branch": "main",
"require_plan_approval": true
},
"policy": {
"task_classes": ["coder"],
"allowed_risk": ["low"],
"max_concurrency": 1,
"external_processing": true,
"project_spend_usd_max": 0
}
}
api_version;id;kind;driver;enabled.scm;agent;model;execution.auth.secret_ref;settings;policy.Unknown top-level fields should be rejected in the first implementation unless the schema explicitly provides an extension namespace.
Initial schemes:
env:VARIABLE_NAME
A future implementation may add explicit resolvers such as:
vault:...
onepassword:...
aws-secrets-manager:...
without changing connection semantics.
Prohibited:
{
"api_key": "actual-secret-value"
}
A connection may be stored even when its secret is unavailable; its probe state then reports a configuration/authentication failure and it is ineligible for routing.
Example:
{
"connection_id": "jules-main",
"status": "healthy",
"checked_at": "2026-09-22T12:00:00Z",
"driver": {
"id": "jules",
"version": "0.1"
},
"observed": {
"source": "sources/github/MSKazemi/idkmesh",
"capabilities": ["coder", "git", "tests", "remote_sandbox"]
},
"auth": {
"configured": true
},
"warnings": []
}
Probe statuses:
healthy;degraded;unavailable;disabled.A probe must never return credential values.
POST /v1/work-units:preview
Purpose:
Example request:
{
"project_id": "MSKazemi/idkmesh",
"source": {
"type": "github_issue",
"number": 123
}
}
Response contains:
Issue text is untrusted input and cannot set connector credentials, executable paths, secret refs, merge authority, or repository administration permissions.
POST /v1/routes:resolve
This is advisory/deterministic routing, not execution.
Request:
{
"project_id": "MSKazemi/idkmesh",
"work_unit": { "...": "canonical WorkUnit" }
}
Response:
{
"eligible": [
{
"connection_id": "jules-main",
"reasons": ["task_class_supported", "risk_allowed", "capacity_available"]
}
],
"ineligible": [
{
"connection_id": "local-goose",
"reasons": ["required_model_unavailable"]
}
],
"selected": null
}
The endpoint should not select a connector unless the caller explicitly asks for the project’s deterministic auto-routing policy to be applied.
POST /v1/runs
Request:
{
"project_id": "MSKazemi/idkmesh",
"work_unit": { "...": "canonical WorkUnit" },
"connection_id": "jules-main",
"approval": {
"dispatch_approved": true
}
}
Response:
{
"id": "run-...",
"state": "dispatched",
"work_unit_id": "wu-...",
"work_unit_digest": "sha256:...",
"connection_id": "jules-main",
"source_revision": "<commit-sha>",
"external_ref": {
"provider": "jules",
"id": "sessions/..."
}
}
Creating a run does not approve any future code change.
States:
created;admitted;dispatched;waiting_for_agent;candidate_ready;verification_pending;verified;verification_failed;awaiting_human_decision;integrated;rejected;cancelled;failed.State transitions must be monotonic except for explicitly modeled retry/attempt records.
A retry creates a new attempt identity; it must not rewrite historical evidence.
GET /v1/runs/{run_id}
Minimum response fields:
GET /v1/runs/{run_id}/events
Events are append-only observations such as:
run.created;run.dispatched;agent.plan_ready;agent.progress;agent.completed;candidate.discovered;result.normalized;verification.started;verification.completed;human.decision_recorded;run.failed;run.cancelled.Provider-specific payloads belong under an extension namespace and must not redefine canonical state.
POST /v1/runs/{run_id}:cancel
Cancellation means:
Cancellation is best effort for external systems whose API cannot guarantee immediate stop.
GET /v1/connections
POST /v1/connections
The API accepts secret references only.
GET /v1/connections/{connection_id}
POST /v1/connections/{connection_id}:probe
POST /v1/connections/{connection_id}:enable
POST /v1/connections/{connection_id}:disable
Deleting a connection should not delete historical run/evidence records.
Minimum:
GET /v1/projects;POST /v1/projects;GET /v1/projects/{project_id}.Project record should include:
Project policy never contains provider API keys.
POST /v1/webhooks/github
Requirements:
X-Hub-Signature-256;Initial accepted event families can be limited to:
Start with label/manual dispatch, not every event.
A run may point to one of:
{
"type": "github_pull_request",
"repository": "MSKazemi/idkmesh",
"number": 999,
"head_sha": "..."
}
or:
{
"type": "artifact_bundle",
"locator": "file://...",
"digest": "sha256:..."
}
The normalizer converts the external candidate into canonical ResultManifest/artifact evidence.
{
"api_version": "idkmesh.io/v1alpha1",
"id": "gemini-compat",
"kind": "model",
"driver": "openai-compatible",
"enabled": true,
"auth": {
"secret_ref": "env:GEMINI_API_KEY"
},
"settings": {
"base_url": "https://generativelanguage.googleapis.com/v1beta/openai/",
"model": "<configured-model>"
},
"policy": {
"external_processing": true,
"project_spend_usd_max": 0
}
}
Local Ollama can use the same driver with localhost base URL and no secret reference when its local policy permits that.
{
"api_version": "idkmesh.io/v1alpha1",
"id": "goose-local",
"kind": "agent",
"driver": "cli",
"enabled": true,
"settings": {
"preset": "goose",
"model_connection_id": "ollama-local",
"execution_connection_id": "idkmesh-node-local"
},
"policy": {
"task_classes": ["coder", "researcher"],
"allowed_risk": ["low"],
"network": "disabled"
}
}
The preset resolves to maintainer-controlled executable/arguments. WorkUnit content must not inject or replace those command templates.
Example:
{
"error": {
"code": "rate_limited",
"message": "Connector is temporarily rate limited.",
"retryable": true,
"connection_id": "jules-main",
"run_id": "run-...",
"details": {
"retry_after_seconds": 120
}
}
}
Initial error codes:
configuration_error;authentication_error;authorization_error;rate_limited;quota_exhausted;provider_unavailable;source_not_connected;sandbox_failure;agent_failed;timeout;cancelled;result_normalization_error;policy_denied;verification_failed;conflict;not_found.Do not include secrets or raw authorization headers in details.
Any mutating HTTP call should support an idempotency key.
Required first:
If a retry arrives with the same idempotency key and equivalent request digest, return the existing object.
If the same key is reused for different content, fail with conflict.
Bootstrap local mode may bind only to localhost and rely on local user access.
A networked/hosted control plane requires explicit authentication/authorization before it can mutate connection or run state.
Do not expose an unauthenticated write-capable control service.
GitHub webhook authentication is separate from operator/API authentication.
Retain:
Do not retain provider credentials.
Provider prompts/responses should be retained only to the extent required for provenance/replay and permitted by data policy; prefer bounded task/evidence artifacts over storing unnecessary conversational material.
This API is a control surface above the existing semantic contracts:
Connector API
-> WorkUnit
-> WorkerAdapter / external agent
-> ResultManifest
-> EvaluatorPlan
-> VerificationResult
-> Evidence Report
-> human decision
A change to this control API must not silently change the meaning of those canonical objects.