# v6.1.0 — Team Parity, Dynamic Help, Code Mode Auto-Return

## Highlights

- **Team Tools Parity** → 17 new team tools (3 → 20) with full feature parity including vector search, relationships, export, and cross-project insights
- **Dynamic Help Resources** → `memory://help` and `memory://help/{group}` auto-generated from live tool definitions — zero maintenance overhead
- **Code Mode Auto-Return** → Bare expressions like `mj.help()` now correctly return values (REPL semantics)
- **OAuth Scope Enforcement** → Per-tool HTTP-level scope gating now active (read/write/admin)
- **46 New E2E Tests** → Template resources, Code Mode API, error contracts, tool filtering, OAuth scopes

## Added

- 17 new team tools: CRUD, search, stats, relationships, export, backup, vector search, cross-project insights
- `memory://rules`, `memory://workflows`, `memory://skills` resources with caching
- Dynamic `memory://help` and `memory://help/{group}` runtime-generated tool reference
- Error auto-refinement and `structuredContent` on error responses
- Query helpers (`coerceNumber`, `coerceBoolean`, `coerceLimit`) and resource annotation presets
- Per-tool OAuth scope enforcement middleware
- Tool invariant tests (annotations, output schemas, titles)
- Test coverage → 96.21% with Code Mode coverage mock

## Changed

- Server instructions refactored: ~55% reduction, ~33% token savings, filter-aware sections
- `essential` and `starter` shortcuts now include `codemode`
- `memory://significant` batched importance (eliminates N+1 queries)
- npm publish gated behind Docker Scout checks
- Version SSoT via `src/version.ts`
- `relaxedNumber()` upgraded from `z.any()` to `z.union([z.number(), z.string()])`
- Compact JSON for tool responses (~15-20% payload reduction)
- 27 npm dependency updates, 0 vulnerabilities

## Fixed

- Code Mode auto-return for bare expressions (CM-1)
- FTS5 phrase search with porter stemmer (rewrites quoted phrases to AND-joined terms)
- Sandbox readonly `TypeError` → structured error proxy
- `search_entries` filter regressions (pr_status, workflow_run_id)
- `link_entries` self-loop prevention + directional-only duplicate detection
- `team_get_cross_project_insights` scaling trap (SQLite 999 binding limit)
- 27 ad-hoc error responses standardized across all handler files
- `restore_backup(confirm: false)` raw MCP error leak
- FTS5 ghost entry cleanup on startup
- `team_export_entries` filter-then-limit ordering

## Security

- SLSA Build L3 attestation (`--provenance` on npm publish)
- CodeQL `security-extended,security-and-quality` query sets
- CI action SHA pinning (codeql-action v4.33.0, gh-aw v0.58.3, upload-artifact v7)
- `.gitleaks.toml` and `.trivyignore` configuration
- `flatted` 3.4.2 prototype pollution resolved

## Tests

- 46 new E2E tests across 5 spec files (templates, Code Mode API, error contracts, tool filtering, OAuth scopes)

---

**Compare**: [`v6.0.1...v6.1.0`](https://github.com/neverinfamous/memory-journal-mcp/compare/v6.0.1...v6.1.0)

**Install**:

```bash
npm install -g memory-journal-mcp@6.1.0
# or
docker pull writenotenow/memory-journal-mcp:v6.1.0
```
