Compliance Work Runs

Compliance Work Runs are Retvest's public docs name for the governed review loop used when an AI answer, policy summary, or compliance claim needs evidence before it becomes a committed record.

Current status: the platform and app owner repos define the Work Run record, approval receipts, correction workflow, and audit-packet export. Admin UI browser-path smoke evidence for correction interactions is still pending, so public docs should describe the workflow and its evidence boundaries without claiming final production proof.

What A Work Run Contains

  • The proposed answer or claim summary, scoped to the source material reviewed by the operator.
  • Citation and retrieval metadata needed to decide whether the claim is supported.
  • Review state, including blocked, approved, or committed Work Run outcomes.
  • Append-only correction history with pending, applied, rejected, and superseded correction statuses.
  • Reviewer identity, role, timestamp, approval receipt, and vault commit receipt when a record is approved.
  • Audit-packet metadata that lets compliance, legal, or security review the run without reconstructing the workflow from chat logs.
  • Role-aware correction audit visibility that keeps raw correction text out of operator, reviewer, and unavailable states.
  • Correction packet manifest metadata for RIL proof review, limited to correction ids, sequences, statuses, hash-chain fields, and receipt digests.
  • Audit guarantees for correction metadata: sequence ordering, immutable correction rows, request IDs, and visibility scopes retained in a role-aware ledger.

Review Flow

  1. Seed a work run from a cited answer, compliance check, or policy review task.
  2. Inspect the evidence and the proposed claim in the admin Work Control UI.
  3. Correct unsupported or imprecise language before approval.
  4. Block the run when evidence is insufficient, or approve and commit it when the reviewed evidence supports the record.
  5. Export the audit packet from the same governed state for internal review.

This loop is intentionally narrower than a general chat transcript. A Work Run should answer who reviewed the output, what evidence they saw, what changed, what was approved or blocked, and which receipt proves the committed state.

Correction Lifecycle And Failure Handling

The lifecycle keeps this loop to a narrow set of correction states, bounded failure variants, and role-safe retries.

Common failure variants are surfaced as bounded Problem categories:

  • validation
  • conflict
  • already finalized
  • invalid transition
  • authorization
  • tenant mismatch
  • rate limit
  • unavailable
  • retryable failure

A retryable failure means the same body and idempotency key is preserved for exact idempotent replay before re-reading history.

Structured validation failures expose invalid_params entries with public-safe name and reason fields, so operator tools can point to bounded metadata without logging raw correction text. Current shipped limits are 80 characters for correction category and resolution reason code, 4000 characters each for original assertion, corrected assertion, and observed consequence, 120 characters for corrected evidence key, 240 characters each for evidence and rollback refs, 2000 characters for resolution note, and a list/audit page limit range of 1 to 100.

Correction model contract

Work Run correction behavior is append-only:

  • Submit pending corrections with one correction body and one Idempotency-Key.
  • List correction history before apply/reject/retry decisions so reviewers act on the latest inspected ledger.
  • Apply, reject, and retry-request actions append a lifecycle or follow-up row; the original pending row stays visible.
  • The system must not delete, overwrite, or hide existing correction rows.
  • Unresolved retry follow-up rows block approval/export until a follow-up correction is resolved.

Approval Submit Boundary

Public docs must separate the action that submits the inspected Work Run to the awaiting_approval gate from the final human approval decision. Submission means the run is ready for an authorized reviewer to decide; it is not approval, commit, export readiness, or evidence that the reviewer accepted the record.

Use awaiting_approval for the public approval gate state. A legacy pending and not_requested approval state may appear in owner storage or older fixtures, but it is not a public client state and must not be used in buyer docs, examples, or support copy. accepted can appear in non-public transition metadata, but it also must not be used in buyer docs, examples, or support copy. Public wording should say that an inspected Work Run was submitted to awaiting_approval, then approved, rejected, revoked, blocked, or exported only when owner evidence names that later transition.

Do not publish the approval submit request path, operation ID, SDK helper name, optimistic-version request fields, or approval-decision request fields until retvest-contracts, retvest-platform, retvest-app, and retvest-sdk all name the same shared contract surface and launch readiness links to that owner evidence. Until then, examples should describe the awaiting_approval state transition in prose only.

Approval And Export Boundary

Do not describe a Work Run as approved, committed, or export-ready while its correction review is unresolved. Before approval or export wording appears in public docs, the operator evidence should show a refreshed correction ledger, resolved pending review, no unresolved retry follow-up gate, and the approval version the reviewer inspected.

