IDKMesh

IDKMesh API Conventions v0.1

Status: proposed baseline; issue #736 owns review/freeze
Date: 2026-09-23
Program: #713

This specification defines cross-cutting conventions for IDKMesh HTTP product APIs. Domain specifications remain authoritative for domain semantics.

1. Namespace and versions

Product endpoints use:

/api/v1/...

Operational probes use:

URL compatibility version and object schema version are separate.

Every IDKMesh API object should expose an explicit version field appropriate to its contract, for example:

{
  "kind": "idkmesh-control-tower-snapshot",
  "schema_version": "0.1"
}

A URL v1 breaking semantic change requires explicit migration/version review.

2. JSON

Default media type:

application/json

A domain may additionally define a versioned vendor media type.

Requirements:

3. Resource identity

Resource IDs must be:

Content identity uses canonical digests where required:

sha256:<64-lowercase-hex>

A filename, branch name, UI row number, or mutable provider URL is not a substitute for immutable content identity.

4. Response envelope

Domain resources may be returned directly when a schema explicitly defines that shape.

Operation/result envelopes should carry:

Do not add request-specific timestamps/random values to otherwise deterministic evidence projections.

5. Standard error envelope

All JSON API errors should follow one stable structure:

{
  "api_version": "v1",
  "schema_version": "0.1",
  "kind": "idkmesh-api-error",
  "ok": false,
  "error": {
    "code": "stable_machine_code",
    "message": "human-readable explanation",
    "retryable": false,
    "details": {}
  }
}

Rules:

6. HTTP status mapping

Baseline meanings:

Issue #736 freezes any final mapping changes.

7. Request correlation

Accept safe caller X-Request-ID; replace invalid/unbounded values.

Every response exposes the effective request ID.

Request IDs:

8. Service metadata

Services should expose stable bounded headers such as:

Evidence projections may expose:

No-store policy may coexist with ETag when ETag is an integrity/equality signal rather than cache permission.

9. Authentication and authorization

Local profile

A loopback session token may protect a local browser/API service.

It is not a human/service principal.

Network profile

A request that can access project state or mutate durable state must carry a trusted authenticated principal and pass policy authorization.

Endpoint specifications declare required scopes/actions.

Authority must never be inferred from:

10. List endpoints

List endpoints require:

Proposed response shape:

{
  "kind": "idkmesh-list",
  "schema_version": "0.1",
  "items": [],
  "page": {
    "next_cursor": null,
    "limit": 50
  }
}

Offset pagination should be avoided for mutable event/run streams unless a domain demonstrates safe semantics.

11. Filtering

Filters must be explicitly enumerated and bounded.

Do not expose arbitrary expression languages in v1.

Unknown filters fail explicitly rather than being silently ignored.

12. Mutations and idempotency

Every externally retried mutation defines whether it is idempotent.

For creation/dispatch/decision-recording APIs, prefer requiring:

Idempotency-Key

Semantics:

same key + same canonical request digest
 -> return/refer to the original logical result

same key + different canonical request digest
 -> 409 conflict

Persist the idempotency record before invoking an external side effect when required by the operation.

13. Concurrency

Mutable resources define an optimistic-concurrency strategy before release.

Preferred forms:

A retry must not silently overwrite a newer human or policy decision.

14. Human decisions

A Human Decision Record:

Integration execution is a separate operation and policy boundary.

15. Events

Canonical events are immutable and append-only.

Events should include:

Historical query uses cursor pagination.

Live read delivery begins with resumable SSE.

16. Health and readiness

/healthz answers whether the process is alive.

/readyz answers whether the service is ready for its declared profile.

Neither endpoint exposes project/evidence/secrets.

Readiness may report bounded dependency state in the network profile.

17. Limits and overload

Every deployment profile documents:

Use 429/503 explicitly; do not allow uncontrolled memory growth.

18. Logging, metrics, tracing

Logs/telemetry must not contain:

Network profile should support W3C traceparent.

Telemetry identifiers are not authority/evidence.

19. OpenAPI and JSON Schema

OpenAPI is a discovery/transport contract, not the sole source of domain truth.

Requirements:

20. Deprecation

Stable API deprecation must be explicit.

Final policy is owned by #736, but should include:

Nothing is removed merely because a newer UI stopped using it.

21. Security-sensitive browser mutations

If/when network browser mutations exist, define:

Local token behavior must not be copied blindly into network mode.

22. Compatibility classes

Every API change should be labeled internally as one of:

Breaking changes require the process defined by #736 and release/migration evidence.

23. Authority statement

These conventions standardize transport behavior.

They do not grant:

Authority remains owned by domain policy and explicit actor/governance decisions.