changelog ·what shipped, not roadmap

the record of what changed.

every 3ngram release with its date and grouped changes, each linked to the source on GitHub.

Updated

v1.14.2

view release ↗

A maintenance release:

  • Account erasure now scopes every write to the target account explicitly, not only through row-level security.
  • The MCP TypeScript SDK moves to 2.4.
  • @hono/node-server moves to 1.19.19, which backports the serveStatic advisory fix to the 1.x line.

The REST API, MCP surface, schema and Stop hook are unchanged.

Changes

Security

  • Explicit tenant predicates in account erasure (#497, closes #494).
    • What changed. eraseAccountData had 13 statements with no tenant predicate that relied on row-level security alone. Each now also filters on the target user_id. The tables covered are memories, facts, commitments, the consolidation and fact proposals, agent sessions, profile attributes, web sessions, API keys, OAuth tokens and codes, and the reset and verification tokens.
    • Self-serve path. It runs as the NOBYPASSRLS runtime role and erases exactly the same rows as before.
    • Why it matters. Before this change, a caller on a connection that bypasses RLS (a table owner, a migration or an operator script) would have erased every tenant. Now it erases only the target account.
    • Test. A new integration test runs the erasure on an RLS-bypassing connection and proves that another account is untouched.
  • @hono/node-server 1.19.19 (#488). The workspace override floor moves to <1.19.19. 1.19.19 backports the fix for GHSA-rmxm-3fg6-px4f (serveStatic decodes the request path twice) to the 1.x line. 3ngram never calls serveStatic.
    • Dependabot. The GitHub advisory database still lists the fix as 2.1.3, so Dependabot and pnpm audit keep reporting it until that record is corrected.
    • Self-hosting. Self-hosters who install @3ngram/server from npm need the same override in their own workspace, because pnpm overrides do not travel with published packages.

Dependencies

  • MCP TypeScript SDK 2.4 (#490). @modelcontextprotocol/server and @modelcontextprotocol/client move to 2.4.0, and @modelcontextprotocol/node to 2.1.2. Adapter 2.1.2 requires server 2.4. This supersedes #483.
    • Upgrade notes. None of the SDK’s upgrade notes apply to 3ngram’s tools: there is no x-mcp-header on a number parameter, no .meta({ id }) output schema, and no $id or $ref in tool schemas.
    • Surface. The generated MCP reference is unchanged.
    • @hono/node-server. The adapter now also accepts 2.x, but the lockfile stays on 1.19.19.
  • hono 4.13.19 (#495). The hono override floor stays at <4.13.18.
  • jose 6.2.17 in @3ngram/core (#485), and zod 4.6.7 in @3ngram/server, @3ngram/config, @3ngram/schema and @3ngram/sdk (#489). Both finish bumps that v1.14.1 started in other packages.
  • @types/pg 8.23.1 (#496).

CI and tooling

  • Biome 2.6.8 (#493).
    • Scope. Markdown, YAML and SVG stay out of Biome’s scope, matching the platform.
    • Config. The linter config moves from the deprecated recommended field to preset.
    • Formatting. The 2.6 formatter was applied to tests.
  • actions/setup-node 7.1.0 (#492) and actions/attest 4.2.2 (#491), pinned by digest.

Compatibility

  • No REST, MCP or schema changes, no new environment variables, and no public API changes.
  • Package versions:
    • 1.14.2 together: @3ngram/server, @3ngram/worker, @3ngram/sdk and the 3ngram CLI.
    • Patch bumps: core 0.19.1, db 0.18.1, config 0.8.2 and schema 0.16.1.
    • Unchanged: llm 0.5.0.
  • The 3ngram-hook binary is unchanged and stays at 3ngram-hook-v1.1.1.

Operations

  • No migrations. The schema head stays at 0047_tough_lockheed. provision-roles.sql is unchanged since v1.12.0, so it does not need a rerun.
  • Workers. Worker images must be adopted separately from the server package. Verify the image, and a completed execution, for every scheduled worker.
  • Self-hosting. Self-hosters keeping their own @hono/node-server override should raise it to <1.19.19: ^1.19.19.

v1.14.1

view release ↗

A maintenance release. The server and worker images now run on Node 26 LTS, the engine’s Sentry init is pinned to send no default personal data, and hono moves to 4.13.18 for nine upstream advisories that 3ngram does not reach. The REST API, MCP surface, schema and Stop hook are unchanged.

Changes

Runtime

  • Node 26 LTS images (#478). The server and worker images build and run on node:26.13.1-bookworm-slim, pinned by digest, up from node:24-bookworm-slim (#466 pinned the exact Node 24 version first). Node 26 no longer ships corepack, so the images install the pinned pnpm with npm. engines.node is unchanged: the published packages still support Node 22, 24 and 26.

Privacy

  • Sentry sendDefaultPii pinned off (#463). The engine’s Sentry.init now sets the Sentry 10.x opt-out explicitly, as the platform inits already did: no user info, HTTP bodies, database query data, or genAI inputs and outputs. Cookies and headers are deny-listed rather than dropped. Sentry 11 removes the flag, so this pin makes that upgrade fail the typecheck rather than change behaviour silently. @3ngram/config exports sentryClientOptions, so the options can be tested without booting the SDK.

Dependencies

  • hono 4.13.18 (#480, #484). @3ngram/server pins hono 4.13.18, and the hono override floor moves to <4.13.18. Together they cover GHSA-4m76-xfj5-7975, GHSA-h7mg-cq63-vhpq, GHSA-3gg2-335m-rxc6, GHSA-46wx-v44x-9hh2, GHSA-4h7h-rv7c-7m2v, GHSA-92p4-j3wq-jmqx, GHSA-39q9-qp46-w8xg, GHSA-h25j-2p75-qj33 and GHSA-74fm-fwc7-3fwp. hono is a direct dependency of @3ngram/server and also arrives through @modelcontextprotocol/node, but no 3ngram code imports a hono API, so the bump is for scanner hygiene, not an exposure fix. The @hono/node-server advisory GHSA-rmxm-3fg6-px4f (serveStatic, which 3ngram does not call) remains open; its fix needs the MCP SDK 2.4 upgrade (#407).
  • jose 6.2.17, zod 4.6.7, drizzle-kit 0.31.11, @types/node 25.9.9 and lock file maintenance (#482, #473, #474, #472, #471, #361).

CI and tooling

  • The hook release workflow scopes contents: write to its release job (#477).
  • Renovate leaves engines ranges and the Go directive to maintainers (#468).
  • GitHub Actions updates and digest pins (#469, #470, #475, #476), and the pgvector test image pinned by digest (#464).

Docs

  • The session continuity concept notes that a /loop pauses the Stop nudge (#462).

Compatibility

  • No REST, MCP or schema changes, and no new environment variables. The only public API addition is the sentryClientOptions export in @3ngram/config.
  • @3ngram/server, @3ngram/worker, @3ngram/sdk and the 3ngram CLI move to 1.14.1 together, and @3ngram/config moves to 0.8.1. Core 0.19.0, db 0.18.0, schema 0.16.0 and llm 0.5.0 are unchanged.
  • The 3ngram-hook binary is unchanged and stays at 3ngram-hook-v1.1.1.

Operations

  • No migrations. The schema head stays at 0047_tough_lockheed, and provision-roles.sql is unchanged since v1.12.0, so it does not need a rerun.
  • Self-hosted images move to Node 26. If you build your own image from the published packages, any Node 22, 24 or 26 runtime still works.
  • Worker images must be adopted separately from the server package. Verify the image and completion of an actual execution for every scheduled worker.

v1.14.0

view release ↗

The Stop debrief nudge asks less often, for sessions that opted into it with THREENGRAM_STOP_NUDGE=1. The server now waits a cooldown before re-arming a session’s nudge, and the 3ngram-hook-v1.1.1 hook stays quiet while a Claude Code turn is waiting on background work. A default install, with the nudge off, sees no change.

Changes

Session triage

  • Re-arm cooldown (#457). Re-entry was one nudge per turn that produced new provenance, so a long session that kept writing was asked to debrief after nearly every turn, including the turn right after a debrief. POST /api/v1/agent-sessions/triage/begin now declines with the new reason cooldown while the run’s last armed attempt is younger than SESSION_TRIAGE_REARM_COOLDOWN_MINUTES (default 30).
  • The decline consumes nothing. The signal stays untriaged, the first Stop past the window arms on it, and the closer still sees it if the session ends first. A run that never armed has no cooldown, so the first nudge of a session is unchanged.
  • The age is read from triage_armed_at, which is never cleared, so a completed run that a later write flipped back to idle is covered too. The not-live, terminal, pending, pending-fresh and no-signal declines keep priority over the cooldown, and the cooldown is checked before the debounce.
  • A reader clock slightly behind the arming clock only defers the nudge. An age more negative than the whole window reads as no cooldown, so a badly skewed arming clock cannot silence a run.

Stop hook (3ngram-hook-v1.1.1)

  • No nudge while background work runs (#456, for #455). Claude Code passes in-flight background work to a Stop hook as background_tasks. When that list has an entry, the hook asks nothing: it does not call triage/begin, so no attempt is armed or spent, and the provenance stays untriaged for a later Stop or the closer. A session_crons entry with recurring: false, a one-shot wakeup, also pauses the nudge.
  • Teammate entries do not pause it, because an idle teammate can stay listed as running for the rest of the session. Recurring crons and crons that do not say whether they recur do not pause it either. Only each task’s type is read; status values are not a documented contract.
  • The finalize path (stop_hook_active) still runs first, so an injected debrief’s continuation completes its attempt, and the heartbeat still runs on every Stop. A list that is not an array changes nothing, and an odd shape cannot fail the Stop decode and skip the heartbeat.
  • Accepted costs: a long-lived background process such as a dev server keeps the nudge quiet while it runs, and that session falls back to the closer. An attempt left pending by a lost stop_hook_active or a failed finalize is finalized by the next quiet Stop instead of this one.
  • A harness or version that does not send background_tasks or session_crons behaves as before. Claude Code documents both lists as present only when its task registry is reachable.

Compatibility

  • Strict parsers of the triage/begin response must accept the decline reason cooldown. triageDeclineReasonSchema and the OpenAPI enum gain it. The hook branches only on pending and treats every other decline as “no nudge”, so an installed 3ngram-hook needs no update for the cooldown.
  • For direct package users: TriageDebounceThresholds (@3ngram/db, re-exported by @3ngram/core) and SessionTriageConfig (@3ngram/config) gain the required rearmCooldownMs, in milliseconds, with 0 switching the cooldown off. A composition root that builds the thresholds by hand must supply it and fails to compile in TypeScript until it does. loadSessionTriageConfig() already supplies it. The managed dashboard in 3ngram-platform does not build the thresholds and is unaffected.
  • @3ngram/server, @3ngram/worker, @3ngram/sdk and the 3ngram CLI move to 1.14.0 together. The dependency versions are config 0.8.0, schema 0.16.0, llm 0.5.0, db 0.18.0 and core 0.19.0.
  • The 3ngram-hook binary ships from its own tag, 3ngram-hook-v1.1.1. The background-work change reaches a machine only once that binary is reinstalled there: download the release archive, verify it against checksums.txt and replace the binary on your PATH (cmd/3ngram-hook/README.md, “Install (released binaries)”). 3ngram-hook --version then reports 3ngram-hook 3ngram-hook-v1.1.1. Managed dashboard changes are delivered separately by 3ngram-platform.

Operations

  • No migrations. The schema head stays at 0047_tough_lockheed, and provision-roles.sql is unchanged since v1.12.0, so it does not need a rerun.
  • New optional server setting SESSION_TRIAGE_REARM_COOLDOWN_MINUTES: whole minutes from 0 to 1440, default 30. 0 switches the cooldown off and restores the previous one-nudge-per-writing-turn behaviour. A blank value reads as unset, so it means 30, not 0; set 0 explicitly to switch the cooldown off.
  • Worker images must be adopted separately from the server package. Verify the image and completion of an actual execution for every scheduled worker.

v1.13.0

view release ↗

Agents can ask where a memory came from. Accepted proposals now record what they produced, and keyed memory reads can return a bounded provenance trace. Native writes can also decline session attribution explicitly.

Changes

Provenance

  • Accepting a consolidation, fact, resolution or retention proposal records a tenant-bound link back to that proposal. Facts and edges it creates carry a foreign key to the proposal. Lifecycle events it emits record the proposal’s kind and id in their payload. Account exports keep the links. Rows written before this release are not backfilled and report an unknown producer.
  • get_memories accepts include: ["provenance"] for at most five ids. Each trace reports the recorded origin, revision lineage, audit events, accepted proposals and fact identities. It carries identity fields such as ids, topic, scope, project and status, never content, rationale or raw payloads. Events are capped at 50, proposals and facts at 25, lineage at 25 nodes and 50 edges, and each proposal’s produced ids at 50, with truncation flags. A call without include returns the same response as before.
  • GET /api/v1/memories/{id}/history returns the same trace. If the trace cannot be read, the history still returns and reports provenance as unavailable.
  • The origin’s agent label is reported by the session opener. It is not verified attribution.
  • A blocking integration test checks the full chain across two tenants: exact identities in all five trace sections and no foreign ids.

Writes and isolation

  • Native memory writes accept sessionRunId: null to skip session attribution. The write leaves every session’s lease, triage state and closer eligibility unchanged. An omitted id keeps automatic attribution, and a supplied id must still belong to the caller.
  • Every statement behind memory history now binds user_id to the caller alongside row-level security (#427). Results are unchanged while RLS holds.

Images and dependencies

  • The server and worker images move to the current node:24-bookworm-slim digest, which ships apt 2.6.2 and clears CVE-2026-109518.
  • The @hono/node-server override rises to ^1.19.18 for GHSA-jpvv-r467-5p4w: a raw backslash in a request path was parsed as /, so a path-based proxy rule could see a different path than the app. GHSA-rmxm-3fg6-px4f (serveStatic) has no 1.x fix. 3ngram never calls serveStatic, and that advisory stays open on #407 until the MCP SDK 2.4 upgrade.
  • The qs override rises to ^6.16.1 for GHSA-6pq8-jhm2-2vcw. qs is transitive under express and body-parser, and the images now resolve 6.16.1.

Compatibility

  • Breaking for direct @3ngram/db users: getMemoryHistory takes the caller’s id as its second argument, getMemoryHistory(tx, userId, memoryId). Pass the same id given to withTenant(). The old two-argument call fails to compile in TypeScript and fails at runtime in JavaScript. The @3ngram/core function and the REST route are unchanged. The managed dashboard in 3ngram-platform reads history through REST and is unaffected.
  • Strict parsers of get_memories output must accept the optional provenance object. Strict parsers of REST memory history must accept its optional provenance fields.
  • Clients that validate write inputs must accept sessionRunId: null.
  • Import event payloads may no longer carry proposalKind or proposalId. Like sessionRunId, they are reserved for native writes. Strict parsers of account exports must accept the new nullable producer fields on facts and edges.
  • Workspaces that install @3ngram/server from npm should make sure their lockfile resolves @hono/node-server 1.19.18 or later and qs 6.16.1 or later, because pnpm overrides do not travel with published packages.
  • @3ngram/server, @3ngram/worker, @3ngram/sdk and the 3ngram CLI move to 1.13.0 together. The dependency versions are config 0.7.0, schema 0.15.0, llm 0.5.0, db 0.17.0 and core 0.18.0.
  • The 3ngram-hook binary ships from its own 3ngram-hook-v* tag. Managed dashboard changes are delivered separately by 3ngram-platform.

Operations

  • Apply migrations 0046_illegal_thunderbolt and 0047_tough_lockheed. Both are additive. 0046 adds a composite unique key to each of the four proposal tables, three nullable producer columns on facts and memory_edges with their foreign keys and indexes, and a one-producer check on memory_edges. 0047 adds a partial index on memory_events.
  • Neither migration creates a table or needs a grant. provision-roles.sql is unchanged since v1.12.0, so it does not need a rerun. Upgrades from versions before v1.11.0 still need migration 0045_retention_proposals and the runtime grants described in the v1.11.0 release notes.
  • 0046 locks the four proposal tables, facts and memory_edges while it adds columns and validates constraints. Both migrations build indexes without CONCURRENTLY, so writes to those tables and to memory_events wait until the migration finishes.
  • The forgetting pass remains disabled by default. This release does not authorize enabling it.
  • Worker images must be adopted separately from the server package. Verify the image and completion of an actual execution for every scheduled worker.

v1.12.0

view release ↗

Onboarding can distinguish a user’s live memories from the system welcome seed, and explicit seed creation reports whether it created a memory or found an existing copy.

Changes

  • GET /auth/onboarding adds userMemoryCount to its read-only status response. The count excludes archived and superseded memories, and excludes the genuine welcome seed using its content hash and system-creation provenance. A user-authored welcome lookalike still counts.
  • POST /auth/onboarding/seed returns { "outcome": "created" } or { "outcome": "already_exists" }. An archived welcome seed remains archived; requesting it again does not restore it.
  • Regression coverage now checks that commitment search preserves commitment state through REST and MCP, and that production forgetting candidate queries exclude both events and notes from singles and pairs.

Compatibility

  • The seed endpoint returns HTTP 200 with JSON instead of HTTP 204. Clients that require exactly 204 must accept the new response. Clients that ignore a successful response body continue to work.
  • @3ngram/server, @3ngram/worker, @3ngram/sdk and the 3ngram CLI move to 1.12.0 together. The dependency versions are config 0.7.0, schema 0.14.0, llm 0.5.0, db 0.16.0 and core 0.17.0.
  • Managed dashboard changes are delivered separately by 3ngram-platform.

Operations

  • No additional database migration or configuration is required beyond v1.11.0. Upgrades from earlier versions still need migration 0045_retention_proposals and the runtime grants described in the v1.11.0 release notes.
  • The forgetting pass remains disabled by default. This release does not authorize enabling it or replacing a scheduled worker while it is running.

v1.11.0

view release ↗

Facts replace previous values by default, and current fact reads follow the liveness of the memory that asserted them. The forgetting pass ships disabled by default and stages proposals for review; it never applies its own verdicts.

Changes

Facts

  • A new open-ended, single-valued fact closes open values of the same (subject, predicate) that started at or before its validFrom. cardinality: "many" opts into coexisting values; a write with its own validTo closes nothing. Backdated writes retain history, and concurrent writers of a key serialize.
  • Current reads exclude facts whose parent memory was superseded or archived. asOf reads respect parent supersession; archive has no timestamp and does not hide facts from time travel. Range reads still include every generation.
  • revise cannot carry facts. After revising a memory, assert any still-true facts again through remember.

Forgetting and review

  • The worker can judge stale decisions, preferences, blockers and facts, plus likely conflicting pairs of decisions, preferences and facts. Notes and events are excluded from candidate selection. Tenant judgment consent and a configured judgment gateway are required in addition to the deployment flag.
  • The pass stages retention proposals. Accepting one through review_proposals uses the existing audited archive, supersession or conflict-review paths. Keeps and verdicts below their thresholds stay out of the review list.
  • review_proposals output V4 adds retention records and counts; exports include retentionProposals. Its description and tool-selection fixtures cover all four proposal kinds.
  • A report-only forgetting evaluation harness and synthetic fixtures run nightly. Synthetic results do not establish production calibration; private labeled evaluation remains a prerequisite to enabling the pass.

Compatibility

  • @3ngram/server, @3ngram/worker, @3ngram/sdk and the 3ngram CLI move to 1.11.0 together. The dependency versions are config 0.7.0, schema 0.14.0, llm 0.5.0, db 0.15.0 and core 0.16.0.
  • Existing review_proposals cursors become invalid once; restart the walk from its first page. Strict output parsers must accept the retention count key, retention records and the applied_retention / rejected_retention actions.
  • Existing fact windows are not rewritten by this release. Historical duplicate open values need a separately reviewed, tenant-scoped cleanup. A later open-ended, single-valued assertion also closes those whose validFrom is at or before the new assertion’s validFrom.

Operations

  • Apply migration 0045_retention_proposals and rerun provision-roles.sql for the runtime role’s access to the new table.
  • Keep FORGETTING_PASS_ENABLED=false until evaluation and a tenant trial have justified enabling it. The flag defaults to false. No new cron service is required while it is disabled.
  • Worker images must be adopted separately from the server package. Verify the image and completion of an actual execution for every scheduled worker.

v1.10.1

view release ↗

Patch: the one-shot worker’s session closer now uses the Jev judgment gateway when it is configured, as the resident worker already did. Nothing changes for a deployment that does not set JEV_* or does not run node dist/once.js session-sweep.

Changes

Worker

  • One-shot closers get the judgment gateway. node dist/once.js session-sweep built its closer gateway from LLM_GATEWAY_* alone, so decide() never reached Jev on a cron schedule. Tenants opted in to typed judgment (#225, #229) silently fell back to the complete() path. Both worker modes now build the closer’s gateway and budget with one shared function, so they cannot drift apart again. The resident worker’s behaviour is unchanged.

Docs

  • docs/operate.mdx now names the right migration, 0042_rate_limits, for the Postgres rate-limiter store.

Compatibility

  • No API, schema or configuration change. @3ngram/server, @3ngram/worker, @3ngram/sdk and the 3ngram CLI move to 1.10.1 together as one fixed version group. The other packages keep their 1.10.0-era versions.

Operations

  • No migrations. Neon stays at 0044_resolution_proposals.
  • No configuration change is required. SESSION_CLOSER_ENABLED still defaults to off, and JEV_* still has to be set explicitly.

v1.10.0

view release ↗

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.

v1.9.1

view release ↗

Patch: two dependency security fixes. v1.9.1 is the first published 1.9 release. The v1.9.0 tag exists, but its release run stopped at the image scan before anything was published, so no 1.9.0 artifact exists on npm or GHCR. Everything in the v1.9.0 notes ships in this release.

Changes

  • zod 4.6.6 (#347, CVE-2023-54404: denial of service via unbounded array validation). Every package that pins zod moves from 4.6.5: @3ngram/schema, @3ngram/config, @3ngram/sdk, @3ngram/server and the 3ngram CLI.
  • body-parser 2.4.0 (#347, CVE-2026-111181: denial of service via an unhandled decompression stream error). It is transitive under express 5.3.0 and moved through the workspace advisory override. Because 2.4.0 was published inside the 7-day registry cooldown, it is a reviewed exact-version minimumReleaseAgeExclude entry until it matures. The 413 / 415 / 400 mapping for rejected request bodies is unchanged.

Compatibility

  • Runtime pin lockstep. Consumers that pin zod exactly next to @3ngram/schema or @3ngram/sdk must move to 4.6.6 together. A second zod copy splits the schema types.
  • Upgrading from 1.8.x? Read the v1.9.0 notes first: they cover the new MCP output fields, the revise dispositions and the new reaffirm event kind.

Operations

  • From 1.8.x, apply migrations 0039–0041 before starting the new server (see the v1.9.0 notes). There is no new migration in this patch.
  • No configuration change.

v1.9.0

view release ↗

Minor: the 25 October 2026 memory-harness audit follow-ups. Commitments carry deadlines, owners and the reason they were settled; reads label filing, account and session provenance; proposal review pages completely; writes can follow an account-level scope policy; and revise can archive or reaffirm stale memories without writing a successor.

Changes

Writes

  • Commitment deadline and owner on native remember (#323, resolves #165). A commitment write over MCP, REST, the SDK or the CLI (--due, --owner) accepts an optional dueAt (ISO-8601 UTC instant, at most millisecond precision) and owner. Both land on the auto-created commitment row, so briefing reports it overdue and the surfacing sweep expires it exactly as for imported commitments. Either field on a non-commitment is rejected, and nothing is inferred from content.
  • Write-scope policy (#336, resolves #235). configure_scope gains set_write_default (off | default | require), the write-side twin of set_retrieval_default. off is the default, so nothing changes until an account opts in. An explicit scope always wins; remember echoes the scope it actually wrote to; describe_environment reports writeScopePolicy.
  • Resolve reason (#338, resolves #234). resolve takes an optional reason (trimmed, 1–500 characters), stored on the commitment row (commitments.last_resolution_reason), never in the append-only event payload. A later reasonless transition clears it. A blocker resolve with a reason is rejected. It is read back only through GET /api/v1/memories/:id/history (lastResolutionReason) and the owner’s export, is never logged, and is nulled by account erasure.
  • revise archive disposition (#339, resolves #217). { kind: "archive", memoryIds } moves 1–50 memories active → archived with no successor or edge, content and dates untouched, one outcome per id (archived, already_archived, or rejected with not_found, superseded, open_commitment or blocker). Each archive writes an archive event { disposition: "archive", sessionRunId? }; the REST archive route writes the same payload and now takes the account guard. AGENTS.md hard rule 1 names the audited active → archived transition.
  • revise reaffirm disposition (#340, resolves #218). { kind: "reaffirm", memoryIds } records “reviewed, still valid”: it stamps memories.last_reviewed_at and writes a new reaffirm event kind, with no new row, edge, status or updated_at change. Briefing stale candidates key on GREATEST(updated_at, last_reviewed_at), so a reaffirmed memory leaves that section for one full window; never-reviewed memories are judged as before.

Reads

  • Search hit metadata (#324, resolves #319). Hits carry scope, nullable project and, for commitments, commitmentStatus, on both MCP projections, REST and the SDK; the CLI labels them. Ordering and cursors are unchanged.
  • Briefing commitment owner and filing (#325, resolves #261). Commitment items carry owner (never inferred), scope and project.
  • History source session (#326, resolves #262). The history read adds allowlisted sessionRunId per event and createdBySessionRunId on the envelope, re-parsed through the provenance schema, null when absent.
  • Complete proposal review (#334, resolves #320). review_proposals and GET /api/v1/proposals take an opaque cursor and return hasMore, nextCursor and live totals; the MCP list walks edge and fact proposals as one merged stream, so limit now bounds a page across both kinds. count keeps its meaning (edge proposals on this page).
  • Account identity and facets (#335, resolves #321 and #168). describe_environment reports account: { id } (the same id as GET /api/v1/me, never derived from a scope name) and inlines the live scope/project inventory as facets (capped at 50 per array, with truncated flags). New MCP resource threengram://facets returns the complete inventory.

Session closure

  • Defensive triage finalize (#337, resolves #189). POST /api/v1/agent-sessions/triage/complete accepts defensive: true: the attempt lands expired and the watermark stays at the begin stamp, so a write committed between begin and a complete whose debrief was never shown stays untriaged. The Stop hook (cmd/3ngram-hook, released by its own 3ngram-hook-v* tag) sends it on arm-without-inject paths and falls back to the ordinary complete on a 400 from an older server.
  • Real-concurrency session tests (#337, resolves #178), plus test-only hardening of the triage attempt log (#316, #307) and the US4 auth harness (#318, #297). The hook shows each precheck hit’s real id (#317, #263; hook release).

Compatibility

  • MCP output schemas grow (search, briefing, describe_environment, review_proposals, resolve, revise); every addition is a new field or a new union branch, and output schemas advertise open, so clients on the previous catalog keep working. revise’s registered output is the new reviseToolOutputV2Schema union; reviseToolOutputSchema is unchanged.
  • REST: a rejected id on the revise archive/reaffirm disposition is a 200 whose body carries outcome: "rejected"; read the outcome, not the status code. GET /api/v1/proposals pages; a caller that reads only the first page keeps today’s behaviour.
  • SDK: revise() is overloaded (disposition body → outcome list, other bodies → memory, the full ReviseBody union → ReviseToolOutputV2); resolve() takes { reason }.
  • Native remember: scope no longer defaults to personal in the schema (the server applies the account’s write policy, off → personal).
  • New event kind reaffirm. Consumers that switch exhaustively on memory_events.event_kind must handle it; it is importable.

Operations

  • Migrations 0039–0041 (additive, run before starting the new server): 0039_user_write_scope_policy (new table, RLS + FORCE RLS), 0040_commitment_resolution_reason (nullable column + length CHECK on commitments), 0041_memory_last_reviewed_at (nullable column on memories, memory_events kind CHECK regenerated to include reaffirm). No backfill.
  • No configuration change. SESSION_CLOSER_ENABLED and THREENGRAM_STOP_NUDGE stay default-off.

v1.8.7

view release ↗

Patch: the database and HTTP runtime pins move to their newest releases past the 7-day cooldown, and every request body that body-parser rejects now gets its client error instead of a 500.

Changes

  • Rejected request bodies are client errors (#312, resolves #301). express.json() runs before any route, and only a malformed JSON body was mapped to 400 invalid_request; an oversized body or an unsupported content encoding fell through to 500 internal_error and an unhandled-error log line. A body over the 100 KB default limit now returns 413 payload_too_large, an unsupported Content-Encoding or charset returns 415 unsupported_media_type, and a corrupt or truncated compressed body returns 400 invalid_request. Each is logged at warn with the status and body-parser type only, never the body. /mcp, /api/v1 and the form-encoded OAuth endpoints share the handler.

  • drizzle-orm 0.45.4, pg 8.23.1, hono 4.13.13 (#303). drizzle-orm 0.45.3 adds a Netlify DB driver entry point and 0.45.4 fixes explicit .prepare(name) on the postgres-js driver; the node-postgres driver this engine uses is unchanged. pg 8.22/8.23 add opt-in direct SSL negotiation and query pipelining (both off unless configured), rewrite the Bind serializer, warn on an invalid Date parameter, and surface a socket reset on a pooled client as ECONNRESET instead of a later “Connection terminated unexpectedly”. withTenant()’s set_config(..., true) path, pg-pool 3.14.0 and the ssl default are unchanged. hono 4.13.12/13 are fixes in modules the engine does not import; the pin governs the copy @modelcontextprotocol/node pulls in.

  • express 5.3.0 (#311). res.send() no longer adds Content-Length when Transfer-Encoding is already set, req.fresh revalidates QUERY requests, HTML redirect bodies gain a doctype and title, and content-type moves to 2.0 (faster parser; res.send() keeps existing Content-Type parameters when it appends the charset and no longer throws on an unparsable Content-Type) with type-is 2.1 and content-disposition 2.0.1. No route or error-handling behaviour changes.

  • CI: the unused Turbo remote cache wiring is gone and the cache is disabled explicitly (#308). No published output changes.

Compatibility

  • Runtime pin lockstep. Consumers that pin drizzle-orm, pg, hono or express exactly next to @3ngram/db or @3ngram/server must move to 0.45.4, 8.23.1, 4.13.13 and 5.3.0 together. @3ngram/db pins drizzle-orm and pg exactly, and a second drizzle-orm copy fails to typecheck against the engine’s table types; @3ngram/server pins express exactly, and a consumer that mounts its own routers into the engine app must share that one copy.
  • New error codes. Clients that switch on the JSON error field may see payload_too_large (413) and unsupported_media_type (415) where they previously received internal_error (500).

Operations

No migration and no configuration change.

v1.8.6

view release ↗

Patch: the engine’s runtime dependencies move to their newest releases past the 7-day cooldown, the deprecated MCP server-legacy package is gone, and zod moves to 4.6.5 with the datetime grammar unchanged.

Changes

  • MCP SDK 2.3 (#302). @modelcontextprotocol/server 2.0.0 -> 2.3.1 and @modelcontextprotocol/node 2.0.0 -> 2.1.1 move together, leaving one @modelcontextprotocol/core in the graph. The tool, prompt and resource-template surface clients list is byte-for-byte unchanged. Three wire behaviours change; see Compatibility.

  • server-legacy removed (#299, resolves #281). POST /oauth/token now builds its RFC 6749 errors from OAuthError in @modelcontextprotocol/server. Every token-endpoint error keeps its HTTP status, JSON body and headers, pinned byte for byte by a new unit suite. express-rate-limit and ip-address leave the graph, and the scoped ip-address advisory override is dropped.

  • zod 4.6.5 (#300). zod 4.5 began requiring seconds on any time with Z or an offset; every datetime field now goes through the new isoDateTime() helper in @3ngram/schema, so minute precision such as 2026-01-01T06:15Z still parses and the emitted date-time pattern is byte-identical. @3ngram/schema gains isoDateTime and IsoDateTimeOptions.

  • Runtime minors (#296). nodemailer 10.0.16, rate-limiter-flexible 11.2.1, pino 10.4.0, @node-rs/argon2 2.2.2, ipaddr.js 2.5.0 and jose 6.2.12. argon2 swapped its Rust backend; hashes keep the same PHC format and parameters, and a unit test verifies a hash minted by 2.0.2. argon2 2.2.2 drops the wasm32-wasi fallback, so a platform without a prebuilt native binding no longer falls back to WASM (every linux gnu/musl x64/arm64, darwin and win32 target still has one).

  • Worker queue stack (#298). bullmq 5.81.5 and ioredis 5.11.1, one ioredis copy across server and worker. Since 5.81.2 BullMQ drops connection errors no listener receives, so the worker’s Queue and Worker now register one each and log only the error name and queue name, never the message, which can quote stored job data.

  • @sentry/node 10.76.0 (#295). Data collection, request-body capture and the beforeSend / beforeSendTransaction scrub are unchanged for this config.

  • Security triage 2026-10-12 (#280). @modelcontextprotocol/client, vitest, js-yaml and source-map-js advisories cleared. Replacing the ioredis-mock test dependency with a local fake (#293) also removes sprintf-js (GHSA-hp3w-g68c-fv3c, no patched release) from the graph.

Compatibility

  • zod lockstep. Consumers that compose @3ngram/schema schemas or types with their own zod must move to zod 4.6.5 at the same time: zod’s declarations carry the minor version as a literal type, so mixing copies fails to typecheck. Upstream also counts string length bounds in Unicode code points, and emitted JSON Schema (MCP tools/list, OpenAPI) writes a nullable primitive as type: [T, "null"] instead of a two-branch anyOf.
  • MCP wire. prompts/get for debrief with arguments omitted now renders the prompt instead of failing with -32602. A 2026-07-28 POST without the MCP-Protocol-Version header is refused with 400 / -32020 (SDK clients always send it). A legacy JSON-RPC batch of more than 100 messages is refused with 400 / -32600.

Operations

No migration and no configuration change.

v1.8.5

view release ↗

Patch: a read-only commitment panel for Claude Code, index-served successor lookups, and ten moderate advisories cleared.

Changes

  • Read-only commitment panel for Claude Code (#255: #257, #258, #259, #260, #264, #272). 3ngram-hook commitments list|show|context prints one JSON envelope over GET-only reads of /api/v1/me, /api/v1/briefing and /api/v1/memories/:id, with a context fingerprint on every envelope and whole-response redaction on show. --github adds GitHub issues and pull requests a commitment names as related evidence through gh api --method GET, never as proof of completion. The 3ngram plugin (plugins/3ngram) opens the pane with /commitments; rows draw only next to the read that produced them, a context probe runs before every refresh, and a reload never shows rows held under another selection or account. The plugin also bundles the four session hooks and stands each copy down when it recognises the same hook in settings.json. The guard is best-effort and fails open: a registration it cannot recognise (a shell wrapper, a composite command, another settings source) runs twice, never not at all, so keep one registration path. Source-only in this release: the panel runs the 3ngram-hook binary, and no 3ngram-hook-v* tag has been cut yet, so until a maintainer publishes the first hook release it needs a build from source (cmd/3ngram-hook/README.md).

  • memory_edges is indexed by target (#244, closes #240). Migration 0038_memory_edges_target_idx adds (user_id, to_id, edge_type), so the superseded flag in search, supersededBy in get_memories and the REST history’s direct relationships are index-served. get_memories resolves the successor with one lateral lookup per row. On a 5,000-memory, 20,000-edge tenant a 20-id batch drops from 51 ms to 0.2 ms.

  • Security triage 2026-10-06 (#256). hono moves to 4.13.11 and the hono, ip-address and qs advisory overrides are re-cut, clearing ten moderate transitive findings under @modelcontextprotocol/*. Only the hono bump reaches npm consumers of @3ngram/server; the ip-address and qs fixes are root pnpm-workspace.yaml overrides, applied in this repository’s lockfile and container images. A consumer keeping its own lockfile should raise those two itself.

Operations

Migration 0038_memory_edges_target_idx builds its index inside the migration transaction, which blocks writes to memory_edges for the build; at current sizes that is sub-second. Apply it to every environment before a deployment that consumes @3ngram/db 0.12.2 (@3ngram/core 0.13.2, @3ngram/server 1.8.5). No configuration change.

Cloud-session bootstrap only: both repositories now commit a cloud-only Claude Code SessionStart hook (#254); local sessions are untouched.

v1.8.4

view release ↗

Patch: ChatGPT can connect again, shipped on a re-scanned image.

v1.8.3 was not published. Its release scan failed on advisories published after v1.8.2 (perl-base, libpcre2, proxy-addr, nodemailer). v* tags are immutable, so that number is burned, and this release carries its content together with the dependency fixes.

Changes

  • CIMD clients that list none as supported now resolve as public PKCE clients (#248). ChatGPT’s connector uses a Client ID Metadata Document (client_id=https://chatgpt.com/oauth/client.json) that prefers private_key_jwt and lists none as a fallback. The schema only accepted a declared none, so every ChatGPT authorization ended in a bare 400 invalid_client. When a document carries token_endpoint_auth_methods_supported, that list is now authoritative and must include none; without it the declared method must be none or absent. The parsed client is always public, so /oauth/token and the oauth_clients row are unchanged. The live documents for ChatGPT, claude.ai and Claude Code are pinned as schema test fixtures.

  • Release images clear the current scan (#251). Both images move to the current node:24-bookworm-slim digest (libpcre2 10.42-1+deb12u2) and upgrade perl-base to 5.36.0-7+deb12u4 from Debian security until the base image is rebuilt. proxy-addr is overridden to 2.0.8.

  • nodemailer 9.1.1 → 10.0.12 (#251). Version 10 keeps the transport API, requires Node 20 or newer, and ships its own types.

Operations

No migration and no configuration change. Send one test email after the server promote to confirm SMTP delivery on nodemailer 10.

v1.8.3

view release ↗

Patch: ChatGPT can connect again.

ChatGPT’s MCP connector moved from dynamic client registration to a Client ID Metadata Document (client_id=https://chatgpt.com/oauth/client.json). Its document prefers the private_key_jwt token endpoint auth method and lists none as a supported fallback. The schema only accepted a document declaring none, so every ChatGPT authorization ended in a bare 400 invalid_client.

Changes

  • CIMD clients that list none as supported now resolve as public PKCE clients (#248). When a document carries token_endpoint_auth_methods_supported, that list is authoritative and must include none; without it the declared method must be none or absent. The parsed client is always public, so /oauth/token and the oauth_clients row are unchanged. Clients that cannot authenticate as none are still rejected before consent.

  • Real client documents are pinned as test fixtures. The live CIMD documents for ChatGPT, claude.ai and Claude Code now run through the schema in CI, so a client-side change fails a build instead of production.

Operations

No migration and no configuration change. @3ngram/core is republished because its published manifest pins @3ngram/schema exactly.

v1.8.2

view release ↗

Patch: the v1.8.0 release images failed the release scan on a Debian package, so this release re-cuts v1.8.0’s content on a patched base image.

Neither v1.8.0 nor v1.8.1 was published: Trivy rejected v1.8.0’s images on libpcre2-8-0 10.42-1 (CVE-2026-86145, high) in the pinned node:24-bookworm-slim digest, and the v1.8.1 tag was pushed against the wrong commit before its promotion had merged. v* tags are immutable, so both numbers are burned and this release carries their content, exactly as v1.6.3 did for v1.6.2.

Changes

  • Release images move to the current node:24-bookworm-slim digest (#243): same Debian 12.15 and Node 24.21.0, with libpcre2-8-0 10.42-1+deb12u1 installed.

  • Everything listed under v1.8.0, which never shipped: revise inherits filing from the predecessor (#222), the revise move disposition (#233, with the hard rule 1 carve-out), get_memories returns supersededBy (#223), the agent-session read endpoints (#203, migration 0037_triage_attempt_log), consolidation that no longer re-proposes settled pairs (#220), and the overdue grace window COMMITMENT_EXPIRY_GRACE_DAYS (#221).

Known gap

The revise tool’s one-line description still reads “never edits in place”; a description refresh needs the tool-selection embeddings regenerated with an OpenAI key and follows in a later release.

Operations

One migration since v1.6.3: 0037_triage_attempt_log (schema head 0036 to 0037). Run it before the server promote. The worker gains one optional environment variable, COMMITMENT_EXPIRY_GRACE_DAYS. Both triage mechanisms (SESSION_CLOSER_ENABLED, THREENGRAM_STOP_NUDGE) remain default-off.

v1.8.1

view release ↗

Patch: the v1.8.0 release images failed the release scan on a Debian package, so this release re-cuts v1.8.0’s content on a patched base image.

v1.8.0 was tagged but never published: Trivy rejected libpcre2-8-0 10.42-1 (CVE-2026-86145, high) in the pinned node:24-bookworm-slim digest. v* tags are immutable, so that version number is burned and this release carries its content, exactly as v1.6.3 did for v1.6.2.

Changes

  • Release images move to the current node:24-bookworm-slim digest (#243): same Debian 12.15 and Node 24.21.0, with libpcre2-8-0 10.42-1+deb12u1 installed.

  • Everything listed under v1.8.0, which never shipped: revise inherits filing from the predecessor (#222), the revise move disposition (#233, with the hard rule 1 carve-out), get_memories returns supersededBy (#223), the agent-session read endpoints (#203, migration 0037_triage_attempt_log), consolidation that no longer re-proposes settled pairs (#220), and the overdue grace window COMMITMENT_EXPIRY_GRACE_DAYS (#221).

Known gap

The revise tool’s one-line description still reads “never edits in place”; a description refresh needs the tool-selection embeddings regenerated with an OpenAI key and follows in a later release.

Operations

One migration since v1.6.3: 0037_triage_attempt_log (schema head 0036 to 0037). Run it before the server promote. The worker gains one optional environment variable, COMMITMENT_EXPIRY_GRACE_DAYS. Both triage mechanisms (SESSION_CLOSER_ENABLED, THREENGRAM_STOP_NUDGE) remain default-off.

v1.8.0

view release ↗

Minor: the revise tool stops re-filing memories by accident and learns to refile them on purpose, get_memories points a superseded row at its successor, and the v1.7.0 train (session-run read endpoints, a consolidation queue that settles, overdue commitments that stay visible) ships with it.

v1.7.0 was versioned on staging but never tagged: three more changes landed before the promotion, so this release carries the whole train since v1.6.3.

Changes

  • revise inherits filing from the predecessor (#222, #238). The revise schema extended the remember schema and so inherited its literal defaults: a revise that left out scope wrote the successor as personal, with no project and no tags, while closing the original. scope, project and tags are now optional with no default on revise; an omitted value is copied from the predecessor inside the revise transaction, and both transports echo the filing the successor was written with. Explicit values still override; a project can be replaced but not cleared.

  • revise move disposition (#233, #241). { kind: "move", predecessorId, scope?, project?, tags? } changes a memory’s filing in place: no successor, no edge, content, topic, status and the bi-temporal columns untouched, so a refile neither floods the target project’s recent section nor breaks asOf reads. Audited by a revise memory event recording scope, project and tag count before and after. Works on superseded and archived rows. The move takes the account-lifecycle guard first and the row lock after provenance; a no-op move writes nothing and attaches no session. Hard rule 1 in AGENTS.md gains this single carve-out. The object schema exports keep their shapes; the successor-or-move union is new under reviseRequestSchema / nativeReviseRequestSchema / reviseToolRequestSchema.

  • get_memories returns supersededBy (#223, #239). Each item names its direct successor ({ id, edgeType }) when the row is superseded, or null. Superseded follows REST history’s precedence: not archived, closed validity, and a supersedes/updates edge; for active rows that matches search’s superseded flag. One hop only; lineage stays with REST history.

  • Read endpoints for agent-session rows and triage attempts (#203, #215). GET /api/v1/agent-sessions/{sessionRunId} and .../triage-attempts, read-only and tenant-scoped, backed by migration 0037_triage_attempt_log.

  • Consolidation no longer re-proposes a settled pair (#220, #231). A pair with a proposal in any status, or with a materialized edge, in either orientation, is excluded at candidate time. Production logs had shown the same 218 candidate pairs and zero new proposals on 121 consecutive runs.

  • Overdue commitments stay open for a grace window (#221, #232). COMMITMENT_EXPIRY_GRACE_DAYS (default 14; 0 restores immediate expiry; blank counts as unset) keeps a past-due commitment open, and therefore overdue in the briefing, before the worker expires it. Library callers of surface() and sweepCommitments() that omit the new optional argument keep the previous semantics.

Known gap

The revise tool’s one-line description still reads “never edits in place”; the move kind makes that inaccurate. Refreshing it requires regenerating the tool-selection embeddings, which needs an OpenAI key; a description-refresh covering #222, #223 and #233 follows in a later release. The field descriptions and the concept docs carry the current semantics.

Operations

One migration: 0037_triage_attempt_log (schema head 0036 to 0037). Run it before the server promote, as the deploy runbook requires. The worker gains one optional environment variable, COMMITMENT_EXPIRY_GRACE_DAYS; both Compose stacks pass it through. Both triage mechanisms (SESSION_CLOSER_ENABLED, THREENGRAM_STOP_NUDGE) remain default-off pending the #166 validation bar.

v1.6.3

view release ↗

Patch: native MCP clients such as Claude Code can authorize again, and the mail transport moves off a nodemailer release with a high-severity advisory.

v1.6.2 was tagged but never published: the release image scan rejected nodemailer@9.0.1, so that version number is burned and this release carries its content. @3ngram/core 0.11.2, @3ngram/schema 0.9.1 and @3ngram/db 0.10.2 reach npm for the first time here.

Changes

  • Loopback redirect URIs match on any port (#208). Claude Code registers through a Client ID Metadata Document whose redirect_uris are http://localhost/callback and http://127.0.0.1/callback with no port, then presents redirect_uri=http://localhost:<ephemeral port>/callback, because a native client cannot know its loopback port before it binds one. /oauth/authorize matched redirect URIs byte-exactly, so every such login ended in 400 invalid_client with reason=redirect_uri_mismatch. A presented URI now also matches when a registered URI is http on the same loopback host (localhost, 127.0.0.1, [::1], never cross-matched) with an identical path and query; only the port may differ, on either side. The requested URI, port included, is what the 302 targets, what the authorization code is bound to, and what /oauth/token compares against. https URIs, non-loopback http, and any path or query difference stay byte-exact.

  • http://[::1] is a registrable loopback redirect. redirectUriSchema admitted plain http only for localhost and 127.0.0.1; the IPv6 loopback literal now joins them for DCR and CIMD alike. The hostname check runs against the parser-canonicalised host, so every spelling of ::1 is accepted and no other address is.

  • Redirect URIs must use RFC 3986 characters. Registration rejects a redirect URI carrying a character the URI grammar never allows unencoded (a backslash above all, which the WHATWG parser reads as /). The rule is defined once in @3ngram/schema as hasForbiddenUriCharacter and reused by the loopback matcher, so a registration predating this release that carries such a character keeps byte-exact matching and gains no port relaxation.

  • nodemailer 9.0.1 → 9.1.1 (#211). Clears GHSA-2x7j-588g-ccc2 (high, quadratic address-list parsing enabling remote denial of service) and three medium advisories on recipient-domain validation and resolveContent() access controls.

No migrations. Schema head stays at 0036_triage_armed_at. Both triage mechanisms (SESSION_CLOSER_ENABLED, THREENGRAM_STOP_NUDGE) remain default-off pending the #166 validation bar.

v1.6.2

view release ↗

Patch: native MCP clients such as Claude Code can authorize again. The authorization server now honours RFC 8252 §7.3 for loopback redirect URIs.

Changes

  • Loopback redirect URIs match on any port (#208). Claude Code registers through a Client ID Metadata Document whose redirect_uris are http://localhost/callback and http://127.0.0.1/callback with no port, then presents redirect_uri=http://localhost:<ephemeral port>/callback, because a native client cannot know its loopback port before it binds one. /oauth/authorize matched redirect URIs byte-exactly, so every such login ended in 400 invalid_client with reason=redirect_uri_mismatch. A presented URI now also matches when a registered URI is http on the same loopback host (localhost, 127.0.0.1, [::1], never cross-matched) with an identical path and query; only the port may differ, on either side. The requested URI, port included, is what the 302 targets, what the authorization code is bound to, and what /oauth/token compares against. https URIs, non-loopback http, and any path or query difference stay byte-exact.

  • http://[::1] is a registrable loopback redirect. redirectUriSchema admitted plain http only for localhost and 127.0.0.1; the IPv6 loopback literal now joins them for DCR and CIMD alike. The hostname check runs against the parser-canonicalised host, so every spelling of ::1 is accepted and no other address is.

  • Redirect URIs must use RFC 3986 characters. Registration rejects a redirect URI carrying a character the URI grammar never allows unencoded (a backslash above all, which the WHATWG parser reads as /). The rule is defined once in @3ngram/schema as hasForbiddenUriCharacter and reused by the loopback matcher, so a registration predating this release that carries such a character keeps byte-exact matching and gains no port relaxation.

No migrations. Schema head stays at 0036_triage_armed_at. Both triage mechanisms (SESSION_CLOSER_ENABLED, THREENGRAM_STOP_NUDGE) remain default-off pending the #166 validation bar.

v1.6.1

view release ↗

Patch: closes the last erasure race on the session-lifecycle surface, and the release pipeline now publishes the worker image.

Changes

  • Session opens refuse erased accounts (#197). openSession took only the session-attach lock and never consulted the account-deletion tombstone, so an authenticated /open in flight during erasure could INSERT a fresh agent_sessions row — selector, briefed_memories and all — after the bulk redaction that is documented as the account’s final content write. It now takes the account-lifecycle advisory lock in shared mode and re-checks the tombstone under it as its first statement, throwing AccountDeletedError; REST maps it to 410 account_deleted (previously an unmapped 500). Shared mode is the point: opens serialize against erasure, never against each other.

    The fix also hoists the heartbeat’s shared-lock acquisition above the attach lock on the excerpt path — the two locks were requested in opposite orders, which would have closed a three-party deadlock cycle the moment an erasure queued its exclusive request between them. Excerpt-free heartbeats still take no account-lifecycle lock.

  • Worker image published per release (#200). ghcr.io/b3dmar/3ngram-worker now ships alongside the server image with the same supply chain: amd64+arm64 Trivy scans, max-mode provenance, SBOM, registry-pushed attestation, and an anonymous-pull verification. The @3ngram/worker npm package stays private; the image is the only published artifact. Worker identity labels are asserted at publish time so the image carries its own OCI title/description rather than the server’s.

  • Worker deployment documented — docs/operate.mdx topology grows to four portable pieces, docs/container-image.mdx gains the worker-image section (env contract including the non-obvious production OAUTH_JWKS requirement, tracked for relaxation in #204; PID-only liveness caveats), and the SESSION_CLOSER_ENABLED kill switch is exposed in both env templates.

No migrations. Schema head stays at 0036_triage_armed_at. Both triage mechanisms (SESSION_CLOSER_ENABLED, THREENGRAM_STOP_NUDGE) remain default-off pending the #166 validation bar.

v1.6.0

view release ↗

Minor: session-continuity hardening — the four preconditions the #166 validation bar requires before either triage mechanism can be enabled anywhere. Both mechanisms remain default-off; this release makes turning them on measurable and safe, not on.

Changes

  • Closer scan bound by backlog, not history (#183). A needs_look discriminator on agent_sessions lets settled completed rows leave the closer’s partial index entirely; the late-commit EXISTS backstop is paid only on flagged rows. Migration 0034 backfills every existing completed row — open ones included — so no pre-migration event is lost.

  • Failing closer candidates back off (#184). Per-row exponential backoff (min(4h, 20min · 2^(n-1)), migration 0035), stamped once per exhausted worker job and computed atomically from the row at write time, so a consistently-failing row stops starving the sweep’s batch window. Every resurrect path and both terminal write-backs reset it.

  • The Stop nudge age-guards a pending attempt (#188). A pending attempt younger than SESSION_TRIAGE_MIN_ATTEMPT_AGE_SECONDS (default 30) declines as pending-fresh and withholds the attempt token, so a concurrent sibling Stop cannot finalize an attempt still in flight. A finalize-only delivery declares itself (stopHookActive) and is exempt, keeping short continuations’ watermarks clean. Migration 0036.

  • Erasure fences the closer (#185). Account erasure bumps activation_epoch atomically with the redaction; the closer re-checks the epoch after its budget reservation, immediately before the gateway call, and the commitment resolve takes the row lock before reading the epoch — so an erasure abandons in-flight passes and post-erasure resolves cannot land. The honest residual is stated in the docs: one racing dispatch per concurrently-executing pass, each capped at the gateway timeout.

Upgrade notes

Run pnpm db:migrate — migrations 0034–0036 (three new columns on agent_sessions, no new table; the GDPR export gains the corresponding fields). No breaking API change: new REST/schema surface is additive (pending-fresh decline reason, optional stopHookActive on triage begin), and SESSION_CLOSER_ENABLED / THREENGRAM_STOP_NUDGE stay off until the validation bar in docs/concepts/session-continuity.mdx is measured.

v1.5.0

view release ↗

Minor: session continuity lands (issue #166) — typed agent sessions with write-time provenance, a session-lifecycle REST surface for hooks, and two default-off triage mechanisms (the worker-side closer and the Stop-nudge handshake). Nothing triages a session until the flags are turned on.

Changes

  • agent_sessions + write-time provenance. New table keyed by the natural key (agent, sessionId); native remember/revise/resolve/archive accept an optional sessionRunId and stamp it on audit events. Import rejects the reserved key. Erasure redacts session rows in place; the GDPR export includes them. Migration 0032.

  • Session-lifecycle REST surface for hooks. POST /api/v1/agent-sessions/open, /close, /heartbeat, the typed provenance read GET /api/v1/agent-sessions/{sessionRunId}/events, and GET /api/v1/prompts/debrief — one renderer shared with the MCP debrief prompt, now inlining the run’s briefed commitments so the model can tell which id to resolve.

  • Session closer, default-off (SESSION_CLOSER_ENABLED, a kill switch, not just a first-boot default). A lease-expiry sweep closes crashed sessions and a resolve-only worker job makes one metered LLM pass over the run’s briefed commitments — it can resolve, never remember/revise/archive. Migration 0033. The worker gains a Dockerfile and a service in both compose files.

  • Stop-nudge triage handshake, default-off (THREENGRAM_STOP_NUDGE on the hook). POST /api/v1/agent-sessions/triage/begin and /triage/complete; the server decides the debounce, the hook injects only when armed. 3ngram-hook stop ships the client half with Claude Code as the one registered validation harness.

  • Supply chain: the server image build no longer sets npm_config_ignore_scripts, restoring the strictDepBuilds tripwire during docker build (the worker image got the same fix in #181). nanoid bumped to 3.3.18 (Dependabot alert #16, dev-only chain).

Upgrade notes

Run pnpm db:migrate — this release adds migrations 0032 and 0033 (one new table, agent_sessions; the table count moves to 27). No breaking API change: every new surface is additive, sessionRunId is optional everywhere it is accepted, and both triage mechanisms are off until you set their flags. The SDK’s remember() now uses the facts-capable V2 argument/output types.

v1.4.4

view release ↗

Patch: debrief writes stay one typed atom under the 2000-character cap, and the debrief prompt can carry a project so those writes appear in a project briefing.

Changes

  • Debrief is one typed atom per remember. SERVER_INSTRUCTIONS and the debrief prompt tell the agent to split a longer recap rather than dump a session transcript. MAX_CONTENT_LENGTH stays 2000 — it is now a typed-atom budget, not the retired capture-hook latency contract. Import is unchanged (larger bound). This is the cheap half of issue #166; the Stop-hook trigger is not in this release.

  • Optional project on the debrief prompt, completable from live facets. A memory written with no project never matches a project-scoped briefing.

  • Concept docs describe shipped behavior. #164 aligned table counts, MCP resource status, and the 11-tool README, and added scripts/check-docs-truth.sh so those claims cannot silently rot.

Upgrade notes

No breaking API change. Clients that already call remember with content over 2000 characters still get a schema 400 — they always did. Agents that follow server instructions will split instead of retrying.

v1.4.3

view release ↗

Patch release: a transitive @hono/node-server advisory fix that reaches the MCP HTTP transport. No source changed in any published package and no runtime behaviour moves — the fix is a resolution, carried by the lockfile and by the image built from it.

Changes

  • @hono/node-server moves 1.19.14 → 1.19.17 (GHSA-frvp-7c67-39w9). The advisory is a serve-static path traversal reachable on Windows through an encoded backslash. @hono/node-server is not a declared dependency of @3ngram/server; it arrives transitively as a regular dependency of @modelcontextprotocol/node, which the MCP HTTP transport relies on. Because it is a regular dependency rather than an optional peer, a scoped root override (@hono/node-server@<1.19.15: ^1.19.15) reaches it — unlike hono itself, which had to become a declared dependency in v1.2.6.

    The resolution is 1.19.17 rather than the advisory’s 1.19.15 because 1.19.16 was never published.

    The workspace lockfile is what pins this, and the published ghcr.io/b3dmar/3ngram image builds from that lockfile, so the image carries the patched version from this release forward.

  • Dev-scope advisory overrides re-raised. nanoid 3.3.16 → 3.3.17 (GHSA-2v37-7h3g-55p8) and js-yaml 3.15.0 → 3.15.1 / 4.3.0 → 4.3.1 (GHSA-5p4m-2wfm-xmqj). Both are reached only through devDependencies — nanoid via vitest → vite → postcss, js-yaml via @changesets/cli — so neither is present in any published package or in the server image. The js-yaml selectors had gone inert (3.15.0 no longer matches <3.15.0) and are re-raised to the new advisory boundaries, still split so the unaffected 5.x major stays put. The orphaned fast-uri override, which had left the dependency graph entirely, was pruned; it changed no resolution.

  • A CI gate now re-asserts every dependency override against the lockfile. An override is written once and never re-examined — --frozen-lockfile replays the recorded resolution, so CI passed whether or not an entry still did anything. scripts/check-override-freshness.mjs fails on two outcomes: NOT APPLIED (a resolved version still satisfies the override’s own selector, the optional-peer failure mode that forced hono to become a declared dependency) and ORPHANED (the package is gone from the lockfile). It runs in the hygiene lane with no install, reading only pnpm-workspace.yaml and pnpm-lock.yaml. Repository tooling only — no runtime change, and no package version moves with it.

Upgrading

No configuration or migration changes, and no API changes.

Nothing in the published @3ngram/server, @3ngram/sdk, or 3ngram package contents changed; the version exists to carry the patched resolution. Running ghcr.io/b3dmar/3ngram:1.4.3 is sufficient — the image is built from the lockfile that pins 1.19.17.

Consumers who resolve their own dependency graph rather than running the published image should confirm their own @hono/node-server resolves to >= 1.19.15 — an override or a lockfile refresh, since the vulnerable version is reached transitively there too.

Library versions

@3ngram/core 0.9.2, @3ngram/db 0.8.2, @3ngram/schema 0.7.2, @3ngram/config 0.2.6, @3ngram/llm 0.2.4 — unchanged; nothing in this release touched them.

v1.4.2

view release ↗

Patch release: the advertised MCP tool output schemas open up, so a client holding a cached catalog no longer hard-fails on a response field added after it fetched. Runtime validation is untouched — the server still parses its own results strict — and inputs stay closed. Also in this release, the self-imposed MCP surface caps are replaced by a gated eval that measures what they were standing in for.

Changes

  • Tool output schemas advertise additionalProperties: true (issue #154). Every tool output object was .strict(), which Zod 4 emits as additionalProperties: false in the JSON Schema that tools/list publishes. Clients cache that catalog for an hour, so any release adding a response field hard-failed every validating client for the whole TTL window — and nothing prompted an early re-fetch, because the failure is client-side output validation rather than a -32601/-32602 the client reads as staleness.

    That is the v1.4.1 incident: a session still holding the v1.3.0 catalog called get_facts and died on data/facts/0 must NOT have additional properties — a nested item object, a purely additive field. Every object node reachable in all eleven tool output trees now carries .meta({ additionalProperties: true }): root envelopes, array item objects, union members, and section wrappers alike, since the incident failed at depth rather than at the root.

    The runtime contract does not move. .meta() carries metadata only — the objects remain .strict(), so the server still rejects an unknown key in a result it produced itself, and the search envelope’s projection-homogeneity refinement still relies on its hit members being strict. .loose() and .passthrough() would have moved the runtime contract and were deliberately not used.

    Inputs stay closed, and the asymmetry is pinned by a test. An unknown argument key remains a loud rejection — a silently dropped scope filter reads as a scope leak — so no input schema’s advertisement moved a byte. The briefing/handoff selector union is the one object reachable from both an input and an output tree (it is an argument and an echo); the openness rides an output-side derivation, leaving the input union untouched. A registry invariant test walks every emitted output schema asserting no additionalProperties: false at any depth, and asserts every input root still carries it.

    The OpenAPI response schemas open up too, deliberately. The generator reuses the same output schemas for REST responses, so POST /api/v1/memories, POST /api/v1/search, GET /api/v1/facts, GET /api/v1/briefing, and the revise/resolve responses now publish additionalProperties: true. Same rationale: a REST reader compiled against an older spec should not break on a field that was only added. Request bodies and query schemas are untouched.

  • MAX_TOOLS = 12 and MAX_PROMPTS = 2 are gone; a gated eval replaces them (#155). Both were 3ngram’s own discipline, entered at the v1.0.0 launch commit and sourced to nothing upstream — the specification defines no maximum tool count and paginates tools/list, and the pinned SDK enforces no limit. Neither constant was ever exported past its module and neither appears in the public API report, so there is no runtime or API change for any client: the server still registers exactly 11 tools and 2 prompts, with the same names, schemas, and annotations.

    What replaced them measures the property they proxied for. The tool-selection eval slice moved from report-only to gated: selection_accuracy_at_1 (0.8545) and selection_margin (0.1097) are recorded as floors, and max_description_overlap (0.6737, briefing ~ handoff) as a ceiling — a metric where lower is better, so eval/fixtures/floors.json gained a ceilings block with its own comparison rather than storing an inverted floor. A twelfth tool is no longer blocked; a twelfth tool whose description reads like an existing one now fails a required check, and the failure names the offending pair.

    The docs generator no longer arbitrates the surface — generate-mcp-reference.ts threw above both ceilings, which put the argument in the one place that cannot measure either metric; the generated docs/reference/tools.mdx and prompts.mdx now cite the eval instead. AGENTS.md hard rule 8 became an evidence test (JTBD, regenerated surface snapshot, per-tool eval scenarios) with its enforcement named.

  • @3ngram/core moves for a comment-only change: write/archive.ts justified its REST-only surface by citing hard rule 8 without its reason, which no longer reads correctly now that the rule is an evidence test rather than a count. No behaviour changed in core.

Upgrading

No configuration or migration changes, and no breaking API changes.

Clients that validate MCP tool results against the advertised schema will accept additive response fields from now on, including across a stale catalog window. A client pinned to a locally vendored copy of an older schema should refresh it to pick up the openness; nothing else is required. Because the change is to what the server advertises and not to what it accepts, servers and clients can be upgraded in either order.

REST consumers that generate types from the OpenAPI document will see additionalProperties: true on response schemas. Strict code generators may emit an index signature on those types where they previously emitted a closed object.

Library versions

@3ngram/core 0.9.2, @3ngram/db 0.8.2, @3ngram/schema 0.7.2, @3ngram/config 0.2.6, @3ngram/llm 0.2.4.

v1.4.1

view release ↗

Minor release: structured retrieval. Numbers no longer live only inside prose — facts get a live write path, search learns an exhaustive chronological mode, and bi-temporal range reads turn a fact series into one call. No new MCP tool was added for any of it; every capability extends an existing tool’s query shape, and the tool count stays at eleven.

Structured facts capture

  • remember accepts facts[] — structured facts (subject, predicate, value, optional validity window) written atomically with the memory, in the same transaction, composite-FK’d to it. The response echoes factIds exactly when facts were written; existing responses are byte-identical. Both transports (MCP and POST /api/v1/memories) carry the same contract.

  • The convention is one measure per fact, unit in the predicate: subject lift.back_squat, predicate top_set.weight_kg, value 98. Values stay text; charting consumers cast on read.

  • Fact timestamps are ISO strings at the boundary. A Date-typed field cannot ride the JSON Schema that MCP publishes via tools/list, so the contract is ISO-only with conversion at the handler seam. Validity windows are compared as instants, not strings, so mixed-precision pairs (…00Z vs …00.001Z) behave correctly.

Fact proposals: staged extraction awaiting review

  • A new fact_proposals table stages machine-extracted facts for human review before they become queryable truth. One open proposal per candidate fact (partial unique index over md5(value) — btree-safe for long values), first-proposal-wins collapse semantics, append-and-supersede lifecycle, full RLS with the tenant-qualified composite FK making cross-tenant references unrepresentable.

  • review_proposals reviews both kinds. The list grows an optional factProposals array (edge-only responses are byte-identical); accept and reject take the same proposalId-only input and probe both proposal kinds. Accepting a fact proposal materializes the fact in the same transaction; a concurrent double-apply loses the race cleanly rather than double-writing.

  • The extraction job itself is deliberately not in this release; the seam it will use (an injectable extractor behind the same repository pattern the consolidator uses) ships ready.

Search: supersession visibility

  • Superseded predecessors are demoted for every revise kind. The ranking penalty previously keyed on supersedes edges only; updates revises closed a memory’s validity without demoting it. Both now demote.

  • Every search hit carries superseded: boolean, on both transports and both projections, computed from the same predicate that drives the demotion — a demoted hit can never read false. Superseded rows remain retrievable (demote, never filter); the flag is what tells you which ones they are.

Search: chronological list mode

  • order: "chronological" turns search into an exhaustive, filter-driven enumeration: no query needed (filters required instead), no embedding call, no semantic ranking — newest-recorded first, live memories only, with as_of time travel lifting the live gate when asked. “Every gym session, in order” is now a contract the server actually offers rather than a top-k approximation.

  • The list cursor is small and drift-free. Ranked search’s continuation token carries a frozen candidate pool (~4–6 KB); the chronological cursor is a (recorded_at, id) keyset position. It carries the timestamp at full microsecond precision as opaque text — a millisecond-floored cursor silently skips rows when a batch insert shares one transaction timestamp, and a regression test now pins the exact failure.

  • Cursors are bound to the mode and filters that minted them; replaying a cursor across modes is rejected as a typed mismatch, never silently misread.

Facts: bi-temporal range reads

  • get_facts accepts from/to — a half-open [from, to) overlap window over fact validity, ordered chronologically, returning every generation in the window (superseded ones included: that is what a history is). recordedAt joins the output so consumers can tell when a fact was observed versus when it was written down — retroactive logging stops lying about dates.

  • Range and as_of are mutually exclusive; empty and inverted ranges are rejected; bounds reject sub-millisecond precision and advertise the limit.

Also in this release

  • GET /api/v1/version (authenticated) reports the running server version, so deploy tooling can tell a finished rollout from one still in flight.
  • MCP reference documentation for resources and the tool surface expanded, and the design docs now record the deliberate decision to keep the twelfth tool slot unspent.

Review hardening

Pre-release review (v1.4.0 was versioned but never tagged; this release supersedes it) closed five findings before anything shipped:

  • Account erasure and portability export now cover fact_proposals — staged proposal content is redacted on erasure and included in the export archive like every other user-owned table.
  • Chronological search rejects a query rather than silently ignoring it — the query never applied to the enumeration, so a caller could receive the entire live set believing it was filtered.
  • Fact write timestamps reject sub-millisecond precision (the read bounds already did), so nothing is silently truncated on the way in.
  • The superseded flag and its ranking demotion now require closed validity in addition to an incoming revision edge, so an imported updates edge whose target is still live is neither flagged nor demoted — search now agrees with memory_history about what “superseded” means.

Upgrading

  • One additive migration (0031_fact_proposals) — a new table; no existing table is altered. The migration adds a foreign key referencing memories, so apply it with a lock_timeout and retry rather than queueing behind long-running transactions. Self-hosters on FIPS-mode Postgres builds: the new unique index uses md5(), which FIPS disables.
  • No breaking API changes. All new request fields are optional; all new response fields are additive. Shipped schemas are byte-identical for existing calls.

v1.3.0

view release ↗

Minor release: the MCP surface catches up with the 2026-07-28 protocol. Two specification MUSTs are closed, two protocol primitives the server had never served are now served — resources and completions — and clients finally receive enough description to use the tool surface well rather than guess at it.

There is one new REST endpoint, GET /api/v1/version, so deploy tooling can tell a finished rollout from one still in flight.

Protocol compliance

  • server/discover now advertises a cache hint — the same one-hour cacheScope: public the tool and prompt catalogs carry. The spec requires hints on every cacheable result, and discovery is one of them. This was not a case of the field being merely absent: the SDK’s 2026 codec fills unconfigured hints from its own defaults (ttlMs: 0, cacheScope: private), so discovery was actively advertising itself as immediately stale and clients re-probed on every reconnect.

  • /mcp now validates the Origin header. A request with no Origin is allowed — the spec’s requirement is conditional on the header being present, and no non-browser client sends one — while a present Origin must appear in an allowlist or the request is refused 403 ahead of authentication and rate limiting. Host is deliberately not validated; see Upgrading below, because this one has a configuration consequence.

New protocol surface

  • Memory bodies are readable as resources: threengram://memory/{id}, via resources/templates/list and resources/read. resources/read is cacheable on 2026-07-28, so a client that pulled a truncated: true search hit can cache the full body instead of re-calling get_memories every session.

    The body carries only fields that never change after a write — content, topic, type, scope, project, recordedAt — and deliberately omits lifecycle state (status, validity, commitment status, tags). That omission is what makes a 24-hour cacheScope: private TTL sound: nothing in a cached body can go stale, because supersession mints a new memory with a new id rather than editing the old one. Lifecycle questions stay on the tool calls, which are never cacheable.

    Reads enforce the same tenant, read-scope, and access guards as the read tools, and an id belonging to another tenant is reported identically to one that does not exist. resources/list returns nothing by design — enumerating a tenant’s corpus is the firehose the no-firehose rule exists to prevent.

  • Argument completion (completion/complete) over the tenant’s own scope names, so a client can offer real values instead of making the user recall them. It is an adapter over the existing facets read and carries the same guards: tenant from verified auth rather than the request, memory:read enforced fail-closed, access gate ahead of the read. A caller that may not read completes to an empty list rather than an error.

Describing the server to clients

  • server/discover carries instructions — a short usage policy telling the model to open with briefing, to search before asserting something is unknown, that memory is append-only, and that scope and project decide what later reads return. Until now the only guidance an agent received was eleven individual tool descriptions with no cross-tool framing.

  • Every tool declares annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint), so a client can auto-approve a read like search instead of giving it the same friction as a write. destructiveHint is false on every memory write, which is accurate rather than optimistic: append-and-supersede never destroys memory data.

REST

  • GET /api/v1/version returns the running server’s package version. Nothing previously exposed build identity over HTTP — /health reports liveness and /ready readiness, but neither says which build answered, so a post-deploy probe could verify the previous build and report success.

    Authenticated like every /api/v1 route, so the exact version is never disclosed on an unauthenticated surface, but deliberately ungated: the response is the server’s own build identity, not tenant data, and a deploy probe must stay answerable when the access gate itself is broken.

Upgrading

One configuration change is worth acting on before upgrading a browser client. Origin validation is fail-closed: with neither WEB_APP_URL nor the new optional MCP_ALLOWED_ORIGINS configured, the allowlist is empty and any request carrying an Origin header is refused 403.

This is safe for normal use — Claude Desktop, the CLI, and agent runtimes send no Origin at all and are unaffected — but a browser-based client needs its origin listed. WEB_APP_URL is allowlisted automatically; set MCP_ALLOWED_ORIGINS (comma-separated) for any additional origins. For local development against MCP Inspector, that is MCP_ALLOWED_ORIGINS=http://localhost:6274.

No migrations. No other configuration changes.

Library versions

@3ngram/core 0.8.6, @3ngram/db 0.7.5, @3ngram/schema 0.6.4, @3ngram/config 0.2.6, @3ngram/llm 0.2.4.

v1.2.7

view release ↗

Patch release: an OAuth correctness fix that stops handing clients a credential the authorization server would never honour, and a correction to the remember tool description that had been telling agents the opposite of what the read surface actually does.

Changes

  • Refresh tokens are no longer issued to clients that never advertised the refresh_token grant (issue #86). The authorization-code exchange minted a refresh token unconditionally, but the token route gates the refresh grant on the client’s advertised grant_types. A client registered for authorization_code alone — which is also the schema default when a CIMD document omits grant_types entirely — therefore received a refresh token that the very next request rejected as invalid_client. Nothing in the token response signalled that, so the client had no way to know the credential was inert until it tried to use it and lost its session.

    Issuance now matches what the authorization server will actually honour: the refresh token is omitted from the response and its hash is not persisted, since a hash for a token no client was ever handed can never be presented or rotated. refresh_token on the token response is now optional, which is what RFC 6749 §5.1 always specified.

    Rotation additionally fails closed if a client’s advertised grants are narrowed between issuance and rotation, rather than revoking the predecessor and minting no successor.

    This predates the CIMD grant-type narrowing in #85 — grant_types: ['authorization_code'] has always been accepted.

  • The remember tool description no longer contradicts the read surface (issue #71). It asserted flatly that “a memory written with a NULL project never matches a project filter”, which stopped being true once the scope_project selector gained includeUnscoped: true. briefing and handoff were updated at the time; remember was missed, so the write surface was describing the opposite of what the read surface does.

    The description now distinguishes the two cases precisely: the bare project selector is still never widened, and only scope_project with includeUnscoped: true opts NULL-project memories back in. It also drops a dangling (issue #244) citation, which referenced an internal tracker item that means nothing to a reader of the public tool surface.

    Tool descriptions are standing context on every MCP connection, so the regenerated surfaces (docs/reference/tools.mdx, eval/fixtures/transport-surfaces.json) and the recorded transport-cost floors move with it: +13 surface tokens, +104 per-task uncached, +26 per-task cache-effective.

  • Threads design doc published at docs/concepts/threads.mdx. Design documentation only — no runtime change and no package version moves with it.

Upgrading

No configuration or migration changes.

One behavioural note for OAuth integrators: a client whose registration advertises only authorization_code will now receive a token response with no refresh_token field. That credential was already non-functional — presenting it returned invalid_client — so nothing that previously worked stops working. Clients that parse the token response should treat refresh_token as optional, per RFC 6749 §5.1. To keep receiving refresh tokens, advertise the refresh_token grant in the client’s grant_types.

Library versions

@3ngram/core 0.8.5, @3ngram/db 0.7.4, @3ngram/schema 0.6.3, @3ngram/config 0.2.5, @3ngram/llm 0.2.4.

v1.2.6

view release ↗

Patch release: dependency advisory fixes, plus a move to Node 24 for how this project is built, tested and shipped. The supported Node floor for consumers is unchanged at >=22.

1.2.5 was versioned but never published — see Skipped version below.

Changes

  • hono is now a declared dependency of @3ngram/server, pinned to 4.12.34. It previously arrived as an optional peer of @modelcontextprotocol/node, which pnpm auto-installs. Two consequences, both fixed here:

    1. It carried an open advisory, and pnpm overrides cannot reach an auto-installed peer — a scoped override, a bare override and pnpm install --force all left the vulnerable version pinned. Only an explicit declaration moves it.
    2. @modelcontextprotocol/node@2.0.0 declares hono: ^4.12.34, so the auto-installed version was violating that peer range, which pnpm peers check reported as an unmet peer.

    Declaring it also means consumers resolve the version this project actually tests against, rather than whatever their own tree happens to auto-install.

  • postcss advisory override raised to 8.5.23. The previous selector (<=8.5.17) no longer covered the advisory range.

  • Built, tested and shipped on Node 24 (Active LTS). CI, the release workflow and the server image base move to Node 24 — node:24-bookworm-slim, digest-pinned so the base is reproducible rather than tracking a moving tag. Node 22 entered maintenance on 2025-10-21 and receives security fixes only.

  • engines.node deliberately stays >=22. What this project builds on and what it requires of consumers are separate decisions. Nothing in this closure uses a Node 24 feature, and Node 22 is supported upstream until 2027-04-30, so raising the published floor would have hard-failed Node 22 consumers on a patch release. Raising it will be a deliberate major when there is an actual reason.

Skipped version

1.2.5 was versioned and tagged but never published to npm or GHCR. Its engines.node raise to >=24 would have broken Node 22 consumers in a patch release; the release gate rejected the tag for missing curated notes before any publish job ran, and the repository’s tag-protection ruleset makes release tags immutable, so the version was burned rather than moved. No 1.2.5 artifact exists for any package.

Upgrading

No configuration or migration changes. No action required for consumers on Node 22 or Node 24.

Library versions

@3ngram/core 0.8.4, @3ngram/db 0.7.3, @3ngram/schema 0.6.3, @3ngram/config 0.2.5, @3ngram/llm 0.2.4.

v1.2.4

view release ↗

Patch release: a Client ID Metadata Document is no longer rejected for advertising a grant type this server does not implement. Together with v1.2.3 this completes CIMD support — the registration mechanism MCP 2026-07-28 designates as primary, replacing deprecated Dynamic Client Registration.

Changes

  • CIMD documents advertising unsupported grants are now accepted. grant_types was validated as an enum of the two grants this server issues, capped at two entries. Any document listing a third grant failed structurally, so the client could not authorize at all — it received a bare 400 invalid_client.

    This locked out real MCP clients. Claude’s metadata document advertises urn:ietf:params:oauth:grant-type:jwt-bearer alongside authorization_code and refresh_token, failing both the enum and the cap.

    grant_types and response_types advertise what a client MAY use (RFC 7591 §2). An authorization server’s obligations for CIMD are to validate that client_id matches the document URL, to validate redirect_uris, and to validate that the structure is valid JSON containing the required fields (client_id, client_name, redirect_uris) — grant_types is not among them. Both fields are now parsed permissively and narrowed to what this server issues.

    Structurally malformed advertisements are still rejected, and the absent-field default is unchanged.

  • grant_types may narrow to empty; response_types may not. The asymmetry is deliberate. /oauth/authorize already rejects a client without authorization_code and reports the precise unsupported_grant_type, so usability stays a policy decision rather than a blanket invalid_document. Nothing downstream consults a client’s advertised response_types, so code must survive narrowing — otherwise a document advertising only token would be issued an authorization code it never advertised support for.

  • No per-element length cap on either field. A cap would reject before narrowing, so one long vendor extension URI would still condemn a document this server can otherwise serve. Input is bounded where it matters: the resolver caps a fetched document at 5 KiB, and the array length is bounded here.

Upgrading

No configuration or migration changes. Clients previously rejected for advertising an unsupported grant can now authorize.

Library versions

@3ngram/schema 0.6.1, @3ngram/core 0.8.2. @3ngram/db 0.7.0, @3ngram/config 0.2.3 — unchanged.

v1.2.3

view release ↗

Patch release: OAuth Client ID Metadata Document (CIMD) client resolution never worked in a deployed build. If you authorize an MCP client that identifies itself by a metadata-document URL rather than dynamic registration, this is the release that makes it work.

Changes

  • Every CIMD client resolution failed under a real ESM runtime. packages/core/src/auth/client-metadata.ts imported ipaddr.js as a namespace (import * as ipaddr). That package is CommonJS with module.exports = ipaddr and no exports map, so Node’s ESM interop — which relies on cjs-module-lexer finding statically scannable assignments — synthesizes no usable named exports. Every member of the namespace was undefined at runtime, so the first call, ipaddr.isValid(...) in resolveHostnameDefault, threw a TypeError.

    resolvePublicTarget catches any resolver throw and relabels it dns_failure, so every CIMD resolution failed — for hostnames and IP literals alike, with no network I/O — and surfaced to the client as a bare 400 invalid_client attributed to DNS. The import is now a default import.

    This was invisible to the test suite: Vitest pre-bundles CommonJS dependencies through Vite’s own interop and synthesizes the named exports, so the module shape under test was never the shape the deployment loaded.

  • New guard: scripts/check-cjs-namespace-imports.mjs. Imports every namespace-imported bare specifier through real Node ESM resolution and fails when a member the source uses is absent from the namespace. Detection is by member use rather than export count (ipaddr.js’s namespace is not empty — the lexer emits a literal module.exports key, so counting exports is a false pass) and covers destructuring as well as property access. Not yet wired into CI; run it with node scripts/check-cjs-namespace-imports.mjs.

Upgrading

No configuration or migration changes. Deployments using CIMD clients should retry authorization after upgrading. Deployments using only dynamic client registration (RFC 7591) are unaffected — that path never went through the broken resolver.

Library versions

@3ngram/core 0.8.1. @3ngram/db 0.7.0, @3ngram/schema 0.6.0, @3ngram/config 0.2.3 — unchanged.

v1.2.2

view release ↗

Patch release: OAuth client resolution. A deployment whose DNS returns IPv4-mapped answers could not authorize any Client ID Metadata Document (CIMD) client at all, and the /oauth/authorize rejection that resulted was invisible in logs. Both are fixed.

Changes

  • CIMD fetches no longer fail closed on IPv4-mapped DNS answers. The SSRF guard’s address-family agreement check compared the resolver-reported family against ipaddr.process(), which unmaps ::ffff:a.b.c.d to its IPv4 form. A resolver reports that answer as family 6, so the unmapped kind (ipv4 → 4) disagreed and a perfectly self-consistent answer was treated as forged: every CIMD document fetch threw unsafe_address before a socket was opened, surfacing to the client as a bare 400 invalid_client. The check now uses ipaddr.parse(), which preserves the wire form.

    The security boundary is unchanged. isPublicClientMetadataAddress() still classifies via process(), so a mapped loopback, private, or otherwise non-public answer (::ffff:127.0.0.1) is still rejected. Both directions are pinned by tests.

  • /oauth/authorize now records why it rejected a request. One structured, content-free line per rejected request (oauth: authorize endpoint) carrying a hashed client_id_prefix and a closed-set reason: not_registered, metadata_* for each CIMD failure class, metadata_not_materialized, unsupported_grant_type, or redirect_uri_mismatch. Previously all of these returned an identical bare 400 invalid_client with nothing written anywhere, so a stale registration and a metadata document that never loaded were indistinguishable in production logs.

    The response is unchanged — still a uniform invalid_client, so there is no enumeration oracle. The reason is diagnostic only and never leaves the log line, and the raw client_id is never written (CIMD identifiers are URLs that may carry a query component — hard rule 6).

Upgrading

No configuration or migration changes. Operators running a CIMD client against a resolver that returns IPv4-mapped addresses will see authorization start working; everyone else sees only the new rejection log line.

Library versions

@3ngram/core 0.8.0 (new optional resolveOAuthClient failure seam; two-argument callers are unaffected). @3ngram/db 0.7.0, @3ngram/schema 0.6.0, @3ngram/config 0.2.3 — unchanged.

v1.2.1

view release ↗

Minor release: the MCP retrieval surface v2 (epic #42). Agents pulling context no longer hit hard walls — every read tool is now bounded, tunable, and pageable, and truncated results are always followable to full content.

(v1.2.0 was tagged but never published: its release image failed the vulnerability-scan gate on a transitive dependency. v1.2.1 is the first published version of this line and additionally forces ip-address to 10.3.1, fixing CVE-2026-69192.)

Changes

  • New MCP tool get_memories — batched full-content read by id (up to 20 ids, per-item maxContentChars). A truncated: true search or handoff hit is no longer a dead end. Unknown and cross-tenant ids land in notFound as data, never an error.
  • Briefing/handoff bounds are caller-tunable — sectionLimit (up to 100, previously a fixed cap of 25), sections selection on briefing (compute only what you need), hasMore + exact count per briefing section, and exact counts + per-section truncated flags on handoff.
  • Search filters v2 — memoryTypes[] (multi-type OR) and recordedAfter/recordedBefore range filters, on MCP search and the REST list endpoint alike. Filters narrow candidates before ranking fusion; the ranking itself is unchanged.
  • Search pagination — an opaque cursor with frozen-pool ordering (no duplicates or skips under concurrent writes) plus a projection: 'compact' mode that omits hit content for cheap broad scans; scan compact, then get_memories the interesting ids.
  • scope_project selector — scope AND project together, with an includeUnscoped: true opt-in that surfaces NULL-project memories in project-filtered briefings and handoffs.
  • Per-user retrieval-scope policy — configure_scope gains set_retrieval_default: mode default fills unscoped reads with your default scope and echoes appliedScope (never silent); require rejects unscoped reads with a typed error naming the registered scopes; off preserves shipped behavior exactly.
  • Stale-candidate allowlist — briefing staleCandidates now only proposes reviewable types (decision, preference, blocker, fact) instead of every aging memory.
  • Recorded-range hardening — both transports reject inverted ranges and sub-millisecond precision at the schema boundary.

Upgrade notes

  • New database migration 0030_user_retrieval_policy. Self-hosters: run the migrations step (docker compose … run --rm migrations) before starting the new server, as in the standard upgrade flow.
  • All shipped tool contracts are unchanged (byte-stable): new fields and selector variants are additive and optional.

Release artifacts

  • @3ngram/server@1.2.1, @3ngram/sdk@1.2.1, and 3ngram@1.2.1 on npm
  • @3ngram/db@0.7.0, @3ngram/core@0.7.0, and @3ngram/schema@0.6.0 on npm
  • @3ngram/config@0.2.3 and @3ngram/llm@0.2.2 on npm
  • ghcr.io/b3dmar/3ngram:1.2.1 for Linux amd64 and arm64
  • BuildKit SBOM plus provenance and GitHub-signed SLSA attestations

The hosted 3ngram dashboard and cloud-operations code are proprietary and are not included in this repository.

v1.1.3

view release ↗

Patch release: fix the database migrator’s role-provisioning step.

Changes

  • runMigrations() now executes provision-roles.sql over the Postgres simple query protocol instead of the extended protocol, so its DO $$…$$ block and multi-statement body run correctly (previously the provisioning step failed).
  • The migrator substitutes the runtime role from RUNTIME_DB_ROLE (default app_user), so a deployment running as a re-provisioned NOBYPASSRLS role is granted correctly.
  • ALTER ROLE … NOBYPASSRLS in provisioning is now tolerant of managed Postgres (e.g. Neon) where the provisioning role lacks privilege to change BYPASSRLS; CREATE ROLE … NOBYPASSRLS already sets it.

Release artifacts

  • @3ngram/server@1.1.3, @3ngram/sdk@1.1.3, and 3ngram@1.1.3 on npm
  • @3ngram/db@0.6.2 and @3ngram/core@0.6.3 on npm
  • ghcr.io/b3dmar/3ngram:1.1.3 for Linux amd64 and arm64
  • BuildKit SBOM plus provenance and GitHub-signed SLSA attestations

The hosted 3ngram dashboard and cloud-operations code are proprietary and are not included in this repository.

v1.1.2

view release ↗

Patch release: make the production DATABASE_URL runtime-role check configurable, completing the pair with the v1.1.1 RLS-guard change.

Changes

  • The production DATABASE_URL validation now honors the RUNTIME_DB_ROLE environment variable (defaulting to app_user) instead of hardcoding app_user. A deployment whose runtime connects as a differently-named NOBYPASSRLS role passes env validation. No behavior change when RUNTIME_DB_ROLE is unset.

Release artifacts

  • @3ngram/server@1.1.2, @3ngram/sdk@1.1.2, and 3ngram@1.1.2 on npm
  • @3ngram/core@0.6.2 and @3ngram/config@0.2.3 on npm
  • ghcr.io/b3dmar/3ngram:1.1.2 for Linux amd64 and arm64
  • BuildKit SBOM plus provenance and GitHub-signed SLSA attestations

The hosted 3ngram dashboard and cloud-operations code are proprietary and are not included in this repository. The MCP server, REST API, SDK, CLI, and memory engine do not depend on that dashboard.

v1.1.1

view release ↗

Patch release: make the runtime row-level-security guard’s expected database role configurable.

Changes

  • The runtime RLS readiness guard (GET /ready) now reads the expected current_user from the RUNTIME_DB_ROLE environment variable, defaulting to app_user. A deployment whose runtime connects as a differently-named NOBYPASSRLS role now passes readiness instead of failing on a hardcoded role name. No behavior change when RUNTIME_DB_ROLE is unset.

Release artifacts

  • @3ngram/server@1.1.1, @3ngram/sdk@1.1.1, and 3ngram@1.1.1 on npm
  • @3ngram/core@0.6.1 and @3ngram/db@0.6.1 on npm
  • ghcr.io/b3dmar/3ngram:1.1.1 for Linux amd64 and arm64
  • BuildKit SBOM plus provenance and GitHub-signed SLSA attestations

The hosted 3ngram dashboard and cloud-operations code are proprietary and are not included in this repository. The MCP server, REST API, SDK, CLI, and memory engine do not depend on that dashboard.

v1.1.0

view release ↗

Feature and hardening release of 3ngram: persistent, typed memory for AI agents. It adds Client ID Metadata Document (CIMD) OAuth, a single stateless MCP handler spanning legacy and current protocol clients, and a defense-in-depth pass over tenant isolation.

Tenant-isolation hardening

  • FORCE ROW LEVEL SECURITY is now set on the tenant-data tables, so isolation no longer depends on the runtime never connecting as a table owner.
  • A runtime, fail-closed guard verifies at readiness (GET /ready) that the connected role cannot bypass RLS and that FORCE is in effect; a misprovisioned database is held out of rotation instead of serving cross-tenant reads.
  • Every memory-domain read and scope mutation now also carries an explicit caller-bound user_id predicate as a second layer alongside RLS. Result sets are unchanged while RLS is in force.
  • audit_log is brought under row-level security, and the runtime role’s NOBYPASSRLS attribute is re-asserted on every provisioning run.

OAuth and MCP

  • OAuth Client ID Metadata Document (CIMD) resolution with SSRF-safe fetching and bounded HTTP caching.
  • A single stateless MCP SDK v2 handler serves both legacy and 2026-07-28 clients from one code path.
  • Cache and pre-parser header observability for the MCP surface.

Release artifacts

  • @3ngram/server@1.1.0, @3ngram/worker@1.1.0, @3ngram/sdk@1.1.0, and 3ngram@1.1.0 on npm
  • @3ngram/core@0.6.0, @3ngram/db@0.6.0, @3ngram/schema@0.5.0, and @3ngram/config@0.2.2 on npm
  • ghcr.io/b3dmar/3ngram:1.1.0 for Linux amd64 and arm64
  • BuildKit SBOM plus provenance and GitHub-signed SLSA attestations

The hosted 3ngram dashboard and cloud-operations code are proprietary and are not included in this repository. The MCP server, REST API, SDK, CLI, and memory engine do not depend on that dashboard.

v1.0.2

view release ↗

Security-hardened public release of 3ngram: persistent, typed memory for AI agents. This patch is intended as the first complete cross-package release after the v1.0.1 publication run was halted during code-scanning review.

Security hardening

  • A coarse per-IP rate limit now covers every non-health HTTP surface before body parsing, backed by Redis across replicas and in-memory for self-hosting.
  • Login, signup, OAuth, MCP, and API-key traffic retain their narrower dedicated rate-limit buckets in addition to the coarse edge limit.
  • Core, LLM, and SDK URL normalization now runs in linear time for arbitrary trailing-slash input.
  • Documentation generators, evaluation tests, and CI permissions were tightened in response to the public CodeQL baseline.

Release artifacts

  • @3ngram/server@1.0.2, @3ngram/sdk@1.0.2, and 3ngram@1.0.2 on npm
  • @3ngram/core@0.5.1 and @3ngram/llm@0.2.2 on npm
  • The existing exact config, schema, and database packages that complete the server dependency closure
  • ghcr.io/b3dmar/3ngram:1.0.2 for Linux amd64 and arm64
  • BuildKit SBOM plus provenance and GitHub-signed SLSA attestations

The hosted 3ngram dashboard and cloud-operations code are proprietary and are not included in this repository. The MCP server, REST API, SDK, CLI, and memory engine do not depend on that dashboard.

v1.0.1

view release ↗

The first public artifact release of 3ngram: persistent, typed memory for AI agents. This patch supersedes the unpublished v1.0.0 release attempt.

Highlights

  • 10 MCP tools and 2 prompts over Streamable HTTP
  • REST API and typed TypeScript SDK
  • Append-and-supersede memory history with bi-temporal facts
  • Postgres + pgvector retrieval with a blocking golden-set quality gate
  • Apache-2.0 server, engine, SDK, and CLI with a self-hosted Compose path
  • A smaller production server image with the unused npm toolchain removed

Release artifacts

  • Public @3ngram/* libraries and the 3ngram CLI on npm
  • ghcr.io/b3dmar/3ngram:1.0.1 for Linux amd64 and arm64
  • BuildKit SBOM and provenance attached to the OCI image
  • GitHub-signed SLSA provenance, verifiable with gh attestation verify

The hosted 3ngram dashboard and cloud-operations code are proprietary and are not included in this repository. The MCP server, REST API, SDK, CLI, and memory engine do not depend on that dashboard.

See the container image guide for immutable pulls and attestation verification, and the self-host guide for deployment.

v1.0.0

view release ↗

The first public release of 3ngram: persistent, typed memory for AI agents.

Highlights

  • 10 MCP tools and 2 prompts over Streamable HTTP
  • REST API and typed TypeScript SDK
  • Append-and-supersede memory history with bi-temporal facts
  • Postgres + pgvector retrieval with a blocking golden-set quality gate
  • Apache-2.0 server, engine, SDK, and CLI with a self-hosted Compose path

Release artifacts

  • Public @3ngram/* libraries and the 3ngram CLI on npm
  • ghcr.io/b3dmar/3ngram:1.0.0 for Linux amd64 and arm64
  • BuildKit SBOM and provenance attached to the OCI image
  • GitHub-signed SLSA provenance, verifiable with gh attestation verify

The hosted 3ngram dashboard and cloud-operations code are proprietary and are not included in this repository. The MCP server, REST API, SDK, CLI, and memory engine do not depend on that dashboard.

See the container image guide for immutable pulls and attestation verification, and the self-host guide for deployment.

start with the latest 3ngram.

free · no card · persistent typed memory for the AI client you connect.

get started free ↵