07. Canonical API Surface (FACET v2.1.3)

FACET standardizes a language/runtime contract, not a provider-specific inference API. The practical integration boundary is Canonical JSON.

Canonical JSON object

Phase 5 must produce:

{
  "metadata": {
    "facet_version": "2.1.3",
    "profile": "hypervisor",
    "mode": "exec",
    "host_profile_id": "...",
    "document_hash": "sha256:...",
    "policy_hash": "sha256:...",
    "policy_version": "1",
    "budget_units": 32000,
    "target_provider_id": "generic-llm"
  },
  "tools": [],
  "messages": [
    { "role": "system", "content": "..." },
    { "role": "user", "content": "..." }
  ]
}

Metadata fields

Ordering requirements

Tool exposure

When @system.tools exists:

Content forms

Message content is either:

Canonical assets

Image asset shape (example):

{
  "kind": "image",
  "format": "jpeg",
  "digest": { "algo": "sha256", "value": "..." },
  "shape": { "width": 1024, "height": 768 }
}

Audio asset shape (example):

{
  "kind": "audio",
  "format": "wav",
  "digest": { "algo": "sha256", "value": "..." },
  "shape": { "duration": 3.2 }
}

Serialization

Canonical JSON must use RFC 8785 (JCS) or equivalent canonicalization:

Execution Artifact (Hypervisor)

When emitted, the artifact is separate from canonical JSON and includes:

See Appendix F for the normative schema.