Consumer Runtime v0

Consumer Runtime v0 is the public source-doc shape for a customer-installable 24/7 runtime agent that can run continuously inside the customer's deployment boundary. It documents setup flow, security boundaries, approval gates, metadata-only evidence pointers, quota states, and shipped-only claim limits. It is documented from the contract-pinned retvest-contracts@0.8.2 OpenAPI surface and openapi/consumer-runtime-v0-consumer-pin.json.

Current status: this page is not production install proof, a managed 24/7 service claim, an uptime SLA, or a signed runtime package claim. Customer runtime release artifacts, customer-specific 24/7 operating proof, generated SDK methods, provider-specific deployment instructions, and provider-specific deployment support remain owner evidence pending.

Customer-Installable Model

The v0 runtime model is a governed worker loop that a customer can install inside their own deployment boundary once owner release evidence exists. The runtime registers a tenant-scoped agent, heartbeats to receive current policy and quota state, leases bounded work, records metadata-only evidence pointers, asks approval gates before guarded actions, and finalizes work with an outcome receipt.

This page does not grant broad local authority. The contract describes control messages and receipts; retvest-platform evidence must still prove exact process isolation, network policy, package signing, release commands, runtime auth, prompt-injection handling, log redaction, quota enforcement, stop-control enforcement, and production install behavior before public copy can claim those capabilities are shipped.

Contract-Pinned Surface

The v0 contract pins these tenant-scoped runtime operations:

Runtime step Operation Public-safe purpose
Register agent POST /runtime/v0/tenants/{tenant_id}/agents Create a tenant-scoped runtime agent record with heartbeat, quota, stop, and audit receipt controls.
Heartbeat POST /runtime/v0/tenants/{tenant_id}/agents/{agent_id}/heartbeat Report runtime liveness and receive quota plus stop-control instructions before leasing more work.
Lease work POST /runtime/v0/tenants/{tenant_id}/agents/{agent_id}/work/lease Lease bounded work with policy revision, authority scope, evidence requirements, approval requirements, and hard limits.
Upload evidence POST /runtime/v0/tenants/{tenant_id}/work/{work_id}/evidence Append a metadata-only evidence pointer for customer-retained runtime artifacts.
Approval gate POST /runtime/v0/tenants/{tenant_id}/work/{work_id}/approvals/gate Ask whether a guarded action is allowed, approval_required, or denied under the tenant policy revision.
Quota status GET /runtime/v0/tenants/{tenant_id}/quota Read tenant runtime quota state as open, limited, or held.
Stop agent POST /runtime/v0/tenants/{tenant_id}/agents/{agent_id}/stop Request running, stop_requested, or stopped control for one tenant-scoped agent.
Outcome receipt POST /runtime/v0/tenants/{tenant_id}/work/{work_id}/outcome-receipts Finalize bounded work with an auditable outcome receipt tied to lease, evidence, approval, and result digest references.

The contract pin also requires API key scope runtime:*. Do not broaden this page into general admin-session, filesystem, shell, model-routing, or provider-specific deployment claims.

Local DB-Backed Owner Proof

retvest-platform/api/tests/test_consumer_runtime_postgres_proof.py::test_consumer_runtime_v0_postgres_workflow_and_denials is the owner-source integration proof for the current lifecycle slice. It uses the migrated Postgres test engine and the ASGI HTTP routes without monkeypatches or application dependency overrides. The test creates a scoped runtime API key, registers an agent, heartbeats it, leases work, persists a metadata-only evidence receipt, and reads the ordered audit events.

The same test obtains a token from a second lease and submits it against the first work item; the evidence request is refused with HTTP 403 and a runtime_lease_token_invalid audit event. It then makes the persisted agent heartbeat older than the platform limit and proves another lease is refused with HTTP 409 and RUNTIME_AGENT_HEARTBEAT_STALE. Finally, the test independently re-derives every audit row hash and verifies each prev_hash link, including both refusal events.

The platform-owned test-consumer-runtime-postgres-proof target runs the scenario against Postgres. This is local source and integration evidence only. It is not customer installation proof, release-artifact evidence, an uptime claim, or proof of provider-specific deployment behavior.

Outcome Receipt Contract Names

