# v6.0.0 — Code Mode, OAuth 2.1, FTS5, and Architecture Overhaul

> **Breaking Changes**: WASM SQLite fallback removed (`--sqlite-wasm`/`--sqlite-native` flags gone). CORS config changed from `corsOrigin: string` to `corsOrigins: string[]`.

## Highlights

### 🧠 Code Mode (`mj_execute_code`)

Sandboxed JavaScript execution for multi-step workflows with 70-90% token reduction. Worker-thread isolation with V8 boundary, `mj.*` namespaced API across all 44 tools (10 groups), positional args, method aliases, and per-group `help()`. Resource limits: 50KB code, 30s timeout, 128MB memory, 60 exec/min.

### 🔐 OAuth 2.1 Authentication

Full RFC-compliant OAuth 2.0 auth for HTTP transport. JWT validation via `jose`, JWKS caching, 3 scopes (`read`/`write`/`admin`) mapped to 10 tool groups. RFC 9728 Protected Resource Metadata endpoint.

### 🔍 FTS5 Full-Text Search

Replaced `LIKE '%query%'` with SQLite FTS5. BM25 ranking, phrase queries, prefix matching, boolean operators. Content-sync mode (no duplicate storage), Porter stemmer, auto-populated on migration.

### 📊 Configurable Briefing

15 new env vars / CLI flags to customize `memory://briefing`: entry counts, team inclusion, issue/PR listing depth, workflow runs, Copilot review aggregation, rules file, skills dir.

### 🏗️ Architecture

- **sqlite-vec** replaces vectra for vector search (86 fewer dependencies)
- **tsup** replaces tsc (875 KB → 455 KB dist, ~48% reduction)
- **Modularized** SQLite adapter, GitHub integration, HTTP transport, briefing resources
- **Harmonized error types** with `MemoryJournalMcpError` base class (9 categories, 6 subclasses)
- **Built-in rate limiting** replaces `express-rate-limit`

### 🧪 Testing

- Unit coverage: 73% → 87% (320+ new tests across 10 files)
- E2E: 71 → 105 tests (8 new Playwright specs)
- 10 rounds of code quality audit fixes
- 4 rounds of performance audit fixes

### 🔒 Security

- 6 CVEs patched via `undici` 7.24.1
- DNS rebinding protection, server timeouts, HSTS config
- SHA-pinned all GitHub Actions across 6 workflows

[Full Changelog](https://github.com/neverinfamous/memory-journal-mcp/blob/main/CHANGELOG.md#600---2026-03-14)

```bash
npm install -g memory-journal-mcp
```
