Changelog
All notable changes to RaySpec. This page is generated from the
repo’s CHANGELOG.md at build time — entries appear here exactly as
they ship. Release artifacts live on GitHub →
Under FSL-1.1-ALv2, each release converts to Apache-2.0 after two years — the license irrevocably grants the future license “effective on the second anniversary of the date we make the Software available”. That date is shown next to every version below.
# added
- Sentence-sized transcript spans (
span_granularityon thesttcapability). The Deepgram adapter cut a transcript into one span per paragraph, so the sentences of a paragraph shared one span id and several claims extracted from it cited the same id: a reader could not tell which sentence backed which claim. A product document can now declarespan_granularity: sentenceon itssttcapability, besideprovider_policy, and the adapter emits one span per sentence of the provider's response, with the sentence's own text, start and end. The setting is part of the document, so it is the same on every deployment of it and travels in the bundle;rayspec packandrayspec bundle verifyaccept it and derive the samerequires,permissionsandbindingsas without it. Values areparagraphandsentence; another value is aschema_violation, and so is the key on a capability other thanstt, at validation (rayspec doctor,planandpackrefuse it; the deploy composition refuses it again). The default does not change: a document without the key, or withspan_granularity: paragraph, gets the spans, the span ids and the transcript rows it got before, and the request sent to the provider is the same under both values. A response without paragraphs carries no sentences and is cut at pauses under both values. A sentence without text is skipped and its time goes to the neighbouring sentence of its paragraph. The fake adapter (STT_PROVIDER=fake) emits its fixtures' segments as written and ignores the key. Span ids differ between the two granularities. An id keeps the form<track>:s<index>, and the index counts paragraphs underparagraphand sentences undersentence, somic:s1names different text under each and evidence stored under one value does not match transcripts produced under the other. Choose the value before a product stores evidence. Nothing is migrated on a change: sessions that are not processed again stay consistent with themselves;POST /v1/sessions/{id}/reprocessrewrites a session's transcript and artifact rows at the current value; the rows a reprocess preserves (human-edited rows of a kind withpreserve_human_edits, dismissed rows, surplus rows of a kind withoutreconcile_stale_rows) keep the citations of the earlier value and are not marked as such. A transcript row cut per sentence carriespayload.span_granularity: sentence, which a view can project; a paragraph-granular row is unchanged and carries no such key, and neither does a row from the fake adapter, from a supplied adapter or from a response without paragraphs. Seespan_granularityonstt. A deployed product runs end to end with no provider key. A product that transcribes could validate, plan, dry-run and pack without a key, but a real deployment of it could not get a recording past transcription:
STT_PROVIDER=fakebuilt the fake adapter with no fixtures, and the deterministic extraction provider refused the product's committed extraction config because it names a real backend. Three environment variables close that, for development and tests:RAYSPEC_STT_FAKE_FIXTURESnames a directory of transcript fixture files (*.json) the fake adapter answers recordings from. A fixture for the recording's own session answers first, then a fixture whosesession_idis*(any session). The directory is read once, at boot; a directory that cannot be read, holds no fixture, holds a malformed one or holds two for the same session and track refuses the boot instead of failing the first recording. A recording's session and track ids are only compared with the ids the fixtures declare: no path is built from them. A symbolic link is followed only to a regular file inside the directory (the layout of a mounted volume); a fixture file is at most 1 MiB, and the span ids of a file are unique over all its tracks.RAYSPEC_STT_FAKE_FALLBACK=fixedanswers a recording no fixture matches with a fixed two-sentence transcript, with or without a fixture directory. It carries no labelled line, so it takes a recording to a readable transcript, not to extracted artifacts.RAYSPEC_EXTRACTION_DETERMINISTIC_STAND_IN=truelets the deterministic extraction provider, underRAYSPEC_EXTRACTION_MODE=deterministic, answer for an extractor whose config names a real backend. The committed config is read foragent_idandschema_fileonly and is not modified; no backend is constructed, no credential is asked for and no prompt is read. A stand-in also reads transcript spans and gives each claim the id of the span its labelled line was read from, so the claim passes grounding and is persisted with a true citation.
With the fixture
examples/acme-notes/stt-fixtures/default.json, the acme-notes example now runs upload, transcribe, extract, ground, persist and read throughrayspec deploywith none of its files changed; getting started walks through it. All three stay a development and test posture. The non-real-provider boot banner names each one in effect: how many fixture files answer, whether the fallback is on, and every extractor the deterministic provider stands in for with the backend its config names. For a product document,RAYSPEC_HOSTING_POSTURE=managedrefuses each of them at boot, by name, whether or not the document transcribes or extracts. For a product document that transcribes, a fake-adapter setting beside anotherSTT_PROVIDERand an unsupported value refuse the boot; so do, for one that extracts, the stand-in underRAYSPEC_EXTRACTION_MODE=liveand a stand-in config that names no backend.rayspec deploy --check-envlists the three as optional for a product document that reads them. Nothing changes for a deployment that sets none of them: the fake adapter has no fixtures and gives the same error, a real-backend config under deterministic mode is refused with the same message, an extractor whose own config selectsdeterministicreads what it read before, and the banner text is the same. A bundle packed from a config that names a real backend still declares that backend's key as a required binding, so a keyless deploy of the bundle supplies a placeholder value for it. The fixture directory is deployment configuration and is not carried in a bundle. See fixtures for the fake speech-to-text adapter and standing in for a configured backend.- A warning when a bundle needs ffmpeg and the host has none.
rayspec bundle verifyandrayspec deploy <file.ray> --dry-runwrite one line starting withwarning: media tools missingto stderr when the bundle requiresaudio_inputormedia_playbackandffmpegorffprobeis not found on the host: as a file the user may execute in a directory ofPATH, or at the pathRAYSPEC_FFMPEG_BIN/RAYSPEC_FFPROBE_BINnames. The line is written with and without--json; the dry-run writes it as soon as the bundle is read, whatever the plan then says. Nothing is started to find out, so a tool that is present but broken is not noticed. The result envelope, itswarnings, the verdict, the plan and the exit code are unchanged: the envelope's warning codes are the closed list of the bundle contract, which has no code for a host tool, so this is a line on stderr and not an entry ofwarnings. A deploy without--dry-runbehaves as before: it serves, and stitching a recording fails closed. A bundle that requires neither capability never gets the line. - The upgrade with data also starts from 1.9.0. The candidate workflow, and the release build through it, ran
scripts/upgrade-with-data.mjsfrom 1.7.0 and 1.8.0 onto the candidate install. It now runs the same four variants from 1.9.0 too: the three applications, and the one that turns role separation on with the upgrade. From 1.9.0 the platform chain does not move, and the check holds that every stored row, password and API key is unchanged and that a bundle deploys onto the upgraded environment.
# fixed
- An audio session is marked
completedonce all its tracks are sealed. The audio capability created theaudio_sessionsrow withstatus: recordingand never changed it: finalizing a track sealed the track row only, so a session list kept reporting a finished recording asrecording. Finalizing the last open track of a session now sets the session tocompleted. A session with a track still uploading staysrecording, and a track that starts on a completed session puts it back torecordinguntil that track is finalized. This holds when the requests overlap: a finalize and the first chunk of a new track take a lock on the session row before they read its tracks or its status, so two tracks finalized at the same time complete the session, and a track that starts while the session's other track is being finalized leaves itrecording. The first chunk of a track, and every finalize, therefore wait for another such request on the same session to commit; later chunks of a track take no session lock. Sessions finalized before this release keeprecordinguntil a track of theirs is finalized again (a re-finalize with the sametotal_chunksis idempotent and settles the session), or until they are updated directly:UPDATE audio_sessions s SET status = 'completed' WHERE status = 'recording' AND NOT EXISTS (SELECT 1 FROM audio_tracks t WHERE t.session_pk = s.id AND t.status <> 'completed') AND EXISTS (SELECT 1 FROM audio_tracks t WHERE t.session_pk = s.id). A client that treatedrecordingas the only session status should acceptcompleted. - A rejected audio chunk no longer leaves an empty recording behind.
POST /sessions/{session_id}/{track}/chunks/{n}created theaudio_sessionsrow and theaudio_tracksrow before it comparednwith the track's watermark. A chunk withngreater than 0 for a session or track that did not exist yet was answered409with"error": "gap"andnext_expected_index: 0, as it should be, but both rows were committed, atrecordingwith zero chunks and zero bytes, and a session list showed a recording that never started. A first chunk refused with413 track_too_largedid the same. Every rejection is now decided from a read of the track row: a track with no row is at watermark 0 with no committed bytes, so the409and the413are answered without a write, on a new session and on a new track of an existing one. Only an accepted chunk 0 creates the rows, and it creates them after its bytes are stored, so a failed blob write creates none either. The status codes and bodies are unchanged for requests sent one after the other. One overlap is answered differently: chunk 1 of a new track sent while chunk 0 is still being stored waited for chunk 0 and was answered200; it is now a409 gapwithnext_expected_index: 0, as for any chunk sent ahead of the watermark, and the client resumes from that index. Rows left by earlier releases are not removed. A track row atrecordingwithpersisted_chunk_count = 0is such a row, because a track's row and its first chunk have always been committed together:DELETE FROM audio_tracks WHERE status = 'recording' AND persisted_chunk_count = 0removes them, andDELETE FROM audio_sessions s WHERE NOT EXISTS (SELECT 1 FROM audio_tracks t WHERE t.session_pk = s.id)then removes the sessions left with no track. Run both before theUPDATEof the entry above: a leftover empty track keeps its session atrecording, for thatUPDATEand for a re-finalize of the session's other tracks alike, until the track row is deleted or the track is itself finalized withtotal_chunks: 0. That finalize emits the session's finalized event again, under the same session-scoped event id, so a consumer that deduplicates by event id sees nothing new. - The lead-qualifier live test reads a run's usage once the run has ended. A durable agent run holds no transaction across the model call, so a tool's write is served while the run is still executing. The test took the lead reading
qualifiedas the end of the run and summedjournal_stepsat that moment: the tool's own step, which carries no tokens, was the only one there, because the OpenAI adapter journals its model calls when the provider call returns. It failed ontotal_tokens0 for a run that went on to journal its usage. It now waits for the run header to be terminal and reads that run's steps. No runtime behavior changes: a run's usage and cost are journaled as before, when its last model response is in. A database test drives the same example with a backend that reports usage per model response around a tool call, and holds the tool step, each model step's tokens and registry cost, the billed cost and the header's roll-up; the in-request cost test now holds the token columns too. - The release-candidate test passes on the commit a release is tagged on.
scripts/release-candidate.test.mjsasserted that a release build of the committed version is refused, which holds on a development commit and not on the one that carries the tagv<version>, where the build is admitted. It asserts the refusal only where no such tag points at the checkout. - The runtime image can run a product that records audio: it carries ffmpeg and ffprobe. The image installed Node, the published packages and the PostgreSQL client tools, and no ffmpeg. The audio capability stitches a recording's Ogg-Opus chunks with ffmpeg and checks the result with ffprobe, before transcription and to make the recording playable, and fails closed without them, so a product that declares
audio_inputormedia_playbackdeployed on the image and then transcribed and played nothing. The one image now installs Debian'sffmpegpackage, which carries both tools: at a pinned version (FFMPEG_VERSIONindeployments/runtime-image/Dockerfile), from the Debian archive as it stood at a pinned moment (DEBIAN_SNAPSHOT, served by snapshot.debian.org), without recommended packages, with the package lists, logs and caches of the install removed. There is no second image without it. The build runs both tools, requires the concat demuxer and the Ogg-Opus muxer, and stitches two generated chunks the way the capability does, so a build without a working ffmpeg fails;scripts/image-conformance.mjsrequires both tools at the pinned version and runs the image's own@rayspec/audio-runtimeon two chunks as the image's user, and requires it to refuse a chunk that is not Ogg and one ffmpeg cannot read. The image is larger: ffmpeg brings 206 Debian packages with it, and an image built from the 1.9.0 tarballs grew from 1.30 GB to 1.75 GB unpacked and from 402 MB to 572 MB as an archive. The build now also needs snapshot.debian.org. - The image SBOM lists the image's Debian packages.
image-sbom.cdx.jsonlisted the npm packages under/opt/rayspecand left out the Debian userland.scripts/gen-image-sbom.mjsnow also reads the image's dpkg record (/var/lib/dpkg/status) and lists every installed Debian package aspkg:deb/debian/<name>@<version>?arch=<arch>&distro=debian-<release>, name and version percent-encoded as a package URL writes them (libstdc%2B%2B6); the component'snameis the one dpkg records. Listed are the base image's userland, ffmpeg and everything ffmpeg depends on. It refuses an image without a dpkg record, and one whose record names no installedffmpeg. A Debian package carries no digest and no licence in the SBOM, since dpkg records neither; Node and the PostgreSQL client tools are still not listed. No step scans the Debian packages for advisories. scripts/publish.mjscan publish from a terminal with a browser-based second factor. The script ran the publish with piped input and output. An npm account whose two-factor authentication is a passkey or a security key gets an authentication URL from npm, which then waits on the terminal for the approval; behind a pipe npm cannot wait, so the first package failed withEOTPand nothing was published. 1.9.0 was therefore published by hand, one tarball after the other. A--publishnow runs every publish call attached to the terminal the script was started from, and--otp <code>hands a one-time code to every call for an account with an authenticator app (refused outside--publish). npm waits for a browser approval only while both its input and its output are a terminal, so the script's output must not be piped either (| tee publish.logis enough to fail withEOTP); a failed publish that ran without a terminal on either side says so. With--from <dir>each tarball goes tonpm publish <tarball>as it is (before:pnpm publish <tarball>, which runs the same npm command), and every publish and dry run carries--access public, so a scoped package that is new in a release is created public instead of being refused as a restricted one. A publish call that fails no longer ends in a stack trace: the run restores the manifests, names the package and the packages it published before it, says that the same command continues (after a--fromrun) or that the run cannot be continued (when it packed its own bytes), and exits 1; the--jsonsummary carriesfailed, the name of that package ornull. The reason it prints is npm's exit code, or the signal that ended npm; it never repeats the publish command line, which carries the one-time code. A failed dry run names its package the same way. Continuing is unchanged: a package npm already serves with the integrity of its tarball is skipped, and one it serves with other bytes stops the run before the first publish. The two opt-ins of a real publish (--yes-really-publishandRAYSPEC_ALLOW_PUBLISH=1), the tag check and every other refusal are unchanged, and the release workflow's publish step runs the same command as before.- A static mount at
route: /serves its/.well-known/directory. The static handler refused every request path with a segment that begins with a dot, so/.well-known/security.txt(RFC 9116),assetlinks.json,apple-app-site-associationand every other well-known file answered404although the file was in the mounted directory. A mount at the root now serves the top-level.well-knowndirectory of itsdir. Everything else stays hidden: only the exact, case-sensitive first segment.well-knownis let through, no segment below it may begin with a dot, and a mount at any other route serves no dot path, so/.env,/.git/config,/.well-known/.secretand/a/.well-known/xanswer404as before. The traversal and symlink-escape checks are unchanged and apply to these paths, and the directory is not listed. The symlink check is containment only, here as on every other path: a link insidedirwhose target is a hidden file of the samedirserves that file under the link's name, so a link in.well-knowncan name one too. Files are typed by extension (security.txtastext/plain, a.jsonfile asapplication/json), andapple-app-site-association, which has none, is served asapplication/json.cleanUrlsand the root404.htmlapply as to any other path; a path under/.well-known/that names no file is a404on anspa: truemount too and never theindex.htmlfallback. The boot's inline-asset scan reads the HTML files of that directory, since they are now served.rayspec packalready carried the directory in a bundle; a test now holds that. What changes for an existing deployment: files a build already placed in<dir>/.well-known/of a root mount become reachable; look at what is in that directory before upgrading.
# documentation
- The documentation no longer describes a runtime image on GHCR listed in a signed release manifest. 1.9.0 was published from a maintainer's machine with npm, not by the release workflow: its npm packages carry no provenance attestation, the release manifest attached to its GitHub release is unsigned, and its runtime image was built and tested by the release build and pushed nowhere.
docs/runtime-image.mdanddocs/self-hosted-deployment.mdtold operators to pullghcr.io/rayspec-labs/rayspecby the digest of a signed manifest, which does not exist. They now say how to get the image (build it from the tarballs the release attaches, with the twodocker buildx buildcommands given there), what the unsigned manifest shows and does not show, why the digest it names cannot be pulled or reproduced, and that the image carries ffmpeg and why. Both pages date ffmpeg, the build's checks of it, the Debian entries of the image SBOM and themedia tools missingwarning from 1.9.1, anddocs/runtime-image.mdsays what a 1.9.0 deployer with an audio product does instead: move to 1.9.1, or install ffmpeg in an image built on their own 1.9.0 image.docs/releasing.mdstates how 1.9.0 and 1.9.1 are published and what such a release carries, and its "Verifying a release" leads with the commands that fit such a release (the manifest against the tarballs, the identity manifest,npm view), from a built checkout of the tag; the signature and the image archive follow as what a workflow-published release adds. docs/releasing.mddescribes publishing from the owner's machine as a supported path. It was a note that 1.9.0 had been published that way. The runbook now gives the path step by step beside the workflow path: the build pass of the release workflow, downloading its artifacts, verifying them against the release manifest and the identity manifest, publishing the tarballs withscripts/publish.mjs --publish --from, checking npm against the manifest, and creating the GitHub release. It says what that path does not produce (npm provenance, a signed manifest, an image in a registry, the evidence document and the managed receipt), and how the approver adds the signature and pushes the tested image archive afterwards.
# security
@modelcontextprotocol/sdkmoves to1.31.0, the first version outside GHSA-6qxp-vccf-f47h.@rayspec/adapter-codexpins the SDK exactly, so a1.9.0install carries1.29.0; upgrade to take the fixed version. The root overrides hold the other adapters' transitive copies at the same version, and the lockfile, the dependency inventory and the closure SBOM are regenerated. RaySpec uses the SDK'smcp.jsandstreamableHttp.jsonly, for the in-process tool server an agent backend talks to.- The exceptions for the advisories inside the Pi SDK's shrinkwrap are renewed until 2026-12-06; all 22 still apply.
@rayspec/adapter-pidepends on@earendil-works/pi-coding-agent0.79.9, whosenpm-shrinkwrap.jsonpinsundici8.5.0(15 advisories),brace-expansion5.0.6(6) andprotobufjs7.6.4(1) for every consumer; no override reaches them. The exceptions inosv-scanner.consumer.tomlwere set to expire on 2026-10-31. Every release of the SDK from0.79.9to1.0.4, the newest, was checked on 2026-10-06 against the registry and OSV.dev:0.79.10to0.80.10pin the same three copies;0.86.0to1.0.0pinundici8.10.2andprotobufjs7.6.6, which carry no advisory, andbrace-expansion5.0.9, which still carries three;1.0.1to1.0.4ship no shrinkwrap and depend onundici8.10.2andbrace-expansion5.0.12, which carry none. So a patched SDK exists, and the adapter cannot take it unchanged: since0.80.8the SDK no longer exportsAuthStorageand takes credentials and models through an asynchronousmodelRuntimeoption, and the adapter's recorded fixtures are bound to the SDK version. The adapter stays at0.79.9in this release and a consumer install still carries the 22 advisories; the move to the1.xSDK is its own change. No exception was added or widened. The same file governs the scan of the runtime image's lockfile in the candidate workflow, which installs the same copies. - The workspace lockfile is clear of the advisories published against
proxy-addrandsource-map-js. The root overrides pinproxy-addr2.0.8(GHSA-jqcg-44mw-7w3h) andsource-map-js1.2.2(GHSA-68fv-2mgg-jv7q), the first fixed versions, and the lockfile, the dependency inventory and the closure SBOM are regenerated; nothing else in the lockfile moves.proxy-addris in the published closure only as a dependency ofexpress, which@modelcontextprotocol/sdkdeclares; RaySpec starts no Express application, andRAYSPEC_TRUSTED_PROXIESis matched by RaySpec's own code, not byproxy-addr, so the trusted-proxy behavior of a deployment is unchanged.source-map-jsis reached only through the test tooling (vitest,vite,postcss) and is not part of what a consumer installs. A fresh consumer install of the published packages already resolvesproxy-addr2.0.8, becauseexpressdeclares^2.0.7; the consumer scan reports nothing new. - The audio capability hands ffmpeg only Ogg chunks, and refuses a recording ffmpeg stitched around a chunk.
remuxChunksof@rayspec/audio-runtimewrote every uploaded chunk to a file and ran ffmpeg's concat demuxer over them with no check of what a chunk was, so ffmpeg chose a demuxer from the bytes. A chunk of plain text behind a good one made ffmpeg logImpossible to open, end the stream there and exit 0, and the result, the recording up to that chunk, passed both structural checks and was transcribed and played as the whole recording. A chunk that was anffconcatscript was followed (four chunks' length from two uploads), and a chunk in another container was handed to that container's demuxer. Now a chunk that does not begin with the Ogg capture pattern (OggS) is refused before anything is written or run; ffmpeg runs with-format_whitelist concat,ogg -protocol_whitelist file, so it uses those two demuxers and the file protocol only, and with-xerror, so an error ends the run; and a run in which the concat demuxer reports a chunk it could not open is refused whatever ffmpeg's exit code (a chunk cut off inside its headers is skipped with exit 0 even under-xerror). Each refusal is aRemuxError, which the transcription and playback steps already treat as a failed recording. What changes: a recording with a chunk that is not Ogg, or that ffmpeg cannot read, now fails where it was silently shortened; a recording of intact Ogg-Opus chunks is stitched as before. The image build's stitch check uses the same command line. The runtime image and the threat model now state what ffmpeg is given, as which user, under which limits (a time limit; no memory, CPU or concurrency limit and no sandbox), and that an ffmpeg security fix reaches an image only when its pinned version is moved. - A trusted-proxy range gives one answer for one address, however the address is spelled. An IPv4-mapped IPv6 address was replaced by its IPv4 address only in the dotted spelling (
::ffff:10.1.2.3). The hex spelling of the same address (::ffff:a01:203, also in uppercase, with leading zeros or fully expanded) stayed IPv6: it was compared against the IPv6 entries ofRAYSPEC_TRUSTED_PROXIES, so a broad entry such as::/8made an IPv4 peer a trusted proxy whoseX-Forwarded-Forwas believed, and the IPv4 entries did not apply to it. The mapped block::ffff:0:0/96is now recognised by value: every spelling becomes the IPv4 address it carries before anything is matched, on the peer, on eachX-Forwarded-Forhop and onX-Real-IP. On the list side, an entry written inside the mapped block is the IPv4 range it carries (::ffff:10.0.0.0/104and::ffff:10.0.0.0/8are10.0.0.0/8,::ffff:0:0/96is every IPv4 address), and an IPv6 entry wider than the block (::/8,::/0) covers IPv6 peers only, as it always did for the dotted spelling. A Node socket reports a mapped peer in the dotted spelling, so the peer check of a running deployment was already the IPv4 one; the hex spelling reaches the runtime in a forwarding header. What changes: the client address the runtime derives is the IPv4 address for every spelling, so the rate-limit bucket, the address stored with a session and the address hash in the audit log are the same for::ffff:a01:203as for10.1.2.3, where the hex spelling had its own before. An entry inside the mapped block with an IPv6-length prefix (/96to/128) matched no dotted peer before and matches its IPv4 range now; review a list that carries one,::ffff:0:0/96in particular. An entry written as a dotted mapped address with an IPv4-length prefix (::ffff:10.0.0.0/8,::ffff:10.1.2.3/32) keeps the meaning it had: the IPv4 range behind the mapped prefix, here10.0.0.0/8and10.1.2.3/32. A dotted mapped address with a prefix between the two notations (/33to/95) names no range, as before. An entry that names no range now refuses the boot and the message names it: an address that does not parse, or a missing or malformed prefix length (10.0.0.0/,10.0.0.0/8.0,10.0.0.0/33). Before, an empty prefix was read as/0and trusted every address of the family,/8.0was read as/8, and an entry that could match nothing was accepted without a word, which left the proxy untrusted and every client behind it in one rate-limit bucket. An IPv6 address with a dotted tail outside the mapped block (64:ff9b::10.1.2.3) is parsed and matches IPv6 entries, where it matched none. No other IPv6 address is rewritten.
# upgrade notes
Everything below is documented in place above; this is the checklist, and Upgrading to 1.9 → From 1.9.0 to 1.9.1 walks through it. A deployment that upgrades and sets nothing new keeps working as it did, with three things to do first: correct a RAYSPEC_TRUSTED_PROXIES entry that names no range (the boot refuses it), repack a bundle with 1.9.1 (one packed for 1.9.0 is refused), and look at the .well-known directory of a static mount at the root (it is now served). Then install 1.9.1 and start the deployment the way you started it before. The first two items apply to every deployment; the rest only to a deployment that sets RAYSPEC_TRUSTED_PROXIES, records audio, serves a static mount at the root, deploys bundles, runs the runtime image or installs the Codex adapter.
- No platform migration runs. The platform chain ends at
0017, as in 1.9.0, and no product table changes: the first boot of 1.9.1 migrates nothing. From 1.8.x or older, the notes of 1.9.0 below apply first. - Going back to 1.9.0 needs no restore. Both releases run on the same platform schema, so 1.9.0 boots on a database 1.9.1 has served. What 1.9.1 wrote stays: audio sessions at
completed, which 1.9.0 never writes and reads like any other session. Before going back, takespan_granularityout of a product document that declares it (1.9.0 does not know the key), and deploy the bundle packed for 1.9.0 again (a bundle pins its runtime). The upgrade check runs forward only, so this direction is not exercised before a release; going back to 1.8.x or older still starts from the backup taken before that upgrade. - A trusted-proxy entry that names no range now refuses the boot. Check
RAYSPEC_TRUSTED_PROXIESbefore upgrading: an address that does not parse, or a missing or malformed prefix length (10.0.0.0/,10.0.0.0/8.0,10.0.0.0/33), stops the boot with a message that names the entry. 1.9.0 read an empty prefix as/0, which trusted every address of the family, read/8.0as/8, and accepted an entry that matched nothing. Correct or remove such an entry first. A list without one boots as before. - A trusted-proxy entry inside
::ffff:0:0/96with a prefix of/96to/128now matches the IPv4 range it carries, where it matched no dotted peer before;::ffff:0:0/96itself is every IPv4 address. Review a list that carries one. The client address the runtime derives for the hex spelling of an IPv4-mapped address (::ffff:a01:203) is now the IPv4 address, so its rate-limit bucket, the address stored with a session and the address hash in the audit log are those of10.1.2.3. - A client may now read
completedas the status of an audio session. 1.9.0 wroterecordingand never changed it. A session iscompletedonce all its tracks are sealed and goes back torecordingwhile a track that started later is uploading. A client that treatedrecordingas the only status should acceptcompleted. Sessions finalized by 1.9.0 keep
recording, and rows left by rejected chunks are not removed. Nothing has to be done for the runtime to work; to make a session list right, run the three statements below once, in this order, on the application database of a product that declaresaudio_input. With role separation run them as the migration role, which sees every tenant's rows. The twoDELETEs remove the empty track rows a rejected chunk left (a track atrecordingwith no chunk never held one, because a track's row and its first chunk have always been committed together) and the sessions left with no track; theUPDATEthen settles every session whose tracks are all sealed. An empty track left in place keeps its session atrecording, which is why theDELETEs come first.DELETE FROM audio_tracks WHERE status = 'recording' AND persisted_chunk_count = 0; DELETE FROM audio_sessions s WHERE NOT EXISTS (SELECT 1 FROM audio_tracks t WHERE t.session_pk = s.id); UPDATE audio_sessions s SET status = 'completed' WHERE status = 'recording' AND NOT EXISTS (SELECT 1 FROM audio_tracks t WHERE t.session_pk = s.id AND t.status <> 'completed') AND EXISTS (SELECT 1 FROM audio_tracks t WHERE t.session_pk = s.id);Run them after the upgrade, at a moment when no recording is being uploaded.
- Chunk 1 of a new track sent while chunk 0 is still being stored is answered
409with"error": "gap"andnext_expected_index: 0, where 1.9.0 waited for chunk 0 and answered200. A client that uploads the chunks of a track one after the other is not affected; one that sends them in parallel resumes from the index the answer names. - A recording with a chunk that is not Ogg, or that ffmpeg cannot read, now fails. 1.9.0 stitched the recording up to that chunk and transcribed and played the shortened result as the whole recording. Recordings of intact Ogg-Opus chunks are stitched as before.
- A static mount at
route: /now serves the.well-knowndirectory of itsdir. Files a build already placed there become reachable; look at what is in that directory before upgrading. - Span ids change when a product opts into
span_granularity: sentence. Nothing changes for a document without the key. With it,<track>:s<index>counts sentences instead of paragraphs, so evidence stored before the change does not match transcripts produced after it, and nothing is migrated. Choose the value before a product stores evidence. - A bundle pins its runtime. Repack each application with 1.9.1 before deploying it; a bundle packed for 1.9.0 is refused with
RAY_RUNTIME_UNSUPPORTED. An extension whosepackage.jsonpins a@rayspec/*package to exactly1.9.0moves the pin to1.9.1, or to a range that includes it, before repacking:rayspec packrefuses a range the runtime is outside of, with the same code. A snapshot pins its runtime too: an export taken on 1.9.0 is imported with 1.9.0, and the upgrade follows the import. - The runtime image now carries ffmpeg and ffprobe, and is larger. Rebuild it from the 1.9.1 tarballs and the Dockerfile at the
v1.9.1tag; ffmpeg comes from the Dockerfile, so the tarballs alone do not bring it. Debian's full ffmpeg build brings 206 packages: an image built from the 1.9.0 tarballs grew from 1.30 GB to 1.75 GB unpacked and from 402 MB to 572 MB as an archive, and the build needs snapshot.debian.org besides the npm registry and Docker Hub. A deployment that added ffmpeg in an image of its own on 1.9.0 can drop that layer. On any other host,rayspec bundle verifyand the dry-run of a bundle deploy now writewarning: media tools missingto stderr when the bundle records audio and the host has no ffmpeg or ffprobe; the envelope and the exit code are unchanged. - The Codex adapter's
@modelcontextprotocol/sdkis fixed only by upgrading.@rayspec/adapter-codexpins the SDK exactly, so an install of 1.9.0 resolves1.29.0, inside GHSA-6qxp-vccf-f47h, and no newer SDK release changes that; 1.9.1 pins1.31.0. - Still open for consumers: the 22 advisories inside the Pi SDK's shrinkwrap. The adapter stays at
@earendil-works/pi-coding-agent0.79.9; the scanner exceptions now expire on 2026-12-06. - For maintainers:
scripts/publish.mjs --publishnow runs attached to the terminal. For an account with a browser-approved second factor, run it from a terminal with its output not piped; for one with an authenticator app, pass--otp <code>. 1.9.1 is published from the owner's machine like 1.9.0: no npm provenance, an unsigned release manifest, no image in a registry (Releasing).
# added
rayspec bundle signwrites the detached Ed25519 signature of a bundle.rayspec bundle sign <file.ray> --key-file <ed25519-private-key.pem> [--output <file.ray.sig>] [--force] [--json]reads the bundle through the structural steps of the one bundle reader (never extracting or running it, so a damaged or hostile archive is refused before anything is written), signs its archive SHA-256 with the bundle library'screateSignatureFile, writes the signature file beside its destination, reads it back and verifies it against the public half of the key, and only then moves it into place: to<file.ray>.sig, the filebundle verifyanddeployread, or to--output. An existing file is refused withRAY_OUTPUT_EXISTSunless--force, which replaces a file or a link without writing through it; a signature path that reaches the bundle or the key file through another path (a linked directory, a second hard link) is refused withRAY_USAGE, with or without--force, and so is a file system without hard links when--forceis not given. The signature file is mode 0644 whatever the umask. The key file is opened once without following a link and judged through that handle: a link, a file that is not regular, one owned by another user or one group or others can read or write isRAY_BINDINGS_FILE_INSECURE(exit 4); a missing file, a public key, an RSA, EC or encrypted key, or more than one key isRAY_USAGE. The envelope (bundle.sign) carries the archive SHA-256, the signature path and the SHA-256 of the public key, the valuebundle verifyreports; no output carries key material. Like the other bundle verbs it loads no server, database layer or handler loader. The signature shows who signed the archive, not that its code is safe; see Signing a bundle. The team-notes reference journey signs its first release, verifies it with--require-signatureagainst the publisher key and with another key, and deploys it with--require-signature.- Release candidates, built and tested as a release.
pnpm release:candidate --version <x.y.z-pre> --out <dir>(scripts/release-candidate.mjs) stamps a pre-release version into every RaySpec manifest for the run only, packs the publish set, writes the release identity manifest, packs the launcher again with that manifest inside, writes the CycloneDX SBOM of the closure, restores every manifest to its committed bytes (and refuses to go on otherwise), resolves the image's dependency tree once into a lockfile, builds the linux/amd64 runtime image from the tarballs and that lockfile, checks the image holds it, writes the CycloneDX SBOM of the image's installed tree and writes the release manifest. It refuses a release version, a tree with changes, an identity manifest left from an earlier run and a non-empty output directory.--releasebuilds the committed version from its annotated tag, unstamped. The new workflowcandidate.ymlruns it on every push tomainand by hand, then installs the tarballs as a consumer and runs the contract corpus and the reference journeys through that install and through the image, and the upgrade with data from 1.7.0 and 1.8.0 onto the candidate, and scans the image's lockfile for known advisories; everything is kept as workflow artifacts and nothing is published. See Releasing. - A runtime image.
deployments/runtime-image/Dockerfilebuilds the linux/amd64 image of the runtime: Node at the pinned 22 patch on a digest-pinned Debian base, the published closure installed withnpm cifrom a lockfile resolved once from the release tarballs, install scripts disabled, every timestamp at the commit's time, the userrayspec(uid 10001) that cannot write the installation,/bin/shfor the supervisor,pg_dumpandpg_restoreof PostgreSQL 16, no npm, npx, corepack or yarn, a health check on/livez, and the version and source-commit labels. It is exported as an OCI image layout archive thatdocker loadreads, so the image tested is the image the release manifest names. The lockfile and the CycloneDX SBOM of the installed tree (scripts/gen-image-sbom.mjs) ship with the release, because the image's third-party versions are the ones the registry served when the lockfile was written and can be newer than the workspace's.scripts/image-conformance.mjschecks the image's configuration, Node patch, user, working directory, port and file ownership on the loaded image, runs the contract corpus through its CLI and serves the team-notes application from it with role separation. See The runtime image, which also states the host settings the managed posture needs (--ulimit core=0,kernel.yama.ptrace_scope). - The signed release manifest and the release evidence.
pnpm release:manifest(scripts/release-manifest.mjs) writesrelease-manifest.jsonexactly as the contract'srelease-manifest.schema.jsonstates it, from the tarballs, the identity manifest and the image archive (every layer present with its own bytes); signs it with an Ed25519 release key on the approver's machine (a key file other users can read is refused) and verifies the signature against the approver's public key; verifies a manifest, its signature, its tarballs and its image; and writesrelease-evidence.json, which binds the contract version and digest, every package's SHA-256, the image reference, the schemas, the fixture corpus digest, the previous supported version and the upgrade results, the platform schema head, the capabilities, the managed receipt, the closure SBOM and the image SBOM to the manifest's digest. The evidence takes an image SBOM only when it shows every release tarball installed in the image, and an upgrade report only when it ran the candidate install's CLI at the release version. Both refuse a missing input and any placeholder value.@rayspec/bundle-contractgainsvalidateReleaseManifestandreleaseManifestViolations(the contract's semantic rules), and@rayspec/bundlegainscreateReleaseSignatureFileandverifyReleaseSignatureFile. - A CycloneDX SBOM of the published closure.
docs/closure-sbom.cdx.json(pnpm gen:closure-sbom) lists the publish set and every package it reaches in production, with the dependency graph, each third-party SHA-512 from the lockfile and each licence fromdocs/dependency-sbom.json. The SBOM freshness gate holds it to a fresh derivation. A candidate writes it with each tarball's SHA-512. - A release workflow, prepared and never run by itself.
release.ymlruns only on a manual dispatch from the annotated release tag with the typed confirmationpublish rayspec <version>, refuses a version npm already has and areleaseenvironment without a required reviewer, and takes two dispatches. The first builds and tests the release's artifacts and runs the certification lane at the tag, and publishes nothing. The approver signs that run's release manifest on their own machine; no signing key is given to the workflow. The second dispatch names that run and carries the signature: in the protectedreleaseenvironment, after a reviewer approves, it verifies the signature against the approver's public key, makes the managed receipt, publishes that run's tarballs with npm provenance, copies its archived image to GHCR without conversion and checks both registries serve what the manifest names. - Conformance through an installed release.
scripts/corpus-conformance.mjsruns everybundle inspectandbundle verifyexpectation of the contract corpus through an installed CLI and lists the ones a command line cannot state;tsx scripts/gen-corpus.ts --uncommitted <dir>writes the corpus case generated at test time.scripts/reference-journeys.mjs --image <ref>runs the three reference applications with everyrayspeccommand in a container of a runtime image, andscripts/upgrade-with-data.mjs --candidate <dir>upgrades onto a candidate install instead of the working tree; it stops unless every path it uses lies inside that install and its CLI reports the install's version, and records both in its summary. - A certification lane for the hardened hosting posture.
pnpm test:certification(scripts/certification.mjs) runs the suites that prove each check a public host must hold, on a real database, and prints one JSON verdict per check; a skipped test fails its check, and no provider credential reaches a suite. New suites inpackages/app/cli/src/certification/deploy an application through the realrayspec deploy <file.ray>with role separation and forced row-level security, single-tenant mode, the managed posture and pinned trusted proxies, and prove: object authorization for two users and a removed member on every store route, upload part, playback and event stream and queued run; trusted-proxy headers believed only from the pinned address; CORS and CSRF where the session cookie authenticates; the JSON body limit and upload-path limits; sanitized error envelopes; every hostile archive of the contract corpus that the reader refuses at its default limits refused by the deploy, and every hostile migration bundle except the inner size bomb refused by the import, with nothing extracted or restored (the archives that need a lowered reader limit, and the size bomb, are covered by the reader's own corpus suite, which the lane runs); bounded sessions, memory and queue admission under a parallel workload against a provider that never answers; and an export, import and restore round trip with the identity reset. The rest are the existing suites run as the runtime role. CI runs it in thecertificationjob. See Hosting in the hardened posture → Certifying the posture. The lane also certifies single-tenant mode, the agent trace export staying off, the execution levels and the supported-backend matrix, and its log directory now holdssummary.json, which names each suite's report and the exit status of its vitest run, and records the commit, whether the working tree was clean, the runtime version and the platform the lane ran on. A suite file whose vitest run does not exit 0 (an unhandled rejection or a crash outside every test) fails its check even when its report lists every test as passed; a report left by an earlier run into the same log directory is removed before the file runs; a report counts only for the file at its full path in the repository. The CI job keeps the log directory as the workflow artifactcertification-lane, and the log directory, summary and receipt the docs write into the repository root are ignored by git, so a second run still records a clean tree. - The managed-posture receipt generator.
pnpm receipt:managed(scripts/managed-receipt.mjs) makes a release's managed-posture receipt from one certification lane directory and the release manifest, as canonical JSON thatvalidateReceiptaccepts. Each protection it states is claimed through the lane checks that establish it; every report is judged again, against the one suite file it is named for, rather than taken from the summary; a backend is listed only when every test of its matrix row passed.capabilitieslists what the managed posture allows, as the contract defines the field; only its provider capabilities rest on lane evidence. It refuses, naming why and writing nothing, when a check failed, was skipped or is missing, a suite file's vitest run did not exit 0, one report is named for two suite files, when the lane did not run as the runtime role on linux x64 with Node 22.21 or later from a clean tree at the checkout's commit, or when the release manifest is for another version, commit or target, or carries a package of another version. See Hosting in the hardened posture → The managed-posture receipt. - A threat model for operators. docs/threat-model.md states the boundaries, the adversaries, what the runtime enforces (each with the lane check that proves it), what the host must enforce — the process sandbox, the egress firewall, encrypted volumes, backups, the request edge — the supported-backend matrix, and every residual risk this release accepts, with its owner, word for word as the receipt carries them. It states that the serving process keeps the migration role's connection, so the application's own code can bypass row-level security and lift an export's fence, and that a stream ingest route's body is capped only by the reverse proxy; docs/export.md and docs/hardened-posture.md say the same where they describe the barrier and the body limits.
rayspec deploy <file.ray>: deploy an application bundle on a self-hosted target. A file that starts with a ZIP signature or whose name ends in.raytakes the bundle path, decided on at most four bytes before any configuration is read; every other file takes the YAML deploy, unchanged.rayspec deploy <file.ray> --dry-runreads and verifies the bundle with the one bundle reader, prepares the plan against the live database and prints it — binding names and whether each is set, schema impact, permission changes, storage, warnings, blockers and the plan digest, valid 30 minutes — writing only the plan record to the deployment state directory (--state-dir, default.rayspec-state); it changes no row and runs nothing from the bundle.rayspec deploy <file.ray> --plan-digest <digest>deploys that plan: it is recomputed at its own time and refused asRAY_PLAN_STALEwhen anything it covers changed (the bundle, a binding value, the schema head, the environment revision) or when the state directory holds no record of it, and a plan that changes the schema or the grants is never deployed without it. The bundle is extracted into an immutable, content-addressed version directory (<state-dir>/versions/<bundleSha256>/, read-only, verified file by file against the inventory), the boot validates the signing key, the spec and its preflight, and only then does one apply run the platform chain, the regenerated product change with its ledger row, the application's record and the switch ofactive.json, each step with receipts; its idempotency key is the plan digest, so the same deploy run again after an interruption, while its plan is valid (30 minutes from the dry-run), continues the interrupted operation; once the plan has expired, run the dry-run again and deploy the new digest. A deploy that fails leaves the previous version active and reverses no schema change; its refusal names the forward step that finishes it. When the live product schema is already the one the bundle's delta migrates to — the delta landed in a deploy that stopped before it finished — the dry-run plans no further product change, so the deploy is finished forward; a carried delta that ends anywhere else is refused. The boot banner names the product migration ledger row the deploy's product change wrote. The application is served from the active version directory:@rayspec/*imports andrequire()calls resolve to the installed runtime (a copy the bundle carries is never loaded), every other package to the bundle, and a package the bundle does not carry is not found even when anode_modulesabove the state directory has it. Bindings come from--bindings-file(JSON, the contract's schema, a regular file owned by the user with mode 0600 or stricter, otherwiseRAY_BINDINGS_FILE_INSECURE) and the explicit process environment only: no.envfile is loaded on this path, a reserved operator name in the file is refused withRAY_BINDING_RESERVED, a required binding without a value isRAY_BINDING_MISSING, and no value reaches any output, plan or receipt — plans carry HMAC revision ids. The verb writes onedeploy.dry-runordeployenvelope on stdout, with or without--json, and exits with the contract class of its first error; whatever else is printed while it runs (the durable runtime's startup lines, a handler'sconsole.log) goes to stderr. New: the guide Deploying a bundle on your own server — inspect, bind, review, apply, readiness, update, recovery.- An upgrade check with data, run in CI.
pnpm test:upgrade-with-data(scripts/upgrade-with-data.mjs) installs the previous published release from npm with install scripts disabled, deploys thenotes-uiexample with it, registers a user, creates an organization, mints an API key and writes notes through the API; then it boots this working tree on the same database and checks that every stored row of the notes, users, organizations, memberships and API keys is byte-identical, that the user logs in with the same password, that the API key reads the notes and that a new note can be written; finally it packs the example and deploys it as a bundle onto the upgraded environment and checks the same again. It runs in about a minute and is a required step of the database lane.--app team-notesand--app asset-catalogrun the same check with those reference applications; the previous release gets each spec without the fields it does not know (metadata.id,metadata.version, and for the asset catalogdeployment.egressHostsand theuseslists of its extension's handlers), and its extension imports the@rayspecpackages of whichever runtime boots it. Both run in CI. @rayspec/serverexports the bundle deploy's building blocks:readApplicationBundle(reader steps 1 to 17 without a database),preparePlan(prepare()at a givenpreparedAt),applyBundle,bindingRevisions,initialBindingRevisionKey,planNeedsReview, the deployment state directory (openStateDirectory,StateDirectory,readProtectedFile) andinstallBundleModuleResolution.assembleServeracceptsbeforeSchemaChange, run after the boot validated everything and before it changes any schema, which may report the product change it applied (BeforeSchemaChangeResult, shown on the boot banner) and is handed what the boot resolved (BootFacts: the blob backend), andensureRuntimeControlStateaccepts the binding revision key a first apply stores.applyBundletakes that blob backend and records it with the application it activates;readRecordedBlobBackendandparseBlobBackendRecordread it back.rayspec pack: an application bundle from an application that is already built.rayspec pack --spec <path> --output <file.ray>writes one.rayapplication bundle: the spec, the compiled handler and extension modules with what they import, the built frontend, the product configuration files, the third-party packages the modules need (never@rayspec/*, which the runtime provides), the dependency lock, a CycloneDX SBOM and the license notices. It builds, installs, imports and runs nothing; a handler, extension or frontend that was not built is refused with the build instruction. The application id and version come from the spec's metadata,--idand--versionoverride them, and pack refuses when neither gives one.--runtimepins another exact runtime than the CLI's own,--includeadds a file or directory,--source-mapscarries source maps, and--previewprints the inclusion list and writes nothing. The archive is written to a temporary file beside the output, read back through the bundle reader, compared with the digests the files were checked under, and only then moved into place; an existing output is refused without--force, and a refused or interrupted pack leaves no file. The same prepared files give the same bytes from any directory at any time. Like the bundle verbs, pack writes one result envelope on stdout and, without--json, the inclusion summary and the output SHA-256 on stderr; the summary says that nothing was deployed. Without--againstit loads no server, database layer or handler loader.--build(a build in a disposable sandbox) is refused withRAY_USAGEnaming the manual step. The summary escapes control characters in the file names it quotes, so a hostile name cannot write terminal escapes. New: the packing guide — what goes in, what never does, and how to fix each refusal.- Product schema changes bound to the live schema: the product migration ledger, and
rayspec pack --against. A new platform migration,0014_product_migration_ledger, adds the append-only tableproduct_migration_ledger(a reserved store name now): every product DDL a deploy applies is recorded in the transaction that runs it, with its SHA-256, the product schema digest before and after, the schema description after, the declared stores it leaves in place and the operation that applied it.rayspec pack --spec <new> --against <old-spec> [--allowlist <file.json>]carries the product delta from the previous spec's stores to the new spec's, the reviewed allowlist byte for byte, and inproductMigrationthe product schema digests the delta migrates between, computed on a throwaway database on the serverSHADOW_DATABASE_URLnames (from the environment only); a destructive delta the allowlist does not clear is refused, naming each store and column and the review step. The runtime'sprepare()trusts none of it: it regenerates the delta from the ledger's latest row and the bundled spec and refuses a carried delta, from-digest or to-digest that differs (RAY_MIGRATION_MISMATCH,RAY_MIGRATION_REQUIRED), scans the delta itself (the bundle'sdestructiveflag is advisory) and blocks a destructive change the bundle's allowlist does not clear, computes the head after the delta on a throwaway database where the ledger's changes, regenerated from the stores each row records, must first reproduce the live schema, and reports a live product schema the ledger does not describe asRAY_SCHEMA_DRIFT, naming each table and column. The product DDL step checks the ledger again under the schema lock and refuses drift, a ledger row a newer runtime wrote, and a result other than the planned head, rolling its DDL back.schemaImpact.destructiveandallowlistednow say what the scanner found. The bundle reader can hand back a bundle's product delta and allowlist (captureProductMigration). An environment deployed before the ledger keeps working: its product head is introspected withRAY_W_PRODUCT_SCHEMA_UNLEDGERED, and its first product change throughrayspec deploy <spec.yaml>starts the ledger. See Runtime operations → Product schema changes and the packing guide. - Application identity in the spec. A backend spec may declare
metadata.idandmetadata.version: the identity an application bundle carries. Both are optional. The id is a lowercase letter followed by up to 62 lowercase letters, digits or hyphens; the version is an exact semantic version with an optional pre-release and no build metadata, at most 128 characters. These are the patterns ofapplication.idandapplication.versionin the bundle manifest, so a value the backend grammar accepts is one a bundle can carry. A product spec uses the same two keys inproduct.metadata, which stays a free-form string map: the parser accepts any string there, as it always has, so a document that already used either key for something else still parses, andrayspec packchecks the two values when it reads them. A document without them parses exactly as before.spec.schema.jsonandversion-1.0.schema.jsoncarry the new backend fields;product.schema.jsonis byte-unchanged. A 1.8 parser refuses a backend spec that uses them. @rayspec/bundle-closure: the inclusion list of an application bundle, from its spec. A new kernel package thatrayspec pack(above) builds on;bundle verifyuses it too (below).resolveClosuretakes a spec path and returns every file the application needs at run time and nothing else: the spec; the compiled handler modules and each extension's entry andhandlers/modules, followed through their imports by a lexer (es-module-lexer) without running them; each frontend directory; for a product spec, the extraction, responder and normalizer configuration files and the prompt and schema files they name; the third-party packages the modules import, with the packages those depend on and the packages their modules import without declaring them, placed so that Node resolves each import to the version it resolved to on the author's machine and a package several others share (a peer such asreact) stays one copy; the dependency lock; a CycloneDX 1.5 SBOM and the license notices of every redistributed package.@rayspec/*packages are never copied: the range apackage.jsondeclares for one must include the pinned runtime version, or the closure is refused withRAY_RUNTIME_UNSUPPORTED. Refused before any output, with the file and the fix in the message (RAY_CLOSURE_INVALID): an import that does not resolve inside the application directory, a dynamicimport()of a computed name,node:module, a CommonJS or TypeScript module, a native addon that its ELF header does not show as a linux/x64 shared object for Node 22 or Node-API (it is read, never loaded), any other package file whose header shows a binary for another platform, a package whoseosorcpufield excludes linux/x64, a native package without a compiled addon, a shared peer dependency that would need two copies, a symbolic or hard link, a path outside the directory of the spec, a script or style sheet with an inline source map unless source maps are asked for, and an explicitly named file of an excluded class. Walked directories leave out version-control metadata, caches, logs, environment files (.env,.env.*,*.env,.envrc), credentials (.aws/,.ssh/,credentials, key files and others), database dumps (by name,*.sqlincluded, and by the first bytes pg_dump, pg_dumpall, mysqldump and mariadb-dump write or a pg_dump archive or SQLite database starts with), localnode_modulesand, unless asked for, source maps, matching names in any letter case, and list each with its reason. A file that starts like a database dump is refused when it is named explicitly. Inside a vendored package only environment and credential files by name are left out, so a certificate bundle or data file it reads at run time goes in. Every file then goes through the bundle's secret rules, and a hit isRAY_SECRET_DETECTEDnaming the path only. The identity comes from--id/--versionor the spec's metadata and never from the name or the runtime; the bindings are the platform-grantable credentials of the agent backends the spec uses.closurePreviewreturns the inclusion summary pack prints, andclosureManifestandclosureFilesthe input of the@rayspec/bundlewriter.@rayspec/bundle-contract: the application bundle contract in code. A new kernel package carries the format of a.rayapplication bundle, of the encrypted migration snapshot and of the managed hosting receipt, as contract version1.0.0-rc.2. It commits the contract's JSON Schemas and vocabularies byte for byte undercontract/, withCONTRACT-LOCK.jsonrecording the SHA-256 of every contract file and one digest over them. A test recomputes that digest over the recorded file map and the hash of every committed file; the contract's prose documents are not committed, so they are covered only through the digest. On top of them it exports the TypeScript types of the manifest, the snapshot, the receipt, the result envelope and the runtime-control operations; the closed error vocabulary with each code's exit class and retryable flag; the capability ids, the reserved binding names, the reader limits and the supported target. It adds one new canonical JSON form: keys in Unicode code-point order (not RFC 8785's UTF-16 order), safe integers only, NFC strings, at most 64 nested containers, one trailing LF in a file. The three existing serializers in@rayspec/core, the record runtime and the grounding runtime are untouched and keep their output, because stored hashes depend on it.validateManifest,validateSnapshotandvalidateReceiptparse a document under those rules, validate it with its JSON Schema through Ajv 2020 in strict mode, and then apply the rules a schema cannot express (inventory order and uniqueness, the spec and the closure files in the inventory, unique binding names, the migration inventory, the archive limit of the kind, unknown receipt capabilities). The first failure is returned aserrors[0]with a code and reason from the closed vocabulary; hostile input — deep nesting, oversized documents,__proto__members, floats, non-NFC strings, duplicate keys,nulloptions — is answered, never thrown. A message never repeats a member name taken from the document;pathnames the member only while every name on the way is at most 64 printable ASCII characters, so a terminal escape or a bidirectional override in a name reaches neither field.ray.jsonis limited to 1 MiB,snapshot.jsonand the receipt to 4 MiB each, which holds every document their schemas admit. Reserved binding names include theANTHROPIC_andCLAUDE_settings that the agent CLI subprocess inherits, except the two platform-grantable credentials.checkRuntimeAdmissionruns the runtime, target, capability and reserved-binding checks of a validated manifest. The golden fixture corpus (133 byte-level cases and 41 document cases) is rebuilt fromcontract/fixtures/EXPECTATIONS.jsonby a generator and compared byte for byte; the tests run every case whose outcome depends on the manifest, and check that every other case matches its recorded digest and carries a vocabulary code. Every case is committed except one with 10,005 entries, which the tests generate. The archive reader that consumes the container cases is not part of this package yet. Nothing uses the package yet: the CLI and the server do not depend on it, so it is not in the publish set and nothing a deployment runs changes.@rayspec/bundle: the one reader and writer of.rayarchives. A new kernel package, built on@rayspec/bundle-contractand Node's own modules only, that the CLI and a hosting service are meant to share, so both accept and refuse exactly the same archives.inspectBundleruns the structural checks of the contract's reader pipeline in its order and stops at the first failure: the archive limit of the operation (the larger kind limit for inspect and verify, the application limit for deploy and prepare, the migration limit for import), the end record, every central record (ZIP64, encryption, data descriptors, flag bits, compression, version, timestamp, extra fields, comments, disks, links, directories, special files, attributes, sizes and every name rule), the name set (duplicates, case-fold, normalization and file-versus-directory collisions, byte order), the layout and each local header byte for byte, the manifest through the contract validator, and every entry streamed against the inventory (size, cumulative extracted bytes, CRC-32, SHA-256). It computes the archive's identity on the same pass, reports secret findings by path, and writes nothing.extractBundleruns the same checks while copying into a directory that must not exist: it is created with mode 0700 only after the manifest passed, files are created exclusively without following links, a directory swapped for a link while it runs is noticed before a byte is written into it, and the directory is removed on any failure. Neither ever imports, evaluates or executes anything from an archive; a test with a payload that would write a file and open a connection if imported shows both untouched, and then imports it on purpose to show the probe works. Reads stay inside the size the archive had when it was opened, run under a wall-time budget (RAY_LIMIT_EXCEEDEDtime-budget) that also bounds the name-set checks, which take time in proportion to the number of names and its logarithm however deep a name is, and refuse an archive whose directory, size or manifest changes while it is read. A path that is not a regular file, a FIFO included, is refused at once. Every limit can only be lowered. Hostile input is answered with a vocabulary code and never thrown, and no message repeats a name from the archive. The private-key scan accepts digits in the header's words (SM2,X25519), as the contract's reference reader does. The ZIP parsing is written for the strict profile rather than taken from a ZIP library, which would accept forms the contract refuses.writeBundlecomputes the inventory from the prepared files, validates the manifest, writes the entries in name order in the strict profile with the canonical manifest last, reads the result back through the reader, and moves it into place atomically, never over an existing file unless asked. Payload files over the extracted byte limit are refused before anything is written (extracted-size), and a limit the read-back reaches is reported as that limit. The same input gives the same bytes in any directory, and the base contract fixture is reproduced byte for byte.createSignatureFileandverifySignatureFilemake and check the detached Ed25519 signature in the contract's order (malformed,mismatch,untrusted-key). Every case of the golden corpus runs through inspection and extraction with its expected code and reason, including the generated 10,005-entry case; the verify expectations run through the reader, the runtime admission checks, the secret scan and the signature, except for the four cases decided by the spec checks, which are left to the spec parser. Seeded property tests cover generated hostile names, header and end-record fields, every single-byte flip and every truncation. The CLI'sbundle inspectandbundle verify(below) are its first users, so it and the contract package join the publish set with the CLI.inspectBundlealso reports the entry count and, when asked withcaptureSpec, hands over the bytes of the spec file once they have matched the inventory, so the spec can be parsed without extracting the archive.rayspec bundle inspect <file.ray>andrayspec bundle verify <file.ray>. Two passive commands on top of@rayspec/bundle; neither extracts, imports or runs anything from the archive, and neither writes anything or reads the environment.inspectruns the structural checks and reports what the bundle declares — application id and version, pinned runtime and target, required capabilities, binding names, execution level, egress hosts, size, SHA-256, entry count and whether a.sigfile lies next to it — with the verdictstructurally-valid.verifygoes on against a runtime (the CLI's own version, or--runtime <exact-version>): the runtime version, the target, each required capability (an id the vocabulary does not know is refused), reserved binding names, the spec parsed from the payload, therequires, execution level and egress hosts the spec derives, the secret scan, and the detached Ed25519 signature (--signature, default<file.ray>.sig;--trusted-key, repeatable;--require-signature). An unsigned bundle passes with the warningRAY_W_UNSIGNEDunless a signature is required. A spec error names its rule and, for YAML, its line and column, never the spec's text. A signature or trusted-key path that is not a regular file, a FIFO included, is refused at once. Both write one result envelope to stdout, with or without--json, print the operation id (and, without--json, a short description that never claims the code is safe) on stderr, and exit with the class of their first error: 0, 1 spec invalid, 2 invalid input, 3 incompatible, 4 policy refusal, 6 interrupted by SIGINT/SIGTERM, 7 internal. Every case of the golden corpus runs through the commands with its expected envelope and exit code, the spec checks included. A test runs both commands through the built CLI under a module-resolution probe and shows that neither loads the server, the database layer, the platform's handler loader or the Postgres driver; another shows a bundle whose handler would write a file and open a connection if it ran leaves both untouched.--jsonon every existing command. It wraps the command's own result object, unchanged, in the same result envelope, with the warningRAY_W_LEGACY_OUTPUT; spec errors appear asSPEC_codes, every other error asRAY_CHECK_FAILED, a usage error asRAY_USAGE, and the exit code stays the one the command has without the flag. A servingdeploy --jsonprints its banners on stderr and writes its one envelope when it stops or is refused. Without--jsonevery command's output is unchanged.- A tier-direction gate.
pnpm gate:tier-direction(part ofpnpm gateand CI) checks that every workspace package depends only on packages of its own tier or a lower one, in every dependency field, with the tier order read againstdocs/ARCHITECTURE.md. The three upward edges the workspace has today are listed in the gate with their reasons, and a listed edge that disappears fails the gate until it is removed.pnpm test:tier-directiondrives the gate over throwaway workspaces with planted edges. - Runtime control:
inspect()andprepare(), an operation lease, and operation receipts.@rayspec/serverexportscreateRuntimeControl, a typed library (no HTTP route) over one environment database.inspect()reports the runtime version, target and Node version, the capability ids whose modules resolve in this process, the contract version, the two-part schema head (the last platform migration tag, mapped from the drizzle ledger onto the runtime's journal, and a SHA-256 of the live product schema read from the catalog; null before the first migration;RAY_SCHEMA_DRIFTwhen the ledger holds a migration this runtime does not ship), the active application, the release and managed-posture digests, the fence and the environment revision — never a host, port, user or path.prepare()reads a.raybundle at an absolute path without following a link, through the reader pipeline, checks its SHA-256 against the one the caller named, and plans against the LIVE schema: required bindings and whether each has a revision, schema impact (the head before and after, the product delta's SHA-256, destructive), permission changes against the active application, storage, warnings and blockers (drift, a changed schema head, a missing binding, a delta without a shadow database to evaluate it in, a carried delta). The target product head is computed by applying the delta to a throwaway database on the shadow server, never the live one. The result carries the plan digest over the contract's inputs,preparedAt,expiresAt(exactly thirty minutes later) and the environment revision.prepare()takes no lock, stores no plan and writes nothing to the environment's database. The contract package gains the pure rules both sides compute: request checks, the plan digest and its expiry, the product schema digest, binding revision ids, the shared schema lock key and the platform tables with their snapshot categories. - An operation lease with a fencing epoch, and append-only operation receipts. Two new platform tables (migration
0012_runtime_control):runtime_control_state, one row per environment (environment revision, fence, binding revision key, operation lease, the active application), andruntime_control_receipts.acquireOperationLeasegives one mutating operation at a time the lease, increments its fencing epoch and records the operation's intent in the same transaction, before any effect. Every write of the holder re-checks the epoch, the holder and the expiry (by the database clock) in its own transaction, so a holder whose lease expired and was taken over cannot write when it wakes up; the takeover names the previous holder, and a step it started and never finished stays visible for reconciliation. Receipts record the operation id, actor, kind, lease epoch, inputs digest, each step's start and finish with its digest, timestamps and the outcome; a trigger refuses UPDATE, DELETE and TRUNCATE on them, and an idempotency key names one intent only. Both tables are reserved store names and classifiedruntime-control-state, which a snapshot never exports. RAYSPEC_SCHEMA_LOCK_TIMEOUT_MS, the bounded wait for the shared schema lock (default 60000, at most one hour; an invalid value aborts the boot). See Fixed.@rayspec/bundle:refuseLinks. A read option that opens the archive path withO_NOFOLLOWand refuses a symbolic link withRAY_USAGEinstead of following it.- Runtime control:
quiesce(),resume()andhealth(), and a source fence every running process keeps.quiesce(reason, deadline, sourceStopped)takes the environment's fence under the operation lease (the fence epoch and the environment revision increase in one transaction, with receipts) and waits, until the deadline, for every running runtime process to stop its producers and drain its in-flight work. Each process reads the fence every 500 ms and, while it is held, refuses every HTTP mutation (uploads, trigger fires and run starts included, and any request to a declared route whose action writes — a store create, update or delete, an agent run, a handler not declaredreadonly, a stream ingest — whatever its method) and every new event stream with503 SERVICE_UNAVAILABLEandRetry-After(reads keep answering, and a read authenticated with an api key does not stamp the key's last use), closes open event streams after the chunk in flight, skips cron ticks and the daily system cleanup, and pauses the run queues without shutting the durable engine down; once it has drained it also refuses event-bus appends and object writes. A mutation counts as in flight until its work has ended: the drain closes a streamed run's stream for its client, and the run behind it finishes and is waited for. A process is counted from the moment its boot reads the fence, before it attaches any producer, so a quiesce during a boot waits for that process too. Statusfencedmeans every live process reported drained at the new epoch; otherwise the result istimed-outwithok: falseandRAY_SOURCE_NOT_QUIESCENT, and the fence stays held; quiesce renews its lease while it waits, however far away the deadline is. The result lists each producer's state, the write barriers and the external services no fence reaches (RAY_W_EXTERNAL_EFFECTS_UNFENCED). The database barrier is taken only after a full drain: with role separation (runtimeRole) the runtime role's write privileges are revoked in both databases and recorded (refused asunavailablewhen the role, or a role it can switch to withSET ROLE, owns a table, holds a write that survives, is a superuser, bypasses row security or may create roles); without it, a source the operator attests is stopped holdsdatabase-stopped-sourcewhen no other session is connected; otherwise it is reporteddatabase-write-role: unavailable.resume(fenceEpoch)releases only the fence held at that epoch (RAY_FENCE_MISMATCHotherwise), grants back exactly the recorded privileges, and every process restarts its producers within one poll. The fence is kept in the database, so a process booted under it starts fenced.health()reports liveness and readiness with each failing check's cause and no topology. One new platform table (migration0013_runtime_control_processes) holds each running process's heartbeat; it is a reserved store name, classifiedruntime-control-state, and the one table the write barrier leaves writable. GET /livez, a liveness probe that answers 200 while the process answers.GET /health(readiness) also checks that the platform schema is the one this runtime ships, that every boot secret mounted as a<VAR>_FILEis still a readable file, and, when a durable worker is wired, that it is running and its system database answers. Its body keepsstatus,dbandfrontendand addslive,readyandchecks(each check's name with its boolean).RAYSPEC_HOSTING_POSTURE(local, the default, ormanaged). Undermanagedthe public/recovery-scopeprobe is not registered, and cross-process run cancellation is on (see Changed).RAYSPEC_SHUTDOWN_DRAIN_MS, the bounded graceful shutdown (default 10000, at most 600000). On SIGINT or SIGTERM bothrayspec-serveandrayspec deploystop accepting connections, let in-flight requests finish for that long, then close every connection still open and the application, itself bounded by the same drain.SERVICE_UNAVAILABLE(503) joins the platform's HTTP error codes.@rayspec/durable-dbos: pausable dispatch.pauseDispatch()/resumeDispatch()on both executors stop and restart dequeuing (the queue's worker concurrency set to 0 and back) without shutting DBOS down, andinFlightcounts the jobs running; the cron and cleanup schedulers take agateand count their fires in flight.- Runtime control: apply, with crash reconciliation.
runApply(in@rayspec/server) runs a list of steps against an environment in the contract's order: the idempotency key is looked up (a key recorded with another plan digest isRAY_IDEMPOTENCY_CONFLICT; a succeeded operation answersalready-appliedwith its original receipts and runs nothing), the plan digest is recomputed from the live state and the expected environment revision compared (RAY_PLAN_STALE, also for an expired plan, and nothing is written), blockers and a held fence areRAY_POLICY_DENIED(plan-has-blockers,fenced), then the operation lease is taken with the intent receipt, the checks run again under it, and each step runs with a receipt before and after; a schema-changing step takes the shared schema lock. The environment revision increases by one in the transaction of the outcome when a step ran. Before any step, every apply an earlier process left unsettled is reconciled from its receipts and the live state: a step whose effect commits with its finish receipt is proven not applied by a start without a finish; any other step is read back through the observer its start receipt names and closed as applied or not applied; a step whose outcome cannot be established — an external effect nothing can read back — is never replayed and blocks every apply withRAY_RECONCILIATION_REQUIRED(exit class 6) until an operator records what it did withresolveInterruptedStep. Schema changes are never reversed automatically. A live lease is never taken over, not even by a retry under the same operation id, so two retries of one interrupted apply cannot both run its steps; a retry under the key of an apply that another apply closed as interrupted continues that operation. The contract package gainscheckApplyRequest,checkApplyControlandisIdempotencyKey. New: the runtime operations guide — the lifecycle operations, the receipts and how to recover from each interruption. - The hosting report beside
inspect().inspectHosting()on the runtime-control adapter reports the hosting posture and whether cross-process run cancellation is on, with its interval and whether the variable or the posture set it. The contract's inspect result has no member for it, so it is not part ofinspect(). - Database roles and row-level security, opt-in. Setting
RAYSPEC_MIGRATION_DATABASE_URL(orRAYSPEC_MIGRATION_DATABASE_URL_FILE) turns on role separation: the platform migrations, product DDL, the migration ledgers and a new step that enables row-level security run as a migration role over that connection, whose pool the boot closes once its schema work is done, and the server serves as the runtime role inDATABASE_URL. The step enables and forces thetenant_isolationpolicy on every tenant table (every table with atenant_idcolumn, product stores included; a product migration does it in the transaction that creates its tables), guards each foreign key between tenant tables with a trigger that refuses a reference to another tenant's row (reported like a missing parent), and leaves the runtime role read-only on the two migration ledgers. The new platform migration0015_tenant_row_securitycreates the core policies and three narrow functions (the invite and run-ownership lookups that must find a row before a tenant is known, and the reference trigger); it enables nothing, so a deployment that sets nothing keeps one role and behaves as before. The boot then checks, from the catalog, that the runtime role is no superuser, bypasses no row security, may create no role, database, schema, table or temporary table, owns nothing, holds noTRUNCATEon a tenant table and starts with no preset tenant, and that every tenant table carries exactly the tenant policy and no other permissive policy; it also names every view or materialized view the runtime role can read that reads a tenant table with its owner's rights, and everySECURITY DEFINERfunction owned by a bypassing role that the runtime role can call other than the two lookups, unchanged. It reports the result asBootedServer.databaseIsolationand prints one warning line naming each failed check, while still serving. The durable worker's own tables are migrated as the migration role before the engine starts as the runtime role, andrayspec tenant ensureprovisions over the migration role when the variable is set. The boot's product-schema drift check reads foreign keys frompg_constraintinstead of the information schema, which shows a constraint's referenced table only to the table's owner, so a restart of a role-separated deployment mounts its product stores instead of refusing them as drifted. The three roles and their grants come fromsql/database-roles.sqlin@rayspec/db(packages/kernel/db/sql/database-roles.sql), which the dev container (pnpm db:up, on a new volume) and CI run too; it is idempotent and hands the objects of an existing single-role database over to the migration role without touching a row. New guide: Database roles and row-level security. - The runtime-control adapter reports the database isolation posture.
inspectDatabaseIsolation()runs the same catalog check for the adapter'sruntimeRole, andinspect()reportsmanagedPosture.supportedonly when the release carries a capability receipt, that posture is active and single-tenant mode (RAYSPEC_SINGLE_TENANT=true) is on; withoutruntimeRoleit is never supported. - The tenant chokepoint gate fails a migration that adds a tenant table without its row-level policy.
scripts/check-tenant-chokepoint.mjsreads the committed platform chain and names every table with atenant_idcolumn (created quoted or not, or given the column by adding or renaming one) that no migration gives the canonicaltenant_isolationpolicy. It also fails a migration that creates any other policy, changes a policy, creates a view withoutsecurity_invokeror a materialized view, creates aSECURITY DEFINERfunction other than the two lookups, or switches a table's row security off.gate:migrate-cleanasserts the policies on every tenant table and row security enabled on none after the chain. - A test lane served as the runtime role. With
RAYSPEC_TEST_DATABASE_ISOLATION=rolesthe database-backed suites of api-auth, platform, workflow-durable, durable-dbos, server and cli run the code under test as a runtime role with every tenant table's policy enabled and forced: a hand-built test schema is served as a role of its own (testAppDbin@rayspec/db/testing), every server boot is handed role separation (the server'svitest.setup.tswrapsassembleServerandprovisionTenant), a workflow engine launches as the runtime role, and a spawned CLI or server gets both connections (runtimeRoleEnv). Each lane checks from inside a session that it is connected as the runtime role; any other value of the variable fails the run. CI runs all six packages that way as well.GLOBAL_TABLESin@rayspec/dblists the tables without a tenant column, and the database-backed suite holds it equal to the catalog. The new row-level isolation suites of@rayspec/dband@rayspec/servercreate throwaway roles through the setup SQL and prove, as the runtime role, that one tenant cannot read, update, delete, insert or reference another's rows or receive its events, that no, forged or stale tenant context reaches nothing, that pooled connections carry no tenant into the next request under concurrency, and that the runtime role can neither run DDL, disable or drop a policy, truncate, nor change its own role attributes. - Single-tenant mode, opt-in.
RAYSPEC_SINGLE_TENANT=trueholds the runtime to one organization. The org store refuses a second one under a transaction-scoped advisory lock, on every path that creates one:POST /v1/orgs,POST /v1/auth/registerwith anorgName, the operator bootstrap route, andrayspec tenant ensure(which reads the same variable, keeps resolving the existing organization idempotently and reportsSINGLE_TENANT_LIMITfor a second). Open registration only creates that first organization; after it an account is made by redeeming an invite. A refusal is a403with one fixed message, and it creates no account: the loser of two registrations racing for the first organization gets the403too. A boot of a database that already holds more than one organization is refused. Any value other thantrueorfalserefuses the boot.BootedServer.singleTenantreports it, and the runtime-control adapter'sinspectHosting()reports the tenant limit asapplicationTenants: { singleTenantMode, maxApplicationTenants }. Unset, nothing changes. - In the hardened posture a durable agent run is re-checked against its requester when it starts. A run enqueued through the API (
async: true, or a handler'sinit.enqueue) records who asked for it —requestedByon the job: the member, the API key, orsystemfor a trigger — taken from the authenticated request, never from the body or handler code. With role separation or single-tenant mode on, the worker asks the newDurableRunAuthorizer(makeRunAuthorizerin@rayspec/api-auth, wired by the server only then) before it starts the run: a member no longer in the organization, or a key revoked, expired or withoutagent:run, gets no run. The run is marked like a cancellation, so no recovery re-dispatch runs it either, and it reads back asstatus: 'error',errorClass: 'cancelled'with a message saying it was not started; the backend is never called.recordRunCancelledtakes the message to record. - New guide: Hosting in the hardened posture — role separation, single-tenant mode and the managed posture together; how to turn it on and check it; what every surface authorizes; what handler code is given; and what it does not protect against (it is not a sandbox for custom code).
- One execution policy bounds every agent run. Wall time (
RAYSPEC_AGENT_RUN_MAX_MS), the provider-call timeout (RAYSPEC_AGENT_REQUEST_TIMEOUT_MS,RAYSPEC_AGENT_MAX_ATTEMPTS), the kill grace for a child process (RAYSPEC_AGENT_KILL_GRACE_MS, new), queue admission forasyncruns in total and per organization (RAYSPEC_AGENT_QUEUE_MAX,RAYSPEC_AGENT_QUEUE_MAX_PER_TENANT, new), the durable worker's concurrency (RAYSPEC_AGENT_WORKER_CONCURRENCY, new, default 4) and in-request runs per process (RAYSPEC_AGENT_SYNC_RUNS_MAX, new: synchronous agent runs, conversation reply runs and record normalize runs together) are read in one place. UnderRAYSPEC_HOSTING_POSTURE=managedevery bound has a default (15 minutes per run, 2 minutes per provider call, 2 attempts, a queue of 1000 and 100 per organization, 32 in-request runs, the 2 s cancellation poll) and an unusable value of any of them refuses the boot; without the posture the bounds that predate the policy stay off unless set.inspectHosting()reports the resolved policy and where each value came from. See Hosting in the hardened posture → Bounded execution. - A run past a queue or in-request bound is refused with
429.RATE_LIMITED, aRetry-Afteranderror.details{ reason: "queue-full", scope, limit }; nothing is recorded for the refused run, and anIdempotency-Keyit carried is free again. Admission counts the durable engine's own queue under one database lock, so a burst is admitted exactly up to the bound. - Every adapter bounds its provider call. The openai backend's per-request timeout now covers the response body too, so a provider that sends its headers and then stalls is ended; the anthropic, codex and pi backends end a call whose stream or child goes silent for the provider-call timeout, with the neutral
timeoutclass; the Deepgram and OpenAI speech adapters bound each request, body included. The auth preflight of a remote backend is bounded by the same timeout. Each is proven against a local provider that never answers or a child that never speaks. - A codex child that ignores
SIGTERMis killed. The adapter starts the binary through a small launcher, in a process group of its own, that forwards theSIGTERMto the group and sendsSIGKILLafter the kill grace, and never waits on the child's output beyond the grace, so a cancelled or timed-out codex run always settles, even when a process the child started holds its output open. - A run's record says what happened to its provider call. A run ended by a cancellation or by its wall-clock bound carries
before-call,call-aborted,after-calloroutcome-unknownin its terminal step, as observed by the process executing it; the cancel surface recordsoutcome-unknownfor a run it finds executing until that process reports. A run cancelled while it was being set up, before it could be signalled, reads its cancellation once before the provider call and never makes it. - The supported-backend matrix for the managed posture. Under
RAYSPEC_HOSTING_POSTURE=managedonly the openai agent backend and the Deepgram and OpenAI speech providers run; a boot whose agents, product model calls or speech providers use anything else is refused before anything is written, with the backend, what uses it and why. The matrix, with each backend's bounds, cancellation semantics, gaps and the tests that prove them, is in Hosting in the hardened posture → Supported backends and ininspectHosting().supportedBackends. - The egress declaration. A backend spec may list the outbound hosts its application calls in
deployment.egressHosts, a product spec indeployment_overrides.egress_hosts: lowercase DNS hostnames of at least two labels, no wildcard, trailing dot, IP address, port or URL, each once, at most 256.rayspec packcarries them into the manifest'spermissions.egressHosts, which was always empty before;rayspec bundle verifyre-derives them from the spec and refuses a manifest that lists one more or one fewer (permissions-mismatch);prepare()reports them as permission changes and covers them by the plan digest. The declaration is for the host network policy to enforce: the runtime blocks no call to an undeclared host.spec.schema.json,version-1.0.schema.jsonandproduct.schema.jsoncarry the new fields. A 1.8 parser refuses a spec that uses them. - A guard for outbound requests to a URL the platform did not choose.
guardedFetchin@rayspec/platformrefuses a scheme other thanhttp:/https:, a URL with credentials, and a loopback, private, link-local, metadata, unspecified, multicast or reserved destination (an IPv4 address embedded in IPv6 judged by that address, any IPv6 address outside2000::/3refused) — judged on the address the connection uses after DNS resolution, so a name that resolves to127.0.0.1or rebinds is refused — and checks every redirect hop the same way. Every guarded request has a time limit, 30 seconds unless the caller setstimeoutMs, covering the resolution, every redirect hop and the response body; a request past it is ended withOutboundRequestTimedOut. No outbound path of this release takes a URL from a spec or a request; a test holds the list of every outbound call site in the shipped source so that a new one goes through the guard or is reviewed. Handlers are not bound by it: they run in-process, and the host network policy contains them. See Hosting in the hardened posture → Egress. - The managed posture exports no agent trace by default, and the hosting report says whether one is exported. Under
RAYSPEC_HOSTING_POSTURE=managedan unsetRAYSPEC_AGENT_TRACINGmeansoffonrayspec-serveand the boot wrappers too, as it already did onrayspec deploy(both the YAML and the.raypath);RAYSPEC_AGENT_TRACING=openaiturns the export back on.inspectHosting()reportsagentTraceExport(offoropenai) andegress(enforced by the host network policy), andinspect()no longer reports the managed posture as supported while traces are exported. Without the managed posturerayspec-servekeeps exporting by default, as before; setRAYSPEC_AGENT_TRACING=offto stop it. See Hosting in the hardened posture → Telemetry. - Rotating the JWT signing key without logging anyone out.
RAYSPEC_JWT_SIGNING_KEY_PREVIOUS(or its_FILE) holds the key in use before a rotation: it signs nothing, and its public key stays inGET /v1/oauth/jwksand in the OIDC provider's key set, so a token signed before the rotation verifies until it expires. Unset it after the overlap window; a value that is not a PKCS#8 PEM refuses the boot by name. See Hosting in the hardened posture → Credentials and rotation. - Rotating the API-key pepper with an overlap window.
RAYSPEC_API_KEY_PEPPER_PREVIOUS(or its_FILE) holds the pepper in use before a rotation: while it is set, an API key, refresh session or invite token hashed under it still verifies and is renewed under the new pepper when it is used (an API key is re-hashed on first use, a session is replaced when it refreshes). Unset it at the end of the window; what was not used by then is refused. A new pepper with no previous one is the reset for a pepper that leaked: every such credential is refused at once, and passwords are unaffected. The operator procedure for both is in Hosting in the hardened posture → Credentials and rotation. - Provider keys from a file, and each to the component that uses it.
OPENAI_API_KEY,ANTHROPIC_API_KEY,CLAUDE_CODE_OAUTH_TOKEN,CODEX_API_KEYandDEEPGRAM_API_KEYeach accept a<NAME>_FILEvariant — a regular file of the server user, mode 600, never a link — which wins over the plain variable and never falls back to it; a value read from a file stays out of the process environment. A refused key (401/403) fails the run, transcription or synthesis with a message naming the credential instead of the provider's text, without a retry and without another credential in its place. See Hosting in the hardened posture → Provider credentials. init.bindings: a bundle's own bindings, for its handlers. Onrayspec deploy <file.ray>the values of the application names the manifest declares reach every handler kind asinit.bindings.get(name)(andnames); a name the bundle does not declare, or a provider credential, throwsBindingNotGrantedErrorinstead of answeringundefined. The type ships in@rayspec/handler-sdk. See Spec reference →init.bindings.- One redaction path for logs, error envelopes, receipts and traces. Every line a server boot or
rayspec deploy <file.ray>writes to stdout and stderr, every HTTP error envelope, every runtime-control result envelope, every receipt detail, every run's recorded error, the error a failed durable run leaves in the workflow engine's system database and every exported agent trace passesredactText/redactValue(@rayspec/core): the boot secrets, the provider keys and the binding values the process resolved are removed wherever they occur, and so are bearer tokens, credential headers, URL passwords, PEM private keys, JSON web tokens, RaySpec API keys andsk-…provider keys. See Hosting in the hardened posture → Redaction. - Scoped handler rights:
handlers[].uses. A handler may list the capabilities it uses (blob,fsSource,stt,tts,emit,enqueue,mintPlayToken,bindings); its init then carries exactly those, and reaching for another one throwsToolRightNotGrantedErrorinstead of arriving. A right outside the list is refused when the document is parsed, one the handler's kind never receives by the lint (capability_violation), and one the deployment does not grant by the boot before anything is written, naming the handler and the missing setting. UnderRAYSPEC_HOSTING_POSTURE=manageda handler withoutusesrefuses the boot. Without the key a handler receives what the deployment configured, as before.spec.schema.jsonandversion-1.0.schema.jsoncarry it; a 1.8 parser refuses a spec that uses it. See Hosting in the hardened posture → Tool rights. - Snapshots of a fenced source: preflight and capture, as a library.
preflightSnapshot(@rayspec/server) checks, read-only and before any fence, everything an export needs: the deployed application rebuilt byte for byte from the state directory and matching the database's record, the schema head and product ledger (RAY_SCHEMA_DRIFT), apg_dumpof the server's major, the reading role's access past row-level security, the fs blob store walked completely, the migration size and object limits, free scratch space, database extensions — none in the application database, and in the workflow system database none butuuid-ossp, which the durable engine's own migrations create there (RAY_POLICY_DENIEDunsupported-extension), exactly one organization and no blob of another tenant (RAY_MULTI_TENANT_UNSUPPORTED), a password-holding member (RAY_OWNER_RECOVERY_REQUIRED), and every table being a platform table or a product store (RAY_EXTERNAL_STATE_UNSUPPORTEDunknown-table).captureSnapshottakes the plaintext inner snapshot archive under the fence: it refuses without the fence at the given epoch, without a held database write barrier (database-barrier-unavailable), with a session that could write (uncontrolled-writer) or a run still marked running (unreconciled-effects); it copies every stored blob intoobjects.binwith both digests checked, dumps each database withpg_dump --snapshotin the transaction that counts its rows, dumps the workflow system database whole when it exists, refuses a blob root or fence that changed meanwhile (RAY_SOURCE_NOT_QUIESCENT), and reports who read (snapshot-roleorsingle-role) and which barriers held. Credential, replay, audit and runtime-control rows never leave the source, run history follows the requiredincluded/excludedpolicy, and every exclusion is listed.pg_dumpis the operator's (an absolute path, or the first onPATH) and gets its connection through the libpq environment only. See Runtime operations → Snapshots of a fenced source. - The inner snapshot archive and its object index.
writeSnapshotArchiveandinspectSnapshotArchive(@rayspec/bundle) write and read the strict stored ZIP rooted atsnapshot.json, checking the inventory, the application digest, the object ranges (RAY_DIGEST_MISMATCHobject-range) and both digests of every object (object-sha256);validateObjectIndex(@rayspec/bundle-contract) validatespayload/object-index.json.listFsBlobs(@rayspec/platform) walks an fs blob root and lists every stored object with the length and digest its header states, refusing anything the store would not have written. - Migration bundles, encrypted with age.
writeMigrationBundle(@rayspec/server) encrypts an inner snapshot archive with age v1 to one X25519 recipient and writes it as the only payload file (payload/migration.age) of a migration-kind.ray, mode 0600, read back by the one reader and never written over an existing file, through the one bundle writer (writeBundlegainsfileMode);encryptFileandisAgeX25519Recipientare its parts. A passphrase, an identity and the post-quantum or tag recipients are refused. The encryption is the age authors' JavaScript implementation,age-encryption0.3.1 (BSD-3-Clause; new dependency, with@noble/*and@scure/base, in the SBOM and the notices), run against every official age test vector (cctv-age, a test-only dependency); RaySpec implements no primitive. rayspec exportandrayspec resume: move a self-hosted deployment as one encrypted bundle.rayspec export --deployment <id> --recipient <age1…> --output <migration.ray> --run-history <included|excluded>runs a read-only precheck, asks the operator to confirm the downtime (or takes--confirm-quiesce), fences the source with a database write barrier — the runtime role's writes revoked under role separation, or a stopped source attested with--source-stopped, elseRAY_EXTERNAL_STATE_UNSUPPORTEDdatabase-barrier-unavailablewith the source fenced — captures both databases and the blobs under that one fence epoch, encrypts the snapshot in a private scratch directory under the state directory and writes the migration bundle (mode 0600, never over an existing file). The source stays fenced; the result names the barriers that held, who the snapshot read as, and therayspec resume --deployment <id> --fence-epoch <n>that releases it, which refuses any other epoch (RAY_FENCE_MISMATCH). A second export while fenced reuses the fence at its epoch. SIGINT or SIGTERM stops at a safe point, endspg_dump, removes the scratch data and reportsRAY_INTERRUPTED(exit 6) with the resume command; the next export, orrayspec resume, removes the plaintext a killed one left in the scratch directory and closes its receipt. An application that loads extensions is exported when its blobs are in the platform's fs store, or it keeps none: which backend holds them is a value of the extensions' code, so the export does not load them but reads what the deployment's boot resolved, which the bundle deploy records with the application digest in the newruntime_control_state.blob_backend(migration0017_runtime_control_blob_backend). An application whose blobs are in a backend an extension provides (it does when an extension provides one and the application has a stream route, the only case in which the runtime builds a blob backend) is refused before the fence (RAY_EXTERNAL_STATE_UNSUPPORTED,unsupported-blob-adapter), naming that extension, and so is one whose active version has no record (deploy it once with this runtime). A deploy that activates another version while the export runs is refused (RAY_SOURCE_NOT_QUIESCENT), before the fence or under it, since the blob decision belongs to the version it was made for.LoadedExtensions.capabilityProvidersin@rayspec/platformnames the extension that provided each capability. An upload being written during the precheck is normal operation: it is reported as in flight and left to the fence's drain; only a temporary upload file still there after the drain refuses, in the capture (unreconciled-effects), with the source fenced.listFsBlobstakes the phase (liveorquiesced) that decides which of the two a temporary file is. Every transition (PRECHECK,QUIESCING,FROZEN,EXPORTING,EXPORTED,BLOCKED) is recorded with its operation id, actor, fence epoch, time, digests and recovery action in a shareable local receipt (<state-dir>/receipts/, no secret, record or table name) and in the environment's receipts. The configuration comes from the process environment only, with the newRAYSPEC_SNAPSHOT_DATABASE_URLfor the read-only snapshot role andRAYSPEC_PG_DUMPfor an explicitpg_dump. New guide: Exporting a deployment.rayspec import: restore a migration bundle into a new, empty target.rayspec import <migration.ray> --target <state-dir> --identity-file <file> --dry-runis the passive eligibility plan: the bundle through the one reader, the ciphertext's size and SHA-256 checked before decryption, the decryption with the age X25519 identity file (a protected file: yours, mode 0600) into a private scratch directory within the migration plaintext limit, the inner snapshot through the same reader, every clear hint of the bundle against the authenticated snapshot (RAY_DIGEST_MISMATCHinner-metadata), the embedded application against this exact runtime, each dump against the restore allowlist, and the target — both databases and the blob root empty (RAY_TARGET_NOT_EMPTY), the snapshot's server major, the roles prepared. Without--dry-runthe import withholds the migration role's default privileges that would give the runtime role writes, so the runtime role writes nothing the import restores before the cutover; restores both databases withpg_restoreas the target's migration role, never a superuser, under the shared schema lock, in one transaction each, with no owner, privilege, comment or tablespace from the dump; writes every stored blob file unchanged; verifies the bytes restored, the row counts, the foreign keys, the schema head, the one organization, the empty credential tables, the runtime role's posture and every object's digests; and holds the target's fence, with the writes the runtime role is owed recorded for the cutover. The restore allowlist reads each dump's table of contents from its bytes and compares it withpg_restore --list: it refuses an extension (onlyuuid-osspin the workflow system database,unsupported-extension), another owner or a grant to an unknown role (unmapped-owner), and a role, an event trigger, a view, a type, an untrusted language, aSECURITY DEFINERfunction beyond the platform's two,COPY … PROGRAM, a call into the dump or a server function (SQL from text, files, large objects, advisory locks, notifications) from an expression the restore evaluates, an entry outside the sectionpg_dumpputs its kind in, a Unicode-escape name or string (U&"…",UESCAPE), or any statement beside the ones an entry may hold (privileged-statement). The restore runs pre-data, data and post-data in that order whatever the archive's order, so no trigger of the dump exists while rows are copied in; after each restore, after the import's own writes and before the cutover, both catalogs must hold exactly what the restore plan creates (no extra extension, schema, function, view, type, rule, publication, large object, foreign grant, or changed default privileges or role settings; every function with the language, security mode, search path and body its dump entry gives it). A dump that restores a second organization is refused and its restore discarded (RAY_MULTI_TENANT_UNSUPPORTED). Every transition (IMPORTING,VERIFYING,READY_FOR_CUTOVER,CUTOVER,COMPLETE,BLOCKED) is recorded in a shareable local receipt and the target's receipts. The import prints a cutover token once: it binds the migration bundle, the application, the target, both fence epochs, the target's environment revision and its catalogs, works once and expires after 15 minutes; the target keeps only its SHA-256.rayspec import --target <dir> --cutover-token <token>checks and consumes it and only then releases the target's fence and grants the runtime role its writes;--renew-cutover-tokenreplaces an expired or spent token;rayspec resumenever releases a fence an import holds. A failed import leaves the target marked failed in<target>/import.jsonand its fence, which is never resumed;rayspec import --target <dir> --discard-failedremoves what it restored and gives the withheld default privileges back.RAYSPEC_PG_RESTOREnames an explicitpg_restore. New guide: Importing a deployment.@rayspec/serverexports the import's building blocks:openMigrationBundle,planDumps,inspectImportTarget,restoreImport,discardImportTarget,markImportFailed,ImportReceiptLog, the cutover (issueCutoverToken,renewCutoverToken,consumeCutoverToken), the catalog check (readCatalog,catalogDifference,catalogDigest,describeFunction), the custom-format table-of-contents readerreadDumpToc, the restore allowlistplanDumpRestore,decryptFileandparseAgeX25519Identity, andlistDump/restoreDumpforpg_restore. The inner snapshot reader of@rayspec/bundlereports where each payload entry lies in the archive (SnapshotInspection.entries), and@rayspec/dbexports the platform's definer-function allowlist (ISOLATION_DEFINER_FUNCTIONS,normalizeFunctionBody).- The identity of an imported target.
rayspec importnow requires--secrets-out <new-dir>and mints the target's own boot secrets there — an RS256 signing key (jwt-signing-key.pem), an API-key pepper and a media signing key, directory mode 0700, files 0600, printed nowhere — so nothing keyed by the source's secrets works on the target: its access tokens, refresh sessions, API keys, invites and playback URLs are refused, while passwords (argon2id, keyed by no secret) keep working. After the verification the import records each account's carried identity — user id, and password hash when it has one — in the target'sauth_audit(identity_imported, naming the import and the bundle's digest), checks the credential tables empty once more, and lists on stderr who signs in again with their password, which owner needs owner recovery because they hold no password, which account has no way in, and that every API key of the source is reissued; the receipt keeps the counts andbootSecrets: "reissued". - Owner recovery:
rayspec tenant recover-ownerandPOST /v1/auth/owner-recovery. For an active owner who holds no password — an owner whose only credential was an API key, which a new pepper breaks — the operator issues a one-time token against the deployment's database with its pepper:rayspec tenant recover-owner --email <address> [--org-id <uuid>] [--ttl-seconds <n>]. The token is printed once, in the command's JSON object on stdout; the new platform tableowner_recovery_tokens(migration0016_owner_recovery, a global table under the snapshot categorycredential-state) keeps only its HMAC under the pepper, a newer token replaces an outstanding one, andowner_recovery_issuedis audited. The command refuses an owner with a password, an account that is not an active owner and a fenced environment. The owner redeems the token once atPOST /v1/auth/owner-recoverywith a new password (rate-limited per source asowner-recovery): one transaction consumes it, sets the password and ends the account's sessions, and the owner is signed in (owner_recovery_redeemed); every token that does not redeem answers the same400.owner_recovery_tokensis a reserved store name. - A deterministic extraction provider, for development and tests only. Under
RAYSPEC_EXTRACTION_MODE=deterministicthe runtime now runs a shipped provider instead of refusing the boot when no executor is injected, so a product with extractors runs end to end without a provider credential. It reads labelled lines (Title: …) of the step's input text into the properties of the extractor's output JSON Schema, converting each to its declared type, and is not an extraction model: it is documented as unsuitable for production extraction, and the boot's non-real-provider banner says so. An extractor uses it only when its config selects it ("backend": "deterministic", withagent_idandschema_fileand no other key); a config that names a real backend is refused in deterministic mode rather than answered by it, a config that selects it is refused in live mode, andRAYSPEC_HOSTING_POSTURE=managedrefuses it as test-only (extraction-deterministic). An injected executor still replaces it. A bundle does not state that it selects the provider:bundle inspectlists no requirement for it. See Spec reference → the deterministic extraction provider. - Three reference applications under
examples/, each packed and deployed from its bundle.team-notesis a CRUD notes store with keyset pagination, soft delete (a deleted note stays as a tombstone that every read hides and an export carries) and a static UI that shows the application's own version (not the runtime's), in three releases:1.0.0,1.1.0(an optionallabel, abigintcounter and anumeric(30, 6)amount, an additive change that keeps every row) and2.0.0(droppingcontent, refused by pack and by the deploy); it ships a 100-note seed for two users with an inventory digest and a loader that pages it back.document-intakeis a product-profile workflow — upload a plain-text or text-layer PDF document, parse, extract, validate, persist, read — running on the deterministic extraction provider with no credential, with a 50-document seed of hashes and expected records and a live-model config beside it.asset-catalogis custom code: a compiled TypeScript extension whose handler uses a third-party npm package (mime-types, withmime-db) vendored into the bundle by the example's build, writes through the tenant-bound database facade and calls one declared HTTPS host; a native-addon fixture beside it shows pack's refusal of a macOS build. Each has a README; the repository tests build, pack, inspect, verify and deploy each one with the real CLI. The build, seed and fixture scripts run also when started through a symlinked directory.gate:fixture-neutralitynow scans the three applications as well — every text file in them, seed documents, READMEs, UI and scripts included — and fails closed when a root it scans is missing or holds nothing; the handler gates scan the asset catalog's extension. - Reference journeys, run in CI on every pull request.
pnpm test:journeys(scripts/reference-journeys.mjs, one script per application underscripts/journeys/) packs the workspace, installs the tarballs into an empty directory the way a consumer does (scripts/check-consumer-install.mjs) and drives each reference application with that installedrayspeconly: build, pack, inspect and verify; a deploy on fresh databases with role separation; data and file writes; an additive release that keeps every row and a destructive one refused at pack and at deploy. Forteam-notesanddocument-intakeit goes on: an encrypted export while the source serves (writes503, reads200), holding only its manifest and the age payload with no stored value readable in it, and refused to another identity (RAY_DECRYPTION_FAILED); an import into an empty target, the cutover and a deploy with the target's own secrets; a new write; a second export and an import into another empty target; and the state compared by counts, digests and rows — the largest safebigintand anumericvalue past float precision included — with the documented identity reset: passwords sign in, every access token and API key of the earlier environment is refused, a key-only owner gets in throughrayspec tenant recover-owner, andrayspec resumereleases the export fence at its epoch only. The document intake journey also crashes the server before and after persistence and checks each run ends, after a restart, with exactly one record; replays a retried upload; refuses an unsupported type, a disguised executable and hostile markup; and compares every stored file of the target with the source's. The custom-code journey (asset-catalog) deploys behind an egress proxy the journey programs from the bundle's declared hosts, with npm offline, checks the dependency resolves from the bundle's own tree, and sees that proxy refuse a call to a host the running bundle does not declare — the refusal is the proxy's, as it is in a deployment, since the runtime does not enforce egress; it then goes through the same export, import, new write, second export and import as the others, and each target serves the extension and its dependency from the bundle it carries. A separate case adds an extension that provides its own blob backend, whose export is refused naming it (RAY_EXTERNAL_STATE_UNSUPPORTED,unsupported-blob-adapter), with the source left unfenced. A source with two organizations is refused on export. A running document workflow cannot be cancelled (the run cancel route answers404for it), and the imports are self-hosted only. The newreference-journeysjob of CI runs them;pnpm test:journeys-logicchecks the harness in lane 1. - A consumer quickstart,
docs/quickstart.md: fromnpm install rayspecto the team-notes application deployed from its bundle, separate from the source-build getting-started. The reference journeys run every command of its steps — the clone with its tag and path, against a local repository tagged at the packed version — and the restart it names after Ctrl-C. - A live smoke of the document-intake application (
packages/app/server/src/document-intake-live.smoke.db.test.ts): one seed document through the application's live extraction config, one model call, the record checked against the fields the document states. Gated like the other intake smokes: it runs only withDATABASE_URLandOPENAI_API_KEYset.
# changed
scripts/publish.mjs --from <dir>publishes the packed tarballs of an earlier--packthemselves, in dependency order, stamping nothing, so the registry receives the bytes the candidate tested and the release manifest's integrities match it. It refuses a directory that is not exactly one tarball per publish target at the release version.- Every published package names its source repository. The release workflow publishes with npm provenance, and the registry refuses a provenance statement for a package whose
repository.urldoes not name the repository the workflow ran in; no package declared one, so the first publish would have stopped at the first package. Each package of the publish set now declaresrepositorywith the repository's URL and its owndirectory, andscripts/publish.mjsrefuses to pack or publish a target, or a--fromtarball, that omits it or names another, before anything is packed or published. - The skill-drift gate holds the CLI help, the CLI reference and the authoring skill to the same commands. Every command
rayspec --helpprints needs a section indocs/cli-reference.md, and every command the authoring skill names in code must be one the help prints. The gate now reads the built CLI, so it needspnpm build. scripts/release-identity.mjs --verifydoes not compare the source side of a manifest generated from a working tree with changes, such as a candidate's stamped tree: the bytes it recorded are gone, and it says so instead of failing on them. Its notes name the release workflow and the signed release manifest that records its digest.- The bundle contract is revision
1.0.0-rc.2, and it states what this release does.@rayspec/bundle-contractcarries the revised contract files and their new lock digest, and every envelope, runtime-control request, snapshot and receipt statescontractVersion1.0.0-rc.2. The verb map listspack --againstand--allowlistas they work, theimportflags--secrets-out,--discard-failed,--cutover-tokenand--renew-cutover-token, andtenant recover-owner, which writes its own JSON object and refuses--json. Each verb's code list is the set its source can report:deployaddsRAY_CHECK_FAILED(a boot that refuses the version it applied) andRAY_FENCE_MISMATCH,resumeaddsRAY_LOCK_TIMEOUT(another operation holds the environment's operation lease), andexportandimportadd the codes of the reader steps their prechecks run again;EXPORT_ERROR_CODESandRESUME_ERROR_CODESfollow. The snapshot categories name the runtime-control tables, the product migration ledger and the owner recovery tokens, and the platform schema head is0017_runtime_control_blob_backend;PLATFORM_TABLESlists every platform table andCONTRACT_PLATFORM_TABLESis gone. The corpus gains three cases: aray.jsonwhose CRC-32 is wrong, a central directory with bytes after its records, and a private-key header whose word holds digits. The verb map definesbundle signin full (its flags, key file and output rules, codes and data) andbundle.signis a result operation; there is noruntime.snapshotoperation, so it is not one any more, and theRuntimeControltype lists the five operations the adapter performs. The deterministic extraction capability,extraction-deterministic, is available and provided by the runtime: runtime-controlinspect()lists it, and a bundle cannot require it. - Every suite that starts a deploy, and
pnpm test:upgrade-with-data, listen on a port the operating system hands out. They no longer derive a port from the process id, which a server left over from an earlier run could still hold; the upgrade script still takes--port. Suites that spawn deploys directly stop every one of them when they finish, also after a failed test. A test inpackages/app/clifails when a suite of the package or the upgrade script derives a port from the process id again. rayspec exportrefuses a source no database barrier can protect before fencing it. Without role separation and without--source-stoppedno database write barrier can hold. The export used to take the fence, drain the source and only then refuse withRAY_EXTERNAL_STATE_UNSUPPORTED(database-barrier-unavailable), leaving it fenced untilrayspec resume. It now refuses with the same code and reason at the precheck, with nothing at the source changed: no fence, no downtime, no receipt in the environment. A barrier that could hold and does not is still refused after the fence. Recorded as a difference from the bundle contract in Export → Compatibility notes.docs/ARCHITECTURE.mdon restores and the boot secrets. It said a new API-key pepper breaks only the copied API keys; the pepper also keys refresh sessions, invite tokens and owner-recovery tokens, which a new pepper breaks just the same. The section now says what each boot secret keys, and separates a backup restore paired with the secrets it was taken under (every credential keeps working) from a portability import (every credential is reset by design). The import guide gains the operator's whole move: dry run, restore and verify, private testing, cutover, the recovery window and why switching DNS back after new writes is not a rollback.- The durable worker holds no transaction across the model call. A run's statements commit as they are made, as on the in-request path, so a run waiting on a slow provider holds no database connection and the worker's pool bounds statements, not runs. One execution per run is kept by a lease on the run's started-once marker (a second dispatch waits for it; an execution whose lease is taken over stops its run), and a recovery re-run of an untainted run first removes what the interrupted attempt left. Consequences: an async run reads
runningwhile it executes rather thanenqueued; a cancelled run keeps the journal steps it wrote before it was ended; a tool's writes commit as they happen, as they always did in-request; and a recovery or second dispatch of a run whose header is already terminalerrorleaves it as recorded instead of running it again (before, only acompletedheader was left alone). - The wall-clock bound ends the run instead of only abandoning it. When
RAYSPEC_AGENT_RUN_MAX_MSexpires the run's signal is aborted, so a backend that honours it stops its provider call, and the run is recorded terminalerrorwith thetimeoutclass. A run that throws is recorded terminalerrorwith the neutral class of its failure; neither reads back asenqueuedorrunningfor ever any more. A same-key retry of a thrown, tainted run therefore replays that recorded failure instead of answering409. - In the hardened posture, starting or cancelling an agent run rereads the membership. With role separation or single-tenant mode on,
agent:runis checked against the live membership row, likestore:writeand the administrative actions, so a member removed or demoted since their access token was minted can no longer start or cancel a run on the token's claim. An API key is unaffected (the key itself is the live credential). Outside the posture the claim is trusted, as before.isSensitivein@rayspec/auth-coretakes the posture as an optional second argument. - In the hardened posture the terminal
errorframe of a streamed run carries a fixed message per class. A run that throws while streaming (Accept: text/event-stream) ends with{ message, errorClass }as before, but with role separation or single-tenant mode onmessageis a fixed text for the class (The run failed.for an unclassified failure), not the thrown error's own text; the platform's timeout and cancellation texts are kept, and the detail is logged server-side. There, an agent definition that does not fit its backend answersAgent spec is invalid for its backend.without the validator's detail, which is logged. Outside the posture both carry the detail, as before. - With role separation every statement of the tenant chokepoint runs under the tenant context. A
TenantDbbuilt on a pool marked with the newrequireTenantContext(the server marks the runtime role's pools whenRAYSPEC_MIGRATION_DATABASE_URLis set) runs each standalone statement in a short transaction that sets the transaction-localapp.current_tenantfirst; a statement on a transaction the chokepoint did not open sets it before it runs. Results are the same; such a statement costs aBEGIN, aset_configand aCOMMITmore (measured locally at about 1.35 ms instead of 0.59 ms for a small read). On an unmarked pool a standalone statement still runs on its own, as before. The invite redemption resolves the invite's tenant from its token hash first and reads the invite through the chokepoint, and the event-bus retention sweep runs once per organization under that tenant's context (TenantDb.sweepEvents); both return what they returned before. - The legacy YAML deploy changes the schema through apply. Every schema change a boot makes (
rayspec deploy <spec.yaml>andrayspec-serve) — the platform migration chain when the ledger is behind the runtime, and each product-store migration — runs as aruntime.applyoperation: under the operation lease, after reconciling any interrupted apply, with receipts, the environment revision raised and, for product DDL, the product schema digest recorded in the same transaction as the DDL. A successful deploy boots and prints exactly as before; a restart with nothing to change takes no lease and writes nothing — unless an interrupted apply is there that it can settle, and not even then when the environment is blocked on a step whose outcome no one can establish: that restart warns, serves the schema it finds, and writes nothing. New refusals, each with a message and its contract exit class fromrayspec deploy(rayspec-servekeeps exit 1): a schema change on a fenced environment (RAY_POLICY_DENIED, 4), a plan made stale by a concurrent change (RAY_PLAN_STALE, 3; the platform chain plans again instead), another operation holding the lease past the wait (RAY_LOCK_TIMEOUT, 5) and an interrupted apply that needs manual reconciliation (RAY_RECONCILIATION_REQUIRED, 6). The chain that first creates the receipt tables on an older database runs as before, under the schema lock.rayspec tenant ensureruns its platform chain the same way (actortenant-ensure), and while the environment is fenced it creates, resolves and migrates nothing: it reportsENVIRONMENT_FENCED, orMIGRATION_REFUSEDfor another refusal of its chain. - Cross-process run cancellation is on under the managed hosting posture. With
RAYSPEC_HOSTING_POSTURE=managedand noRAYSPEC_RUN_CANCEL_POLL_MS, an executing run re-reads its cancellation record every 2000 ms, so a cancellation reaches it in whichever worker process it runs. An explicit interval still wins; the local posture keeps it off unless the variable sets one. - The release script
release:packis nowrelease:tarballs, so that "pack" means onlyrayspec pack. It runs the samenode scripts/publish.mjs --pack; the old name is gone, because no workflow or document used it. The documentation calls extension packs extensions, and so do the messages users see:deploy --check-envnow says "no extension is loaded" and "declares N extension(s)", the boot errors about merged extensions and a missing blob backend say "extension", so do the extension loader's errors (for example "failed to load extension entry" and "is not under the extension'shandlers/directory"), and the example specs, extension manifests, extension sources and build scripts describe themselves the same way. - An unexpected internal failure of the CLI exits 7, not 2, so a script can tell a defect from a usage error. Every other exit code of the existing commands is unchanged.
- Each CLI command loads only its own modules. The entry point now imports a command's module when that command runs, so a light command no longer loads the database layer and the Postgres driver that
plananddev dbneed. bundle verifyderives the manifest fields with the code pack uses. Parsing a bundle's spec and re-derivingrequires, the execution level and the egress hosts moved from the CLI into@rayspec/bundle-closure, unchanged, so the fields pack writes and the fields verify checks come from one function.@rayspec/bundle'sBundleManifestInputnow keeps the members of each manifest kind, so an application manifest withspec,requiresandproductMigrationcan be passed towriteBundlewithout a cast.- The Node floor is now
>=22.21.0. Every package'sengines.node, the root manifest's and the documented prerequisites moved from>=22to the first release on the 22 line that implementsNODE_USE_ENV_PROXY; below it the server's proxy restore has nothing to restore (see the 1.8.0 entry on the env-proxy dispatcher). The runtime check in the server stays, because the new range still admits the whole 23 line, which never got the feature, and because a package manager only warns on an engines mismatch unless it runs engine-strict. CI now installs one exact patch,22.23.3, instead of whatever22resolved to on the day.
# fixed
- The release and certification scripts run when started through a linked path.
scripts/managed-receipt.mjs,scripts/certification.mjsandscripts/check-consumer-install.mjscompared their own URL with the path they were started by, so started through a path holding a symbolic link (macOS keeps its temporary directories under/var, a link to/private/var) they did nothing and exited 0. They, and the new release tooling, now compare real paths. - A schedule the scheduler refuses is refused in the operator's terms. The boot refusal of a cron trigger's
scheduleand ofRAYSPEC_CLEANUP_SCHEDULEquoted the scheduler's own parser text — for a shorthand such as@dailyor a short expression a bareCannot read properties of undefined (reading 'replace'). It now names the trigger or the variable, the value, and either how many fields the value has (a schedule has five, or six with a leading second) or the field the scheduler refuses and its value:its hour field '25' is not a value the scheduler accepts. The check still goes through the scheduler's own parser, field by field. - A registration whose organization is refused leaves no account behind.
POST /v1/auth/registerwith anorgNameand the operator'sPOST /v1/auth/bootstrap-tenantcreated the user first and the organization in a second transaction, so a refused organization — in single-tenant mode, a registration that lost the race for the one organization; on the bootstrap route, a chosen id already in use — left a user row with no organization, and its email taken. The account, the organization and the owner membership are now written in one transaction (OrgStore.createUserWithFirstOrg);AuthService.registertakescreateUserWithFirstOrgin place ofcreateFirstOrg. - A run that hits its wall time ends for its caller at a stated bound. Once
RAYSPEC_AGENT_RUN_MAX_MSfired (or a run was cancelled), run-core waited for the run's event tail and its terminal record without a limit, so on a loaded pool the caller could learn of the end arbitrarily late. That tail now has a budget of 5 seconds (RUN_END_RECORD_BUDGET_MS): the caller is answered no later than the wall time plus the kill grace plus 1 s plus 5 s, and a record that has not landed by then still completes on its own connection, logged if it fails. See Bounded execution. - A document whose bytes hold a NUL character no longer leaves its workflow running for ever.
file_input.parse_textpassed text containing U+0000 — what an executable or an archive uploaded under a text or PDF type decodes to — to the next step; PostgreSQL refuses that character in a JSON value, so the step's journal write failed on every attempt and the run stayedrunning, which also kept the deployment from being exported (unreconciled-effects). The parse now fails such a document closed with the terminalfile_text_contains_nul, on the text and the PDF path. - A runtime refuses a database a newer runtime migrated. An older runtime found a platform ledger with migrations it does not ship, applied nothing and served that schema silently. The boot (and
rayspec tenant ensure) now refuses it, under the schema lock and before anything is applied, with a message that names the cause, and leaves the database unchanged. This protects from 1.9.0 on: a 1.8.x runtime does not have the check and boots on a database 1.9.0 migrated. - A durable worker's shutdown no longer hangs after an outage of the workflow database. While the workflow engine reconnected its notification listener,
executor.shutdown()in@rayspec/durable-dboscould wait for ever on the connection the reconnect held, retry the reconnect every second for ever, or raise an uncaught "Release called on client which has already been released" when the listener failed as it closed. Once the running workflows are drained, the close of the system database now releases a listener a reconnect publishes, clears a reconnect it arms and absorbs a late listener error, and it is bounded by the new optionalsystemDatabaseCloseTimeoutMs(default 10 s, exported asDEFAULT_SYSTEM_DATABASE_CLOSE_TIMEOUT_MS): past it,shutdown()rejects with the reason instead of never returning. - Shutdown no longer waits for ever on an open connection. A request that never completed (a stalled upload, an event stream, half a request) kept a stopping server alive indefinitely; the drain above bounds it.
- A boot that refuses leaves the database untouched. The server applied the platform migration chain before it parsed the injected spec and the signing key, so a deploy with an invalid spec, a Product-YAML document outside the boot scope or a malformed
RAYSPEC_JWT_SIGNING_KEYstill created every platform table in an empty database before it refused. The key and the document are now validated first, with the same refusals as before; a valid deployment boots exactly as it did. Every other refusal the deploy can decide from the configuration and the document is made before the platform chain runs too, with the same message. For a backend spec, with its extension packs loaded and merged: a stream route without a blob root, a playback route without a valid media signing key, an unsupported STT or TTS provider or a missing credential for one, an unreadableRAYSPEC_FS_SOURCE_ROOT, a frontend mount with nothing to serve, a cron or manual trigger withoutRAYSPEC_CRON_TENANT_IDor with no durable worker to fire it (nodeployment.durableWorker, or no agent backends supplied), a cron schedule the scheduler cannot parse (a new refusal: it failed only when the worker launched), an agent whose backend the deployment does not build, and whatever the deploy itself refuses — the merged document, a handler module that does not load, a route under a reserved prefix, a store table the registrar did not admit — which the boot finds by rehearsing the deploy with no migration to apply. For a Product-YAML document: its deployment tenant (RAYSPEC_PRODUCT_TENANT_IDset, an org id, and naming a live org; on a database without the platform tables no org exists yet, so that refusal comes first), a reviewed update delta and its allowlist, a blob root, a media signing key, a readableRAYSPEC_FS_SOURCE_ROOT,RAYSPEC_MEDIA_PREP, the extraction mode, the speech provider, the responder and the normalizer with their sidecar configurations, a deployment's model-call factory, and the composed deploy, rehearsed the same way. What is left after the first write depends on the database: the platform chain and the source fence, the live product schema (its drift, the update plan, and so whether a reviewed delta is applied and gated), each migration's apply, the post-update drift gate, and the durable worker's launch. - A server no longer exits when its workflow system database is briefly unreachable. DBOS's scheduler started each scheduled workflow from a loop that did not catch: when the workflow system database refused a connection at a scheduled instant (a failover, a restart, a database not accepting connections), the rejection went unhandled and the process exited with code 1 — and every server with a durable worker schedules at least the system cleanup. Scheduled workflows (cron triggers and the system cleanup) now run on a loop of the runtime's own with the same instants, workflow ids, modes and make-up watermark; an instant that cannot be started is reported once and retried, the server stays live and reports not ready, and the schedule fires again once the database is back. A trigger without make-up work does not fire the instants missed meanwhile; a catch-up trigger makes them up.
GET /healthanswers when the database hangs. Its database round trip had no time bound, so a database that stopped answering (rather than refusing connections) left the probe without an answer. It is now bounded like the other readiness checks (2 s) and reportsdb: unreachablewith 503. The boot banner's route list is unchanged; it does not listGET /livez.- Every schema change takes one lock. The boot's platform migration chain took no lock, so a boot racing another boot or a
rayspec tenant ensureagainst an empty database could die on a duplicate object. The chain, product-store DDL andtenant ensurenow all take the one shared advisory lock (pg_advisory_xact_lock(1918990707, 1), the pairtenant ensurealready used), with a bounded wait: a boot that waits longer thanRAYSPEC_SCHEMA_LOCK_TIMEOUT_MSrefuses with a retryable error and changes nothing, andtenant ensurereportsSCHEMA_LOCK_TIMEOUT. - The documented test run passes on a fresh clone. The shutdown test for the example
dev-boot.mjswrappers forwardedRAYSPEC_JWT_SIGNING_KEYandRAYSPEC_API_KEY_PEPPERonly when they were exported, so without a.envthe wrapper it spawns aborted on the missing secrets and three tests failed. It now generates a throwaway key and pepper for whichever is absent and still passes an exported value through, which is how CI runs it. pnpm testreports every failing package. The root script stopped at the first failing package task, which left the packages scheduled after it unrun and unreported. It now passes--continue, so every package runs, and the command still exits non-zero when any failed.- The local Postgres is the one CI tests against.
docker-compose.ymlpulled whateverpostgres:16resolved to on the day. It now pins the same multi-platform index digest as CI's service containers, which serveslinux/amd64andlinux/arm64alike. - CI no longer lists a push trigger for a branch that no longer exists.
# documentation
- Releasing is the maintainer runbook: what a release ships, building and testing a candidate, verifying a release, publishing, and what to do when a release fails.
- The runtime image describes the image, running it, and the host settings it needs.
docs/cli-reference.mddocumentsrayspec init, which the CLI help listed and the reference did not.CONTRIBUTING.mdstates what a complete local test run needs: the Node and pnpm versions, Docker for the pinned Postgres, the two database URLs andRAYSPEC_REQUIRE_DB_TESTSin the environment,ffmpegfor the media suites, and that no boot secret has to be set.
# security
- With role separation, no process that runs application code holds the migration or snapshot connection.
rayspec deployandrayspec-servenow act as a supervisor: the process the operator starts re-executes itself (process.execve) to clear the privileged connections from its own environment block, reads them from a one-time handoff file it removes before any child exists, never imports application code (a module-resolve guard enforces it), and serves the application in a child process started with an environment that never held them. Every schema change of the boot — the platform migration chain, row-level isolation, each product migration, the workflow system database, a bundle apply — runs in the supervisor, which generates the product DDL from the document itself and re-gates a reviewed delta rather than running SQL the child sent. The serving child holds the runtime role alone and learns the export fence from the database as before. So application code can no longer reach the migration role's connection through the process's environment block, through interception of the database driver before the schema work, or over the channel to the supervisor — it cannot bypass row-level security or lift the export fence. Runtime control that needs privilege (rayspec export's write barrier and snapshot,resume,import) runs in the operator's CLI, which imports no application code either. Signals, readiness, graceful drain, exit codes and the one--jsonenvelope are unchanged; a crash of the serving child makes the supervisor exit non-zero and say so; a serving child whose supervisor is killed (an OOM kill,kill -9) stops at once, without a drain, as the single process did, so a restarted deployment never runs beside it; single-role mode (no migration URL, even with a snapshot URL) runs one process exactly as before. A wrapper that callsassembleServerin process with the migration connection (examples/local-boot, deployments/acme-notes) boots as before and warns that the application code it imports can reach the migration role. One gap depends on the operating-system user: when the supervisor and the child run as the same user, a_FILE/.envthe supervisor can read, its memory on a kernel without Yamaptrace_scope≥ 1, and a core file it can be made to write are readable by the child; the managed posture refuses to boot while any is open and names it, and every other posture warns (the entrypoint sets a zero hard core-file limit through/bin/shwhere one exists).@rayspec/serverexports the supervisor (superviseServing,sameUserConditions), the child's channel (connectToSupervisor) and the re-execution (reexecWithoutPrivilegedConnections,takeSupervisorHandoff, the@rayspec/server/supervisor-handoffsubpath);withholdPrivilegedConnectionsandPRIVILEGED_CONNECTION_VARSkeep their names. The certification lane proves it through the real CLI under theprivileged-credentialscheck. Closes the contract's release-blocking "unprotected privileged credentials" and "bypassable migration fence". - In the hardened posture a stream handler no longer receives the caller's credential. With role separation or single-tenant mode turned on, the Web
Requestastreamroute handler is handed (init.request) no longer carriesauthorization,proxy-authorizationorcookie, and a playback handler's request URL andparamsno longer carry the?token=media token. Every other header and the body arrive unchanged; the caller isinit.principal. Without either setting the handler sees the request as before. The platform exports the view aswithoutCredentialsand the header list asCREDENTIAL_REQUEST_HEADERS;createAuthApptakeshardenedPosture, which turns on every check of the posture listed here. - In the hardened posture a playback token stops working once its user is no longer a member. With role separation or single-tenant mode on, the media-token check also rereads the token user's membership in the token's organization on every request, so a member removed after the mint loses playback at once instead of at the token's expiry (up to 24 hours). Outside the posture the token alone decides, as before.
- With role separation, one tenant's row cannot reference another tenant's row. A store foreign key onto a parent's
idis checked by Postgres without regard to tenancy, so a create or update naming another tenant's parent id was accepted. Under role separation the same-tenant trigger refuses it as a validation error, exactly like a parent that does not exist. A single-role deployment is unchanged. - An install of the published packages no longer resolves the vulnerable
honoand top-levelundici. The rootpnpm.overridesmoved both inside this repository, but a consumer'snpm installnever sees those overrides: it installs the exact versions@rayspec/serverand@rayspec/api-authdeclare, which werehono4.12.27andundici8.9.0, both inside advisory rangesnpm auditreports (honobelow4.13.5,undici8.0.0to8.10.1). The declared versions are nowhono4.13.9andundici8.11.2, and the overrides name the same versions, so the workspace tests what a consumer installs. Annpm auditover the packed tarballs installed into an empty directory drops from 10 findings to 8, with nohonofinding and none against the top-levelundici. - The workspace lockfile is clear of the advisories published against
brace-expansion,fast-uriandip-address. The root overrides move tobrace-expansion5.0.12,fast-uri3.1.8andip-address10.7.2, the first versions outside every reported range, and the dependency SBOM is regenerated. The threebrace-expansionadvisories also match the5.0.6copy inside the Pi SDK's shrinkwrap, which no override reaches; the newest Pi SDK release checked,0.99.1, pins5.0.9, which they cover as well. The consumer scan lists them next to the entries below, with the same expiry. - Still open for consumers: advisories against three packages pinned by
@earendil-works/pi-coding-agent, 22 in all (15 againstundici, 6 againstbrace-expansion, 1 againstprotobufjs).@rayspec/adapter-pidepends on@earendil-works/pi-coding-agent0.79.9, which ships annpm-shrinkwrap.jsonpinningundici8.5.0,brace-expansion5.0.6andprotobufjs7.6.4. npm installs a dependency's shrinkwrap as written, so neither a pin in a RaySpec manifest nor the workspace overrides reach those copies.0.86.0is the first release that moves all three pins (undici8.10.2,brace-expansion5.0.9,protobufjs7.6.6); it clears every one of these advisories except the threebrace-expansionones above, which cover5.0.9as well. Moving to it is a dependency bump of the Pi adapter across several breaking releases of the Pi SDK, including the removal of theAuthStorageexport the adapter uses, and is left to its own change. Inside this repository pnpm ignores the shrinkwrap and the overrides already resolve fixed versions. - The workspace audit is clear of the advisories published in early September. The root overrides moved
honofrom4.12.34to4.13.5andfast-urifrom3.1.5to3.1.6(both moved again by the entries around this one, to4.13.9and3.1.8), and a new override pins the transitiveqsat6.16.0.vitestmoved from4.1.9to4.1.11in every manifest that declares it. Workspace and lockfile only; what a consumer installs is thehonoentry above. - The workspace dependency audit passes again. Advisories published since the last release cover
fast-uri3.1.6(two, fixed in3.1.7) andip-address10.3.1(two, fixed in10.5.1), the versions the root overrides pinned, so the osv-scanner audit ofpnpm-lock.yamlfailed. The overrides now name the first fixed versions. A consumer install was not affected: npm resolvesfast-uri3.1.8andip-address10.7.2there. - CI now audits the release the way a consumer installs it. The audit of
pnpm-lock.yamlcould not see the Pi SDK advisories above, because no consumer installs from that file and a dependency's own shrinkwrap never enters it. A new CI step packs the release closure, installs it with npm into an empty directory (scripts/check-consumer-install.mjs), imports every package's entry point there, and scans the resultingpackage-lock.jsonwith the same pinned osv-scanner. The shrinkwrap advisories are recorded inosv-scanner.consumer.tomlas exceptions that expire on 2026-10-31, each naming the Pi SDK release that fixes it, so the step turns red again unless the adapter has moved by then. The step also lists every dependency of a RaySpec package that the consumer tree holds in two versions; today that includeshono(4.13.9for@rayspec/serverand@rayspec/api-auth, the newest4.13.xfor the@hono/*packages that take it as a peer).
# upgrade notes
Everything below is documented in place above; this is the checklist, and Upgrading to 1.9 walks through it with the action for each item. A deployment that upgrades and sets nothing new keeps working as it did: role separation, row-level security, single-tenant mode, the managed posture and the execution bounds are all opt-in, a YAML deploy boots and prints as before, and every existing command keeps exit codes 0, 1 and 2 for the outcomes it had. The first items apply to every deployment; the rest only once you turn something on, deploy a bundle, embed the packages or parse what the runtime writes.
- Node
>=22.21.0. Every package'sengines.nodemoved from>=22. A package manager only warns on the mismatch unless it runs engine-strict, so check the Node a host runs before upgrading; CI and the runtime image use22.23.3. - The first boot runs six platform migrations,
0012to0017. Each is additive: five new global tables (runtime_control_stateandruntime_control_receipts,runtime_control_processes,product_migration_ledger,owner_recovery_tokens), one nullable column (0017_runtime_control_blob_backend), and0015_tenant_row_security, which only creates policies and functions and enables nothing, so a deployment that does not setRAYSPEC_MIGRATION_DATABASE_URLruns exactly as before. The chain runs as aruntime.applyoperation under the operation lease and writes receipts. There is no downgrade after this boot: a 1.8.x runtime does not detect a database 1.9.0 has migrated and boots on it, so going back must start from the backup taken before the upgrade. Only 1.9.0 and later refuse a database a newer runtime migrated. - The legacy YAML deploy can refuse a schema change it used to make. A schema change on a fenced environment (
RAY_POLICY_DENIED, exit 4), a plan made stale by a concurrent change (RAY_PLAN_STALE, 3), another operation holding the lease past the wait (RAY_LOCK_TIMEOUT, 5) and an interrupted apply that needs manual reconciliation (RAY_RECONCILIATION_REQUIRED, 6) are new outcomes ofrayspec deploy <spec.yaml>;rayspec-servekeeps exit 1. A deploy that changes nothing takes no lease and writes nothing. - An unexpected internal failure of the CLI exits 7, not 2. A script that treated 2 as "any failure" also treats 7 that way.
- Log lines and error messages are redacted. A line or message that carried a credential shape (a bearer token, a credential header, a URL password, a key) or a value the process holds as a secret now carries
[redacted]in its place. A log parser that matched on such a value matches on the name around it instead. Messages also say "extension" where they said "pack" (for exampledeploy --check-env's "no extension is loaded"). - Agent runs report their state more exactly. An async run reads
runningwhile it executes rather thanenqueued; a run that throws, or hitsRAYSPEC_AGENT_RUN_MAX_MS, is recorded terminalerrorwith its class, so a same-key retry of a thrown tainted run replays that failure instead of answering409; a cancelled run keeps the journal steps it wrote before it ended. A client that polled forenqueuedor retried on409follows the recorded state instead. - Bounded execution: what changes without the managed posture. Nothing is bounded that was not before, with two exceptions that are unsafe for everyone: a codex child that ignores
SIGTERMis killed afterRAYSPEC_AGENT_KILL_GRACE_MS(default 5000), and the durable worker no longer holds a database transaction for the length of a run.RAYSPEC_AGENT_RUN_MAX_MS, when set, now aborts the run's call and records a terminal outcome. An unusable value of a variable the execution policy adds refuses the boot. - The anthropic backend's child process no longer inherits the whole server environment. It is started without the other providers' keys, every
_FILEvariant, the database URLs (DATABASE_URL,SHADOW_DATABASE_URL,DBOS_…,PG…) and everyRAYSPEC_…andCLOUD_…setting, in every posture: handing a model client the database credentials was unsafe for every deployment. Its own two credentials, proxy settings and everything else are passed as before. - The openai backend no longer registers its key or client as the agent SDK's process-wide default. Each backend instance uses its own client, so two backends with different keys cannot send each other's. Code outside RaySpec that relied on the default being set by RaySpec must set it itself.
- Changing the API-key pepper also invalidates refresh sessions, invites and owner-recovery tokens, as it always did for the first two; the architecture guide said only API keys were affected. Use
RAYSPEC_API_KEY_PEPPER_PREVIOUSto rotate without that effect. - Nothing about the hardened posture changes unless it is turned on. Without
RAYSPEC_SINGLE_TENANTthe number of organizations is not limited and registration stays open; withoutRAYSPEC_MIGRATION_DATABASE_URLone role migrates and serves. With neither set, every authorization check and error message behaves as before. With either setting on:agent:runrereads the membership; a queued agent run is re-checked when it starts (a run enqueued before the upgrade carries no requester and runs as before); a playback token needs a current member; streamed error frames and the invalid agent-spec answer carry fixed messages; and a stream handler no longer sees the credential headers or the playback?token=— a handler that read the caller from them readsinit.principalinstead. See Hosting in the hardened posture. - Turning role separation on for an existing deployment means running the setup SQL on its databases, setting the two URLs and restarting; see Database roles and row-level security. The quiesce barrier
database-write-roleneeds the runtime-control adapter's connection to be the migration role's. - With role separation,
rayspec deployandrayspec-serverun as two processes. The process you start supervises and holds the migration role; the application runs in a child under it. A process manager still starts, signals and watches the one process it started. Pass the migration and snapshot connections in the environment, not as_FILEor in a.envfile. - Under
RAYSPEC_HOSTING_POSTURE=managedevery handler declaresuses(an empty list for a handler that uses no optional capability); a deployment using the anthropic, codex or pi backend, or a fake speech provider, does not boot (boot it without the posture, or move the agents toopenai); the execution policy's defaults apply; and on Linux the boot refuses a host where the child could read the supervisor's memory or make it write a core file: setkernel.yama.ptrace_scopeto 1 or more (Docker Desktop's VM kernel has no Yama at all, and RHEL/Fedora-style kernels default to 0), and keep/bin/shin the image or start with a hard core-file limit of 0 (docker run --ulimit core=0). Every other posture boots and warns instead. See Hosting in the hardened posture → Turning it on. rayspec deployof a.rayfile is a new path. It used to read the file as YAML. Now a.rayname, in any case, or a file that starts with a ZIP signature is deployed as a bundle, reads no.envfile, and needsDATABASE_URL,RAYSPEC_API_KEY_PEPPERand, for a schema change,SHADOW_DATABASE_URLin the process environment. A YAML spec deploys exactly as before.- A bundle deploy hands bindings over differently. The bindings file may supply only names the bundle declares (plus the selected speech provider's key); any other name is refused with
RAY_USAGE. A provider key it supplies is no longer written into the process environment: it goes to its adapter alone. The application's own names are still written there, and are also available to handlers asinit.bindings.get(name). - A bundle pins its runtime. After upgrading the CLI, repack the application with the new release before deploying it; a bundle packed for another runtime version is refused with
RAY_RUNTIME_UNSUPPORTED. - The first bundle deploy onto an environment a YAML deploy created plans against the product tables that deploy made. When those tables were created before the product migration ledger existed, a bundle that only matches them, or only adds whole stores, deploys; a bundle that carries a product delta is refused until one change through
rayspec deploy <spec.yaml>has started the ledger. rayspec exportof an application that loads extensions is refused (unsupported-blob-adapter) until the deployment has had one bundle deploy with this release, which records the blob backend in the column0017adds.- Version directories are read-only. Remove one that is no longer active with
chmod -R u+w <dir> && rm -rf <dir>. - For maintainers: the release script
release:packis nowrelease:tarballs.
# added
lintSuppressnow docks on atriggers[]and ahandlers[]node too. The key arrived (see below) on agents, stores and api routes; on a trigger or a handler it was not ignored but a hard parse error (unknown_field) that broke the document — which put the two advisories an author is most likely to have reviewed out of reach:cron_tenant_required, reported on acron/manualtrigger, andtypescript_handler_module, reported on a handler whosemoduleis TypeScript source. Both node kinds now take the same[{ code, because }]list under the same fail-closed rules (the code vocabulary contains no error codes, and an empty or whitespace-onlybecauseis rejected at parse), with the same node scope — a suppression filters only advisories whose path lies under its own node — and the samestale_suppressionrot detector, which names the trigger by itsnameand the handler by itsid. An acknowledgement records a reviewed decision and quietsdoctor; it changes no enforcement.doctormoves the finding fromwarningstosuppressedwith the justification and the finding's path. Nothing else consults the list:rayspec planreports the raw advisory pass, so an acknowledged finding is still listed in itsspecWarnings; a document declaring a cron or manual trigger still aborts the boot whenRAYSPEC_CRON_TENANT_IDis unset; and the deploy loader still loads compiled JavaScript only, so a.tsmodule still needs its build step. The plan reference and thePlanResultfield doc now state that divergence rather than claiming the two commands report the same entries. The field is optional with no default, so a document that declares no suppression parses byte-identically. The exported JSON-Schema artifactsspec.schema.jsonandversion-1.0.schema.jsoncarry the key on both new nodes;product.schema.jsonis byte-unchanged (the product profile declares neither section).absent_state: not_found_404— a view can now answer an unknown reference with a 404. The member decides what asingleread serves when it matches no row:404 { error: 'not_found', detail }alongside the existingempty_200(the declaredread.absentDTO at200) andnot_ready_409. Neither existing member has ever produced a 404, and until now there was no way to say that a reference does not exist at all. Which member is correct is decided by when the backing row appears, not by the view — the read sees zero rows either way.not_found_404fits a read model whose row exists from the moment the reference is valid: a catalog or reference store materialized before any workflow runs, or a store written at acceptance. It is wrong for a store that a workflow step writes, because there an absent row is a job that has not finished, and a 404 would tell a polling client that its reference does not exist. The reference page and the views-runtime README now state that precondition next to the vocabulary, and lint rejects the declarations that cannot mean anything:not_found_404together with aread.absentshape (a fixed error body leaves nothing to project) andnot_found_404on alist/collectread. Thedetailon the 404 is a constant string and carries nothing derived from the request. What makes that hold is where the body is built: a view returns its response from the interpreter and the route layer serializes it verbatim, so it does not pass the auth-core error chokepoint that stripsdetailsfrom a 404 — there is no later stage that could remove an echoed path or filter value, so none is put in. The status choice leaks nothing either way: the read is tenant-bound, so a foreign row and an absent row both yield zero rows and take the same arm under every member. Nothing a view answers changed. This is a vocabulary addition, not a migration: no shipped example or fixture document was touched, all 24absent_statedeclarations in the shipped example and fixture documents still readempty_200ornot_ready_409, and both existing members behave exactly as before. The dispatch around them did change, so a 1.7.0→1.8.0 diff shows all three arms as new text rather than one arm added: the interpreter and the OpenAPI emitter no longer testabsent_statewith anif-chain ending in anempty_200fall-through — each looks the member up in one map annotatedsatisfies Record<ViewAbsentState, …>. That annotation is what makes a fourth member a build failure instead of a silent 200: both files are non-test modules undersrc/, which the package tsconfig includes while excluding**/*.test.ts, and the package'stypecheckscript istsc -p tsconfig.json --noEmit.- A boot warning when a served page carries an inline
<style>/<script>/style=/on*=that the active Content-Security-Policy does not permit. The default policy for a served frontend isdefault-src 'self'with no'unsafe-inline', and a page that violates it fails in a way nothing on the server side shows: the response is200, the bytes are exactly what the build produced, and only the browser applies the policy. It need not say so there either — a refused inline<style>can produce no console message at all, which is why the warning tells the reader the browser console is not a way to check this. The signal now arrives at boot, naming the file. It rides the pass over the declared mounts that already runs once per boot to compute what/healthreports asfrontend, so no/healthrequest re-reads anything, and it covers both boot shapes that servefrontend[]mounts — the static (frontend-only) profile and a full-backend boot — because both stamp the same headers on mount responses. It is warn-only and cannot fail a boot, and what makes that true is that the scan's only product is a string handed to the boot's warn sink that no caller reads back — the readiness/healthreports is computed without it — while every filesystem call it makes is individually wrapped, so an unreadable directory or file is skipped rather than raised. Serving a page the policy blocks is a deployment's choice, andRAYSPEC_FRONTEND_CSPis how it overrides the baseline. It judges the page against the active policy, not the shipped default: a policy that carries'unsafe-inline'for the directive governing a shape says nothing about that shape, and a policy governing none of them is not scanned at all — the four shapes are resolved through their own CSP fallback chains (style-src-elem/style-src-attr/script-src-elem/script-src-attr→style-src/script-src→default-src), and the warning names the directive that decided. Nothing about its reach is left implicit. The bounds: at most 200 HTML files per boot across all mounts, at most the first 1 MiB of any one file, at most 5 offending files named (the rest are counted). Each of the three appears in the message when it truncates — the file-count line is printed off the file the scan actually DECLINED to open, not off the budget being spent, so a build of exactly 200 pages is never told anything was skipped. The fidelity: it is a heuristic text scan, not an HTML parser — it strips comments, skips<script>/<style>bodies as raw text, and reads attributes off start tags (every start tag, so anon*=handler on a<script src=…>is reported like any other element's), but markup quoted inside an attribute or a string can still be named and unusual markup can be missed. It also computes no hashes, so a policy carrying a hash or nonce source is treated as permitting that shape. The message says all of this in the same breath as the finding. The coverage: the walk runs the mount's own three request-path checks as it goes, so it does not name a page one of them refuses — a dot-segment path, a symlink whose real path escapes the served directory, and, under a/mount, anything beneath the reserved/v1,/healthand/oidcnamespaces, which the mount declines before the file server ever runs. An in-tree symlink it does follow, because the mount serves those. It is not a fetch, and the converse is not claimed: clearing those three checks is not a proof that the page resolves. (Issues #355, #345, #313.) GET /v1/subscribe— an SSE subscription over the tenant event stream, with a resume protocol that cannot silently drop frames. The emit half gave a handler somewhere durable to announce a change; this is the half a client reads it back from, so a workspace UI holds one connection open instead of polling. It is a platform route (nothing declares it), on the same authenticated chain as every other route, gated by a newevents:readpermission — granted to owner, admin and member, and grantable on an api-key. That permission is deliberately not a reuse ofstore:read: an event payload is whatever a handler passed toinit.emit, so it can carry values from capabilities no declared store route serves, and folding it in would have retroactively widened every api-key already minted with that scope. It is not added to the OIDC scope list. The route serves whenever the deployment enabled the bus (deployment.eventBus.enabled, or structurally on a product deployment) and answers a clean501naming the key to set when it did not — never a404, and never an empty stream that reports itself healthy. What a subscriber observes: a data frame carriesid:(the cursor),event:(the author's topic) anddata:(the payload as JSON); a control frame carries noid:, which is the discriminator and is structural rather than nominal — a topic is author data, so a handler could emitrayspec.truncateditself, but it could never emit a frame without a sequence number, and a control frame therefore can never come back as a cursor. There are two:rayspec.live(your backlog is drained) andrayspec.truncated(your cursor is older than retention; it carries the floor, and the stream resumes there). The event timestamp is deliberately not on the wire — it is not monotone withseq, so shipping it would only invite clients to sort by it. The cursor is<tenant_id>:<seq>, not a bare number, and arrives either as the standardLast-Event-IDreconnect header or as?since=: a sequence means something different in every tenant's stream, so an untagged cursor would resume silently at the wrong place after an org switch. Four cursor shapes are refused with a400rather than served — a malformed one, one tagged with another tenant, a sequence that is not plain decimal digits (a hexadecimal, exponent, fractional, signed, padded or empty one is refused rather than coerced, since coercing resumes the subscriber somewhere it never asked for while looking successful), and one ahead of the stream. ALast-Event-IDthat is present but empty is none of them: anEventSource's last-event-ID string starts empty, so an empty header says exactly what an omitted one says, and it is read as absent — a?since=sent beside it still applies. That is the empty string and nothing wider: a header carrying any other value, including one made only of characters HTTP does not count as whitespace, is checked against the four refusals like any other cursor. Omitting the cursor starts at the tail and is not a truncation, however old the stream's floor is. Omittingtopicsmeans every topic; an explicitly empty?topics=is a400, because an empty filter can only match nothing and that is indistinguishable from a healthy stream on a quiet workspace, and a filter naming more than 64 topics is a400as well — a documented bound on the filter rather than one a client discovers by being refused. Each read takes the events above the cursor together with the stream's retention floor from one snapshot, so a subscriber can never be told its cursor is fine about events that are already gone, and the floor is re-checked on every read rather than once at connect — a connection held open for hours can outlive the retention of its own unread history. Delivery is immediate: the emitting transaction wakes the process's one listener, which fans out in memory. Each subscriber also reads on its own interval, and that timer is on by default — a departure from this project's posture that interval knobs are opt-in, made deliberately because a wake is a hint that can be missed (a listener reconnect, a deployment that wires none), and an opt-in backstop would mean the default posture loses events until somebody notices. The same timer is the SSE heartbeat. The server closes a stream after a bounded lifetime — the access-token TTL — and the client reconnects. Permission is middleware, so it is checked once at connect; the reconnect is a fresh request through the whole chain, and that is what makes a revoked principal stop receiving events. No second, bespoke mid-stream authorization path exists. Because that close is the server's own, the route also puts the resume position on the wire before it can happen: anEventSource's last-event-ID string starts empty and is set by nothing but anid:, and control frames carry none, so a subscriber on a quiet workspace would otherwise reach the cap holding no cursor, reconnect withoutLast-Event-ID, and be started at a freshly probed tail — skipping everything emitted in the reconnect gap whilerayspec.livereported the backlog drained. A resume checkpoint (anid:line and nothing else, which the event-stream grammar defines as a cursor update that dispatches no event) is written whenever the cursor moves without a delivery, so the cap costs a round trip and no events. The stream also states the reconnect delay itself, as an SSEretry:field (one second) written before its first frame: the close is the server's own, so how long the client waits before coming back is the server's decision rather than a per-client default — and those defaults differ, which would otherwise make the same deployment resume at a different speed in every browser. There is no WebSocket surface, and none is planned: SSE plus a durable cursor covers the case, and the durable rows — not the connection — are what make a resume correct.examples/live-workspace-eventsis the whole loop in one bootable document. One change to the emit side comes with this:init.emitnow refuses a topic carrying a line break, naming the reason. A subscriber receives the topic as the SSEevent:field, whose grammar cannot carry one — so such a row could not be delivered at all, and the stream would die on it and die again on every reconnect that resumed from the cursor in front of it, silencing that tenant permanently. Multi-line content belongs in the payload, which is stored and served verbatim.- A tenant-scoped event bus:
deployment.eventBusturns oninit.emit(topic, payload), a durable per-tenant event stream a route or tool handler appends to. Everything real-time in RaySpec was scoped to a single agent run, so a product whose UI is driven by everything happening in a workspace had no transport to carry it and each one rebuilt the same polled events table in product code. A deployment that declaresdeployment: { eventBus: { enabled: true } }now gives everyhandler-kind route init, and the tool inits of an in-request agent run, anemit(topic, payload)capability; a product-profile deployment has it structurally, with nothing to declare. Presence follows theblob/enqueueposture exactly: without the declaration the field is absent (notundefined-valued), so a handler that needs it fail-closes loudly rather than dropping events into a silent no-op, and astream-kind route init and a trigger init do not carry it (the same boundaryfsSource/stt/ttsalready draw). Neither do the tools of an enqueued run (async: true, or a trigger whose action iskind: agent): the durable worker runs a whole run inside one transaction, and an emit allocated there would hold the tenant's sequence lock until that run committed, so the bus is not threaded into the worker's tool inits at all. The capability is tenant-bound by construction — it is built per request from the run's server-derived tenant and has no tenant parameter — and it is positional, so a mis-call in the shape the siblinginit.enqueuetakes (emit({ topic, payload })) is refused with a named error stating the expectedemit(topic, payload)shape, never a 404 and never a corrupt row. What a consumer of the stream may rely on: every event carries a per-tenant sequence number; the order numbers are issued in is the order the writes commit in, so a reader resuming withseq > cursorcannot skip an event that committed late; the sequence is gap-free (a request that rolls back returns its number and the next emit reuses it); and on a route handler the events commit with the handler's own writes, so a reader never sees an event announcing a change it cannot yet read. A tool's emit is a standalone statement on a plain handle, so each is durable as it returns. Two platform tables ship with it (tenant_events,tenant_event_streams, migration0011), both cascading on org delete and both now reserved store names. Events are kept forretentionHours(default 24) and swept by the daily housekeeping pass that already runs the OIDC prune — an approximate bound, and deliberately so: nothing is deleted inside a product request, so a tenant's oldest events can outlive the declared window, and a bursting tenant can exceed its nominal size, until the next pass. That pass runs on the durable worker, so a deployment that enables the bus withoutdeployment.durableWorker: trueemits and serves exactly as described but never sweeps — the stream then grows for as long as it lives, and the boot says so in one line rather than leaving the declared window looking like a bound. (A product-profile deployment always has the worker, so it always sweeps.)seqis the only ordering authority the stream has; theatcolumn is display only and is not monotone withsequnder concurrency (it is transaction-start time while the number is issued at flush), so ordering or windowing a query by it reorders and drops events. This entry is the emit and storage half; the subscription surface it exists to feed (GET /v1/subscribe) is the entry above. cleanUrls: trueon a frontend mount — extensionless URLs resolve to<path>.html, so a generated multi-page site arrives with working links. A static mount resolved a directory to itsindex.htmlbut never tried<path>.htmlfor an extensionless request, so a site whose navigation links/docs/getting-startedwhile the built file isdocs/getting-started.htmlanswered404on every such link — the default output shape of common static site generators, and a shape Netlify, Vercel and GitHub Pages all resolve. The only mount knob wasspa, which is not a substitute and is worth naming as a trap here: on a multi-page site it turns every broken link into a200carrying the root document, so link checkers, uptime probes andcurlall pass and the site is wrong only to a reader. The new third mount option resolves the extensionless form instead: the exact path when it is a file, then<path>.html, then<path>/index.html, then — only whenspa: true— the SPA fallback, then the mount root's404.htmlor the uniform404. The two options are ordered rather than exclusive, so a mount may set both and each keeps its own promise: a deep link that has a page gets that page, and only a path with no page at all reaches the shell.404therefore stays the terminal outcome for everyspa: falsemount — the distinctionspa: truenecessarily destroys — and the option is fail-closed in the same two senses as the rest of the module: the<path>.htmlcandidate runs the same dotfile / traversal / symlink-escape guard as any other served path, and the range, method and reserved-namespace guards all still run first. Extensionless is the exact domain, which is what makes that terminal404worth having: a path whose last segment carries a.names a typed asset (/app.js,/data.json) and is never rewritten, so afetchfor a file that is not there still gets a404rather than200 text/htmlfrom a<name>.<ext>.htmlsibling — while a dotted directory on the way (/guide/1.2/notes) still resolves its page, since only the last segment decides. It is opt-in (defaultfalse), so no existing deployment changes behaviour — and two behaviours change for a site that opts in. Where both<path>.htmland<path>/index.htmlexist for the same path, the.htmlfile now wins where the directory index served before (.htmlis tried first, the order the hosts above use). And on a mount that ships a root404.html,/404is an extensionless path like any other, so it now serves that page with200. What that displaces depends onspa, since the SPA fallback precedes the404.htmlbranch: on anspa: falsemount the miss branch answered the same bytes with404, so the status flips, while on anspa: truemount the shell already answered/404with200, so the document flips and the status does not. Either way it is the same parity with those hosts, all of which serve/404as a page, and the reason the status is not "fixed" back to404. A trailing-slash request (/docs/) is unaffected and still resolves the directory index. The option is echoed in thedeploy --dry-runverdict for both the static and the backend profile, so the preview names the resolution boot will use, and the static profile's boot banner marks a mount that sets it. One source-level note for anyone building against the tree in TypeScript:FrontendSpecis the parsed mount type, and a key with a schema default is required on it (this is whyspawas already required there), so a hand-writtenFrontendSpecliteral now needscleanUrlsas well. Nothing about arayspec.yamldocument changes — the key stays optional in YAML and defaults tofalse— and no runtime behaviour changes; it is only literals written in TypeScript against the parsed type that gain a key. The mount literals inside this repository's own tests are updated to match.- Speech synthesis reaches a backend-profile handler as the optional
init.ttscapability, behind a newTTS_PROVIDERcontract — the egress half of the audio pipeline. The platform shipped a real speech-to-text stack and, since the previous change, aninit.stthandle for it; the other direction did not exist in either profile, so every voice product had to hand-roll a raw provider call in product code, each with its own key handling, error hygiene, and provider-drift exposure — exactly the scaffolding the platform otherwise absorbs. A route or tool handler now receivesinit.tts.synthesize(text, opts)— the text it already assembled in, the audio bytes plus thecontentTypedescribing them out, withvoice,speed, andformat(mp3|opus|wav) as plain options. Two new packages carry it:@rayspec/tts-port, the provider-neutralTtsAdaptercontract and the request rules every adapter behind it applies, and@rayspec/adapter-openai-tts, a raw-fetchOpenAI adapter (tts-1/tts-1-hd, one REST call, no provider SDK and no new third-party dependency). The engine selects the provider and builds the adapter once at boot, so a handler never names a provider, reads a credential, or constructs an adapter. Presence follows the other optional capabilities exactly: setTTS_PROVIDERand everyhandler-kind route init and every tool init carries the handle (astream-kind route init and a trigger init do not — neither builder injects it); leave it unset and the field is absent (notundefined-valued), so a handler that needs it fail-closes loudly instead of speaking into a silent no-op — and an unset provider is never a boot error, since nothing in a spec declares that a handler speaks.TTS_PROVIDER=openaidemandsOPENAI_API_KEYat boot rather than failing every call at request time (that is the same variable the OpenAI and Pi agent backends already use, so those deployments need no new credential; an Anthropic- or Codex-backed one does not carry it and must supply it), an unsupported provider name is refused at boot naming the wired ones, andTTS_PROVIDER=fakeis a working deterministic offline synthesizer for dev and CI (every call returns the same fixed-length tone, byte-identical; the boot warns loudly that nothing is being spoken, warn-only). The fake validatesformatexactly as the live provider does but encodes nothing, so it always answers WAV bytes under an honestaudio/wavcontent type whatever container was requested — readcontentType, never derive it from the requestedformat. Unliketranscribe,synthesizerejects rather than returning a status union — the happy path is the audio itself — with a structured, content-freeTtsAdapterErrorthat never echoes the text, the response body, or the credential (the SDK re-exports the type, so a handler can name what it caught). Two limits are enforced before any provider call, so a rejected request is never billed: the 4096-character text cap is fail-closed (an over-long text is refused, never truncated into a recording that stops mid-sentence), and an unknown voice is refused rather than silently falling back to a default — a blank string is an unknown voice, not an absent one, and is refused the same way; the default is reached by omittingvoice, and by an explicitnull, which only an untyped caller can send and which is read as absent — whilespeedis clamped into the supported range. The capability forwards every option the caller expressed rather than every option that is truthy, so a blankformatreaches the same membership check a blankvoicedoes instead of being dropped and resolved to the adapter's default container. The offline provider enforces exactly those same limits — it is handed the live adapter's own policy — so a request that passes in CI cannot first fail in production. Deployments that set no provider boot and serve exactly as before. - Transcription reaches a backend-profile handler as the optional
init.sttcapability, behind the existingSTT_PROVIDERcontract. The platform shipped a real speech-to-text stack — the neutral adapter port and a production Deepgram adapter — that only the product profile's audio pipeline could reach; a backend-profile spec had no path to it at all, so a handler that needed a transcript had to deep-import built adapter files across package boundaries and cap its audio at the JSON body limit. A route or tool handler now receivesinit.stt.transcribe(bytes, opts)— bytes it already holds (a raw-body upload, a blob, a file read throughinit.fsSource) in, the neutral transcript artifact out, withcontentType,languageHint, anddetectLanguageas plain options (languageHintanddetectLanguage: trueare mutually exclusive: a call that sets both comes back as afailedresult carryingunsupported_option, on the offline provider exactly as on the real one, so the illegal pair cannot pass in CI and first fail in production). The engine selects the provider and builds the adapter once at boot and resolves the per-call media internally, so a handler never names a provider, reads a credential, or constructs an adapter. Presence follows the other optional capabilities exactly: setSTT_PROVIDERand everyhandler-kind route init and every tool init carries the handle (astream-kind route init and a trigger init do not — neither builder injects it); leave it unset and the field is absent (notundefined-valued), so a handler that needs it fail-closes loudly instead of transcribing into a silent no-op — and an unset provider is never a boot error, since nothing in a spec declares that a handler transcribes.STT_PROVIDER=deepgramdemandsDEEPGRAM_API_KEYat boot rather than answering every call with a content-freeprovider_unavailableat request time, an unsupported provider name is refused at boot naming the wired ones, andSTT_PROVIDER=fakeis a working deterministic offline transcriber for dev and CI (identical input yields an identical synthetic transcript; the boot warns loudly that no audio is being transcribed, warn-only). A provider-side failure is astatus: 'failed'result carrying a content-free error, never a throw and never an echo of the audio or the credential. Trigger inits are unchanged (they carry no optional capability), and a deployment that sets no provider boots and serves exactly as before. - An optional response projection on declared store routes:
projectwithcasing(snake default | camel),omitInjected,rename, and afieldsallowlist. A store route serialized rows in exactly one shape — snake_case, every injected column included — so a product whose wire contract predates its backend (an existing frontend, a mobile app, a published API) could not use the declarative surface at all and fell off onto{handler}routes wholesale.projectdocks on a route or on a store (the route-level one overrides wholesale;project: {}opts a single route back out) and reshapes responses only:casing: camelre-keys every field to its camelCase twin,omitInjected: truedrops the injected columns while keepingid,renamemaps a declared/injected column to a pinned wire name (id → companionId), andfields— matched against the post-casing/rename wire names, applied last — is the final word on membership (it can re-include an injected column pastomitInjectedand can dropid). Requests are untouched: bodies keep the declared column names in either casing, and thelistquery surface (filters,order, operator params) stays author-named — a rename produces a documented request/response naming split, stated in the reference docs and on every projected operation of the generated OpenAPI document, whose response schemas follow the projection (the serializer and the emitter consume one shared resolution, so the documented shape is the served shape). Misconfiguration failsdoctorwith three new closed error codes — an unknown or deadrename/fieldsmember (projection_unknown_column), two columns on one wire name (projection_collision), and a rename target equal to another column's author name, which would mislead the author-named query surface (projection_query_shadow) — never a runtime surprise. Keyset pagination is projection-immune (the cursor is minted from the stored row, so paging works withidrenamed or dropped), and a projected route serializes exactly its projected field set. Additive with one exception: a document withoutprojectparses, serves, and documents exactly as before the key existed, except for a store that declares a column named__proto__— the un-projected serializer now emits that column instead of swallowing it, which is its own entry in this release. - Two fractional column types for declared stores:
double(PostgreSQLfloat8) andnumericwith requiredprecision/scale(exact decimals). The column vocabulary had no honest home for a fractional value — a confidence score, a price, a coordinate — leaving authors to choose between scaled integers, an untypedjsonbslot, ortext. Adoublecolumn is an IEEE-754 binary64 float and round-trips natively as a JSON number (the float a client writes is the float it reads back — the platform never re-rounds); NaN/Infinity are refused fail-closed everywhere a value enters, and a non-finite value planted by direct SQL makes the read a400rather than a silent JSONnull. Anumeric(p, s)column is the exact type for money, and exactness is why its wire form is a decimal string in both directions: JSON numbers pass through float64 in every parser, which corrupts a decimal past 2^53 before any validator could see it. A write must fit the declared shape — at mostscalefractional digits andprecision − scaleinteger digits — and is refused rather than rounded when it does not; a JSON number on a numeric column is refused outright; a read returns the exact stored decimal with exactlyscalefractional digits. Both types filter (?col=,?col__in=), order, and keyset-paginate — numeric compares as a number server-side, never lexicographically.precision/scaleare validated at parse (integers, 1..1000,scale ≤ precision, both required onnumeric, both rejected on any other type), a precision/scale change on an existing column is emitted as a gatedALTER … SET DATA TYPE numeric(p, s)like any other type change, drift detection verifies the live parameters (anumeric(14, 2)column where the spec saysnumeric(12, 2)is drift, not a pass), and the exported spec JSON-Schema artifacts carry the new vocabulary for editor validation. A spec without the new types produces byte-identical generator, diff, and doctor output. - An escape-hatch handler can now read the authenticated caller as
init.principal—{ kind: 'user' | 'apikey' | 'm2m', id, role? }, plain values resolved by the platform middleware. The route init deliberately strips credential headers, but nothing replaced them, so a handler could not tell two users of the same org apart: a "who am I" route had no "who", per-user rows inside a tenant (preferences, drafts, read cursors) had nothing to key on, and audit attribution in custom logic had to be reinvented — even though the platform already resolved the identity to stampcreated_by. The new field closes that asymmetry:idis the userId or apiKeyId — exactly the valuecreated_bystamps, derived from the same resolved principal so the two can never disagree — androleis present for user principals with a live org role. Trust posture: the principal is data, never a tenant signal (the tenant stays server-derived) and never an authz input (permission gates run before the handler). The field is?-optional likeheaders, so an older engine/init combination stays well-formed with it absent; an invocation context with no authenticated principal (a scheduled trigger fire, the media-token playback path) simply omits it — never a fabricated identity. Route and stream-ingest inits carry it today; the trigger init declares the same optional slot. RAYSPEC_AUTH_RATE_MULTIPLIERscales the auth rate-limit buckets for a dev/CI run (default 1). Theregister(5/min),login(10/min) andrefresh(30/min) per-source buckets are sized for production and had no dev/CI override, so a test harness that provisions several orgs against a live boot tripped theregisterbucket — the 6th registration inside a minute answered429, and the suite's later assertions then failed401far from the cause. A positive integer set in the environment now multiplies themaxof exactly those three buckets; the windows and every other bucket (oauth-token,reprocess,trigger-fire,invite-accept, the declared-route tiers) are untouched. Unset, blank or an explicit 1 leaves the limiter byte-identical to before — five registrations per source per minute,429on the sixth. Any other value makes the boot log a loud one-line warning naming the variable and the value, so the dev/CI posture can never sit in a production environment silently; a value that is not a positive integer or is above 1000 aborts the boot with a refusal naming the variable and the value, in the same shape as the other env refusals. The ceiling is deliberate and matches the shapeRAYSPEC_ACCESS_TOKEN_TTL_SECONDSalready had: the variable scales a throttle, so an unbounded value is a way to switch that throttle off by arithmetic — at ×1e9 theregisterbucket admits 5e9 registrations a minute, which is no limit at all. ×1000 is ten times the documented example and already means 5000 registrations a minute, so no harness meets the bound. The getting-started docs gain a "Testing against a live boot" section naming the buckets and their windows, so suite authors can also stagger registrations knowingly instead.- A spec node can acknowledge a
doctoradvisory withlintSuppress— with a mandatory recorded justification. An agent, a store, an api route, a trigger or a handler may carrylintSuppress: [{ code, because }].codenames one of the advisory (warning) codes only — the field's closed vocabulary contains no error codes, so suppressing an error is not expressible — andbecauseis required and non-empty (whitespace-only rejected): a suppression without a recorded reason fails the parse, fail-closed. The scope is the node the list sits on, never global; the same code fired by another node stays visible.doctormoves each acknowledged finding fromwarningsto asuppressedarray carrying the finding's code, the justification verbatim, and the finding's path — visible in review, quiet in the loop. Like warnings, suppressed entries never affectokor the exit code, and a document declaring no suppression produces byte-identicaldoctoroutput to before. A suppression whose code no longer fires on its node is reported as a new advisory,stale_suppression, pointing at the stale entry — an acknowledgement cannot outlive its finding silently (andstale_suppressionitself is not suppressible). The exported spec JSON-Schema artifacts carry the new key, so editor validation offers the closed advisory-code list. POST /v1/triggers/{name}/firehands back the run it started when the fired action is anagentaction. The202was{ name, fired }in every case, so the off-request run an agent-action fire had just enqueued could not be followed through the public API — the only ways to observe it were re-deriving the internal deterministic run id client-side or polling a runs listing. An agent-action fire that dispatches now answers{ name, fired: true, runId, events: "/v1/runs/{id}/events" }— the real id plus the same events path anasync: truerun's202advertises — and the fire path writes the same pre-enqueueenqueuedrun header the async run surface writes, so the returned id resolves onGET /v1/runs/{id}and on the events path immediately instead of404ing until the run ends (and forever, for a run that ends by throwing). A handler-action fire and a deduped no-op keep the exact previous shape (norunIdkey), and the route's404/429/501and audit behavior are unchanged. The route also enters the spec reference next totriggers— method, permission, the202bodies, thefired:falseambiguity, the error cases, and thetrigger-firerate bucket (30 fires per 60 seconds per tenant+trigger). The header write is not route-only, and that is a behaviour change beyond this route. It sits in the scheduler's one shared fire path, below the firing reserve and above the enqueue, keyed on nothing about how the fire arrived — so a scheduledcrontrigger's agent action writes it too, on every scheduled tick that actually dispatches (a deduped no-op, a tenant-absent skip and a beyond-look-back catch-up replay all return before it, as they always did). A cron-fired run id therefore now resolves onGET /v1/runs/{id}asenqueuedfrom the instant it is enqueued, where it previously404ed until the run's own header committed and stayed404for a run that ended by throwing. So a bounded or thrown cron run now leaves a non-terminalenqueuedrow inrunsrather than no row at all — read such a run's outcome by testing the header for TERMINALITY (isTerminalRunStatus), the same way an API-enqueued run has always had to be read. The documentation that stated the old behaviour outright is corrected with it: theRAYSPEC_AGENT_RUN_MAX_MSnote in.env.example, and the 1.7.0 entry that first described it. The write stays advisory on both arms: it is driven by the run-header identity resolver the deployment injects — the one boot path that constructs the cron scheduler always supplies one, resolved off the same agent registry the executor resolves runs from — a write failure is logged and never costs the fire its dispatch, and a resolver that cannot name theagentIdlogs the skip and writes nothing. Both arms are pinned inpackages/workflow/durable-dbos/src/cron-scheduler-run-header.db.test.ts, the scheduled one throughfireScheduled— the same body the registered DBOS scheduled-workflow runs.- Bounded comparison filters on both read surfaces, and a cursor on every
listpage. Every read was equality-only, so "give me everything after X" — the natural read for an event log, an activity feed, or an incremental sync — could not be written at all. The declaredlistop now accepts?<column>__gt=/__gte/__lt/__lte(the__inpattern extended to ranges): allowed only on non-nullable, non-jsonb declared columns — a nullable column, ajsonbcolumn, an undeclared column, and the injectedid/created_at/created_byeach answer400 VALIDATION_ERROR, so a typo'd operator never widens a read. Values are coerced with the same per-type rules equality uses (doubleandnumericcompare numerically,numericexactly), each bound folds into the same AND-chain (two bounds on one column make a range) and composes with equality,__in,order, and keyset pagination; a column literally named<x>__gtstill routes as plain equality, and the generated OpenAPI documents the per-column operator params with the eligibility rule. The handler facade takes the same family as a typed filter value —init.db.select('events', { seq: { gt: lastSeen } }, …)(and oncount) — a plain serializable object, fail-closed the same way: only a well-formed{ gt/gte/lt/lte }object on an eligible declared column is a comparison (an unknown or mixed key, an empty object, a contradictorygt+gte/lt+ltepair, anull/undefinedbound, or an ineligible column each reject; on ajsonbcolumn an object remains an equality value, andupdate/deletefilters still reject objects — no previously-legal filter changes meaning). And thelistop now returnsX-Next-Cursoron every non-empty keyset-ordered page, not only a full one, so a client can drain a feed, park the cursor, and later pass it asafterto receive exactly the rows that arrived since. An empty page carries no cursor (your previously-held cursor remains your frontier), a ranked?__search=page carries none (relevance-ordered, no keyset), andX-Result-Truncatedis still set only when a page fills to the cap. sequentialTools: trueon an agent serializes its tool calls — they execute one at a time, in the order the model emitted them. A tool-call batch was always dispatched concurrently: the model can batch several calls into one turn, the platform ran such a batch in parallel under the per-run concurrency cap, and no spec field could turn that off — for tools with ordered side effects (a write that must land before a finish, a spawn that must land before a sweep) that is a real race, and instructing the model to "call tools one at a time" does not stop SDK-level batching. The new optional agent field (defaultfalse— dispatch is unchanged for a spec that does not set it) is honored at two levels. Onopenaithe adapter sends the provider-sideparallel_tool_calls: false, so the model stops batching at the source, and caps the SDK loop's local tool concurrency at 1, so a batch that still arrives executes strictly in emission-index order; with the flag off neither setting is sent and the provider's own default (parallel) applies, exactly as before. Bothopenaisettings are conditioned on the agent actually declaring tools: an agent that sets the flag with an emptytoolslist has no call to order, so neither setting is sent and its request is byte-identical to the one it sent before — the same wire shape as the flag being off. On every backend the platform additionally serializes the run's tool dispatch through a per-run FIFO width-1 queue in front of the tool dispatcher, so a batched turn's calls run strictly in emission order — handlers, events, and journal steps included. A backend that could honor neither level is rejected at validation time with acapability_violation(never a silent no-op); every wired backend honors it today.rayspec deploy --check-env <spec>— the environment a document's boot will require, answered without attempting one. Until now the read-only floor named exactly one of these variables:doctorraises acron_tenant_requiredadvisory for a declaredcron/manualtrigger, namingRAYSPEC_CRON_TENANT_ID— and it can only be advisory, because the lint pass is pure over the document and cannot read an environment. Everything else surfaced only as adeployrefusal, and that refusal is not cheap: the demands a declaredstreamroute, playback route orcrontrigger raise are reached only after the boot has opened the database and applied the whole committed migration chain. The new flag emits a JSON verdict naming every variable the boot will require, its<VAR>_FILEequivalent where it has one, why this document or this environment demands it, and whether it is currently set. Exit 0 when every demand is met and no refusal is already visible, 1 otherwise;missinglists the unmet demands anderrorsnames a refusal that is not an unset variable (a document that does not validate, an agent selecting an unwired backend, anstt.*step declared without the audio capability). It reads the document and the environment, and it has to read both. Some demands have no document signal at all: on a backend document, settingSTT_PROVIDER=deepgrammakesDEEPGRAM_API_KEYa demand, andTTS_PROVIDER=openaimakesOPENAI_API_KEYone, whatever that document declares — the two speech capabilities are wired from the environment alone. (That is a backend-document law: a product document readsSTT_PROVIDERon its own terms and never readsTTS_PROVIDERat all.) A provider selector is never itself an unconditional demand: on a backend document, leavingSTT_PROVIDERorTTS_PROVIDERunset means that capability is simply absent, which is not a boot error, so both are reported as optional saying exactly that; on a product documentSTT_PROVIDERis demanded, but only when the document declares anstt.*step alongside the audio capability whose blob-backed chunks the transcription resolver reads — anstt.*step without audio is refused on the document's shape, before the selector is read at all. In neither case does a credential become a demand before a provider has been selected. Each of the three boot profiles gets its own answer: a frontend-only (static-profile) document is told it needs none of the three platform secrets, and a product document gets its own set (RAYSPEC_PRODUCT_TENANT_IDplus the capability-conditional demands its declarations raise). The demands are not re-derived CLI-side. They come from the same records@rayspec/servercomposes its boot refusals from, and the deploy guards ask their conditions through the same shared predicates, so a demand the boot raises is a demand this prints. Every existing boot refusal keeps its exact wording. The command opens no socket, no database and no credential, and it loads no extension pack — running pack code is what would break that promise. Every demand a pack changes is therefore invisible, in both directions: a pack-supplied blob backend removes theRAYSPEC_BLOB_ROOTdemand, while a pack-contributedapiroute adds theRAYSPEC_BLOB_ROOTdemand (anykind: stream) and theRAYSPEC_MEDIA_SIGNING_KEYdemand (mode: playback), and a pack-contributed agent adds its backend's credential demand — the boot guards ask their questions of the post-merge document, and this reads the base one. So that a pack-bearing document is never a silent green, the verdict names the packs it declares (parsed offextensions[], never loaded). All of that is stated in the verdict'snotChecked, together with the rest of the boundary: a set<VAR>_FILEmount counts as set from the variable alone (the file is never opened, so a missing or empty secret file still refuses the boot), and no value is validated — a malformed PEM, a non-UUID cron tenant or a media key under 32 bytes is reported as "set" and still refuses. A value is read only where it decides which demands apply (a selectedSTT_PROVIDER/TTS_PROVIDER, andRAYSPEC_ANTHROPIC_REUSE_LOGIN, whose unrecognised value is reported because it decides whether the anthropic token demand exists at all). No environment value is ever printed; every variable is reported as asetboolean, and the one refusal about a value names the variable without quoting it. The verdict also names the.envfiles the CLI's auto-loader searched, which is usually the answer to a disputed "unset".
# changed
- A mapping key written literally as
__proto__is now refused at the parse boundary of both document profiles (reserved_document_key), anywhere in the document. It is the one key name the shape validator will not report on where it validates keys at all — and in a free-form slot it validates none, so the parse boundary is the only pass that can see it either way. The YAML loader builds it as a genuine own property — it defines the property rather than assigning it, so the prototype setter is bypassed — and the validator then skips that key by name, in both readers a spec goes through — the strict-object unrecognized-key walk and the record branch — without raising an issue. What that cost, measured on this grammar. Where the grammar reads the level, the key is dropped and the document that reached every rule downstream was not the document the author wrote:api[].project.rename: { __proto__: … }parsed clean, linted clean and did nothing — the column kept its own name on the wire and in the OpenAPI document while the author read the document as a rename. A__proto__key at the document root, or inmetadata, passed the strict unknown-key rejection that refuses every other unknown key. Every record dock behaved the same way: productmetadata, a store step'sfilter/values, a view'sfields/params,contracts. Inside a FREE-FORM schema slot the behaviour is the opposite and matters just as much: a tool'sparametersand the body of acontractsentry are openz.unknown()regions the validator never descends into, so there the key is not dropped — it survives the parse with its value intact and is carried through to what the engine serves (a contract property named__proto__reachescomponents.schemasin the emitted OpenAPI document). Unreported in both directions, which is why the refusal belongs at the parse boundary and not in the grammar. The view-name denylist that already named__proto__(VIEW_RESERVED_NAMES) shows the same split: for the positions it reads from mapping keys — fields, params, filter/match columns — the key was already gone by the time the lint ran, so that member could not fire for a document anyone actually wrote; for a counts bucket, which is an array value and which the refusal deliberately leaves alone, it fires on a parsed document today. One scan over the raw loaded document closes the reportable gap at once, and it is the only place in the pipeline where the key is both still present and inspectable. The scan is cycle-guarded, because a YAML alias resolves to the very node its anchor labels and an unguarded walk of such a document would not return. This is a validation behaviour change, and it is deliberate: a document that used to parse now fails, with the error pointed at the offending key. No shipped example or fixture document declares such a key (checked across every tracked.yaml/.yml). Two classes of author document are affected, and they are not the same. One was already broken without being told: the key sat on a level the grammar reads, was dropped, and the meaning written under it did nothing — that author now finds out. The other was working: the key sat in a free-form schema slot, survived the parse and was served in the emitted API contract. That document parsed before and is refused now; renaming the property is the migration. Loading such a document never reparented an object either way — the YAML loader defines the property rather than assigning it, so the__proto__setter is never reached. Only__proto__is refused.constructorandprototypesurvive the shape parse as ordinary keys, so they need no parse-boundary refusal and keep their existing treatment: a store column namedconstructoris a legal declaration this platform serves, and a view field namedconstructoris still rejected by the view lint on a parsed document. And the refusal is about a key: a__proto__value is untouched, so a store column named__proto__stays legal and is served under its own name. - The
501fromPOST /v1/triggers/{name}/firenow names the manual-trigger requirement instead of a durable worker. It readManual trigger firing requires a configured durable worker and a declared manual trigger. No manual-trigger firer is wired on this deployment., and the worker half of that sentence is never the but-for cause: the composition root wires the fire seam exactly when the deployed document declares akind: manualtrigger, so settingdeployment.durableWorker: truealone never clears the refusal. Nor can a document declare a manual trigger without the worker — that is a lint error at parse/deploy time, with the boot abort as its runtime backstop — so the reader most likely to meet the refusal, an operator on an all-crondocument such as the shippedacme-notes-backend, whose single trigger iskind: cron, was pointed at a component that is already there. It now reads: "This route fireskind: manualtriggers only — acrontrigger fires on its own schedule and is not fireable here. Declare akind: manualtrigger in the deployed document; no manual-trigger firer is wired on this deployment." No behaviour changed: same501, sameNOT_IMPLEMENTEDcode, same guard on the same wiring (the composition root wires the fire seam only when the deployed document declares akind: manualtrigger). The refusal stays deployment-level and never names the requested trigger — it is raised before the firer's tenant reconciliation and before thetrigger-firerate limiter, so echoing the name would answer "does this trigger exist?" for any authenticated caller, which is exactly what the route's uniform404(unknown name, non-manualkind, foreign tenant) refuses to answer. The trigger reference's501bullet now states the same cause; the404bullet is unchanged. rayspec-servenow honours an explicitly setRAYSPEC_AGENT_TRACING, and refuses a value it cannot act on. The variable had exactly one reader, reached only fromrayspec deploy, so onrayspec-servean operator could setRAYSPEC_AGENT_TRACING=off, watch the boot banner stateTrace export: EXPORTING TO OPENAI, and have the agent SDK go on exporting — and a typo such asRAYSPEC_AGENT_TRACING=NoNsEnSewas ignored there, while the same value fail-closes by name ondeploy. What that transport carries is run metadata and, once an agent calls tools, the tool arguments and tool outputs (the SDK strips the model prompt fields before export). Unset — including blank — is unchanged, and deliberately so:rayspec-servekeeps the agent SDK's own default, which is to export, andrayspec deploykeeps its default ofoff. The new reader is explicit-only for that reason: it hands off toresolveAgentTracing— the same refusal, in the same words — only once a value is actually stated, so that function's collapse of unset intooffis never reached fromrayspec-serve, and the deploy path behaves as before. What changes onrayspec-serveis only what an explicit value now does:offdisables the export (through the SDK's programmaticsetTracingDisabled, because that entrypoint's static imports have already built the trace provider, so writing the SDK's environment switch alone would arrive too late),openaiis a no-op, and anything else aborts the boot with the same messagedeployraises, from the same line — not a second, entrypoint-specific wording — before the config load and before any port is bound. Who is affected: a deployment that exportsRAYSPEC_AGENT_TRACINGprocess-wide and relies onrayspec-serveignoring it. Withoffthat boot stops exporting; with an unsupported value it now refuses to start rather than booting and exporting.deploy --check-envstill does not list this variable — it reports the variables a document's boot demands, and tracing is not demanded. The documentation of the variable is corrected to match on both halves..env.exampleno longer presents the block asrayspec deployonly or claims that leaving the variable unset keeps traces in the process: it now states the one thing that differs between the two entrypoints in how they treat the variable, which is what unset means (offondeploy, the SDK's exporting default onrayspec-serve), and names the boots that assemble the server themselves and read no trace-export setting at all. (Both halves of that list moved again later in this release — see "the boot wrappers that assemble the server themselves now honourRAYSPEC_AGENT_TRACINGtoo" below.) The getting-started guide's two "same boot" passages aboutrayspec deploy <spec>andRAYSPEC_SPEC_PATH=<spec> rayspec-servenow name two differences that matter for what leaves the process and for what can still register a table — this trace-export default, andsealProductStores(), whichdeploycalls after its boot returns andrayspec-servenever calls — without claiming to have counted every difference between the two entrypoints (withBootTimeoutdiffers as well). The operator-facing messages are corrected while they are being touched. The refusal an unusable value raises statedunset ⇒ off, which is false on the entrypoint this change makes it reachable from; it now states the default per entry point. And bothTrace export:banner lines said the export carries prompts. It does not:@openai/agents-openaikeeps the model input and response in_-prefixed span fields and@openai/agents-corestrips every_-prefixed key inSpan.toJSONbefore the exporter serializes anything, while function spans carry tool arguments and outputs unprefixed. Both lines now say run metadata plus, once an agent calls tools, its tool arguments and outputs — and both name the remediation asRAYSPEC_AGENT_TRACING. (That hint was scoped torayspec deployandrayspec-serveat the time, because the banner's other two call sites read nothing; it is unqualified now that they do — see below.)
# fixed
- The boot wrappers that assemble the server themselves now honour
RAYSPEC_AGENT_TRACINGtoo, and load their local.envthrough the shipped loader.examples/local-boot/serve.tsanddeployments/acme-notes/serve.mtscallassembleServerdirectly, so neither reached therayspec-serveentrypoint'smain(): an operator who setRAYSPEC_AGENT_TRACING=offon either one still got the agent SDK's exporting default — run metadata and, once an agent calls tools, its tool arguments and outputs leaving for OpenAI — and an unsupported value that fail-closes by name on both documented entrypoints was ignored there. Both wrappers printed the resolved posture on their boot banner throughout, so the export was visible; it was simply not a decision the operator could make. Each now applies the same explicit-only reader therayspec-serveentrypoint uses, before its first boot input is read:offdisables the export through the SDK's programmatic switch (both import the composition root statically, so the trace provider has snapshotted the SDK's own switch long before either boots and an environment write alone would arrive too late),openaiis a no-op, unset and blank still change nothing, and anything else aborts with the message the documented entrypoints raise — printed as a message, not a stack, on both.examples/local-boot/serve.tsalso carried its own single-path.envreader: a private parser resolving exactly one file, the install-root one, relative to its own module location. That is the construction issue #384 was about, one level down — it ignoredRAYSPEC_SKIP_DOTENV=1, never looked at the invoking directory, and parsed values by rules of its own. It now calls the shippedloadLocalDotenvIfPresent, so it resolves configuration exactly asrayspec deployandrayspec-servedo:$PWD/.envfirst, the install-root file second, per key, opt-out included.deployments/acme-notes/serve.mtsreads no.envat all and still does not — it is a deployment entrypoint whose environment comes from the deployment. The banner's remediation hint drops its entry-point qualifier, because all four boots that print it now read the variable; a source-discovering test requires everybootBannercall site to apply a posture, so a fifth boot that printed the banner without reading the variable fails rather than making that sentence false. And the two.envloaders gain the parity test they never had: the CLI's copy and the server's are behaviourally identical and joined only by a comment in each pointing at the other, which is exactly how they came apart the first time. One suite now runs both shipped modules over the same two-root layout on disk and requires identical resolved values — order, per-key precedence, the opt-out, quote-stripping and the\nunescape — so a change to one that is not made to the other stops being green. (Issues #383, #384.) rayspec gen-handlernow says WHY it cannot coerce adoubleornumericcolumn from a tool arg, instead of refusing the type as if it did not exist. The holes contract carries its own column-type set — the types the deterministic renderer has a coercion arm for — and that set is deliberately narrower than the grammar's, because the renderer has no arm for either fractional type. Acolumns[]entry naming one has been refused fail-closed all along, which is right; what was wrong is what the refusal said. The message enumerated the seven types it accepts and stopped there, so an author who had just declared a perfectly validnumericmoney column read it as a typo and went looking for one. The refusal now appends the reason and the way out: the type is a valid store column type, the renderer has no coercion arm for it, so a handler that coerces that column from an untrusted arg must be hand-written. It also names the path that is NOT closed — a server-stampedfixedValuesconstant into that column still renders, becausefixedValuespins author constants by column name and carries nojsonType— so the refusal cannot be read as "this column is unwritable from a generated handler". A type the grammar does not carry either — a genuine typo likefloat— still gets the plain refusal, so the two failure modes stay distinguishable. Two smaller rot fixes ride along, both in the same file. The accepted list in the message is now read off the set the validator checks against, rather than spelled out a second time by hand, so it can never quote a vocabulary the renderer has outgrown. And the set of types the refusal calls out by reason is DERIVED, by subtracting the renderer's set from the grammar's enum — nothing re-listsdoubleandnumeric, so a type added to the grammar is explained on its own and one that gains a renderer arm drops out on its own. The neighbouring comment claimed the local set mirrored the grammar's and that floats map tojsonb; neither has been true since the fractional types landed. It now states the subset relationship, and names what enforces it: the renderer's coercion switch has nodefaultand returnsstring, so adding a member to the local set without writing its arm failstsc. No accepted hole-set renders differently — the seven renderable types, their coercion arms and the emitted bytes are untouched.- The generated OpenAPI document stops describing a
listfilter the server refuses, and itsnumericpattern is now the envelope the server enforces. Three corrections to whatGET /v1/openapi.jsonpublishes for declared{store}routes. Each is a document-accuracy fix — no route behaviour changed, and the runtime was fail-closed throughout — but the document is a product artifact a client generates code from, so a parameter it advertises has to be one the server answers. Suffix companions were de-duplicated against the wrong set. The emitter adds a<col>__in, a<col>__containsand the four<col>__gt/__gte/__lt/__ltecompanions per eligible column, and dropped a companion whose name collides with a declared filterable column. Ajsonbcolumn is not filterable and was therefore missing from that set — while the query builder resolves the FULL query key first, against every declared column. A store declaring an eligible columnfoonext to ajsonbcolumn literally namedfoo__gtpublished afoo__gtparameter that?foo__gt=answers with400 VALIDATION_ERROR: Column 'foo__gt' is not filterable.The de-duplication now keys on every declared column name plus the injectedcreated_by— exactly the set the query builder resolves first — and it covers all three suffix families and each of the four comparison operators on its own. Nothing else moved: a non-jsonbcolumn of the same name still wins as plain equality, and a shadowed operator still costs its eligible sibling only that one bound. Thenumericpattern was a hand-written copy of the runtime's, and a looser one. The row schema and the numeric filter parameters carried^-?\d+(\.\d+)?$while the value gate is^-?\d{1,1000}(\.\d{1,1000})?$, so the document admitted digit runs the server answers with a 400. All three emitted patterns — row schema, filter parameters, and the create/update body schema that already derived from it — are now the one exported regex, which the body validator and the filter and cursor coercion also test against, so the published envelope and the enforced one cannot diverge. Not covered by this: the per-columnnumeric(precision, scale)fit the create/update validator additionally applies is a refinement with no JSON-Schema form, so the exported body schema still admits a value the column's typmod refuses. Aproject: {}route stated a naming split it does not have, and the split sentence understated the request surface.project: {}is the documented per-route opt-out from a store-level projection, and{}is not nullish — so an opted-out operation, whose schemas are byte-identical to an un-projected one, still carried the sentence describing a request/response naming split. The sentence is now emitted only for a non-empty projection. Where it is emitted it also states the request-side casing rule, which it previously left out: a create/update body key may be written as the declared snake_case name or its camelCase twin (both variants of one column in one body are refused as ambiguous), while a query parameter takes the declared name only. Reading only the generated document, a client author would have concluded that snake_case bodies are required — stricter than what the server accepts. examples/agent-pack-deploymentcan be deployed now, and its pack manifest stops claiming the loader compiles TypeScript. The example's whole product surface — anotesstore, alookup_notetool and thenote_summarizeragent that references it — ships as adefineExtensionpack authored in TypeScript, and the example carried no build step of any kind. The deploy runtime loads compiled JavaScript only (assertCompiledJavaScriptModulerefuses a.tspath before importing it), sorayspec deploy examples/agent-pack-deployment/rayspec.yamlaborted at the pack entry — whilepacks/agent-pack/package.jsondescribed the pack as "loaded at deploy/test time by loadExtensions (the importer transforms the .ts)". The example now shipsbuild.mjsandpacks/agent-pack/tsconfig.build.json, the same thin-tsc-wrapper pairexamples/stream-backendships:node examples/agent-pack-deployment/build.mjstranspiles the pack'sindex.tsandhandlers/*.tsto ESM underpacks/agent-pack/dist/and marks that output{"type":"module"}. The built pack lands under the pack directory so the entry still resolves@rayspec/platformthrough the pack's ownnode_modules, which is the first stop on Node's upward walk from the built file. A newexamples/agent-pack-deployment/README.mdgives the build command and the one line a deployment changes —module: ./packs/agent-pack/dist— and says plainly that the build clears the compiled-JavaScript boundary and nothing else: the document still needs the boot environmentrayspec deploy --check-envreports, and that report is derived from a document declaring no agents of its own, so it does not name the credential the pack's agent needs. The committedrayspec.yamlstill points at the pack SOURCE, by design. That is the form the example's tests load, through the loader's explicittypeStrippingImporterseam, and repointing it atdist/would also drop the pack's handler root fromgate:handler-importsandgate:extension-capability, which add<packDir>/handlersonly when it exists on disk — in a clean clonedist/handlersdoes not. The parenthetical was false on the test path too, not just on deploy, so it is deleted rather than narrowed: no importer transforms anything.typeStrippingImporteris the production importer minus the compiled-JavaScript assertion — a bare dynamicimport()of the module's own file URL — so whether an un-built.tsexecutes is the RUNTIME's business and never the loader's: the test runner's transform underpnpm test, Node's own type stripping on the versions that do it by default, andUnknown file extension ".ts"on a Node that does not. (That is why the production boundary is an explicit extension check rather than a reliance onimport()failing, asassertCompiledJavaScriptModule's own docblock says.) That sentence shipped byte-identically inexamples/stream-backend/packs/stream-pack/package.json, and with the neighbouring "no build/typecheck/test" framing it made nine claims across seven files — both pack manifests, both pack entries, the agent pack's handler, the twoexamples/*comments inpnpm-workspace.yamland two paragraphs of the stream-backend README, which called its pack "a pure loaded-at-deploy fixture" while the example shipped abuild.mjs, and told a reader that its source-pointing spec "works in this repository because the dev/test importer strips types on the way in" — the same misattribution, plus a compiled-JavaScript boundary wrongly localized to out-of-repo deployments. All nine now say what is true: neither pack declares a build/typecheck/test script and turbo runs none, each example carries its ownbuild.mjsbecause the deploy runtime loads compiled JavaScript only, and the seam is named as the opt-in it is.packages/app/server/src/deployable-backend-handlers.test.tsgains the third arm of the battery it already ran foracme-notes-backendandstream-backend: the production importer refuses the agent pack's.tssource, runs the documented build, and then resolves the builtdist/— entry, handler and the pack-contributedagentsfragment. That test is a@rayspec/servertest and runs in CI; the example itself is a@spike/*fixture and is not built, typechecked or tested there. (Issue #364.)- A port that is already in use now refuses the boot in one actionable line instead of crashing with a raw Node stack.
serve()returns while the bind is still pending — immediately after the call the listener'slisteningisfalseand itsaddress()isnull— so neither entrypoint had anything to catch: the boot reported itself served and theEADDRINUSEarrived afterwards as an unhandled'error'event, printing Node'sthrow er; // Unhandled 'error' eventreport and anode:netstack. Onrayspec deploythat landed after the boot had connected to the database and applied migrations, so a successful-looking preamble was followed by an unhandled exception. The raw stack did name the address numerically, but nothing else: not the variable to change, not the host knob, and no remedy. Both shipped entrypoints now refuse instead — therayspec-servebin andrayspec deploy, on their normal and their static-profile (frontend-only) boot paths, four listeners in all. Each attaches an'error'listener the momentserve()returns, and onEADDRINUSEprints one line naming the address (Boot aborted — 127.0.0.1:8191 is already in use. …), the command that finds the process holding it (lsof -nP -iTCP:<port> -sTCP:LISTEN) and the knob that entrypoint's operator turns —PORT=<n>forrayspec-serve,--port <n>orPORT=<n>forrayspec deploy(its--portwritesPORT), withRAYSPEC_HOST/--hostnamed for moving the address — then exits 1. It opensBoot aborted —, the same opening as the existing invalid-PORTrefusal (Boot aborted — PORT='abc' is not a valid TCP port (1–65535).). OnlyEADDRINUSEchanges. Every other listen error —EACCESon a privileged port, agetaddrinfofailure on an unresolvableRAYSPEC_HOST, anything else — is re-emitted by that listener after it removes itself, so it reaches exactly the handling it reached before: Node's unhandled-'error'report, with its frames, and exit 1. The address in the refusal is built from the host and port the entrypoint already resolved, never from the error object, because a listen error carriesaddress/portfor some codes only. (Issue #365.) Ctrl-Cnow stops the example dev-boot servers once they are up.examples/contract-intake/dev-boot.mjs,examples/support-intake-chat/dev-boot.mjsandexamples/support-ticket-triage/dev-boot.mjskept running afterSIGINTand afterSIGTERM— still answering/health200 — so a developer who pressedCtrl-Cwas left with a live server still holding its database pool and its durable worker. Each wrapper now owns its shutdown: it captures theserve()return value and, onSIGINT/SIGTERM, closes the HTTP server, awaitsserver.close()(which drains the durable worker, then ends the database pool) and exits0— the same wiringpackages/app/server/src/serve.tsgives the shippedrayspec-serveentrypoint, which is why that entrypoint is not affected. Two bounds the handler does not remove, both of them consequences of that same wiring rather than of these wrappers. The exit runs insidehttpServer.close()'s callback, and Node invokes that callback only once every open connection has ended: the port stops accepting the moment the signal lands, but a request still in flight holds the process until it finishes. And the handler is registered only after the boot completes, so aCtrl-Cduring the boot is not the wrapper's to answer — before its dependencies install the handlers described next, the signal kills the process outright and the graceful path never runs; from there untilserve()returns it does nothing at all and the server finishes coming up.packages/app/server/src/serve.tsbehaves the same way in both cases. Nothing in a dependency changed. The wrappers registered no signal handler of their own, and theSIGINT/SIGTERMhandlers their dependencies install each act only when no other listener is registered —@openai/agents-core's tracing provider exits only whenprocess.listeners(sig).lengthis not greater than 1, andsignal-exitre-raises the signal only when that count equals its own listener count — so with both loaded neither one ended the process. An owning handler is what terminates it now, whatever the dependencies decide.SIGHUPis deliberately left unlistened:signal-exitregisters for it and@openai/agents-coredoes not, sosignal-exitis its sole listener there and re-raises it — that path is unchanged. The two example READMEs that gave a boot command with no stop instruction (contract-intake,support-intake-chat) now nameCtrl-C, and the authoring skill's dev-boot pattern teaches the handler. (Issue #360.)- A deploy that is refused after its product-store DDL applied now names the tables it already committed, instead of reading as if nothing had happened. Each migration is applied in its own transaction, so it is committed the moment it returns; every refusal raised after the migrate step —
deploy()'s own[roll out]gate (a handler module that does not load, a product table that never reached the tenant chokepoint) and the boot gates that run on the deploy result (acron/manualtrigger with no durable worker wired, an unset or malformedRAYSPEC_CRON_TENANT_ID) — therefore left theCREATE TABLEs standing and said nothing about them. An operator who read the refusal as "nothing happened" and edited the spec'sstoresnext met a drift refusal on what they believed was a first deploy. Such a refusal now carries a note naming the migrations that were applied and the tables this deployment's stores materialize, stating that a table this deploy created is committed and empty, and giving both ways forward: fix the refusal and re-deploy the same spec — a live schema that matches it classifies present-matching and MOUNTS those tables, applying no product DDL, with no cleanup step in between — or, having changed thestoresfirst, reconcile the drift with a reviewed forward migration (rayspec plan <new-spec> --against <old-spec>, thenrayspec deploy --apply-migration <delta.sql>). It namesrayspec dev db --reset --yesonly as the throwaway-database remedy it is, with its real blast radius: that command DROPs the whole database and its_dbos_syssibling and re-creates one empty database, so the platform tables and every org registered in them go with it — it is not a table-level cleanup. What is unchanged: the DDL is still committed and still not rolled back. There are no down-migrations in RaySpec and recovery stays forward-fix, so the refusal states the mid-state rather than undoing it. The note is appended to the refusal in place, so the error keeps its class and its existing wording verbatim, with the note on a following line — the CLI andrayspec-serveprint it exactly as they printed that refusal before. A refusal raised before the migrate step carries no note at all: the fact is derived from the migrations the deployer actually applied, not from what the boot planned, so a document whose deploy is refused at validation says nothing about a schema it never touched. The two post-update drift refusals, whose own text already states it, are left alone rather than made to say it twice. Both boot paths carry it — the classic backend deploy and the Product-YAML boot. (Issue #361.) - The durable worker is now fenced to its own document, so two deployments sharing one
DATABASE_URLstop dequeuing each other's off-request work — and a job whose workflow the consuming worker cannot resolve is now written to theworkflow_runsjournal instead of vanishing from it. Two independent defects produced one loss. DBOS scopes its dequeue by application version, and with nothing supplying one it derives that version by hashing the source of the workflow functions registered in the process plus the SDK version. Every function this platform registers is a thin wrapper, and nothing in that input comes from the workflows the deployed document declares — so two documents that registered the same set of functions computed the same version, whatever they declared. Two Product-YAML boots always did: that profile registers the same three wrappers on every boot and starts no cron scheduler, which is the pair issue #359 measured. A backend boot's set also grows by one registered function per cron trigger the document declares, and the hash is taken over the array of those sources with identical text never collapsed — so two backend documents landed on the same version only when their declared trigger counts matched. With the change reverted, this repo's composition-root boot test (durable-worker-boot.db.test.ts) printsApplication version: e0b3d354857e6676f40a2867c79ae41d; issue #359 reports one value across four boots of two different products. Two processes on oneDATABASE_URLalso derive the same DBOS system database and register the same queue names, and the only other column DBOS's dequeue could have discriminated on — the executor id — is no help either, because nothing here sets it and DBOS defaults it to the same constant in every process. So nothing at all distinguished them: either worker could claim either deployment's job, and on claiming a foreign one its fail-closed resolver killed the run terminally. That resolver throws before the workflow engine is constructed, and the engine is the only writer of the journal's run header — so the killed run left no row at all inworkflow_runs, not even an orphanedrunningheader, and the stack trace landed on the stderr of the process that consumed the job rather than the one that accepted it. A durable worker now boots withapplicationVersionderived from the deployed document's identity —product.idfor a Product-YAML boot,metadata.namefor a backend spec, each namespaced by profile and hashed to a short prefixed digest (doc-plus 16 hex characters). Two different documents are fenced from each other; from this release on, the same document keeps the same version across redeploys, so a redeployed process comes back and consumes the work it queued before it restarted. The one boot where that does not hold is the first boot on this release, which changes the version once — see Upgrading below. Deriving it from document content was rejected deliberately: a row whose version matches no running worker is inert in both directions — never dequeued, never recovered — and this deployment has no way back out of that state, because resuming a workflow does not reset the column, DBOS's garbage collection skips the pending, enqueued and delayed rows, and the HTTP escape hatches live on the admin server the platform deliberately never binds. A content hash would therefore have turned every document edit into permanent work-stranding. Both queue registrations now also passonConflict: "always_update". That is not cosmetic: DBOS's default only writes the queue row when the running version is the newest one registered, which per-document versions make the *un*common case — a second deployment'sworkerConcurrencywould have looked accepted and silently not applied. What the fence does not cover: the queue row itself. The fencing above is about claiming — which worker may dequeue which job. Queue configuration is not fenced, and this release does not change that. The queue names are process-independent constants (workflow-runs,agent-runs) and DBOS'squeuestable is keyed on the name alone — it carries no application-version column, andalways_updateupsertsON CONFLICT (name) DO UPDATE. So where two deployments share oneDATABASE_URL, and therefore one DBOS system database, they share one queue row per name: the most recently booted deployment'sworkerConcurrencyis the one in effect, for both. Setting different values per deployment is not expressible against a shared system database; give each deployment its own if their concurrency must differ. Verified against the pinned SDK (4.21.6) rather than inferred. What an operator observes. TheApplication versionDBOS prints as it initializes — and theapplicationVersionfield the publicGET /recovery-scopereadiness probe reports — is now adoc-…value rather than a platform hash. The probe's fail-closed contract is unchanged: both fields non-empty, else503. The value is a digest of the document's identity, not of its content, and the derivation is deterministic and lives in this source-available repo — so anyone who can guess a product id or spec name can confirm it against the served value. It distinguishes deployments; it does not conceal which document a deployment serves. Where two documents share one DBOS system database, the one whose version is not the newest row in DBOS'sapplication_versionstable prints DBOS's ownCurrent version '…' is not the latest version.warning on every boot, and the most recently registered version prints it on none: that table is ordered by first-registration timestamp and nothing in this platform promotes a version. Expected, and the diagnostic that was missing before — but it is one line on one of the two deployments, not a symptom on both. A run whose workflow the worker cannot resolve now leaves aworkflow_runsrow withstatus = "terminal_failure",resumable = false,attempts = 0and the resolver's own message undererror(codeworkflow_resolve_failed), and the worker emits one line naming the workflow, the tenant and the run id through an injectable sink that defaults toconsole.warn. The run's reconciled liveness for such a run is nowterminalwhere it wasabsent. If that run ALREADY carries a header a WORKFLOW EXECUTION wrote — the reachable case is a crash mid-run followed by DBOS crash-recovery re-invoking it against a document that no longer declares the workflow — the existing header is left exactly as it is, whether it is stillrunningor already settled atterminal_failure, because itsattemptsand its node journal are real and this failure attempted nothing; the worker emits a line naming the status it kept, and a keptrunningheader keeps reading asstalled, the dead-letter classification, rather than being rewritten toterminal. The one header this path does re-settle is one carrying its own mark —terminal_failuretogether with theworkflow_resolve_failedcode, which no other writer sets — so that a re-invocation of the same failing job stays idempotent.rayspec's live-smoke run diagnostics consequently print the workflow-journal line for these runs instead of reporting the run in neither journal. Upgrading. The first boot on this release changes the deployment's application version, and both of DBOS's claim paths are scoped by that column: a startable workflow is selected withapplication_version IS NULL OR application_version = $3, and crash recovery reads pending workflows withstatus = PENDING AND executor_id = $2 AND application_version = $3. Work leftENQUEUEDorPENDINGunder the previous version is therefore neither dequeued nor recovered after the upgrade, and nothing ages it out — DBOS's garbage collection skips exactly those states. Drain the durable queue before deploying this release. Work already stranded is released by re-stamping the column once from a database session:UPDATE dbos.workflow_status SET application_version = '<the doc-… value GET /recovery-scope reports>' WHERE status IN ('ENQUEUED','PENDING') AND application_version <> '<same value>'. Measured against a throwaway system database: anENQUEUEDrow left on the old version was still queued after the new version had been running for twelve seconds, and ran within seconds of the re-stamp. One knob also stops working on a durable worker: DBOS seeds its version fromDBOS__APPVERSION, butDBOS.launchprefers the config field this platform now supplies, so that environment value no longer decides the worker's version. What did not change. The happy path writes exactly what it wrote before — same header, same node states, same artifacts. The new journal write is scoped to the resolver alone and never widened over the engine, which keeps its invariant that an invalid spec never creates a run header; it is best-effort and cannot mask a failure, since it goes through the tenant chokepoint inside its owntry/catchand the original resolver error is rethrown either way, so the durable job still fails. A worker constructed without a document still gets DBOS's own computed version — the optional field is then absent from the DBOS config, which a DB-free test asserts in both directions. And the bound of the fence is exactly the value it derives from: it separates documents with distinct identities (product.id,metadata.name). Two processes serving the same identity share a version by design — that is what lets a redeploy consume its own queued work — so while one document is being rolled over, the older process can still claim a job for a workflow only the newer document declares. Such a job is what the second half of this entry is about: it now fails with a journalled row rather than silently. Supplying a version also means the SDK version and the wrapper source no longer participate in it; what pins those instead is the exact@dbos-inc/dbos-sdkversion this package depends on and the compile-time DBOS key assertions that breaktsc -bif the config field is renamed or removed. (Issue #359.) rayspec deploy --dry-runnow judges a backend-profile document by the backend grammar, so a documentdeployvalidates and boots is no longer reportedok: falseby its own preview. The dry run applied the product ruleset to every document: a product document was parsed by it, a frontend-only one was rescued by an explicit classification arm, and a backend one had no arm — so the product grammar's rejection became its verdict. One document, one binary, three answers:doctorandplanaccepted it,deployvalidated and booted it, anddeploy --dry-runreturnedok: false, exit1, andno_code_in_yamlviolations about the veryhandlers,tooling,triggersandextensionskeys that profile is made of — scaling with the document, so a larger spec produced proportionally more of them. A deployment spec that declares only an extensions pack was rejected on that key alone (the shippedexamples/stream-backendandexamples/agent-pack-deploymenteach came back with one violation atextensions[0].module). A backend document that declares no handlers or tools was rejected just the same, only in the product grammar's other vocabulary: a purely store-backed one (the shippedexamples/notes-ui) carried no code-like key for that lint to fire on, so it came back with the product shape rejections instead — a missingproduct:section, a missingstores[].key, andunknown_fieldon itsapiandfrontend. The failure was authoritative-looking in the direction that hides work (spec did not validate), and nothing in the output said a different profile's ruleset had been applied. It was also wrong in the other direction: a backend document with a real defect — a dangling handler referencedoctorreports asdangling_ref— came back carrying the same product lint and never the actual error, so the arm could neither pass a good document nor diagnose a bad one.--dry-runnow dispatches on the document profile before parsing — the orderplanalready uses — and validates a backend document with the parserdoctorandplanuse. Consumer-visible verdict change: such a document now returnsok: trueand exit0where it returnedok: falseand exit1, carrying a newbackendProfileblock — the profile named plus the declaredstores,routes(METHOD /path),agents,handlersand, when the document declares any,frontendMounts: declared names only, no SQL and nothing derived — as the counterpart of thecomposedandstaticProfileblocks. It covers the sectionsplanalso projects (stores,routes,agents) plus the declared handler ids; it is notplan's own payload, which publishes no handlers and carries richer store/route objects.ok: truethere means the document validates, never that it boots, and itsnotProvensays so: the shared boundary plus this profile's boot refusals (astreamroute with no blob backend configured, a declared handler module that does not resolve as compiled JavaScript under the jailed root, theSTT_PROVIDER/TTS_PROVIDERcredentials demanded at boot, and a declared frontend mount whose directory does not hold servable built assets — a backend document that also serves a bundled UI, asexamples/notes-uidoes, boots the full platform, which refuses an unservable mount fail-closed). A document the backend grammar rejects now reports its own violations. A caller gating on the JSON verdict therefore no longer has to know which ruleset was applied. Product and frontend-only documents are untouched — same verdict, same errors, byte-identical payloads — and the profile dispatch keeps the boot dependency graph off every product document's dry run exactly as before.- A malformed
init.enqueuecall now fail-closes with a clear error naming the expected{ agentId, input }shape, instead of answering404. The capability takes one request object. Called positionally —init.enqueue(agentId, input), the shape the name reads like — the string landed where the object was expected,agentIdread asundefined, the registry lookup missed, and the request ended as404 NOT_FOUNDwith the uniformNot found.body: a declared route reporting a not-found from a handler that demonstrably ran, which sends debugging to routing and mounting. A handler ships as an.mjsmodule, so the published type protects a type-checked call site only. The closure now refuses a malformed argument — anything that is not an object carrying a stringagentId— before it reaches the shared enqueue core, with a500 INTERNALwhose message names the capability, names the expected{ agentId, input }shape, reports the type of the argument that arrived (never its value), and names the call form that fits what arrived — that the capability is not positional when a bare positional argument landed, thatagentIdis absent or not a string when the request object itself arrived.500rather than400or404because a mis-call is a defect in the handler's own code, not something the HTTP caller did — the same register in which this capability family already fails closed (an absent capability throws to500, and a nullish mis-call already reached500). The refusal is written as a shared shape the other optional capabilities (blob,fsSource,mintPlayToken,stt,tts) can adopt at their own seams: each supplies its own name, expected argument and call form, because the family is not uniform on the call form (blob.put(key, body, opts?),fsSource.read(path, opts?),stt.transcribe(bytes, opts?)andtts.synthesize(text, opts?)are positional, whileenqueueandmintPlayTokentake one request object). None is retrofitted here. Note the status change: a call that answers404today answers5xxafter this change, so a deployment alerting on 5xx rates will see it. An undeclared but well-formed agent id is unmoved — it still answers the uniform registry-bound404— and a correct object-form call is untouched. rayspec --help(and-h) is now answered as a help request — exit0, on stdout — and, named after a command, prints that command's help instead of the whole manual. Every spelling was a usage error:rayspec --helpexited2from the leading-dash check,rayspec deploy --helpandrayspec dev db --helpfrom the subcommand's strict argument parser, andrayspec dev --helpfrom the group dispatcher — and in every case thecliErrorenvelope and the usage text went to stderr, leaving stdout empty. A CI smoke step or aset -escript runningrayspec --helptherefore failed on a successful help request and had nothing readable on the stream it was reading. All three paths now answer ahead of the check that rejected them, the same interception point--versionuses:rayspec --help,rayspec <command> --help, andrayspec <group> <sub> --helpeach exit0and print to stdout, withrayspec dev --helpanswering for all threedevcommands andrayspec dev db --helpfor that one alone.rayspec deploy --helpnow shows deploy's six flags (--dry-run,--check-env,--port,--host,--apply-migration,--allowlist) without the rest of the manual around them.This is the one documented exception to "every subcommand emits exactly one JSON object on stdout": the help text is plain text, and every place that carried that promise — the CLI reference's Conventions section and both published package READMEs — now names the exception rather than leaving it quietly broken. Nothing else moves — a genuine usage error (an unknown subcommand, an unknown option, a token after the help flag) is still exit
2with thecliErrorenvelope and the usage text on stderr, and past the command path the vector is still that command's own to parse, so a-hwritten further along means exactly what it meant before. The usage text itself is now assembled from one self-contained block per command, so a command's flags are described in a single place that both its scoped help and the general usage read from.- A valid API key calling
GET /v1/auth/menow receives403 FORBIDDENwith a message naming the actual situation, instead of401 UNAUTHENTICATED — "Authentication failed.". The key authenticated fine; the route answers a user identity, which a key principal (apikeyorm2m) does not have. The old401claimed the credential failed and invited clients to re-authenticate, which no re-auth can fix; the response now saysThis endpoint answers a user identity; the authenticated key principal has none.— uniform with the403the platform management routes give an authenticated-but-not-permitted key, but without amissing_permissionhint, since no grantable permission would make the route answerable for a key. A JWT or cookie-session user still gets its200unchanged, and an invalid or absent credential still gets the uniform401. - A refreshed access token carries
mship_roleagain, resolved from live membership at refresh time.POST /v1/auth/refreshre-minted the JWT without the role claim, so after the first refresh (8 minutes in, at the defaultRAYSPEC_ACCESS_TOKEN_TTL_SECONDS = 480) every claim-trusted permission (store:read,agent:run,agent:read,org:read,apikey:read) answered403 missing_permission, while every sensitive permission (store:write,apikey:mint,apikey:revoke, the org-management ops) kept working through its live-membership recheck — an inverted session where writes succeeded and reads failed. Both refresh paths — the normal rotation and the grace-window double-submit re-issue — now resolve the role from live membership for the session's current org, the same source login uses, so claim-trusted reads keep answering 200 across refreshes and the workaround of following every refresh with an org switch is no longer needed. A membership revoked between login and refresh yields a token without the claim — fail-closed, exactly as a fresh login would. - A frontend served beside an API now carries the same
Content-Security-PolicyandPermissions-Policythe static profile has always emitted. A static-profile boot (a frontend-only spec) answers every response with the two headers — secure defaults (default-src 'self'; frame-ancestors 'none'; object-src 'none'; base-uri 'self'/camera=(), microphone=(), geolocation=()), each overridable verbatim viaRAYSPEC_FRONTEND_CSP/RAYSPEC_PERMISSIONS_POLICY. The moment the same spec grew its first store, the boot took the full-backend path, whose global header chain deliberately leaves CSP to a fronting proxy — so the served frontend lost both headers and the two env vars silently stopped doing anything, on exactly the documented core posture (trusted, self-hosted, single node) that has no proxy in front to add them. Now every response a declaredfrontendmount itself serves — a file, the SPA fallback, a custom404.htmlpage, a range416, a method405— carries both headers, resolved from the SAME defaults and the SAME env overrides as the static profile through one shared code path, so the two boot shapes cannot drift. Nothing else moved, measured as a before/after diff of full header sets: API and auth responses (/health,/v1/...) still emit no CSP and no Permissions-Policy, and a static-profile boot's responses are byte-identical to before. - An unparseable
RAYSPEC_CLEANUP_SCHEDULEnow aborts the boot with a refusal naming the variable and the value, instead of the scheduler's own error. The expression used to be handed to the worker's scheduler exactly as written: shorthand such as@dailyor a 4-field expression killed the launch with an unhandledTypeError: Cannot read properties of undefined (reading 'replace')that named neither the variable nor cron, while an out-of-range field (99 99 99 99 99) at least got the parser's field error — still without the variable name. The boot now attempts the parse up front, through the scheduler's own parser rather than a second cron grammar (so a value accepted at boot cannot diverge from one the scheduler accepts), and an operator who mistypes the crontab seesBoot aborted — RAYSPEC_CLEANUP_SCHEDULE='<value>' is not a crontab the scheduler can parse (<the parser's own detail>), in the same shape as the other env refusals. Every currently-valid value is unaffected: a 5-field or 6-field expression reaches the scheduler byte-identically, and unset or blank still resolves to the documented0 3 * * *. One surface grows: the check runs where the rest of the environment is resolved, so a boot that wires no durable worker — an auth-only boot, or a classicrayspec.yamlwithout one — now also refuses an unparseable value it previously ignored, with one exception: a frontend-only document is outside the check's scope, because both documented entrypoints branch it to the static profile — whoseloadStaticServerConfigresolves no cleanup knob — before the environment is resolved, so such a boot still serves an unparseable value here, exactly as it still serves a malformedDATABASE_URLor a non-numericRAYSPEC_GDPR_RETENTION_DAYS. rayspecrun from a vendored checkout now honors the invoking project's./.env. The CLI's.envauto-loader resolved the file relative to its OWN install location — always the RaySpec install root, never the caller's project — so in the vendored/submodule layout the brownfield docs recommend, a product repo's./.envwas silently ignored and the boot failed closed claiming a variable is missing even though the file set it. The loader now searches$PWD/.envfirst and the install-root.envsecond, with the same parser and the same per-key no-override rule, so the effective precedence is: real environment >$PWD/.env> install-root.env— an earlier source always wins per key, a later one only fills what is still unset.RAYSPEC_SKIP_DOTENV=1keeps skipping the auto-load entirely, now covering both candidates; a run from the RaySpec install root, where the two candidates are the same file, behaves exactly as before.- A missing-required-variable boot refusal now names the
.envpaths that were searched.rayspec deploy's fail-closed refusal for a missing required variable gains a trailing(searched: <$PWD/.env>, <install-root .env>)— the auto-loader's candidate paths in precedence order, each listed whether or not the file existed, which is the diagnostic: an operator whose./.envsits in the invoking project sees at once whether the file they populated was even a candidate. Paths only, never file contents or values; a refusal for an invalid or unsupported value is unchanged, and underRAYSPEC_SKIP_DOTENV=1the suffix is omitted because nothing was searched. - A subscription cursor with a zero-padded sequence is refused rather than coerced.
GET /v1/subscribe?since=<tenant_id>:007answered200and resumed from 7, skipping the seven events below it, and:00replayed the stream from the floor — while the route's own400body, the spec reference and this changelog already described a padded sequence as refused. The sequence half must now be the canonical spelling the stream itself writes:0, or digits with no leading zero. No cursor this platform issues is affected: the SSEid:is built by interpolating a number, so it never carries a leading zero, and a client echoing anid:back (asLast-Event-IDor?since=) resumes exactly as before —:0, the replay-from-floor cursor, included. (Issue #385.) rayspec-servenow honours the invoking project's./.envtoo — the other half of the.envdefect this release closed for therayspecCLI. The CLI gained a two-candidate search;rayspec-servekept resolving a single path relative to its OWN install location — always the RaySpec install root — so one checkout could hand the two documented entrypoints different configuration. With a./.envin the invoking project and another at the install root naming, say, a differentDATABASE_URL,rayspec deploy <spec>opened the first andRAYSPEC_SPEC_PATH=<spec> rayspec-servethe second, with nothing said either way. Both entrypoints now search$PWD/.envfirst and the install-root.envsecond, deduplicated to a single read when they are the same file, through the same parser and the same per-key no-override rule — so the effective precedence is: real environment >$PWD/.env> install-root.env. Everything else about the loader is unchanged:RAYSPEC_SKIP_DOTENV=1still skips it entirely, now covering both candidates; an already-set variable still wins over both files; a literal\nis still unescaped, which is what makes the single-line PEM form work; and a file that does not exist is still silent. The boot's refusals are unchanged too —rayspec-servenames no searched paths, whererayspec deploylists them. The one thing a deployment could notice: arayspec-servestarted from a directory that happens to contain a.envnow reads that file, project file first. Started from the install root, where the two candidates are one file, it behaves exactly as before. (Issue #384.)- A
numericcolumn holding aNaNis refused on read, like a non-finitedouble— and a page that serves it no longer mints a cursor no client can follow. PostgreSQL'snumericacceptsNaN, which is not a decimal at all. Neither write path produces one — the request body validator and the handler facade both check the same plain-decimal shape — so only a direct SQL write or a hand-written migration can plant one, and until now both read paths handed it straight out: the HTTP read returned200with"amount":"NaN"under a type documented as the exact stored value in PostgreSQL's canonical rendering with exactlyscalefractional digits, and the handler facade returned the same string to an escape-hatch handler, astore_readnode and the views interpreter. The follow-on was worse than the value: a keyset page ordered on that column minted anX-Next-CursorcarryingNaN, and the next request rejected its own cursor withFilter '<column>' must be a plain decimal string (no exponent).— a400on a filter the client never wrote, with no way to page past the row. Both serializers now refuse such a value with the same400 VALIDATION_ERRORshape thebigintanddoubleread guards use, naming the column and the row id and never the value. A page is serialized before its pagination headers are minted, so the refusal takes the whole page and mints no cursor: on any route that serves the column, the feed cannot strand a client mid-scroll. The guard reaches exactly as far as the serializer and no further — a route whoseprojectdrops the column never serializes it, so the guard never sees the value; that page is served, and becauseorderis validated against the store's columns and not against the projection (the documented author-named query surface), a page ordered on the dropped column still mints theNaNcursor the next request refuses. Both arms — the refusal and its reach — are pinned instore-fractional.db.test.ts, each with the other as its accept control. This is the one read guard keyed on the DECLARED column type rather than the value shape, and it has to be: anumericvalue is a string, exactly like thetextvalue beside it, whereNaNis ordinary data no read may refuse. Nothing legitimate is affected — every rendering PostgreSQL produces for a decimal passes the check,±Infinitycannot reach a column that declares a precision and scale (the DB refuses it), and recovering a planted row stays a SQL-level operation, the same price the other two read guards already state. - A timestamp filter through the handler facade takes an ISO string, instead of failing as an internal fault. The facade's contract is plain serializable rows: it hands a handler an ISO string for a timestamp column and accepts one on the write path. A filter did not: the value went straight to the driver, whose timestamp mapper calls
.toISOString()on it, so a string raised a rawTypeError— a 500-shaped fault for what is a handler input mistake, where every other facade input guard produces a400. It applied to all three filter forms (an equality value, anINelement, and agt/gte/lt/ltebound), so a handler could not express "rows since this timestamp" with the value the same facade had just returned. All three now pass through the write path's own coercion: a parseable string becomes theDatethe driver wants, and an unparseable one is the existing typed input refusal with its existing generic public message. ADatebound is untouched, and no other column type is coerced on a filter — the write range bounds still belong to the write path only. - A store column named
__proto__is serialized instead of silently dropped on the un-projected read path. Such a column is a legal declaration (the identifier rule admits it, the doctor passes it, the write path stores it), and a route declaring aprojectalready serialized it correctly. A route without one did not: the serializer accumulated into a plain object, whereout['__proto__'] = valueis not a property write at all. A string value was silently swallowed — the column simply vanished from the response, with no error anywhere — and a value from ajsonbcolumn of that name REPLACED the response object's prototype, so the column vanished and every key of the stored value became readable through the response object. Both paths now accumulate into a prototype-free object. Nothing else moves: an ordinary column is an own property either way and serializes to the same bytes in the same order, so the only response this changes is one whose store declares a column named exactly__proto__— which could not reach the wire at all before. It is the only name with that property: on a plain{}every otherObject.prototypemember (constructor,toString, and the rest) already assigned as an own property and already serialized, because__proto__alone is a setter rather than a plain key.
# documentation
- The two prose lists of which columns
omitInjecteddrops can no longer age quietly. TheResponseProjectiondoc comment in the grammar and theprojectsection of the spec reference each spell out, by name, the seven server-injected columns a projection removes and the sparedid. Both are correct today — checked against the generated injected-column list — but both were written by hand, while the code that enforces the rule derives the set from that generated list. A ninth injected column would change what the platform does and leave both documents quietly describing the old set, with nothing to notice. A test now reads both documents off disk and compares the names they list to the injected set minusid, so adding an injected column turns it red until both documents name it. The chain closes end to end: the set the test compares against is this package's copy of the injected columns, which is itself pinned by an existing equality assertion against the generated list. The extractor requires exactly one marker sentence per document and throws otherwise, so rewriting the sentence out of reach — or duplicating it — fails loudly instead of silently finding nothing and passing. No prose changed and no behaviour changed — what is new is that the next injected column reds a test instead of aging two documents. - The list of boots that ignore
RAYSPEC_AGENT_TRACINGwas wrong in the direction that matters..env.examplenamed two wrappers as the ones that "assemble the server themselves and never read this variable at all". Five boots assemble the server themselves. The three the list omitted are the per-example demo wrappers —examples/contract-intake/dev-boot.mjs,examples/support-intake-chat/dev-boot.mjsandexamples/support-ticket-triage/dev-boot.mjs— and they are the worse case: they read no trace-export setting and print no boot banner. Two of the three call a model —contract-intakeandsupport-intake-chatdeclare an extractor, default to the live extraction path, and abort by name withoutOPENAI_API_KEY— so on those a demo run keeps the agent SDK's exporting default with nothing said either way.support-ticket-triagedeclares no extractor and demands no model credential, so it makes no model call and has nothing to export; it belongs on the list because it reads the variable no more than the other two do, not because it exports. An operator reading a two-item list concludes the boots it omits honour the variable. The entry no longer enumerates the ones that do not read it against a list that can rot: the two wrappers that print the banner now read the variable (above), and the demo wrappers are named as a shape —examples/<slug>/dev-boot.mjs— with what they do state plainly, along with the agent SDK's own switch as the way to stop that export in their environment. - A third "same boot" sentence is qualified, and the
.envsearch's install root stops being called a checkout root. The equivalence betweenrayspec deploy <spec>andRAYSPEC_SPEC_PATH=<spec> rayspec-servewas corrected in the getting-started guide earlier this release —deployseals the product-store registrar after its boot returns and defaults the agent trace export off,rayspec-servedoes neither — while the CLI reference stated the same equivalence unqualified. It links to the corrected passage, so a reader gets there; the clause is now on the sentence itself, and on this changelog's own restatement of it. Separately, the two-candidate.envsearch was documented as ending at the "checkout root". It ends at the install root: the loader resolves it four segments above its own module, which is a checkout root only when you run from one. Installed from the registry those four segments land outside the package — the consuming project's own root under npm's flat layout, where it is usually the same file as$PWD/.envand the two candidates dedupe to one read, and a directory insidenode_modules/.pnpm/under pnpm's. In neither layout is it the unscopednode_modules/rayspeclauncher package, which ships a bin and no loader.install rootis what this changelog's own normative sentences for issue #384 already used, so the reference, the environment example, the server package README, the authoring skill and the two loaders' own comments now all say it, and each names how that root is resolved rather than assuming a layout. The missing-required-variable refusal keeps listing the resolved paths themselves, which is the one place an operator reads the actual directory off a real run. The authoring skill additionally still attributed the two-candidate search to the CLI alone; both documented entrypoints have run it since issue #384. Two stale module paths in the CLI loader's comments (packages/cli/{src,dist}, which has never existed at that spelling) are corrected in the same pass. - The column-type vocabulary is swept:
doubleandnumericnow appear everywhere the closed set is enumerated. The reference page was updated when the two fractional types landed; the two surfaces a reader actually starts from were not. The concepts page still called the vocabulary "text,uuid,timestamp,integer,bigint,boolean, andjsonb" — the first thing a first-time reader is told about columns, and flatly wrong. The authoring skill repeated the seven-type list in three more places and, under what it cannot express, told an author that floats map tojsonb. Every one of those now names all nine types. Widening a list is not enough on its own, becausenumericis the one column type that does not parse without more:precisionandscaleare REQUIRED on it and rejected on every other type, and an author following the old list would have writtentype: numericand met a lint error the page never mentioned. So the skill's store reference gains the two keys and a short entry on the pair —doubleis float64 on the wire and never money;numericis the exact decimal, crosses the wire as a string in both directions, and refuses a JSON number — and the concepts page names the split in one sentence. One place stays at seven ON PURPOSE and now says so: thejsonTypeset of agen-handlerholes file, which is what the renderer can emit a coercion for, not what a store may declare. - Three sentences that had outgrown the code they describe. Each states a closed set that a later change widened, and each is now the set the code actually implements. The reference page called the
typescript_handler_moduleadvisory "the one a.tsmoduleraises". The trigger set is four-wide —.ts,.tsx,.mts,.cts, matched case-folded from one shared vocabulary — so an author reading that sentence could reasonably conclude a.tsxhandler raises nothing and needs no build step. The same page enumerates the surfaces thebigintJSON boundary is enforced on, and the list predates the comparison filters: a?<col>__gt=-family bound is coerced by the same routine as equality and refuses an out-of-range value identically. The sentence understated the enforcement rather than over-claiming it, but an enumeration that is read as exhaustive should be one. The concepts page promised anX-Next-Cursor"on every non-empty page". A relevance-ranked full-text page is ordered by rank rather than by a stored column and therefore mints no keyset cursor — the one non-empty page that carries none. That exception was already stated on the reference page, in the OpenAPI document and in the authoring skill; the summary page is now consistent with them, which matters because a client polling that header is the reader most likely to have started there. rayspec deploy --host <addr>is documented. The flag has always been accepted and has always been printed byrayspec deploy --help, but the CLI reference's deploy section described the other five flags and not this one — both synopsis forms that carry[--port <n>]omitted it, and so did theFlags:summary, leaving--hostin the whole document exactly once, inside the quoteddeploy --helptranscript. So an operator reading the deploy section learned neither the flag nor the loopback bind default from it; both were reachable by running the help text, or from theRAYSPEC_HOSTentry in.env.example, the environment surface this reference points readers at. The section now names--host <addr>in both synopsis forms and in the summary, and carries a bullet for it: it writesRAYSPEC_HOST, overriding an ambient value, exactly as--portoverridesPORT; unset, blank or whitespace-only binds loopback, so a deployment is not reachable off-box until an operator names another interface; the boot banner reports the address actually bound rather than a fixed loopback string;--dry-runand--check-envbind nothing, so each accepts and ignores it — where both refuse--apply-migration/--allowlist; and it moves the listen address only, leaving the OIDC issuer at itshttp://127.0.0.1:<port>/oidcdefault, so a deployment bound to0.0.0.0keeps emitting loopback OIDC URLs untilOIDC_ISSUERnames the address its clients reach it on. A@rayspec/clitest now reads deploy's option set out of the argument parser that declares it and fails when a flag the command accepts is missing from either of those two places; the per-flag bullets are not covered, because--portand--allowlistcarry none. Nothing about the command changed — the flag, its loopback default and the help text are exactly as they were.- The getting-started backend-profile walkthrough now points at
rayspec deploy --check-envbefore the first boot, so a reader can ask for the environment its document demands instead of discovering it one refused boot at a time. The section walks the reader into a boot whose requirements it never lists up front: the surrounding text explains that a missing credential fails the boot fast, and that refusal is clear on its own, but a document raising more than one demand answers them one at a time — and not every one of those attempts is cheap: the demand a declaredcron/manualtrigger raises is reached only after the boot has opened the database and applied the committed migration chain, while a missing backend credential and the three config-load secrets refuse before the database is opened at all.--check-envwas already documented in the CLI reference and answers the whole set in one shot without booting; the walkthrough simply never mentioned it. The added sentence names thedeployspelling — therayspec-serveentrypoint the section's own code block uses parses no flags, sorayspec-serve --check-envboots as if the flag were absent — and bridges to it through the equivalence the page already states, thatrayspec deploy <spec>andRAYSPEC_SPEC_PATH=<spec> rayspec-serveare the same boot up to the differences that page names (product-store sealing and the agent trace-export default), neither of which changes what a document's boot demands. It is scoped to what the check reports (the variables the document's boot will require, why, and whether each is set) and does not present a passing verdict as a boot that will succeed: the check validates no value and opens no database, so it answersokfor a document whose boot still refuses on a non-UUID tenant id or a TypeScript handler module, and it links the CLI reference for what it deliberately does not check. Documentation only — no command, flag or behaviour changed. - The default Content-Security-Policy a served frontend carries is now documented where someone deploying a built site meets it — and the shipped example stops violating it. The baseline is
default-src 'self'; frame-ancestors 'none'; object-src 'none'; base-uri 'self', which names nostyle-srcand noscript-src, so an inline<style>or<script>in a served page is blocked. The policy is right and is unchanged; what was missing is that meeting it required a browser. No request shows it: the response is a200carrying the exact bytes, socurl, the deploy output and the request logs all look correct and only the rendered page differs — the first encounter reads as "the deployment lost my CSS", with nothing connecting it to the policy. (The server-side signal for it is the boot warning listed under Added above.) Thefrontendgrammar reference, the getting-started static-serving walkthrough, the concepts page and the CLI reference now state the default value in full, that CSS and JS belong in files the page references rather than in inline code (a same-origin file is what the default allows), and thatRAYSPEC_FRONTEND_CSPreplaces that whole baseline verbatim — it does not add to it — when a page genuinely needs a weaker one. Every page underdocs/that mentioned those two headers framed them as a static-profile property —.env.examplealready described both boot shapes — and a full-backend boot stamps the same two, from the same two variables, on the responses its ownfrontendmounts serve, so each of those pages now says both shapes. The bundledexamples/notes-uipage carried itsloadNotesfetch helper as an inline script — the one shipped asset the platform's own default policy would have blocked; it now lives inweb/dist/app.jsand the page references it. No behaviour changed: the policy, the two environment variables and the served headers are exactly as they were. - Three example READMEs stop telling the reader to "register/switch to the tenant", which no deployment has ever allowed. A deployment cannot create its own tenant — the boot fail-closes on a
RAYSPEC_PRODUCT_TENANT_IDthat names no live org — aPOST /v1/auth/registercarrying anorgNamecreates a different, server-generated org (without one it creates no org at all, and the product calls then answer404), andPOST /v1/orgs/{id}/switchanswers a bare404(Not found.) to an account that is no member of the target, so following the sentence left the reader serving their own tenant rather than the one the demo seeds: reads there answer200over no data (GET /tickets→{"tickets":[]}) and a turn is refused403with the reason named (cross_tenant). The three files needed two different corrections, because the situations differ. Inexamples/support-intake-chat/README.mdthe dev-boot seeds the org00000000-0000-4000-8000-000000000043and no user, and its foursupport_catalogrows are seeded under that tenant alone; the README now walks the shipped path instead —rayspec tenant ensureagainst the demo's ownplay_support_chatdatabase mints an owner invite for that exact org, andPOST /v1/invites/acceptredeems it into an account whose201already carries an org-scoped token, so no login and no switch follow. It also states why theDATABASE_URLoverride is load-bearing (the dev-boot ignores.env's value, the CLI does not), why the invite file has to be deleted, and what a re-run does instead of minting a second token —already_ownedonce the org is claimed,pendingwhile an invite is outstanding, and--reissue-owner-invitefor a token lost before redemption. Inexamples/invoice-intake/README.mdandexamples/expense-claim/README.mdthere is no seeded org: the recipe already asks for an existing org uuid, so those two now say where one comes from — aPOST /v1/auth/registercarrying anorgNamereturns the new org's id asactiveOrgIdand a token already scoped to it, which is the valueRAYSPEC_PRODUCT_TENANT_IDwants, and it has to exist before the boot because the boot fail-closes on an id that names no live org. No behaviour changed — the correction is in the three READMEs, and the platform paths they now describe are the ones that already shipped. examples/contract-intake/README.mdnow says how to reach the tenant its dev-boot seeds. The wrapper seeds the org00000000-0000-4000-8000-000000000042and no principal — a booted demo has one org, zero users and zero memberships — so a reader who followed the README could call none of the product:PUT /files/{file_id},POST /files/{file_id}/submitandGET /contractsall answer401, and the file carried no auth step of any kind. Registering does not reach that org either: aPOST /v1/auth/registercarrying anorgNamecreates a different one andPOST /v1/orgs/{the seeded id}/switchanswers404to a non-member, whose own empty tenant then serves200on the reads and on an upload but is refused403at the submit, with the reason named (cross_tenant). The README now walks the shipped path instead —rayspec tenant ensureagainst the demo's ownplay_contractdatabase mints an owner invite for that exact org, andPOST /v1/invites/acceptredeems it into an account whose201already carries an org-scoped token, so no login and no switch follow. It states why theDATABASE_URLoverride is load-bearing (the dev-boot ignores.env's value, the CLI does not), whyRAYSPEC_API_KEY_PEPPERhas to be the value the demo booted with (the invite token is hashed under it, and under a different one it is refused at accept), why the invite file has to be deleted, and what a re-run does instead of minting a second token —already_ownedonce the org is claimed,pendingwhile an invite is outstanding, and--reissue-owner-invitefor a token lost before redemption. It also names this example's own upload pair,PUT /files/{file_id}→POST /files/{file_id}/submit: neither route appeared anywhere underexamples/contract-intake/— the capability mounts them, so the authored document does not declare them, and they were written down in the@rayspec/file-runtimeREADME, the authoring skill and the invoice-intake example, but nowhere in this example's own docs. No behaviour changed — the correction is in the README, and the platform paths it now describes are the ones that already shipped.OPENAI_BASE_URLandDEEPGRAM_BASE_URLare documented in.env.example. Both speech adapters read a base URL from the environment at call time — the OpenAI synthesis adapter and the Deepgram transcription adapter, each falling back to the provider's real host — and neither variable appeared in the environment surface the reference points readers at, so the only way to find the seam was to read the adapter source. The speech section now carries both, commented out besideTTS_PROVIDER, as what they are: optional test/dev seams for pointing a suite or a dev boot at a local stub, with the trailing slash stripped either way and unset meaning the real host. TheOPENAI_BASE_URLnote also states its blast radius, which is wider than speech: the vendoredopenaiclient defaults its base URL to that variable and the OpenAI agent backend constructs the client without passing one, so a boot that points the variable at a local stub sends that backend's model calls to the stub as well. Two backends are not redirected by it: Codex deliberately omits the variable (withOPENAI_API_KEY,CODEX_API_KEYandCODEX_BASE_URL) from the subprocess environment it builds, and Pi passes an explicit per-model base URL to every client it constructs, so that client never falls back to the variable — meaning a stub set here does not contain Pi. No behaviour changed — both variables were already read exactly this way.
# security
- A static mount's containment guard now inspects the name the file server actually reads. The mount handler decoded the request path with
decodeURIComponentand ran the fail-closed guard — dotfiles, traversal, and the realpath symlink-escape check — on that string, while@hono/node-server'sserve-staticresolves the path it decodes withdecodeURI. Those agree on every path except one carrying a percent-encoded reserved character (/ ? # : @ & = + $ ,), and there the guard cleared one name while a different one was served. A served directory holding a file whose literal name carries such an escape — for instance a symlink nameddocs%2Fgetting-started.htmlpointing outside the mount — answered200with bytes from outside the served directory, while the identical symlink under a plainly-spelled name was correctly refused. When the two decodings differ, the served name is now guarded as well — and, on acleanUrlsmount, the<name>.htmlcandidate the rewrite would resolve from it. The malformed-escape fallback is mirrored rather than approximated, which is the part that makes the guard complete: on an inputdecodeURIrejects,serve-staticdoes not fall back to the raw string but retries each escape run on its own, so a raw-string fallback here would have agreed with the other decoder on exactly the inputs where a third, different name is read (/docs%252Fgetting-started.html%readsdocs%2Fgetting-started.html%). Appended names are covered too.serve-staticresolves a directory to<dir>/index.htmland the SPA fallback names/index.html; neither string had ever reached the guard, so asub/index.htmlsymlink pointing out of the served directory answered200with its bytes forGET /sub— needing no unusual filename at all. Both are guarded now, matching the custom-404 branch, which already checked the name it appends. This is not a traversal:decodeURInever turns an escape into a/, and an encoded..was already refused by both decodings. For every path without a percent-encoded reserved character the two strings are identical, and the appended-name checks fire only where such a name is actually resolved, so an ordinary build sees no change. The behaviour predates this release; it is fixed here rather than carried, and pinned across three mount shapes with the plainly-spelled twin of each escaping symlink as the accept control. - Two checks that certified files they never read now reach them. The unscoped
rayspeclauncher — the package npm serves when a user installs the product — carries a bare name, and every--filterin the two required CI lanes was either the@rayspec/*glob or an explicit@rayspec/<name>. It was the only test-carrying workspace member no lane filter matched, so its suite ran in no required check: the only test of the shipped bin, four cases that spawn the launcher and the@rayspec/clibin side by side and compare exit code, stdout, stderr and the scaffold they write. Lane 1 now names it explicitly, which is where it belongs — the suite spawns two built bins and touches no Postgres — so the deterministic subset goes from 22 packages to 23. Separately, the anti-re-accretion gate (pnpm gate:no-archaeology) enumerates tracked files under a fixed path allowlist, and three example directories were never added to it:examples/live-workspace-events,examples/notes-uiandexamples/agent-boot-backend, 7 scanned files between them. Anything under a path the allowlist does not name is not read, so the gate passed on them the way it passes on a clean tree. Neither gap was hiding a live failure: the launcher suite is green on this tree and the three example directories carry no forbidden token — what changes is that a regression in either place is now loud instead of silent. The stale ci.yml comment pointing at apnpm gate:workspacescript (never defined in this repository, nor thegate:tracker-hygieneit named) is deleted rather than renamed, and the deterministic-subset count, wrong in both places it appeared, is corrected and now carries the derivation and the command that recounts it. Repository infrastructure only: no published package, API or runtime behavior changes. - The transitive
nanoidcopy behind the test runner is raised from 3.3.17 to 3.3.18 (GHSA-2v37-7h3g-55p8:customAlphabetandcustomRandomloop indefinitely when configured with a size of 0, hanging the calling thread). That copy has exactly one dependent,postcss, which is itself reached only throughvitest→vite, so it never ships in a published package — and the vulnerable functions are never entered on that path:postcssimports the plain generator fromnanoid/non-secureand calls it with a fixed size (nanoid(6)), nevercustomAlphabetorcustomRandom, and no source in this repository calls either. The fix is a patch release insidepostcss's declared range (^3.3.16), so the copy is pinned forward via a scopedpnpm.overridesentry (nanoid@3) rather than carried as a scanner exception. The dependency SBOM (docs/dependency-sbom.json) is regenerated to match. Thenanoid5.x copy behindoidc-provideris 5.1.16, past this advisory's fixed 5.1.6, and is unchanged; the graph still resolves to 485 distinct packages. - The transitive
nanoidcopy behindoidc-provideris raised from 5.1.15 to 5.1.16 (GHSA-28wg-ghj8-5hjv / CVE-2026-67214: thenanoid/non-securegenerators can loop indefinitely when given a negative size). The vulnerable module is not reachable here —oidc-providerimports the securenanoidentry point and nevernanoid/non-secure, in either of the two helpers that use it, so the affected generators are out of reach regardless of the size passed. (Only one of those two helpers passes a fixed size:helpers/nanoid.jsbuilds a 43-character generator, whilehelpers/user_codes.jsderives its length from the user-code mask.) But the fix is a patch release insideoidc-provider's declared range, so the copy is pinned forward via a scopedpnpm.overridesentry (nanoid@5) rather than carried as a scanner exception. The dependency SBOM (docs/dependency-sbom.json) is regenerated to match. The separatenanoid3.x copy (dev-only, behindpostcss) is not affected by this advisory; it is raised for a different one, above. - The transitive
@hono/node-servercopy behind the MCP SDK is raised from 1.19.14 to 1.19.15, and the repository's last scanner exception is retired with it (GHSA-frvp-7c67-39w9: a path traversal inserve-staticon Windows, reached through an encoded backslash). The reachability argument that carried the exception still measures true — that copy has exactly one dependent,@modelcontextprotocol/sdk, which uses the server for its JSON-RPC transport to a child process and never for static file serving, and the advisory depends on the Windows path resolver treating\as a separator. It was retired anyway, because the exception rested on a second claim that did not survive measurement: raising the copy was said to force a foreign major version onto that SDK, when the advisory's fixed version is a patch release inside the range the SDK declares (^1.19.9). So the copy is pinned forward via a scopedpnpm.overridesentry (@hono/node-server@1), exactly as the twonanoidcopies above are, rather than carried as a scanner exception.osv-scanner.tomlnow declares no suppressions at all, so every advisory the scanner matches fails the dependency-audit lane. The direct dependency is untouched at 2.0.10, the dependency SBOM (docs/dependency-sbom.json) is regenerated to match, and the graph still resolves to 485 distinct packages.
# upgrade notes
Everything below is documented in place above; this is the checklist. Nothing here applies to a deployment that only authors specs and deploys them — the items are for embedders, for operators of an existing database, and for authors of documents that were silently doing nothing.
- Two exported types gained REQUIRED members, so an out-of-repository implementation stops typechecking until it grows them.
ServerConfig(@rayspec/server) gains three:frontendCsp: string,permissionsPolicy: stringandauthRateMultiplier: number. A deployment that builds its config withloadServerConfigneeds no change — it fills all three from the environment; only code that constructs the object literally is affected.FrontendSpec(@rayspec/spec) gainscleanUrls: booleanin its OUTPUT type, so a literal built outside this repository needs the key; parsing a document is unaffected, because the field carries a default. - A document with a mapping key written literally as
__proto__no longer parses. It used to, and then quietly did nothing with whatever sat under that key — arenamerenamed nothing, a view field vanished from the response. It is now a namedreserved_document_keyerror at the parse boundary of both profiles. If a document relied on that key surviving into a free-form slot (a tool'sparameters, the body of acontractsentry), rename it before upgrading. RAYSPEC_AUTH_RATE_MULTIPLIERnow has a ceiling and refuses a value above it by name, the way its sibling knobs already did. A deployment that set an implausibly large multiplier must lower it or the boot stops.- A static mount refuses a served file whose on-disk name carries a percent escape when the two decoders disagree about it, and refuses a directory index or SPA shell that resolves outside the served directory. Both were served before; neither shape is produced by an ordinary build.
# added
A run executing in another process can now be ended promptly instead of burning until it returns: set
RAYSPEC_RUN_CANCEL_POLL_MS. Cancellation (thePOST /v1/runs/{id}/cancelentry below) has two halves, and only one of them crosses a process boundary: the per-run record every dispatch consults does, the abort signal does not. The abort lives in a process-local registry, and by default nothing re-reads the record while a run is waiting for its provider, so a run on another worker holds its slot and keeps spending until the call comes back by itself. With this variable set to a number of milliseconds, a run that is executing re-reads its own record on that interval and aborts its own controller. That abort is the one the in-process path delivers, so everything after it is that same path: the same terminalerrorheader, the same journal, the same refusal of every seam the abandoned call reaches for. What that journal holds follows the invocation shape rather than which process cancelled — measured against an in-process control run through the identical invocation shape, the terminal state and the journal are equal.Off by default, and off costs nothing. Unset — the default, and what any unusable value resolves to — no read is issued at all. (The handle itself is not otherwise idle: the dispatch chokepoint writes the
run_taintmarker through the same one before a non-idempotent tool fires. What is unchanged is that the cancellation path adds no read to it.) Set, the cost is one indexedidempotency_keyslookup per in-flight run, per interval, per worker process, issued on the run's autonomous-commit handle — the worker's second connection, the one the taint marker already uses — and never inside the run's own transaction, because a read that failed there would abort that transaction server-side and take a healthy run down with it. The reads are chained rather than periodic, so at most one is ever in flight per run and a database that has slowed down receives fewer of them rather than a backlog. A read that fails is treated as no answer and asked again on the next tick: an unreadable record never ends a run. 1000–5000 ms is a sensible range; there is no floor, and a shorter interval buys cancellation latency rather than more safety.Every rule cancellation establishes still holds with the variable set. A cancelled run is never automatically re-run — the record is what makes it un-dispatchable — and a run that had already fired a non-idempotent tool is quarantined: its taint marker was committed on the autonomous handle before the side effect, so the run's rollback cannot take it with it. One observable difference, for a cross-process cancellation only: the run now ENDS where it runs, where without the variable it ran to completion. What survives in its journal then follows the invocation shape rather than which process cancelled — it is exactly what an in-process cancellation leaves in that same shape. On the durable worker the run executes inside a transaction, so it rolls back and the steps journaled there are discarded: the run ends with the single
cancelledstep. On the synchronous HTTP path there is no transaction, so the steps it already committed are kept beside thecancelledone. Both are measured.POST /v1/runs/{id}/cancel'ssignalledfield means "this process's registry reached it", so it staysfalsefor a cross-process cancellation even when that cancellation lands. And the message a cancelled run reports is worded to stay true in both configurations: a model call in flight on another worker "runs on until that process observes the cancellation itself".A backend can now bind its authentication at the moment the run identity exists, instead of before it: the neutral
Backendcontract gains an optionalpreflightAuth(). A run's auth mode is resolved once, before the run starts, and threaded onto the run context so every journaled step attributes to one mode — that ordering is what makes the attribution honest by construction, and it is not moving. It is also perfectly workable for a local adapter, which reads its own environment and needs no run identity to know how it authenticates. A remote backend cannot work that way: at that instant there is no run id, no tenant and no agent identity, so it cannot select a tenant- or run-scoped credential and can only report a mode it has not actually bound. A backend that implementspreflightAuth()is asked there instead, at exactly the same point in the run, and is handed the identity the server derived: the run id, the tenant, the agent's neutral name, the model, and — when the deployment supplies one via the newRunOptions.credentialBindingRef— an opaque credential-binding reference. The mode it returns is the run's pre-run mode, so it reaches therunningheader while the run is still in flight, every platform-dispatched tool step, and the billing rule that reads the mode.Nothing but identifiers crosses the seam. The payload is a closed set of plain strings the platform minted from what it already held — never model output, never a request body, never credential bytes. The binding reference is a handle the deployment mints and the backend redeems out-of-band; it is forwarded byte-for-byte and the platform never inspects, derives, logs or persists it. An answer outside the neutral auth-mode vocabulary, or a preflight that throws, ends the run closed — before the header transition, before any journal row and before any model call — so the refusal itself writes nothing: no
journal_stepsrow, norun_eventsrow and norunsrow of its own. On the synchronous run surface that leaves nothing behind at all, while a run enqueued through the API keeps theenqueuedheader that path writes before handing the job over, exactly as it stands — the refusal neither advances it nor adds to it. The refusal names the run, never the value it rejected, so a backend that mistakenly handed back its credential does not get it echoed into an error message.A backend that does not implement it runs byte-identically.
resolveAuth()is untouched and remains the contract's one required auth method. A backend that omitspreflightAuth()— or that carries it as an explicitundefined— takes the same singleresolveAuth()call at the same point it always did, and that answer is still used verbatim and unvalidated. The asymmetry is deliberate and it is not about which modes are acceptable — every member of the vocabulary,unauthenticatedincluded, passes the new check. It is about not inventing a failure the contract never had:resolveAuth()is declared to return anAuthModeand its answer has always been used as given, so validating it now would newly refuse a third-party backend that returns an off-vocabulary value at runtime, where today that run completes and records the mode it reported. The new validation therefore applies only to a preflight's answer, which is a value no existing backend has ever produced. No adapter in this repository implements the preflight, so every run in the tree resolves its auth mode by the identical code path it used previously, and no existing test needed changing.Three limits worth stating plainly. The preflight is not bounded: the run's wall-clock bound and its cancellation controller are both armed after this point, so a remote preflight that hangs holds the run — and, on the durable path, a worker slot and the open Postgres transaction the worker wraps the run in, which means a pooled connection for the whole time it hangs. Bounding it is a separate change. Nothing in this repository supplies a
RunOptions.credentialBindingRef: the platform mints no credentials and ships no remote backend, so the field is an injection point for a deployment's own composition root, and the only callers that set it here are tests. And anllmstep's auth mode is still whatever the adapter records — the Anthropic adapter deliberately reconciles it mid-run from the live session — so the bound mode is guaranteed on every platform-dispatched tool step by construction, and onllmsteps by the adapter honouring the context, exactly as it was before.One command now creates or resolves the organization a deployment binds to, from a deploy script, with no server running:
rayspec tenant ensure --org-id <uuid> --name <n>. A product or cron deployment has to be pointed at an organization that already exists, while the organization service owns id generation — so automating it meant booting the auth surface alone, registering a user through the public API, reading the generated id back, stopping, and booting the real profile. Four steps for a one-step need, and the temporary user it registered could never be removed: the last owner cannot be removed, and a user delete is a soft delete that leaves a row.tenant ensuretalks toDATABASE_URLdirectly and settles the whole thing in one call. It lives in a new top-leveltenantgroup rather than underdev, which is documented as local-development-only — that scoping was the gap.Running it twice with the same
--org-idis the same organization and no second row. The chosen id is the operation id:orgs.idis the primary key, so the database itself is the ledger and there is no second key or mapping table to keep. Two concurrent runs of the command converge rather than race — one reportscreated, the otherexisting, and both name the same org — and that holds against a fresh database, because the migration step is serialized by an advisory lock rather than left to a migrator whoseCREATE … IF NOT EXISTSbootstrap is not concurrency-safe. An id supplied in upper case is the same organization, reported as the database stores it, which is the form a deployment compares against (uuidgenprints upper case on macOS). That makes the command safe to call unconditionally from a script that cannot know whether an earlier attempt got through.The owner handoff leaves no platform user behind. With
--owner-emailthe command writes oneownerinvite — authored by nobody — in the same transaction as the organization row, so an organization is never created without the thing that makes it claimable. A real person then redeems it at the ordinary publicPOST /v1/invites/accept, which provisions their account with their password. The command creates no user and no membership at all. The minted token is written to an exclusively-created mode-600 file and appears in no output, no log line and no audit row; the result object has no field that could hold one. There is no flag that takes a token value either — a secret passed as an argument lands in shell history and inps.It has no HTTP route, in any posture. That is the point of doing it through the database rather than an endpoint:
RAYSPEC_TENANT_BOOTSTRAP_ENABLEDnever has to be set on a production deployment, soPOST /v1/auth/bootstrap-tenantis never registered on a production listener at all. It reads exactly two secrets —DATABASE_URLandRAYSPEC_API_KEY_PEPPER— through the existing<VAR>_FILEconvention with the same precedence and the same fail-closed abort, and deliberately notRAYSPEC_JWT_SIGNING_KEY, because it mints no JWT and a provisioning job should not have to carry the platform signing key.Two things to know before pointing it somewhere. It applies the committed migration chain to whatever
DATABASE_URLnames — required on a first bootstrap, idempotent afterwards, and a real side effect if the variable is not what you thought. And the token in--owner-invite-outis a tenant-takeover credential until it is consumed or expires: whoever can read that file owns the organization, which is why the operator default lifetime is one hour rather than the HTTP surface's seven days (--invite-ttl-secondsoverrides it, clamped by the same shipped bounds).Nothing that existed changes.
rayspec dev bootstrap-tenantandPOST /v1/auth/bootstrap-tenantare untouched and fully supported, and the local walkthrough through a running server still reads the same.createOrgWithOwneris not edited — the reservation is a new sibling method — so the publicregisterpath emits the identical INSERT it always has. No route is added, removed or re-registered anywhere; turning the bootstrap posture on still adds exactly one path and the reservation contributes none.InviteStore.createand.consumeeach gain one optional trailing parameter, so both shipped call sites compile to the same handle they did before. There is no migration, no new column and no new table.- The reserved store names are now drift-locked on both sides, and the authoring skill teaches them. The lint rule and the boot registrar read one shared constant; what could still rot was everything around it. The lock in
@rayspec/dbderived its expectation from a hand-written list of the platform tables, so a NEW global table added toschema.tsand forgotten there would have stayed unreserved — it now reads every table the schema module exports, which makes forgetting impossible rather than unlikely. The list printed indocs/spec-reference.mdhad no lock at all and could have drifted from the rule an author actually hits; a test now parses that very paragraph and compares it to the constant. And the authoring skill, which taughtreserved_column_nameand said nothing about store names, now names all sixteen and the three places the rule binds. The tenant bootstrap can target an org id you chose in advance:
rayspec dev bootstrap-tenant --org-id <uuid>. Org ids were server-generated without exception, which left the deployment variableRAYSPEC_PRODUCT_TENANT_IDin an awkward position: it has to name an org that already exists, so the only way to configure a deployment was to bring something up, create an org, read its id back, and re-provision with it. With--org-idthe id is settled first, and the deployment is configured with it from the outset. The org row and its owner membership are still created in one transaction, so a chosen id can never leave a memberless org behind — and that matters more than it sounds, because invites are owner-only andinvites.tenant_idis a NOT NULL foreign key toorgs(id), which makes an org with no owner a permanent dead end rather than an inconvenience. Without the flag the command is unchanged: the same request to the same route, and the database generates the id exactly as before.A chosen id travels over an operator-gated route, and never over the public one. The public, unauthenticated
POST /v1/auth/registerdoes not accept an org id and will not start doing so. The reason is concrete: a deployment binds itself to one org id, so if any public caller could name the id, somebody who learned the id an operator intends to deploy against could create that organization first, with themselves as owner, and the deployment would come up bound to an organization they control. Instead the chosen-id path is a separate route,POST /v1/auth/bootstrap-tenant, which a server registers only when it was started withRAYSPEC_TENANT_BOOTSTRAP_ENABLED=true(exact string, like the other operator gates). On any other deployment that path does not exist at all — a404, not a refusal — so there is no gate to probe and no collision reply to read as an org-existence oracle. Turn it on for the bootstrap boot; leave it off everywhere else.The deployment binds the org as the database stores it, not as the variable spells it.
orgs.idis auuidcolumn, so Postgres matches an id supplied in any letter case and hands it back canonically — while at runtime the bound tenant is compared as a string against a tenant the server derived from that same column (the capability sinks, the reprocess seam). Binding the configured spelling would therefore pass both boot checks and then refuse every capability event withcross_tenant: the same silent misconfiguration one layer down. That is not a thought experiment —uuidgenprints upper case on macOS and BSD. The boot now resolves the id and binds what the database returned, so a differently-cased id is simply the same org. The resolved value is additionally exposed asproductTenantIdon the boot result — an in-process signal for an embedder that assembles the server itself, not something the CLI prints.Embedder note:
ServerConfig— the assembly configuration exported as a type from@rayspec/server— gains a REQUIREDtenantBootstrapEnabled: boolean.loadServerConfigfills it from the environment, so anything that gets its config from there is unaffected; code outside this repository that builds the object literally has to add the field. It carries no default on purpose: the value decides whether an operator route exists at all, and a silentfalsewould be a guess about a deployment's posture rather than a statement of it.A 64-bit integer column type:
bigint, alongsideintegerrather than replacing it. The declaredintegertype maps to PostgreSQLint4, whose ceiling is 2 147 483 647 — for a column counting bytes, 2048 MiB. A store that measures anything real in bytes reaches that ceiling on a perfectly ordinary day, and because status rows are usually written in one transaction, the one value that overflowed fails the whole row. The failure reads like a dead writer rather than an arithmetic limit, which is what makes it expensive to diagnose.bigintmaps to PostgreSQLbigint(int8) and is a new member of the column vocabulary:integeris untouched. Widening it would have silently re-typed every already-materialized column in every existing deployment, and, as below, that re-typing is not free — nobody who declared anintegercolumn asked for it.A
bigintvalue crosses every JSON surface as a JSON number, and is refused rather than rounded when it cannot. JavaScript numbers hold integers exactly only up to 9 007 199 254 740 991, so that is the range this API serves, end to end: request body, response body, equality filter,<col>__inelement, keyset cursor. A value beyond it is a400 VALIDATION_ERROR— on the way in, and equally on the way out. The outbound half is the one worth stating plainly, because it can refuse a request the caller did not get wrong: a row can reach anint8column by a route that is not the HTTP write path — a hand-written migration, a direct SQL write, a low-level handler write, or a column that wasintegerbefore a reviewed type change. When such a row is read, the platform can either report the true number or refuse; it will never report a rounded one. The cost is concrete and deliberate: one out-of-range row makes the whole list page containing it fail, and the same bound on filters means you cannot query for that row either, so recovering it is a SQL-level operation. The error names the column and the row id — never the value — so the row is findable, and a page that failed this way carries no pagination cursor, so a client that pages by following one cannot skip silently past the page it never received. Below the bound nothing changes: values are exact, and the column is orderable, filterable, and usable as a keyset pagination column like any other.Changing an existing column from
integertobigintis gated, not automatic. The diff generator emits a singleALTER … SET DATA TYPE bigintand the destructive-migration scanner classifies it exactly as it already classifies any other type change without aUSINGclause: blocked unless a reviewed allowlist entry covers that exact statement, applied once one does. There is no "safe widening" carve-out, and the reason is what PostgreSQL actually does.int4andint8are not binary-coercible, so thisALTERperforms a full table rewrite while holding anACCESS EXCLUSIVElock, rebuilding the column's indexes along the way. Every value survives exactly; what is at risk is availability, and on a large hot table that is a real outage. That is a judgement about a specific deployment at a specific hour, which is precisely why it belongs to a human at review time rather than to a code path. An agent output property typedintegerornumberin JSON Schema is accepted into abigintcolumn by the same deploy-time compatibility check that accepts it into anintegerone; what differs is the write itself, which enforces the range above and, unlike anintegercolumn, refuses a numeric string rather than letting the driver bind it untyped.A declared route can declare its own rate limit: the new optional
api[].rateLimitfield. Declared routes have been throttled for a while, but only by two allowances shared across the whole declared surface — a strict one for callers whose credential does not validate and a generous one for those whose does. Neither of them knows anything about the path, so a route that costs a model call and a route that lists ten rows drew on exactly the same budget, and an author who could declare a route still could not declare what it costs.rateLimit: { windowSeconds: 60, max: 10 }on a route now gives that route its own budget of ten calls a minute, counted per tenant and principal for that route alone. Both members are whole positive numbers, rejected at parse time by the grammar and again at boot by the engine that turns them into a policy — so a spec assembled in code, which never meets the parser, still cannot start a server on a budget that would never throttle or never expire. The boot names the offending route and member.windowSecondsis additionally capped at 86400 (one day), refused by the linter while authoring and by the boot otherwise. That ceiling is not a security limit but a truthfulness one: the counters live in the serving process, so a window longer than the process is voided by the next restart rather than enforced, and a monthly quota declared here would silently reset whenever the fleet moved. A durable long-window quota needs a shared counter store, not a larger number.It is opt-in and additive, which are the two properties that make it safe to ship. Omitting the field is not a default budget — a route without one behaves exactly as it did before the field existed, and a spec that declares none anywhere does not so much as consult the limiter at boot. Declaring one does not replace the shared tier: a call must be inside both, so the effective allowance is the smaller of the two. That has a consequence worth stating in the direction people will actually try it — a declared
maxabove the tier ceiling cannot take effect, so the field can make a specific expensive route stricter than the surface it sits on and can never make one more permissive than it is today.What the budget deliberately does not do. It is enforced after authentication, because a counter keyed on tenant and principal needs a principal to exist. So an unauthenticated call still meets its usual
401and spends nothing, while a call that authenticates and then fails the permission check does spend budget before its403— the throttle sits ahead of the permission check on purpose, since both the permission check and the tenant resolution touch the database and an over-budget caller must cost no round trip there. It bounds load; it does not authorize. Over budget the answer is the same429 RATE_LIMITEDa tier refusal gives, through the same code path: the identical envelope,Retry-Afterin whole seconds anderror.details.retryAfterMs, fired before the route runs, so nothing executed and noIdempotency-Keyreservation was taken.The honest limits. The counters live in the process, exactly like every other throttle here, so a multi-instance deployment grants a caller one budget per instance it reaches; a hard cluster-wide ceiling needs either a shared front-line limiter or, for an embedder, the
SharedRateLimitStoreport described in its own entry below. Per-route buckets also multiply the number of distinct keys the one bounded in-process store tracks, and that store evicts the oldest live window when it is full — which hands that caller a fresh budget. A deployment with very many budgeted routes and very many principals can therefore see a limit reset early under key pressure, and that store is the single shared one: it also holds the authentication counters (login,register,refresh,oauth-token,invite-accept), eviction is by insertion age across all of them, so the window dropped under per-route key pressure may be an authentication throttle rather than a route budget. That cap is not a deployment setting — it is a constant of@rayspec/auth-corefixed at 100 000 keys and the server constructs its limiter with no arguments, so the lever a deployment holds is the numerator: declarerateLimiton the routes that are expensive rather than on all of them, and keep (budgeted routes × active principals) plus the authentication counters well under that number. A key count that cannot fit belongs behind a shared front-line limiter instead. Both limits are documented in the spec reference rather than concealed, and neither is changed by this release, the store's bound included. A streamplaybackroute may not declare arateLimitat all: it is authorized by a signed media token on its own middleware tuple and its media principal carries no API-key identity to count on, so a deployment that declares one refuses to boot with a message pointing at the route that mints the token instead — a silently ignored limit would be the worst available outcome. The served OpenAPI document follows suit: a budgeted route names its own allowance in its429, and the document's previous claim that each allowance is one budget for the whole declared surface is now scoped to the two shared tiers, which is the only place it was ever true.A run can be ended on demand:
POST /v1/runs/{id}/cancel. Until now nothing could stop an agent run. A synchronous request could give up waiting — that is what the held-request timeout does — but giving up on a request never asked the run to stop, so the model call kept going; and a run enqueued on the durable worker could not be stopped at all, so a provider that had accepted a request and gone quiet held a worker slot until its own retry window ran out. The new route ends a specific run. It is tenant-scoped like every other run route (a foreign or unknown id answers404and changes nothing) and requires the sameagent:runpermission that starting a run does. A cancelled run is terminal aserrorwith the neutral error classcancelled, journaled exactly like every other outcome, soGET /v1/runs/{id}reports it.cancelledis a terminal class, so a same-key retry replays it rather than re-running the agent — cancelling is never a silent re-run, least of all for a run that already fired a non-idempotent tool, which stays quarantined under its key with the taint marker as the record that it needs review. The response is200with{ runId, cancelled, status, signalled };cancelledsays whether this call made the run terminal, so it isfalsefor a run that had already finished (whose own outcome is never overwritten — which also makes a repeated cancel harmless) and for a run still holding its own header row — one executing on a worker process the abort signal did not reach, which records the cancellation itself when it ends. An executing run IS signalled first, so in the single-process shape it unwinds and the same call goes on to record it:cancelled: trueis the ordinary answer for a run caught in flight.What it stops, precisely, because the three cases genuinely differ. A run that has not started is recorded cancelled and never dispatched: the record is what a worker consults, so neither a first dispatch nor a recovery re-dispatch can execute it. A run executing in the same process is handed an abort signal, which run-core races the backend call against and puts on the run context, so the backend adapter can stop the work — this is the half that frees the run rather than only the caller waiting on it, and it is delivered before anything is written, so it is never queued behind the run it is ending. A run executing on another worker process gets no signal by default: the durable engine's own cancellation is cooperative and the whole run occupies a single engine step, so the model call already in flight is not interrupted and the run stops when it stops. (Setting
RAYSPEC_RUN_CANCEL_POLL_MSmakes such a run observe its own cancellation record and end itself where it runs — see the entry for it above.) It is still recorded cancelled — a run that finishes under a cancellation records the cancellation instead of its own outcome, and persists no output; a run that ends by failing has no result to record with and rolls back everything it wrote, so the worker records the cancellation once that rollback has happened — and it is never dispatched again. The cancel request never waits for the run it is ending: an executing run holds its header row for as long as it runs, so the terminal record is written by whichever side can write it — the cancel surface when the run is not holding it, the run's own side when it is.Which runs you can name. Cancellation is by run id, and the only call that returns an id before the run ends is an asynchronous one (
async: trueanswers202with therunId). A synchronous run does not return its id until it completes, and without anIdempotency-Keythe run surface never holds it at all — so in practice this cancels asynchronous runs. A synchronous request that is holding a run when it gets cancelled answers409 CONFLICT, and the run's terminal outcome is readable atGET /v1/runs/{id}either way.Backend support is uneven and the documentation says so.
openaipasses the signal into the SDK run call, so the model request itself is aborted.anthropicandcodexlink it to theAbortControllereach already owns, so the streamed turn and the spawned child are torn down at once instead of at the end of the run.pihas the least direct handle: its prompt call takes no signal at all, so cancelling brings the session's ownabort()forward, and that reaches the controller the agent created for the run it is executing — which is the controller whose signal the model request underneath carries. In every case the platform stops waiting immediately; that table is about the provider side, which no platform can promise on an SDK's behalf. A run nobody cancels is unaffected throughout: the signal is never aborted, nothing that shapes a request to a provider changed, and the pinned adapter fixtures are untouched. (The run context now always carries a signal, so an adapter that passes one through —openai— sends it on every run; the emitted option bag is pinned exactly, with and without a signal, by that adapter's own tests.)The generated OpenAPI document for a declared
{agent}route follows the same rule: its200namescancelledamong the terminal classes it also covers, and its409describes both conflicts that status carries — theIdempotency-Keyones, which never replay a result, and the run a request was holding being ended on demand, whose outcome a same-key retry does replay.- Declared routes are rate limited, and the tier is decided after the credential has been validated. Spec-declared
api[]routes carried no throttle at all, so the only place a deployment could bound their load was a front proxy — and a proxy cannot validate a Bearer token. All it can see is whether anAuthorizationheader was sent, which makes a tier decided there forgeable: junk in the header buys the generous allowance and switches the protection off. The throttle now sits on the declared-route chain itself, behind the middleware that validates the credential and in front of the one that demands a principal, so the question it asks is whether the credential actually validated. A call with no credential, or with one that failed to validate — an expired or forged token, an unknown API key — is counted in a strict bucket keyed on the client source (the socket peer, or the forwarded address when a configured trusted proxy set the forwarding header), at 30 requests per minute. Every unvalidated shape from one source shares that one budget, so alternating a junk JWT, a junk API key, and no header at all does not multiply an anonymous caller's allowance. A call carrying a validated credential is counted in a generous bucket keyed on the tenant and the principal — the user or the API key, each with its own budget, the same principal in two organizations counted separately — at 600 requests per minute, sized so first-party automation calling in bursts is not locked out. What a consumer observes: a declared route can now answer429 RATE_LIMITED, in the standard error envelope, carrying the retry advice twice — aRetry-Afterheader in seconds (how much of the window is left, never below1) anderror.details.retryAfterMsin the body, the same field the auth routes' throttle already emits.Retry-Afteris not a CORS-safelisted response header, so it has been added to the response headers the platform exposes to cross-origin browser clients (alongside the request-id echo, the pagination pair and the idempotent-replay signal) — afetchclient can now read the back-off it is given, on this429and on a transient run's502alike. On anagentroute the throttle's429is distinguishable from a run-outcome429: it fires before the route runs, so it answers the error envelope rather than aRunResult, no agent executed, and noIdempotency-Keyreservation was taken or released. Nothing changes under budget — an unauthenticated call still gets its usual401, because the throttle bounds load and does not authorize — and the mediaplaybackroute, which mounts on its own token path with its own per-user stream cap, is untouched. The counters are the existing in-process limiter, not a new one and not a shared store, so each instance counts on its own: a multi-instance deployment gives a caller one budget per instance it reaches. Treat both numbers as a per-instance floor rather than a cluster-wide ceiling; for the latter, keep a shared front-line limit in front of the deployment or, as an embedder, give the limiter theSharedRateLimitStoredescribed below. - A persist handler can cap a model-chosen enum column server-side: the
clampValueshole. The persist templates already re-checked a model-chosen IDENTIFIER against a store before writing it (fkRevalidate) — the guarantee that makes "never trust the model's choice" structural rather than a matter of prompt wording. There was no counterpart for a model-chosen CLASSIFICATION, because there is no store to re-check a judgment call against: a severity, a risk level, a policy verdict was whatever the model returned, and the only thing standing between untrusted input and the value that got persisted was how the instructions happened to be phrased.clampValuesis that counterpart. An author declares, next tofixedValues, an upper bound per enum column —"clampValues": { "policy_flag": { "max": "review" } }— and the renderer emits a deterministic cap applied after the untrusted-arg coercion and before the write. Rank is the column's declaredenumValuesorder and nothing else defines it, so a proposal ranked above the bound is written AS the bound. The model still chooses: unlike afixedValuesconstant, everything at or below the bound persists exactly as proposed, so the judgment stays the model's and only the ceiling is the author's. A bound that FIRES is reported on the handler's result asclamped: [{ column, proposed, applied }]— the model's original choice next to the value actually written — and since that result is what the central tool dispatch opaque-wraps and journals, both survive in the run journal and in the tool result the transcript carries. A tool whose handler declares a clamp must declareclampedin itsoutputSchema, or dispatch rejects the tool result the first time a bound fires. The key is absent, never an empty array, on a write no bound touched.validateHolesfail-closes on a clamp that cannot mean what it says: a key that is not a declared column, a key on a column with noenumValues(there is no order to rank by), amaxoutside that column'senumValues, a key that is also pinned byfixedValues(the constant is stamped last, so the bound would never reach the store), a key equal tofkRevalidate.codeArg(an identifier is not a ranked classification) and a key equal tonaturalKeyCol(the upsert key is tenant-namespaced from the value read before the clamp and stamped back on last, so the bound would never reach the store while the result still journaled a record claiming it had). Because that order is now load-bearing, a column'senumValuesmay no longer contain a duplicate: the rendered comparison ranks by first occurrence, so a repeated value names a rung the ladder never reaches, and no reading of it is one the render could honour. The bound is unconditional by design — a rule carrying any key other thanmaxis rejected rather than silently ignored. The hole is optional and additive: a hole-set that declares none renders byte-for-byte what it always did, for both--emit tsand--emit js. The shipped Expense-Claim example now caps itspolicy_flagatreview— an agent may raise "a human should look at this" but may not declare aviolationon its own — and its smoke asserts that a claim description demanding one cannot push the stored value past the bound. - Optional upper bounds on an agent run:
RAYSPEC_AGENT_REQUEST_TIMEOUT_MS,RAYSPEC_AGENT_MAX_ATTEMPTSandRAYSPEC_AGENT_RUN_MAX_MS. A provider that accepts a request and never answers used to keep a run alive for as long as the model client's own retry window lasted — on the durable worker that occupies one of its run slots for the whole time, and nothing in the deployment could shorten it. The first two bound the model client the OpenAI backend registers: a per-request timeout, and how many attempts it makes for one request — the first try plus its retries, so1is a single attempt with no retry (the client's own knob counts retries, one fewer, and the mapping is pinned by a test). The third is a wall-clock ceilingrun-coreapplies to one whole run, on the synchronous request path and the durable worker alike. What each caller then reports differs, so read it exactly: a synchronous JSON request ends as a504 GATEWAY_TIMEOUTcarrying the neutraltimeoutclass — the same envelope the pre-existing held-request timeout returns, so which of the two ceilings expired first does not change what the client reads — and a streaming request, whose200status line has already been sent, ends with the terminalerrorframe carrying that same class. On the durable worker there is no such envelope: run-core runs inside the executor's transaction, so the ceiling rolls that transaction back and no terminal run header is written. What the bounded run leaves behind there depends on how it was enqueued: a run enqueued through the API keeps theenqueuedheader that path writes before handing the job over, so reading its outcome has to test the header for TERMINALITY, which is whatisTerminalRunStatusis for — while a cron trigger's agent action enqueues without writing a header, so a bounded run of that kind leaves norunsrow at all. (SUPERSEDED — that second clause describes this release only. The trigger fire path now writes the same pre-enqueueenqueuedheader, so a bounded cron- or manual-fired run leaves that non-terminal row behind and is read for TERMINALITY exactly like an API-enqueued one; see thePOST /v1/triggers/{name}/fireentry above.) Be precise about what the ceiling does: it stops run-core waiting, it does not cancel the model call — there is no cancellation path, so the provider request continues until it settles by itself. What it does give you is the caller and the worker slot back, and a run-core that refuses what the abandoned call reaches for afterwards: an event it emits is dropped, a journal read or write is refused, a transcript rehydrate is refused, and a tool dispatch it starts after that point is refused closed — the handler does not run, no step is journaled and no taint marker is written. A dispatch already in flight when the ceiling fires is not stopped: its taint marker is written before the handler, the handler runs to completion, and its journal step is then refused, so a side effect it performs happens without a journal row. All three variables are off unless set, and an unusable value (not a number, or — after flooring — below 1 or above2147483647, the largest delay a timer can hold) is treated as unset, so a deployment that sets none behaves exactly as it did before. The OpenAI adapter gained the matching optionaltimeoutMs/maxAttemptsoptions, andopenai— until now in the tree only through the agents SDK — is a direct pinned dependency of that package. All three variables are documented in.env.example. rayspec plansurfaces the non-fatal spec advisories. A backend-profile document that carries a finding from the advisory lint pass — the same findingsdoctorhas always reported in itswarningsfield, such as ahandlers[].modulethat is TypeScript source and so needs a build step before the production loader will accept it — now has them in the plan envelope too, as the additivespecWarnings(the structured list, identical todoctor's entries) andspecWarningSummary(one readable line each).planis the pre-deploy command, so a document it certifies no longer hides an advisory that onlydoctorwould have shown. An advisory never affectsok, never blocks, and changes no phase or gate finding; both fields are omitted when there are none, so an advisory-free plan is byte-identical to before. They are document findings, distinct from the operational stderr warning the read-only shadow guard emits for a brokenDATABASE_URL_FILEmount.rayspec gen-handler --emit jsrenders a handler that deploys as it stands. The new--emit <ts|js>flag picks the emit target;tsstays the default and its output is byte-for-byte what it has always been, so nothing changes for an existing invocation. With--emit jsthe same bounded template renders the same program as plain ESM JavaScript — the default filename becomes<name>.gen.js— which the production loader accepts directly, closing the gap between "codegen worked" and "it runs": a.tsrender is TypeScript source, anddeployfail-closed-refuses to load one until a build step has compiled it. The emission is sound because the templates import the handler SDK type-only, so the JavaScript target drops exactly what a compiler would erase (the annotations, the type-only import) and nothing else — same coercion of untrusted args, same tenant-namespaced natural key, same zero npm dependencies, still no import at all. A deployment directory holding the emitted.jsmust resolve it as ESM ("type": "module"in its nearestpackage.json, exactly as the bundledbuild.mjswrapper writes).--filenow has to end in the extension--emitselects, so a name can no longer contradict the module's actual form.- The
gen-handlerJSON envelope carriesnextStepsandemit. Following the shaperayspec initalready returns, a successful render now names what stands between it and a running deployment: for atsrender, that the module is TypeScript source needing a build step before deploy, with the bundledexamples/acme-notes-backend/build.mjswrapper and--emit jsas the two ways out; for ajsrender, the wiring and deploy steps with no build step at all. Both fields are additive and only present on success — a parser readingok/file/exportName/templateis unaffected. detectStaticProfileis re-exported from the@rayspec/serverpackage root. It resolves a spec path into the static boot's input (the path plus the parsedfrontendmounts) when the document is a frontend-only one, and returns nothing for a non-static, missing, or unreadable document. Therayspec-serveentrypoint andrayspec deploynow share this one detection instead of carrying a copy each; both boot exactly as before.- The rule that decides an agent run's HTTP status is written down. A run that fails does not usually fail the request: it completes and returns a result carrying the neutral
errorClass, and the synchronous JSON response maps that class onto the status. The mapping has always been deliberate, and it has never been anywhere a caller could read: an invalid provider key (upstream_4xx) came back200and a rate limit (rate_limited) came back429, two same-shaped failed runs treated differently with no discoverable reason. The spec reference now carries it under Agent route runtime semantics, as the rule it is — a transient class (rate_limited→429,upstream_5xx→502,timeout→504) gets a real error status and releases theIdempotency-Keyreservation, so a same-key retry re-runs; a terminal class (upstream_4xx,model_refusal,internal) is a real, repeatable outcome, so it stays200with the class in the body and a same-key retry replays it — together with the one exception (a run that fired a non-idempotent tool keeps its reservation whatever its class, so a transient one replays at its transient status), when a429carries aRetry-After, why a streamed run reports its class in the terminal event instead of the status line, and the fact thatGET /v1/runs/{id}is a durable re-read that answers200whatever the run's outcome. The section also states the runstatusvocabulary in full: a run header now exists from enqueue on, so that endpoint answersenqueuedandrunningbesides the two terminal values, and onlycompletedanderrormean a run is finished. The generated OpenAPI document for a declaredagentroute describes the same mapping: the429,502and504responses are documented alongside the200/202it already carried, the429documents itsRetry-Afterheader, and the200says which failed runs it also covers. Behaviour is untouched by all of this — no status, reservation or replay rule changed. - A journal step records its error class and retry advice as columns:
journal_steps.error_classandjournal_steps.retry_after_ms. Both values used to exist only inside the step'soutputjsonb, in a shape that differed per step type — anllmerror step carried{ error, errorClass, retryAfter }, atoolerror step carried the opaque{ kind: "tool_error", … }and no classification at all. So the worst-classified failure was also the most common one: a tool error, which the model usually sees and continues past, ending the run ascompleted, left post-hoc triage nothing to filter on. And reading the classification of ANY failure meant reading the column that also holds raw model I/O — a grant cannot exempt a jsonb path, so the classification and the payload could not be granted apart. Both new columns are nullable and are filled for BOTH step types by the platform's journal sink.error_classholds the neutral class the adapter reported for anllmstep (rate_limited,upstream_5xx,upstream_4xx,timeout,model_refusal,internal) andtool_errorfor atoolstep — a value the neutral vocabulary deliberately does not contain, so the column carries MORE than the API ever reports:GET /v1/runs/{id}validates the class it reports and still answersinternalfor a run whose only failure was a tool error, exactly as before. Read "holds the class the adapter reported" precisely: the sink promotes it only if it is one of those six, so a failing step whose output carries no class, or one the platform does not recognise, recordsnullrather than an unvouched-for string. Filter a journal for failures onstatus = 'error';error_class IS NOT NULLis the narrower question of which of those the platform could classify.retry_after_msholds the upstream's Retry-After when it sent one, in MILLISECONDS — the journaled advice is in seconds and is converted on write — and is null otherwise, because advice is never invented. The HTTPRetry-Afterheader is unchanged: still whole seconds, still only on a retry-advisable status. Nothing moved out of the jsonb: the existingoutputkeys are written exactly as before and every reader still reads them, so a consumer parsing them keeps working untouched. A successful step leaves both columns null, and so does a failed step that a later attempt healed to success. Migration: apply0010_journal_step_error_columns— two additive nullableADD COLUMNs onjournal_steps, no table rewrite and no backfill, so a row written before it reads back null (unclassified) rather than a fabricated class. A release now ships a machine-readable identity manifest, so you can check for yourself which commit the packages you installed were built from. A development branch keeps the previous version string until the release cut, which means a commit hash plus a
versionfield never identified a published artifact — a1.7development snapshot and the released1.6.2source both say1.6.2.rayspec-release-identity.jsoncloses that: it names the version, the source commit and whether the working tree was clean at it, and then, for all 29 packages of the runtime closure, the package name, version, tarball integrity and unpacked file-list digest. It also carries the digests of the three checked-in JSON Schema artifacts (unified, backend, product), ofpnpm-lock.yamland ofdocs/dependency-sbom.json, plus the Node and pnpm requirements, the Git tag and the build workflow run. Every digest form is spelled out in the manifest's ownalgorithmsblock, so a reproduction needs nothing from this repository:openssl dgst -sha512 -binary <file>.tgz | openssl base64 -Aprints a recorded tarball integrity, andshasum -a 256 pnpm-lock.yamlprints a recorded source digest.Two places, the same bytes. The manifest is attached to the GitHub release, and it ships inside the installed launcher package —
node_modules/rayspec/rayspec-release-identity.jsonafter annpm i rayspec, and inside therayspectarball itself.What it does not claim. Nothing is invented for a field that has no value: with no release workflow in this repository the build workflow run is an explicit
nullnaming that reason rather than a plausible-looking run, and a manifest generated before the release tag exists records the tag asabsent. The manifest is unsigned, and says so, with the reason — signing it in CI would mean moving the release build into CI, and the release is deliberately a human-invoked script. And the launcher records no tarball integrity at all: it is the package the manifest ships inside, so a tarball whose digest included the manifest could never match the tarball that ships. What is recorded for the launcher instead is verifiable on the real artifact — its file-list digest over every entry except the manifest — and a launcher carrying some other manifest fails verification, so the exclusion is checked rather than trusted. Making that true takes an archive reader that reads which file each entry is the way node-tar and libarchive do, then refuses the rest: a tarball carrying one path twice (extraction keeps the last entry, so a forged second copy at the excluded path would be the one installed), one hiding content behind a lone null block (tar, and the node-tar annpm iruns, treat that as a warning and read on), and one that renames an entry through a paxpath=override the readers do not agree on — a global-headerpath, which node-tar and libarchive both ignore, and one smuggled inside another record's value, which node-tar honours (it scans the header line by line) and libarchive does not (it frames records by their declared length). The verifier takes both readings and refuses a header they name differently, rather than picking one and disagreeing with whichever installer you use. A pax header can also move an entry's end, and with it the start of the next one: asizerecord is applied the way both readers apply it, so an entry swallowed into its predecessor's content changes the file list instead of hiding in it, and any other record that could reach that far is refused rather than ignored. Two more places where a reader can part company with an installer over a NAME get the same treatment: every NUL-terminated string in an archive — the 100-byte name field, the ustar prefix, a GNU long-name block's body — is read both ways and refused when they end it in different places (node-tar's terminator stops at a newline); and the ustar prefix field is read only under the exact magic node-tar requires, so a header rewritten in place with its path split acrossnameandprefixunder GNU magic — every digest unchanged — is refused instead of certified. And a directory that declares a body is refused: tar gives a directory no content, so those bytes are the next entries to an installer, which writes them, while a reader that took the declared size at face value would record nothing for them — a package whose own files are attacker-chosen, with every digest still matching. Two narrower shapes of the same fault go with it: an empty name field joined to a prefix (node-tar decides file-vs-directory before the join, so it writes a 0-byte file where the reader sees a directory — emptying a certified file), and an empty prefix in the wide branch, where node-tar prepends a bare/and the resulting absolute path installs a level deeper. And whengitcannot answer whether the working tree was clean, generation refuses rather than recording the flattering value — a failed command and a clean tree both produce no output, and only one of them is worth writing down.Verifying is one command.
pnpm release:identity-verify --tarballs <dir>recomputes every digest and exits non-zero naming every package that diverged and both values. A tarball whose bytes moved fails on the integrity even when it unpacks to identical content; a tarball whose contents moved fails on the file list even when no integrity is recorded for it. Generating ispnpm release:identity --tarballs <dir>; both are offline, and neither starts a package manager or writes anything to a registry.A Product-YAML deployment can now construct every product-side model call itself, through one optional seam on
assembleServer:productAgentBackendsFactory. The two spec profiles were not equal here. A backend-profile deployment has always been able to supply anAgentBackendsFactoryand decide for itself how each model call comes into existence — which is what lets a deployment broker those calls through its own execution boundary instead of holding provider credentials in the serving process. A product-profile deployment had no such seam at all: the boot built the four in-process adapters directly fromOPENAI_API_KEY/CLAUDE_CODE_OAUTH_TOKEN/ANTHROPIC_API_KEY/CODEX_HOME, so the only credential boundary available for a product deployment was the whole process. The factory closes that gap for extraction, the conversation responder and the record input-normalizer.It is called once, with the complete set, after composition — never one call at a time. The boot resolves the sidecar configs and composes the capabilities first, then hands the factory every model call the deployed document actually needs: each declared extractor in document order, then the responder, then the normalizer, each with the agent id, the declared backend and the declared model. Returning a Backend per requirement is the whole contract. There is deliberately no per-requirement fallback: a factory that omits one requirement fails the boot rather than having that one call quietly built in-process against an ambient credential, which is the exact outcome the seam exists to prevent. A returned Backend must also report the
idthe sidecar declared — the seam substitutes construction, not identity, and journal attribution, the native-structured- output boot gate and run-core's capability validation all key on that id.Omitting it changes nothing. With no factory the boot never executes a byte of the survey or of the checks on what a factory returns — that whole block is unreachable without one. What still runs is the seam's own default source, and all it does is make the same
makeExtractionBackendcall every builder made before, with the same two arguments, at the same point in the same loop. The per-backend environment demands, the anthropic billing and reuse-login warnings and their order, the per-extractor abort order, and every error string — includingextraction backend '<x>' is not wired in this boot (wired: openai | anthropic | pi | codex). Fail-closed.— are unchanged. A deterministic executor mode keeps its exact meaning too:RAYSPEC_EXTRACTION_MODE,RAYSPEC_RESPONDER_MODEorRAYSPEC_NORMALIZE_MODEset todeterministicstill uses the injected dev/CI Backend, and the factory is never even asked for a Backend that mode would discard.Installing a factory does tighten one check, in the stricter direction. An extractor sidecar whose
modelis missing or blank is left out of the requirement set, so the factory is never shown it and the boot refuses that call instead of brokering one nobody described. The same document boots without a factory, because the extraction builder does not validate the model itself. If you install a factory and a boot now stops on an extractor it previously accepted, that sidecar is the reason.What it does not cover, stated plainly. Speech-to-text is not part of this seam: the STT adapter is still selected by
STT_PROVIDERand still needsDEEPGRAM_API_KEYin the product process, as does the media-preparation path. A deployment that transcribes audio therefore still has a provider credential in-process, and this change should not be read as discharging the whole credential boundary. The seam is also a boot seam: one Backend serves every request tenant the deployment admits, so it is not a place to scope credentials per tenant. And it is embedder-only — there is no environment variable naming a module to load, because that would mean loading operator-named code from the environment into the process holding the boot secrets;rayspec-serveandrayspec deploycannot install a factory, and a test pins that they cannot.An embedder can now give the rate limiter a SHARED store, so several serving instances enforce one combined limit instead of one budget each.
@rayspec/auth-coreexports aSharedRateLimitStoreport whose singleconsumereturns the decision AND the retry hint from one operation — that is the load-bearing clause, because a store that decides first and advises second lets two instances each see the last token before either has taken it. A limiter over such a store is built byRateLimiter.withSharedStore(store), and there is no other way to build one: the factory probes the store as it constructs the limiter (a budget of one must allow then refuse, that refusal must advise a non-zero wait, and a locked key must stay refused with the same lock constant the in-process path reports) and throws instead of returning a limiter that answered any of it wrongly. The declarative route syntax does not change at all — the samerateLimitfield, a different backing store — and because there is only ever one limiter in the application, supplying a store moves every counter at once: thelogin/register/refresh/oauth-token/invite-accept/reprocess/trigger-firethrottles, both declared-route tiers, and every per-route budget.A deployment that supplies no store is unchanged, and that is asserted rather than assumed. Every rate-limit call site now goes through an
…Asyncmethod, and on a limiter with no shared store each of those is a call to the synchronous method it always called — same arguments, same returned decision object by identity.createAuthAppkeeps its synchronous signature. The synchronous methods themselves now refuse to answer on a limiter that DOES carry a shared store, rather than quietly falling back to the in-process counters and handing that instance a private budget; and a boot that finds a budgeted route about to mount on a shared limiter that never went through the factory aborts instead of serving an unenforced limit.What ships is the port, not a deployment. The server in this repository configures no shared store: there is no environment variable and no configuration field that selects one, no table, and no migration. The only implementation of the port in the tree is a Postgres one under test-support, which exists to prove the contract against real concurrent connections — it has no sweeper and no counterpart to the in-process store's entry bound, and is not a deployable store.
The platform boot banner now states the resolved housekeeping posture, so an operator can see which way the two irreversible-deletion gates are set and which crontab the cleanup will fire on. The banner said nothing about any of the three:
RAYSPEC_GDPR_PURGE_ENABLED,RAYSPEC_ERASURE_ENABLEDandRAYSPEC_CLEANUP_SCHEDULEwere resolved at startup and handed straight to the cleanup scheduler and the erasure seam, so the first runtime statement of the purge mode was the cleanup job's own summary line — written when the job runs, at 03:00 by default. Every boot that mounts the platform surface now prints aHousekeeping (resolved):block that reports what this boot will actually do and names the variable behind every value it prints: the GDPR tombstone purge readsARMEDorDRY-RUN, the tenant data erasure readsARMED,DRY-RUNorNOT WIRED, and the daily cleanup prints either the crontab it is scheduled on together with theRAYSPEC_GDPR_RETENTION_DAYSwindow in days, orNOT SCHEDULED.Resolved values only, so a typo reads as the dry-run it produced rather than as the string that was supplied. Both gates arm on the exact string
trueand on nothing else, and that comparison is unchanged; what changes is thatRAYSPEC_GDPR_PURGE_ENABLED=TRUEnow renders theDRY-RUNline instead of saying nothing at all, and the banner is never handed the raw value, so it cannot echo one back as though it had been accepted. Where a line would otherwise advertise something that cannot happen, it says so instead, while still naming the variable it is about: a boot that launches no durable worker reports the cleanup asNOT SCHEDULEDrather than printing a crontab that will never fire, and a boot that deployed no product stores reports that there is nothing to erase rather than a gate posture.The static (frontend-only) profile is unchanged. That boot prints its own banner, opens no database, schedules no cleanup and wires no erasure, so it has no resolved housekeeping posture to state and carries no such block.
For embedders.
BootedServergains one additive field,housekeeping, carrying the resolvedcleanupsettings and the resolvederasureEnabledgate — the same values the boot hands to the cleanup scheduler and the erasure seam.bootBanner's signature is unchanged.rayspec --version(and-v) now reports the CLI's version instead of failing as a usage error. The top-level dispatch treated any first token beginning with-as "expected a subcommand" and exited2before looking at which flag it was, so an installed CLI could not be asked which version it is. Both spellings are now recognised ahead of that check and emit the ordinary single-JSON-object envelope on stdout —{ "ok": true, "version": "1.7.0" }— with nothing on stderr and exit0.The value is read at run time from the CLI package's own manifest, resolved relative to the entrypoint rather than the working directory, and npm places
package.jsonbesidedist/in the packed tarball — so a published install reports the version it actually is, from any directory, with no dependency on the source layout. This is the top-level flag only: it reports the CLI itself, not the versions of the packages installed around it. Every other leading--flag, and every unknown subcommand, is still the same exit-2usage error on stderr — and so is a token after the flag:rayspec --version --nopeis refused rather than answered, because a branch that sits ahead of the leading-dash check would otherwise be a hole in the grammar that check enforces.
# changed
rayspec deployno longer exports agent traces to OpenAI unless you ask it to: setRAYSPEC_AGENT_TRACING=openai. The agent SDK exports traces to OpenAI by default, and those traces carry prompts and tool arguments. On a machine running somebody else's workload that is their content leaving for a third party without anyone having chosen it, anddeployis the strongest signal the platform has that the workload is somebody else's — so on that path the export is now an affirmative choice rather than a default.RAYSPEC_AGENT_TRACING=openaiturns it on;off, or leaving the variable unset or blank, leaves it off. Any other value refuses the boot by name, so a typo cannot read as "notopenai, therefore off" — silence in either direction is the whole point of this entry. It is an affirmative switch rather than a negation of the SDK's own variable: an operator states an intention, and the repository is not bound to a third party's variable name.The export is turned off two ways, because one is not enough. The agent SDK builds its global trace provider while its own module is being evaluated, and that provider reads the kill-switch ONCE, at construction — so
rayspec deploysets the switch before it imports the boot closure (which reaches the SDK through the model adapters), and drives the SDK's programmatic switch afterwards, which is the only thing that can move a provider that already exists.--apply-migration, whose pre-flight loads that closure first, needs the second one.Only
rayspec deploychanges.rayspec-serveand the local development wrapper keep the SDK default, because a developer tracing their own agent sees their own prompts, and taking that away would burden the case that was never the risk. The boot banner now states the observed posture on every path —Trace export: OFForTrace export: EXPORTING TO OPENAI, in an observed block beside the resolved housekeeping one — and it is READ OFF THE SDK's own trace provider rather than derived from any variable, so it stays honest on the entry points that do not change the default, on a deployment that set the SDK's own switch directly, and on a boot where the mechanism failed. Nobody loses tracing without being told, and nobody exports customer content without being told.A product deployment whose
RAYSPEC_PRODUCT_TENANT_IDis malformed or names no live org now REFUSES TO BOOT. Until now that variable was only checked for being non-empty, so a deployment pointed at nothing came up green and reported healthy — and then failed for everybody, far from the cause: a bare404on the reprocess seam, or across_tenantthrow on the first capability event to reach the tenant-bound dispatcher. Every workflow run, every capability event and every authenticated principal of a product deployment binds to that one org, so a phantom tenant does not degrade the deployment, it makes it serve nobody. Both halves are now checked at startup and the boot aborts with a message naming the variable, its value and the remedy: the shape, through the same tenant chokepoint that already rejects a malformed cron tenant, and the existence, through the samedeleted_at IS NULLquery the cron tenant is answered with — so a soft-deleted org counts as absent and a deployment can never bind to an erased tenant.What an operator must do, and in which order. Because
deployalso serves the auth surface, a product deployment can no longer create its own org through itself, so the tenant has to exist first. Against an org that already exists nothing changes — setRAYSPEC_PRODUCT_TENANT_IDto its id and deploy. From nothing, settle the org first withrayspec tenant ensure --org-id <the uuid> --name <n>— see its entry under Added: it talks toDATABASE_URLdirectly, needs no running server and creating twice under the same id yields the same org — then deploy with that id. (The longer route through the auth surface still works: boot it alone withRAYSPEC_TENANT_BOOTSTRAP_ENABLED=true rayspec-serveand no spec, runrayspec dev bootstrap-tenant --base-url <url> --org-id <the uuid>against it, stop it, then deploy with the gate off.) A deployment that used to come up and wait for its org to appear will now refuse to start until it does.The cron tenant is deliberately NOT treated this way, and keeps its current behavior exactly.
RAYSPEC_CRON_TENANT_IDis still checked for shape only at boot; whether it names an existing org is still asked per firing. The failure profiles are genuinely different, so the decisions are. A cron deployment whose org does not exist yet is merely idle: it comes up, skips each firing with one log line, and starts firing by itself the moment the org appears, no restart needed — and gating that at boot would have made the org impossible to create through the very application it was waiting for. A product deployment in the same state has no such self-healing moment and nothing about it improves by staying up.- Embedders implementing the neutral
DurableExecutormust add acancelmethod. The cancel route needs an engine-agnostic way to end a job that has not been dequeued, soDurableExecutor— exported from@rayspec/platform's public surface — gainedcancel(jobId: string): Promise<void>as a required member. Every implementation in this repository was updated with it, but an out-of-repo implementation of that interface will not typecheck until it grows the method. It is the whole of the breaking surface: no existing member changed name, shape or meaning, and the neutralDurableJobStatusunion already containedcancelled— this release is simply the first thing that produces it. - The neutral run error class has a seventh value,
cancelled. A consumer that enumerated the six and treated anything else as unrecognised will now see it on a run that was ended through the cancel route. It is the one class no backend adapter produces and the upstream classifier never returns: nothing upstream failed, so it is set where the cancellation is recorded rather than inferred from an error shape. It behaves like the other terminal classes everywhere the platform already distinguishes them —200on the synchronous status mapping, noRetry-After, and anIdempotency-Keyreservation that is kept and replayed rather than released. No existing run's reported class changes. - A store read through the handler data facade comes back in a defined order.
init.db.selectapplied anORDER BYonly when the caller passedopts.orderBy; without one the rows arrived in whatever order Postgres happened to find them, which it is free to change after aVACUUM, on a different plan, or under a parallel scan. A handler taking a window of a store —{ limit: 200 }with no ordering, sorted afterwards in the client — therefore received some 200 rows, neither the newest nor the oldest, and which ones it received shifted as the table churned. A read that declares no ordering is now ordered byidascending: the same default the declarativelistroute has always applied, so both read paths order alike. What a consumer observes: an unorderedselectthat used to come back in insertion order — which is what an untouched table tends to give — now comes back inidorder, andidis a server-generated UUID, so that is not insertion order; a bounded unordered read returns the same window on every call rather than an arbitrary one. A caller that passes its ownorderByis unaffected — the ordering it declares is emitted verbatim, with no tiebreaker appended, so the statement, the rows and their order are exactly what they were. A declarative view is affected without owning a line of handler code, since the views runtime reads through the same facade: asingleview that declares noorder_byand whose filter matches more than one row now serves the lowest-idmatch instead of whichever row the scan reached first, a nestedlookupfield whose sub-read matches more than one row embeds that same lowest-idmatch, and acollect, a pagedlist, or alist/countssub-read withoutorder_bynow returns a defined order and a defined window. A handler rendered byrayspec gen-handlerobserves it too: a generated lookup tool reads the store unordered and caps the result in the handler (maxRows), so the rows a model receives are now the lowest-idmatches rather than an arbitrary subset that shifted between runs — the template is unchanged, only what it returns is now defined. The order column is the injected primary key every store table carries, so it always resolves. A generated store has a primary-key index onidand a separate index ontenant_idbut no composite index over the two, so the cost depends on which plan the tenant-scoped read gets: an unbounded one sorts the rows its tenant predicate matched, while a bounded one ({ limit: n }) over a tenant holding a large share of the table is answered by walking the primary-key index inidorder withtenant_idas a filter — no sort, but it reads past other tenants' rows, and the smaller a tenant's share the further it reads. - A deployment that declares a cron or manual trigger boots before its tenant org exists.
RAYSPEC_CRON_TENANT_IDnames the org a trigger fires under — yet the boot used to verify that org existed and abort when it did not (… is a well-formed UUID but no such active org exists), which is a state a cron deployment legitimately passes through: an org is registered against a running application, so a deployment restarting before its org row is there could not come back up at all, and the only way in was to deploy without the trigger first. The boot no longer asks that question. A well-formed id naming an org that does not exist yet starts the scheduler, and firing begins the moment anorgsrow with that id exists. Which id that is remains the row's to decide:POST /v1/orgs,POST /v1/auth/registerand a plainrayspec dev bootstrap-tenantall let the database generate it, so an operator using those still reads the id back before setting the variable, while an id chosen up front has to be the id itsorgsrow is created with — withrayspec tenant ensure --org-id <uuid> --name <n>, which needs no running server, or withrayspec dev bootstrap-tenant --org-id <uuid>against a server in the tenant-bootstrap operator posture (see the Added entries on reserving a tenant and on choosing the org id). Nothing fires under an unknown tenant: the existence check moved to the firing itself, where it runs before the firing's reserve, so a skipped firing dispatches nothing and writes no marker — which leaves that instant explicitly re-fireable instead of burning it. Each skipped firing emits exactly one line naming the trigger, the instant and the tenant; the boot additionally says once that the org is missing and that no restart will be needed. Once the org exists, scheduled firing resumes at the next instant — the check is re-asked per firing, never cached. Read that precisely: the instants skipped in the meantime do not come back on their own, because a scheduled tick reached the skip from inside the engine's per-instant workflow and returned normally, so the engine has recorded that interval as run; what the unwritten marker preserves is the ability to re-fire such an instant explicitly. Read the other way round, an org that is soft-deleted while the deployment runs stops firing at the next instant. The on-demand fire of amanualtrigger runs through that same guard, so such a fire dispatches nothing and reportsfired: falserather than success — which is why every contract carrying that value (fireNow,fireScheduled,fireCronNow, the manual-fire seam, thePOST /v1/triggers/{name}/fire202 and the immutable audit row that fire writes) now documents the absent-tenant skip alongside the deduped no-op it used to name exhaustively:fired: falseis not by itself evidence that the work has run. Two boot refusals are unchanged, both with their exact previous message: a malformed (non-UUID) value, which no waiting could make valid, and an unsetRAYSPEC_CRON_TENANT_IDon a spec that declares a cron/manual trigger.doctorandplannow also state the requirement up front, as the new non-fatalcron_tenant_requiredadvisory on each declared cron/manual trigger — it names the variable, says the value is an org id, and says the org may not exist yet. Like every advisory it never affectsok. Embedder note:CronSchedulerDeps— the constructor dependencies ofDbosCronScheduler, exported from@rayspec/durable-dbos— gains a REQUIREDtenantExists(tenantId)probe. Anything outside this repository that constructs the scheduler itself has to supply one; there is no default, deliberately, because a scheduler that cannot answer whether its tenant exists is exactly the thing that must not dispatch. Every in-tree construction site is updated. /healthcovers the declared frontend mounts, and its response carries afrontendfield. The probe used to report only database reachability, so a deployment that also serves afrontend[]mount could answer200 {"status":"ok","db":"ok"}while every static asset was still 503 — a deploy tool waiting on that signal reported "ready" while users saw 503. The response is now extended by one additive field,frontend, valued"ok"or"unavailable", and a mount that cannot be served answers503instead of200. A mount is servable when its resolved directory is a readable, traversable directory and — for anspa: truemount — itsindex.htmlis a readable file. Both profiles are covered: the full platform ({"status","db","frontend"}) and the static profile ({"status","frontend"}, still nodbfield). The readiness is computed ONCE at boot and cached, so the probe performs no filesystem access per call no matter how often a load balancer polls it. The existing fields are untouched: same names, same values, and the reachable / unreachable database cases keep their exact200/503. A deployment that declares no frontend mounts omits the new field entirely and answers byte-for-byte as before. The static profile's boot banner, printed by bothrayspec-serveandrayspec deploy, describes the endpoint accordingly: itsLiveness:block is now aReadiness:one naming thefrontendfield and the503.- A boot secret that normalization actually changed now says so, once, at boot.
DATABASE_URL,RAYSPEC_JWT_SIGNING_KEYandRAYSPEC_API_KEY_PEPPERare trimmed on read — leading and trailing whitespace and a leading byte-order mark go, interior bytes stay — and until now that happened in silence. The silence is what hurts on an upgrade: a secret carrying stray edge whitespace that worked before is now trimmed, every request starts rejecting, and nothing points at the cause, so the operator searches the auth logic, the database and the proxy while an invisible character is to blame. The boot now emits one warning per changed secret, naming the variable it was resolved from —<VAR>, or<VAR>_FILEwhen the mount won — and the kind of change from a closed vocabulary:a leading byte-order mark removed,leading whitespace removed,trailing whitespace removed. It never names the value or any part of it: not truncated, not hashed, not a length, not a count, not an excerpt of what was removed — a warning reaches every log the process writes to, and the value is the secret. It reports the difference rather than prescribing a fix: the trailing newline a>redirect leaves in a secret file is the documented, harmless case and needs no action. A clean secret boots exactly as silently as before, a value that normalizes to nothing still just takes the fail-closed missing-variable abort that already names it, and nothing else moves: the resolved values, the<VAR>_FILEprecedence and every abort are byte-for-byte what they were. The trim contract is documented alongside the signal in the README, the concepts guide, the CLI reference, the getting-started guide and.env.example. - An agent that declares both
toolsand anoutputSchemais now a config error. The linter addsagent_output_schema_shortcircuits_tools: anagents[]entry carrying a non-emptytoolslist AND a top-leveloutputSchemais rejected bydoctor,plan, and boot, atagents[<i>].outputSchema. The combination is dead at runtime: a backend with native structured output (openai,anthropic,codex) projects the schema into that slot, so the model answers in one turn and never calls a tool; the backend that emulates structured output through instructions (pi) appends a JSON-only directive that pulls the answer the same way. Either way a declared lookup/persist loop silently never fires. The rule is uniform and fail-closed — it rejects the shape on every backend rather than per capability. Previously such a spec passeddoctorwithok: trueand only a live run exposed it. A spec of this shape must move the structured shape onto the persist tool'sparametersand drop the agent'soutputSchema(the agent's terminal action is then the tool call). A tool-less agent with anoutputSchema— including thepersistTostructured-output shape — is unaffected, as is a tool-using agent without one. Theexamples/acme-notes-backendreference document carried the combination and has been corrected the same way. - A store named after a platform table is now a config error, not a boot failure. The linter adds
reserved_store_name: astores[]entry whose name is one of the tables the platform owns —api_keys,auth_audit,conversation_items,idempotency_keys,invites,journal_steps,memberships,oidc_models,orgs,run_events,runs,sessions,users,workflow_artifacts,workflow_node_states,workflow_runs— is rejected atstores[<i>].name, in both profiles, and at every other place a store name comes out of a product document: a product artifact'scollection, which derives a store of that name, and a view'ssource: { kind: store, ref: … }, which names the transcript sink store when it resolves to neither a declared store nor a collection. What an author observes differently: such a document previously returned{ "ok": true, "errors": [], "warnings": [] }fromdoctorandok: truefromplan— whose migration then carried the collidingCREATE TABLE— and failed only when the deployed container booted, in a restart loop whose cause was visible solely in container logs, after the build and image had already been paid for. It now failsdoctorandplanwith a message naming the store and asking for a rename, before anything is deployed.sessionsfor a chat application,invitesandrunsare the names most likely to be hit; the match is exact, so a distinguishing prefix (chat_sessions) is the whole fix, and a store renamed that way boots unchanged. The boot registrar's own refusal is untouched and stays the fail-closed net for a spec assembled in code that never meets the parser — it is simply no longer the first thing that says it. The reserved names are documented understoresin the spec reference. The release script has no default version any more: it derives the release version from the repository-root
package.jsonand refuses, before it packs anything, if the checkout disagrees with it.scripts/publish.mjsused to fall back to a hard-coded version when--versionwas omitted, so a release run could stamp, pack and publish a version that no manifest in the tree carried — and neither a published npm version nor a release tag can be taken back. There is now no input that produces one: the version comes from the root manifest, and--versionbecame an assertion against it — supplied and unequal, the run exits nonzero naming both values. Before the first manifest is stamped and before the firstpnpmchild process starts, the run also refuses when any RaySpec manifest carries a different version — every offender is listed with its path and its value, so one run names the whole drift instead of the first manifest of it — and when HEAD carries an annotated release tag naming another version. The@spike/*example fixtures are outside that check: they are not RaySpec packages, are never published, and are versioned independently.What differs per mode.
--publishadditionally requires the annotated tagv<version>to exist and point at HEAD, because that is the irreversible one.--packand--dry-runonly report the tag state —absent,lightweight,other-commitorat-head, in the human output and in--json— since both write nothing anywhere and a pack rehearsal legitimately happens before the tag for the version being prepared exists. The double gate for a real registry write (--yes-really-publishandRAYSPEC_ALLOW_PUBLISH=1) is unchanged, and the--jsonsummary keeps every existing key and gainsversionSourceandtag.
# fixed
A deployment whose only route to the internet is an HTTP proxy can run agents again. On such a deployment every agent run failed at its first model call with
Error: Connection error., zero tokens anderrorClass: internal, while the identical call from a freshly spawned process in the same container succeeded — and during the failing run, nothing from the application reached the proxy at all, measured as a delta on the proxy's own access log. The server's runtime closure contains undici v8, and undici v8 runs this the moment it is imported: ifSymbol.for('undici.globalDispatcher.2')is unset it installs a plainAgentinto it — and itssetGlobalDispatcheralso writesSymbol.for('undici.globalDispatcher.1'), the slot Node's built-infetchreads, and exactly whereNODE_USE_ENV_PROXY=1had installed Node's ownEnvHttpProxyAgentat startup. Node core never sets the.2symbol, so the branch fires on the first import in any process. Importing the boot closure therefore replaced a proxy-aware global dispatcher with a direct-connecting one, and everyglobalThis.fetchcaller in the process — the model SDKs among them — quietly stopped honouring the proxy. The boot now puts a proxy-aware dispatcher back, in the one place every boot shape reaches (assembleServer, which bothrayspec deployandrayspec-servecall, and through which the classic, Product-YAML and auth-only boots all pass), before the app is assembled and so before any run can start.It runs only where the running Node would have run it, and it changes nothing anywhere else. The condition is Node's own, in all three of its parts. First, the runtime has to implement
NODE_USE_ENV_PROXYat all — it exists from Node 22.21.0 on the 22 line and across the 24 line and up, and NOT on Node 22.0–22.20 or 23.x, which this project'sengines: node >= 22still admits. Measured, readingSymbol.for('undici.globalDispatcher.1')with the environment set at startup:22.12.0,22.19.0,22.20.0and23.11.1install nothing;22.21.1,24.0.0and25.6.1install anEnvHttpProxyAgent. On a Node without the feature the boot installs nothing either — a deployment carrying those variables in anticipation of a newer runtime keeps the direct egress it had. Second,NODE_USE_ENV_PROXYcarries a value that runtime accepts, which is not the same value everywhere: the strict "must be1" comparison arrived on the 24 line at 24.5.0, and the 24 releases before it arm on any non-empty value. Measured the same way, withHTTP_PROXYset —24.0.0,24.1.0,24.2.0,24.3.0,24.4.0and24.4.1install anEnvHttpProxyAgentforNODE_USE_ENV_PROXY=true,=0or=2, while22.21.0,22.21.1,24.5.0and25.6.1install nothing for any of them and only=1arms them; a blank value arms none of them. The boot follows whichever rule the running Node applies rather than picking one and calling it Node's, so a deployment on 24.0–24.4 that spells the opt-intrue— proxied by stock Node, and therefore broken by the clobber — is restored too. Third, at least one non-emptyHTTP_PROXY/HTTPS_PROXY/http_proxy/https_proxy, which is also what Node requires before it installs anything. Below that bar the boot does not so much as load undici, and the two global-dispatcher symbols come out of it as the same objects they went in as.NO_PROXYkeeps working: the dispatcher reads it itself, and a host excluded there is still reached directly.- A malformed
RAYSPEC_JWT_SIGNING_KEYnow refuses the boot as a named, fail-closed config abort instead of crashing with the signing library's own error and a stack trace.loadServerConfigchecks that the secret is present, and nothing between it andjoselooked at the bytes, so a value that is not a PKCS#8 PEM surfaced asTypeError: "pkcs8" must be PKCS#8 formatted stringor asDOMException: Invalid character— neither naming the variable, neither hinting that the value needs real newlines, and both taking the entrypoint's unexpected-error branch, which prints a Node stack trace with the absolute paths of the machine that built the artifact. The two shapes that reach it come from one documented value:rayspec dev gen-secretswrites the PEM into.envas a single line carrying literal\nescapes behind a leading", and only the entrypoint's own.envloader un-escapes that form — a loader that skips any variable already present in the environment. So a value copied out of.envinto an inline assignment is never un-escaped: with the quotes still attached the PEM header is not at offset 0, and with them stripped the literal\nsurvives into base64 decoding. The boot now aborts withBoot aborted — RAYSPEC_JWT_SIGNING_KEY is not a PKCS#8 PEM., naming the shape expected and both of those causes, and pointing atRAYSPEC_JWT_SIGNING_KEY_FILE. It is aBootConfigError, one of the classes the entrypoints print as a message rather than as a crash, so the stack trace is gone as well. No byte of the value is echoed, matching the surrounding secret diagnostics, which name the variable and the kind of problem but never the value. Nothing about what is accepted changed — a value that is not a PKCS#8 PEM still refuses the boot, and a real multi-line PEM, whether supplied directly or through the_FILEvariant, boots exactly as before. Thelead-qualifierexample's boot recipe now passes the key throughRAYSPEC_JWT_SIGNING_KEY_FILE, because the value that example's reader has in.envcannot be pasted into the inline assignment it previously showed. - A cancelled run reports being cancelled, whatever else it also recorded. A run can hold two classed failures at once: the platform records the cancellation for a run that produced its answer anyway — the signal reached it in the post-backend tail, or it executes in a process the signal cannot reach — on top of whatever failing step the run had already journaled. The read path picked between them by position, taking whichever classed step the database returned last, and that order is not specified: the same rows, asked for with the same predicate, come back in different orders for different queries. A cancelled run could therefore read back with an upstream failure as its class, contradicting the rule the write side already follows — a cancelled run records the cancellation as its outcome and commits nothing else. The read now selects by class rather than by position, so it answers the same way regardless of row order. Runs with a single failing step are unaffected.
- Tearing down a
pisession can no longer become the run's answer. The adapter tears its session down in afinallywhose comment promises it happens "no matter what", but only theabort()call was guarded. A throw from unlinking the cancellation hook, from unsubscribing, or fromdispose()escapedrun()as a rejection — so a run that had completed perfectly well, or one that had a real upstream error worth reporting, came back to the caller as a tidying-up failure instead — and it skipped whatever teardown stood behind it, which is exactly the part that releases the SDK's resources. Each step is guarded individually now: a failure while tidying up is swallowed, the remaining steps still run, and the run keeps its own outcome. - The
codexadapter's tool-bridge teardown can no longer hang forever, so a cancelled run whose turn ends reaches its end instead of leaving the bridge alive. The adapter hosts an in-process MCP bridge — a listening HTTP server — alongside thecodexchild, and closed it by awaitingserver.close(). That call stops accepting new connections immediately, but its completion callback waits for every connection that still has a request in flight, and nothing was dropping those: any peer still holding a connection with an incomplete request wedged the teardown forever.backend.run()then never settled, and the listening server plus its async work stayed alive behind a caller the run core had already stopped waiting on. The likeliest such peer is thecodexchild itself — the teardown only signals it, so it need not have exited and released its connection yet. The teardown now drops those connections, so it is bounded. This is not specific to cancellation: the teardown runs at the end of every run, and the regression test that pins it is an ordinary uncancelled run — one that used to hang and now finishes, which is precisely the observable change on a run with no cancellation signal. Everything else there is what it was: the SDK call, the sandbox confinement, the neutral result, the event sequence and the journaled step are pinned by value, save three that cannot honestly be held that way and are pinned by shape: the working directory and the step's wall clock, which are not stable across machines, and the producer stamp, which carries the pinned SDK version. The residual limits are stated in the adapter's README and in the per-backend table indocs/spec-reference.md, and the sharpest one is that a bounded teardown is only reached once the streamed turn ends: the child is signalled rather than force-killed, processes it spawned itself are not signalled, and a child that ignores the signal keeps its stdout — and therefore the whole run — open. - Cancelling a run on the
pibackend no longer lets the model request go out anyway. The adapter linked the run's abort signal to the session'sabort(), but that call delegates to the agent's abort, which aborts the controller of the run the agent is currently executing and does nothing at all when there is none. A cancel that landed before the prompt reached the agent — including one that landed while the session was still being created — was therefore swallowed: the run read back ascancelledwhile the adapter issued the full request against a fresh, never-aborted controller and streamed the entire answer, spending the tokens and holding the provider work open after the caller had already been freed. The adapter now re-checks the run's signal immediately before the SDK call and does not make it on a run that is already over; no new terminal state is invented, because the platform already journals the cancelled run and discards whatever the adapter returns. Cancelling during a run reaches the transport: the agent run's controller signal is the one the model request carries, so an in-flight token stream is aborted, not merely abandoned. Nothing changes on a run nobody cancels: the session option bag and the prompt call are byte-identical whether the run context carries a signal or not, both pinned by tests, and the recorded fixtures and parity suite are untouched. The residual limits — the narrow window that remains and why it is a choice rather than an SDK constraint, the session's separate compaction controller, a run on another worker process, a host tool already in flight and therun()promise that stays pending behind it, and what the adapter returns for a run cancelled before the call — are written down in the adapter's README. - A tombstoned organization is now absent on the authorization path too. Whether an org is a usable tenant is asked in four places, and three of them treated
orgs.deleted_atas decisive: the org list does not return such an org, a login never resolves one, and a product deployment refuses to boot bound to one. The live-membership lookup — the one the org switch and the live re-check for sensitive permissions consult — did not, so a member of an erased tenant could still switch into it and still act in it, in an org the rest of the API behaves as if it had forgotten. It now joinsorgslike the others; the switch answers the same uniform404it gives for an org you are not a member of, so nothing new is learned from the response. No shipped route setsorgs.deleted_at, so no reachable flow changes — this closes the disagreement rather than a live hole. POST /v1/auth/registerwith anorgNamenow hands back a token that is actually scoped to the org it just created. The response has always reportedactiveOrgId, but the session was issued before the org existed, so the row carriednulland the token carried no org claim: the very firstPOST /v1/auth/refreshafter the documented onboarding call answeredactiveOrgId: null, and a browser that registered and reloaded landed in no tenant at all. The org is now created as part of the registration, so the response, the session row and the token's claims name the same tenant, and the owner role travels with it. Registering without anorgNameis unchanged. The same seam carries the operator bootstrap route, so a chosen-id tenant likewise comes back ready to use.- A switch presented with a rotated refresh cookie records the choice on the live session instead of losing it. Inside the refresh grace window a client legitimately still holds the pre-rotation secret —
POST /v1/auth/refreshalready resolves that to the replacement row. The switch write did not: it landed on the superseded row, which no later refresh reads, so the selection vanished at the next reload. It now resolves the same hop, and the store refuses a write to a superseded row outright, so the rule is structural rather than a convention a future call site could forget. A rotated cookie beyond the grace window still resolves to nothing here; detecting a replay remains the refresh route's job. The chosen organization now survives a refresh and a fresh login instead of dying with the access token.
POST /v1/orgs/{orgId}/switchre-minted a JWT scoped to the org but recorded the choice nowhere durable:sessions.current_org_id— the columnPOST /v1/auth/refreshreads back asactiveOrgId— was only ever written when a session was created. A browser therefore lost its tenant on every refresh, which at an 8-minute access-token TTL means constantly, and again on every login. The refresh reportedactiveOrgId: null, so a client that wanted to be back where it already was had to re-runGET /v1/orgs, work out which of the returned organizations it had been in, and switch into it again. The switch now persists the choice on the caller's own session row, strictly after the live-membership recheck — so a denied switch still writes nothing, and the refresh that follows a successful one returns the sameactiveOrgIdthe switch returned. Session rotation carries it onto the replacement row, as it already did for a session created with one.POST /v1/auth/loginadditionally pre-fills the org when the user is an active member of exactly one live organization, the single-workspace case where the list-then-switch round trip was pure ceremony. Two or more memberships still yieldnull: the server has no basis on which to pick one and does not guess.Two limits are worth stating, because a consumer observes both. First, a refreshed token is now tenant-scoped but still roleless.
POST /v1/auth/refreshmints an access token carrying the remembered org — that half is new — but, as it always has, no role claim. So the routes gated on a claim-trusted permission (org:read,apikey:read,store:read,agent:read,agent:run) answer403on it, while the permissions that are re-resolved live instead of trusted from the claim (store:writeon the declared store routes,apikey:mint,apikey:revoke,org:member:add,org:member:change) now succeed on it in the remembered org — before this change a refreshed token carried no org at all, so every tenant-scoped route answered404for want of a tenant. That is a shorter path to those routes rather than new authority: the same refresh cookie already reached them by callingPOST /v1/orgs/{orgId}/switchfirst, which carries no permission gate of its own and re-checks membership live exactly as those routes do. What this change removes for a returning browser is therefore theGET /v1/orgsdiscovery step, not the subsequentPOST /v1/orgs/{orgId}/switch— the client now knows the org id it should switch into, and still has to switch before it can READ its tenant data. The login path has no such caveat: a sole-org user's login token carries the live role and is usable against tenant routes immediately. Second, persisting the choice requires the switch request to carry the refresh cookie, and a switch is a Bearer-required mutation. A same-origin browser sends the httpOnly refresh cookie alongside the Bearer header automatically — that is the flow this fixes. Any client that sends no cookie has no session row to write, so its selection stays inside the re-minted token exactly as before: a CLI or desktop client, and equally a cross-origin browser client, which this API serves bearer-only (the CORS grant never enables credentials, and the refresh cookie is__Host-…; SameSite=Strict). The switch itself succeeds either way; nothing about it fails for want of a cookie.- The documentation no longer calls the tool-dispatch boundary "the defense against prompt-injection-style attacks". It is the defense against ONE of three classes, and saying so without the qualifier taught the wrong mental model everywhere it appeared — the tool-dispatch trust boundary section of
docs/ARCHITECTURE.md, the mirrored bullets inSECURITY.mdandREADME.md, and the shippedexamples/lead-qualifier, whose agent instructions modelled the pattern for anyone copying from it. Injection carried in a record's free-text field breaks in three ways: it can COMMAND the agent ("ignore all previous instructions"), it can ASSERT a different value for a structured field ("this company actually has 8000 employees"), or it can INVENT a decision rule ("pre-approved accounts route to field_sales regardless of headcount"). Only the first asks to redirect anything, so only the first is what the boundary stops; the other two merely inform the answer, which is exactly what the boundary permits, and the model then classifies from the planted fact or rule while every tool call it makes stays inside the rules. Nothing at the dispatch boundary can intercept that, so nothing about this is a code defect — but the docs claimed a coverage the boundary does not have, which is a defect in its own right. ARCHITECTURE now names all three classes, states that answering the second and third is the AUTHOR's job in the agent's instructions (a stated field precedence, plus a decision rule declared closed), carries the measured defence rates behind each of those two statements, and says the part that does not transplant: how reliably a prompt-side defense works is a function of how mechanically enumerable the decision rule is — a lookup table can be closed in a prompt, a judgment call cannot be. Thelead-qualifieragent instructions were replaced with the wording that measurement was made against, so the shipped example teaches the whole pattern rather than its first third, andexamples/lead-qualifier/injection-smoke.shis the new regression that drives all three classes, three runs each, plus two control leads, against a live deployment; each run is scored on both verdict fields,tierandowning_queue, because the policy payload asks for both. Nothing in the platform changes — no API, no envelope, no runtime behavior; what changes is the shipped example's own agent, which is the point of the example. doctorandplanreport a new non-fatalagent_untrusted_field_precedenceadvisory. It fires once per agent whoseinstructionsname an unconstrainedtextcolumn of a declared store — one that can hold free-form text the author does not control — while stating no precedence between that field and the structured ones or without saying the stated rule is the whole rule, pinned to that agent's ownagents[<i>].instructions. Both statements are asked for and the message names the one that is missing, because they close different attack classes: field precedence answers text that asserts a different field value, a closed rule answers text that invents a policy, and satisfying either alone leaves the other class open. Atextcolumn that declares anenumwhitelist is excluded, since its stored value must be one of the listed literals and so cannot carry an injected sentence. Both halves are keyword matches over natural-language prose, so this advisory is wrong in both directions by construction: instructions that state a precedence in vocabulary outside its small closed list are flagged anyway, and instructions that merely contain one of those words are not. It also cannot confirm that the agent really receives those rows, nor whether it reads a named column or writes it — an agent'sinputis a runtime value, and the handler that assembles it lives in module source this pass never reads, so the message names the columns without asserting they are input. It is advisory for exactly those reasons: a heuristic over prose must never fail a deploy, so it never affectsokand no document that parsed before stops parsing. Two shipped documents report it as things stand —examples/acme-notes-backendandexamples/expense-claim-coder, alongside thetypescript_handler_moduleadvisories they already carried — andexamples/lead-qualifier, which reported it before its instructions were rewritten, no longer does.- A full-platform deploy — a document that declares more than a
frontend— now fails closed on anspa: truemount without anindex.html, instead of booting into a permanent503. The deploy guard that fail-closes on an unusablefrontend.dirand the/healthreadiness probe disagreed about what makes a declared mount servable. The guard tested only the mount's directory; the probe additionally requires, for anspa: truemount, that the directory carries a readableindex.html. A document whose spa directory existed but shipped noindex.htmltherefore passed the gate, booted, served every API route and every real asset — and answered/health503for the rest of the process's life, because mount readiness is computed once at boot and cached, so nothing re-evaluated it. A readiness probe pulls such a process out of service permanently even though its API works. Both now decide from one shared per-mount check, so that guard refuses the mounts the probe would call"unavailable", with aBootConfigErrornaming the route, the declareddirand the resolved path. The directory case keeps its existing message verbatim; the spa case has its own, which additionally says that an spa mount servesindex.htmlfor every unmatched deep link and points at building the frontend intofrontend.diror settingspa: false. A frontend-only document is outside this guard's scope: both documented entrypoints branch it to the static profile before the guard runs, so there an unservable mount still boots and then reports/health503with"frontend":"unavailable"for the life of the process. That reporting is the extended probe described under Changed above — this fix neither adds nor alters it, and changes only which mounts a full-platform boot accepts. A deployment whose mounts are servable, or which declares no frontend mount at all, boots and answers as it did before this change. An async run's
runIdresolves while the run is still going, instead of404until it ends.POST /v1/agents/{id}/runswithasync: trueanswers202with arunIdand the/v1/runs/{runId}/eventspath to stream completion from. But therunsheader row was written only by the completing upsert at the very end of the run, and both run-read routes read that row —GET /v1/runs/{id}reconstructs the result from it, andGET /v1/runs/{id}/eventsguards on it — so for the whole duration of the run, exactly when a caller most needs an answer, both replied404, indistinguishable from "no such run". The header is now created at ENQUEUE withstatus: "enqueued", so — when that write lands —GET /v1/runs/{id}returns the run with a non-terminal status and the advertised events path is reachable throughout. run-core also moves the header to"running"when execution starts, but the durable worker runs the agent inside ONE transaction, so an async caller polling the endpoint readsenqueuedfor the whole run and then the terminal status;"running"is what a SYNC run publishes, which executes outside a transaction. A consumer that treated that endpoint'sstatusas always one ofcompleted/errornow also seesenqueuedandrunning; the two terminal values are unchanged, and so are the404s for an unknown or another tenant's runId — the header read is tenant-scoped, so a foreign run in flight is exactly as invisible as a foreign finished one. Both new writes are strictly additive: the enqueue-time insert is anON CONFLICT DO NOTHING, and therunningtransition applies only to a header that is stillenqueued, so neither can touch a run that already carries an outcome. The completing upsert, which updates only a header that is not alreadycompleted, remains the one write that puts a run into a terminal status, and the exactly-once gate that couples it topersistTooutput persistence is untouched. The enqueue-time header is written BEFORE the job reaches the durable worker — so it can never wait on a worker transaction that holds that row — and is removed again when the engine confirms the job was never created. That write is ADVISORY and best-effort: a failure to write it at enqueue is logged and the request still answers202with the runId rather than failing — but that runId then does not resolve,GET /v1/runs/{id}and the advertised events path answer404for the whole run as they did before this change, and never resolve at all for a run that ends by throwing, because the header such a run writes for itself rolls back with the worker transaction it is written in.Two consequences worth knowing. First, a run that THROWS (a crash, a timeout, an exception out of the backend) reaches no completing write at all, so any header it has stays at a non-terminal status and nothing reaps it:
GET /v1/runs/{id}then answers200withenqueued/runningfor a run that will never finish, where it used to answer404. Second, two places that read a run header now key on the status being TERMINAL rather than on the header merely existing: a secondPOSTunder anIdempotency-Keywhose run is still executing continues to answer409"already in progress" rather than replaying a half-finished run, and the conversation reply path's bounded attempt walk re-uses the slot of an interrupted attempt instead of spending one of its deterministic attempt ids on it.- A stream
playbackroute no longer keeps its second authorization path to itself. Such a route validated, built and booted without a word, and every read attempt ended401 UNAUTHENTICATED— including with a valid Bearer token of the tenant that had uploaded the bytes. The reason is sound but was invisible in the document: a playback route mounts its own middleware tuple and is authorized by a signed?token=media token, not by the Bearer chain the other routes mount on, and that token is minted throughinit.mintPlayToken, a capability only akind: handlerroute's handler receives — so a deployment that declares no route minting one leaves that playback route unreachable without an externally issued token.doctorandplannow report that shape as the new non-fatalstream_playback_media_tokenadvisory, once per playback route declared in the document's ownapi[], pinned to that route's ownapi[<i>].action.mode. A playback route a pack contributes throughextensions[]is merged into the spec at boot, while the advisory pass reads the parsed document, so such a route is outside its field of view — a property of every advisory, not of this one. It states the authorization shape and what follows if nothing mints a token; it deliberately does not claim the mint route is missing, because the mint call lives in handler module source and the advisory pass is pure over the parsed document. As with every advisory it never affectsok, so no document that parsed before stops parsing. Thestreamsection ofdocs/spec-reference.mdnow says the same thing in one sentence. - A document whose handler modules are TypeScript source no longer lints green and then aborts at boot. A backend document declaring a
handlers[].modulewith a TypeScript extension (.ts,.tsx,.mts,.cts) validated withok: trueand no warnings at all, and the container then entered a restart loop: the production handler loader refuses TypeScript source fail-closed, because it loads compiled JavaScript only. Nothing about that needs a running system to see — the extension is written in the document — sodoctornow reports the newtypescript_handler_moduleadvisory athandlers[<i>].module, naming the handler, the offending path, and the same two ways out agen-handlerrender already recommends: compile the module to.jswith a build step (the bundledexamples/acme-notes-backend/build.mjswrapper transpiles the handlers and rewrites the spec'smodule:paths), or re-render it as deployable ESM withrayspec gen-handler --emit js. It is an advisory, never an error: authoring against TypeScript source is the documented loop — the development loader takes un-built source through an explicit opt-in, and the shipped example documents declare such modules on purpose — sodoctorstill answersok: trueand no document that parsed before stops parsing.extensions[].moduleis deliberately not flagged, because that field is a pack root DIRECTORY reference rather than a module file path — the extension loader jails it as the pack root and appends its own entry file inside it — so there is no authored module extension there for the advisory to read. The extension set behind all three decisions — the loader's fail-closed guard, the pack resolver's sibling preference, and the new advisory — is written down in exactly one place rather than in copies that could drift, and@rayspec/specexposes it as the functiontypeScriptSourceExtensionOf(modulePath), which answers with the TypeScript-source extension a module path carries — case-folded — or nothing when it carries none. It is a function and not a shared set on purpose: a set handed across the package boundary is a live object any consumer, or any code merely sharing the process, can add to or clear, and the loader's fail-closed guard reads that answer, so it must not rest on state a caller can rewrite. The match is case-insensitive at all three sites, so an uppercase extension is the same dead end as a lowercase one. All three make byte-for-byte the decisions they made before. rayspec deploy --dry-runreports a frontend-only document truthfully instead ofok: false. Such a document is not a product document, so composing it against the product runtime was never the question — yet that is what the check did, and it answered with three schema violations and exit1for a document the same command boots on the static branch. When the product grammar rejects a document, the dry-run now classifies it with the same detection that boot branches on and answers for the boot it would perform:ok: trueand exit0, with astaticProfileblock in place ofcomposednaming the profile, listing thefrontendMountsit would serve, and stating outright that no database is touched, no migration applies, and there is nothing to compose. The honest boundary narrows with it — only the document was read, so what stays unproven is whether the declared directories hold built assets and that the app serves. Every other document's verdict is byte-for-byte what it was: the compose path, itscomposedsummary and itsnotProvenlist are untouched, it stays as fast as it was (a product document's dry-run — whether it composes or reports violations — loads no boot machinery for the new classification, which is asked only of a document that is not the product profile), and the guards are unchanged (--apply-migrationwith--dry-run, and--apply-migrationagainst a frontend-only document, are both still refused as usage errors).rayspec deployboots a frontend-only document as the static profile, before any secret is read. A document whose only section isfrontendis detected by the same fail-closed shape predicate therayspec-serveentrypoint uses, and takes the same database-less, secret-less static boot — sorayspec deploy ./my-ui.yamlis now what the documentation says it is: the equivalent ofRAYSPEC_SPEC_PATH=./my-ui.yaml rayspec-serve. Both previous outcomes were wrong, in opposite directions. With the three boot secrets present in the environment,deploysilently booted the full server on such a document: a live OIDC issuer answering/oidc/.well-known/openid-configuration,GET /v1/auth/meanswering401instead of404, and noContent-Security-PolicyorPermissions-Policyon the served assets — the documented "provably no authenticated surface behind the assets" turned into its opposite with no signal. Without those secrets — the documented scenario — it refused to start at all, namingDATABASE_URL,RAYSPEC_JWT_SIGNING_KEYandRAYSPEC_API_KEY_PEPPERas missing. What an operator observes now, either way: the static boot banner, no database and no boot secret required, no auth / OIDC / run route mounted (/v1/auth/me→404),/healthreporting the declared mounts' readiness ({"status","frontend"}, still nodbfield and still no database probe), and theContent-Security-Policy+Permissions-Policysecure defaults on every served response (still overridable verbatim throughRAYSPEC_FRONTEND_CSPandRAYSPEC_PERMISSIONS_POLICY). A document that declares anything else — stores, api, agents, tooling, triggers, handlers, extensions, or a durable worker — is unaffected and takes exactly the boot it took before, including its fail-closed error on a missing secret. Because that boot touches no database it reaches no migration engine, so--apply-migration/--allowlistagainst a frontend-only document are now refused as a usage error (exit2, the message names the flag) instead of being accepted and dropped — the same ruledeployalready applied to--apply-migration --dry-runand to a bare--allowlist. The static boot itself is unchanged; its entry points (isStaticProfile,loadStaticServerConfig,assembleStaticServer,staticBootBanner) are now re-exported from the@rayspec/serverpackage root, so a wrapper can reach them as well.- A mounted static frontend answers non-content methods with
405instead of the SPA fallback. A static mount servesGET,HEADandOPTIONS; every other method on any path under the mount now returns HTTP 405 carryingAllow: GET, HEAD, OPTIONSand the platform's uniform JSON error envelope, with the newMETHOD_NOT_ALLOWEDcode joining the closed error-code set. Previously, on anspa:truemount aPOSTorDELETEto a path that does not exist — a removed API route, for example — was answered200withindex.html, so a caller could not tell a route that is gone apart from a write that succeeded; no data was written and no authorization was bypassed, the status was simply wrong. What integrators observe, by what the path used to resolve to: a non-content method against an existing file came back200with that file's bytes on either mount type; against a missing path it came back200+index.htmlon anspa:truemount, and on a plain mount either the404.htmlpage (when the mount ships one) or the uniform404. All of them now come back405with theAllowheader. Still answering first and keeping their exact response for every method: the reserved platform prefixes (/v1,/health,/oidc), the fail-closed path guard (traversal, dotfiles, symlink escapes) and the unsatisfiable-range416— all three run ahead of the method guard. Unchanged for the methods a mount serves:GET/HEADof existing files, theGETdeep-link fallback (200+index.html, so History-API navigation still works), and the404.htmlconvention — aGET/HEAD/OPTIONSmiss still gets the custom page, including itsHEAD/OPTIONSmetadata handling. The custom page is the one preserved surface that narrows: it sits behind the method guard, so on a mount that ships a404.htmla non-content verb is now answered405before the page is consulted. This narrows the1.6.2note that described the custom page as a plain mount's not-found surface without qualifying it by method. - A replayed
429from an agent run now carries the sameRetry-Afterthe live one did. A synchronous run that fails with the transientrate_limitedclass answers429and, when the backend adapter captured retry advice from the upstream limit, aRetry-Afterheader read back from the run's failing journal step. One run can answer that twice. A failed run that fired a non-idempotent tool keeps itsIdempotency-Keyreservation — releasing it would let a retry re-fire the side effect — so a same-key retry replays the stored result, and the replay applies the same status mapping and answered429as well. It just answered it bare: for one and the same rate-limited run the first caller was told how long to wait and the second was told nothing, so a client that keys its backoff off the header behaved differently depending on which of the two surfaces it happened to hit. Both now emit the header through one shared path, from the same journal step, so a run's429advises every caller identically. Nothing else about either response changes: same status, same body, and a429whose upstream sent no retry advice still carries no header, on both surfaces. - A
502from an agent run carries itsRetry-Aftertoo. The header followed the status rather than the advice: it was emitted only for a429, although an upstream5xxis classified with whatever retry advice came back exactly as a rate limit is, andupstream_5xxis a transient class whoseIdempotency-Keyreservation is released precisely so a retry re-runs. So a provider that answered503with aRetry-Afterhad that advice written to the run's journal step and then dropped on the way out. It is now emitted for every retry-advisable status, on the live response and the same-key replay alike, and the generated OpenAPI documents the header on the502as it already did on the429. A504still carries none — nothing upstream advises a delay for a deadline this platform imposed — and a502whose upstream sent no advice still carries no header. Every published RaySpec package now declares
"engines": { "node": ">=22" }, so installing one under an older Node is reported by your package manager instead of failing later at runtime. The Node requirement was declared only on the repository-root manifest, which isprivateand never published — so nothing in the packages you actually install said anything about Node, and an install under Node 18 went through silently. The incompatibility then surfaced whenever the code first reached a Node 22 API. All 29 packages of the publish closure carry the field now: the unscopedrayspeclauncher,@rayspec/cli,@rayspec/server, the five provider adapters, and every kernel, compose, capability and workflow package they depend on. Installing one under Node 18.20.4 makes npm printnpm warn EBADENGINE … required: { node: '>=22' }, and with--engine-strictit refuses outright (npm error code EBADENGINE, exit 1); under Node 22 the same install succeeds. One honest caveat about the closure as a whole:@rayspec/adapter-pidepends on@earendil-works/pi-ai, which declaresengines.node: ">=22.19.0", so an--engine-strictinstall of the full launcher closure needs that patch level rather than any Node 22. The>=22stamped here is this project's own floor, not a claim about every transitive dependency. Nothing else about the packages changed — same contents, same dependencies, same entrypoints.A future package cannot ship without it. The requirement string has one source, the repository-root
engines.node, so a Node bump moves one number.scripts/publish.mjsnow refuses a pack, dry-run or publish — before the first manifest is stamped and before the firstpnpmchild process — when any package in the publish closure omitsengines.nodeor declares a different value, naming every offender with its path and the value it carries. The stamping step deliberately does not inject the field: a package that does not declare the requirement in its committed manifest must not ship at all, which is the whole point of the check. Workspace members outside the publish closure (@rayspec/parity,@rayspec/local-boot) are untouched — nobody installs them.- The Expense-Claim Auto-Coder example ships the build step its documented live smoke needs. Its spec points
handlers[].moduleat the committedhandlers/*.gen.ts, which are the byte-goldens the renderer is pinned against — and the runtime loads compiled JavaScript only, so the boot in that example's README fail-closed on TypeScript source instead of serving.build.mjsnow writes the deployable form: it renders each committed hole-set withgen-handler --emit js, marks the output directory as ESM, and copies the spec with itsmodule:paths rewritten — so the example boots fromdist/rayspec.yamlthe way the bundled hand-written backend already did. It renders rather than transpiles because for a generated handler the JavaScript target is a first-class render, and a comment-stripping transpile would ship a file the renderer never produced. Repository examples only: no published package, API or runtime behavior changes. - Two backends built into
dist/no longer share one throwaway development database. The local-boot wrapper derives its database name from the spec file's directory precisely so that side-by-side backends do not collide, but it read only the last path segment — which isdistfor every built backend, so the second boot silently DROPped and re-created the first one's database. A spec inside a build-output directory is now named after the backend instead, and the derivation is a pure exported function with the collision pinned by a test. Development wrapper only. - Two backends with long directory names no longer share one throwaway development database either. The same derivation was unbounded in length, and Postgres stores only the first 63 bytes of an identifier — so two sibling directories whose names agree on their first 49 characters were one database, and the second backend's first-deploy boot DROPped and re-created the first one's data. Nothing reported it afterwards, because the connection URL built from the untruncated name resolves to the truncated database. A derived name that would not fit is now capped and disambiguated with a short digest of the resolved spec path, so the result is at most 63 bytes and what keeps two capped siblings apart is that digest rather than how much of their directory names happens to fit. That is a bound, not a guarantee of distinctness: the digest is 8 hex characters, so two capped names still collide when their spec paths' digests do — accepted deliberately for a throwaway development database, where the failure being closed is that every sufficiently-long sibling pair collided by construction. A name that already fits is returned unchanged, byte for byte, so an existing backend keeps the database it has been booting into. A spec at a filesystem root now derives a complete name as well: its directory segment is the empty string, and the fallback only covered an absent one, so every such spec derived the single name
rayspec_local_. The cap also reserves the nine bytes the companion<name>_dbos_sysneeds: truncation makes that identifier equal to the database's own at exactly 63 bytes, so a cap that only respected the 63-byte limit would have put every newly capped name on the one length where the boot's companion drop names the app database instead of the companion — the drop is issued one statement after that database has been dropped, so it would find nothing and stale workflow state would survive. Capped names are therefore at most 54 bytes and both identifiers stay whole and distinct. A directory name that already fits but is longer than that keeps the aliasing it has today: changing it would orphan the database that backend has been booting into, which is the collision this derivation exists to avoid. Development wrapper only. RAYSPEC_REQUIRE_MEDIA_TESTSreaches the suite it gates. The remux suite carries an un-skippable guard that refuses to self-skip when the variable says the real media proof is required — butpnpm testruns the suites through turbo in strict environment mode, and the variable was not among those the test task declares, so it was stripped before any test saw it. Measured with the variable set and ffmpeg unavailable: the suite reported 66 passed and 3 skipped, which is exactly the false green the guard exists to prevent; it now fails. Its two siblings for the database- and provider-backed suites were already declared. Repository tooling only.- A deployment booted from a
*.product.yamldocument now runs the daily platform housekeeping job it was always documented to run. The job — one platform-wide pass that hard-deletes expiredoidc_modelsrows and then runs the operator-gated GDPR tombstone purge — rides the durable worker, and the rule has always been that it is wired whenever a durable worker is launched, independently of whether the spec declares cron triggers. A product deployment does launch one, but only the classicrayspec.yamlboot registered the job; the product boot never constructed the scheduler at all, so on that deployment shape the daily pass simply never happened. Nothing said so: no boot line mentions the cleanup, the only symptom is a table that quietly never shrinks, andRAYSPEC_CLEANUP_SCHEDULE,RAYSPEC_GDPR_PURGE_ENABLEDandRAYSPEC_GDPR_RETENTION_DAYSwere all resolved at boot — the retention window fail-closed-validated, the gate and the crontab taken as written — and then never read. The product boot now registers the same scheduled workflow in the same pre-launch window, over the same pool that boot's worker already runs on, and gains the same on-demand cleanup seam the classic profile has always had: an in-process one,BootedServer.runCleanupNow, available to a host that embeds the server — no route and no CLI command invokes it. The gate keeps its meaning exactly: unset — the default — the purge counts what it would delete and deletes nothing, while the OIDC prune is ungated and always deletes. This changes what a running product deployment does: see the upgrade note. The classic boot is untouched, and both boot shapes are now pinned by tests that assert against the booted server — one seeds an expired token row and waits for the schedule loop to prune it with nobody calling anything, the other arms the gate and watches a past-retention tombstone actually disappear. - A mistyped key in a
gen-handlerholes file is refused instead of quietly rendering a handler without the safety it names. The holes parser read the keys it knew and ignored the rest, so a single character was enough to lose a server-side mechanism with nothing to show for it: starting from the Expense-Claim reference hole-set,clampValueswritten asclampValuerendered a handler with the whole server-side clamp gone (5207 bytes → 3964), andfkRevalidatewritten asfkRevalidatesrendered one with the foreign-key re-validation gone (→ 4648) — and both runs reportedok: trueand exited0, so the author had no way to notice from the render. The same loss was one level down, where a hole key is just as load-bearing:lookupFixedFilterwritten aslookupFixedFiltersrendered a foreign-key re-check without itsactive: truepredicate (5207 bytes → 5186), so the re-check began matching deactivated lookup rows, and — on a hole-set whose enum column carries no clamp, where nothing else notices —enumValueswritten asenumValuerendered a coercion without the closed-set membership check (3964 → 3895), so any string the model emitted was persisted into the classification column. Every hole object whose shape is fixed now carries a closed key set — the hole-set itself (per template), eachcolumns[]entry,fkRevalidate, and eachclampValuesrule, the last of which already was — the way the spec grammar already is: an unrecognised key fails the hole-set with the standard malformed-hole-set envelope (ok: false, anerrorsentry, exit1), names the offending key, and names the known key it is a near-miss of. The map-valued holes (fixedValues,fixedFilter,lookupFixedFilter,clampValues) are keyed by column name, so their keys stay fenced by the snake_case charset and the column rules — which leaves no tolerated annotation prefix at any level. A hole-set that only uses declared keys is unaffected and renders byte-for-byte what it always did. - A relative
--outno longer scatters the release tarballs one per package directory.scripts/publish.mjs --packhanded--outto eachpnpm packchild exactly as it was typed, and those children run with their working directory set to the package being packed — so a relative destination resolved once per target: the 29-package closure landed in 29 separatepackages/**/release/v<version>/directories while the run printed the single unresolved path as if the tarballs were all there.release/is gitignored at any depth, so nothing about that showed up ingit status. The documented release sequence passes exactly such a relative path and then hands the same string torelease:identityandrelease:identity-verify, which resolve it against the repository root — so pointed at a directory the pack never wrote, those two would build and verify a release-identity manifest over whatever an earlier run happened to have left there and report0 failure(s)for tarballs that are not the ones just packed. The destination is now resolved to an absolute path once, before the first target is packed, so every target lands in that one directory and thetarballs → …line names it. An absolute--out, and the temporary directory used when--outis omitted, are unchanged. Measured on a tree with noreleasedirectory anywhere:node scripts/publish.mjs --pack --out release/v1.7.0from the repository root puts 29.tgzin<repository-root>/release/v1.7.0/andfind packages -name '*.tgz' -path '*/release/*'finds none, where before it found 29 and the repository root held none; the documented steps that follow then run verbatim. Repository release tooling only: no published package, API or runtime behavior changes. - A boot that refuses because
RAYSPEC_FS_SOURCE_ROOTdoes not name an existing directory now tells the operator which variable to fix, and tells them without a stack trace. The read-only fs-source root is validated once, at boot: a path that does not exist, and a path naming a regular file, both abort. That refusal is raised inside@rayspec/platform, which is handed a plain root path and never learns which variable produced it, so the message named the resolved path and nothing else — unlike the environment refusals those two boot paths raise themselves (RAYSPEC_GDPR_RETENTION_DAYS,RAYSPEC_ACCESS_TOKEN_TTL_SECONDS,RAYSPEC_CRON_TENANT_ID,RAYSPEC_BLOB_ROOT,RAYSPEC_MEDIA_PREP), which each name the variable they refuse on. It was also outside the small set of classes therayspec-serveentrypoint recognises as operator-actionable, so it printed asboot failed:followed by a Node stack trace of absolute filesystem paths. Both boot paths now catch that refusal where the variable is known and re-raise it in their own house wording: a spec boot aborts withBoot aborted — RAYSPEC_FS_SOURCE_ROOT='<resolved path>' does not exist or is not a directory. … Fail-closed., and a Product-YAML boot with the same sentence behind that boot's ownBoot aborted (Product-YAML) —prefix. Both classes are onesrayspec-serveprints message-only, so the refusal now arrives as that one line and nothing else. Nothing about the decision changed: the same two conditions refuse, the process still exits non-zero, serves nothing, and never creates the directory it refused — measured on the real entrypoint, which exits1and leaves the missing path absent.makeFsSourceFactorykeeps its(root: string)signature and its own message, so an embedder calling it directly sees exactly what it saw before. - A product-boot refusal through
rayspec deployno longer carries a stack trace — it is the diagnosis alone, the way the same refusal throughrayspec-servealready was. Both entrypoints assemble the same deployment and raise the same refusals, but only therayspec-serveentrypoint countedProductBootErroramong the errors it reports as a message rather than as a crash. Throughrayspec deploya product-boot refusal fell into the unexpected-error arm instead: an operator who setRAYSPEC_PRODUCT_TENANT_IDto something that is not a UUID got the diagnosis followed by seven stack frames of absolute paths belonging to the machine that built the artifact — paths that name nothing on the operator's own machine, in a trace that buries the line telling them what to fix. Measured on the shippedacme-notesproduct against a throwaway database: that refusal now writes the single line[rayspec deploy] Boot aborted (Product-YAML) — RAYSPEC_PRODUCT_TENANT_ID=…and exits1, where the same command previously wrote eight lines, seven of thematframes; a well-formed id that names no live org, and an unsupportedRAYSPEC_MEDIA_PREP, likewise lose their frames. Exit codes and the wording of every diagnosis are untouched — only the trace is gone. An error that is not one of the fail-closed classes still prints its stack, so a genuine crash stays exactly as debuggable as it was. The two entrypoints now name the identical four classes (BootConfigError,BootTimeoutError,DeployError,ProductBootError), compared at the source by a test so they cannot drift apart again. What each entrypoint prints for a given class is unchanged by this release: aDeployErrorthroughrayspec deploystill carries theroll-out refused:prefix and the follow-on line naming the sanctioned registration path, whichrayspec-servedoes not print. - A deliberately generous
RAYSPEC_FFMPEG_TIMEOUT_MSno longer turns into the shortest cap there is. The variable is a wall-clock cap on ONE ffmpeg or ffprobe child, and the number an operator wrote went straight into a timer — which keeps a delay only up to 2147483647ms and silently substitutes 1ms for anything larger (Node printsTimeoutOverflowWarningbeside it). A cap above that ceiling therefore did not wait longer, it waited a millisecond: the child was SIGKILLed while perfectly healthy and the step ended as a fail-closed remux error naming a timeout that had never applied, so every recording that needed stitching — the transcription path included — failed. Both the ffmpeg and the ffprobe child were affected, since they read the same variable. Measured against a stub child that works for two seconds and then fails: at2147483647the remux ended on the child's own exit after 2021ms, at2147483648it ended on the timer after 6ms. A value above the ceiling is now UNUSABLE and uses the 120000 default, which is the rule the agent-run bounds already apply to their four variables; it is not clamped to the ceiling, because running with a number nobody wrote is its own surprise, and an operator who asks for an enormous cap is asking for the work not to be cut off, which the generous default already gives them. The same now holds at the other end, where a timer behaves identically: a value that floors below 1 —0.5— used to reach the timer and become a 1ms cap, and is unusable too. A value in range is read exactly as before, now floored to a whole millisecond so the cap the timer gets is the one the refusal message names..env.examplestates the extended rule, in the wording the agent-run bounds block already uses.
# documentation
- Three shipped statements narrowed to what the code carries. (1) The getting-started page said a minted API key "authenticates a client that only holds the API key", one block below a worked
GET /v1/auth/mecall — so a reader followed the same call with their new key and got a401readingAuthentication failed.for a credential that is perfectly valid. The key is resolved to a principal; that route just answers a user identity, and an API-key principal has no user behind it, so the handler refuses. The sentence now scopes the key to the routes the spec declares and names the exception. (2) The CLI reference presentedpath_escapeas an emitted errorcode, in a section that documentscodeas a closed set — but every read-time refusal is deliberately flattened ontoyaml_parse_errorso the envelope stays uniform, and the message carries the cause. The reference now says which code actually arrives and that a tool must read the message to tell a jail refusal from a syntax error. (3) The walkthrough tells you to createrayspec.yamlin the repo root, which left a reader who followed it inside their own clone with an untracked file from then on; that path is now ignored, as.env, eachdist/andrelease/already were. No behaviour changed in any of the three — the code was right and the words were not. - The getting-started walkthrough's token-expiry recovery can now be carried out by a reader who followed the page literally. The page provisions the first tenant with a pinned owner address and never passed
--password, then promised — in a paragraph added this release — that an expired 8-minute token could be refreshed by runningdev bootstrap-tenantagain or bylogin. Neither half worked for that reader. A repeat with the pinned address is a409and the command reportsREGISTER_FAILED; a repeat without one takes a per-run default address, so it succeeds but registers a different owner and creates a different organization — a token scoped to an org the deployment is not bound to, which is exactly whatRAYSPEC_PRODUCT_TENANT_IDmust keep matching. Andloginneeded a password the reader never chose: the walkthrough's own by-handregistercurl prints one, but that value belongs to the illustrative calls, not to the CLI invocation, and the command's actual default appeared in no published document. The walkthrough now passes--passwordexplicitly, the recovery paragraph is alogincall the reader can copy, and it says plainly not to re-rundev bootstrap-tenantfor a fresh token, with the reason.dev bootstrap-tenantin the CLI reference states what each optional flag falls back to — the timestamped default address, the default organization name, and the development default password — instead of promising "sensible defaults". - The declared-route throttle is described by its real reach, and the generated OpenAPI advertises it. "Every declared route is rate limited" would overstate twice, and the reference does not say it: a stream
playbackroute is authorized by a signed media token, mounts its own middleware and is bounded by the per-user concurrent-stream limit instead, and that phrasing would reach the platform's own/v1/auth,/v1/orgsand run routes as well. The reference also states three things a deployment has to plan around. Each of those two tier allowances is one budget for the whole declared surface, so a client spends the same 30 or 600 whether it calls one route or twenty — a route may additionally declare its ownrateLimit, which is counted separately and per route. The strict tier is only as precise asRAYSPEC_TRUSTED_PROXIES: left unset behind a load balancer every unvalidated request presents the balancer as its source and shares ONE bucket, so a first-party client whose token has merely expired meets a429instead of the401it would have refreshed on. And because the tier is chosen after validation — the entire point — a forged credential still costs one key lookup or token verification before it is refused, so the throttle bounds route work rather than credential checking. Separately, the emitted OpenAPI document (GET /v1/openapi.json) documented the throttle429only on{agent}routes, where it shares a response code with the run-outcome429; a generated client saw two unrelated meanings on one kind of route and none anywhere else. Every declared route that mounts the Bearer chain now carries it, with itsRetry-Afterheader, whileplaybackcorrectly carries none and the{agent}arm keeps its own richer description. - The authoring skill teaches the whole untrusted-input pattern, not its first third. Its agent guidance said only that record content is "untrusted data, never instructions" — the framing that stops an attack which COMMANDS an agent and leaves the two that merely ASSERT a field value or INVENT a policy untouched. It now asks for all three statements (data framing, which field wins on a contradiction, and that the stated rule is the whole rule), documents the
agent_untrusted_field_precedenceadvisory next to theagents[]grammar the waytypescript_handler_moduleis documented, and notes that how reliably any of this carries depends on how mechanically enumerable the decision is. The chat-responder template no longer implies its framing makes a reply injection-proof: a responder answers by judgement, so its real bound is the tool-less agent andvalidation.check, both already declared.examples/lead-qualifier/PRD.mdandexamples/expense-claim-coder/README.mdcarried the same one-third framing; the latter credited the trust boundary for an outcome its handler's server-side re-validation of the model-chosen category is what actually guarantees. - Cancelling a run on the
anthropicbackend is now described by how long it actually takes, and the child's death is proved against a real process id. The reference table said theclaudechild "is torn down", with no qualification, and the adapter said the same to anyone reading its source — which reads as "immediately" and is not what happens. The pinned SDK ends the child's standard input at once and then escalates on timers: a two-second grace, thenSIGTERM, then five more seconds, thenSIGKILL. Measured against a real child, standard input closed 1 ms after the abort, a child that honoursSIGTERMwas gone at 2014 ms, and one that ignores it at 7030 ms, while the adapter's own call returned at 2008 ms — so a caller gets its answer while the child may still be exiting. Both escalation timers areunref()ed, which costs something real: a host process that exits inside that window loses theSIGKILLrung, and a child that ignoresSIGTERMis then left running — measured still alive twenty seconds after a host that exited 200 ms after the abort, at which point the observation stopped. The adapter's README now lists that limit alongside the four others this backend inherits (every rung is sent to the child's own process id and never to a process group; no signal reaches a run executing in a separate worker process unlessRAYSPEC_RUN_CANCEL_POLL_MSis set; a tool call already in flight is not interrupted; work already committed upstream is not undone), and the reference table'santhropicrow says seconds rather than implying instants. Nothing about how a run behaves changed — what changed is that a reader can now find out what they are getting, and that a test in the adapter package drives the real SDK against a stand-in executable, holds the process id the SDK spawned and watches it disappear, instead of checking that a boolean flipped. That test exercises the SDK's process-level teardown; it says nothing about the vendor binary's own shutdown behaviour. - The documented environment surface covers seventeen more variables an operator can set.
.env.exampleis what the CLI reference and the getting-started guide both call the full set, and it omitted every variable in this list, including two that gate irreversible behavior: the GDPR tombstone purge (RAYSPEC_GDPR_PURGE_ENABLED, whose absence leaves the purge counting rather than deleting) and its retention window (RAYSPEC_GDPR_RETENTION_DAYS, where a value that is not a non-negative number refuses the boot). The rest are the access-token lifetime, the body-refresh opt-in, the daily cleanup schedule, the handler and fs-source roots, the media-prep selector with its ffmpeg/ffprobe binaries and per-child timeout, the conversation and normalize executors, the extraction-config override, the update-mode delta and allowlist paths, and the.envauto-load opt-out. Each entry states its default, what an unusable value does, and whether that is a refusal or a fallback. Four variables that only change how this repository's own suites behave are deliberately still absent, as is one the codex adapter writes per run rather than reads. - Four reference statements a reader could act on wrongly. The
/healthdocumentation described thefrontendfield and the503but never thestatusvalue that accompanies them, so an operator matching the body exactly would meet an undocumented"degraded"in production; thebigintmigration guidance covered only the widening direction, leaving the reviewer'sUSINGobligation and the narrowing failure unstated; the handler facade's ordering paragraph gave theid ascdefault without the offset-paging caveat its own SDK docstring carries; and thegen-handlersection documented a required--holesflag whose file format appeared nowhere indocs/. The authoring skill also gained theapi[].rateLimitfield, which it had omitted entirely, and its clamp rule now names the mechanism that enforces it. Contributor-facing: the test-suite gates that turn a self-skip into a failure are documented inCONTRIBUTING.md, which previously stated the false-green principle without naming the lever. - The contributing guide's live-test promise is now the one the suites actually keep, and it names the variable that closes the gap. The guide said
RAYSPEC_REQUIRE_LIVE_TESTS=trueturns a provider-backed skip into a collection-time failure the wayRAYSPEC_REQUIRE_DB_TESTS=truedoes for the database-backed suites, and then offered a run "where nothing skips". For the cross-backend parity smoke that holds only when no provider credential at all is present: hold exactly one and the guard is satisfied, the blocks whose credential is absent skip themselves, and the run exits 0 — measured collection-only, a single credential collects one of that file's five live blocks and the other four never run. (The server intake smokes and the Deepgram live test do fail on their own missing credential, which is what made the blanket claim look true — but the opt-in does not gate them at all: they call a real provider whenever their own credential is present, so a filled-in repo-root.envis enough for them to spend.)RAYSPEC_LIVE_BACKENDSis what makes it true — a comma-separated list drawn fromopenai,pi,anthropicandcodexnaming the backends a run must exercise, where a named backend whose credential is absent, or a name outside those four, fails collection instead of skipping — and it appeared in no document a contributor reads. It is now documented beside the other require-gates, with its value form, the four names and the credential each one needs, and the guide no longer promises a no-skip run it cannot deliver on a partial credential set. No behavior changed: the same credential configurations are refused, with byte-identical messages, and the continuous-integration live lane still names its backends explicitly. The decision itself is now a pure function the parity package tests directly, one case per credential configuration, so the one-credential behavior the guide now describes cannot drift away from it unnoticed. - The expense-claim auto-coder's smoke script no longer carries its own copy of the boot sequence. Its
Prereqs:header restated the setup and pointedRAYSPEC_SPEC_PATHat the committedrayspec.yaml, whosehandlers[].moduleentries are TypeScript source — the loader refuses those fail-closed, so that boot aborted at deploy with exit 1 and nothing was served, which means theRun:line under it could never fire. Holding a second copy is what let it drift out of step withexamples/expense-claim-coder/README.md, so the header no longer holds one: it states what the script assumes — the builtdist/backend already being served — and sends the reader to the README's "Run the live smoke", now the single place that sequence lives, as the sibling example scripts already do. The script keeps its own usage line, and its unreachable-server message names the same section. - The same smoke script no longer announces a
404on a declared agent route, and the spec reference now states what such a route does with a path parameter. Just before its write-isolation check the script postsPOST /claims/{id}/codeas a second organization and printedexpect 404 — cannot code A's claim, with comments attributing that refusal to a tenant predicate resolving{id}— while its own case arm absorbed a200silently, so the announced expectation and the accepted status disagreed. No such resolution exists to refuse anything: anagentaction declaresagentand an optionalpersistToand nothing else, so a route names no store its path parameter could address; the route registers the tier throttle, authentication, tenant resolution andagent:run, then hands the request to the run surface, which prepends the matched parameters to the run input as a labelledRoute parameters:block and otherwise leaves them as text for the agent. The script now announces the run result it accepts, says why{id}is not resolved, and keeps the write-isolation re-read as the hard assertion it always was — which holds because every store the run touches goes through the tenant-scoped data layer bound to the caller's organization, so another organization's id matches no row there exactly as an invented one would.docs/spec-reference.mdgains a "The path parameter" subsection saying the same for every agent route, including the contrast a reader needs: astoreroute'sgetand the run routes do answer404on an id outside the caller's tenant. No behavior changed — the correction is in the example script and the reference. - The expense-claim auto-coder's README points at a security policy that exists. Its trusted-posture note offers exactly one link, and that link routed through a directory at the repository root which this repository does not have and has never had — no commit in the history touches such a path — so from
examples/expense-claim-coder/it resolved to a file that is not there, and the reader weighing the trust boundary the note describes had nothing to follow. The target is now../../SECURITY.md, which resolves to the repository rootSECURITY.md, the onlySECURITY.mdtracked here. Resolving every relative*.mdlink in every committed.mdfile confirms this was the only target that did not exist: of the 81 such links across 12 files, the other 80 each resolve to a file present in the tree. RAYSPEC_MEDIA_PREPis documented for the blank value it actually accepts. The.env.exampleentry promised that "Any OTHER value refuses the boot by name — an invalid value is never coerced", and the doc comment abovemediaPrepEnabledsaid the same for "any OTHER value". Both overstate: the selector is read with?.trim()and the unset branch accepts the empty string alongsideundefined, so a blank value takes theffmpegdefault and wires the prep step. An operator who leftRAYSPEC_MEDIA_PREP=in a file — the ordinary way an env var is neutralized without deleting the line — was told to expect a named refusal and got a silent default instead. Both texts now say "blank counts as unset", the phrasingRAYSPEC_ACCESS_TOKEN_TTL_SECONDSandRAYSPEC_GDPR_RETENTION_DAYSalready use for the same shape, and both state that the value is trimmed before it is matched, so the refusal claim reads on non-blank values only. No behavior changed — blank keeps counting as unset. The unit tests gain the two arms that pin it: an empty string and a whitespace-only value both resolve to the wired default, alongside a case-variant arm (FFMPEG) that still refuses, since the match is exact after trimming. The refusal message itself now reads "unset or blank ⇒ ffmpeg": the doc comment said blank counts as unset, but the message an operator meets on a typo is the only place that reaches them, and it namedunsetalone. The comment above the reader no longer claims the repo-wide law that every declared env fail-closes on an invalid value — it states what this reader does.- Two shipped sentences narrowed to what they can carry.
.env.example'sRAYSPEC_FS_SOURCE_ROOTentry said the root is checked by "a boot that DEPLOYS A SPEC (a rayspec.yaml or a *.product.yaml document)", but a frontend-only static document is arayspec.yamltoo, and that boot does not read the variable — the entry says so three lines later. It now names a backend spec. Inexamples/expense-claim-coder/smoke.sh, the comment above the printer said a body "is only ever printed in a form that cannot leak", which claims an invariant the printer does not establish; it now says what the printer does, which is mask three named fields. .env.exampleno longer claimsRAYSPEC_FS_SOURCE_ROOTis validated on every boot. The entry said the root is "checked ONCE at boot — a root that does not exist or is not a directory refuses the boot", which an operator reads as a guarantee that a typo cannot start a server. It holds only where the fs-source is actually built, and only two boots build it: therayspec.yamldeploy and the*.product.yamldeploy. Both build sites are gated on the variable alone, so a spec deploy checks the root whether or not the document declares a handler or toolinit.fsSourcewould be handed to. An auth-only boot (noRAYSPEC_SPEC_PATH) deploys no spec, so it never constructs the factory the check lives in — it resolves the value to an absolute path, validates nothing, and serves; a frontend-only static boot does not read the variable at all. The entry now says where the check applies and what the other two boots do instead. The refusal itself is unchanged, and the boot suite gains the missing half of the picture: the same missing-path and regular-file roots that abort a spec deploy are now asserted to serve on an auth-only boot, beside the arms that pin the refusal. No behavior changed — the correction is in the sample environment file.- The README's "From source" block now explains the
Failed to create binwarnings it makes the reader produce. Its first two commands clone the repository and runpnpm install && pnpm build, and on a fresh clone the install half prints a run ofWARN … Failed to create bin at … ENOENTlines and then exits0: it runs before the build, so the two workspace bins it tries to link —rayspec(@rayspec/cli→./dist/index.js) andrayspec-serve(@rayspec/server→./dist/serve.js) — still point atdist/files nothing has written, and each link is reported more than once. The README said nothing about them, so the first thing the page produced was unexplained red text; getting-started has carried the same explanation since #66, but a reader in the README is not reading getting-started. A blockquote directly beneath that command now says they are non-fatal and why, and states the consequence the rest of the block silently depends on: nothing links those bins untilpnpm installis run again after the build, and even then onlyrayspec-servereaches the repo-rootnode_modules/.bin, because the root package depends on@rayspec/serverand not on@rayspec/cli— which is why the block's CLI steps invokenode packages/app/cli/dist/index.jsrather thanrayspec. The same correction lands indocs/getting-started.md, whose note promised that a re-run install "creates the bins cleanly" and so implied both. The block'sdeploystep also prints the boot'sNON-REAL PROVIDER(S) SELECTEDbanner, because the block selectsSTT_PROVIDER=fake; its comment now names that banner as the expected dev/CI posture, as the walkthrough already does. No behavior changed — the build sequence the README documents is untouched.
# security
- The two chokepoint-family gates refuse to certify a source root they never read. Both
pnpm gate:chokepoint(no raw-db handle orunscoped()in the request path) andpnpm gate:adapter-handlers(no tool handler outsidectx.dispatchTool) walk a fixed list of source roots, and their directory walk returns silently on a path that does not exist. Renaming or moving any one of those packages therefore retired that root's scan without a signal: zero files read, zero violations found, exit 0, and a PASS line indistinguishable from a real one — the adapter gate's line even names all four adapters as clean. Each gate now counts the files it scanned per root, exits non-zero naming any root that read nothing, and reports its coverage in the PASS line the way the handler-imports, extension-capability and no-pack gates already do (… 100 source file(s) across 4 root(s) …). This is the same fail-open, and the same guard, thatcheck-no-pack-imports.mjsalready carries. No invariant was unenforced: the roots are correct in this tree and both gates fire on a planted violation — what changes is that a future rename becomes loud instead of silent. Repository infrastructure only: no published package, API or runtime behavior changes. The regression runs locally viapnpm test:gate-coverage. - The expense-claim-coder live smoke no longer prints credentials to the terminal. Its
pphelper pretty-printed whole response bodies at seven call sites, and three of those bodies carry credential material: the user access token fromPOST /v1/auth/register, the org-scoped access token fromPOST /v1/orgs/{id}/switch, and the api-keyplaintextfromPOST /v1/orgs/{id}/api-keys— which has no expiry and holdsstore:writeandagent:run. A developer running the smoke therefore had all three in their scrollback, and in any log or paste of that run.ppnow replaces the values ofaccessToken,refreshTokenandplaintextwith[REDACTED]before printing, at any depth of the body. Masking sits in the printer rather than at the call sites, so all seven are covered at once and any call site added later inherits it; thejq-less fallback path, and a bodyjqcannot parse, get the same treatment textually. This follows the shapeprint_runalready uses one function down, where a run result is projected to a fixed field list so the raw input never reaches the terminal. What a run observes: keys and every non-credential field print exactly as before —tokenType,expiresIn,keyPrefix,scopesand the run fields are unchanged, and the set of keys printed across a full run is identical — because only the three values are rewritten. No assertion changes: each credential is read withjvalout of$BODY, never out of what was printed, so the lookup, injection, clamp, idempotency and write-isolation proofs are untouched. - Six dependencies carrying published advisories are pinned forward:
brace-expansionto 5.0.9,postcssto 8.5.23,fast-urito 3.1.5,undicito 8.9.0,ip-addressto 10.3.1 andhonoto 4.12.34, closing ten advisories in total (three High, seven Medium). Every one is held at an exact version through the repository'spnpm.overrides, so closing them is a version change in one place rather than a resolution change: the dependency graph still resolves to the same 485 packages, and no package was added, removed or moved to a different major.brace-expansionandundicireach the closure through the pi coding-agent,ip-addressthrough the agent SDK. None of the advisories is reachable from a route this project exposes, but the dependency audit is deliberately deny-by-default — a known advisory on a shipped dependency fails the lane rather than being reasoned away, and the one suppression this repository carries is documented inosv-scanner.tomlwith its reachability argument. The dependency SBOM is regenerated with them. - The boot no longer writes the two auth secrets into
process.env, so a spawned child does not inherit them.assembleServerused to mirror the resolvedRAYSPEC_JWT_SIGNING_KEYandRAYSPEC_API_KEY_PEPPERontoprocess.envat the top of the boot, because the readers that need them —assertBootSecretsinsidecreateAuthApp, andgetApiKeyPepperon the api-key, session-secret and invite-token hashing paths — resolve lazily and looked only at the environment. That undid the gain the<VAR>_FILEsecret mounts exist for: an operator who supplies a key as a mode-600 file precisely so it is not in the process environment found it there anyway once the server was up, every child process the server spawns received a copy of it for free, and it was readable from outside the process (/proc/<pid>/environ, container inspection of the children). The boot now hands the resolved secrets to@rayspec/auth-corein-process through the newsetBootSecrets, and the readers take what the boot supplied first, falling back to the environment variables exactly as before for a caller that constructs the app directly. What a deployment observes: after a boot from<VAR>_FILEmounts, neitherRAYSPEC_JWT_SIGNING_KEYnorRAYSPEC_API_KEY_PEPPERis present inprocess.env, nor in the environment of any child spawned afterwards. A value an operator sets as a plain environment variable is left exactly where they put it — the boot does not scrub the environment, it only stops adding to it — so the documented plain-variable path is unchanged. A caller that relied on reading either secret back out ofprocess.envafterassembleServermust take it from theServerConfigit passed in. Fail-closed is unchanged: a missing or blank secret still aborts the boot with the same error, and no path falls back to an empty pepper or an unsigned token. A boot owns every secret it hands over, blank ones included — a caller that passes a hand-builtServerConfigwith an empty secret gets that same abort, never a silent boot on whatever the ambient environment happened to hold for that variable. - Bump the transitive
brace-expansiondependency to5.0.8(pinned viapnpm.overrides), resolving GHSA-mh99-v99m-4gvg — a regular-expression denial-of-service (ReDoS) advisory in the affected versions. Transitive-only; no API or behavior change. - Dependency advisories are re-checked on a schedule, not only on a push. A new
Dependency advisoriesworkflow scans the committedpnpm-lock.yamlagainst OSV.dev every Monday at 06:00 UTC (and on manual dispatch), with the same pinned, SHA-256-verified scanner build the push/pull-request audit uses — so an advisory published against a dependency that has not changed surfaces on its own instead of waiting for the next unrelated push to run CI. A finding becomes exactly one issue per advisory id, labeleddependencies(the label is created if it does not exist) and refreshed on later runs rather than re-filed, so an advisory never accumulates duplicates; a clean run files nothing, comments nothing and notifies nobody. The round is read-only: it changes no dependency, so the committed dependency SBOM and its freshness gate are untouched — that gate keeps tracking dependency drift while this round tracks advisory drift against a lockfile that has not moved. Repository infrastructure only: no published package, API or runtime behavior changes. The report-to-issue sync ships asscripts/sync-advisory-issues.mjsand runs locally viapnpm test:advisory-sync.
# upgrade notes
Everything below is documented in place above; this is the checklist. Nothing here applies to a deployment that only authors specs and deploys them — the items are for embedders, for operators of an existing database, and for clients written against the HTTP surface.
- Three interfaces gained REQUIRED members, so an out-of-repository implementation stops typechecking until it grows them.
ServerConfig(@rayspec/server) gainstenantBootstrapEnabled: boolean; the neutralDurableExecutor(@rayspec/platform) gainscancel(jobId: string): Promise<void>;CronSchedulerDeps(@rayspec/durable-dbos) gainstenantExists(tenantId: string): Promise<boolean>. A deployment that builds its config withloadServerConfigneeds no change — it fills the new field from the environment; only code that constructs one of these objects itself is affected. - Apply migration
0010_journal_step_error_columns. Two additive nullableADD COLUMNs onjournal_steps; no table rewrite and no backfill. - A product deployment whose
RAYSPEC_PRODUCT_TENANT_IDis malformed, or names no live org, now refuses to boot where it previously came up and waited for the org to appear. Settle the org before deploying —rayspec tenant ensure --org-id <uuid> --name <n>does it againstDATABASE_URLwith no running server. The cron tenant is deliberately unchanged. - A store read through the handler data facade with no explicit
orderBynow comes back orderedid asc. A caller that passes its ownorderByis unaffected. Code that depended on the previous unordered result should state the order it wants. - A mounted static frontend answers non-content methods with
405and anAllow: GET, HEAD, OPTIONSheader, where such a request previously fell through to the SPA shell with200. A client that sent one and read the shell as success will now see the refusal. /healthcarries one more field and one more status value. A probe that matches the body exactly should acceptfrontendnext todb, andstatus: "degraded"with503when a covered dependency is not ready.errorClasshas a new terminal value,cancelled. A client that enumerates error classes should accept it; a same-key retry replays it rather than starting a new run.- The two auth secrets are no longer mirrored into
process.env. Code that readRAYSPEC_JWT_SIGNING_KEYorRAYSPEC_API_KEY_PEPPERback out of the environment after boot now finds nothing there, and a spawned child no longer inherits them. - A deployment booted from a
*.product.yamldocument starts running the daily system cleanup, and one half of it deletes data. The job did not run there before, so on such a deployment both halves are new behavior. The OIDC prune is ungated and starts hard-deleting expiredoidc_modelsrows on the first scheduled instant after the upgrade; on a deployment that has been up for a while that first pass can clear a large accumulated backlog in one go — these are already-expired OAuth artifacts, but the delete is real. The GDPR tombstone purge runs only ifRAYSPEC_GDPR_PURGE_ENABLEDis exactlytrue: if you have that gate armed on a product deployment today you have been getting nothing from it, and after this upgrade you get the irreversible hard-delete the gate asks for — every user tombstone older thanRAYSPEC_GDPR_RETENTION_DAYS(default 30), and every membership tombstone older than its own org'sorgs.retention_dayswhere that column is set, else that same default, goes on the first pass, across every org in the database rather than only the deployment tenant. Confirm that is what you want before upgrading; leaving the variable unset, or set to anything other thantrue, keeps the purge as a dry run that counts and deletes nothing, and that dry run is the only mitigation the shipped surface offers — the on-demand seam is in-process (BootedServer.runCleanupNow, for a host that embeds the server), so there is no command to run the pass once under supervision first.RAYSPEC_CLEANUP_SCHEDULE(default0 3 * * *) now actually decides when that pass happens on this deployment shape — and because the expression is handed to the worker's scheduler as written, a value that scheduler cannot parse now aborts the boot of a product deployment that previously ignored it. The scheduler takes the standard 5-field crontab and the 6-field form that prepends a seconds field; shorthand such as@daily, a 4-field expression, or an out-of-range field is refused, and the refusal is the scheduler's own error, which names neither the variable nor the cleanup. Check the value before upgrading. Registering the job also adds one durable workflow to this deployment, which rotates the DBOS application version the product boot runs under: runs a pre-upgrade process enqueued or left in flight carry the old version and are neither dequeued nor recovered by the new one, so let the durable queues drain before restarting into this release (theapplicationVersionthat/recovery-scopereports changes with it). Deployments booted from a classicrayspec.yamlare unaffected: the job is wired there whenever the spec declaresdeployment.durableWorker: trueand backends are wired, exactly as before — a classic spec that declares no durable worker never ran this job and still does not. rayspec gen-handlernow refuses a holes file carrying a key the hole shape it sits in does not declare, where it previously ignored the key and rendered anyway. This applies at the top level (per template) and inside eachcolumns[]entry,fkRevalidate, andclampValuesrule. A holes file that only uses declared keys is unaffected and renders identical bytes; one that carried a typo, a key of the other template, or a hand-added comment/metadata key at any level stops withok: falseand exit1, and the error names the key (and the declared key it is a near-miss of). Fix the key or drop it — a build step that runsgen-handlerwill fail until it is settled, which is the point: that key was configuring nothing.- If you were reading your agent traces in the OpenAI dashboard from a
rayspec deploydeployment, setRAYSPEC_AGENT_TRACING=openaibefore upgrading, or they stop arriving. That path now leaves the export off unless the variable is exactlyopenai;rayspec-serveand the local development wrapper are unchanged. Set nothing else to that variable — any value other thanopenaioroffrefuses the boot. Whichever way you leave it, the boot banner states the resolved posture, so check theTrace export:line on the first boot after upgrading.
# added
- Static frontends can ship a custom
404.html. When a request to a mounted static frontend misses (no file, nodir/index.html, and no SPA fallback), and the mount's root contains a404.htmlfile, the response is that file's contents with HTTP status 404 (Content-Type: text/html) — the GitHub Pages / Netlify / Cloudflare Pages convention. Backward compatible for a deployment that does not already ship a root404.html: without the file, behavior is unchanged (the platform's uniform 404). A deployment whose static root already contains a404.html(or a nested mount that ships one) will begin serving it (status 404) on a miss — the convention. The custom page is served only on a genuine content miss: reserved platform prefixes (/v1,/health,/oidc) and refused paths (traversal, dotfiles, symlink escapes) keep the uniform 404, and aHEAD/OPTIONSmiss returns the 404 metadata without a body. On anspa:truemount the SPAindex.htmlfallback still wins, so the custom page is a plain-mount not-found surface.
# changed
- Boot secrets are whitespace-trimmed uniformly, whatever their source. Leading and trailing whitespace — a trailing newline (the
echo/printf/env-file classic) and a leading byte-order mark included — is now stripped from every resolved boot secret (DATABASE_URL,RAYSPEC_JWT_SIGNING_KEY,RAYSPEC_API_KEY_PEPPER) whether it is read from a<VAR>_FILEmount or from the plain variable, giving the two sources one documented contract instead of source-dependent behavior. Interior bytes are never touched, so a multi-line PEM keeps its internal newlines and its header at offset 0. For every well-formed secret this is a no-op: a base64 pepper and an RS256 PEM carry no edge whitespace, and the file path already trimmed. The one behavioral change is on the plain variable — a value carrying stray edge whitespace (for example an API-key pepper with a trailing newline) is now trimmed to the same value a file mount produces. Because the pepper is the HMAC key for api-key, session, and invite hashes, a deployment whose plainRAYSPEC_API_KEY_PEPPERcurrently carries significant edge whitespace must strip it before upgrading (already-issued keys and sessions were hashed under the untrimmed value and would otherwise stop verifying). The one contract limit: a secret whose real bytes must begin or end with whitespace cannot be expressed through a boot variable — encode such a value (for example, base64). journal_stepsgains acreated_atindex. Migration0009adds a btree index (journal_steps_created_at_idx) onjournal_steps(created_at), so time-range and day-bucket scans over the step journal are index-backed instead of sequential — paralleling the existingruns_created_at_idxon the run header. The change is additive and non-destructive;drizzle-kit migratebuilds the index on the existing table (a plain, non-CONCURRENTLYbuild that briefly locks writes for its duration, consistent with the run-header index).
# security
- Transitive
postcsspinned to 8.5.18 (GHSA-r28c-9q8g-f849). A pnpm override raises the transitivepostcss— pulled only by thevite/vitestdevelopment toolchain, never a runtime dependency — to the patched 8.5.18, clearing a source-map (sourceMappingURL) path-traversal advisory flagged by the dependency audit. Build- and test-time only: no runtime code path is affected and no published package's contents change.
# fixed
@rayspec/dbships its migration chain in the npm tarball. The package declaredfiles: ["dist"], which excluded the committeddrizzle/platform migration chain (meta/_journal.jsonand0000..0008_*.sql) from the published tarball. A backend booted from the npm packages therefore failed at startup inapplyMigrations()—migrationsDir()resolves to<pkg>/drizzle, absent in the installed package — before reaching the database. Addingdrizzletofilesships the chain, so an npm-consumed boot applies its migrations. No API or runtime code changed.
# added
- Boot secrets can be read from a file mount. Each of the three boot secrets —
DATABASE_URL,RAYSPEC_JWT_SIGNING_KEY, andRAYSPEC_API_KEY_PEPPER— now also accepts a<VAR>_FILEvariant (DATABASE_URL_FILE,RAYSPEC_JWT_SIGNING_KEY_FILE,RAYSPEC_API_KEY_PEPPER_FILE) naming a file to read the value from, so a mounted secret (mode600) stays out of the container's declared environment (docker inspect) and out of the process's own environment. Precedence is unambiguous and fail-closed: a set<VAR>_FILEwins outright (the plain variable is not consulted); a blank<VAR>_FILEcounts as not set (the plain variable is used); and a non-blank<VAR>_FILEpointing at a missing, unreadable, or empty file aborts the boot rather than silently downgrading to the plain variable. Documented in the CLI reference and.env.example. - A frontend-only spec boots as a static profile — no database, no auth surface. A backend-profile document that declares only a
frontend(emptystores,api,agents,tooling,triggers,handlers, andextensions, and no durable worker) now boots with noDATABASE_URL, JWT signing key, or API-key pepper, and mounts no auth / OIDC / run route — the database-and-auth composition is never reached (not merely left empty)./healthis liveness-only (200 {"status":"ok"}, no database probe). The two response security headers a reverse proxy would otherwise supply —Content-Security-PolicyandPermissions-Policy— are read from the environment (RAYSPEC_FRONTEND_CSPandRAYSPEC_PERMISSIONS_POLICY), each with a secure default when unset, so the app can serve a static UI directly with no proxy in front. This is distinct from serving a staticfrontendalongside a full API, which is unchanged. - Inline and hash-pinned extraction prompts. A product-profile
extractors[]entry may now carry its extraction system prompt inline as aninstructionsblock scalar, or pin an external prompt file by hash withinstructions_ref: { file, sha256 }— the file is read spec-relative (traversal-jailed) and sha256-verified at boot, fail-closed on a missing file or a hash mismatch. Exactly one prompt source is allowed (inlineinstructions, a pinnedinstructions_ref, or the existing sidecarprompt_file); declaring more than one fails closed. The no-code guardrail is narrowed, not removed: free-form prompt text is admitted only at the designatedinstructionsfield, and everywhere else — includingpurpose,extraction_constraints, and the still-bannedprompt/system_promptkeys — the guardrail stays fail-closed.
# changed
rayspec plan's read-only shadow guard resolves its target fromDATABASE_URL_FILEtoo. The guard that refuses to shadow-apply whenSHADOW_DATABASE_URLresolves to the same host and database as the realDATABASE_URLnow resolves that comparison target from aDATABASE_URL_FILEfile mount as well (with precedence over the plain variable), so it still fires when the connection string is supplied only through the mount. Becauseplanis read-only and never connects to the real database, a broken mount is not fatal here (unlike a server boot): it emits one stderr warning — naming the variable, the path, and the OS error code, never the file content — and proceeds with no comparison target rather than falling back to a possibly-stale plainDATABASE_URL.
# security
- Dependency advisories patched. Six advisories are resolved by upgrade (across
hono,brace-expansion,fast-uri, andprotobufjs— direct dependencies and their transitive copies), and the dependency SBOM is refreshed. One remaining advisory — a Windows-only@hono/node-serverserve-staticpath traversal, reached only transitively (the fixed 2.x line is used directly; the older copy is pulled in solely for a child-process JSON-RPC transport, never for static file serving) and not exercised on this project's Linux code paths — is not silently ignored: it is a single, tightly scoped, documented suppression in the vulnerability-scan allowlist, so a new advisory on any other package still fails the dependency audit.
# documentation
- Add a per-package
README.mdto the 22 published packages that shipped without one, so every package page on npm renders a purpose description, quickstart pointers, and the license summary. Docs-only release: no runtime, API, or dependency changes.
# added
- RaySpec is installable from npm.
npx rayspec initscaffolds a new project (a minimal, valid backend spec you canrayspec planand deploy without provider credentials), andnpm i -g rayspecputs therayspeccommand on your PATH — no clone-and-build required. The scoped@rayspec/*packages are published alongside the unscopedrayspeclauncher. - Declarative full-text search. A store can opt into Postgres full-text search with
fullTextSearch: true: the store gains a generatedtsvectorcolumn over its text columns, a GIN index, and a ranked__searchquery that orders results by relevance. Stores that do not opt in keep the existing substring search unchanged. - Out-of-band organization invites. Invite a member by email with a single-use, expiring, organization-scoped invite token; the invitee redeems it to join (setting their own password for a new account, or authenticating as an existing one). This closes the account-existence signal the direct member-add response carried.
- Read-only, path-jailed file source. A new
fs_sourcecapability gives handlers a deployer-configured, read-only reader over local files, contained by a symlink-safe path jail (no traversal or absolute-path escape). - Cron catch-up. A cron trigger can opt into missed-interval catch-up with
catchUp: true: on startup the worker replays each interval it missed while it was down (bounded look-back). Default behaviour is unchanged (no catch-up). - Manual trigger firing. Fire a manual trigger on demand through an auth-guarded, rate-limited, tenant-scoped control route (
POST /v1/triggers/:name/fire). - Live-executor readiness probe. A public
GET /recovery-scoperoute reports the live durable-executor identity ({ executorId, applicationVersion }), failing closed (503) until the engine has finished launching.
# changed
- Handler and extension-pack modules load compiled JavaScript in production. The production loader accepts only compiled
.jsmodules (a deterministic, Node-version- independent boundary); a raw.tsmodule is refused fail-closed. The shipped example backends now include a build step, and the docs state the.js-only contract. - Durable cron exactly-once is hardened. The run-level exactly-once guard on the durable cron path is strengthened, with a test that asserts the durable invariant directly rather than counting raw invocations.
- A first upload can no longer reset a sealed row. A conditional upsert closes the race where a first upload could reset an already-sealed row.
# fixed
rayspec planfails on a boot-fatal document. A document whose stores cannot be derived now returns a non-ok plan verdict instead of reportingok: trueand crashing at boot.
# documentation
- Tenant-table registration guidance corrected. The engine
deploy()and the server composition root now describe the real mechanism — a product table joins the deny-by-default chokepoint set at boot through the sanctioned registration hook, anddeploy()verifies rather than registers — replacing an out-of-date committed-source description.
# security
- The per-tenant Anthropic credential directory is hardened further. The directory is now created in a single atomic step (create-or-validate, with no check-then-create window), the credential root's ownership and permissions are asserted at startup, and the tenant identifier is validated — an empty, absolute, separator-, traversal-, or NUL-bearing value is rejected — before it is ever used to build a path. This builds on the mode-
0700and containment checks from the previous release. - All static-analysis findings are resolved. The code-, path-, and label-parsing and file-I/O findings surfaced by static analysis are fixed, or dismissed with a documented rationale, leaving zero open alerts.
- CI supply-chain integrity is tightened further. Container images used in CI are pinned by content digest, and repository secret-scanning with push-protection is enabled.
# changed
- Clearer startup and developer diagnostics. Boot now emits a progress line before the ready banner and fails with an explicit timeout message if it stalls; a failed development-database connection reports its underlying cause; and a second local instance can run alongside the first through container, volume, and port overrides. The getting-started guide is polished to match.
- Source comments and test descriptions are rewritten in self-carrying product language, and the repository check that keeps the shipped source product-neutral is stricter. These are non-functional text and tooling changes; runtime behaviour is unchanged.
# documentation
- The v1 posture now states its honest edges. A new "what v1 does not do yet" section documents that request cancellation is bounded to the request rather than propagated into in-flight work, that the hard-delete purge is operator-gated and off by default, and that the federation and residency columns are shape-only with enforcement deferred to the separate hardening layer.
# security
- The local server now binds to loopback (
127.0.0.1) by default. A freshly started instance no longer listens on all network interfaces; it is not reachable from the network until a host is explicitly configured, closing an accidental-exposure default. - Request bodies are size-bounded on every ingress path. Both the JSON and the audio-upload routes now reject an oversized payload before it is buffered, bounding the memory a single request can consume.
- Rate-limit identity is derived from a trusted peer, and the limiter store is bounded. A spoofed client identifier can no longer evade the limit, and the limiter's memory footprint is capped so a flood of distinct identifiers cannot grow it without bound.
- The session-reprocess affordance is now rate-limited and recorded, so repeated reprocessing of a session is bounded and observable.
- An incoming
x-request-idis constrained to a short, printable allow-list before it is echoed or logged, so an untrusted header value cannot inject control characters downstream. - A declared
quote_fieldthat carries no quote is now rejected under the unquoted-claim policy, rather than being silently accepted as an unquoted claim. - The per-tenant Anthropic credential directory is hardened against loose or hostile paths. It is created with mode
0700; a resolved path that is not a direct child of the configured root, an existing symlink or non-directory, or a group- or world-accessible directory is refused at startup (fail-closed), with containment re-checked against the real path. The adapter's interface and behaviour are otherwise unchanged. - Supply-chain integrity of the build is strengthened. CI actions are pinned to verified commit SHAs, the
gitleaksdownload is verified against a pinned SHA-256, and a CodeQL static-analysis workflow now runs over the codebase.
# changed
- The live provider parity smoke suites are now behind an explicit opt-in. They run only when
RAYSPEC_REQUIRE_LIVE_TESTS=true, with the exercised backends selected viaRAYSPEC_LIVE_BACKENDS; without the opt-in an ordinary test run never reaches a live provider or spends against a real credential. - Build and gate tooling resolve repository roots portably and fail closed on an empty scan, so a seam gate cannot pass vacuously.
# fixed
- An authentication test asserting that a password is never leaked is now deterministic, removing a source of intermittent test failures.
# upgrade notes
- Anthropic credential directory permissions — one-time action may be required. Anthropic credential directories are now created with mode
0700, and the adapter refuses to start when a credential directory is group- or world-accessible. If you upgrade an existing installation whose credential directory still exists with0755(or any group/other permissions), runchmod 0700on that directory once after upgrading — otherwise the Anthropic adapter will not start.
Minor hardening follow-ups are tracked for v1.4.1.
# added
- Persist a validated agent output to a store (
persistTo). An agent action — on both an api route and a trigger — may now declarepersistTo: <store>. On a successful run the validatedoutputSchemaoutput is written as one row into that store, exactly once, atomically with the run header's completing transition, across both the synchronous (in-request) and durable (off-request / recovery) execution paths. Safety is enforced at deploy, not runtime: the doctor validates the mapping in both directions and fails closed at boot on any mismatch — forward (every output property maps to a writable business column of a compatible type) and reverse (every NOT-NULL, no-default business column is reliably produced by a present, required, non-nullable output property; where a column and its mapped property both declare anenum, the property's enum must be a subset of the column's whitelist). - Declarative record-input normalization (
input_normalize). Therecord_inputcapability accepts an optionalinput_normalize: { agent, output_contract }that runs a declared agent over a submitted record before it is persisted: the record is transformed, re-validated, then stored — the stored and emitted value is the normalized one. It runs synchronously through the neutral agent path; a failure is fail-closed (nothing is persisted) and never leaks raw provider or database text to the client. It is idempotent, keyed on the canonical payload hash, so a retry converges while a corrected resubmission re-normalizes. It is wired via arecord/<agent>.normalizer.jsonconfig (path-jailed and validated); declaring it without a wired normalizer fails closed at deploy. A record capability without it is byte-identical to before. - Server-side substring search on
listroutes (?search=/?<col>__contains=). The declarativelistop gains an opt-in, additive, keyset-stable search:?search=<term>is a case-insensitiveORmatch across the store's declared text columns, and?<column>__contains=<term>matches one declared text column. User terms are bound parameters with theLIKEwildcards%and_escaped (ESCAPE), so they match literally rather than as wildcards. Search folds into the same AND-chain as the equality and set filters and composes with ordering and the keyset cursor.searchis a reserved query word — a store that declares a column namedsearchfails lint. created_byon escape-hatch handler inserts. A handler-managed store insert now stamps the injectedcreated_bycolumn from the authenticated caller (server-derived and un-spoofable), matching the declarativestorecreate path. A posture with no request principal is unaffected.
# changed
- Handler-facade input-validation rejections now return
400(previously500). An unknown column, a server-controlled column, anenum-whitelist violation, an injection attempt, an invalid timestamp, or a negative pagination value now surface as a typed400error rather than an internal500. The client-facing message stays generic and no internal detail ever leaves the server. - A spec-vs-spec plan no longer emits phantom platform-column deltas. Running
rayspec plan <spec> --against <copy>on two identical specs now produces no diff. The real-database injected-column reconcile stays reachable behind a new opt-in--reconcile-injected-columnsflag (an update-mode flag that requires--against). - Opt-in run-journal payload scrub during tenant erasure. Passing
journalScrub: trueto a tenant erasure NULLs the raw journal payload columns while keeping the journal rows and their idempotency and cost columns intact — closing the content-erasure gap where a per-subject purge left raw payloads behind. The default behaviour is byte-identical (no scrub).
# fixed
- A journaled error step-row no longer bricks an agent re-run. The run-journal writer now upserts a step on its unique key — replacing an
errorpredecessor, but never overwriting a successful row — and reconciles the run header to the healed terminal outcome without ever downgrading an already-completed run. A re-run of a previously-failed step now succeeds, and both run observability and the double-charge guard see the true result.
# documentation
- Documented
persistTo(agent output persistence) andinput_normalize(record-input normalization) in the spec reference and the authoring skill, and the new server-side substring search (?search=/?<column>__contains=) under thelist-route query surface — correcting the earlier "noLIKE/full-text operators" note.
# added
- Opt-in
readonlyroute handlers. A{ kind: route }handler may now declarereadonly: true. Ahandler-kind route is gated on the sensitivestore:writepermission by default (the platform cannot statically prove a handler only reads, so it fail-closes to the stronger gate);readonly: trueis the author's assertion that the handler only reads product stores, so its route is gated onstore:readinstead — letting a read-scoped credential (for example an ingest-only API key) reach a read-only route. It is an authorization gate / author assertion, not a runtime write restriction. An absent orfalseflag parses byte-identically to before, so every existing spec, fixture, and golden is unchanged. - A tenant-scoped session reprocess endpoint.
POST /v1/sessions/{id}/reprocess(store:write, strictly tenant-scoped) re-drives a session's declared finalized-session workflow as a fresh durable run under a distinct idempotency key — the operational recovery path for re-running extraction after a fix or unsticking a stuck session, without manual database surgery (simply re-emitting the finalized event deduplicates to the original run and does nothing). It is wired for audio products; a deployment with no reprocessor wired answers501, and a foreign or absent session id returns404with zero enqueue. - Opt-in reuse of a machine
claudelogin for the Anthropic backend. SettingRAYSPEC_ANTHROPIC_REUSE_LOGIN=truelets the Anthropic subscription backend boot with noCLAUDE_CODE_OAUTH_TOKEN/ANTHROPIC_API_KEYin the server environment, reusing aclaudelogin the operator has seeded into the per-tenant config directory underRAYSPEC_ANTHROPIC_CONFIG_ROOT(still required). A loud boot banner announces the mode. Honest caveats: the boot cannot verify any per-tenant directory is actually seeded, so an unseeded tenant boots clean and fails only at first run; seeding the login is a manual operator step; and if a token or key is also present in the environment it wins over the seeded login (the boot warns). Without the flag, boot behaviour is byte-identical (fail-closed when no credential is present). Documented indocs/concepts.mdand.env.example.
# fixed
- Store
enumwhitelists are now enforced on the low-level escape-hatch handler write path too. Atextcolumn's declaredenumwhitelist was already enforced on the HTTPcreate/updateroute and the workflowstore.writevalue path, but a custom handler writing directly through theHandlerDbfacade was not checked. It is now rejected fail-closed against a table-identity whitelist registry (a non-member value — including a non-string scalar — is refused; the failure names the store and column only, never the offending value), so all three write surfaces agree. This closes the "the facade is not enum-checked" residual noted in1.3.1. - Every sealed track of a multi-track audio session is transcribed. The session-finalized event fires as soon as one track seals, but a sibling track could still be uploading at that instant; the transcribe node re-read only the completed tracks and finished, permanently dropping any track that sealed afterward. The durable transcribe node now waits (bounded, with real retry backoff) for all tracks to seal before transcribing, so every sealed track is transcribed under a staggered or concurrent finalize. The finalize emit stays unconditional, so a session-scoped idempotency key still deduplicates to exactly one durable run (never zero). Honest bound: once the wait elapses the run proceeds with whatever sealed and logs loudly, so an abandoned upload can never stall the run forever.
- The migration generator emits foreign keys after the tables they reference. A store that referenced a later-declared store emitted its
REFERENCES <parent>before that parent'sCREATE TABLE, failing at apply (42P01 relation does not exist) whiledoctor/planstill reported ok. A stable topological sort now orders everyCREATE TABLEahead of the foreign keys that reference it (an already-ordered spec stays byte-identical, so committed goldens are unchanged). A genuine foreign-key cycle is now a blockingfk_cycleerror atdoctor/plantime (rather than a throw at apply); a merely out-of-order forward reference is a non-blockingfk_forward_referenceadvisory. - An unsatisfiable
Rangeon a staticfrontendmount now returns416. The underlying static server mishandled an unsatisfiable byte range — a closed range beyond end-of-file yielded a malformed 0-byte206, and an open one surfaced as a500. An additive guard now returns RFC-7233416withContent-Range: bytes */<size>for an unsatisfiable range (a start at/after EOF — open or closed — or a reversed range), underGETand every write verb.HEAD/OPTIONSstay200full-size (never416), every satisfiable/clamped206is unchanged, and the fail-closed dotfile/traversal/symlink guard still returns404under aRangerequest. This corrects the1.3.1note that said an unsatisfiable range returns500. - API-key minting is exactly-once under a concurrent
Idempotency-Key. The mint applied idempotency as a non-atomic find-then-act, so two concurrent requests with the same key could each mint a distinct usable key with the loser's key left stranded (usable but never replayable). The mint is now retrofitted onto the atomic reserve-before-execute primitive: a concurrent loser replays the winner's redacted mint metadata (200, plaintext omitted — a caller that lost the original201must mint a new key) or gets a409while the mint is in progress, and exactly one key is ever minted. The no-idempotency-key path is behaviourally unchanged, and the plaintext secret is still never stored (the kill-trigger closure is preserved). Honest residual (documented in code): exactly-once except a rare ambiguous mint-commit window. - A user-dismissed collection row is preserved across a rebuild. The collections materializer re-stamped
dismissed: falseon every rebuild, so re-extracting (or a reprocess) would resurrect a user-dismissed artifact. A dismissed row is now spared unconditionally — reconciliation never deletes it and the upsert loop skips it — mirroring the existing human-edit preservation, independent ofpreserve_human_edits. - An extension-pack agent that selects a backend no base agent uses now boots. The env-driven backend factory derived its backend set from the pre-merge base document, so a backend introduced only by a pack agent was never built and the boot failed closed on it — including a backend spec whose only agents come from a pack (zero base
agents:). The composition root now builds any backend a merged agent selects (via the same fail-closed path), while a base-only deploy stays byte-identical.
# security
- The API error envelope strips
detailsstructurally for non-input-echo codes. The "a bare401/404leaks no details" invariant moved from a per-call-site convention to a structural guard at the single envelope chokepoint every non-2xx response flows through: an allowlist keepsdetailsonly for the codes whose details echo caller-supplied context (VALIDATION_ERROR,FORBIDDEN,RATE_LIMITED,GATEWAY_TIMEOUT) and drops it for every other code regardless of what a caller passes. Behaviour-preserving — no code outside the allowlist carries adetailspayload today, so no current response changes — but the guarantee is now enforced by construction rather than by convention.
# documentation
- Updated the spec reference, concepts, and the authoring skill for the
readonlyroute-handler flag, the session reprocess endpoint, the all-three-surfacesenumenforcement (the1.3.1handler-facade residual is closed), the static-mount416correction (superseding the1.3.1"returns500" note), and theRAYSPEC_ANTHROPIC_REUSE_LOGINreuse-login option.
# added
- Opt-in soft delete for a store. A store may now declare
softDelete: true. When it does, adeletestamps the injecteddeleted_attombstone (through the tenant-scoped update chokepoint) instead of physically removing the row, and every read/write hides tombstoned rows — so a soft-deleted row is uniformly invisible:get→404,listomits it, a seconddelete→404,update/PATCH→404. Tombstone-hiding is enforced on the richer read/write surface too (declarative views, workflowstore_read/store_write, and tool/route/trigger handlers), not just the CRUD routes. Without the field the default is unchanged — adeleteis a hard physical delete with nodeleted_atfiltering. Documented caveat: because a tombstoned row physically persists (holding its column values), auniquevalue from a soft-deleted row still occupies the tenant-scoped unique index, so re-creating that same value returns409 CONFLICTrather than reusing it. - Server-enforced
enumwhitelists on a text column. Atextcolumn may declare anenumlist of allowed values, and the platform now enforces it server-side: an out-of-whitelist value on acreate/updatestore route is a400 VALIDATION_ERROR(az.enumderived at the write chokepoint), and the same whitelist is enforced on the workflowstore.writevalue path.enumis valid only on atextcolumn and its members must be distinct (rejected at validation otherwise). Honest residual: a custom escape-hatch handler that writes directly through theHandlerDbfacade is not enum-checked — a handler author owns its own value discipline. - Foreign keys to a
uniqueparent column (referencesColumn). A store foreign key may setreferencesColumnto target aunique: truecolumn of the parent store instead of its injectedid. It materializes as a tenant-scoped compound foreign key —(tenant_id, <col>) REFERENCES parent(tenant_id, <refcol>)— which structurally forbids a cross-tenant reference. Acreate/updatenaming a non-existent parent value returns400; arestrict-blocked parent delete returns409(both tenant-safe — the400names only the local column, the409names no relationship at all, never a foreign value). The local column's type must match the referenced column's, the referenced column must beunique: true, andonDelete: 'set null'is rejected (a compound FK cannot nulltenant_id). The id-target FK path is unchanged. - A set (
IN) filter on the declarativelistop. Alistroute now accepts a per-column set filter?<col>__in=v1,v2,…that maps to SQLIN, so a "status is open OR in_progress" read is expressible in one query. The distinct__insuffix keeps plain?<col>=vequality byte-identical and unambiguous on a comma-bearing value (a real column literally named<x>__instill routes as plain equality). It folds into the same AND-chain as equality filters, keyset pagination, and the tenant predicate. Fail-closed: an empty/blank element, an oversized set (> 100 values), a non-filterable (jsonb) column, or an unknown prefix column each return400. rayspec deploy --apply-migration <delta.sql>.deploycan now apply a reviewed forward migration in place, reaching the existing gated migration engine — an operator with a brownfield schema change no longer has to drop to the dev harness.--allowlist <file.json>supplies the reviewed cover for a destructive statement (a destructive statement without a covering entry is still blocked by the deploy gate); both paths are jailed through the same path check as the spec. It is reboot-safe: the boot classifies the live schema first and mounts a present-matching schema instead of re-applying a non-idempotent delta, so leaving the flag in a process-managed unit applies once and mounts thereafter.--dry-runrejects the flag (it touches no database), and a bare--allowlist(without--apply-migration) is refused. Reachable from both profiles.
# fixed
- An agent-free spec boots and updates with no provider key. The local dev-boot wrapper hard-required
OPENAI_API_KEYup front (an unconditional check before the spec was parsed, plus an always-on OpenAI factory), so applying an additive delta to an agent-free spec failed closed on a credential it never uses. The wrapper now routes through the shippedassembleOptsFromEnv, which returns an agent-backends factory only when the spec declares at least one agent — so a stores/api-only backend (or a product-profile document) boots and updates with no provider key, while an agent-bearing spec still fail-closes naming the missing per-agent credential.
# documentation
- Corrected the "deploy applies the migration" overstatement to the mount-only truth.
rayspec deploy/rayspec-servematerializes a store on a clean database and mounts a present-matching one, but against an existing deployment it is mount-only: it fail-closes on a drifted schema rather than altering it on its own. A schema change is applied by the explicitrayspec deploy --apply-migration <delta.sql>(with--allowlistfor a reviewed destructive statement). The diff/gate and from-clean-database guarantees are unchanged. Corrected across getting-started, the CLI reference, concepts, ARCHITECTURE, and the README. - New "Restore and key rotation" operational note (ARCHITECTURE → security model): a restored database dump survives whole at the row level — orgs, users, the argon2id password hashes, and all tenant data come back reachable. The only thing a freshly-minted
RAYSPEC_API_KEY_PEPPERbreaks is the set of copied API keys: their stored HMACs no longer match, so they return401— mint new ones. User passwords are argon2id (pepper-independent), so an org owner just logs in again and a fresh JWT under the current signing key reaches the data. (The JWT signing key is the same class and self-heals on that same re-login; an org whose sole credential was an API key needs a fresh key established out of band.) - Documented the new store features in the spec reference (
enum,softDelete,referencesColumn, and the<col>__inset filter), and pinned Range and HEAD on a staticfrontendmount as a supported feature with tests (byte-range206/HEAD200). Honest edge: an unsatisfiable range currently returns500— the underlying static server (@hono/node-serverserveStatic) has no RFC-7233416path.
# added
- Static frontend serving from the spec. A backend-profile document may now declare a
frontendlist of{ route, dir, spa? }mounts, and the booted server serves each mount's built static assets alongside its API — one config can ship a whole product, UI included. Static mounts are served last: every API route,/health,/v1/*, and/oidc/*always wins (a path under a reserved platform prefix is never answered by a static mount), and a static miss returns the uniform404.spa: truefalls unmatched deep links back toindex.html; Range and HEAD requests are honored. Serving is fail-closed — path traversal (including URL-encoded forms), dotfiles/hidden paths, and directory-escaping symlinks are refused, and directories are never listed. A missing/unreadabledirfails the deploy closed with an actionable error, anddoctorreports a missing directory and route collisions (afrontendroute may not duplicate another mount, equal a declaredapipath, or target/v1//health//oidc). Not in v1 (documented): SSR, templates, an asset pipeline, cache/CDN headers, and the product profile. Seeexamples/notes-ui/and thefrontendspec reference.
# added
- A server-stamped
created_byactor column on every store row. Each row now records the principal that created it —user:<userId>for a JWT request,key:<apiKeyId>for an API-key request. It is stamped on create only (never re-stamped on update), returned in responses, and is not client-settable: it is a reserved column, so acreated_by/createdByfield in a request body is rejected (400 VALIDATION_ERROR). It is filterable on alistroute, so a caller can list only the rows it created. (A row created before this column existed carries a nullcreated_by.) - Query power on the declarative
storelistop. Alistroute now accepts equality filters (?<column>=<value>on any declared column pluscreated_by, AND-combined — equality only, no ranges /OR/LIKE), single-column ordering (?order=<column>.asc|descover non-nullable columns and the injectedid/created_at; defaultid asc), and keyset pagination (?limit=in1–200, default200, plus?after=<opaque cursor>). A full page setsX-Result-Truncated: trueand returns anX-Next-Cursor. Every filter, order, and cursor is folded through the tenant predicate, and an unknown query parameter is rejected (400). An offset-paged read or a filtered total count still drops to ahandlerroute. Idempotency-Keyreplay onstorecreate. A create request carrying anIdempotency-Keyheader is deduplicated per tenant and per store: a repeat with the same key value replays the original row (200withIdempotency-Replay: true, no duplicate row and no409), regardless of the request body. A request without the header is never deduplicated. This is distinct from aunique: truecolumn, whose duplicate value is a409 CONFLICTrather than a replay.- Owner-gated org membership management.
POST /v1/orgs/{orgId}/membersadds a member by{email}— owner-only, via a live-membership permission check (a non-owner, or an API-key principal, is refused). An existing user is added idempotently as amember; a new email provisions an account and returns aoneTimePasswordonce in the owner's response (the core sends no mail — the owner conveys it out of band).GET /v1/orgs/{orgId}/memberslists the org's members and is readable by any member. Accepted limitation: because the one-time password appears only for a newly provisioned account, the response reveals whether an email already has a platform account — accepted for the trusted single-node posture and closed by the out-of-band invite flow in the hardening layer (seeSECURITY.md). - A shipped authoring skill,
rayspec-author, guiding an assistant from a plain-language product brief to a validated spec and a deployed, curl-testable local backend, plus agate:skill-driftbuild guard (in the deterministic CI lane) that fails if the skill drifts from the shipped grammar version, the CLI entrypoints, or the example specs it cites. rayspec dev db --reset --yes. An opt-in, destructive local-dev reset that DROPs and re-CREATEs a clean, empty dev database (and drops the sibling<name>_dbos_sysdurable-worker system database). It is gated on an explicit--yes;--resetwithout it refuses and touches nothing. The defaultdev dbremains create-if-absent and never destructive.
# changed
storecreate/updatebodies accept snake_case or camelCase column keys. A request may key each declared column by its snake_case declared name or its camelCase twin (the form the generated OpenAPI documents); both are accepted. Sending both variants of the same column in one body is rejected (400 VALIDATION_ERROR). Responses are always snake_case.- Newly minted API keys use an
rk_prefix (previouslymk_); the key shape isrk_<public-prefix>.<secret>. Existingmk_keys stay valid indefinitely — both prefixes are accepted. - Quieter boot. The benign
NOTICEframes Postgres emits for each idempotent DDL guard in the migration chain (… already exists, skipping) are no longer printed, so a clean boot no longer prints a wall of messages that read like errors. AWARNING(or any higher severity) is still logged, and query error handling is unchanged.
# changed
LICENSEcopyright holder is now the legal entitySocialinsiders UG (haftungsbeschränkt). The FSL-1.1-ALv2 notice attributes copyright to the operating legal entity rather than the trade name (counsel instruction, 2026-07-12). No license terms change — the grant, the change date, and the future license are unchanged.
# changed
- An author-declared store column
unique: trueis now TENANT-SCOPED. The generated unique index is a compound(tenant_id, <col>)index rather than a global one, so two tenants may hold the same value (uniqueness is enforced within a tenant) and a duplicate never reveals another tenant's data. A durable product-storekeycolumn keeps its single-column index (itsON CONFLICTupsert target is unchanged).
# fixed
- A same-tenant uniqueness violation on a REST store write now returns
409 CONFLICTinstead of a bare500. The response names the violated column and never echoes the offending value or any foreign-tenant data; it applies to bothcreateandupdatestore routes. - Every
5xxresponse now emits one server-side log line — carrying the request id and status, plus the error code and message when the failure was a thrown error. This covers both a thrown error (mapped by the global handler) and a directly returned upstream502/504(the live sync-run path), each logged exactly once. The previous500branch was a silent swallow; a4xx(including the new409) still logs nothing. The line is server-side only (the client still gets the bare envelope); the log path does no database write and never throws, so it is safe during an outage.
# added
rayspec-serveandrayspec deployboot a backend-profile spec with agents directly. Point either entrypoint at a backend-profile document that declares agents —rayspec-servereadsRAYSPEC_SPEC_PATH, andrayspec deploy <spec>sets it for you — and the shipped boot builds each declared agent's backend instance from the ambient environment (for example theopenaibackend fromOPENAI_API_KEY), with no hand-writtenAgentBackendsFactorywrapper. Both paths assemble their deployer seams through the same shared builder, sodeployandserveare the same boot for a spec with agents. A missing or misconfigured credential fails the boot fast, naming the backend and the agent(s) that select it.- A worked backend-profile example with a live agent.
examples/lead-qualifieris a backend-profile spec whose declared agent runs off-request on the durable worker and records its verdict through a persist tool — a runnable end-to-end example (with deterministic and live test suites), not just a grammar showcase. - Scope-gap 403s name the missing permission. An authenticated request that lacks the required permission now returns a
403whose error body carriesdetails.missing_permission, so a client can tell which scope it is missing. A membership-failure 403 and an unauthenticated 401 stay bare (no scope leak).
# changed
LICENSEcopyright holder is now RaySpec Labs. The FSL-1.1-ALv2 notice attributes copyright to RaySpec Labs.- Internal tidy-ups:
pnpm lintis warning-free, and the dev-harness scratch directory.dev-blobs/is now gitignored.
# fixed
@rayspec/local-bootdrops the derived DBOS system database on a fresh-database re-provision. When the local dev harness re-provisions its throwaway database (DROP+CREATE), it now also drops the sibling<db>_dbos_sysdurable-worker system database, so a fresh-empty app database never pairs with orphaned workflow/queue state auto-created by a previous run.
# documentation
- Clarified four onboarding points: a backend-profile spec with agents boots directly (no wrapper) — via either
rayspec-serveor the equivalentrayspec deploy; a returning user callsPOST /v1/auth/login(which returnsactiveOrgId: null) thenPOST /v1/orgs/{id}/switchto obtain an org-scoped token; the Anthropic subscription path needsCLAUDE_CODE_OAUTH_TOKENin the server process's own environment; and the declarativestorelistop is unfiltered, unsorted, and uncounted (capped, with anX-Result-Truncatedheader) — a filtered, sorted, paged, or counted read drops to astore:write-gatedhandlerroute. .env.examplenow documentsRAYSPEC_PRODUCT_TENANT_IDandRAYSPEC_EXTRACTION_MODE, the two variables a product-profiledeployrequires.
The first tagged release of RaySpec — file-deployable AI infrastructure. Describe a product's backend in one declarative version: '1.0' spec, and the platform stands up the running backend from that single file.
# added
- Declarative spec engine. One
version: '1.0'language with two profiles — a full-control backend profile (metadata,stores,api,agents,tooling,triggers,handlers,extensions,deployment) and a higher-level product profile (selected by a top-levelproduct:section). Specs are parsed fail-closed: an unknown key is rejected, not ignored. The deploy pipeline validates, diffs the required migration, gates destructive changes, and materializes the declared backend. - Accounts, authentication, and tenancy. First-class organizations, memberships, users, API keys, and JWT/OIDC — all owned by the platform. Every query against tenant-owned data carries a tenant predicate, enforced structurally by a single fail-closed, deny-by-default database chokepoint.
- Four in-process agent backends behind one neutral interface. OpenAI Agents, Anthropic's Claude Agent SDK, Pi, and OpenAI Codex all run in-process behind a single neutral
Backendinterface; an agent is declared once and its backend is chosen from the spec. A cross-backend parity suite holds every adapter to the same neutral contract. - A generated, tenant-scoped data layer. Declared stores become Postgres/Drizzle tables with the tenancy and data-lifecycle columns injected automatically; migrations are diffed and passed through a safety gate before they apply, including a from-clean-database bootstrap check.
- Durable background work and a run journal. Long-running agent runs and scheduled triggers execute off-request on a durable worker, with a per-step, append-only, tenant-scoped run journal that is the single source of truth for replay, cost accounting, and audit.
- Reusable ingress capabilities. A product profile can request reusable capabilities by name — audio/transcription, file ingest, multi-turn conversation, and structured records — rather than writing the ingress plumbing.
- The
rayspecCLI.deploystands up a product's declared backend from its spec (validate → derive the required migration → plan → apply). Read-only diagnostics —doctor(static validation),plan(a read-only deploy preview with an optional shadow-apply),openapi(emit an OpenAPI document for a product's declared views), andgen-handler(render a bounded escape-hatch handler) — plus a local-devdevgroup (gen-secrets,db,bootstrap-tenant). - The
rayspec-serveboot server. An environment-driven boot that fails closed on missing secrets, applies the committed migration chain, and serves the platform — with a loud banner stating its trusted, single-node, not-yet-hardened posture.
# security
- Security by construction from the first boot: tenant isolation enforced by the fail-closed chokepoint (with a CI cross-tenant test), no plaintext secrets, an untrusted-content tool-dispatch trust boundary, an out-of-band audit journal, and per-backend credential isolation. The additional hardening required for untrusted, multi-tenant, public-internet hosting is a separate layer and is deliberately not part of the core — see
SECURITY.md.