The outcome receipt endpoint is pinned to the shipped RuntimeOutcomeReceiptRequest request body and RuntimeOutcomeReceiptResponse response envelope. Public examples should use those contract names when describing the HTTP request and response shape.

The request body may name only the contract fields agent_id, lease_token, evidence_receipt_ids, approval_id, result_digest, summary, outcome, and completed_at. The response envelope may name outcome_receipt_id, tenant_ref, work_id, accepted_at, and the nested runtime audit receipt. ConsumerRuntimeOutcomeRequest and ConsumerRuntimeOutcomeReceipt are SDK alias names for that same shipped request and response pair. ConsumerRuntimeOutcomeRequest maps only to RuntimeOutcomeReceiptRequest and is an SDK alias; ConsumerRuntimeOutcomeReceipt maps only to RuntimeOutcomeReceiptResponse and is an SDK alias; they are not separate wrapper schemas, alternate OpenAPI examples, or proof that generated runtime SDK methods are published.

The site gate checks these names, required fields, type annotations, route references, and examples against the owner OpenAPI, both SDK source fixtures, and the RIL model, exporter metadata, and example. It fails closed when those owner and consumer sources diverge. Public values may replace owner identifiers and the audit location with safe placeholders; the contract shape and constraints remain pinned.

The same gate checks the nested RuntimeAuditReceipt fields and receipt-type enum, the TypeScript request serializer, and its response-envelope validator. It also requires both SDK helpers to bind the submitted result_digest to the nested audit digest and to keep outcome_receipt_id distinct from the audit receipt_id. That prevents a declaration-only match from hiding a runtime helper that sends the wrong request field or accepts a mismatched receipt.

RuntimeOutcomeReceiptRequest example

The request uses the shipped field names, a non-empty evidence receipt list, one of the four contract outcome values, and a bare lowercase SHA-256 digest.

{
  "agent_id": "agent_example",
  "approval_id": "approval_example",
  "completed_at": "2026-07-09T22:00:00Z",
  "evidence_receipt_ids": [
    "evrec_example"
  ],
  "lease_token": "lease_token_example",
  "outcome": "succeeded",
  "result_digest": "6666666666666666666666666666666666666666666666666666666666666666",
  "summary": "Bounded work completed with the required evidence and approval references."
}

RuntimeOutcomeReceiptResponse example

The response is the shipped envelope, not a bare audit receipt. Its nested receipt binds the same agent, tenant, and work references. The public example keeps the owner-controlled audit location opaque.

{
  "accepted_at": "2026-07-09T22:00:01Z",
  "outcome_receipt_id": "outrec_example",
  "receipt": {
    "agent_id": "agent_example",
    "audit_uri": "<opaque-audit-uri>",
    "created_at": "2026-07-09T22:00:01Z",
    "digest": "6666666666666666666666666666666666666666666666666666666666666666",
    "previous_digest": "5555555555555555555555555555555555555555555555555555555555555555",
    "receipt_id": "rtrec_example",
    "receipt_type": "outcome",
    "tenant_ref": "tenant_example",
    "work_id": "work_example"
  },
  "tenant_ref": "tenant_example",
  "work_id": "work_example"
}

Setup Flow

Use this setup flow as a source-only checklist until retvest-platform release evidence names the install artifact and commands:

Phase Runtime action Public-safe proof to retain
Preflight Confirm the customer deployment is covered by current platform release evidence and the retvest-contracts@0.8.2 runtime consumer pin. Contract version, release evidence identifier, environment label, and reviewer.
Credential Create a tenant-scoped runtime credential with only the runtime:* scope and store it in the customer's secrets manager. Credential id or key fingerprint, scope, created timestamp, rotation owner, and secrets-manager reference.
Install Install the runtime artifact only from platform-owned release instructions. This site does not publish package, container, Helm, or Terraform runtime release commands yet. Artifact name, version, digest, source release evidence, and command transcript location without secrets.
Register Register the agent with runtime_installation_id, display_name, agent_version, requested work scopes, capabilities, and host fingerprint. Returned agent_id, registration_id, policy_revision, heartbeat interval, quota state, stop control, and registration receipt.
Steady state Send heartbeats on the returned interval, then request bounded leases only when quota and stop controls allow new work. Heartbeat timestamps, lease ids, lease_token digest, leased_until, authority scope, policy revision, and hard-limit summary.
Guarded action Upload metadata evidence pointers and evaluate approval gates before guarded actions. Evidence receipt ids, approval decision, approver role when required, request id, policy revision, and audit receipt.
Finalize Create an outcome receipt only after required evidence and approval references are present. Outcome receipt id, result digest, evidence receipt ids, approval id when required, final outcome, and previous receipt digest.
Hold or stop Honor quota held, limited, stop_requested, and stopped states before taking more work. Hold reason, stop reason, drain deadline when present, last accepted lease, and operator acknowledgement.

If any setup phase lacks owner evidence, keep the runtime in a no-new-work state and keep public copy source-only.

Security Boundaries

  • The runtime is customer-installed and tenant-scoped; all documented paths include tenant_id.
  • Public examples must stay metadata-only: no bearer tokens, customer documents, raw prompts, generated answers, citation text, private evidence refs, or full UUID-heavy payload dumps.
  • Evidence upload uses content_sha256, content_uri, evidence_type, captured_at, and redaction_status; raw runtime artifacts stay in the customer-controlled vault or storage boundary.
  • Work leases carry an authority_scope, policy_revision, replay_seed, lease_token, and hard limits. The runtime must not treat the lease as a broad autonomous action grant.
  • Stop control must be honored locally before accepting or executing more work.
  • Missing or stale policy_revision, lease_token, quota, stop-control, or approval state is a no-new-work condition.
  • A runtime credential with runtime:* scope is not an admin login, an interactive user session, a broad shell grant, or permission to read arbitrary customer files.
  • Public docs must not describe exact network egress, local sandbox, filesystem, model-provider, or log-redaction behavior as shipped until the owner release evidence names those controls.
  • Provider-specific deployment support, model-provider routing, runtime auth, prompt-injection controls, log redaction, and signed release details remain platform-owned evidence boundaries until the claim ledger names exact shipped wording.

Content Guards

Runtime public docs must stay source-only and metadata-only until owner evidence promotes a shipped claim. Use these guardrails when adding examples, buyer replies, operator checklists, marketing copy, launch notes, or release notes: Allowed public runtime content appears in the left column. Blocked public runtime content appears in the right column.

Public-safe wording Do not say until owner evidence exists
Consumer Runtime v0 is source-documented and contract-pinned. Block shipped, generally available, or production-ready Runtime v0 wording until owner evidence exists.
The docs describe a customer-installable 24/7 runtime model. Block managed 24/7 service, SLA-backed, production-proven, or provider-supported runtime wording until owner evidence exists.
Runtime setup remains tied to platform-owned release instructions. Block runtime package, container, Helm, Docker, Kubernetes, Terraform, curl, pip, npm, pnpm, provider-specific commands, copied release transcripts, or signed-artifact availability claims until owner evidence exists.
Evidence examples are metadata-only pointers to customer-retained artifacts. Block examples containing customer documents, prompts, answers, citation bodies, raw logs, bearer tokens, private evidence refs, or concrete vault/storage/audit URIs.
Quota and stop states are part of the pinned control-plane contract. Block shipped quota, stop-control, runtime-auth, prompt-injection, log-redaction, or network-isolation claims until owner evidence exists.
Continuous operation remains a source design until owner proof names the operating window. Block always-on production operation, support SLA, fully offline, no operator intervention, or 24/7 production proof until owner evidence exists.
Quota docs name states and field names without default numeric limits. Block default numeric quota limits, unlimited work, or quota behavior proof until owner evidence exists.
Approval gates require explicit allowed decisions before guarded actions. Block legal approval, unattended approval automation, or launch-complete fail-closed enforcement wording.
Approval examples may name decisions, required approver roles, request ids, and receipt ids only. Block approval tokens, approval secrets, customer identifiers, tenant secrets, raw logs, private audit URIs, or private proof-packet URIs.
Owner evidence is pending for generated runtime SDK methods. Block published generated runtime SDK methods, package registry distribution, or customer automation until owner evidence exists.

Review these limits against the claim ledger when changing public docs. Run make site-claims for marketing copy and the full owner-repo gate with make verify before handoff.

