Skip to content

3ngram 1.13.0

Choose a tag to compare

@github-actions github-actions released this 09 Nov 14:22
1bf0f82

3ngram v1.13.0

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.

Immutable container reference

ghcr.io/b3dmar/3ngram@sha256:913e4f4d0216dc574cbc3c85606cf43e098287a63799939dff5dbc2f96006781