v1.2.0 — The audit-driven release #31
idapixl
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Why this release exists
An external code-and-architecture review of cortex-engine landed on three credible critiques:
await store.put*/update*calls without atomicity. A mid-sequence failure could leave orphan memories or a fade marker without its audit-trail belief entry.CortexStoreinterface, but offered no tool to clone data from one to the other. The "abstract the persistence layer" recommendation from the audit was already done in code — but the plumbing that proves it (a migrator) was missing.queryvsrecallvsretrievevsneighborsvswondervsspeculate) was genuinely ambiguous from names alone.A fourth track landed during integration: a user-reported regression where
fozikio health,vitals,anomalies,maintain fix, and a handful of other CLI subcommands silently ignored the agent'sdefault_namespaceand the--namespaceflag, returning zero-stat results in any workspace that wasn't using the default namespace.This release addresses all four, with parallel implementation tracks and a final code review pass.
What's new
withTransactionon everyCortexStoreIf any line throws, the whole sequence rolls back. SQLite uses manual
BEGIN IMMEDIATE/COMMIT/ROLLBACKwith a per-store Promise-chained mutex (better-sqlite3's owndb.transactionrejects Promise returns and doesn't surviveawaitsuspensions — we caught this empirically and rebuilt the implementation around the actual constraint). Firestore usesrunTransactionwith aFirestoreTxnProxythat routes writes through the transaction handle while explicitly throwing on scans (Firestore's reads-before-writes model).busy_timeout = 5000is now set on every SQLite store afterjournal_mode = WAL, so concurrent writers ride out checkpoint contention instead of failing instantly withSQLITE_BUSY.Full contract:
docs/concurrency.md.fozikio migrateMigrations are ID-preserving (so links survive), idempotent (re-running with
--resumeis safe), checkpointed (.cortex-migrate-state.json), and fail loudly on schema mismatch before mutating the destination. Three backends supported today —sqlite:,firestore:,json:— with adapters added by implementingCortexStore.JSON is the third backend introduced here, primarily as a backup format and migration staging target. It loads the whole dataset into memory and rewrites the file on every write, so don't run a live agent off it.
Typed tool metadata
Every cognitive tool now carries:
The MCP
tools/listresponse composes these into the description the LLM sees:All 57 tool descriptions were rewritten to a consistent quality bar, with extra attention to the memory cluster (the highest-confusion area). The full catalogue is auto-generated at
docs/tools-reference.md, regenerable vianpm run docs:tools.Browse from the command line:
A new REST endpoint exposes the same structured metadata:
CLI namespace fix
If you ran
fozikio healthin a workspace withdefault_namespace: anthemsand got zero stats while the MCP server backed by the same SQLite file was correctly serving 18 memories — that bug is fixed. A newsrc/bin/namespace-resolver.tshelper threads--namespace,--agent, and the agent.yaml default through every subcommand. Affected commands:health,vitals,anomalies,maintain(bothfixandre-embed),report,digest,wander. The resolved namespace is now printed to stderr on every run for visibility.Migration path
For existing v1.1.x users: No breaking changes for tool authors who don't implement
CortexStore. The interface grew six new methods (withTransaction, fiveupsert*variants,getCapabilities), so any externalCortexStoreimplementations need to add them — see the existing implementations insrc/stores/for the pattern.For plugin authors who add tools:
ToolDefinition.categoryandwhenToUseare now required fields. The TypeScript compiler will flag any plugin tool that doesn't have them. Valid categories:memory,consolidation,beliefs,ops,threads,journal,social,content,graph,vitals,agents,maintenance,meta.For agents in production: Recommended pre-upgrade step:
This gives you a frozen snapshot of your agent's mind before the upgrade. Restore is symmetric if needed.
Known limitations shipped intentionally
SqliteCortexStore/JsonCortexStoreviainstanceof; Firestore as a migration source or destination throws a clear error. The publicCortexStoreinterface lackslistAll*methods for signals, beliefs, edges, ops, and observations, and we chose not to extend it mid-release. Workaround for now: route via JSON if you need Firestore↔X. Follow-up issue tracking this.JsonCortexStoreis a tool, not a backend. It rewrites the file on every write and holds everything in memory. Use it for backup, restore, and migration. Do not host a live agent on it.Internal numbers, for the curious
withTransaction.Thanks
To the reviewer who delivered the audit that drove this work — your assertions were precise enough to plan around, your three "next steps" mapped cleanly onto three implementation tracks, and the one detail you got wrong (the dependency profile) was a useful Rorschach for catching out future LLM-driven reviews.
To the user who reported the namespace bug mid-release — you saved us from shipping a regression that would have been embarrassing to find later.
Full changelog
CHANGELOG.mdhas the comprehensive list.Discussion
What's missing? What broke? What should v1.3.x focus on? Reply below.
Beta Was this translation helpful? Give feedback.
All reactions