Index
ipc
¶
IPC layer for the conductor — Unix socket + JSON-RPC 2.0.
Classes¶
DaemonClient
¶
Async client for the Marianne daemon Unix socket IPC.
Parameters¶
socket_path:
Path to the Unix domain socket created by DaemonServer.
timeout:
Seconds to wait for a response before raising TimeoutError.
pool_size:
Maximum number of pooled connections for call().
Source code in src/marianne/daemon/ipc/client.py
Methods:¶
close
async
¶
call
async
¶
Send an RPC; retry transport failures only for known safe reads.
A timeout never retries: the daemon may still be doing the operation. Cancellation and corrupt responses discard the connection, preventing late replies from contaminating the next request.
Source code in src/marianne/daemon/ipc/client.py
stream
async
¶
Send a JSON-RPC request and yield streaming notifications.
Notifications (no id) are yielded as dicts. The final
response (with id) terminates the iteration.
If the final response contains an error, raises the
corresponding DaemonError.
Source code in src/marianne/daemon/ipc/client.py
is_daemon_running
async
¶
Check if daemon is running by performing a lightweight health RPC.
Uses a dedicated connection with a short deadline. Missing/refused sockets return False; an endpoint that accepts but does not respond raises DaemonUnresponsiveError, preserving the difference from absence.
Source code in src/marianne/daemon/ipc/client.py
status
async
¶
register_schedule
async
¶
Request daemon-side recurring registration and accepted digest.
Source code in src/marianne/daemon/ipc/client.py
current_schedule
async
¶
Read only the venue and schedule bound by an accepted receipt.
Source code in src/marianne/daemon/ipc/client.py
cancel_schedule
async
¶
Cancel one bound schedule; never retry a lost mutation response.
Source code in src/marianne/daemon/ipc/client.py
register_schedule_v2
async
¶
Request a daemon-minted receipt for caller-owned durable custody.
Source code in src/marianne/daemon/ipc/client.py
submit_job
async
¶
get_job_status
async
¶
Get status of a specific job.
pause_job
async
¶
Pause a running job. Returns {"paused": bool}.
Source code in src/marianne/daemon/ipc/client.py
resume_job
async
¶
Resume a paused job. Returns a JobResponse dict.
Source code in src/marianne/daemon/ipc/client.py
cancel_job
async
¶
Cancel a running or paused job. Returns {"cancelled": bool}.
Source code in src/marianne/daemon/ipc/client.py
list_jobs
async
¶
clear_jobs
async
¶
Clear terminal jobs from the daemon registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
statuses
|
list[str] | None
|
Status filter (defaults to terminal statuses). |
None
|
older_than_seconds
|
float | None
|
Only clear jobs older than this. |
None
|
job_ids
|
list[str] | None
|
Only clear these specific job IDs. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dict with "deleted" count. |
Source code in src/marianne/daemon/ipc/client.py
config
async
¶
reload_config
async
¶
Trigger the conductor's single config reload path (#408).
Not in _SAFE_RETRY_METHODS: a reload is a mutation, so a
response lost after send has an unknown outcome and is never
blindly retried.
Source code in src/marianne/daemon/ipc/client.py
health
async
¶
Liveness probe independent of busy pooled request connections.
Source code in src/marianne/daemon/ipc/client.py
readiness
async
¶
get_errors
async
¶
Get errors for a specific job.
Source code in src/marianne/daemon/ipc/client.py
diagnose
async
¶
Get diagnostic data for a specific job.
Source code in src/marianne/daemon/ipc/client.py
get_execution_history
async
¶
Get execution history for a specific job.
Source code in src/marianne/daemon/ipc/client.py
recover_job
async
¶
Request recovery data for a specific job.
Source code in src/marianne/daemon/ipc/client.py
rate_limits
async
¶
learning_patterns
async
¶
Get recent learning patterns from the global store.
DaemonServer
¶
DaemonServer(socket_path, handler, *, permissions=432, backlog=100, max_connections=DEFAULT_MAX_CONNECTIONS, max_concurrent_requests=DEFAULT_MAX_CONCURRENT_REQUESTS, max_streams=DEFAULT_MAX_STREAMS, request_timeout=300.0, write_timeout=10.0, read_idle_timeout=DEFAULT_READ_IDLE_TIMEOUT, enforce_peer_uid=True)
Async Unix domain socket server with JSON-RPC 2.0 routing.
Parameters¶
socket_path:
Filesystem path for the Unix domain socket.
handler:
RequestHandler that dispatches JSON-RPC methods.
permissions:
Octal file permissions applied to the socket after creation.
Defaults to 0o660 (owner + group read/write).
max_connections:
Maximum simultaneous connected clients. FD protection — idle
connections are cheap, so the default is high (~500).
max_concurrent_requests:
Maximum requests being processed at once across all connections.
This is the real concurrency control (~50).
read_idle_timeout:
Seconds a connection may sit between complete messages before the
server closes it (dead/stuck client FD hygiene).
enforce_peer_uid:
Refuse connections whose peer UID differs from the daemon's
effective UID. Defense-in-depth over socket file permissions —
the 0o660 mode admits the owning group, and root bypasses file
modes entirely. On platforms where the peer UID cannot be read
(no SO_PEERCRED) the gate fails open, because absence of the
credential is not evidence of a foreign peer. Unix credentials
are user-granular: this stops other users, not other processes
running as the same user.
Source code in src/marianne/daemon/ipc/server.py
Attributes¶
Methods:¶
start
async
¶
Bind the Unix socket and start accepting connections.
Source code in src/marianne/daemon/ipc/server.py
stop
async
¶
Finish owned cleanup before propagating caller cancellation.