Skip to content

Execution Contract Evolution

Status: active in SPEC_VERSION 0.3.0. The execution contract now defines governed-by-default semantics, stable error classification, and explicit independent opt-outs. This design does not by itself publish an SDK or establish production readiness.

Decisions

PRAXO-CORE (praxo-core, praxocore) converges execution semantics before freezing additional SDK APIs. The specification is governed-by-default construction and execution, explicit independent opt-outs, stable error classification, and per-implementation stability acceptance. Go remains the reference implementation; the specification, not an implementation accident, defines shared behavior.

See Execution Errors, SDK Stability Acceptance, and the execution contract requirements. These requirements define the active contract; implementation support remains a per-SDK acceptance claim.

Architecture

Application configuration
  -> normalize explicit governance choices
  -> validate required capabilities and policy
  -> freeze effective tool scope
  -> run entry validation
  -> model step through the same middleware boundary in both modes
  -> prepare tool batch: proposal, middleware, HITL, final authorization
  -> commit final calls to conversation history
  -> execute bounded batch
  -> observe every started outcome, preserve primary failure
  -> finalize once; classify errors for return/events/telemetry

The core owns execution invariants. Applications own identity, authorization decisions, credentials, stores, effect verification and idempotency. Adapters own provider protocol translation. Observability adapters project classified errors; they must not infer classifications by parsing messages.

Governed Defaults

The target configuration must distinguish an omitted tool scope from an explicit empty scope, including in languages whose zero-value collections cannot express that distinction. A scope discriminator or explicit scope object is preferable to relying on null-versus-empty collection behavior across languages.

Input Target behavior
Missing Policy Reject before model/tool access
Explicit allow-without-policy choice and missing Policy Skip policy only; retain all other checks
Omitted tool scope Reject before model/tool access
Explicit empty tool scope Allow no tools; model-only runs remain valid
Named tool scope Advertise and execute only those names
Explicit all-registered scope Snapshot names at assembly; later registration cannot widen scope

An opt-out is configuration intent, not a nil value. Allowing all tools does not disable Policy. Allowing no Policy does not disable tool scoping. Neither choice disables schema validation, HITL, cancellation or host containment. A configured Policy denial always fails closed. A framework default cannot establish that an application's Policy is correct or that its tools enforce resource-level access.

Validation must also occur at run entry: direct constructors and mutable fields must not bypass required controls. Effective run configuration is immutable for the run. Changes require a new assembly or run; callbacks must not mutate retained configuration asynchronously. No diagnostic should serialize Policy, credentials, raw arguments or identity claims just to report the chosen mode.

Scope And Opt-Out Shape

This subsection defines concrete shapes for the table above in the active contract; names remain language-idiomatic.

Concern Representation Default
Policy requirement required unless explicitly opted out required
Policy opt-out explicit allow-no-policy flag off
Tool scope scope object: unspecified, none, named, all-registered unspecified
  • unspecified scope and missing Policy reject before model or tool access; they are errors, not skipped checks.
  • none is valid and exposes zero tools; model-only runs remain valid.
  • all-registered snapshots names at assembly; later registration cannot widen it.
  • There is no separate scope opt-out: choosing all-registered is already explicit.
  • Opt-outs are independent. Allowing no Policy does not widen tool scope, and allowing all registered tools does not skip Policy, schema validation, HITL, cancellation or host containment.
  • Run entry revalidates the frozen effective configuration. A direct constructor or zero-value instance cannot bypass required controls.
  • Diagnostics report the chosen mode, not Policy contents, credentials, arguments or identity claims.

Go shape:

type ToolScopeMode int

const (
    ToolScopeUnspecified ToolScopeMode = iota
    ToolScopeNone
    ToolScopeNamed
    ToolScopeAllRegistered
)

type ToolScope struct {
    Mode  ToolScopeMode
    Names []string
}

Options carries Scope *ToolScope and AllowNoPolicy bool. agent.New validates and freezes them; Run revalidates the frozen value. A nil Scope means unspecified, never "all".

A configuration-resolution prototype with tests lives in internal/governance. Its private fields and defensive-copy accessors protect the resolved name set. PolicyPresent is a synthetic test input, not proof that an Agent holds or enforces a Policy. This prototype implements neither run-entry validation nor runtime authorization and does not establish GOV-04 acceptance.

Go now wires this into the default constructor. agent.New requires a Policy unless AllowNoPolicy is set, requires an explicit ToolScope, snapshots AllRegistered names at construction, and filters both advertised and invokable tools. A named scope must reference registered tools. agent.NewLegacy keeps the previous permissive defaults for migration. Rejecting directly constructed agents at run entry is still pending.

Python now matches this default: AgentOptions is governed unless legacy=True is set. ToolScope selects none/named/all-registered, and allow_no_policy is the independent policy opt-out.

TypeScript now matches this default: AgentOptions is governed unless legacy: true is set. scope selects none/named/all-registered, and allowNoPolicy is the independent policy opt-out.

Rust now matches this default: AgentOptions::new is governed and AgentOptions::legacy keeps the previous permissive behavior. ToolScope selects none/named/all-registered, and allow_no_policy is the policy opt-out.

Java now matches this default: AgentOptions is governed unless AgentOptions.legacy(model) is used. ToolScope selects none/named/all-registered, and allowNoPolicy is the policy opt-out.

Binding And Migration

