Skip to content

feat(local): serverless local execution runtime (opensop-local)#59

Closed
Chosen9115 wants to merge 1 commit into
mainfrom
feat/local-cli-runtime
Closed

feat(local): serverless local execution runtime (opensop-local)#59
Chosen9115 wants to merge 1 commit into
mainfrom
feat/local-cli-runtime

Conversation

@Chosen9115

Copy link
Copy Markdown
Owner

Serverless local execution for OpenSOP (opensop-local)

Adds a local runtime: run an OpenSOP process on-machine with no server — no Rails app, no daemon, no network. Reads a process definition, runs its steps in order, threads a JSON context between them, and writes an append-only on-disk receipt per step.

Why: today a process runs on the Rails runtime, and opensop-cli is a thin HTTP client to that server. This lets you run the same kind of process with just the CLI — for development, CI, air-gapped/edge environments, and lightweight agents that can't carry a Ruby runtime.

Dependencies: bash + jq. (Optional yq/PyYAML for .sop.yaml → JSON.)

What's in this PR (local/)

  • bin/opensop-local — the runtime: run / list / runs / show / import-yaml.
  • examples/greet.sop.json + examples/steps/build.sh — a minimal worked example.
  • test/test.sh — golden test (passing): asserts 2 steps run, context threads, receipts are written, and no step-output leak.
  • README.md — format, the step I/O contract, step-type matrix, audit format, design notes.

Model

  • Process format: .sop.json (jq-native, zero extra deps), mirroring SPEC.md. import-yaml converts .sop.yaml.
  • Step I/O contract: each step gets the accumulated context (process inputs + prior step outputs) on stdin and in $OSL_CONTEXT; its JSON stdout merges back under the step id (non-JSON → {stdout: …}).
  • Step types (local): automated, shell, noop ✅ today. form/approval/llm/webhook/subprocess/wait are the roadmap for full SPEC parity (see README table).
  • Receipts: $OPENSOP_LOCAL_HOME/runs/<id>/{manifest.json, audit.jsonl, context.json} — the local equivalent of the DB receipts, fully inspectable.

Notes for review

  • Self-contained under local/; nothing else in the repo is touched.
  • from: expression resolution (exact server parity) and local-aware runs/show/status in opensop-cli are noted as follow-ups.
  • Battle-tested driving a real lightweight agent's daily procedures before extraction/genericization.

Draft, for review — please don't merge yet. @kuri — would love your eyes on the format/IO-contract and where this should live long-term (here vs opensop-cli).

🤖 Generated with Claude Code

Run an OpenSOP process on-machine with no server (no Rails, no daemon, no
network) — just bash + jq. Reads a process definition, runs steps in order,
threads a JSON context between them, and writes an append-only on-disk receipt
per step. Lets you run processes with just the CLI (dev, CI, air-gapped, and
lightweight agents that can't carry a Ruby runtime).

Includes: the runtime (automated/shell/noop step types), JSON process format,
on-disk receipts (manifest/audit.jsonl/context), a YAML->JSON converter, a
worked example, and a golden test (passing). Battle-tested driving a real
lightweight agent's daily procedures.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Chosen9115

Copy link
Copy Markdown
Owner Author

Moving this to the opensop-cli repo — it's a CLI runtime and belongs there. New PR to follow in Chosen9115/opensop-cli.

@Chosen9115 Chosen9115 closed this Jun 3, 2026
@Chosen9115 Chosen9115 deleted the feat/local-cli-runtime branch June 3, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant