Lex 2.0.0 — December 6, 2025

The AX-Native Release

Lex 2.0.0 is the freeze point. All contracts are live and binding. From here forward, the work is AX improvement—not contract churn.

Agent eXperience (AX) is no longer aspirational. It's the spec we ship against.

What Froze at 2.0.0

Lex 2.0.0 freezes four binding contracts:

Contract Version Document
AX Guarantees v0.1 docs/specs/AX-CONTRACT.md
Frame Schema v3 docs/specs/FRAME-SCHEMA-V3.md
Error Schema v1 AXError in src/shared/errors/
FrameStore 1.0.0 src/memory/store/CONTRACT.md

Breaking these contracts requires a major version bump and explicit changelog entry. This is not aspirational—it's auditable.

When AX Became Real

Agent eXperience (AX) sounds like marketing. It's not.

AX is the discipline of designing systems where AI agents are first-class consumers.

At Lex 1.0.0, we documented the philosophy. At 2.0.0, we froze the guarantees:

Guarantee Status What It Means
Structured Output --json on remember, timeline
Recoverable Errors AXError schema with nextActions[]
Memory & Recall FTS5 case-insensitive, hyphen-safe
Frame Emission Frame v3 schema stable for runners

This table is a contract. If we break any of these guarantees in a 2.x release, it's a bug—not a "known limitation."

The LexSona Socket

Lex 2.0.0 clarifies the layering between Lex, LexSona, and LexRunner:

  • Lex: Memory + Policy + Rules + Behavioral socket
  • LexSona: Persona engine (consumes Lex socket)
  • LexRunner: Orchestration (consumes both)

The new @smartergpt/lex/lexsona subpath export provides the behavioral memory API:

  • getRules(moduleId, taskType) — Retrieve behavioral rules with confidence scores
  • recordCorrection(violation, correction) — Store new behavioral learning

This socket is agnostic. Any tool can plug into it. LexSona is one consumer, not the only one.

What moved out of Lex 2.0.0:

  • Persona execution logic (now in LexSona)
  • .smartergpt/personas/ directory (LexSona-specific)
  • Orphaned persona schema (no longer needed in core)

What stayed in:

  • Behavioral memory storage (the socket API)
  • Rule confidence tracking (Bayesian alpha/beta)
  • Policy-aware behavioral constraints

Error Codes as a Contract

Lex 2.0.0 introduces a stable error code catalog (src/shared/errors/error-codes.ts):

  • CONFIG_*: Configuration and initialization errors
  • POLICY_*: Policy loading and validation failures
  • STORE_*: Database and storage errors
  • PROMPT_*: Prompt loading issues
  • SCHEMA_*: Schema validation failures

Every error code has standard nextActions[]:

{
  "code": "CONFIG_LEX_YAML_NOT_FOUND",
  "message": ".smartergpt/ exists but no lex.yaml found",
  "nextActions": ["cp lex.yaml.example lex.yaml"],
  "context": { "smartergptDir": "/path/to/.smartergpt" }
}

This is not "nice to have" error handling. This is per AX Contract v0.1 §2.3: Recoverable Errors.

AI agents can programmatically handle and recover from errors without guessing.

Instruction Management

Lex 2.0.0 ships full instruction management:

  • lex instructions init — Scaffold canonical source, lex.yaml, and target files
  • lex instructions generate — Generate host-specific projections
  • lex instructions check — Verify projections are in sync

This is the realization of the YAML-as-contract vision from 1.0.0:

Describe what work means in a repo, without shipping any particular executor.

Instructions are:

  • Deterministic: Same source → same projections
  • Idempotent: Running generate twice produces identical output
  • Non-invasive: Content outside markers is never touched

Canonical source lives in .smartergpt/instructions/lex.md. Projections use markers:

<!-- LEX:BEGIN -->
Generated content here
<!-- LEX:END -->

This pattern scales to any IDE/host that supports instruction blocks.

Performance Improvements

Lex 2.0.0 ships cached policy module ID lookups for O(1) resolution:

  • 1000-module policy now validates in ~0.003ms (same as 10-module)
  • Benchmark performance improved by ~55% over baseline
  • WeakMap-based caching prevents memory leaks

This matters for large monorepos where policy checks run thousands of times per session.

The optimization is transparent—no API changes required.

What 2.0.0 Actually Means

Lex 2.0.0 is not "feature complete." It's something more useful:

The parts that runners and agents depend on are now stable. You can build on this without the ground shifting.

Stable means:

  • Frame v3 schema will not break in 2.x
  • AXError shape will not change in 2.x
  • FrameStore 1.0.0 interface is frozen in 2.x
  • AX guarantees will not regress in 2.x

Not frozen:

  • New CLI commands (additive)
  • New MCP tools (additive)
  • Performance improvements (transparent)
  • AX improvements (non-breaking)

The contract surface is frozen. The implementation can still improve.

What the Future Holds

From 2.0.0 forward, the work is AX improvement:

Near-term (2.x)

  • More CLI commands get --json output
  • More MCP tools return structured errors
  • AX documentation expands with real-world examples
  • Performance profiling and optimization
  • LexSona integration deepens (offline-capable personas)

Mid-term (3.x)

  • Frame v4 schema (additive, non-breaking adoption path)
  • AX v0.2 guarantees (stricter, more comprehensive)
  • Multi-repo Frame federation (experimental)
  • Advanced recall features (semantic search, time-weighted decay)

Long-term (4.x and beyond)

  • Frame streaming for real-time agent workflows
  • Distributed FrameStore backends (PostgreSQL, etc.)
  • AX v1.0 specification (fully mature)
  • Cross-runner Frame format standardization

None of this requires breaking the 2.0.0 contracts. That's the point.

On npm as @smartergpt/lex

Lex 2.0.0 is published to npm and ready for production use:

npm install @smartergpt/lex@latest

Package details:

  • Version: 2.0.0
  • License: MIT
  • Node: ≥20, <23
  • Published: December 6, 2025

Subpath exports:

  • @smartergpt/lex — Core types + store API
  • @smartergpt/lex/errors — AXError schema and utilities
  • @smartergpt/lex/lexsona — Behavioral memory socket
  • @smartergpt/lex/policy — Policy loading and validation
  • @smartergpt/lex/atlas — Atlas Frame generation
  • ...and 9 more (see GitHub README)

All exports are TypeScript-first with full type definitions.

The Integration Ecosystem

Lex 2.0.0 is designed to be consumed by multiple tools:

LexSona (Private, v0.2.0)

  • Offline-capable persona modes
  • Behavioral memory integration via @smartergpt/lex/lexsona
  • Confidence ceiling enforcement when offline
  • Consumes Lex behavioral socket for rule storage

LexRunner (Private, v0.5.0)

  • Built on Lex 2.0.0 contracts
  • Governance hardening complete
  • Capability tier routing, turn cost tracking
  • Disciplined failure patterns, environmental hostility scoring

Your Tools (Future)

  • Any runner can target the Lex contract surface
  • See docs/CONTRACT_SURFACE.md for requirements
  • Reference implementation: LexRunner (patterns, not prescriptions)

Lex is MIT-licensed infrastructure. Build what you need on top.

The Throughline

The throughline remains unchanged from day one:

Work continuity with receipts, not vibes.

Lex 2.0.0 is the moment we can say, with receipts, that the contracts behind those receipts are production-ready.

All contracts are live and binding.

Ready to build on Lex 2.0.0?

Install from npm, read the contracts, and start building with AX guarantees.

The 1.0.0 Story

How Lex went from 0.4.6-alpha to 1.0.0: boundary work and contract stabilization.

Read the 1.0.0 story →

AX Contract v0.1

The technical specification for Agent eXperience guarantees in Lex 2.0.0.

Read the contract →

Contract Surface

What runners and tools must understand to be Lex-compatible.

Read the surface →