orxtra v0.13.0 /services.src.orxtra.services._run
On this page

Run lifecycle: RunConfig plus start_run()/start_run_from_file() mint the run principal, assemble the Scheduler, and execute the workflow; abort/pause/resume_run() drive trace state transitions.

#services.src.orxtra.services._run

#services.src.orxtra.services._run

#RunConfig

RunConfig
FieldTypeDefault
workflow_pathPath
agents_dirPath
knowledge_dirPath
categories_pathPath
read_rootPath
db_urlstr
provider_configsdict[str, dict[str, str]]
budgetDecimal
autonomy_levelstr
budget_exhaustion_policyBudgetExhaustionPolicyBudgetExhaustionPolicy.UNLIMITED
secrets_env`dict[str, str]None`None
tools_dir`PathNone`None
pricing`dict[str, TokenRates]None`None

#_redact_netloc

python
def _redact_netloc(netloc: str) -> str

Redact the password in a netloc, keeping everything else verbatim.

Works on the raw string (not parsed properties) so percent-encoded userinfo, IPv6 brackets, and host case survive untouched. Userinfo is everything before the last @; the password is everything after the first : within it.

#_redact_query

python
def _redact_query(query: str) -> str

Redact the value of any password query parameter.

Other parameters are preserved verbatim. Keys are percent-decoded for comparison (libpq decodes URI parameter keys) but emitted as written.

#_redact_db_url

python
def _redact_db_url(db_url: str) -> str

Redact password material in a database URL, if present.

Covers both the userinfo password (postgres://u:pw@host/db) and the libpq/asyncpg query-parameter form (postgres://host/db?password=pw).

#_serialize_config

python
def _serialize_config(config: RunConfig) -> dict[str, Any]

Serialize a RunConfig for persistence in the run record.

Credential-bearing values (provider api_keys, db_url password) are redacted to a fixed placeholder -- the snapshot is stored verbatim in PostgreSQL and must never contain plaintext secrets.

#_load_custom_tools

python
def _load_custom_tools(tools_dir: Path, secret_registry: SecretRegistry | None) -> list[ToolEntry]

Load data-defined tools and convert to ToolEntry objects.

Http-type definitions get a real factory via build_http_tool. Monty and command types use build_monty_tool and build_command_tool respectively, with capability-derived tags.

#start_run

python
async def start_run(pool: asyncpg.Pool | None, principal_storage: PrincipalStorage, caller_principal: Principal, intent: str, config: RunConfig, *, transport_registry: dict[str, Any] | None=None, overseer: Any | None=None, backend: StorageBackend | None=None, get_worker_bridge: Callable[..., Any] | None=None, run_manager: Any | None=None) -> UUID

#start_run_from_file

python
async def start_run_from_file(pool: asyncpg.Pool, principal_storage: PrincipalStorage, get_worker_bridge: Callable[..., Any] | None, run_manager: Any, caller_principal: Principal, intent: str, config_path: Path) -> UUID

#get_run

python
async def get_run(pool: asyncpg.Pool, run_id: UUID) -> RunReport | None

#list_runs

python
async def list_runs(pool: asyncpg.Pool) -> list[RunSummary]

#_resolve_run_principal_id

python
async def _resolve_run_principal_id(pool: asyncpg.Pool, run_id: UUID) -> UUID

Resolve the run's own principal id for transition attribution.

Run control operations (abort/pause/resume) emit a run_transition event attributed to the run principal. It was minted at run birth; a missing one is a hard error (an invariant violation), never a silent fallback.

#abort_run

python
async def abort_run(pool: asyncpg.Pool, run_id: UUID) -> None

#pause_run

python
async def pause_run(pool: asyncpg.Pool, run_id: UUID) -> None

#resume_run

python
async def resume_run(pool: asyncpg.Pool, run_id: UUID) -> None
Search