Repertoire Integration (v3.3+)
Repertoire is preferred. Repertoire (@0xray/repertoire@0.2.9 vendored) is the long-term judgment organ. It matches named laws and enriches orchestrator routing through the MemoryRoutingProvider contract. Wear it. Do not treat Station as a substitute.
Not the successor card. Survive compact / host change is Station (Read .xray/state/STATION.md). 0.1.0–0.1.8 were the same judgment organ; 0.2 cut the factory seed to 8 names. Do not pin 0.1.8. Split: Station vs Repertoire 0.1.
When to use Repertoire
| Scenario | Surface |
|---|---|
| 0xRay orchestrator in-process (ExecutionPlanner, thinDispatch) | features.json → memory_routing |
| External LLM host (Hermes, Grok, OpenCode MCP) | repertoire-mcp stdio server |
| Ad-hoc signal queries / ingest pipeline | Repertoire CLI (npm run query, pipeline) |
Setup
0xray vendors @0xray/repertoire@0.2.9. Fresh npm install 0xray ships memory_routing.enabled: true. Preferred on. Explicit opt-out only: enabled: false with provider: "repertoire". Station then holds the compact ticket — that is fallback, not the preferred brain. This is not an 8th 0xRay MCP.
Shipped xray/features.json:
"memory_routing": {
"enabled": true,
"provider": "repertoire",
"module_path": "node_modules/@0xray/repertoire/dist/provider/memory-routing-provider.js",
"config": {
"signalsPath": ".xray/state/repertoire/curated_signals.json",
"statePath": ".xray/state/repertoire/inference-state.json",
"feedbackDir": ".xray/state/repertoire/feedback"
}
}
Optional sibling (framework monorepo only):
git clone https://github.com/0xRayAI/repertoire ../repertoire
cd ../repertoire && npm install && npm run build
Grok session-start writes a one-line repertoireResume into .xray/state/session-boot.json (signal count when the registry is readable). Leftover default-off also resolves at runtime in loadMemoryRoutingProvider / getMemoryRoutingConfig when the module is on disk — ExecutionPlanner and thinDispatch then use Repertoire without a features rewrite. Station heat persists working state (not Bedrock primitives) to .xray/state/repertoire-working.json and a Working: line on STATION.md. Compact may ingestFeedback for non-Bedrock matches. Explicit opt-out remains enabled: false + provider: "repertoire".
features.json fields (memory_routing)
Validated by xray/features.schema.json at load time:
| Field | Required | Values | Description |
|---|---|---|---|
enabled | yes | true / false | Master switch |
provider | yes | null, repertoire, custom | Provider kind |
module_path | when enabled + repertoire/custom | path string | ESM module exporting createMemoryRoutingProvider() |
config | optional | object | Passed to provider factory |
Repertoire config keys
| Key | Default | Description |
|---|---|---|
dataDir | package data/ (vendored 0.2) | Registry + inference state root |
signalsPath | .xray/state/repertoire/curated_signals.json | Project-local registry (factory + stack laws). Dest is named invariants, not hangar repo-* or git slugs. |
statePath | data/inference-state.json | Idempotent ingest cursor |
logDir | logs/groover-inference | Enriched JSONL log directory |
Paths resolve relative to the 0xRay package root unless absolute.
What Repertoire enriches in 0xRay
ExecutionPlanner (v3.3.1 confidence gate)
When getTaskConfidence() is available on the provider:
calculateTaskComplexity()addscomplexityBoostfrom matched signals- Trap tasks (
ontological-trap, high-confidence primitives) get higher complexity scores selectAgent()receives trap hints viaTYPE: ontological-trapin operation textenrichTasks()attachesmemorySignals,memorySignalConfidences,memoryComplexityBoostto task metadata
thinDispatch
resolveThinDispatch()may override tier-default agent (e.g. →architectwhenhighConfidenceTrapPresentand score ≥ 26)provenance-failuretag can route tobug-triage-specialist
Researcher (analyze_proposal)
Module: src/mcps/researcher-confidence.ts
- Triggers on trap language or high-confidence primitive matches
- Calls
getTaskConfidence()viaMemoryRoutingProvider - Appends auditable
MEMORY_ROUTING:block to governance output
Feedback loop
Per-task ingestFeedback() (v3.3 — not aggregate-only) records orchestrator outcomes back to Repertoire.
MemoryRoutingProvider contract
Custom providers export createMemoryRoutingProvider(config) implementing:
| Method | Pipeline stage |
|---|---|
buildRoutingContext(operation) | Signal/tag matching |
enhanceAgentCapabilities(map) | Agent capability enrichment |
enrichTasks(tasks) | Pre-planning metadata |
buildInheritedContext(tasks) | → ExecutionPlan.memoryContext → AsideContext inheritedContext.memoryRouting |
selectAgent(...) | ExecutionPlanner assignment |
resolveThinDispatch(...) | thinDispatch score + override |
getTaskConfidence?(task) | Confidence gate (v3.3.1) |
ingestFeedback?(entry) | Per-task learning loop |
See src/memory-routing/types.ts and Repertoire's docs/MEMORY-ROUTING-PROVIDER.md.
Repertoire MCP server (external hosts)
Not an 8th 0xRay server. Wear adds a repertoire extra when the module resolves (Hermes / OpenCode / OpenClaw / project .mcp.json / Grok .grok/config.toml).
Server tools are unprefixed so Grok TUI can register them (server__tool → repertoire__get_task_confidence). Hermes/OpenCode see the unprefixed names.
"repertoire": {
"command": "node",
"args": ["node_modules/@0xray/repertoire/dist/mcp/server.js"]
}
In-repo launcher (cwd-proof): scripts/mjs/run-repertoire-mcp.mjs.
MCP tools
| Server name | Grok TUI name | Purpose |
|---|---|---|
get_high_confidence_signals | repertoire__get_high_confidence_signals | List signals above threshold |
get_task_confidence | repertoire__get_task_confidence | Full confidence context for a task |
search_primitives | repertoire__search_primitives | Text search against registry |
ingest_feedback | repertoire__ingest_feedback | Record orchestrator outcome |
In-process orchestrator code uses getMemoryRoutingProviderSync().
Repertoire CLI
cd repertoire
npm run ingest -- --source /path/to/groover/logs
npm run pipeline # ingest + meta-inference
npm run query # ad-hoc confidence query
npm run test:e2e # enriched loop regression
npm run test:mcp # stdio MCP smoke
Data model (summary)
| Artifact | Role |
|---|---|
data/curated_signals.json | Primitive registry with observation_stats |
data/inference-state.json | Ingest idempotency cursor |
logs/groover-inference/*.jsonl | Enriched entries (strict enriched-only ingest) |
Confidence values come from observation_stats or explicit task metadata — no text-score fallbacks.
Lessons, mint, and caps
A passing grade appends one lesson on the named law and stores that line beside the average. The same task id does not step again.
| Cap | Value | What leaves |
|---|---|---|
LESSON_LINE_CAP | 20 | Oldest lesson text, only after its task id is in the ledger |
RETAINED_LESSON_ID_CAP | 20 | Oldest id, insertion order (not alphabetical) |
LEARNED_SIGNAL_CAP | 24 | Only proposed signals tagged learned (lowest confidence, then oldest last_seen) |
Speech that names no stored signal mints one proposed signal tagged learned. The same speech does not mint twice. Factory signals are not eviction candidates.
A plate is the machine schematic (Plates). The npm package ships docs-site/docs/plates/. Station keeps one pointer line for the plate intent names. Pre-compact and MEMORY_ROUTING inject that one schematic.
Testing
0xRay framework repo:
npm test -- src/__tests__/unit/memory-routing-integration.test.ts
npm test -- src/__tests__/unit/memory-routing-provider.test.ts
npm test -- src/__tests__/unit/researcher-confidence.test.ts
npm test -- src/__tests__/unit/researcher-repertoire-wiring.test.ts
Related
- Memory Routing — provider plug-in model
- Features Since 3.1 — full changelog of capabilities
- features.json Reference
- Platform Integrations