Documentation — KOSTRAL
KOSTRAL DOCUMENTATION

Understand the contract behind the engines.

KOSTRAL is building a common contract and execution model for independently developed engines. This documentation explains the current implementation, its boundaries, and the architectural direction—without presenting planned ecosystem features as available today.

Start with the model

Four questions define the system.

Responsibility

Who owns the decision?

Each engine has a distinct job: improve state, detect configuration problems, detect security risks, or render output.

Capability

What may the engine do?

Engine metadata and contracts describe capabilities such as whether the engine may mutate the observable IR.

Workflow

When does it run?

The workflow composes independent engines into explicit execution phases and sequences.

Contract governance

What the contract is responsible for.

The contract is not a generic plugin label. It is the shared agreement that lets KOSTRAL check how an engine participates.

Contract concern Current implementation Boundary
Identity Remote descriptor declares engine name and version. Not a global identity or publishing service.
Contract compatibility Remote descriptor declares contract version; client verifies the supported version. Current contract version is a single implementation-level version.
Input compatibility Descriptor declares accepted Kubernetes kinds; registry pins can be checked. Not a full schema negotiation system.
Mutation authority Engine metadata declares mutates; ServiceBus snapshots and verifies observable IR changes. IR boundary, not a general-purpose sandbox for filesystem, network, or external side effects.
Execution ServiceBus runs explicit phases; remote clients invoke HTTP engines. Remote example is experimental, not distributed orchestration.
Reporting Engines contribute structured findings; mutations must be accompanied by optimization findings. Does not certify analytical correctness of an engine.
Engine responsibilities

Common contract. Specialized behavior.

The shared contract should not erase the differences between engine types.

Optimizer

Improves or prepares deployment state. It may mutate IR when its metadata grants that capability, and observable changes must be reported.

Validator

Detects and reports configuration problems. It is read-only in the current architecture and may recommend fixes without applying them.

Security

Detects security and policy risks. It is read-only in the current architecture and reports findings rather than changing manifests.

Renderer

Converts the prepared representation into the requested output. It does not own optimization or validation decisions.

Remote engine adapter

Invokes an engine over HTTP and checks its descriptor and applicable registry pins before sending supported inputs.

Future specialized contracts

Additional engine categories may require extra rules—for example, AI provenance or external-tool version handling. These are not current product claims.

Execution model

Local and remote are invocation choices.

Where an engine runs should not redefine what it is responsible for. The workflow composes engines; the contract defines how they participate.

Workflow→Local engineorRemote HTTP client→Contract checks→Result
Experimental remote composition: The repository demonstrates local and remote engine composition using a static JSON registry, HTTP endpoints, descriptor checks, pinned version/input kinds, and bearer-token authentication. It does not provide dynamic discovery, automatic registration, engine uploads, isolation, or production-grade distributed execution.
Use cases

Practical problems this model targets.

Multiple teams, independently maintained engines

Let platform, security, and infrastructure teams own specialized engines while sharing a contract for integration and execution.

Controlled mutation in a workflow

Allow an optimizer to change the manifest while keeping validators and security checks read-only. Verify observable IR changes between engine executions.

Compatibility before remote invocation

Compare a remote engine's declared contract and descriptor against the expected identity and pinned version/input kinds before sending the workload.

Existing tools as specialized engines

Use KOSTRAL as the integration and execution layer rather than rebuilding every scanner or validator. External adapters remain a development direction unless explicitly implemented.

Reading map

Go deeper in the repository.

Architecture IR, core components, ServiceBus, adapters, and module structure. Read →
Guarantees Behavioral guarantees, mutation boundaries, determinism, and limitations. Read →
Engine contracts how engine works, contract requirements implementation and boundaries. Read →