neuralosd-restate — durable execution for neuralosd on Restate
Run neuralOS / neuralOSd workloads on Restate (single-binary durable
execution engine, no Docker/JVM/external DB) with CLI + Python only, on
macOS, Linux, and Windows (WSL2). The deterministic code gates stay intact:
Restate owns the pipeline and its journal, neuralosd owns the answers,
the model (optional, qwen3.5:9b via Ollama, think:false) owns judgment.
The contract
- Code gate first — the lexical router /
ask.py floor answers ~90%+.
Restate handlers wrap neuralosd calls; they never replace the router.
- Durable by journal — every handler step runs inside
ctx.run(...) so
results are journaled and replayed on retry. Side effects ALWAYS go
through ctx.run, never bare.
- Honest refusals — a gap question maps to a logged refusal, never a
guessed answer. Keep
none_of_these semantics at the probe layer.
- One model seat — optional qwen3.5:9b via Ollama,
think:false
(see the neuralos-ollama skill) whenever generation is required.
Setup (per machine)
bash scripts/install_restate.sh # macOS + Linux (auto arch/OS)
python3 scripts/verify_restate.py # server up, service registered, invoke OK
Start the server: <install-dir>/restate-server (ingress :8080, admin/UI
:9070 — web UI at http://localhost:9070/ui/). Storage is embedded
(no external DB). Windows: WSL2 Ubuntu, same Linux steps (see
references/platforms.md — official server binaries are macOS + Linux).
Run the durable service
export NEURALOSD_URL="http://127.0.0.1:8878/ask" # the instance HTTP door
python3 scripts/restate_neuralosd_service.py & # serves :9090
curl -s -X POST localhost:9070/deployments \
-H 'content-type: application/json' \
-d '{"uri": "http://127.0.0.1:9090"}'
Invoke (durable — journaled, retried, resumable):
curl -s -X POST localhost:8080/WemaTriage/triage
curl -s -X POST localhost:8080/WemaAsk/ask -d '"how many worklog entries exist"'
View in the UI: http://localhost:9070/ui/ (per-invocation journal, timings,
retries). CLI: restate invocations list --all, restate sql -q "...".
Certification checklist
python3 scripts/bench_durable.py --runs 3 # latency + correctness
python3 scripts/test_neuralosd_restate.py # offline unit tests
Acceptance: triage returns overview + critical + busiest-group with live
numbers; a gap question refuses honestly; journal visible in the UI.
Files
scripts/install_restate.sh — macOS/Linux binary installer + service hints
scripts/install_restate_windows.ps1 — Windows: WSL2 setup + service notes
scripts/restate_neuralosd_service.py — durable service (ask / triage /
nightly report) over the instance HTTP door
scripts/register_and_invoke.py — register deployment, start + poll runs
scripts/verify_restate.py — preflight health checks
scripts/bench_durable.py — timing benchmark
scripts/test_neuralosd_restate.py — offline unit tests
references/architecture.md — design: seats, journaling/replay, retry
policy, awakeables (approvals), Conductor comparison
references/platforms.md — macOS/Linux/Windows service install, upgrade,
backup, troubleshooting
references/recipes.md — worked recipes: nightly report, date-range asks,
approval flow, multi-instance, Ollama think:false generation
Design rules (see references/architecture.md)
- Restate does NOT replace the code gates — it wraps them with durability.
- Side effects inside handlers always use
ctx.run; handler bodies stay
deterministic between journal entries.
- Approvals use awakeables (durable promises), never sleeping loops.
- Keep one Restate service per neuralosd instance; name handlers after
probe families.
1---2name: neuralosd-restate3description: "Durable execution for neuralOS/neuralOSd on Restate — single-binary engine, no Docker/JVM/DB, CLI + Python only, all platforms (macOS/Linux/Windows-WSL2). Covers architecture and design (journal/replay, ctx.run, retries, awakeable approvals), install per OS, a durable Python service wrapping any neuralosd instance HTTP door (ask/triage/nightly-report handlers), deployment registration and invocation, verification, benchmarking, and integration with the neuralos-ollama skill. Use when adding durable execution to neuralosd workflows, replacing Conductor with Restate, or deploying crash-resilient neuralosd pipelines without Docker."4metadata:5 source: https://skillmd.com/skills/drolu/neuralosd-restate6---78# neuralosd-restate — durable execution for neuralosd on Restate910Run neuralOS / neuralOSd workloads on **Restate** (single-binary durable11execution engine, no Docker/JVM/external DB) with **CLI + Python only**, on12macOS, Linux, and Windows (WSL2). The deterministic code gates stay intact:13Restate owns the pipeline and its journal, neuralosd owns the answers,14the model (optional, qwen3.5:9b via Ollama, `think:false`) owns judgment.1516## The contract17181. **Code gate first** — the lexical router / `ask.py` floor answers ~90%+.19 Restate handlers wrap neuralosd calls; they never replace the router.202. **Durable by journal** — every handler step runs inside `ctx.run(...)` so21 results are journaled and replayed on retry. Side effects ALWAYS go22 through `ctx.run`, never bare.233. **Honest refusals** — a gap question maps to a logged refusal, never a24 guessed answer. Keep `none_of_these` semantics at the probe layer.254. **One model seat** — optional qwen3.5:9b via Ollama, `think:false`26 (see the `neuralos-ollama` skill) whenever generation is required.2728## Setup (per machine)2930```bash31bash scripts/install_restate.sh # macOS + Linux (auto arch/OS)32python3 scripts/verify_restate.py # server up, service registered, invoke OK33```3435Start the server: `<install-dir>/restate-server` (ingress :8080, admin/UI36:9070 — web UI at http://localhost:9070/ui/). Storage is embedded37(no external DB). Windows: WSL2 Ubuntu, same Linux steps (see38`references/platforms.md` — official server binaries are macOS + Linux).3940## Run the durable service4142```bash43export NEURALOSD_URL="http://127.0.0.1:8878/ask" # the instance HTTP door44python3 scripts/restate_neuralosd_service.py & # serves :909045curl -s -X POST localhost:9070/deployments \46 -H 'content-type: application/json' \47 -d '{"uri": "http://127.0.0.1:9090"}'48```4950Invoke (durable — journaled, retried, resumable):5152```bash53curl -s -X POST localhost:8080/WemaTriage/triage54curl -s -X POST localhost:8080/WemaAsk/ask -d '"how many worklog entries exist"'55```5657View in the UI: http://localhost:9070/ui/ (per-invocation journal, timings,58retries). CLI: `restate invocations list --all`, `restate sql -q "..."`.5960## Certification checklist6162```bash63python3 scripts/bench_durable.py --runs 3 # latency + correctness64python3 scripts/test_neuralosd_restate.py # offline unit tests65```6667Acceptance: triage returns overview + critical + busiest-group with live68numbers; a gap question refuses honestly; journal visible in the UI.6970## Files7172- `scripts/install_restate.sh` — macOS/Linux binary installer + service hints73- `scripts/install_restate_windows.ps1` — Windows: WSL2 setup + service notes74- `scripts/restate_neuralosd_service.py` — durable service (ask / triage /75 nightly report) over the instance HTTP door76- `scripts/register_and_invoke.py` — register deployment, start + poll runs77- `scripts/verify_restate.py` — preflight health checks78- `scripts/bench_durable.py` — timing benchmark79- `scripts/test_neuralosd_restate.py` — offline unit tests80- `references/architecture.md` — design: seats, journaling/replay, retry81 policy, awakeables (approvals), Conductor comparison82- `references/platforms.md` — macOS/Linux/Windows service install, upgrade,83 backup, troubleshooting84- `references/recipes.md` — worked recipes: nightly report, date-range asks,85 approval flow, multi-instance, Ollama think:false generation8687## Design rules (see references/architecture.md)8889- Restate does NOT replace the code gates — it wraps them with durability.90- Side effects inside handlers always use `ctx.run`; handler bodies stay91 deterministic between journal entries.92- Approvals use awakeables (durable promises), never sleeping loops.93- Keep one Restate service per neuralosd instance; name handlers after94 probe families.