NAME

Langertha::RunContext - Shared execution context for Raid and Raider runs

VERSION

version 0.305

SYNOPSIS

my $ctx = Langertha::RunContext->new(
  input => 'start',
  state => { counter => 0 },
);

my $branch = $ctx->branch(metadata => { path => 'left' });
$ctx->merge_branch($branch, slot => 'parallel', name => 'left');

DESCRIPTION

Carries structured execution state through runnable nodes. It is designed to be safely propagated across sequential steps and branched for parallel steps.

input

Current input payload for the next runnable step.

state

Mutable workflow state shared across sequential execution.

artifacts

Structured outputs and intermediate artifacts produced by runs.

metadata

Execution metadata (labels, counters, step info, etc.).

trace

Chronological trace entries describing orchestration progress.

history

Optional conversation/history payload mirrored from Raider runs.

add_trace

$ctx->add_trace({ event => 'step_result', step => 1 });

Appends a trace hashref.

branch

my $branch_ctx = $ctx->branch(metadata => { branch => 0 });

Creates an isolated context clone for parallel execution.

merge_branch

$ctx->merge_branch($branch_ctx, slot => 'parallel', name => 'step_a');

Stores an immutable snapshot of a branch context in the parent context.

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudss.us/

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.