# Release v7.6.0

## Highlights

- **Production-grade Sandbox:** Replaced the legacy `vm` sandbox mode with a secure `worker_threads` implementation for `mj_execute_code`, complete with dynamic payload limits.
- **Enhanced Caching & Performance:** Introduced true O(1) LRU eviction, robust `Map` caching layers, and decoupled server initialization from database queries to ensure constant-time startup.
- **Strict Isolation & Security:** Enforced strict IP-binding session isolation for Bearer-Token Auth Mode, fail-closed capability checks, and atomic transaction boundaries.
- **Multi-Project Workspace Support:** Refined `PROJECT_REGISTRY` validation and absolute path canonicalization alongside `ALLOWED_IO_ROOTS` verification.
- **Background Indexing:** Moved FTS5 and ML vector semantic indexing to asynchronous background tasks, preventing bottlenecks during rebuilds and massive soft deletes.

## Added

- Explicit HTTP service-level `curl` container health-checks to `docker-compose.yml`.
- True O(1) LRU eviction (using `Map.prototype.keys().next()`) to rate-limiting and user tracking maps.
- A `Map` caching layer tied to the local workspace path to minimize redundant OctoKit and Git instantiations.
- Added a 24-hour absolute TTL limit to streamable HTTP sessions.

## Changed

- **Dependencies:** Bumped `node` (Docker) to `24.15.0-alpine`, `eslint` to `10.2.1`, `typescript` to `6.0.3`, `vitest` to `4.1.5`, and updated multiple GitHub Actions.
- Replaced eager memory-bound directory reads with asynchronous `opendir` streaming in the markdown importer to prevent process OOM.
- Replicated strict 5MB payload truncation limits to `team_export_entries` for consistent memory bounds.
- Enforced strict IP-binding session isolation for Bearer-Token Auth Mode.
- Implemented an asynchronous decoupled outbox pattern for GitHub mutations, preventing rollback deletions upon external API errors.
- Enforced atomic transaction boundaries and synchronized FTS5/vector indexing during massive rebuilds and soft deletes.
- Decoupled server initialization from database queries to guarantee constant-time startup.
- Hoisted execution-invariant server state to bypass redundant cycles during client connections.
- Optimized database searches by replacing correlated subqueries with batched, in-memory aggregate lookup tables and CTEs.
- Replaced the legacy `vm` sandbox mode with production-grade `worker_threads` isolation.
- Decoupled `create_entry` workflow to safely update personal and team databases synchronously.
- Reduced `OVERFETCH_MULTIPLIER` in hybrid search from 3 to 2 to improve performance.

## Deprecated

- `autoContext` field across the memory journal ecosystem.
- Core `.getRawDb()` and execution mechanisms (now marked `@internal`).

## Fixed

- Restored project test coverage above 90% by adding targeted unit tests.
- Fixed multi-project repository fallback failures for naked resource URIs.
- OutputSchema compliance bugs in `create_github_issue_with_entry` and other GitHub lifecycle tools.
- N+1 query performance bottlenecks during team semantic search and Markdown exports.
- `significantResource` compute overhead by precomputing entry timestamps.
- Re-implemented legacy SSE transport to enforce `MAX_STATEFUL_SESSIONS` boundaries.
- Concurrency-related SQLite lock exhaustion failures by standardizing sequential long-running task locks.
- Memory leak in `CodeModeSecurityManager` by adding explicit `dispose()` cleanup for bounded intervals.
- Backup restore race conditions, stale deadlocks, and SQLite lock swap failures on Windows.
- Silent error suppression by ensuring warnings propagate to `stderr`.
- Code Mode test regressions where `flagMetadata` was omitted for Hush Protocol flags.
- Prompt handler failures now surfacing as proper MCP protocol errors.
- Team semantic search omitting cross-project vectors by enforcing `project_number` filtering before truncations.
- Enforced hard exceptions on SQLite WAL checkpoint failures to prevent incomplete backups.
- Graceful handling of post-commit lookup failures in `createEntry` via synthesized returns.
- Bounded uncontrolled GitHub API Promise fan-out within `BriefingGitHub` fetches using sequential chunking.
- Path traversal boundary errors in `memory://rules` and `memory://skills` resource handlers.
- Context resolution and project metadata propagation bugs inside Code Mode sandboxes.

## Security

- Updated `hono` to `4.12.14` to resolve a medium severity vulnerability.
- Limited FTS5 query tokens to 500 characters to prevent ReDoS and AST bloat.
- Enforced per-invocation `randomUUID()` for `mj_execute_code` client IDs to isolate unauthenticated `stdio` callers.
- Replaced insecure `JSON.parse()` with Zod `AutoContextSchema` validations in team/briefing resources.
- Enforced strict tool-to-scope verification during server initialization.
- Required explicit `allowedIoRoots` for I/O operations instead of falling back to `PROJECT_REGISTRY`.
- Capped IP `rateLimitMap` and `userCounts` map to 10,000 keys to prevent OOM attacks.
- Shielded SQLite backup restorations with strict `path.resolve` boundary validations against symlink traversals.
- Enforced post-restore schema validation using `PRAGMA integrity_check` before applying backups.
- Modified `TokenValidator` to fail-closed on misconfigured JWKS origin or Issuer metadata.
- Required `SCOPES.TEAM` (instead of generic `WRITE`) for team operations.
- Rejected claimed authorship (author injection) in team tools outside an authenticated OAuth scope.
- Routed internal Code Mode tool calls through `callTool()` to enforce OAuth scope checks and audits.
- Refused wildcard CORS (`*`) without explicit authentication.
- Prevented path traversal and symlink escapes in markdown importer/exporter via `fs.realpath` and `fs.lstat`.
- Mitigated directory TOCTOU symlink attacks in markdown exports via post-open inode validation.
- Enforced LLM Content Provenance rules with `<untrusted_remote_content>` wrappers for remote content.
- Mitigated SSRF DNS rebinding in OAuth metadata discovery by replacing `fetch` with pinned `node:https`.
- Parameterized `strftime` format strings in timeline queries to eliminate SQL interpolation risks.
- Closed TOCTOU race condition in `audit-logger.ts` recent log queries.
- Refactored FTS5 tokenization to an explicit allowlist, neutralizing ReDoS vectors on structural keywords.
- Eliminated unbounded GraphQL query fanout in GitHub tools by enforcing explicit API fetch limits.
- Explicitly gated the Code Mode sandbox execution behind an `admin` OAuth scope.
- Prevented memory exhaustion (DoS) by adding strict boundary length protections to tags and relationships.

---

**Full Changelog**: https://github.com/neverinfamous/memory-journal-mcp/compare/v7.5.0...v7.6.0

**Install/Update**:
\`\`\`bash
npm update memory-journal-mcp
\`\`\`
