CortexDB · docs

CortexDB 0.14.0 — shared memory: sources, applications and the org brain under one access model

0.14.0 is 0.13.1 plus shared memory (docs/SHARED_MEMORY_ARCHITECTURE.md): one CortexDB holding a tenant's sources, its applications' memories and its org brain, where every row carries who may read it and every read is decided against it. It adds the identity that needs (a principal chain on tokens, external token issuers, a tenant directory and SCIM 2.0), an access API to ask and to change who may read what (check and explain, lookups, AuthZEN, change sets with previews, watch, notices), reads that declare their purpose, legal holds and the erasure of a person, an outside party or a whole tenant, source containers that follow each source's own ACL, agent writes that carry what their run read, rollups and publish for the org brain, a decision-audit stream with audit retention, and an MCP server over HTTP.

This is the one breaking release of shared memory (owner decisions A33 and A36 to A38). Its first start arms the data directory for shard apply format 10, one way: no 0.13.x binary opens the directory afterwards, and the way back is the backup taken before the upgrade. Every new access check refuses by default, and some requests 0.13.1 served now answer differently or under another code. Work through the "Upgrade checklist" before you upgrade.

The upgrade loses nothing stored. Tested on a data directory 0.13.1 wrote in the hosted beta's shape (tests/compat/beta_upgrade.py, the beta data-retention gate, owner decision A34): every record, roster, tree, event, fact, erasure receipt, revocation and token probe 0.13.1 served, 0.14.0 serves; the directory armed one way, 0.13.1 then refused it, and a restored copy served the same. The one difference was the one expected: a person's token minted for 30 days answered 200 on 0.13.1 and 401 on 0.14.0 (its lifetime ceiling, below).

Getting 0.14.0. It is released on the customer channel only: from https://customer.cortexdb.ai, Releases. It is not on Docker Hub or the public GitHub releases.

Every caller-visible change, route by route, is in docs/shared_memory/PHASE0_RELEASE_NOTES_DRAFT.md to PHASE5_RELEASE_NOTES_DRAFT.md; the routes are in docs/API_REFERENCE_V1.md (its §16 lists every error code with its status and retriable flag) and docs/schemas/openapi.json. This page is the summary an operator needs.

Breaking changes

Upgrade checklist

For a single node; on a cluster, for every node. "Upgrading a pilot", below, has the steps in order.

Before the first start of 0.14.0:

  1. Take a cold backup, and keep it with the 0.13.1 binary. With the server stopped: python scripts/cold_backup.py backup DATA_DIR ARCHIVE.tar.gz, then python scripts/cold_backup.py verify ARCHIVE.tar.gz (or the 0.13.1 binary's cortexdb backup and cortexdb backup-verify). The first start arms the directory one way; this archive is the only way back.
  2. Rehearse on a copy with scripts/upgrade_rehearsal.py: it boots 0.13.1 and then 0.14.0 on a restored copy, with your environment, and lists what 0.14.0 lost or answers differently.
  3. Decide each enforcement switch. All eleven CORTEX_<CHECK>_ENFORCE switches are on. Set off for each one your clients would trip; the access report then counts what it would refuse.
  4. Decide the operator key's mode on cloud_shared_saas, where it is deny: an application that reads, writes or mints with the operator key needs CORTEX_OPERATOR_DATA_READS=allow (or audit) until it uses per-person tokens.
  5. Check your tokens and mints: lifetimes within the ceilings (7 days for a person or an agent, 30 for a service, 24 hours with a chain claim); scopes that name every capability family a token uses; no act naming an AI employee; every mint naming its tenant root (scope, tenant or scopes); and no mint wider than its minter.
  6. Hosted deployments: list the website minter's principal in the issuers file's deployment_minters, and mint its token again holding auth.mint and every family it mints, each at *.
  7. Check your callers for what is now refused or answered differently: forget and erasure selector fields a route does not apply, tree.display_name, /v1/understanding* and /v1/concepts* without understanding.read, a decimal offset as GET /v1/events's cursor, and the error codes, statuses and retriable flags that changed.
  8. Upgrade the clients with the server ("Clients"): the published ones predate shared memory.

After the first start:

  1. A restored copy waits for its acknowledgement (503 ACCESS_RESTORE_PENDING): acknowledge it, or restore with --access-state unchanged when access did not change since the backup.
  2. Remove each off once its count in GET /v1/admin/access/report stays at zero.

What changes, and what to do

What a 0.13.1 deployment that sets none of the variables below sees change at the upgrade.

Upgrading a pilot

A single node. On a cluster, upgrade every node; each shard's leader arms it once every member runs 0.14.0.

Before you start

Steps

  1. Pin the deployment to 0.13.1, so nothing restarts it on 0.14.0 while you work.

  2. Stop the server with its full stop grace: docker stop -t 120 cortexdb, or systemctl stop with TimeoutStopSec=120.

  3. Back up the stopped directory and verify the archive:

    python scripts/cold_backup.py backup DATA_DIR ARCHIVE.tar.gz
    python scripts/cold_backup.py verify ARCHIVE.tar.gz
    

    (or the 0.13.1 binary's own cortexdb backup DATA_DIR ARCHIVE and cortexdb backup-verify ARCHIVE; with Docker, --entrypoint cortexdb on the 0.13.1 image). Keep the archive with the 0.13.1 binary or image: arming is one way, and this backup is the only way back.

  4. Review the environment. 0.14.0 reads the same environment and override files as 0.13.1. Each off below serves what the check refuses and counts it in the access report, so you can see when it is safe to remove:

    SetWhenWhy
    CORTEX_OPERATOR_DATA_READS=allow (or audit)the preset is cloud_shared_saas and an application reads, writes or mints with the operator key, or a deployment minter mints account tokensdeny, the preset's default, refuses those requests without X-Cortex-Break-Glass
    CORTEX_MINT_LIFETIME_ENFORCE=offclients hold minted tokens of more than 7 days (person, agent), 30 days (service) or, with a chain claim, 24 hoursthey answer 401 from the first request
    CORTEX_TOKEN_CONFINEMENT_ENFORCE=offclients hold tokens whose scopes do not name every family they usethose uses answer 403
    CORTEX_MINT_REACH_ENFORCE=offa minter's mints name no tenant root, or more than the minter holds (the website minter not yet re-minted)those mints answer 403 or 422
    CORTEX_PERSON_DISPLAY_NAME_ENFORCE=off and CORTEX_DISPLAY_NAME_IN_RECORD_ENFORCE=offa client writes tree.display_namethose writes answer 422
    CORTEX_AUDIT_RETENTION_ENFORCE=off, or CORTEX_AUDIT_RETENTION=offthe deployment names its preset and must keep audit rows older than its periodthe first sweep deletes them five minutes after the start
    CORTEX_DELIVERY_GATE_ENFORCE=offa reader reads rows (lifecycle frames, exports) at homes where it holds no Reader rolethose rows are withheld
    leave CORTEX_FORMAT_CEILING unsetalways7 keeps the directory unarmed and the new features answering 503
  5. Start 0.14.0 on the same directory with that environment. Before it serves, it arms the directory and logs a warning, "shard armed for apply format 10: this is one-way, and this data directory no longer opens on an older binary…", with code SHARD_ARMED_ONE_WAY and format 10; every later start logs SHARD_ARMED_ONE_WAY at INFO. If the log says instead "the format ceiling allows arming, but the shard is held below it" with reason=reserved_path_in_use, a record sits at a marker or companion path (paths names them): the node serves unarmed, and the routes that need the new formats answer 503 FORMAT_UPGRADE_PENDING until you migrate that scope's events out, delete the record and restart. GET /v1/admin/ready answers 200 once it serves.

  6. Verify:

    • GET /v1/admin/version: crate_version 0.14.0 and the new capabilities ("New capabilities").
    • DATA_DIR/format_armed.json holds {"format": 10}.
    • GET /v1/admin/metrics auth.enforce: each switch on or off as you set it.
    • A memory you know is found by GET /v1/events/{id} and by /v1/recall (the operator key under allow, or a person's token), and a retry of a recent write with its idempotency key replays it.
    • Each kind of client token answers GET /v1/auth/whoami as before; a 401 lifetime_over_ceiling names a token to mint again. A hosted deployment's website mints an account token.
    • For each switch you set off: GET /v1/admin/access/report?scope=<tenant root> (the operator key, diagnostics.read) counts what it would refuse. Under the defaults, each refusal is a line under cortex_api::decision in the log, naming the link that failed and its deciding path.
  7. Then mint the over-ceiling tokens again, move display names to the directory, and remove each off once its count stays at zero.

The way back

Only from the backup. Stop 0.14.0 and keep its directory aside. Restore the archive into a new, empty directory with the 0.13.1 tools (python scripts/cold_backup.py restore ARCHIVE NEW_DIR --cortexdb ./cortexdb-0.13.1, or the 0.13.1 binary's cortexdb restore ARCHIVE NEW_DIR), and start 0.13.1 on it. Every write made after the upgrade is lost. Never start 0.13.x on the upgraded directory: it refuses it. The one-click updater never rolls back onto an armed directory.

The hosted beta

The hosted beta runs cloud_shared_saas, and CortexOS reads and writes there with the operator key, as service:cortexos. Set CORTEX_OPERATOR_DATA_READS=allow before its upgrade and keep it until CortexOS's release that moves its traffic to per-person tokens is live: under deny, the preset's default, its data reads and its writes into person regions and shared scopes are refused from the first request. audit serves the same as allow and counts what deny would refuse (check operator_access), which shows when the key's traffic has moved. Mint the website's token again ("Hosted deployments", above) before the upgrade. Before the upgrade, run scripts/upgrade_rehearsal.py on a copy of the beta's directory, with its environment.

What's new

Identity and tokens

The access API

Registry records, change sets and applications

Notices and watch

Consistency tokens

Restores

Source containers

The directory and SCIM

Read sets and agent writes

Derived records and labels

Rollups and publish

Erasures, holds and the read-free forget

Audit

The MCP server

The console

The shared fixture and the release gates

New capabilities

GET /v1/admin/version lists 34 more names than 0.13.1 (mcp_http_v1 only while CORTEX_MCP=on):

New settings

On a cluster data node, set them in the node config's [engine] table. The switches, CORTEX_OPERATOR_DATA_READS, CORTEX_OPERATOR_INHERIT_TENANT, CORTEX_LEGACY_WRITE_CUTOFF, CORTEX_AUDIT_RETENTION, the audit pepper file, the issuers file and the rollup, backfill and MCP settings refuse the start (exit 78) on a value they do not take; CORTEX_ACCESS_REPORT, its _MAX_MB, CORTEX_DECISION_LOG, CORTEX_CONSISTENCY_WAIT_MS and CORTEX_SOURCE_WATERMARK_MAX_AGE_S fall back to their default.

VariableDefaultMeaning
CORTEX_FORMAT_CEILINGthe newest format, 10the highest shard apply format the node arms for; 7 keeps it unarmed, 9 holds it at 9
CORTEX_MINT_LIFETIME_ENFORCE, CORTEX_TOKEN_CONFINEMENT_ENFORCE, CORTEX_MINT_REACH_ENFORCE, CORTEX_MINTER_LINK_ENFORCE, CORTEX_DUPLICATE_MEMBER_ENFORCE, CORTEX_RESERVED_PATH_ENFORCE, CORTEX_ROLE_BLIND_MEMBERSHIP_ENFORCE, CORTEX_PERSON_DISPLAY_NAME_ENFORCE, CORTEX_DISPLAY_NAME_IN_RECORD_ENFORCE, CORTEX_AUDIT_RETENTION_ENFORCE, CORTEX_DELIVERY_GATE_ENFORCEonoff serves what the check refuses and counts it
CORTEX_REVOCATIONS_V2onoff keeps 0.13.x's revocation journal
CORTEX_OPERATOR_DATA_READSthe preset's: deny on cloud_shared_saas with auth on, else allowallow, audit or deny for the operator key
CORTEX_OPERATOR_INHERIT_TENANToffthe key's registrations take the binding of the record that governs them
CORTEX_AUTH_ISSUERS_FILEunsetthe external issuers file
CORTEX_LEGACY_WRITE_CUTOFFunsetfrom this time, chainless non-human writes follow the chain's write rules
CORTEX_AUTHZEN_PDPthe request's originthe policy_decision_point AuthZEN's metadata names
CORTEX_ACCESS_REPORTonoff counts nothing (the report answers 409 ACCESS_REPORT_OFF)
CORTEX_ACCESS_REPORT_MAX_MB64the report counters' memory budget
CORTEX_DECISION_LOGdenialsoff, report, denials or all
CORTEX_AUDIT_RETENTIONunset (the named preset's period, or none)an ISO 8601 period, or off
CORTEX_AUDIT_PEPPER_FILE<data_dir>/audit_pepper.jsonwhere the audit trail's pepper is kept: created at the first start, never replaced
CORTEX_CONSISTENCY_WAIT_MS10,000 (at most 30,000)how long at_least waits
CORTEX_ACCESS_VIEW_MAX_BYTES2 GiBevery permission view a node keeps; 0 keeps none
CORTEX_ACCESS_VIEW_ROOT_MAX_BYTES1 GiBone root's view
CORTEX_READ_SET_THREADSthe cores, clamped to 2 to 16 (at most 64)threads for a read set's parallel search
CORTEX_READ_RECORDS_MAX_MB64the agents' read records, least recently used evicted
CORTEX_LIMIT_BRAIN_SCOPES, _SOURCES, _CONTAINERS_PER_SOURCE, _SETS, _APPS, _POLICIES520,000, 16, 50,000, 50,000, 8, 64the deployment limits, per org tree
CORTEX_ROLLUP_CADENCEteam:300,department:3600,org:86400,node:3600seconds between a read unit's rollup builds
CORTEX_ROLLUP_BUDGET_USDteam:0.25,department:0.50,org:1.00,node:0.25each unit's daily synthesis budget
CORTEX_ENRICHMENT_BACKFILL_BUDGET_USD5the enrich turn-on backfill's daily budget per tenant; 0 queues nothing
CORTEX_SOURCE_WATERMARK_MAX_AGE_S86,400 (a day)a source whose last sync is older is a watermark gap in coverage
CORTEX_MCPoffon serves /mcp
CORTEX_MCP_PROFILEreadwrite adds remember and forget
CORTEX_MCP_SCOPESorg:{tenant}/{principal}/*the MCP tools' scope allowlist
CORTEX_MCP_RESOURCE, CORTEX_MCP_AUTHORIZATION_SERVERS, CORTEX_MCP_ALLOWED_ORIGINSunsetthe resource URI, the authorization servers and the browser origins the MCP server names and admits

Fixes

The release's last lanes audited every route against its contract and fixed what they found. Each item says what was wrong; PHASE5_RELEASE_NOTES_DRAFT.md has the rest of each.

Security

Change sets at scale

Routes 0.13.1 already served

Shared-memory features, as the pre-release builds served them

Known limitations

Clients

0.14.0 ships five client releases. Each is published by hand, before the server's tag: release.yml's preflight ("Verify coordinated client packages are already published") fails a tag whose tree names a cortexdbai (PyPI or npm) or cortexdb-connectors version its registry does not serve, so the Python SDK 0.13.0, the TypeScript SDK 0.11.0 and the connectors 0.3.0 are on their registries first; cortexdb-mcp and cortexdb-cli are not checked and have no automation. Until then the registries hold the versions under "Published".

PackageRegistryPublishedWith 0.14.0What it adds
cortexdbai (Python SDK)PyPI0.12.00.13.0a method for every v1 route, shared memory included, on Cortex and AsyncCortex (sdks/python/COVERAGE.md); typed models from the OpenAPI contract; a typed exception per error code; consistency tokens (ConsistencyTokens); the chain mints, break-glass and the subject-token shadow
cortexdbai (TypeScript SDK)npm0.10.10.11.0a typed call for every v1 route (sdks/typescript/COVERAGE.md): the access API, AuthZEN, change sets, applications, the directory, SCIM, restores, rollups, publish, erasures with their receipts and proofs, the read-free forget; ConsistencyTracker; a class per error code with ERROR_CODES and isRetriable()
cortexdb-mcpPyPI0.8.00.9.0a person's, an agent chain's or an issuer's token as its credential, the subject-token and break-glass headers, new tools (access_check, access_explain, rollups, notices, acknowledge_notices, directory_lookup, and under the write profile publish and forget_by_key), the write and read profiles (all, the default, no longer lists every tool), typed errors with the server's codes, and every tool checked against 0.14.0 (mcp-server/COVERAGE.md)
cortexdb-cliPyPI0.6.00.7.0break-glass flags on every command, typed errors with a hint for each code, cortexdb tokens mint with every field and chain claim, cortexdb directory, and every command checked against 0.14.0 (cli/COVERAGE.md)
cortexdb-connectorsPyPI0.2.220.3.0container mode (source containers) for Slack, Teams, Discord, Google Drive, Confluence and Notion

Each client follows the last server lanes within its version: the Python SDK's models are regenerated from the final OpenAPI contract; the TypeScript SDK reads a change-set preview whole, changes.previewAll() and previewPages() (every page of a preview, a unit's records, changes and people joined across pages; apply() activates after reading it), and throws V1ChangeSetPreviewMovedError for a page of another revision; the console marks an in-band activation, shows not_narrowing's details and pages a preview's units; the MCP server and the CLI take p5v's and p5w's codes.

Their breaking changes, from each package's README and CHANGELOG:

The clients published before 0.14.0 predate shared memory: they reach none of its routes, cortexdb-cli 0.6.0's interactive /forget is refused (strict selectors), and the SDKs' error tables carry the codes as 0.13.x answered them. Upgrade them with the server.

Performance against 0.13.1

Single-node parity (owner decision A30): met. The release's bound is the p50 and the p95 of capture, recall and answer within +10 % of 0.13.1's, strictly. Measured at 12cbbc1b, below, and confirmed on the final server code, 394f46b8: in one interleaved run of v0.13.1, 12cbbc1b and 394f46b8, the final matches 12cbbc1b within ±2.6 % on every write row, all of them inside +10 % of v0.13.1 (the nearest, wait=captured p95, +6.9 %), and RSS at ready on an empty data directory is +22.5 %, the binary's size, as accepted.

Compatibility