Skip to content
OpenTrain AIOpenTrain AIOpenTrain AIDocs

Ask OpenTrain

Answers from the documentation, with sources.

What would you like to do with OpenTrain?

AI answers can be mistaken. Check the linked sources. Don’t include private account information.

Open app

DEVELOPER DOCUMENTATION

Hosted Instructions visual proof

Render the real employer Instructions workspace or designated worker reader into agent-readable visual evidence.

Hosted Instructions visual proof lets an authorized employer or agent inspect the actual OpenTrain Instructions UI without running a local browser. OpenTrain captures the real employer workspace or a real designated test-worker reader in Chromium and returns private PNG, ARIA, diagnostics, and provenance artifacts.

Base path: /api/public/v1/instructions/visual

Agents should fetch the PNG and ARIA artifacts directly. Create an observe link only when an authorized human needs to inspect the same pinned render.

  1. Read capabilities to discover audiences, targets, viewports, retention, and worker-coverage rules.
  2. Create a session pinned to the job’s current canonical Instructions tree.
  3. Select a page or stable node, or include it when creating the session.
  4. Render desktop, mobile, or both using the current state revision.
  5. Inspect the PNG and semantic evidence directly, or mint a human review link.
  6. Revoke the link or expire the session when review is complete.
MethodPathPurpose
GET/capabilitiesDiscover the hosted visual-proof contract.
POST/sessionsCreate an employer or designated-worker session pinned to a job tree.
GET/sessions/{sessionId}Read session state and live source drift.
POST/sessions/{sessionId}/manageSelect a page/node, expire the session, or refresh its renderer grant with an expected-state revision.
POST/sessions/{sessionId}/renderCapture desktop/mobile evidence through the real product renderer.
GET/sessions/{sessionId}/artifactsList bounded private evidence records.
GET/artifacts/{artifactId}Read one artifact with a fresh signed resource URL.
POST/GET/sessions/{sessionId}/linksCreate or list observe-only links.
POST/sessions/{sessionId}/links/{linkId}/revokeRevoke one link.

Employer session:

{
"jobId": "job_123",
"audience": "EMPLOYER",
"pageId": "page_456"
}

Worker session:

{
"jobId": "job_123",
"audience": "WORKER",
"workerContractId": "contract_test_789",
"pageId": "page_456"
}

Worker proof is valid only through a real contract designated for testing. The response carries typed workerCoverage; no synthetic worker is substituted.

Render with the session’s current revision:

{
"expectedStateRevision": 2,
"viewports": ["desktop", "mobile"],
"pageId": "page_456",
"nodeId": "stable-section-id"
}

The response binds each artifact to the exact session, audience, source tree, page/node, viewport, render revision, checksum, and byte size. It also reports source drift against the live canonical Instructions. A successful render sets browserRenderVerified: true.

collaborationSyncVerified is always false. The capture proves what the renderer displayed at that revision; it cannot prove that an already-open collaborative browser received a real-time update.

  • Reads and artifact access require instructions:read.
  • Session control, rendering, and link mutations require instructions:write, an Idempotency-Key, employer job access, and the Instructions visual-proof rollout for the actor.
  • State-changing operations require the current expectedStateRevision and fail closed on drift.
  • Sessions, artifacts, and links are organization-bound, expiring, and revocable.
  • Visual proof writes only isolated preview evidence. It never changes an Instructions page or learner record.
  • Retry a transient renderer 503 with the same idempotency key.

@opentrain-ai/sdk 0.21.0 or later exposes getInstructionsVisualCapabilities, createInstructionsVisualSession, getInstructionsVisualSession, manageInstructionsVisualSession, renderInstructionsVisual, artifact list/get, and link create/list/revoke.

Use the machine-readable OpenAPI document for complete request, response, and error schemas.