Skip to content

Graphrt 0.5.0

Choose a tag to compare

@BimaPangestu28 BimaPangestu28 released this 23 Nov 04:40
· 77 commits to main since this release
37c7078

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.yaml values 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: integer 2024, expected a string). Quote it. Errors in the file now name the setting's path and line.
  • graphrt serve: a bad query parameter is answered 400 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-jwt refuses 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 Host also 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.
  • graphrt serve --verify-jwt: a run started with a user token streams only response (answer) events, run_started and the terminal event, and its blocking result only run_id, status, outputs, answer, usage, reasons, error_type, reason and elapsed_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_chunk should read response events instead.
    • To keep the old behaviour for trusted clients, pass --user-events all.
  • 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 explicit OTEL_EXPORTER_OTLP_TRACES_ENDPOINT or a pushed OTEL_EXPORTER_OTLP_METRICS_ENDPOINT points elsewhere, or over plain http:// to a non-loopback host.
    • --langfuse-scores refuses plain http:// to a non-loopback host too.
    • Migration: point the preset at its backend with its base URL variable (LANGFUSE_BASE_URL, PHOENIX_COLLECTOR_ENDPOINT, ...), use https:// for a self-hosted backend on another machine, or set the credentials yourself in OTEL_EXPORTER_OTLP_HEADERS when exporting through a collector.
  • POST /v1/runs/{id}/feedback with a user token (--verify-jwt) accepts only runs started with a token of the same user.
    • Run records gain user_verified (true when user_id is a verified sub, kept on resume, false for records written before this release).
    • A run started with the API key and a body user_id is 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 user in the body.

