Core Feature

The Loop

Execute a workflow. Record what happened. Let AI write a better one. Repeat. Each cycle, your processes get faster, cheaper, more reliable.

.osop defines what should happen. .osoplog records what actually happened. The gap between them is where optimization lives.

pip install osop
1

Execute

Run the .osop workflow with osop run. Agent nodes call real LLMs. CLI nodes run commands. Human nodes wait for approval.

osop run workflow.osop --allow-exec
2

Record

A .osoplog is produced automatically. Every node: duration, cost, status, tool calls, AI reasoning, human decisions.

# .osoplog.yaml generated
3

Synthesize

Feed multiple .osoplog files to AI. It reads the patterns and writes a better .osop. Slow steps parallelized. Failures handled.

osop synthesize *.osoplog.yaml
4

Diff & Repeat

Compare runs with osop diff. See what got faster, cheaper, or broke. Apply the optimized .osop. Run again. The loop never stops.

osop diff run-v1.osoplog run-v2.osoplog

The tools

osop diff compares runs. osop synthesize writes better workflows from execution data.

osop diff — compare two runs

osop-diff-output.txt
$ osop diff monday.osoplog tuesday.osoplog

  Workflow: feature-build
  Run A: Mon Apr 1 | Run B: Tue Apr 2

  Node             | Duration       | Cost           | Status
  ─────────────────────────────────────────────────────────────
  plan        [AI] | 2.1s → 1.8s    | $0.02 → $0.01  | same
  explore     [AI] | 12s → 5.2s     | $0.08 → $0.03  | same
  implement   [AI] | 45s → 32s      | $0.15 → $0.12  | same
  type_check  [CI] | 3.2s → 3.1s    | —               | same
  review   [Human] | 120s → 60s     | —               | same
  ─────────────────────────────────────────────────────────────
  Total            | 182s → 102s    | $0.25 → $0.16  | -44%

osop synthesize — AI writes a better workflow

optimized-feature-build.osop.yaml
Plan Implementationagent

AI discovered: sessions with planning completed faster.

parallelExplore Codebase
parallelExplore Tests
Explore Codebasemcp

Read source files in parallel with test exploration.

sequentialWrite Code
Explore Testsmcp

Understand existing test patterns before writing code.

Write Codeagent

Generate implementation based on plan and exploration.

sequentialType Check
Type Checkcicd

Immediate verification. 0% regression rate when done after every edit.

fallbackWrite Code
sequentialRun Tests
Run Testscicd

Full test suite.

sequentialRisk Assessment
Risk Assessmentagent

AI discovered: catches security issues that tests miss.

sequentialCommit Changes
Commit Changesgit

Only after risk review passes.

9 CLI commands

Everything from scaffolding to synthesis.

osop run

Execute with real LLM calls, security gates, cost controls

osop diff

Compare two runs or two definitions

osop synthesize

Feed logs to AI, get optimized workflow

osop validate

Check .osop against JSON Schema

osop validate-log

Check .osoplog files

osop init

Scaffold a new workflow from 5 templates

osop render

Generate Mermaid, ASCII, or SVG diagrams

osop test

Run test cases defined in the workflow

osop report

Generate HTML execution reports

Start the loop

pip install osop && osop init