When a correction is applied, treat the previous approval view as stale until a fresh approval receipt or owner evidence ties the export to the corrected Work Run state. A rejected terminal correction can preserve the prior approval path only when the rejected row remains visible as metadata-only history and the approval evidence still matches the reviewed state. A retry follow-up decision blocks approval and export until a follow-up correction is resolved or the Work Run is explicitly blocked.

This page documents the public-safe boundary. Platform-owned fail-closed approval and export enforcement remains evidence for retvest-platform; do not turn this guidance into a shipped enforcement claim from this repo alone.

Audit guarantees for operators

Correction and correction-audit entries expose immutable metadata fields that are safe for public-safe investigation:

  • correction_id and correction_sequence for stable row identity.
  • correction_status for terminal and in-flight state.
  • expected_version / correction_sequence alignment for reviewer safety.
  • receipt_type, request_id, and timestamp for support correlation.
  • Hash-chain fields (prev_hash, row_hash) and receipt digest references.

Public guidance must keep raw evidence text, prompt material, customer payloads, tenant identifiers, and full UUID-heavy payloads out of notes and external support artifacts.

Common Validation And Auth Failures

For operators and scripts, map these common outcomes to safe remediation:

Failure class Expected operator/developer behavior
validation / validation_failed Keep draft local, redact customer text from notes, and correct bounded metadata.
conflict / version_conflict Refresh the ledger and compare sequence/version before retrying a review action.
already finalized Do not re-open terminal rows. Show the final status and require an explicit new pending correction when needed.
invalid transition Keep approval/export blocked and prompt for valid next decision.
authorization Collapse controls and suppress review-only metadata for unauthorized actors.
idempotency_conflict Confirm the actor intent before changing key or content; do not send a different body on the same idempotency key.
forbidden Hide restricted controls, collapse to permission messaging, and avoid sensitive review-only fields.
tenant_mismatch Show safe unavailable-style response, never expose another tenant’s status or content.
version_conflict Refresh ledger history and re-run reviewer decision from latest observed version.
invalid_transition Keep approval/export blocked, require explicit next valid action, and avoid blind automatic retries.
Retryable write/read failures (rate_limited, unavailable, timeout) Respect Retry-After, replay only the same body and idempotency key, then re-list before state changes.

Failure categories and remediation are intentionally bound to checked fixture examples in:

Evidence Boundaries

Public docs and support tickets must not include raw customer documents, prompts, generated answers, citation text, bearer tokens, private evidence refs, or full UUID-heavy audit payloads. Use counts, timestamps, status names, receipt types, and sanitized screenshots where proof is needed outside the customer's deployment boundary.

Role Expectations

Role Expected correction visibility
Operator Sees correction id, status, sequence, receipt type, timestamps, and bounded reason codes needed to continue review.
Reviewer or admin Can apply, reject, or request retry for pending corrections when scope permits and expected version still matches the inspected ledger state.
Unauthorized or tenant-mismatched actor Receives permission or unavailable messaging only; no raw correction text, sensitive tenant details, or cross-tenant existence hints are exposed.

API and SDK usage guide

Use these verified source-package and raw HTTP entry points only:

Operator Checks

  • Confirm the run has the expected tenant and collection scope.
  • Confirm citations match the claim being approved.
  • Confirm pending, applied, rejected, and superseded correction rows explain review state without exposing raw correction text.
  • Confirm unresolved correction review and retry follow-up gates are resolved before approval or export wording, and refresh the ledger after every applied correction.
  • Confirm rejected correction rows remain visible as metadata-only history.
  • Confirm role-aware audit views collapse unauthorized, revoked, or tenant mismatch states to safe Problem messaging.
  • Confirm approval receipts and vault commit receipts are present before treating a run as committed.
  • Confirm blocked runs can still produce an audit packet that explains the failed gate.
  • Confirm correction packet manifests stay metadata-only before sharing outside the customer deployment boundary.

Documentation checks

  • make docs-links validates internal references, anchors, inventory coverage, and sidebars for docs-shipped claims.
  • Recording corrections for correction workflow and API example boundaries.
  • [[admin-guide]] for audit and compliance export operations.
  • API reference for API publication status and auth conventions.
  • Troubleshooting for proof-readiness gaps that must stay visible until runtime evidence is captured.

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