Added

  • Release assets: every platform gets a second archive, graphrt-gateway-<target> (features gateway-all,eval,online-eval: the same CLI plus graphrt gateway and graphrt deploy with every provider, it links mimalloc, the agent archive graphrt-<target> does not), with its checksum in SHA256SUMS and the same smoke test plus gateway --help / deploy --help.
    • The container image gains ghcr.io/bimapangestu28/graphrt:<version>-gateway (also <major.minor>-gateway and gateway).
    • install.sh --gateway installs the gateway build.
    • release.yml builds both.
  • graphrt gateway warm-up and cost guards (plan F4), all off or bounded by default (docs): POST /v1/deployments/{d}/warm prewarms the current version ahead of traffic.
    • warm.predictive learns per-deployment arrival patterns (288 five-minute slots, weekdays and weekends apart, 2.3 KiB) and prewarms lead_secs before expected traffic (hit rate 81–84 % in the seeded simulation, target ≥ 70 %)
    • warm.max_warm_replica_secs_per_day caps 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 and prewarm_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 gateway preempts 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 sends preempt_after_ms and serve --trust-gateway preempts 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 kubeconfig feature of graphrt-provider-k8s reads kubeconfig files without per-struct deserializers, so gw-k8s-kubeconfig is smaller.
  • graphrt gateway runs deployments on Kubernetes, Cloud Run, ECS Fargate, Lambda, Fly and Azure Container Apps, besides local processes: cargo features gateway-k8s (gateway-k8s-in-cluster without kubeconfig), gateway-cloud-run, gateway-ecs, gateway-lambda, gateway-fly, gateway-aca and gateway-all of graphrt-cli (gw-* / deploy-* of graphrt-gateway).
    • Providers are named under providers: in gateway.yaml and 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|aca applies a version with the provider's deploy driver and registers it with the gateway.
    • See docs/gateway.md.
  • Idempotency-Key for 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-request sends Idempotency-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: false turns it off.
    • Plugins receive the key as idempotency_key in node.run (process and WebAssembly), exposed by the Rust, Python, TypeScript and WebAssembly guest SDKs.
    • NodeContext::idempotency_key() in graphrt-core builds it.
    • See docs/workflow-format.md.
  • graphrt serve --deployment NAME (or $GRAPHRT_DEPLOYMENT), now a flag of serve itself (it was part of --trust-gateway): webhook idempotency run ids include the deployment, derived exactly as graphrt gateway derives them (hook- + first 32 hex digits of sha256("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.
  • graphrt-provider-fly (feature provider-fly): the Fly Machines provider of the upcoming graphrt gateway.
    • A deployment version is a pool of pre-created Machines, woken with start (suspended snapshots first), released with suspend falling back to stop, addressed over 6PN.
    • Its deploy driver (graphrt deploy --target fly) creates the app, writes Fly app secrets from env:/fly: references and creates the stopped pool with kill_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.
  • graphrt-provider-api crate: the Provider / DeployDriver traits, capabilities and error kinds of the upcoming graphrt 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::invoke lets a platform without an HTTP address (Lambda) carry the gateway's requests, and max_grace_secs = 0 marks a platform where no preemption is possible.
    • ProviderErrorKind is #[non_exhaustive] and has a PlatformTimeout kind for a run cut at such a platform's time cap (Lambda), recorded as failed{platform_timeout} and never retried.
    • No user-visible change yet.
  • graphrt-gcp crate (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 with ring, exchanged at the OAuth 2.0 token endpoint), cached until exp - 5 min, one shared fetch per token, one refresh after a 401, ±5 min clock skew corrected from the token endpoint's Date, 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-k8s crate: 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 scale subresource (compare-and-swap, singleflight per version), picks the released replica as the scale-in victim with pod-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 TokenSource hook 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.
  • GET /v1/runs/{id}/events honours Last-Event-ID (N resumes after event N, N.k at event N), 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_KEYS for rotation, ±30 s window, replays refused) /internal/v1 routes: 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 any Last-Event-ID, response text included), runs/{id}/abort, drain, and orphans.
    • 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.
  • graphrt serve --listen unix:/path (alias of --addr): listen on a Unix socket created mode 0600.
  • CoordinationStore in graphrt-core (versioned objects written with create_if_absent / compare_and_swap), implemented by the memory and directory stores, and the abstract store conformance suite graphrt_core::store_conformance (feature store-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 /readyz turns 503 draining), pauses every active run (async, streaming and blocking), preempts the ones still busy shortly before --drain-timeout (default 4s), stores them and exits 0.
    • Drained runs end paused with reason kind drained, never failed.
    • Async and webhook runs are resumed by the next server on the same store (--no-resume-drained to 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.
  • RunHandle::preempt / preempt_with and RunHandle::pause_with in graphrt-core: a preempt cancels in-flight nodes and pauses at once. A cancelled node is saved as pending with its exec_id and runs again on resume (at-least-once per node), and container bodies resume at the item that was running.
  • GET /readyz readiness endpoint.
  • CI gate scripts/budget-gate.py with budgets in bench/budgets.toml: binary size and idle RSS of the serve and serve,llm,plugins builds, exec->/healthz p95, and banned crates (cloud SDKs, Kubernetes clients, h2), run as the budgets job for Linux musl x86_64 and aarch64. Baseline in bench/baseline/.
  • graphrt-provider-aws crate: AWS targets of the upcoming gateway without the AWS SDK.
    • auth-aws is 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-ecs runs one ECS Fargate task per replica (RunTask / StopTask / DescribeTasks / ListTasks, stopTimeout ≤ 120 s, for async and cron runs).
    • provider-lambda runs short synchronous runs (≤ 14 min) through InvokeWithResponseStream and Lambda Web Adapter, detects buffered replies and ends over-long runs with an explicit platform_timeout.
    • App Runner is not supported (closed to new customers).
    • The deploy-ecs / deploy-lambda features add the DeployDrivers of graphrt deploy: an ECS task definition revision per version (secrets as Secrets Manager / SSM valueFrom references, 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 in RESPONSE_STREAM mode.
    • See docs/gateway-aws.md.
    • No user-visible change yet.
  • graphrt gateway (preview, opt-in --features gateway, crate graphrt-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 INTO backups and import of graphrt serve --store directories.
    • Per-deployment API keys and JWT iss/aud with 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.
  • Gateway active/passive for on-prem (ha: section, store tier T1-AP): two graphrt gateway processes 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 (flock released), releases on SIGTERM, or (takeover: auto) stops heartbeating for stale_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-api crate: the Provider / DeployDriver traits, capabilities and error kinds of the upcoming graphrt 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::invoke lets a platform without an HTTP address (Lambda) carry the gateway's requests, and max_grace_secs = 0 marks a platform where no preemption is possible.
    • No user-visible change yet.
  • graphrt-provider-azure crate: 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 until exp - 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.rs sends tiny streamed chat and tool-call round-trip requests to OpenAI, Anthropic, Gemini and Bedrock and a typed question to TypeSafe (opt-in with GRAPHRT_LIVE_PROVIDERS=1, each provider skipped without its credentials), and the Live providers workflow runs it nightly and on demand behind repository secrets.
  • CI workflow mobile.yml builds graphrt-ffi for aarch64-linux-android and x86_64-linux-android (cargo-ndk) and for aarch64-apple-ios, aarch64-apple-ios-sim and x86_64-apple-ios, builds both sample apps, and runs the hello workflow in an Android emulator and an iOS simulator through the new examples/mobile/*/scripts/smoke-test.sh. docs/mobile.md gains a checklist for testing on physical devices.
  • Release automation per tag: .github/workflows/cross-platform.yml runs the workspace tests on Windows and macOS for pull requests and main, 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 .exe links the C runtime statically (no VCRUNTIME140.dll).

Changed

  • graphrt-gateway, graphrt-provider-api, graphrt-provider-k8s, graphrt-provider-aws, graphrt-provider-azure, graphrt-provider-fly and graphrt-gcp are published on crates.io (they were internal), so cargo install graphrt-cli --features gateway-all works 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 a serde_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-all x86_64 10,077,000 -> 9,324,616 B (8.89 MiB, within 9 MiB), aarch64 −545 KiB, macOS −471 KiB.
    • bench/budgets.toml holds x86_64 to 8 / 9 MiB.
  • 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).
    • base64 and sha2 are 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.toml now gates gateway-core and gateway-all per architecture.
    • cargo install graphrt-cli from crates.io still builds SQLite with libsqlite3-sys's defaults.
  • The trust-gateway feature 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.py gained delta_of / delta_kib).
    • Agents no longer report orphans (--gateway-url is gone): the gateway pulls them with GET /internal/v1/orphans after a lost stream as after a restart, so an agent never calls the gateway.
    • One handler routes /internal/v1 and boxes each endpoint's future, background tasks share one boxed task type, the gateway stream uses the public stream's type (its hello comes 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 finished instead 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 as failed{owner_lost} in its own store (the gateway owns that decision).
    • Refusals carry short, static messages.
  • Breaking (graphrt-core store API, 0.5.0). RunRecord is #[non_exhaustive] (build it with RunRecord::running or the new RunRecord::queued) and gains deployment, deployment_version, epoch and owner.
    • RunStatus gains Queued.
    • RunStore::append_events takes 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 a Conflict.
    • New RunStore::put_if (a write fenced by the record's epoch, StoreError:: Precondition otherwise) and RunStore::claim_dispatch (queued/paused -> running at epoch + 1)
    • claim_resume increments the epoch too.
    • event_count is now the index of the next event and keeps counting past the store's per-run cap.
    • graphrt serve writes final states with put_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 serve has an id:: the event's index in the run's log (continuing across resumes), <index>.<k> for response text. lagged events have none.
  • graphrt serve writes 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_unavailable instead of only a log line.
  • A streaming caller or /events listener 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 a lagged event.
  • The example Fly config sets kill_signal and kill_timeout.
  • The eval and online-eval cargo features of graphrt-cli are no longer on by default (online-eval needs eval), so cargo install graphrt-cli and docker 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, scores and langfuse stay on by default.

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.lock for 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 a gateway_failover "no steal" failure under CPU load).
    • A lock still busy after stale_after_ms now 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 after stale_after_ms (1.56–1.89 s with 1500 ms, real processes, 13 runs at load average 59–126).
    • ha promote goes 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_failover freezes its active with the lease lock held, so the case runs every time.
  • graphrt gateway: a socket_dir too 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.rs and graphrt-cli/tests/gateway_dev.rs.
  • The gateway feature includes trust-gateway.
    • A --no-default-features --features gateway build answered every run of graphrt gateway --dev (and of kind: local deployments) with agent exited during start-up (exit status: 2): its local agents are graphrt serve --trust-gateway of 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 on gateway-all.
    • New test crates/graphrt-cli/tests/gateway_dev.rs, run by the new CI job gateway without default features (and scripts/ci-local.sh job minimal-gateway).
  • graphrt gateway: a prewarm (cron prewarm_secs, min_replicas of 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 against max_wakes_per_hour. Prewarms now join the in-flight wake and are counted.
  • graphrt gateway no 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: secret and 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} with credentials_required: it needs the secret inputs …, so the client submits it again.
    • graphrt deploy and graphrt gateway --dev register the workflow's secret inputs with the version (secret_inputs on POST /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_lost now finish.
    • The 14 that carry a secret end credentials_required.
  • graphrt gateway no 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_conflict until that instance preempted it.
    • New metric graphrt_gateway_lost_executions_total.
  • graphrt serve drain: runs could be left running at 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 --store directory 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.
  • Telemetry: DO_NOT_TRACK= (empty) and values such as yes/no now turn telemetry off, as documented ("anything but 0/false")
    • Only 0 and false leave it alone.
    • A build with a telemetry endpoint that the user did not opt into no longer creates the config directory and telemetry.lock on every run / serve.
    • Only the telemetry command, or telemetry being on, writes there.
  • --langfuse-scores posted to .../api/public/otel/v1/traces/api/public/scores when LANGFUSE_BASE_URL already 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 answered 404 but left the run running until the next restart, so it could not be resumed or deleted. It stays paused now.
  • Windows: plugin manifests no longer accept rooted paths such as /etc/x or \x for module, checksums or the entrypoint (they are not "absolute" on Windows, yet escaped the plugin directory when joined).
  • Windows: file:///C:/dir/index.json URLs work for GRAPHRT_PLUGIN_INDEX and catalog tarballs.
  • Windows: a killed or wedged process plugin takes its child processes with it (taskkill /T), and plugin and MCP stdio processes get TEMP, TMP and PATHEXT besides SYSTEMROOT, USERPROFILE and APPDATA.
  • Windows: the Python code node keeps the host PATH and SYSTEMROOT, without which CPython cannot start (the Unix default PATH does not exist there).

Security

  • Plugin manifests: a process plugin's cwd must be a relative path inside the plugin directory, and a relative command must 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 cwd such as ../shared inside the plugin, or start the process through a script in the plugin directory, as the rust-text-stats example now does (run.sh).
  • 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 and Debug output: 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 (0600 files, 0700 directories): the serve --store directory (records, events, snapshots, scores.json, .lock), replay cassettes, and graphrt eval -o / --junit reports.
    • 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}/feedback parsed the JSON body (and answered 415/400) before checking the API key or user token, so unauthenticated callers could make the server parse up to --max-body-bytes of 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_result progress (and so gen_ai.tool.call.result, -o events output and stored run events) carried the tool's raw result text, so a tool echoing its tool_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_chars so no prefix of the secret survives.
    • Affects 0.4.0 with capture on.
  • 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, list and info print.
    • Affects 0.4.0.
  • graphrt plugin install <name> extracts into, and plugin install <git-url> clones into, an owner-only (0700) scratch directory. Both used the umask, so under a permissive one (000) in a shared /tmp another local user could replace a file between the checksum check and the copy into the plugin directory. Affects 0.4.0.
  • install.sh refuses a --version / GRAPHRT_VERSION with characters other than those of a release tag: a / could point the archive and its SHA256SUMS at another repository's release (v1/../../../../other/repo/releases/download/v1).
    • GRAPHRT_DOWNLOAD_BASE must be https:// or file://.
    • With wget, an http:// mirror was fetched without TLS.
    • Affects the 0.4.0 installer.
  • packaging/homebrew/render-formula.sh accepts only a semver version and 64-hex digests, which it pastes into Ruby that brew evaluates, and no longer prints a formula with an empty sha256 when an archive is missing from SHA256SUMS.
  • CI: ci.yml and live-providers.yml pin every third-party action by commit SHA (a moved @v4 / @stable tag could have run new code next to the live provider API keys), ci.yml runs 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 tag input must name an existing v* tag, and every job checks out refs/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: wasmi 2.0.1 (yanked) is updated to 2.0.2. The remaining cargo deny ignores (unmaintained, no vulnerability) carry a reason and a review date.
  • A workflow could grow a variable exponentially: an assigner in a loop that appends or extends a variable with itself doubled it every round (memory with extend, CPU through shared children with append, 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-transform checked 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 FlateDecode streams were measured, by a text scan that missed a stream whose dictionary held a nested DecodeParms dictionary after /Filter, or had whitespace before stream, 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.
  • {{#…#}} 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.md has 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 with curl), HA takeover, Kubernetes (kind) wake p95 812 ms and the gateway binary sizes (core 6.69 MiB, gateway-all 7.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 names graphrt 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.0

The 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> (features gateway-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