The caller defines the contract

A protobuf message can say both what a result contains and which rules it must satisfy. ProtoMolt uses that descriptor to guide generation, validate data, and decide whether an agent's deliverable is ready for review.

Overview. Define the result you want, attach executable validation rules, and submit that contract with the task. A response of the wrong type or one that violates those rules cannot become a valid deliverable. Once the contract passes, the reviewer can judge the work and its evidence.
flowchart LR
  caller["Caller · result type and rules"] --> task["Task contract"]
  task --> worker["Worker · result and evidence"]
  worker --> gate["Protocol and contract checks"]
  gate --> refusal["Invalid · refusal with findings"]
  gate --> candidate["Valid · candidate for review"]
  candidate --> review["Reviewer · accept, revise, or leave pending"]
A delegated task with a typed deliverable contract. Protocol, evidence, and deliverable checks run before candidate review.

The rules travel with the type

Protobuf describes fields and their types. Validation annotations add constraints such as required values, lengths, numeric bounds, and relationships between fields. CEL, the Common Expression Language, expresses those relationships as checked expressions. The validation engine reads the annotations from the descriptor at runtime.

A delegation contract carries the result's type name and descriptor set. Its rules do not have to be compiled into the worker's application. ProtoMolt checks the submitted result against the contract the caller supplied. A test builds an entirely new report descriptor at runtime, then proves that missing results, wrong types, invalid fields, and a failed message-level expression are refused.

Read the deliverable contract tests.

A report contract in action

The repository's example contract asks for a delivery.v1.ReviewReport, a headline between 8 and 120 characters, and a finding count greater than zero. These are that example's rules; each caller defines its own.

Refused before review. The headline “short” violates the minimum length of 8 characters.

Illustration of the tested rules. This page does not run a protobuf validator or call a model.

Structured generation returns a validated message

Give structured generation a target protobuf type and a configured model. The prompt renderer combines the descriptor's descriptions, constraints, quality dimensions, and model instructions. It also produces a JSON Schema for the model's structured-output constraint.

ProtoMolt parses the answer as strict protobuf JSON and validates the resulting message. Parse failures or rule violations become specific correction feedback, within a maximum of three total attempts. Success returns a typed message with attempt history and prompt and schema fingerprints. Exhausted attempts return a failure; provider errors abort immediately.

Read the structured generator or explore the inference guide.

Example: enrich a court opinion

The checked-in court example defines an OpinionMetadata result with court, caption, docket, year, disposition, judges, topics, authorities, and a headnote. Protobuf annotations place model instructions beside executable field and message rules: required values, bounded text and collections, and a CEL rule rejecting specified prose placeholders in the docket field.

A source can be too incomplete to support a result. Setting incomplete activates skip_when, which skips field validation, including nested fields. Message rules still run and require an incomplete_reason. A valid incomplete declaration means the result needs review; its remaining fields are not validated as a complete enrichment.

Read the court schema, validation engine, and incomplete-result tests.

Four saved rounds contain 315 document/persona fills using Qwen3-14B-int4 with appellate researcher, citator, and headnote editor instructions. They are historical experiment records. The first round showed that a structurally valid result could still invent a docket; the third recorded incomplete declarations passing their intended rules. Content fidelity needs a separate evidence check.

Saved results: round 1 (45), round 2 (90), round 3 (90), and round 4 (90). Findings: content fidelity and incomplete results.

For structured correction, the current generator turns parsing errors and rule violations into feedback for a bounded retry. That mechanism enforces the declared rules; it cannot establish that a schema-valid fact appears in the source. Correction implementation and tests. The saved court experiment is an example, not a current one-command walkthrough or a multi-provider production benchmark.

Validation, judgment, and receipts have distinct jobs

Validation determines whether a result satisfies its declared executable rules. Judgment evaluates the admissible result against the task: whether the reasoning is sound, the change is useful, and the evidence supports the conclusion. Model instructions can guide either activity; constraints expressed in the schema are the ones the validator enforces mechanically.

In delegation, required-check evidence and commit or artifact references accompany the candidate. A declared deliverable contract adds the typed result gate before the reviewer runs. The default reviewer leaves a candidate pending for an explicit decision. A task without a typed deliverable contract still has the protocol and evidence checks.

Workflows and delegation can project their recorded work into portable work records. Signing and offline verification let another party check the record's integrity and declared policy. The receipt preserves the evidence and decision that were recorded. See transformations, workflows, and receipts for that path.

Agents share a task contract and a conversation

The coordinator can offer work to registered agents, send guidance, follow progress and checkpoints, and accept a candidate or request a revision. The task console presents the worker directory, task offers, conversation, evidence, and review controls in a browser. These are existing delegation operations exposed through the same MCP tools.

Agent-host adapters cover Kimi, Codex, Cursor, Muse, Antigravity, and OpenAI-compatible endpoints, including the configured Glimmer worker. Claude Code can join directly through the delegation MCP tools. Each participant uses the shared protocol while retaining its own provider session and workspace where its adapter supports them.

Agent-host adapters and task console implementation.

Checkpoint recovery re-offers work as a new attempt with an optional prior checkpoint. It is not pause/resume of the same attempt. Coordinator recovery. Explore the browser workbench and its storage configuration.

Use the same foundation without an agent

Call ProtoValidator directly in Java, install validating gRPC interceptors, or validate records through the Kafka serializer. Use mappings and projections to produce another message shape from the data you already have. These are libraries you can compose in your application; the agent host is an additional way to use them.

Choose the validation library, projection library, or delegation library to start.