> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pandaprobe.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Execution and invocation

> Execution boundaries, attribution, active memory, and host callbacks

An execution pins rule state, working files, trace attribution, and a unique identity. Obtain it from the runtime's execution or trial factory. An execution is single-use; do not manually switch its role to bypass validation assignment.

An `Invocation` is the generic host callback input. Its current instructions include the filesystem contract and active memory. During reflection, the callback also receives feedback and the prior result. Deliver instructions to the actual model, and expose only Reflect filesystem administration during reflection.

Ending a task execution seals changes and schedules evaluation; it does not itself invoke a continuation. Use the runtime's explicit continuation for delayed feedback. Accepted rules, trial candidates, active session notes, and native framework conversation history are separate state.

The async execution context seals and schedules on exit. `instructions()` rebuilds one replaceable instruction block. Host-owned `activate()` scopes attribution; it is not a model-facing permission API.

## On this page

[Execution](#execution), [Invocation](#invocation).

## `Execution`

```python theme={null}
from pandaprobe.reflect import Execution
```

One pinned filesystem and identity. It is never a process-global router.

[Source declaration](https://github.com/chirpz-ai/pandaprobe-sdk/blob/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/python/src/pandaprobe/reflect/execution.py#L33)

### Constructor

```text theme={null}
Execution(
  runtime: Reflect,
  *,
  session_id: str,
  execution_id: str | None=None,
  completed: bool=True,
  role: str='task',
  revision: str | None=None,
  rules: dict[str, Rule] | None=None,
  candidate_ids: list[str] | None=None,
  restore: bool=False,
)
```

| Parameter | Type | Default / passing |
| - | - | - |
| `runtime` | `Reflect` | Required |
| `session_id` | `str` | Required; keyword only |
| `execution_id` | `str \| None` | `None`; keyword only |
| `completed` | `bool` | `True`; keyword only |
| `role` | `str` | `'task'`; keyword only |
| `revision` | `str \| None` | `None`; keyword only |
| `rules` | `dict[str, Rule] \| None` | `None`; keyword only |
| `candidate_ids` | `list[str] \| None` | `None`; keyword only |
| `restore` | `bool` | `False`; keyword only |

### Fields and properties

| Name | Type | Default / contract |
| - | - | - |
| `runtime` | `Not annotated` | Instance value; Instance attribute. |
| `session_id` | `Not annotated` | Instance value; Instance attribute. |
| `id` | `Not annotated` | Instance value; Instance attribute. |
| `role` | `Not annotated` | Instance value; Instance attribute. |
| `completed` | `Not annotated` | Instance value; Instance attribute. |
| `base_revision` | `Not annotated` | Instance value; Instance attribute. |
| `trace_ids` | `list[str]` | Instance value; Instance attribute. |
| `proposal` | `Not annotated` | Instance value; Instance attribute. |
| `status` | `Not annotated` | Instance value; Instance attribute. |
| `task_status` | `Not annotated` | Instance value; Instance attribute. |
| `phase_traces` | `dict[str, list[str]]` | Instance value; Instance attribute. |
| `loop` | `asyncio.AbstractEventLoop \| None` | Instance value; Instance attribute. |
| `shell` | `Not annotated` | Instance value; Instance attribute. |

### Methods

> [accordion] instructions
>
> Build one replaceable block of filesystem instructions and active memory.
>
> ```text theme={null}
> instructions() -> str
> ```

> [accordion] seal
>
> Captures rule changes as a proposal against the pinned base revision and checkpoints the execution. It does not accept or publish the proposed rule.
>
> ```text theme={null}
> seal(*, evidence_ids: list[str] | None=None, rationale: str='') -> ProposalOutcome
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `evidence_ids` | `list[str] \| None` | `None`; keyword only |
> | `rationale` | `str` | `''`; keyword only |

> [accordion] activate
>
> Host-controlled phase scope. Reflection cannot attribute itself as task.
>
> ```text theme={null}
> async activate(role: str)
> ```
>
> | Parameter | Type | Default / passing |
> | - | - | - |
> | `role` | `str` | Required |

## `Invocation`

```python theme={null}
from pandaprobe.reflect import Invocation
```

Generic host integration. The host retains its model, tools and agent loop.

[Source declaration](https://github.com/chirpz-ai/pandaprobe-sdk/blob/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/python/src/pandaprobe/reflect/runtime.py#L30)

Construct with the fields below as arguments. Defaults apply when omitted.

### Fields and properties

| Name | Type | Default / contract |
| - | - | - |
| `input` | `Any` | Required |
| `execution` | `Execution` | Required |
| `phase` | `str` | `'task'` |
| `previous_result` | `Any` | `None` |
| `feedback` | `str \| None` | `None` |
| `instructions` | `str` | Required; read-only; Read-only property. |

***

Signatures and fields are generated from the [SDK source](https://github.com/chirpz-ai/pandaprobe-sdk/tree/92d8c37fba00e87ac6f0104cd293990aa5d5e621/libraries/python). See the [import index](https://docs.pandaprobe.com/reference/python/overview.md#public-import-index) for available entry points.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.