AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.
Rust agent-memoryai-agentsbm25claude-codeclicode-searchcursordatabaseelasticsearchfull-text-searchhybrid-searchjsonllocal-firstmcpmcp-servermodel-context-protocolragrustsearch-enginevector-search
Merge remote-tracking branch 'origin/main' into feat/issue-977-xccode-in-binary
xerj-orgc6bcf3eac4e9
diff --cc CHANGELOG.mdindex c5801357e,916b8ee20..285bfbc5f--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -7,52 -7,26 +7,72 @@@ and this project adheres to [Semantic V## [Unreleased]+### Added++- **`xerj code` and `xerj corpus add|index|list` — the reference-coding loop+ is in the binary ([#977](https://github.com/xerj-org/xerj/issues/977)).**+ `xerj code <corpus> "<query>"` retrieves the matching definition from a+ locally indexed corpus of peer projects (`-k`, `--lang`, `--mode+ bm25|semantic|hybrid`, `--full`, `--no-symbol`, `--meatl`, `--json`,+ `--stale-ok`, `--url`, `--api-key`), keeping the wrapper scripts' exit+ triangle: `0` hits, `1` no-match (including `--json` with empty hits),+ `2` usage/transport/30-day-staleness refusal, `3` corpus-in-ledger-but-not-+ loaded-on-this-node. `xerj corpus add` clones (or rebuilds from a pinned+ manifest via `--from`, preserving `review` blocks), detects licences with+ the restrictive-first heuristics and warns on approach-only sources;+ `xerj corpus index` is the #930 build-verify-swap (unverified builds are+ removed by exact name, an uncountable old index is never presumed empty,+ state switches by atomic rename only after `_count > 0`); `xerj corpus+ list` shows what is actually loaded on the node. Hybrid retrieval now fuses+ server-side — one native top-level `hybrid` query, RRF `k=60`, aimed at the+ semantic-capable indices, with an arms-ran note on every run. Existing+ `~/.xerj-code` corpora, state files and indexes work unchanged: same layout,+ same `corpus.json` schema, same `xc-<corpus>` namespaces. The `xerj_code_search`+ MCP tool (the 11th) exposes the same pipeline to shell-less agents, with+ `licence_policy: "strict"` stripping passage text from restricted-licence+ hits. No `python3`/`curl` dependency remains; `git` still is one (for+ `xerj corpus add`). Semantics live in the new `xerj-common::xccode` pure+ core, shared byte-for-byte by the CLI prose and the MCP tool text.++### Removed++- `tools/xerj-code/scripts/{xc.py,xc-index.sh,xc-corpus.sh}` and their+ Python/shell test suites. Most behaviour is ported and gated by scoped cargo+ tests (`xerj-common::xccode`, `xerj-autoindex::xc`, the MCP schema drift+ test); the `--fresh` swap contract — the destructive side of+ `xerj corpus index --fresh` — is re-pinned in `xerj-autoindex/src/xc.rs` as+ ten contract tests running the REAL flow against a fake node and a fake+ autoindex runner behind injected seams+ ([#1004](https://github.com/xerj-org/xerj/issues/1004)): switch-readers-+ before-retiring, deletes by exact name only, a failed or empty build leaving+ the old index untouched, a count the node never answered authorising no+ delete and no switch, sibling corpora never touched, first-build salvage,+ resume under the recorded prefix and state dir, build-id collisions inside+ one second, and the legacy no-ledger path. The deliberate+ drops are the post-query field-report nudge (2026-09-18 llms.txt directive:+ no obligation language) and per-hit hybrid arm annotations (server-side RRF+ exposes no per-leg ranks).++ ### Fixed++ - **The Second Brain dashboard and the reader's graph panel are no longer 401+ for a signed-in operator on an auth-enabled engine (the default).** The+ console holds a passkey session, not an engine API key, so the SPA's direct+ `/_graph/{brain}/*`, `_cat/indices/.xerj-memory-*` and reserved-namespace+ `_search` reads were refused — while a share-link guest, who holds a key,+ could read the graph. The console now serves its own brain-scoped,+ session-authorized graph read path+ (`GET /_xerj-console/api/v1/graph/brains`, `/{brain}/ego`, `/{brain}/overview`,+ `POST /{brain}/edges/_search`, `POST /{brain}/nodes/_search`) in the same+ `xerj-second-brain/1` contract as the data plane: console roles `owner` and+ `admin` may read brains, a role-refused read and a nonexistent brain are+ byte-identical 404s (no existence oracle), and the nodes/edges searches are+ pinned server-side to the brain's own meta-doc indices, so the endpoints+ cannot become a general search proxy and the generic data-sources proxy+ still refuses the reserved namespace. `/v1/metrics` (the dashboard's+ searches-per-index tile) stays key-only by decision; the tile shows the+ refusal honestly. [#936](https://github.com/xerj-org/xerj/issues/936)+## [1.0.0-rc.75] - 2026-09-20### Added