Skip to content

Make Spry runbooks executable via Truth Yard with durable orchestration and webhook triggers #28

Description

@shah

Extend Truth Yard so that Spry markdown workbooks, playbooks, and runbooks are discovered, indexed, and executed as durable, replayable jobs. Spry defines orchestration semantics, Truth Yard is the runner and durability layer. Every runbook must be invocable via standard webhooks and executed using the existing Truth Yard mounting model and SQLite-backed evidence store.

The work is successful when:

  • Spry markdown content can be discovered and indexed by Truth Yard as runnable artifacts
  • Each runbook is exposed as a stable webhook endpoint
  • Invocations create durable runs with step-level state, logs, artifacts, and replay support
  • Execution uses mounted resources (SQLite, DuckDB, files, etc.) consistently
  • Orchestration logic lives in Spry, not hardcoded in the runner
  • The implementation is local-first, deterministic, and auditable

Scope of Work

  1. Discovery and Indexing
  • Extend Truth Yard’s discovery system to identify Spry workspaces and runbooks
  • Parse runbook metadata and build a normalized internal execution graph
  • Assign stable IDs and version hashes to runbooks
  • Persist indexed runbooks in SQLite for querying and audit
  1. Runnable Exposure
  • Expose each runbook as a webhook-addressable runnable
  • Define a canonical webhook contract for starting runs with inputs and idempotency keys
  • Support additional webhook actions: cancel, resume, approve, external callback
  1. Durable Execution
  • Implement a run lifecycle model (run, step, event, artifact)
  • Execute runbooks step-by-step using a queue/worker model
  • Persist all state transitions and outputs in SQLite
  • Support retries, backoff, pause/resume, and replay
  1. Mount Integration
  • Make mounted resources (SQLite, DuckDB, files) available as bindings to runbooks
  • Treat Spry content itself as a mounted resource
  • Ensure step execution resolves mounts by name, not by hardcoded paths
  1. Observability and Evidence
  • Record logs, timings, inputs, outputs, and errors per step
  • Expose run and step state via APIs suitable for SQLPage or other UIs
  • Ensure all execution is reproducible and auditable

Acceptance Criteria

  • A Spry runbook can be invoked via HTTP and produces a durable run record
  • Runs survive process restarts and can be resumed or replayed
  • Step execution is deterministic given the same inputs and mounted state
  • Engineers can query run history using SQL
  • No orchestration logic is hardcoded outside Spry semantics

Ref:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions