Repository navigation
Graphrt 0.5.0
Scale to zero, everywhere. graphrt gateway (preview) is an always on front for scale to zero agents: it owns the run store, holds every run's stream, wakes agents on demand and dispatches runs again after drains, lost replicas and its own restarts. It ships providers for local processes, Kubernetes, Cloud Run, ECS Fargate, Lambda, Fly and Azure Container Apps, and graphrt deploy ships immutable versions to them. Releases now include a second build per platform (graphrt-gateway-<target>) and a :gateway image, while the agent build stays as slim as before. Contains breaking changes, see Changed (Breaking).
Changed (Breaking)
gateway.yamlvalues are typed as YAML resolves them: a string setting given an unquoted number (name: 2024) is refused with its path and line (deployments[0].name (line 3, column 11): invalid type: integer2024, expected a string). Quote it. Errors in the file now name the setting's path and line.graphrt serve: a bad query parameter is answered400 Failed to deserialize query string: <field>: <reason>. Request bodies keep axum's statuses and texts (415, 400, 422 with the field path).graphrt serve --verify-jwtrefuses to start without an API key on every address, loopback included.- A reverse proxy on the same host forwards the internet to a loopback port (and one that rewrites
Hostalso passes the DNS-rebinding check), which made run lists, events and resume of every user public. - Migration: set
GRAPHRT_API_KEY(or--api-key-env VAR) next to--verify-jwt. - User tokens keep working without it on the client side.
- A reverse proxy on the same host forwards the internet to a loopback port (and one that rewrites
graphrt serve --verify-jwt: a run started with a user token streams onlyresponse(answer) events,run_startedand the terminal event, and its blocking result onlyrun_id,status,outputs,answer,usage,reasons,error_type,reasonandelapsed_ms.- Node events (inputs, outputs, tool results, retrieved documents, rendered prompts when capture is on),
run_failed's error text and the pause snapshot are no longer sent to end users. - API-key callers are unchanged.
- Resume and run reads still take only the API key.
- Migration: clients that read
node_chunkshould readresponseevents instead. - To keep the old behaviour for trusted clients, pass
--user-events all.
- Node events (inputs, outputs, tool results, retrieved documents, rendered prompts when capture is on),
- OpenTelemetry presets (
--otel-preset,GRAPHRT_OTEL_PRESET) refuse to start when the preset's credential header (Authorization,x-api-key) would go to a host other than the preset's, because an explicitOTEL_EXPORTER_OTLP_TRACES_ENDPOINTor a pushedOTEL_EXPORTER_OTLP_METRICS_ENDPOINTpoints elsewhere, or over plainhttp://to a non-loopback host.--langfuse-scoresrefuses plainhttp://to a non-loopback host too.- Migration: point the preset at its backend with its base URL variable (
LANGFUSE_BASE_URL,PHOENIX_COLLECTOR_ENDPOINT, ...), usehttps://for a self-hosted backend on another machine, or set the credentials yourself inOTEL_EXPORTER_OTLP_HEADERSwhen exporting through a collector.
POST /v1/runs/{id}/feedbackwith a user token (--verify-jwt) accepts only runs started with a token of the same user.- Run records gain
user_verified(truewhenuser_idis a verifiedsub, kept on resume,falsefor records written before this release). - A run started with the API key and a body
user_idis no longer rateable by that user's token: the body value is an unverified label, so a key holder could make any run rateable by anyone. - Migration: let end users start the runs they rate with their own token.
- API-key callers can still post feedback for any run, with
userin the body.
- Run records gain
Added
- Release assets: every platform gets a second archive,
graphrt-gateway-<target>(featuresgateway-all,eval,online-eval: the same CLI plusgraphrt gatewayandgraphrt deploywith every provider, it links mimalloc, the agent archivegraphrt-<target>does not), with its checksum inSHA256SUMSand the same smoke test plusgateway --help/deploy --help.- The container image gains
ghcr.io/bimapangestu28/graphrt:<version>-gateway(also<major.minor>-gatewayandgateway). install.sh --gatewayinstalls the gateway build.release.ymlbuilds both.
- The container image gains
graphrt gatewaywarm-up and cost guards (plan F4), all off or bounded by default (docs):POST /v1/deployments/{d}/warmprewarms the current version ahead of traffic.warm.predictivelearns per-deployment arrival patterns (288 five-minute slots, weekdays and weekends apart, 2.3 KiB) and prewarmslead_secsbefore expected traffic (hit rate 81–84 % in the seeded simulation, target ≥ 70 %)warm.max_warm_replica_secs_per_daycaps the idle replica-seconds kept warm per UTC day (prewarms refused, idle replicas released at once, runs still wake on demand)wake_storm.max_parallel_wakes(default 16) bounds provider wakes in flight gateway-wide andprewarm_jitter_ms(default 1000) spreads prewarms.- Cron prewarms are jittered and no longer delay the fire.
- New metrics:
graphrt_gateway_prewarm_{started,hits,misses}_total{source},…_warm_replica_seconds,…_warm_budget_replica_seconds,…_wakes_in_flight,…_wakes_gated_total. - Binary (
min-size,--features gateway): +60.8 KiB x86_64 musl (9,441,208 -> 9,503,416 B), +48.2 KiB aarch64 musl (8,074,536 -> 8,123,944 B), +48.6 KiB macOS arm64 (7,011,360 -> 7,061,136 B).
graphrt gatewaypreempts runs shortly before a platform's request cap (Cloud Run 60 min, Container Apps standard ingress 240 s) and re-dispatches them, so long runs continue across the cap: the gateway sendspreempt_after_msandserve --trust-gatewaypreempts the execution itself.- Versions past the 7-day pool are retired on the platform too (Cloud Run traffic tags, Container Apps revisions, Fly Machine pools), with retry.
- The
kubeconfigfeature ofgraphrt-provider-k8sreads kubeconfig files without per-struct deserializers, sogw-k8s-kubeconfigis smaller. graphrt gatewayruns deployments on Kubernetes, Cloud Run, ECS Fargate, Lambda, Fly and Azure Container Apps, besides local processes: cargo featuresgateway-k8s(gateway-k8s-in-clusterwithout kubeconfig),gateway-cloud-run,gateway-ecs,gateway-lambda,gateway-fly,gateway-acaandgateway-allofgraphrt-cli(gw-*/deploy-*ofgraphrt-gateway).- Providers are named under
providers:ingateway.yamland picked per deployment (provider:) - Endpoints and credentials come only from that operator configuration.
- Cloud Run requests carry the invoker ID token (
X-Serverless-Authorization) - Lambda runs go through
InvokeWithResponseStream. graphrt deploy --target k8s|cloud-run|ecs|lambda|fly|acaapplies a version with the provider's deploy driver and registers it with the gateway.- See docs/gateway.md.
- Providers are named under
Idempotency-Keyfor side effects, since execution is at-least-once per node (retries, and the re-run of an in-flight node when a preempted run resumes).http-requestsendsIdempotency-Key: <run_id>:<exec_id>on POST, PUT, PATCH and DELETE: the same for every attempt and re-execution of a node execution, different for any other.- A workflow-set header wins and
idempotency_key: falseturns it off. - Plugins receive the key as
idempotency_keyinnode.run(process and WebAssembly), exposed by the Rust, Python, TypeScript and WebAssembly guest SDKs. NodeContext::idempotency_key()ingraphrt-corebuilds it.- See docs/workflow-format.md.
graphrt serve --deployment NAME(or$GRAPHRT_DEPLOYMENT), now a flag ofserveitself (it was part of--trust-gateway): webhook idempotency run ids include the deployment, derived exactly asgraphrt gatewayderives them (hook-+ first 32 hex digits ofsha256("hook|<deployment>|<hook>|<key>")), so servers of different deployments can share a store and a delivery maps to one run whichever of the two receives it.- Without it, ids are derived as before.
- See docs/serving.md.
graphrt-provider-fly(featureprovider-fly): the Fly Machines provider of the upcominggraphrt gateway.- A deployment version is a pool of pre-created Machines, woken with
start(suspended snapshots first), released withsuspendfalling back tostop, addressed over 6PN. - Its
deploydriver (graphrt deploy --target fly) creates the app, writes Fly app secrets fromenv:/fly:references and creates the stopped pool withkill_timeout=grace_secs(≤ 300 s). - Hand-rolled Machines REST client, no Fly SDK.
- Passes the provider conformance suite against a fake Machines API.
- Not wired into a binary yet.
- See docs/gateway-fly.md.
- A deployment version is a pool of pre-created Machines, woken with
graphrt-provider-apicrate: theProvider/DeployDrivertraits, capabilities and error kinds of the upcominggraphrt gateway, the shared provider HTTP layer (token bucket per provider API, jittered retry, token cache with one refresh on 401) and the C1–C13 provider conformance harness with a scripted fake HTTP server.Provider::invokelets a platform without an HTTP address (Lambda) carry the gateway's requests, andmax_grace_secs = 0marks a platform where no preemption is possible.ProviderErrorKindis#[non_exhaustive]and has aPlatformTimeoutkind for a run cut at such a platform's time cap (Lambda), recorded asfailed{platform_timeout}and never retried.- No user-visible change yet.
graphrt-gcpcrate (gateway plan F2, GCP family), each part behind its own cargo feature and without a Google SDK.auth-gcp: access and ID tokens from the metadata server or a service-account key (RS256 JWT signed withring, exchanged at the OAuth 2.0 token endpoint), cached untilexp - 5 min, one shared fetch per token, one refresh after a 401, ±5 min clock skew corrected from the token endpoint'sDate, never logged.provider-cloud-run: the Cloud Run provider (Addressing::Url, platform-scaled, min instances 0, startup CPU boost, request-based billing, 10 s grace -> preempt, 60-min cap -> planned preempt)deploy-cloud-run: its deploy driver over the Cloud Run Admin API v2 (one traffic tag per version so old versions stay wakeable until retired) and Secret Manager references.- Conformance C1–C12 against fake Google APIs.
- See docs/gateway-cloud-run.md for IAM roles and what still needs a real project.
graphrt-provider-k8scrate: the Kubernetes provider of the upcoming gateway, for self-hosted clusters, kind/k3s, GKE, EKS and AKS.- Scales a version's Deployment 0↔N through the
scalesubresource (compare-and-swap, singleflight per version), picks the released replica as the scale-in victim withpod-deletion-cost, tracks readiness from EndpointSlice watches, and server-side applies Deployment + Service with Secret references only. - Cluster auth: in-cluster service account, kubeconfig token / token file / client certificate / exec plugins, and a
TokenSourcehook for EKS, GKE and AKS tokens. - Minimal REST on the shared provider HTTP layer, no
kube/k8s-openapi. - Passes the shared C1–C13 harness against an emulated API server and an opt-in kind test.
- See docs/kubernetes-provider.md.
- Scales a version's Deployment 0↔N through the
GET /v1/runs/{id}/eventshonoursLast-Event-ID(Nresumes after eventN,N.kat eventN), so reconnecting clients get the rest of the run without gaps or duplicates.graphrt serve --trust-gateway --deployment NAME: the agent side of the gateway protocol (Graphrt-Protocol: 1).- Signed (
Graphrt-Sig, HMAC-SHA256 over method, path, deployment, run id, epoch, a per-request nonce and the body hash, key ids from$GRAPHRT_GATEWAY_KEYSfor rotation, ±30 s window, replays refused)/internal/v1routes:hello,runs(start, or resume with the snapshot in the body, same epoch attaches, never re-executes),runs/{id}/stream(reattach to a running execution from anyLast-Event-ID, response text included),runs/{id}/abort,drain, andorphans. - A gateway-started run whose stream breaks is preempted after 3 s without a reattach and held for
--reclaim-grace-secs(60) as an orphan that the gateway pulls (GET /internal/v1/orphans), instead of being aborted. - Cargo feature
trust-gateway(default, no new dependency). - See docs/gateway-protocol.md.
- Signed (
graphrt serve --listen unix:/path(alias of--addr): listen on a Unix socket created mode0600.CoordinationStoreingraphrt-core(versioned objects written withcreate_if_absent/compare_and_swap), implemented by the memory and directory stores, and the abstract store conformance suitegraphrt_core::store_conformance(featurestore-conformance), including a property test of retried, overlapping and lost-reply appends.- Graceful shutdown for
graphrt serve: SIGTERM and SIGINT start a drain that refuses new runs (503+Retry-After,GET /readyzturns503 draining), pauses every active run (async, streaming and blocking), preempts the ones still busy shortly before--drain-timeout(default4s), stores them and exits0.- Drained runs end
pausedwith reason kinddrained, neverfailed. - Async and webhook runs are resumed by the next server on the same store (
--no-resume-drainedto opt out). - Before, a SIGTERM was ignored when graphrt ran as PID 1 of a container (the image has no init) and every active run was lost to the SIGKILL.
- See docs/serving.md and the grace periods per platform in docs/deploy.md.
- Drained runs end
RunHandle::preempt/preempt_withandRunHandle::pause_withingraphrt-core: a preempt cancels in-flight nodes and pauses at once. A cancelled node is saved as pending with itsexec_idand runs again on resume (at-least-once per node), and container bodies resume at the item that was running.GET /readyzreadiness endpoint.- CI gate
scripts/budget-gate.pywith budgets inbench/budgets.toml: binary size and idle RSS of theserveandserve,llm,pluginsbuilds, exec->/healthzp95, and banned crates (cloud SDKs, Kubernetes clients,h2), run as thebudgetsjob for Linux musl x86_64 and aarch64. Baseline inbench/baseline/. graphrt-provider-awscrate: AWS targets of the upcoming gateway without the AWS SDK.auth-awsis a hand-rolled SigV4 signer (header and presigned), the credential chain env -> container endpoint (ECS task role, EKS Pod Identity) -> STS web identity (IRSA) -> IMDSv2 with caching, refresh-once on 401/403 and clock-skew correction, and presigned EKS tokens.provider-ecsruns one ECS Fargate task per replica (RunTask/StopTask/DescribeTasks/ListTasks,stopTimeout≤ 120 s, for async and cron runs).provider-lambdaruns short synchronous runs (≤ 14 min) throughInvokeWithResponseStreamand Lambda Web Adapter, detects buffered replies and ends over-long runs with an explicitplatform_timeout.- App Runner is not supported (closed to new customers).
- The
deploy-ecs/deploy-lambdafeatures add theDeployDrivers ofgraphrt deploy: an ECS task definition revision per version (secrets as Secrets Manager / SSMvalueFromreferences,stopTimeout≤ 120 s), and a Lambda container-image function created or updated, published, aliased by version, with Lambda Web Adapter streaming settings and an IAM Function URL inRESPONSE_STREAMmode. - See docs/gateway-aws.md.
- No user-visible change yet.
graphrt gateway(preview, opt-in--features gateway, crategraphrt-gateway): an always-on front of scale-to-zero agents and the only writer of the run store.- SQLite (WAL) store with in-process
VACUUM INTObackups and import ofgraphrt serve --storedirectories. - Per-deployment API keys and JWT
iss/audwith a JWKS cache. - Per-IP and per-user GCRA limits.
- Activator (hold + singleflight wake + bounded, age-limited queue), least-loaded scaler 0->N, idle release and reconciliation.
- Quotas (
max_replicas,max_queued,max_wakes_per_hour) - Webhooks whose run record is the idempotency marker, with a completion-callback outbox.
- Cron with time zones, an explicit DST policy, catch-up, deterministic jitter and prewarm.
- Immutable versions with a 7-day pool for paused runs.
- Re-dispatch of drained, preempted and orphaned runs, and reclaim after a gateway restart.
/metrics.graphrt gateway --dev,key,import,check.- Local-process provider.
graphrt deploy --target local.- The gateway build uses mimalloc, agents do not.
- See docs/gateway.md.
- SQLite (WAL) store with in-process
- Gateway active/passive for on-prem (
ha:section, store tier T1-AP): twographrt gatewayprocesses share the SQLite store and a lease on one volume (one host, or DRBD / a SAN LUN).- A passive opens nothing and does not listen.
- It takes over when the active exits (
flockreleased), releases on SIGTERM, or (takeover: auto) stops heartbeating forstale_after_ms, killing a frozen holder on the same host. - Every take raises a fencing token that each store write checks inside its SQLite transaction, so a superseded active can never commit again (I8)
- A self-fence stops an unconfirmed active even earlier.
- Takeover verifies the store (
quick_check) and restores the newest backup when it is missing or corrupt, then reclaims runs as after a restart. - Cron and webhook run ids keep fires and deliveries single across failovers.
graphrt gateway --ha-node,graphrt gateway ha status|promote.- Docs with systemd units and unsupported volumes (NFS, SMB, RWX) in docs/gateway-ha.md.
graphrt-provider-apicrate: theProvider/DeployDrivertraits, capabilities and error kinds of the upcominggraphrt gateway, the shared provider HTTP layer (token bucket per provider API, jittered retry, token cache with one refresh on 401) and the C1–C13 provider conformance harness with a scripted fake HTTP server.Provider::invokelets a platform without an HTTP address (Lambda) carry the gateway's requests, andmax_grace_secs = 0marks a platform where no preemption is possible.- No user-visible change yet.
graphrt-provider-azurecrate: the Azure provider family of the upcoming gateway, without an Azure SDK.auth-azure: Entra ID tokens from managed identity (IDENTITY_ENDPOINT, IMDS), client secret, PS256 certificate assertion and workload identity federation, cached untilexp - 5 min.provider-aca: Azure Container Apps provider (scale-to-zero HTTP rule, one label URL per deployment version, single-flight warm-up).deploy-aca: deploy driver over ARM REST with revision labels, 7-day retention of old versions and Key Vault secret references.- Passes the shared conformance harness against fake servers.
- +48.8 KiB (
auth-azure) and +48.8 KiB (provider-aca) on macOS arm64. - See docs/deploy-azure.md, including what still needs a real subscription and the RBAC roles.
- Live provider test matrix:
crates/graphrt-llm/tests/live_providers.rssends tiny streamed chat and tool-call round-trip requests to OpenAI, Anthropic, Gemini and Bedrock and a typed question to TypeSafe (opt-in withGRAPHRT_LIVE_PROVIDERS=1, each provider skipped without its credentials), and theLive providersworkflow runs it nightly and on demand behind repository secrets.- See docs/providers.md.
- CI workflow
mobile.ymlbuildsgraphrt-ffiforaarch64-linux-androidandx86_64-linux-android(cargo-ndk) and foraarch64-apple-ios,aarch64-apple-ios-simandx86_64-apple-ios, builds both sample apps, and runs the hello workflow in an Android emulator and an iOS simulator through the newexamples/mobile/*/scripts/smoke-test.sh. docs/mobile.md gains a checklist for testing on physical devices. - Release automation per tag:
.github/workflows/cross-platform.ymlruns the workspace tests on Windows and macOS for pull requests andmain, and on Linux, macOS and Windows before a tag is built.- Nothing is published unless they pass.
- Release binaries are smoke-tested on their own OS (
scripts/smoke-release-binary.sh, x86_64 macOS is cross-built only), and the Windows.exelinks the C runtime statically (noVCRUNTIME140.dll).
Changed
graphrt-gateway,graphrt-provider-api,graphrt-provider-k8s,graphrt-provider-aws,graphrt-provider-azure,graphrt-provider-flyandgraphrt-gcpare published on crates.io (they were internal), socargo install graphrt-cli --features gateway-allworks from crates.io.- Their Rust APIs are young and may change between minor releases.
- Smaller binaries from less generic code, no feature removed.
- YAML is parsed by one function (
graphrt_core::yaml::to_value) and every document then deserialized from aserde_json::Value. - Node configs and HTTP request bodies no longer go through
serde_path_to_error(the offending path is recovered from the error, only when there is one:graphrt_core::value_path) - The stores' blocking jobs and the background tasks share one tokio task type (
graphrt_core::task) - Sorts with unique keys are unstable sorts.
- Gateway core (
min-size): x86_64 musl 9,042,760 -> 8,291,784 B (8.62 -> 7.91 MiB, −733 KiB, now within the plan's 8 MiB), aarch64 musl 7,668,672 -> 7,112,896 B (−543 KiB), macOS arm64 6,758,768 -> 6,259,824 B (−487 KiB) gateway-allx86_64 10,077,000 -> 9,324,616 B (8.89 MiB, within 9 MiB), aarch64 −545 KiB, macOS −471 KiB.bench/budgets.tomlholds x86_64 to 8 / 9 MiB.
- YAML is parsed by one function (
- Smaller binaries wherever SQLite or C code is linked: builds from this repository (CI, release binaries, the container image) compile the bundled SQLite without full-text search, R*Tree, STAT4, dbstat, soundex, column metadata and extension loading, which graphrt never used, plus SQLite's recommended
OMIT_DEPRECATED/OMIT_SHARED_CACHE, and the C dependencies of the static musl builds without unwind tables (.cargo/config.toml).base64andsha2are no longer linked in two versions.- Gateway core (
min-size): x86_64 musl 9,503,416 -> 9,040,840 B (−451.7 KiB), aarch64 musl 8,124,200 -> 7,667,392 B (−446.1 KiB), macOS arm64 7,061,136 -> 6,758,752 B (−295.3 KiB) gateway-all−461.1 / −449.2 / −311.5 KiB.bench/budgets.tomlnow gatesgateway-coreandgateway-allper architecture.cargo install graphrt-clifrom crates.io still builds SQLite with libsqlite3-sys's defaults.
- The
trust-gatewayfeature is about 40 % smaller (slim agent,min-size: +73 KiB instead of +126 KiB on Linux musl aarch64, +89 instead of +150 KiB on x86_64), with a budget in the CI gate (agent-slim-gateway, measured + about 5 %,budget-gate.pygaineddelta_of/delta_kib).- Agents no longer report orphans (
--gateway-urlis gone): the gateway pulls them withGET /internal/v1/orphansafter a lost stream as after a restart, so an agent never calls the gateway. - One handler routes
/internal/v1and boxes each endpoint's future, background tasks share one boxed task type, the gateway stream uses the public stream's type (itshellocomes from the guard), request bodies are read from a JSON tree with the snapshot decoder of the run store, and responses are written as text. - Behavior changes on the agent side of the (unreleased) gateway protocol: a start or reattach for an execution that already finished is
409 finishedinstead of a replay of its stored events (its outcome reached the gateway on a stream or is held as an orphan), and the agent no longer rewrites an unreclaimed run asfailed{owner_lost}in its own store (the gateway owns that decision). - Refusals carry short, static messages.
- Agents no longer report orphans (
- Breaking (
graphrt-corestore API, 0.5.0).RunRecordis#[non_exhaustive](build it withRunRecord::runningor the newRunRecord::queued) and gainsdeployment,deployment_version,epochandowner.RunStatusgainsQueued.RunStore::append_eventstakes the index of the batch's first event (append_events(run_id, first_index, &events) -> event_count) and is idempotent per index range: a retried batch is stored once, a gap or an altered retry is aConflict.- New
RunStore::put_if(a write fenced by the record's epoch,StoreError:: Preconditionotherwise) andRunStore::claim_dispatch(queued/paused -> running atepoch + 1) claim_resumeincrements the epoch too.event_countis now the index of the next event and keeps counting past the store's per-run cap.graphrt servewrites final states withput_if, and an event batch whose write failed goes out again at the same index with the next one instead of being lost.- See docs/gateway-protocol.md.
- Every SSE event of
graphrt servehas anid:: the event's index in the run's log (continuing across resumes),<index>.<k>forresponsetext.laggedevents have none. graphrt servewrites a run's events to the store every 32 events or 250 ms after the first unwritten one (before: only every 32 events), so replays trail live runs by at most a quarter second.- Store writes failing with an I/O error are retried five times with backoff (about 0.8 s)
- A paused run whose snapshot cannot be stored gets
error_type: store_unavailableinstead of only a log line.
- A streaming caller or
/eventslistener that falls behind a fast run is refilled from the run's in-memory feed instead of silently skipping events (streaming starts skipped them before). Only events beyond the feed's first 10,000 are reported with alaggedevent. - The example Fly config sets
kill_signalandkill_timeout. - The
evalandonline-evalcargo features ofgraphrt-cliare no longer on by default (online-evalneedseval), socargo install graphrt-clianddocker build .are smaller.- Enable them with
--features eval,online-eval(Docker:--build-arg EXTRA_FEATURES=eval,online-eval). - The release binaries, Homebrew formula and GHCR image are built with both, as in 0.4.0.
jwt,scoresandlangfusestay on by default.
- Enable them with
Fixed
- Gateway HA: a passive now takes over from an active frozen (
SIGSTOP, VM pause, CPU starvation) inside a heartbeat.- The heartbeat holds
graphrt-gateway.lease.lockfor its write + fsync + rename (4 ms p50, 8 ms max on macOS APFS, about 2 % of a 200 ms beat, longer under load), and a process frozen there kept the lock, so every passive poll found it busy and waited until the process resumed: no steal, no kill (the cause of agateway_failover"no steal" failure under CPU load). - A lock still busy after
stale_after_msnow means its holder is frozen, and the passive applies the usual rules without it (the lease file is replaced atomically, the store fence still orders the tokens): it kills the frozen holder on the same host and takes over afterstale_after_ms(1.56–1.89 s with 1500 ms, real processes, 13 runs at load average 59–126). ha promotegoes through such a lock as well.- The failover simulation now freezes processes inside the lock (with the heartbeat's write landing late on resume) and checks that a frozen active on one host loses the lease before it resumes: 147 violations in 1,000 seeds without the fix, 0 in 10,000 with it.
gateway_failoverfreezes its active with the lease lock held, so the case runs every time.
- The heartbeat holds
graphrt gateway: asocket_dirtoo long for Unix socket paths (104 bytes on macOS, 108 on Linux, e.g. a deep$TMPDIR) made every local agent exit with status 2 (agent exited during start-up).- The gateway now puts the agents' sockets and pid files in a short private directory,
/tmp/graphrt-gw-<hash of socket_dir>(0700, owner checked, the same after a restart so orphans are adopted), and logs it. - Tests with a long base directory in
graphrt-gateway/tests/local_provider.rsandgraphrt-cli/tests/gateway_dev.rs.
- The gateway now puts the agents' sockets and pid files in a short private directory,
- The
gatewayfeature includestrust-gateway.- A
--no-default-features --features gatewaybuild answered every run ofgraphrt gateway --dev(and ofkind: localdeployments) withagent exited during start-up (exit status: 2): its local agents aregraphrt serve --trust-gatewayof the same binary, which that build could not run. - Costs 48.8 KiB on the gateway core build (macOS arm64,
min-size: 6,961,376 -> 7,011,360 B) and 81.1 KiB ongateway-all. - New test
crates/graphrt-cli/tests/gateway_dev.rs, run by the new CI jobgateway without default features(andscripts/ci-local.shjobminimal-gateway).
- A
graphrt gateway: a prewarm (cronprewarm_secs,min_replicasof a new version) went around the pool's singleflight and the wake quota, so a prewarm and a cold request at the same moment could start two replicas, and prewarms did not count againstmax_wakes_per_hour. Prewarms now join the in-flight wake and are counted.graphrt gatewayno longer loses a run without a checkpoint when the gateway restarts.- Each accepted run request is written to the store in the transaction that creates the run (no extra write), without the start inputs the version declares
type: secretand without the inputs mapped from request headers (user_jwt) - Only their names are kept (
needs_secrets). - After a restart such a run is re-dispatched from the stored request with the same run id.
- Only one that needs a secret ends
failed{owner_lost}withcredentials_required: it needs the secret inputs …, so the client submits it again. graphrt deployandgraphrt gateway --devregister the workflow's secret inputs with the version (secret_inputsonPOST /admin/v1/deployments/{name}/versions)- A version registered without them has every input treated as secret, so nothing undeclared is persisted.
- In the gateway crash simulation (40 seeds on a one-URL platform) the 18 runs that used to end
owner_lostnow finish. - The 14 that carry a secret end
credentials_required.
- Each accepted run request is written to the store in the transaction that creates the run (no extra write), without the start inputs the version declares
graphrt gatewayno longer loses a run whose executor disappears without an outcome.- On a one-URL platform (Cloud Run, ACA, Lambda), where no orphan can be pulled from an instance, or when no orphan comes within the reclaim grace (the instance is gone), the run is re-dispatched at the next epoch from its latest stored snapshot, else from its request with the same run id (nodes may run again: at-least-once, keyed by
Idempotency-Key). - It ends
failed{owner_lost}only when that is impossible, and says why: the request's credentials expired, the executor was lost 4 times in a row (SupervisorSettings::max_lost_executions), or it needs a secret input after a gateway restart (see below). - A re-dispatch that reaches the instance still holding the lost execution retries its
409 epoch_conflictuntil that instance preempted it. - New metric
graphrt_gateway_lost_executions_total.
- On a one-URL platform (Cloud Run, ACA, Lambda), where no orphan can be pulled from an instance, or when no orphan comes within the reclaim grace (the instance is gone), the run is re-dispatched at the next epoch from its latest stored snapshot, else from its request with the same run id (nodes may run again: at-least-once, keyed by
graphrt servedrain: runs could be leftrunningat the drain deadline (and marked failed by the next start) when the store was slow.- The preemption reserve assumed 10 ms per active run, but a
--storedirectory serialises writes behind one lock and syncs several files per write, so on a busy disk the final writes of many runs stopped at once overran it (seen as 8 of 10 runs paused under load). - The reserve now uses the store's measured recent write latency (three writes per run, at least 10 ms) and is recomputed while the drain waits.
- The preemption reserve assumed 10 ms per active run, but a
- Telemetry:
DO_NOT_TRACK=(empty) and values such asyes/nonow turn telemetry off, as documented ("anything but0/false")- Only
0andfalseleave it alone. - A build with a telemetry endpoint that the user did not opt into no longer creates the config directory and
telemetry.lockon everyrun/serve. - Only the
telemetrycommand, or telemetry being on, writes there.
- Only
--langfuse-scoresposted to.../api/public/otel/v1/traces/api/public/scoreswhenLANGFUSE_BASE_URLalready named the OTLP traces endpoint (which the preset accepts). Preset base URLs now drop the traces path.graphrt serve: resuming a paused run whose workflow is no longer served answered404but left the runrunninguntil the next restart, so it could not be resumed or deleted. It stayspausednow.- Windows: plugin manifests no longer accept rooted paths such as
/etc/xor\xformodule, checksums or the entrypoint (they are not "absolute" on Windows, yet escaped the plugin directory when joined). - Windows:
file:///C:/dir/index.jsonURLs work forGRAPHRT_PLUGIN_INDEXand catalog tarballs. - Windows: a killed or wedged process plugin takes its child processes with it (
taskkill /T), and plugin and MCP stdio processes getTEMP,TMPandPATHEXTbesidesSYSTEMROOT,USERPROFILEandAPPDATA. - Windows: the Python code node keeps the host
PATHandSYSTEMROOT, without which CPython cannot start (the Unix defaultPATHdoes not exist there).
Security
- Plugin manifests: a process plugin's
cwdmust be a relative path inside the plugin directory, and a relativecommandmust not contain.., so a manifest cannot point the process at files outside its directory.- Bare names on
PATH(python3) and absolute system paths stay allowed. - Migration: move a
cwdsuch as../sharedinside the plugin, or start the process through a script in the plugin directory, as therust-text-statsexample now does (run.sh).
- Bare names on
- Bundles: extraction refuses Windows device names (
CON,PRN,AUX,NUL,COM1-COM9,LPT1-LPT9, with any extension) in any path component, and paths that differ only in case, which overwrite each other on case-insensitive file systems so a verified file could be swapped. - URLs are shown without
user:password@userinfo in startup lines, errors andDebugoutput:OtelConfig, the preset's resolved settings, the Langfuse uploader, JWKS, webhook callback and telemetry endpoints. - Run data written to disk is owner-only on Unix (
0600files,0700directories): theserve --storedirectory (records, events, snapshots,scores.json,.lock), replay cassettes, andgraphrt eval -o/--junitreports.- They hold prompts, answers and user data and were created with the umask, so usually world-readable.
- Existing files keep their mode.
- Run
chmod -R go= <store-dir>once to tighten an existing store. - The four "fresh owner-only temp directory" implementations (bundle configs, the Python runner, catalog and git plugin installs) now share
graphrt_core::private_fs. (Low, 0.4.0 is affected.)
graphrt serve: human feedback could fill a run's 256-score cap and make every later online-evaluator score of that run fail to store, so an end user (--verify-jwt) could keep a safety judge from ever scoring their own runs. The cap now counts each source (human,online) separately. (Low, 0.4.0 is affected.)graphrt serve:POST /v1/runs/{id}/feedbackparsed the JSON body (and answered415/400) before checking the API key or user token, so unauthenticated callers could make the server parse up to--max-body-bytesof JSON per request. It now authenticates first, like every other route. (Low, 0.4.0 is affected.)- With OpenTelemetry content capture on, the agent's
tool_resultprogress (and sogen_ai.tool.call.result,-o eventsoutput and stored run events) carried the tool's raw result text, so a tool echoing itstool_context(for example an upstream error repeating the end user's JWT) leaked the plaintext.- It now carries the same masked text the model sees, masked before it is cut to
max_tool_output_charsso no prefix of the secret survives. - Affects 0.4.0 with capture on.
- It now carries the same masked text the model sees, masked before it is cut to
graphrt plugin install <name>: errors that quote a catalog tarball's contents (a refused entry path, a manifest field) no longer print its control characters, so a published plugin cannot send terminal escape sequences (OSC 52 clipboard writes, screen clears).- Catalog text also has Unicode bidirectional formatting characters (U+202E and friends) replaced, and plugin manifests refuse control characters in node kinds and tool names, which
plugin install,listandinfoprint. - Affects 0.4.0.
- Catalog text also has Unicode bidirectional formatting characters (U+202E and friends) replaced, and plugin manifests refuse control characters in node kinds and tool names, which
graphrt plugin install <name>extracts into, andplugin install <git-url>clones into, an owner-only (0700) scratch directory. Both used the umask, so under a permissive one (000) in a shared/tmpanother local user could replace a file between the checksum check and the copy into the plugin directory. Affects 0.4.0.install.shrefuses a--version/GRAPHRT_VERSIONwith characters other than those of a release tag: a/could point the archive and itsSHA256SUMSat another repository's release (v1/../../../../other/repo/releases/download/v1).GRAPHRT_DOWNLOAD_BASEmust behttps://orfile://.- With wget, an
http://mirror was fetched without TLS. - Affects the 0.4.0 installer.
packaging/homebrew/render-formula.shaccepts only a semver version and 64-hex digests, which it pastes into Ruby thatbrewevaluates, and no longer prints a formula with an emptysha256when an archive is missing fromSHA256SUMS.- CI:
ci.ymlandlive-providers.ymlpin every third-party action by commit SHA (a moved@v4/@stabletag could have run new code next to the live provider API keys),ci.ymlruns with a read-only token and without persisted checkout credentials, and the PostgREST binary the chatbot e2e job installs as root is checked against its sha256. - Release workflow: a manual run's
taginput must name an existingv*tag, and every job checks outrefs/tags/<tag>, so a branch with the same name can no longer be built and published as that release (the input was used unchecked as the ref and the release tag).cargo-zigbuild, which runs in the jobs that produce the release binaries, is pinned to 0.24.1, and no release job keeps checkout credentials.
- Dependencies:
wasmi2.0.1 (yanked) is updated to 2.0.2. The remainingcargo denyignores (unmaintained, no vulnerability) carry a reason and a review date. - A workflow could grow a variable exponentially: an
assignerin a loop that appends or extends a variable with itself doubled it every round (memory withextend, CPU through shared children withappend, where type inference walked the whole value).- Assigner inputs read from a variable are now limited to 1,000,000 values and 128 levels of nesting, and type inference no longer descends into nested arrays.
template-transformchecked its 1 MiB output limit only after rendering, so a short loop over a large string could render gigabytes first. The render now writes into a capped buffer and stops at the limit.- PDF extraction: the decompression budget (
max_decompressed_bytes) could be bypassed, letting a small uploaded PDF make the parser allocate gigabytes.- Only
FlateDecodestreams were measured, by a text scan that missed a stream whose dictionary held a nestedDecodeParmsdictionary after/Filter, or had whitespace beforestream, or had a bad zlib header (the parser then retries as raw deflate). LZWDecode, filter chains, PNG-predictor row buffers (sized from/Columns) and encrypted documents were not measured at all.- Streams are now decoded the way the parser decodes them, with every filter it supports, both before loading and on the parsed document before text is extracted.
- Only
{{#…#}}variable templates parsed in quadratic time: every{{#searched the rest of the text for#}}, so a 900 KB string of{{#took minutes (in a workflow document, or at run time in conditions and list filters). The search now stops at the longest possible placeholder.
Documentation
docs/gateway.mdhas a "Measured so far" table: agent exec ->/healthz, gateway restart, gateway start, a first run that wakes a local agent from zero (p50 17.4 ms withcurl), HA takeover, Kubernetes (kind) wake p95 812 ms and the gateway binary sizes (core 6.69 MiB,gateway-all7.40 MiB, macOS arm64).- It states that Cloud Run, Container Apps, ECS, Lambda and Fly are tested against API fakes only.
- The quick start installs from git until the gateway is released.
- The kind measurement is in
docs/kubernetes-provider.md, the README row namesgraphrt deploy --target, and the docs index groups the gateway guides.
Install
# agent build (run, serve, eval)
curl -fsSL https://github.com/Graphrt/graphrt/releases/download/v0.5.0/install.sh | sh
# gateway build (the same CLI plus `graphrt gateway` and `graphrt deploy`, every provider)
curl -fsSL https://github.com/Graphrt/graphrt/releases/download/v0.5.0/install.sh | sh -s -- --gateway
brew install graphrt/graphrt/graphrt
cargo install graphrt-cli # add --features gateway-all for the gateway
docker pull ghcr.io/bimapangestu28/graphrt:0.5.0The container image of this release was published at ghcr.io/bimapangestu28/graphrt and stays there. Starting with the next release, images are published at ghcr.io/graphrt/graphrt.
- Assets:
graphrt-<target>is the agent build.graphrt-gateway-<target>(featuresgateway-all,eval,online-eval, with mimalloc) is the gateway build for Linux (static musl, x86_64 and aarch64) and macOS (x86_64 and aarch64). The gateway is Unix-only, so there is no Windows gateway archive. - Gateway providers: Kubernetes is measured on a local kind cluster. Cloud Run, ECS Fargate, Lambda, Fly and Azure Container Apps are tested against API fakes (conformance suite). Real cloud verification is pending.
- Windows (experimental): cross-compiled (MSVC, static C runtime), not yet run on Windows.
Full changelog: CHANGELOG.md · v0.4.0...v0.5.0