Skip to content

feat: Schema contracts and history - #5

Merged
rt2zz merged 6 commits into
mainfrom
schema-contracts-and-history
Sep 5, 2026
Merged

rt2zz merged 6 commits into
mainfrom
schema-contracts-and-history

Conversation

@rt2zz

@rt2zz rt2zz commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

No description provided.

rt2zz and others added 6 commits September 2, 2026 11:26
…isible horizon

A `horizon` message is a history boundary: for a generator that can see it,
projection renders history from the frame carrying it (messages before it
in that frame drop; the horizon itself stays so history projections see
the cut). It inherits audience semantics like any message (default
broadcast; a targeted horizon cuts only its targets). The fold, work
scheduling, and absorption ignore horizons — history is what the model
sees, work is durable state. Core has no opinion about what follows a
horizon; an app that wants a summary puts it in the same frame or the next.

visibleFramesForGenerator gains { horizon: "apply" | "ignore" }: projection
applies, absorption ignores.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…form

Every schema position in @projectors/core (StateDescriptor.schema,
Action.inputSchema, OutputConfig.schema, executor configSchema, charter and
node params, dataContent) now accepts any StandardSchemaV1 instead of a
z.ZodType. New src/schema.ts normalizes a schema once (memoized per object)
into a NormalizedSchema with synchronous validate/parse/accepts and a
jsonSchema() converter sourced from ~standard.jsonSchema (StandardJSONSchemaV1,
which zod 4 implements), falling back to z.toJSONSchema for vendor "zod", or an
explicit document attached via withJsonSchema(). Async validators and schemas
with no JSON Schema source are rejected at creation.

Type inference uses StandardSchemaV1.InferOutput/InferInput, so createState
and createAction infer the same types for zod schemas as before, and no zod
type appears in the public surface. zod stays a private dependency (hydration
of serialized JSON Schema via z.fromJSONSchema) and is no longer a peer
dependency consumers must pin. Params compatibility checks now read the
schema's input JSON Schema (properties/required) instead of zod's .shape.

Executors build AI SDK / LiveKit tools from the normalized JSON Schema and
validate through the normalized schema; the cascade executor validates tool
input itself since LiveKit no longer receives a zod object. Validation
failures surface as SchemaError with "<message> (at path)" text.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
WorkCompletionMessage.lastResult is a MessageRef to the last result-bearing
message the completing step produced — an action result (terminal actions
included) or an assistant message — so hosts need not scan frames for an
activation's outcome. Absent when the step produced neither. Apps with
another convention read the frames themselves; core takes no position on
what an activation "returns".

Also: ExecuteActionResult.error stays a human-readable string; structured
issues may be added alongside later.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ExecuteActionResult and the durable ActionResultMessage carry the schema's
issues verbatim on input validation failure; the error string is their
rendering (formatSchemaIssues).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
projector-demo Error Error Sep 5, 2026 5:29am UTC

@rt2zz
rt2zz merged commit bb9f354 into main Sep 5, 2026
1 of 3 checks passed

This branch had an error being deployed

1 failed deployment
Preview — e04e0685 Deployed Sep 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant