Releases: Lore-Hex/trusted-router-js
Releases · Lore-Hex/trusted-router-js
Release list
v0.7.0
- Added the
/v1/client-eventsbeacon channel (client telemetry contract v1
§4, §5, §6.2–§6.4), completing the telemetry work begun in 0.6.0. A
TelemetryReporterbatches sampled request events and exact per-minute
counters and posts them with its ownfetch— never the engine's and
never a caller-suppliedfetchImpl— usingcredentials: "omit"and
redirect: "manual". Buffers are bounded and drop the oldest success
first; counter keys fold (error class, then endpoint, then an existing key)
rather than growing without limit; batches are trimmed to the byte cap.
The server's response governs the client: a volume-reducing policy is
honoured, 400/401/403/404/410 disables the reporter for the process, 413
drops the batch, and backoff runs 60 s to 10 min honouringRetry-After.
New client optiontelemetrySampleRate(default 0.01) andclose()for a
bounded final flush;TRUSTEDROUTER_TELEMETRY_DEBUG=1echoes each batch. - The opt-out precedence from 0.6.0 governs both channels unchanged, prompt
and completion content is never recorded, and telemetry can never fail a
request. Still zero dependencies and zero devDependencies.
v0.6.0
- Added the
x-tr-clientheader channel (client telemetry contract v1). On
every inference attempt against a TrustedRouter host, the single engine
loop sends a content-free reliability header carrying the attempt index
and stream flag and, on retries, the outcome, error class and host of the
immediately preceding attempt — closed enums and clamped integers only,
never free text. Control-plane calls and custom base URLs never carry it,
a caller-suppliedx-tr-clientis stripped rather than forwarded, an
out-of-grammar value sends nothing, and telemetry can never fail a
request. Opt-out precedence: the newtelemetryclient option, then
TRUSTEDROUTER_TELEMETRY, thenDO_NOT_TRACK, then on only for known
TrustedRouter base and control hosts. New exports:
TELEMETRY_SCHEMA_VERSION,DEFAULT_TELEMETRY_PATH, theTELEMETRY_*
vocabulary constants, andresolveTelemetryEnabled(). The beacon channel
is deliberately not implemented yet. - Visible User-Agent change: the header is now
trusted-router-js/<version>,
followed bynode/<node-version>on Node (other runtimes send no runtime
token) — the grammar the enclave parses (contract §3.1). 0.5.0 on Node sent
trusted-router-js/0.4.0 node/<version> <platform>: a staleVERSION
constant plus a trailing platform word that made the whole value
unparseable server-side.VERSIONnow trackspackage.json, enforced by
test/parity-contract.test.js. - Failover now actually reaches the alias domains: for the default base URL,
connection failures and 502/503/504 move on toapi.allyrouter.comand
api.uptimerouter.com(exported asALIAS_API_BASE_URLS). A custom
baseUrlis never rewritten, and a 500 is still retried in place. - Honors the gateway's
x-should-retryverdict in both directions, splits
regionalFailover(which now guards only host advancement) from whether a
status or transport failure is retried at all, and parsesretry-after-ms
ahead ofretry-after. Retry-Afteris bounded to 60 seconds so one header can neither park a
caller for hours nor overflow into a hot retry loop.timeoutis now one deadline for the whole logical call — the regional
probes, every attempt and its backoff, and reading the response body —
instead of a per-attempt bound on reaching the response headers.- Every SDK request now refuses to follow redirects (
redirect: "manual");
a caller-suppliedredirectoption is ignored, andRequestOptionsno
longer typesmethod/redirectoverrides. - Attestation:
policyFromTrustRelease()and verification fail closed on a
policy that pins no image identity — the check is the new
pinsImageIdentity()export of@lore-hex/trusted-router/attestation—
and accept the publishedaccepted_image_digests/
accepted_image_referencesrollout lists (imageDigests/
imageReferenceson the policy). collectCompletion()now merges every choice by index, concatenates
reasoning/reasoning_content/refusaldeltas, merges
function_calldeltas, preserves unknown envelope and choice fields, and
reports the stream's ownfinish_reason(nullif none was sent) instead
of inventing"stop"; an empty stream, or one with no choices, raises
InternalError(502) instead of yielding a synthetic empty completion.- Cross-SDK hardening from the review round: a caller's own cancellation
(signal, includingAbortSignal.timeout()andabort(reason), alone or
combined withtimeout) is terminal — never retried, never recorded as a
host failure, honored while the response body is still streaming, and
surfaced as the caller's own reason; the status, attestation,
trust-release, OAuth key-exchange and regional health-probe fetches omit
ambient credentials;fetchAttestationAgain()re-verifies against the
session's pinned policy, TLS exporter and leaf certificate (and the
caller-supplied JWKS, if one was given; otherwise the JWKS is fetched
again); SSE streams must terminate withdata: [DONE]— a stream that
ends without it, or emits data after it, raisesInternalError(502)
instead of completing silently; typed chunk and message shapes gained
reasoning,reasoning_content,refusal,function_calland
logprobsfields. - Repository: added
SECURITY.md(private vulnerability reporting, 72-hour
acknowledgement),CODEOWNERS, and the cross-SDK conformance workflow as a
pull-request gate. - Typed inference and control-plane mutation methods now mint one stable
Idempotency-Keyper logical call and reuse it for every attempt. Generic
request()/rawRequest()calls remain deliberately unkeyed; callers must
provideidempotencyKeyto authorize ordinary status retries or replay after
an ambiguous write. - Fixed buffered Synth completions to merge non-Synth
trustedrouterenvelope
fields, preserve every ordered observability event, and derive panel,
judge-attempt, selected-judge, final-attempt, and summary metadata instead of
overwritingtrustedrouteron each chunk. - API behavior change:
fetchAttestationAgain()now verifies the follow-up
document and returnsGatewayAttestation; it no longer returns an unverified
rawUint8Array. - Internal restructure onto the harmonized cross-SDK architecture: policy
kernel, candidate set, transport engine, attempt assembly, stream codec,
error taxonomy, orchestration builders, and client facade now live in
src/internal/*behind the unchangedsrc/index.jsbarrel. Public API and
import paths are byte-identical. - INTENDED behavior change: the streaming-open path (
rawRequest,
chatCompletionsChunks,chatCompletionsRawStream,responsesEvents,
responsesRawStream) now shares the buffered path's full retry semantics.
Previously it retried only 502/503/504, ignoredx-should-retry: true,
skipped 429 backoff, andregionalFailover: falsedisabled ALL streaming
retries. Now: thex-should-retryverdict wins in both directions, 429 and
5xx are retried with jittered backoff honoringretry-after(-ms), and a
pinned client retries in place. Retries still happen only before any body
bytes are surfaced; a broken open stream propagates and never reconnects.
TrustedRouter JavaScript SDK 0.5.0
What's Changed
- Add sticky regional gateway affinity to JavaScript SDK by @jperla in #5
- Add complete SDK parity and harden attestation by @jperla in #6
Full Changelog: v0.4.0...v0.5.0