Nucleus
si nucleus is the SI local control plane.
It owns:
- the durable task ledger
- worker, session, and run orchestration
- the local WebSocket gateway
- the bounded REST inspection/mutation surface
- OS-native user-service install helpers
Main CLI surfaces
Usesi nucleus ... for control-plane operations:
si codex ... remains the worker/runtime-facing surface.
Service management
Nucleus is intended to run as a local user service. Supported flows:- Linux: generates
systemd --userunitsi-nucleus.service - macOS: generates launchd agent
com.aureuma.si.nucleus
si binary and runs the hidden service entrypoint:
SI_NUCLEUS_STATE_DIR: override the Nucleus state rootSI_NUCLEUS_BIND_ADDR: override the local bind addressSI_NUCLEUS_PUBLIC_URL: override the absolute OpenAPIservers[0].urlvalue for GPT Actions importSI_NUCLEUS_SERVICE_PLATFORM: forcesystemd-userorlaunchd-agent
Gateway discovery
CLI discovery order for the local WebSocket endpoint:--endpointSI_NUCLEUS_WS_ADDR~/.si/nucleus/gateway/metadata.json- default
ws://127.0.0.1:4747/ws
si-nucleus and includes the bound websocket URL and current SI version.
Gateway and API surfaces
The main control-plane transport is WebSocket:- default local endpoint:
ws://127.0.0.1:4747/ws - request/response methods such as
nucleus.status,profile.list,task.create,task.list,task.inspect,task.cancel,task.prune,worker.list,worker.inspect,worker.restart,worker.repair_auth,session.create,session.list,session.show,run.submit_turn,run.inspect, andrun.cancel - server-pushed canonical events through
events.subscribe
GET /openapi.jsonGET /statusPOST /tasksGET /tasksGET /tasks/{task_id}POST /tasks/{task_id}/cancelGET /workersGET /workers/{worker_id}GET /sessions/{session_id}GET /runs/{run_id}
/openapi.json is public OpenAPI 3.1 for GPT Actions URL import and includes summaries, descriptions, schemas, examples, and x-si-purpose annotations for bounded external consumers. Operational REST endpoints remain bearer-token protected.
Task Profile Assignment
Nucleus assigns every dispatched task to one worker profile. Task creation may include a preferredprofile, but the dispatcher can select a fallback when the task is not pinned to an existing session.
Priority order:
- the task’s requested
profile, when present - profiles with ready workers, sorted deterministically by profile and worker id
- configured profile records
- profiles attached to reusable sessions
- profiles with non-ready workers, used only as a last candidate
session_id do not cross profile boundaries; a session mismatch remains blocked as session_broken.
When Nucleus selects a candidate, it writes that profile back to the task record so later inspection shows which profile actually owns execution.
GPT Actions OpenAPI rules
For any Nucleus REST endpoint that is exposed through/openapi.json or docs/gpt-actions-openapi.yaml:
servers[0].urlmust be an absolute HTTPS URL for public imports. UseSI_NUCLEUS_PUBLIC_URLin deployed environments.- Every operation must have a stable
operationId,summary,description, success response schema, andx-si-purpose. - Every JSON request or response body must define a concrete schema. Do not use generic object schemas such as
type: objectwith onlyadditionalProperties. - Every object schema must include a
propertieskey. Map-like objects may useproperties: {}plusadditionalProperties, but thepropertieskey must still be present for GPT Actions compatibility. - Public bootstrap endpoints such as
GET /openapi.jsonmust set operationsecurity: []; operational endpoints must explicitly requirebearerAuth. - Keep the generated runtime document and
docs/gpt-actions-openapi.yamlin sync with the package patch version. - Run the Nucleus OpenAPI tests before committing schema changes so importer compatibility failures are caught locally.
Public route ownership
The publichttps://nucleus.aureuma.ai route is currently exposed by Viva shared Traefik, but the runtime is owned by this si repository.
Current same-host route targets:
https://nucleus.aureuma.aiforwards to thesi-nucleususer service on port4747.https://nucleus.aureuma.ai/gpt-actions-openapi.yamlandhttps://nucleus.aureuma.ai/privacyforward to the static docs server on port8092, rooted atdocs/.
~/.si/nucleus/, uses the si nucleus service ... OS-native lifecycle, and writes gateway metadata consumed by local CLI discovery. Moving it into Docker requires a separate migration plan for state, auth token delivery, public bind policy, and gateway discovery.
Route ownership rules while it remains external:
- Viva owns only the Traefik route entry.
- SI owns the
si-nucleusprocess, docs server, auth policy, OpenAPI document, and service lifecycle. - Set
SI_NUCLEUS_AUTH_TOKENwhenever the gateway binds beyond loopback. - Set
SI_NUCLEUS_PUBLIC_URL=https://nucleus.aureuma.aifor public OpenAPI generation. - Keep Viva route ownership docs in sync when ports, paths, or lifecycle change.
Security and auth
Default behavior:- Nucleus binds to loopback only
- local reads and writes work without extra auth on loopback
SI_NUCLEUS_AUTH_TOKEN is set:
- all WebSocket and REST operations require bearer auth from
SI_NUCLEUS_AUTH_TOKEN - the
si nucleus ...CLI forwards that token automatically when the env var is set
- set
SI_NUCLEUS_AUTH_TOKENso public reads and writes are both protected
State layout
Default state root:- runtime state:
~/.si/nucleus/state/ - canonical event ledger:
~/.si/nucleus/state/events/events.jsonl - gateway metadata:
~/.si/nucleus/gateway/metadata.json - worker directories:
~/.si/nucleus/workers/<worker-id>/
- use
si nucleus task prune --older-than-days 30to explicitly remove old completed, failed, or cancelled task records from the durable task ledger - pruning is conservative: it removes only old terminal task records and does not silently delete active worker, session, or run state

