Programs
A program is a git repo with a manifest and Python functions, deployed to your rrotor by commit and run in a sandbox, with secrets, schedules, a SQLite database and approvals.
What a program is
A git repo (a folder with its own git init is enough); a version is a commit.
glyphh.jsonThe manifestprogram.pyThe functions; load and end are optional hooks, never functionsrequirements.lockOptional: Python dependencies pinned with hashes, binary wheels only, installed at deploy, never at runfiles/Optional: seed files, copied into the program’s folder on its first deploytests/Its own tests, with rrotor.testing (no sandbox needed)With the plugin, ask Claude for what you want run (“each morning, post yesterday’s sales to the ledger”): it agrees with you the hosts it may reach, the steps that need your approval and the secrets it reads, writes it, tests it, commits and deploys it.
The manifest
{
"name": "daily_sales",
"description": "A day's sales, added up, converted to euros, and written to its ledger once approved",
"python": "3.13",
"functions": {
"start": {
"description": "Read a day's export, add it up, write the total to the ledger (asks approval first)",
"inputs": { "type": "object", "properties": { "day": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" } }, "additionalProperties": false },
"approvals": ["write"],
"writes": true
},
"summary": { "description": "The ledger", "inputs": { "type": "object", "additionalProperties": false }, "writes": false }
},
"hosts": ["api.frankfurter.dev"],
"secrets": [],
"databases": ["sqlite"],
"limits": { "seconds": 60, "memory_mb": 256 },
"schedules": [{ "function": "start", "cron": "15 6 * * *", "tz": "UTC", "name": "each_morning" }]
}| Key | What |
|---|---|
| name | Matches ^[a-z][a-z0-9_]{0,62}$; the program’s name on the runtime |
| kind | program (the default) or cli (CLIs) |
| description, python | Free text; python must be 3.13 |
| version | Optional, 1 or more |
| functions | At least one, each with description, inputs (a JSON Schema the call is checked against, E_INPUTS), approvals (every step that may ask the person) and writes |
| hosts | The only hosts a run may reach, HTTPS on 443 (*.example.com allowed). Everything else is blocked |
| secrets | The secret names it reads, ^[A-Z][A-Z0-9_]{0,63}$ |
| databases | ["sqlite"]: a SQLite database in its data folder, ctx.db |
| data | true: a persistent folder outside git, ctx.data |
| limits | seconds (1 to 3600, default 300) and memory_mb (64 to 8192, default 512) per run |
| schedules | Functions the runtime calls by itself: {function, cron, tz?, input?, name?} |
| graph | read or write: the rrotor’s graph as ctx.graph (Pipelines and the graph) |
A deploy refuses (E_MANIFEST, saying where and why) a manifest with an unknown key, a bad value, or a function program.py does not define, read from its syntax tree: no program code runs outside the sandbox.
program.py
from rrotor import Ctx, Result
RATES = "https://api.frankfurter.dev/v1/latest"
def start(ctx: Ctx, inputs: dict) -> Result:
day = inputs.get("day") or ctx.yesterday()
export = ctx.files / "sales" / f"{day}.csv"
if not export.is_file():
return Result.failed("read", f"There is no sales export for {day}.")
total = add_up(export)
rate = ctx.checkpoint(f"rate:{day}", lambda: ctx.http.get(RATES, params={"from": "USD", "to": "EUR"}).json()["rates"]["EUR"])
if not ctx.ask_approval("write", f"Write {day}'s total, ${total}, to the ledger?"):
return Result.done({"day": day, "total_usd": str(total), "written": False})
with ctx.db: # committed at the block's end
ctx.db.execute("create table if not exists ledger (day text primary key, total_usd text)")
ctx.db.execute("insert or replace into ledger values (?, ?)", (day, str(total)))
ctx.log("written", day=day)
return Result.done({"day": day, "total_usd": str(total), "written": True})- A function is
def name(ctx, inputs) -> Result, answeringResult.done(data),Result.failed(step, reason),Result.needs_input(prompt, schema=None, options=None)orResult.needs_approval(step, prompt). A crash is afailedResult with the error and the step, never an exception to the caller. ctx.http(HTTPS to the declared hosts; any library works too, asHTTPS_PROXYis set),ctx.files(its folder),ctx.data,ctx.db,ctx.secrets,ctx.log(message, **detail),ctx.today(),ctx.yesterday(),ctx.caller(claudeorschedule),ctx.clearance.- The
rrotorpackage is in the sandbox already: never install it or list it inrequirements.lock. - Tests use
rrotor.testing.Harness: inputs, answers, a folder, anhttpthat answers what the test says,secrets={...}anddatabase=<a file>.
Approvals and inputs
ctx.ask_approval(step, prompt)makes the run wait withneeds_approval; it returns True once approved, False if declined. A step not named in the function’sapprovalsfails the run (E_STEP_UNDECLARED).- A continue (
program_continuewith{"approved": true}orfalse, or the value for an input) calls the same function again with the same inputs. Wrap anything done once, a fetch or a charge, inctx.checkpoint(key, fn). - Approvals are the person’s: Claude shows the prompt word for word and continues only with what you said. A waiting run expires after 15 minutes;
approvalslists every one waiting.
Secrets
- The manifest declares the name (
"secrets": ["ANALYTICS_KEY"]); you set the value on the runtime, never in the repo and never in the chat: Claude shows you a form (secrets_form) and what you type goes straight to the vault (orPUT /v1/programs/{name}/secrets/{secret}yourself). The program readsctx.secrets["ANALYTICS_KEY"]. - Values are encrypted at rest (AES-256-GCM) with the runtime’s own key, made on first use and never sent anywhere. Listing answers each name, whether it is declared and whether it is set: never a value.
- Only a run gets a value. A declared secret not set stops the run before it loads (
E_SECRET_MISSING, naming it), so Claude knows what to ask you for. A value a program prints or logs is masked as[secret]. - Secrets go from you to the runtime, never through Glyphh.
Schedules
"schedules": [
{ "function": "start", "cron": "15 6 * * *" },
{ "function": "summary", "cron": "0 9 * * MON-FRI", "tz": "Europe/Amsterdam", "input": {}, "name": "weekdays" }
]- Five-field cron, or
@hourly,@daily,@weekly,@monthlyand the like;tzan IANA zone, default UTC;inputchecked against the function’s schema at deploy. Two schedules of one function need names. - The runtime fires them itself, with no Claude and no server involved, as normal runs with
ctx.callerschedule. An approval waits like any other run’s. - A schedule whose last run has not ended is skipped that time, and the skip is kept. Fires missed while rrotor was down are not made up.
schedules_listshows each one’s next and last run;schedule_pauseandschedule_resumekeep across restarts and new versions.
SQLite
"databases": ["sqlite"] gives the program ctx.db, the standard library’s sqlite3.Connection on db.sqlite3 in its data folder, opened on first use and closed when the run ends: with ctx.db: commits, and what is not committed is rolled back. A program that does not declare it gets E_DATABASE_UNDECLARED.
Deploy
A folder on this machineCommit, then the rrotor skill’s deploy (or the SDK’s deploy(path)): a git bundle of that commit, nothing else of the machineprogram_deploy{repo, commit, token?}: repo is owner/name on GitHub, commit the full 40-character SHA, token for a private repoPOST /v1/programs/deploy{repo, commit, token?} or {bundle, commit}, a git bundle in base64 up to 64 MBrrotor fetches exactly that commit, checks its SHA and the manifest, makes a venv from requirements.lock (no package’s setup runs outside the sandbox) and makes the version active. Versions are kept, so a new deploy rolls back like any commit.
Call
program_call {"program": "daily_sales", "function": "start", "inputs": {"day": "2026-10-30"}}
→ {"run_id": "…", "status": "needs_approval", "step": "write", "prompt": "Write 2026-10-30's total, $1240.00, to the ledger?"}
program_continue {"run_id": "…", "answer": {"approved": true}}
→ {"run_id": "…", "status": "done", "data": {"day": "2026-10-30", "total_usd": "1240.00", "written": true}}functiondefaults tostart. One run can take many calls: each continue resumes it while it waits.- A run ends
done,failed,expiredorcancelled; the program’sendhook always runs. Pastlimits.secondsit failsE_LIMIT_SECONDS. run_statusandrun_logread any run; seconds count time running, not waiting.