Skip to content

3ngram 1.10.0

Choose a tag to compare

@github-actions github-actions released this 25 Oct 20:11
50541ed

3ngram v1.10.0

Minor: a Postgres-backed rate limiter, so a deployment can run without Redis;
a one-shot worker for cron schedulers; and the typed-judgment path for the
session closer (a Jev provider, a per-tenant opt-in and resolution
proposals). The typed-judgment path is off unless you configure JEV_* and
a tenant opts in, and SESSION_CLOSER_ENABLED still defaults to off. Also
carries a nodemailer security fix.

Changes

Rate limiting and the worker (#315)

  • RATE_LIMIT_STORE=redis|postgres|memory selects the server's
    rate-limiter store. postgres backs every limiter, including the
    /oauth/token failure counter, with the new rate_limits table
    (migration 0042), and production then accepts a missing REDIS_URL. If the
    variable is unset, behaviour is unchanged: Redis when REDIS_URL is set,
    in-memory outside production, a validation error in production. memory in
    production is an explicit single-replica opt-in that logs a boot warning.
  • One-shot worker: node dist/once.js <consolidation|surfacing|gc-clients|session-sweep> runs one pass without
    Redis and exits (0 success, 1 failure, 2 unknown job). The resident BullMQ
    worker stays the default.
  • Worker env role (#204): the worker validates its env as role worker,
    so it no longer requires the server-only OAUTH_JWKS and REDIS_URL in
    production.

Typed judgment (#224, default-off)

  • Gateway.decide() and a Jev (TypeSafe AI) provider (#225). Each call
    makes one bounded attempt with no retries. Every answer is checked against
    the questions asked, and errors carry counts only, never bodies. New
    optional env vars JEV_API_URL, JEV_API_KEY and JEV_MODEL require an
    explicit model pin and refuse -latest; jev-1.14.0 is the last pin
    verified wire-compatible. Calls are metered as session.closer.decide.
  • Per-tenant judgment opt-in (#225). New table user_judgment_policy
    (migration 0043, RLS + FORCE RLS) and GET/PUT /api/v1/settings/judgment.
    The default is off, and there is no MCP surface. Each change writes a
    content-free audit_log consent row. Account erasure resets the opt-in, and
    the export includes it.
  • The closer decides for opted-in tenants (#229). When an opted-in tenant
    has a configured judgment gateway, the closer sends one question per briefed
    commitment, with the session excerpt fenced as untrusted data. It resolves a
    commitment only at p ≥ 0.9. Opted-out tenants keep the existing path.
  • Resolution proposals (#229). A commitment judged plausibly done
    (0.5 ≤ p < 0.9) is staged in the new resolution_proposals table
    (migration 0044, RLS + FORCE RLS) instead of being resolved.
    review_proposals lists it as a third kind (output V3): counts/totals
    gain a resolution key, and accept/reject return
    applied_resolution/rejected_resolution. Accepting resolves the
    commitment through the FSM-checked transition, recorded as the reviewer.

Security

  • nodemailer 10.1.4 (#355, GHSA-85x2-q946-cp5h: the address parser could
    deliver a crafted quoted address to a domain the header does not name). No
    API or behaviour change.

Compatibility

  • Custom Gateway implementations must add decide. It may reject with
    NotImplementedError('decide'), as the OpenAI gateway does.
  • Library API renames: createRateLimiter takes store instead of
    redis, oauthTokenRouter takes rateLimitStore, and
    setExchangeFailureStore replaces setExchangeFailureRedis. The exported
    envSchema is now role-agnostic; validate through parseEnv/loadEnv to
    get the production rules.
  • review_proposals: a cursor issued before this release is rejected once
    as invalid input, because the walk now covers the third kind. Restart the
    walk from page 1. A client that strict-parses the V2 output or switches
    exhaustively on action has to accept the new resolution key and the two
    new action literals.

Operations

  • Migrations 0042–0044 (additive, run before starting the new server):
    0042_rate_limits (system table, no RLS; provision-roles.sql grants the
    runtime role SELECT/INSERT/UPDATE/DELETE), 0043_user_judgment_policy,
    0044_resolution_proposals. No backfill. From 1.8.x, apply 0039–0044.
  • No configuration change is required. RATE_LIMIT_STORE, JEV_*,
    SESSION_CLOSER_ENABLED and THREENGRAM_STOP_NUDGE keep today's behaviour
    when unset.

Immutable container reference

ghcr.io/b3dmar/3ngram@sha256:ee220e073056b99b82904833ccff519231318816b82dbe6ae37fcc978ebc9300