The target Agent derives Policy presence from the actual configured dependency, not a caller-supplied boolean. AllowNoPolicy permits absence only: a configured Policy is still called, and its denial or error blocks execution. Model-only applications may explicitly choose none and opt out of Policy without supplying a dummy authorizer.

Assembly binds authorized names to registered tool instances; later same-name replacement must not silently change the execution target. New registration or rebinding requires a new assembly. The internal prototype models this as Effective.Bind(registered) returning a RunScope; binding rejects names that are no longer registered, and RunScope.Allows authorizes only bound names. Freezing copies framework configuration and retains dependency references; it cannot freeze mutable application-owned Policy internals or establish OS isolation. Callback mutation cannot widen a run's scope.

During migration, do not silently intersect, union or prioritize legacy AllowedTools against Scope: reject simultaneous use. Explicit legacy RequirePolicy=true must conflict with AllowNoPolicy=true; enabling RequireToolScope must not reinterpret none as omitted. Go's legacy booleans cannot distinguish omitted from explicit false, so false cannot be a new opt-out. The active contract does not let legacy empty AllowedTools mean all tools: callers must select an explicit scope. Versioned migration guidance and unchanged-consumer tests accompany the migration, not a perpetual permissive fallback. The internal prototype encodes the conflict checks as ValidateMigration.

Execution Invariants

The original model proposal remains available for application-owned audit. The conversation used by subsequent model requests records the final effective tool name, ID and arguments, paired with the corresponding tool result. An approval edit is not permission to change an approved call again. Complete final authorization of a batch before starting any of its tools.

Streaming and non-streaming use the same model middleware ordering. A language may use different native concurrency mechanisms, but bounded execution, result ordering and outcome observation must follow the same declared behavior.

After a batch starts, observe every started outcome even when an earlier result or callback fails. Preserve the first primary error and retain secondary cleanup failures without replacing it. Cancellation does not roll back committed effects and cannot force arbitrary in-process callbacks to stop. A completed terminal state cannot later be overwritten by cancellation; cancellation and terminal commit require one defined linearization point.

Attempting a completion notification is not an atomic commit to all sinks. Once completion delivery starts, a sink error must not be translated into an unqualified opposite terminal notification. Report delivery failure separately from execution outcome. This is an active requirement; SDK event behavior acceptance remains per SDK.

Specification Boundaries

The target specification contains shared execution semantics, versioned data and protocol contracts, and conditional capability contracts. Every Core must meet the base contract; a declared optional capability must meet its requirements. Capabilities are not alternate security tiers and cannot waive base governance.

Source API naming remains idiomatic. A language extension must be namespaced and must not be advertised as shared conformance. Shared capability adoption requires a reference implementation, negative fixtures and evidence from affected SDKs. Go tests validate the contract but are not a substitute for normative review.

History continuation, checkpoint serialization and durable execution are separate capabilities. This contract adds no durable step recovery, effect ledger, distributed transaction, exactly-once guarantee or automatic retry permission.

Compatibility

The owner explicitly chose to retain the Go v2 module line on 2026-12-04 while preparing other independent SDKs for 1.0. The governed-default migration is a narrow, intentional behavioral compatibility exception, not a claim that changing defaults is backward compatible. It requires an identified v2 minor release, migration notes, explicit opt-outs and final-artifact consumer verification. Existing v2 permissive defaults remain available only through the legacy constructor. This decision does not authorize unrelated source, wire or lifecycle breakage within v2.

Independent 0.x SDKs make breaking changes in a minor release with migration notes before 1.0. Stable SDKs otherwise require a major release or an explicit compatible opt-in path.

Wire changes require consumer review, including unknown-field/code handling; an optional field is not automatically compatible. This activation sets SPEC_VERSION to 0.3.0 and retains the 0.2.0 vectors and wire snapshots. Further requirements require implementation, vector, parity, migration and packaged-consumer evidence for the affected scope.

Specification and package versions are independent. For example, a future Go v2 release and a Python 1.0 release can target the same spec without matching version numbers. Every release must bind its exact supported spec version and capabilities. A package cannot claim a newer contract just because the contract adds a requirement or its own version was increased. Existing artifacts retain their original binding; do not retroactively relabel their conformance.

Acceptance

Staged Language Migration

Specification versions, SDK package versions and SDK 1.0 acceptance are separate decisions. Adopting specification 0.3.0 does not promote an SDK to 1.0.

Migrate independent implementations in batches. Unmigrated releases retain their original specification and evidence; shared-runtime wrappers verify their host version range and wrapper behavior, while samples do not receive independent SDK versions. No implementation inherits a new contract from a global version edit or a passing legacy vector suite.

Activation requires version-specific vector selection and explicit implementation/release bindings, with rejection tests for missing, unknown and mismatched versions. The 0.2.0 suite remains for unmigrated implementations. The 0.3.0 runners select their own catalog entry; no implementation inherits a new contract from a global version edit.

A merge containing changed constructor defaults must include the corresponding contract activation and migration evidence, or defer those default changes. Other languages may migrate after that merge only when their old contract gates remain enforceable. Merging does not authorize tags or publication.

Acceptance must cover missing controls without effects, each independent opt-out, model-only empty scope, registration after assembly, direct run entry, final call/history correspondence, streaming middleware, partial batch failure, cancellation/terminal races, cause preservation and telemetry redaction.

The requirement IDs are the traceability boundary. Evidence records identify the test, implementation, revision, runtime, final artifact and result. An untested requirement is pending, not implicitly satisfied by a suite label.