Runtime Control Loop

The public-safe control loop is intentionally small:

  1. Heartbeat and read the returned quota, stop_control, and policy_revision.
  2. Refuse new work if quota is held, stop control is stop_requested or stopped, or the policy revision is missing or stale.
  3. Lease one bounded unit of work and enforce the returned authority scope, evidence requirements, approval requirements, expiry, replay seed, and limits locally.
  4. Record only metadata evidence pointers for artifacts retained by the customer.
  5. Ask the approval gate before any guarded action and proceed only on allowed.
  6. Finalize with an outcome receipt that references the lease, evidence receipts, approval id when required, result digest, and final outcome.

The loop is 24/7-capable as a source design, but public docs must not describe it as production-proven continuous operation until owner evidence verifies an actual customer or staging runtime over the required operating window.

Failure And Hold States

Runtime condition Required behavior
Missing heartbeat response Stop requesting leases and surface an operator-visible runtime incident.
Stale or unknown policy_revision Refuse new work until the next successful heartbeat or owner-controlled policy refresh.
Expired leased_until Stop work for that lease and request a fresh lease only when quota and stop state allow it.
approval_required Preserve the approval metadata and wait for the required human path.
denied Do not perform the guarded action; finalize or abandon according to owner policy.
Evidence upload failure Keep artifacts in customer storage and do not create an outcome receipt that claims missing evidence.
Quota limited Avoid expanding work and preserve hold_reason for operator review.
Quota held Take no new work until the hold is cleared by owner-controlled policy.
stop_requested Drain bounded cleanup only until the returned deadline; do not lease more work.
stopped Remain stopped until owner-controlled state permits work again.

Approvals

Approval gates are explicit runtime control-plane decisions. A runtime action can proceed only when the gate returns allowed. When the decision is approval_required, the runtime must preserve the approval_id, required_approver_role, reason, policy_revision, and receipt metadata and wait for the required human approval path. When the decision is denied, the runtime must not perform the guarded action.

Do not describe approval gates as legal approval, unattended approval automation, or a launch-complete guarantee. Approval wording remains tied to the tenant policy revision, evidence receipts, outcome receipt, and owner evidence for the customer deployment.

Evidence And Receipts

Runtime evidence is recorded as a metadata-only pointer. The public-safe shape is a digest, a customer-vault URI, a redaction status, and an audit receipt. The outcome receipt then binds the work id, lease token, evidence receipt ids, approval id when required, result digest, summary, and final outcome.

Receipts are append-only runtime audit records with receipt_id, receipt_type, tenant_ref, agent_id, work_id, digest, previous_digest, audit_uri, and created_at. Public docs may name this shape; they must not publish customer payloads or private audit packet refs.

Customer Proof Packet Shape

Use this shape when a buyer or operator asks what a runtime proof packet would contain. The packet remains source-only until the owner repos provide a sanitized customer or staging evidence packet.

Proof row Public-safe fields Still blocked until owner evidence exists
Contract pin retvest-contracts version, consumer pin path, operation ids, schema digest, reviewer, and timestamp. Generated runtime SDK methods, unpublished OpenAPI snapshots, or inferred request fields.
Release artifact Runtime release artifact name, version, digest, signing status label, release evidence id, and install transcript location with secrets removed. Exact package, container, Helm, Terraform, curl, provider-specific, or signed-release availability claims.
Credential boundary Runtime credential id or fingerprint, runtime:* scope, tenant id, creation timestamp, rotation owner, and secrets-manager reference. Bearer token values, broad admin credentials, interactive session cookies, or customer secret names.
Registration and heartbeat agent_id, runtime_installation_id, host fingerprint digest, heartbeat interval, policy revision, quota state, stop control, and audit receipt id. Host internals, raw logs, network topology, local sandbox details, or provider routing details.
Lease and authority Work id, lease id, lease_token digest, authority_scope, policy revision, replay seed, expiry, and hard-limit summary. Broad filesystem, shell, model-routing, or autonomous authority claims not present in the owner evidence.
Approval gate Approval decision, approval_id when present, required approver role, policy revision, request id, reason code, and audit receipt id. Legal approval, unattended approval automation, or launch-complete fail-closed wording.
Evidence and outcome Evidence receipt ids, content digests, redaction status, customer-vault URI class, outcome receipt id, result digest, final outcome, and previous receipt digest. Customer documents, raw prompts, generated answers, citation bodies, private evidence refs, full audit payloads, or bearer tokens.
Quota and stop behavior open, limited, or held quota state, hold_reason, active-work counts, evidence-byte budget, running, stop_requested, or stopped state, and operator acknowledgement. Shipped quota enforcement, stop-control enforcement, default numeric limits, unlimited work, or fully offline behavior.
Continuous operation Start and end timestamps for the inspected 24/7 operating window, heartbeat count, lease count, incident count, stop/hold events, and reviewer conclusion. Production-proven 24/7 operation, uptime SLA, managed service wording, or provider-supported runtime behavior.

Do not include bearer tokens, raw prompts, generated answers, citation bodies, customer documents, private evidence refs, UUID-heavy payload dumps, or raw runtime logs in a public proof packet.

Quotas And Stop Controls

Tenant runtime quota is part of every control-plane decision. The contract pins max_active_work, active_work, max_daily_leases, used_daily_leases, evidence_bytes_remaining, period_start, period_end, state, and hold_reason.

Quota states have operational meaning:

State Runtime behavior
open The runtime may request work within the returned lease and evidence limits.
limited The runtime must respect the operator-visible hold_reason and avoid expanding work.
held The runtime must stop taking new work until the hold is cleared by owner-controlled policy.

Stop control is separate from quota. A stop_requested response can include a drain deadline and reason; the runtime should finish bounded cleanup and refuse new work. A stopped response means the runtime must remain stopped until a new owner-controlled state permits work again.

Operator Checklist

  • Confirm the agent is registered to the expected tenant boundary and install id before it receives work.
  • Confirm the heartbeat interval is current and stale agents are not taking new leases.
  • Confirm quota state is open before allowing new work, and preserve any hold_reason for operator review.
  • Confirm stop state is running; honor stop_requested and stopped before requesting or executing more work.
  • Confirm every work lease carries bounded tools, authority scope, evidence requirements, approval requirement, replay seed, lease expiry, and hard limits.
  • Confirm approval-gated work has an approval-gate decision before outcome.
  • Confirm evidence uploads are metadata-only pointers to customer-retained artifacts.
  • Confirm outcome receipts bind work id, lease token, evidence receipt ids, approval id when required, result digest, summary, and audit receipt.

Owner Evidence Promotion Checklist

Do not promote this page from status: source-foundation or change shipped-only wording until all owner evidence is named in Public claim ledger and Launch readiness:

Owner repo Evidence required before shipped wording
retvest-contracts Current OpenAPI runtime surface, consumer pin, schema examples, and drift checks for all runtime operations.
retvest-platform Runtime implementation proof, license validation, tenant-scoped auth, quota behavior, stop-control behavior, release artifact, signed release status, and production install proof.
retvest-app Customer web or desktop workflow proof for runtime setup, operator review, approvals, holds, stops, and evidence inspection when those workflows are exposed.
retvest-ril Replay, projection, packet, and proof-runtime semantics tied to runtime evidence and outcome receipts.
retvest-sdk Generated SDK and CLI method availability, package registry evidence, and examples checked against the pinned runtime contract.
retvest-site Claim-ledger update, public docs update, content guards, launch-readiness update, make site-claims, and make verify.

If any row is missing, keep the runtime claim source-only, name the blocker, and avoid implying customer-ready availability.

Shipped-Only Claim Limits

Public copy may say Consumer Runtime v0 is source-documented and contract pinned. Public copy must not say the customer runtime is production-ready, generally available, signed, hosted, provider-certified, air-gapped, or proven for 24/7 production operation until owner evidence exists.

Before promoting this page beyond source documentation, collect owner evidence for the runtime release artifact, install commands, tenant-scoped credential flow, heartbeat and stop behavior, bounded lease enforcement, approval gate, metadata-only evidence upload, quota enforcement, outcome receipts, generated SDK methods, browser/admin operator proof if exposed in the app, and sanitized customer or staging install proof.

Choose what this site may use. Your choice is kept in this browser only.