PromptRunner.Control.Interventions (PromptRunnerSDK v0.10.0)

Copy Markdown View Source

The append-only record of what a human said to a run, kept with the packet.

packet/.prompt_runner/interventions/<prompt>.jsonl, one object per steer: timestamp, prompt, attempt, author, text, and the lane it was delivered on.

Separate from run state on purpose. Run state is runtime detail that disappears with the state file; this lives with the prompt configuration and is committed alongside the work, so a steer is timestamped by a commit — the same property the claim ladder already relies on for pre-registration.

A steer is never evidence about the work. A contract asserting that a document contains X is not satisfied by a human having said "put X in the doc"; the verifier sees what the session produced. This file exists so that a reader can tell a human-guided result from an autonomous one — which is a flag, not a disqualification.

Summary

Functions

Appends one steer to the prompt's intervention log.

How many steers this prompt has taken.

Every steer recorded for one prompt, oldest first.

Types

intervention()

@type intervention() :: %{
  :at => DateTime.t(),
  :prompt_id => String.t(),
  :attempt => pos_integer() | nil,
  :author => String.t() | nil,
  :text => String.t(),
  :lane => atom() | String.t() | nil,
  :delivery => atom() | String.t() | nil,
  optional(:run_id) => String.t() | nil
}

Functions

append(packet_dir, record)

@spec append(String.t(), intervention()) :: :ok | {:error, term()}

Appends one steer to the prompt's intervention log.

count(packet_dir, prompt_id)

@spec count(String.t(), String.t()) :: non_neg_integer()

How many steers this prompt has taken.

Read from the committed artifact rather than from run state, so it survives a state file being deleted and a resume in a fresh checkout.

dir(packet_dir)

@spec dir(String.t()) :: String.t()

path(packet_dir, prompt_id)

@spec path(String.t(), String.t()) :: String.t()

read(packet_dir, prompt_id)

@spec read(String.t(), String.t()) :: [map()]

Every steer recorded for one prompt, oldest first.