Skip to content

Jayrun 0.3.1

Choose a tag to compare

@github-actions github-actions released this 17 Nov 18:11
· 8 commits to main since this release

Jayrun 0.3.1 — delegated workflows and graph declaration reports

A Controller workflow can now launch another Controller or Supervisor workflow
when the host explicitly enables delegation. For example, a coordinating agent
can launch an engineering agent, and that agent can construct, confirm and submit
its own processing graph to the same Engine.

This release also adds structured graph declarations for AI-assisted review and
reconstruction, integrates them into the graph viewer, and bounds owned-loop
startup readiness.

Describe and export a graph

Set name and description when constructing a GraphDefinition. After confirming
it, export its declaration:

payload = graph.report.to_dict()
text = graph.report.to_json()
graph.report.save("graph-declaration.json", format="json", compact=True)

The jayrun.declaration/1 report preserves authored descriptions, component type
references, ordered flows, fields, resource/serializer bindings and configuration
defaults. Reused declarations retain shared references. Missing construction details
and sensitive defaults are disclosed as limitations. Jayrun preserves supplied
intent; it does not infer algorithms or include operator source code.

New graph viewers display the authored name and purpose and offer Export
declaration report
separately from visualization data. Downloads preserve exact
JSON, including large integers. Registry selection downloads the selected graph's
report; captured dashboard graphs use the same action. Existing aggregate export
and capture bounds remain. Regenerate old HTML to add the declaration attachment.

See structured reports
and viewer exports.

Startup and viewer fixes

Owned Engine startup has a five-second boundary for loop initialization and a
cross-thread readiness acknowledgement. Timeout/failure cleanup is bounded
separately, so this is not a five-second limit for the entire start() call or a
future-health guarantee. External-loop ownership is unchanged.

Long descriptions now work within viewer export limits. Legacy viewer detail strings
use safe inspection metadata, closing a path that could bypass sensitive-default
redaction. Existing text reports and execution-report exports remain available.

Enable delegation

from jayrun import Engine
from jayrun.settings import ControllerPolicy, EngineSettings

engine = Engine(EngineSettings(controller_policy=ControllerPolicy.DELEGATED))

Inside a running Controller operator, with a confirmed agent_graph:

from jayrun import Controller
from jayrun.settings import ContextSettings

child = self.runtime.submit(
    agent_graph,
    settings=ContextSettings(max_iterations=1),
    authority=Controller(),
)

self.runtime.submit() now accepts the same arguments as engine.submit():
graph, artifact and configuration builders, context settings and authority.
Without a registry, a Controller can submit any confirmed graph it constructs.
With a registry configured, submitted graph objects must still be registered.

Default behavior and migration

  • ControllerPolicy.HOST_ONLY remains the default. Non-None runtime authority
    raises PermissionError; host engine.submit(..., authority=...) remains allowed.
  • Under DELEGATED, only live Controllers can submit children. Supervisors and
    ordinary contexts do not gain submission rights.
  • Change runtime.submit(graph_key=...) to runtime.submit(graph=...).
    Positional registered-identity calls remain compatible.
  • Children belong to the Engine and can continue after their parent finishes.
    Supervisor scope remains graph-wide; history access requires an explicit grant.
  • Waiting parents retain execution slots. Configure enough max_tasks and
    max_workers for the nesting depth. Delegation does not introduce a process
    sandbox or automatic parent-to-child cancellation.

See the Controller guide
and runtime API
for lifecycle, routing and history details.